ooxml-core 1.8.3 → 1.9.0

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 (308) hide show
  1. package/dist/PptxHandler-AT7FVG5Q.mjs +2 -0
  2. package/dist/{PptxHandler-BL4B7CZO.mjs → PptxHandler-EX4WBIQQ.mjs} +2 -2
  3. package/dist/PptxHandler-VFSCECPL.cjs +11 -0
  4. package/dist/automation/index.cjs +7380 -4682
  5. package/dist/automation/index.mjs +7380 -4682
  6. package/dist/chunk-AT66SA5M.cjs +44423 -0
  7. package/dist/{chunk-TTPZITQN.mjs → chunk-FIELY5PI.mjs} +1 -1
  8. package/dist/{chunk-ZAP5WLEN.mjs → chunk-IGOA57LE.mjs} +1 -1
  9. package/dist/chunk-LCS3J3QI.mjs +87604 -0
  10. package/dist/{chunk-NIHPA63A.mjs → chunk-M76PHYRR.mjs} +54 -37
  11. package/dist/chunk-OB277ZGE.mjs +44107 -0
  12. package/dist/{chunk-GAGSCAR3.mjs → chunk-OXHMZS7B.mjs} +552 -178
  13. package/dist/chunk-SWF7KVL5.cjs +87610 -0
  14. package/dist/{chunk-Z7IQR4S4.mjs → chunk-WSO4T2LJ.mjs} +246 -21
  15. package/dist/docx/block-parser.d.ts.map +1 -1
  16. package/dist/docx/cell-blocks.d.ts +4 -0
  17. package/dist/docx/cell-blocks.d.ts.map +1 -0
  18. package/dist/docx/document-paragraphs.d.ts.map +1 -1
  19. package/dist/docx/document-parts.d.ts +2 -0
  20. package/dist/docx/document-parts.d.ts.map +1 -1
  21. package/dist/docx/embedded.cjs +189 -20
  22. package/dist/docx/embedded.mjs +189 -20
  23. package/dist/docx/index.cjs +219 -24
  24. package/dist/docx/index.mjs +219 -24
  25. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  26. package/dist/docx/layout/adapter.d.ts.map +1 -1
  27. package/dist/docx/layout/flow-paragraph.d.ts +5 -0
  28. package/dist/docx/layout/flow-paragraph.d.ts.map +1 -1
  29. package/dist/docx/layout/flow-table.d.ts +2 -1
  30. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  31. package/dist/docx/layout/footnote-columns.d.ts +22 -0
  32. package/dist/docx/layout/footnote-columns.d.ts.map +1 -0
  33. package/dist/docx/layout/footnote-flow.d.ts +27 -0
  34. package/dist/docx/layout/footnote-flow.d.ts.map +1 -0
  35. package/dist/docx/layout/footnote-split.d.ts +7 -0
  36. package/dist/docx/layout/footnote-split.d.ts.map +1 -0
  37. package/dist/docx/layout/index.cjs +1099 -92
  38. package/dist/docx/layout/index.mjs +1099 -92
  39. package/dist/docx/layout/input.d.ts +17 -1
  40. package/dist/docx/layout/input.d.ts.map +1 -1
  41. package/dist/docx/layout/legacy-footnote-flow.d.ts +18 -0
  42. package/dist/docx/layout/legacy-footnote-flow.d.ts.map +1 -0
  43. package/dist/docx/layout/line-metrics.d.ts.map +1 -1
  44. package/dist/docx/layout/page-cursor.d.ts +13 -8
  45. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  46. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  47. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  48. package/dist/docx/layout/paragraph-tokens.d.ts +2 -0
  49. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  50. package/dist/docx/layout/reference-footnotes.d.ts +7 -0
  51. package/dist/docx/layout/reference-footnotes.d.ts.map +1 -0
  52. package/dist/docx/layout/result.d.ts +31 -0
  53. package/dist/docx/layout/result.d.ts.map +1 -1
  54. package/dist/docx/layout/section-flow.d.ts +2 -0
  55. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  56. package/dist/docx/layout/table-cell-layout.d.ts +11 -0
  57. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -0
  58. package/dist/docx/layout/table-footnotes.d.ts +27 -0
  59. package/dist/docx/layout/table-footnotes.d.ts.map +1 -0
  60. package/dist/docx/layout/table-layout.d.ts +10 -4
  61. package/dist/docx/layout/table-layout.d.ts.map +1 -1
  62. package/dist/docx/load/index.cjs +194 -25
  63. package/dist/docx/load/index.mjs +194 -25
  64. package/dist/docx/model-run.d.ts +2 -0
  65. package/dist/docx/model-run.d.ts.map +1 -1
  66. package/dist/docx/model.d.ts +7 -0
  67. package/dist/docx/model.d.ts.map +1 -1
  68. package/dist/docx/notes.d.ts +5 -0
  69. package/dist/docx/notes.d.ts.map +1 -1
  70. package/dist/docx/parse-table.d.ts.map +1 -1
  71. package/dist/docx/parse.d.ts.map +1 -1
  72. package/dist/docx/save.d.ts.map +1 -1
  73. package/dist/docx/section-model.d.ts +2 -0
  74. package/dist/docx/section-model.d.ts.map +1 -1
  75. package/dist/docx/sections.d.ts.map +1 -1
  76. package/dist/docx/settings.d.ts +2 -0
  77. package/dist/docx/settings.d.ts.map +1 -1
  78. package/dist/docx/table-model.d.ts +3 -1
  79. package/dist/docx/table-model.d.ts.map +1 -1
  80. package/dist/docx/ui/index.cjs +55 -0
  81. package/dist/docx/ui/index.d.ts +1 -0
  82. package/dist/docx/ui/index.d.ts.map +1 -1
  83. package/dist/docx/ui/index.mjs +55 -1
  84. package/dist/docx/ui/table-structure-guard.d.ts +4 -0
  85. package/dist/docx/ui/table-structure-guard.d.ts.map +1 -0
  86. package/dist/docx/write-footnote-columns.d.ts +3 -0
  87. package/dist/docx/write-footnote-columns.d.ts.map +1 -0
  88. package/dist/docx/write-notes.d.ts.map +1 -1
  89. package/dist/docx/write-run.d.ts.map +1 -1
  90. package/dist/docx/write-sections.d.ts.map +1 -1
  91. package/dist/index.cjs +8 -5
  92. package/dist/index.mjs +8 -5
  93. package/dist/opc/clone-part-graph.d.ts +4 -0
  94. package/dist/opc/clone-part-graph.d.ts.map +1 -1
  95. package/dist/opc/index.cjs +8 -5
  96. package/dist/opc/index.mjs +8 -5
  97. package/dist/pptx/automation/index.cjs +621 -207
  98. package/dist/pptx/automation/index.d.ts +3 -3
  99. package/dist/pptx/automation/index.mjs +5 -5
  100. package/dist/pptx/chunks/{index-Cn-GzYGp.d.ts → index-B4cnSPNz.d.ts} +33 -4
  101. package/dist/pptx/chunks/index-B4cnSPNz.d.ts.map +1 -0
  102. package/dist/pptx/chunks/{index-CKIUurnd.d.ts → index-BZh-IMkN.d.ts} +14 -9
  103. package/dist/pptx/chunks/{index-CKIUurnd.d.ts.map → index-BZh-IMkN.d.ts.map} +1 -1
  104. package/dist/pptx/chunks/{text-operations-BHfAm5K9.d.ts → text-operations-BLodkuXE.d.ts} +29 -12
  105. package/dist/pptx/chunks/text-operations-BLodkuXE.d.ts.map +1 -0
  106. package/dist/pptx/cli/index.cjs +622 -213
  107. package/dist/pptx/cli/index.d.ts +1 -1
  108. package/dist/pptx/cli/index.mjs +4 -4
  109. package/dist/pptx/converter/index.cjs +53 -36
  110. package/dist/pptx/converter/index.d.ts +1 -1
  111. package/dist/pptx/converter/index.mjs +2 -2
  112. package/dist/pptx/editor/render/find-replace.cjs +416 -45
  113. package/dist/pptx/editor/render/find-replace.d.ts +35 -4
  114. package/dist/pptx/editor/render/find-replace.d.ts.map +1 -1
  115. package/dist/pptx/editor/render/find-replace.mjs +416 -46
  116. package/dist/pptx/editor/render/slide-operations.cjs +87 -0
  117. package/dist/pptx/editor/render/slide-operations.d.ts +17 -1
  118. package/dist/pptx/editor/render/slide-operations.d.ts.map +1 -1
  119. package/dist/pptx/editor/render/slide-operations.mjs +83 -1
  120. package/dist/pptx/editor/render/slide-search.cjs +6 -10
  121. package/dist/pptx/editor/render/slide-search.d.ts +1 -1
  122. package/dist/pptx/editor/render/slide-search.mjs +6 -10
  123. package/dist/pptx/editor/render/template-editing.d.ts +1 -1
  124. package/dist/pptx/editor/render/template-editing.d.ts.map +1 -1
  125. package/dist/pptx/index.cjs +889 -237
  126. package/dist/pptx/index.d.ts +4 -4
  127. package/dist/pptx/index.mjs +5 -5
  128. package/dist/teams/index.cjs +672 -37
  129. package/dist/teams/index.mjs +672 -37
  130. package/dist/visio/accessibility.d.ts +10 -0
  131. package/dist/visio/accessibility.d.ts.map +1 -0
  132. package/dist/visio/cell-formula.d.ts +2 -0
  133. package/dist/visio/cell-formula.d.ts.map +1 -1
  134. package/dist/visio/connector-curve-aligned.d.ts +5 -0
  135. package/dist/visio/connector-curve-aligned.d.ts.map +1 -0
  136. package/dist/visio/connector-curve-spans.d.ts +14 -0
  137. package/dist/visio/connector-curve-spans.d.ts.map +1 -0
  138. package/dist/visio/connector-jumps.d.ts +5 -0
  139. package/dist/visio/connector-jumps.d.ts.map +1 -0
  140. package/dist/visio/connector-route-walk.d.ts +2 -1
  141. package/dist/visio/connector-route-walk.d.ts.map +1 -1
  142. package/dist/visio/edit-alt-text-scope.d.ts +5 -0
  143. package/dist/visio/edit-alt-text-scope.d.ts.map +1 -0
  144. package/dist/visio/edit-alt-text.d.ts +3 -0
  145. package/dist/visio/edit-alt-text.d.ts.map +1 -0
  146. package/dist/visio/edit-commands.d.ts +7 -2
  147. package/dist/visio/edit-commands.d.ts.map +1 -1
  148. package/dist/visio/edit-formatting-commands.d.ts +5 -0
  149. package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
  150. package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
  151. package/dist/visio/edit-formatting-scope.d.ts.map +1 -1
  152. package/dist/visio/edit-line-jump-cache.d.ts +4 -0
  153. package/dist/visio/edit-line-jump-cache.d.ts.map +1 -0
  154. package/dist/visio/edit-master-index.d.ts.map +1 -1
  155. package/dist/visio/edit-metadata-commands.d.ts +10 -2
  156. package/dist/visio/edit-metadata-commands.d.ts.map +1 -1
  157. package/dist/visio/edit-metadata.d.ts +3 -1
  158. package/dist/visio/edit-metadata.d.ts.map +1 -1
  159. package/dist/visio/edit-page-alt-text.d.ts +4 -0
  160. package/dist/visio/edit-page-alt-text.d.ts.map +1 -0
  161. package/dist/visio/edit-page-layout.d.ts.map +1 -1
  162. package/dist/visio/edit-page-rename.d.ts.map +1 -1
  163. package/dist/visio/edit-page-setup-commands.d.ts +7 -1
  164. package/dist/visio/edit-page-setup-commands.d.ts.map +1 -1
  165. package/dist/visio/edit-page-size.d.ts.map +1 -1
  166. package/dist/visio/edit-pages.d.ts.map +1 -1
  167. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  168. package/dist/visio/edit-scope.d.ts.map +1 -1
  169. package/dist/visio/edit-shape-create.d.ts.map +1 -1
  170. package/dist/visio/edit-stencil-connector-write.d.ts.map +1 -1
  171. package/dist/visio/edit-style-admission.d.ts.map +1 -1
  172. package/dist/visio/edit-text.d.ts.map +1 -1
  173. package/dist/visio/edit.d.ts +1 -1
  174. package/dist/visio/edit.d.ts.map +1 -1
  175. package/dist/visio/index.cjs +1091 -233
  176. package/dist/visio/index.d.ts +2 -1
  177. package/dist/visio/index.d.ts.map +1 -1
  178. package/dist/visio/index.mjs +1091 -234
  179. package/dist/visio/line-jumps.d.ts +1 -5
  180. package/dist/visio/line-jumps.d.ts.map +1 -1
  181. package/dist/visio/model.d.ts +13 -0
  182. package/dist/visio/model.d.ts.map +1 -1
  183. package/dist/visio/page-layout.d.ts +11 -2
  184. package/dist/visio/page-layout.d.ts.map +1 -1
  185. package/dist/visio/parser.d.ts.map +1 -1
  186. package/dist/visio/shape-metadata.d.ts +6 -0
  187. package/dist/visio/shape-metadata.d.ts.map +1 -1
  188. package/dist/visio/shapes.d.ts.map +1 -1
  189. package/dist/visio/text-field-case.d.ts +2 -0
  190. package/dist/visio/text-field-case.d.ts.map +1 -0
  191. package/dist/visio/text-field-display.d.ts.map +1 -1
  192. package/dist/visio/text-field-numeric.d.ts +4 -0
  193. package/dist/visio/text-field-numeric.d.ts.map +1 -0
  194. package/dist/visio/ui/connector-preview.d.ts +1 -1
  195. package/dist/visio/ui/connector-preview.d.ts.map +1 -1
  196. package/dist/visio/ui/data-graphic-rules.d.ts +2 -0
  197. package/dist/visio/ui/data-graphic-rules.d.ts.map +1 -1
  198. package/dist/visio/ui/data-graphics.d.ts +3 -2
  199. package/dist/visio/ui/data-graphics.d.ts.map +1 -1
  200. package/dist/visio/ui/edit-commands.d.ts.map +1 -1
  201. package/dist/visio/ui/index.cjs +16898 -15855
  202. package/dist/visio/ui/index.mjs +16898 -15856
  203. package/dist/visio/ui/scene-details.d.ts.map +1 -1
  204. package/dist/visio/ui/scene-validation.d.ts.map +1 -1
  205. package/dist/visio/ui/snapshot-scene.d.ts +2 -1
  206. package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
  207. package/dist/visio/xml-attribute-whitespace.d.ts +5 -0
  208. package/dist/visio/xml-attribute-whitespace.d.ts.map +1 -0
  209. package/dist/xlsx/edit/index.d.ts +1 -0
  210. package/dist/xlsx/edit/index.d.ts.map +1 -1
  211. package/dist/xlsx/edit/insert-guard.d.ts.map +1 -1
  212. package/dist/xlsx/edit/merge.d.ts.map +1 -1
  213. package/dist/xlsx/edit/page-breaks.d.ts +5 -0
  214. package/dist/xlsx/edit/page-breaks.d.ts.map +1 -0
  215. package/dist/xlsx/edit/pivots.d.ts +8 -0
  216. package/dist/xlsx/edit/pivots.d.ts.map +1 -0
  217. package/dist/xlsx/edit/print-titles.d.ts +7 -0
  218. package/dist/xlsx/edit/print-titles.d.ts.map +1 -0
  219. package/dist/xlsx/edit/session.d.ts.map +1 -1
  220. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  221. package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -1
  222. package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -1
  223. package/dist/xlsx/edit/sparkline-ranges.d.ts +11 -0
  224. package/dist/xlsx/edit/sparkline-ranges.d.ts.map +1 -0
  225. package/dist/xlsx/edit/sparkline-xml.d.ts +13 -0
  226. package/dist/xlsx/edit/sparkline-xml.d.ts.map +1 -0
  227. package/dist/xlsx/edit/sparklines.d.ts +16 -0
  228. package/dist/xlsx/edit/sparklines.d.ts.map +1 -0
  229. package/dist/xlsx/edit/table-edits.d.ts.map +1 -1
  230. package/dist/xlsx/edit/tables.d.ts.map +1 -1
  231. package/dist/xlsx/edit/types.d.ts +22 -1
  232. package/dist/xlsx/edit/types.d.ts.map +1 -1
  233. package/dist/xlsx/formula/functions/text-regex.d.ts.map +1 -1
  234. package/dist/xlsx/index.cjs +3415 -1374
  235. package/dist/xlsx/index.d.ts +1 -0
  236. package/dist/xlsx/index.d.ts.map +1 -1
  237. package/dist/xlsx/index.mjs +3396 -1375
  238. package/dist/xlsx/layout/cell-view.d.ts +2 -0
  239. package/dist/xlsx/layout/cell-view.d.ts.map +1 -1
  240. package/dist/xlsx/layout/header-footer.d.ts +58 -0
  241. package/dist/xlsx/layout/header-footer.d.ts.map +1 -0
  242. package/dist/xlsx/layout/index.d.ts +5 -0
  243. package/dist/xlsx/layout/index.d.ts.map +1 -1
  244. package/dist/xlsx/layout/print-breaks.d.ts +11 -0
  245. package/dist/xlsx/layout/print-breaks.d.ts.map +1 -0
  246. package/dist/xlsx/layout/print-layout.d.ts +34 -0
  247. package/dist/xlsx/layout/print-layout.d.ts.map +1 -0
  248. package/dist/xlsx/layout/print-merges.d.ts +18 -0
  249. package/dist/xlsx/layout/print-merges.d.ts.map +1 -0
  250. package/dist/xlsx/layout/print-repeat.d.ts +12 -0
  251. package/dist/xlsx/layout/print-repeat.d.ts.map +1 -0
  252. package/dist/xlsx/layout/print-titles.d.ts +20 -0
  253. package/dist/xlsx/layout/print-titles.d.ts.map +1 -0
  254. package/dist/xlsx/layout/sparkline-data.d.ts.map +1 -1
  255. package/dist/xlsx/layout/sparkline-view.d.ts.map +1 -1
  256. package/dist/xlsx/load/index.cjs +7831 -6961
  257. package/dist/xlsx/load/index.mjs +7831 -6961
  258. package/dist/xlsx/model-pivots.d.ts +46 -0
  259. package/dist/xlsx/model-pivots.d.ts.map +1 -0
  260. package/dist/xlsx/model.d.ts +5 -0
  261. package/dist/xlsx/model.d.ts.map +1 -1
  262. package/dist/xlsx/pivot/admission.d.ts +5 -0
  263. package/dist/xlsx/pivot/admission.d.ts.map +1 -0
  264. package/dist/xlsx/pivot/aggregate.d.ts +19 -0
  265. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -0
  266. package/dist/xlsx/pivot/cache-xml.d.ts +9 -0
  267. package/dist/xlsx/pivot/cache-xml.d.ts.map +1 -0
  268. package/dist/xlsx/pivot/data.d.ts +12 -0
  269. package/dist/xlsx/pivot/data.d.ts.map +1 -0
  270. package/dist/xlsx/pivot/hierarchy.d.ts +7 -0
  271. package/dist/xlsx/pivot/hierarchy.d.ts.map +1 -0
  272. package/dist/xlsx/pivot/index.d.ts +3 -0
  273. package/dist/xlsx/pivot/index.d.ts.map +1 -0
  274. package/dist/xlsx/pivot/read.d.ts +5 -0
  275. package/dist/xlsx/pivot/read.d.ts.map +1 -0
  276. package/dist/xlsx/pivot/table-xml.d.ts +5 -0
  277. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -0
  278. package/dist/xlsx/pivot/write.d.ts +11 -0
  279. package/dist/xlsx/pivot/write.d.ts.map +1 -0
  280. package/dist/xlsx/read/load.d.ts.map +1 -1
  281. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  282. package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
  283. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  284. package/dist/xlsx/ui/commands/i18n/pivots.d.ts +3 -0
  285. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -0
  286. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts +3 -0
  287. package/dist/xlsx/ui/commands/i18n/print-layout.d.ts.map +1 -0
  288. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts +3 -0
  289. package/dist/xlsx/ui/commands/i18n/sparklines.d.ts.map +1 -0
  290. package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
  291. package/dist/xlsx/ui/commands/page-breaks.d.ts +3 -0
  292. package/dist/xlsx/ui/commands/page-breaks.d.ts.map +1 -0
  293. package/dist/xlsx/ui/index.cjs +2451 -737
  294. package/dist/xlsx/ui/index.d.ts +1 -0
  295. package/dist/xlsx/ui/index.d.ts.map +1 -1
  296. package/dist/xlsx/ui/index.mjs +2451 -738
  297. package/dist/xlsx/write/chart-cache.d.ts +8 -0
  298. package/dist/xlsx/write/chart-cache.d.ts.map +1 -0
  299. package/dist/xlsx/write/page-setup.d.ts.map +1 -1
  300. package/dist/xlsx/write/save.d.ts.map +1 -1
  301. package/dist/xlsx/write/sheet-parts.d.ts +1 -0
  302. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  303. package/dist/xlsx/write/workbook-part.d.ts +1 -1
  304. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  305. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  306. package/package.json +1 -1
  307. package/dist/pptx/chunks/index-Cn-GzYGp.d.ts.map +0 -1
  308. package/dist/pptx/chunks/text-operations-BHfAm5K9.d.ts.map +0 -1
@@ -27,19 +27,19 @@ var isCellError = (value2) => typeof value2 === "object" && value2 !== null && "
27
27
  var MAX_ROW = 1048575;
28
28
  var MAX_COL = 16383;
29
29
  function columnLabel(col) {
30
- let label2 = "";
30
+ let label3 = "";
31
31
  let n = col + 1;
32
32
  while (n > 0) {
33
33
  const rem = (n - 1) % 26;
34
- label2 = String.fromCharCode(65 + rem) + label2;
34
+ label3 = String.fromCharCode(65 + rem) + label3;
35
35
  n = Math.floor((n - 1) / 26);
36
36
  }
37
- return label2;
37
+ return label3;
38
38
  }
39
- function columnIndex(label2) {
40
- if (!/^[A-Za-z]{1,3}$/.test(label2)) return -1;
39
+ function columnIndex(label3) {
40
+ if (!/^[A-Za-z]{1,3}$/.test(label3)) return -1;
41
41
  let n = 0;
42
- for (const ch of label2.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
42
+ for (const ch of label3.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
43
43
  return n - 1;
44
44
  }
45
45
  var formatAddress = (address2) => `${columnLabel(address2.col)}${address2.row + 1}`;
@@ -351,23 +351,23 @@ function compact(value2) {
351
351
  for (const [key, entry] of Object.entries(value2)) if (entry !== void 0) out[key] = entry;
352
352
  return out;
353
353
  }
354
- function patchStyle(base, patch) {
354
+ function patchStyle(base, patch2) {
355
355
  const next = {
356
- font: patch.font ? compact({ ...base.font, ...patch.font }) : base.font,
357
- fill: patch.fill ?? base.fill,
358
- border: patch.border ? compact({ ...base.border, ...patch.border }) : base.border,
359
- numFmt: patch.numFmt ?? base.numFmt
356
+ font: patch2.font ? compact({ ...base.font, ...patch2.font }) : base.font,
357
+ fill: patch2.fill ?? base.fill,
358
+ border: patch2.border ? compact({ ...base.border, ...patch2.border }) : base.border,
359
+ numFmt: patch2.numFmt ?? base.numFmt
360
360
  };
361
- const alignment = patch.alignment ? compact({ ...base.alignment, ...patch.alignment }) : base.alignment;
361
+ const alignment = patch2.alignment ? compact({ ...base.alignment, ...patch2.alignment }) : base.alignment;
362
362
  if (alignment && Object.keys(alignment).length) next.alignment = alignment;
363
- const protection = patch.protection ? compact({ ...base.protection, ...patch.protection }) : base.protection;
363
+ const protection = patch2.protection ? compact({ ...base.protection, ...patch2.protection }) : base.protection;
364
364
  if (protection && Object.keys(protection).length) next.protection = protection;
365
- const styleName = "cellStyleName" in patch ? patch.cellStyleName : base.cellStyleName;
365
+ const styleName = "cellStyleName" in patch2 ? patch2.cellStyleName : base.cellStyleName;
366
366
  if (styleName) next.cellStyleName = styleName;
367
367
  return next;
368
368
  }
369
- function applyStylePatch(workbook, styleId, patch) {
370
- return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch));
369
+ function applyStylePatch(workbook, styleId, patch2) {
370
+ return internStyle(workbook, patchStyle(styleAt(workbook, styleId), patch2));
371
371
  }
372
372
 
373
373
  // xlsx/cell-styles.ts
@@ -853,7 +853,7 @@ function compileFraction(tokens, slash) {
853
853
  while (isDigit(tokens[denEnd]) || tokens[denEnd]?.t === "num") denEnd++;
854
854
  const denTokens = tokens.slice(slash + 1, denEnd);
855
855
  const fixed2 = denTokens.some((t) => t.t === "num") && denTokens.every((t) => t.t === "num" || isDigit(t) && t.c === "0");
856
- const plan = {
856
+ const plan2 = {
857
857
  tokens: [],
858
858
  intDigits: [],
859
859
  numDigits: [],
@@ -861,31 +861,31 @@ function compileFraction(tokens, slash) {
861
861
  denWidth: denTokens.length
862
862
  };
863
863
  if (fixed2) {
864
- plan.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
864
+ plan2.fixedDenominator = Number(denTokens.map((t) => t.t === "num" ? t.v : "0").join(""));
865
865
  }
866
866
  tokens.forEach((tok, i2) => {
867
- if (i2 === slash) plan.tokens.push({ r: "slash" });
867
+ if (i2 === slash) plan2.tokens.push({ r: "slash" });
868
868
  else if (i2 > slash && i2 < denEnd) {
869
869
  if (fixed2) {
870
- if (i2 === slash + 1) plan.tokens.push({ r: "den", index: 0 });
870
+ if (i2 === slash + 1) plan2.tokens.push({ r: "den", index: 0 });
871
871
  } else if (isDigit(tok)) {
872
- plan.tokens.push({ r: "den", index: plan.denDigits.length });
873
- plan.denDigits.push(tok.c);
872
+ plan2.tokens.push({ r: "den", index: plan2.denDigits.length });
873
+ plan2.denDigits.push(tok.c);
874
874
  }
875
875
  } else if (isDigit(tok) && i2 >= numStart && i2 < slash) {
876
- plan.tokens.push({ r: "num", index: plan.numDigits.length });
877
- plan.numDigits.push(tok.c);
876
+ plan2.tokens.push({ r: "num", index: plan2.numDigits.length });
877
+ plan2.numDigits.push(tok.c);
878
878
  } else if (isDigit(tok) && i2 < numStart) {
879
- plan.tokens.push({ r: "int", index: plan.intDigits.length });
880
- plan.intDigits.push(tok.c);
881
- } else if (tok.t === "lit") plan.tokens.push({ r: "lit", v: tok.v });
882
- else if (tok.t === "num") plan.tokens.push({ r: "lit", v: tok.v });
883
- else if (tok.t === "digit") plan.tokens.push({ r: "lit", v: tok.c });
884
- else if (tok.t === "point") plan.tokens.push({ r: "lit", v: "." });
885
- else if (tok.t === "slash") plan.tokens.push({ r: "lit", v: "/" });
886
- else if (tok.t === "percent") plan.tokens.push({ r: "lit", v: "%" });
879
+ plan2.tokens.push({ r: "int", index: plan2.intDigits.length });
880
+ plan2.intDigits.push(tok.c);
881
+ } else if (tok.t === "lit") plan2.tokens.push({ r: "lit", v: tok.v });
882
+ else if (tok.t === "num") plan2.tokens.push({ r: "lit", v: tok.v });
883
+ else if (tok.t === "digit") plan2.tokens.push({ r: "lit", v: tok.c });
884
+ else if (tok.t === "point") plan2.tokens.push({ r: "lit", v: "." });
885
+ else if (tok.t === "slash") plan2.tokens.push({ r: "lit", v: "/" });
886
+ else if (tok.t === "percent") plan2.tokens.push({ r: "lit", v: "%" });
887
887
  });
888
- return plan;
888
+ return plan2;
889
889
  }
890
890
  function approximate(x, maxDen) {
891
891
  if (Number.isInteger(x)) return [x, 1];
@@ -920,29 +920,29 @@ function padRight(s, slots) {
920
920
  for (let i2 = s.length; i2 < slots.length; i2++) suffix += pad(slots[i2] ?? "#");
921
921
  return s + suffix;
922
922
  }
923
- function renderFraction(value2, plan) {
923
+ function renderFraction(value2, plan2) {
924
924
  const x = Math.abs(value2);
925
- const hasInt = plan.intDigits.length > 0;
925
+ const hasInt = plan2.intDigits.length > 0;
926
926
  let ip = hasInt ? Math.floor(x) : 0;
927
927
  const f6 = x - ip;
928
- const maxDen = 10 ** Math.max(1, plan.denDigits.length) - 1;
929
- let [n, d] = plan.fixedDenominator ? [Math.round(f6 * plan.fixedDenominator), plan.fixedDenominator] : approximate(f6, maxDen);
928
+ const maxDen = 10 ** Math.max(1, plan2.denDigits.length) - 1;
929
+ let [n, d] = plan2.fixedDenominator ? [Math.round(f6 * plan2.fixedDenominator), plan2.fixedDenominator] : approximate(f6, maxDen);
930
930
  if (hasInt && n >= d) {
931
931
  ip += 1;
932
932
  n = 0;
933
933
  }
934
934
  const zero = !hasInt && n === 0;
935
935
  const blank = hasInt && n === 0;
936
- const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan.intDigits) : "";
936
+ const intText = hasInt ? padLeft(ip > 0 ? String(ip) : n === 0 ? "0" : "", plan2.intDigits) : "";
937
937
  const allHash = (slots) => slots.every((c) => c === "#");
938
- const numHash = allHash(plan.numDigits);
939
- const hideFraction = blank && numHash && (plan.fixedDenominator !== void 0 || allHash(plan.denDigits));
938
+ const numHash = allHash(plan2.numDigits);
939
+ const hideFraction = blank && numHash && (plan2.fixedDenominator !== void 0 || allHash(plan2.denDigits));
940
940
  const dropSeparator = hideFraction || hasInt && intText === "" && numHash;
941
- const lastInt = plan.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
942
- const firstNum = plan.tokens.findIndex((t) => t.r === "num");
941
+ const lastInt = plan2.tokens.reduce((last, t, i2) => t.r === "int" ? i2 : last, -1);
942
+ const firstNum = plan2.tokens.findIndex((t) => t.r === "num");
943
943
  let text2 = "";
944
944
  let intDone = false;
945
- plan.tokens.forEach((tok, i2) => {
945
+ plan2.tokens.forEach((tok, i2) => {
946
946
  if (tok.r === "lit") {
947
947
  if (!(dropSeparator && i2 > lastInt && i2 < firstNum)) text2 += tok.v;
948
948
  } else if (tok.r === "int") {
@@ -951,12 +951,12 @@ function renderFraction(value2, plan) {
951
951
  } else if (hideFraction) ; else if (blank) {
952
952
  if (tok.r === "num") text2 += " ";
953
953
  else if (tok.r === "slash") text2 += " ";
954
- else text2 += " ".repeat(plan.fixedDenominator ? plan.denWidth : 1);
954
+ else text2 += " ".repeat(plan2.fixedDenominator ? plan2.denWidth : 1);
955
955
  } else if (tok.r === "num") {
956
- if (tok.index === 0) text2 += padLeft(String(n), plan.numDigits);
956
+ if (tok.index === 0) text2 += padLeft(String(n), plan2.numDigits);
957
957
  } else if (tok.r === "slash") text2 += "/";
958
- else if (plan.fixedDenominator) text2 += String(d);
959
- else if (tok.index === 0) text2 += padRight(String(d), plan.denDigits);
958
+ else if (plan2.fixedDenominator) text2 += String(d);
959
+ else if (tok.index === 0) text2 += padRight(String(d), plan2.denDigits);
960
960
  });
961
961
  return { text: text2, zero };
962
962
  }
@@ -1097,15 +1097,15 @@ function compileNumber(tokens) {
1097
1097
  out.splice(at < 0 ? 0 : at, 0, { r: "int", c: "#", index: 0 });
1098
1098
  intDigits.push("#");
1099
1099
  }
1100
- const plan = {
1100
+ const plan2 = {
1101
1101
  tokens: out,
1102
1102
  intDigits,
1103
1103
  fracDigits,
1104
1104
  grouping,
1105
1105
  shift: 2 * percent - 3 * scaleCommas
1106
1106
  };
1107
- if (exponent) plan.exponent = exponent;
1108
- return plan;
1107
+ if (exponent) plan2.exponent = exponent;
1108
+ return plan2;
1109
1109
  }
1110
1110
  var pad2 = (c) => c === "0" ? "0" : c === "?" ? " " : "";
1111
1111
  function placeIntegers(digits2, slots, grouping) {
@@ -1138,40 +1138,40 @@ function placeFraction(digits2, slots) {
1138
1138
  }
1139
1139
  return out;
1140
1140
  }
1141
- function scientific(v, plan) {
1141
+ function scientific(v, plan2) {
1142
1142
  if (isZero(v)) return { value: v, exp: 0 };
1143
- const n = plan.intDigits.length;
1144
- const engineering = n > 1 && plan.intDigits.some((c) => c !== "0");
1143
+ const n = plan2.intDigits.length;
1144
+ const engineering = n > 1 && plan2.intDigits.some((c) => c !== "0");
1145
1145
  const period = engineering ? n : 1;
1146
1146
  const e = v.point - 1;
1147
1147
  let exp2 = Math.floor(e / period) * period;
1148
- let m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1148
+ let m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1149
1149
  if (m.point > period) {
1150
1150
  exp2 += period;
1151
- m = roundDecimals(shift(v, -exp2), plan.fracDigits.length);
1151
+ m = roundDecimals(shift(v, -exp2), plan2.fracDigits.length);
1152
1152
  }
1153
1153
  return { value: m, exp: exp2 };
1154
1154
  }
1155
- function renderNumber(value2, plan) {
1156
- const v = shift(toDigits(value2), plan.shift);
1155
+ function renderNumber(value2, plan2) {
1156
+ const v = shift(toDigits(value2), plan2.shift);
1157
1157
  let rounded;
1158
1158
  let exp2 = 0;
1159
- if (plan.exponent) {
1160
- const m = scientific(v, plan);
1159
+ if (plan2.exponent) {
1160
+ const m = scientific(v, plan2);
1161
1161
  rounded = m.value;
1162
1162
  exp2 = m.exp;
1163
- } else rounded = roundDecimals(v, plan.fracDigits.length);
1164
- const ints = plan.exponent && isZero(rounded) ? plan.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan.intDigits, plan.grouping);
1165
- const fracs = placeFraction(fractionPart(rounded, plan.fracDigits.length), plan.fracDigits);
1163
+ } else rounded = roundDecimals(v, plan2.fracDigits.length);
1164
+ const ints = plan2.exponent && isZero(rounded) ? plan2.intDigits.map(() => "0") : placeIntegers(integerPart(rounded), plan2.intDigits, plan2.grouping);
1165
+ const fracs = placeFraction(fractionPart(rounded, plan2.fracDigits.length), plan2.fracDigits);
1166
1166
  let text2 = "";
1167
- for (const tok of plan.tokens) {
1167
+ for (const tok of plan2.tokens) {
1168
1168
  if (tok.r === "lit") text2 += tok.v;
1169
1169
  else if (tok.r === "int") text2 += ints[tok.index] ?? "";
1170
1170
  else if (tok.r === "frac") text2 += fracs[tok.index] ?? "";
1171
1171
  else if (tok.r === "point") text2 += ".";
1172
- else if (plan.exponent) {
1173
- const sign2 = exp2 < 0 ? "-" : plan.exponent.plus ? "+" : "";
1174
- text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan.exponent.digits, "0")}`;
1172
+ else if (plan2.exponent) {
1173
+ const sign2 = exp2 < 0 ? "-" : plan2.exponent.plus ? "+" : "";
1174
+ text2 += `E${sign2}${String(Math.abs(exp2)).padStart(plan2.exponent.digits, "0")}`;
1175
1175
  }
1176
1176
  }
1177
1177
  return { text: text2, zero: isZero(rounded) };
@@ -1864,9 +1864,9 @@ function parseFractionInput(text2) {
1864
1864
  const m = /^([-+]?)(\d+)\s+(\d+)\/(\d+)$/.exec(text2.trim());
1865
1865
  if (!m) return void 0;
1866
1866
  const den = Number(m[4]);
1867
- const num2 = Number(m[3]);
1868
- if (den === 0 || num2 >= den) return void 0;
1869
- const magnitude = Number(m[2]) + num2 / den;
1867
+ const num3 = Number(m[3]);
1868
+ if (den === 0 || num3 >= den) return void 0;
1869
+ const magnitude = Number(m[2]) + num3 / den;
1870
1870
  return {
1871
1871
  value: m[1] === "-" ? -magnitude : magnitude,
1872
1872
  numFmt: den < 10 ? "# ?/?" : "# ??/??"
@@ -11159,13 +11159,27 @@ var TEXT_REGEX_FUNCTIONS = [
11159
11159
  "REGEXEXTRACT",
11160
11160
  C35,
11161
11161
  "REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])",
11162
- "The first part of the text that matches the pattern.",
11162
+ "Extracts the first match (0), all matches (1), or the first match\u2019s capture groups (2).",
11163
11163
  2,
11164
11164
  4,
11165
11165
  (args) => {
11166
- if (optNum(args, 2, 0) !== 0) fail(ERR.VALUE);
11167
- const match2 = compile(str(args[1]), caseMode(args, 3), false).exec(str(args[0]));
11168
- return match2 ? match2[0] : fail(ERR.NA);
11166
+ const mode = optNum(args, 2, 0);
11167
+ if (mode !== 0 && mode !== 1 && mode !== 2) fail(ERR.VALUE);
11168
+ const regex = compile(str(args[1]), caseMode(args, 3), mode === 1);
11169
+ const text2 = str(args[0]);
11170
+ if (mode === 1) {
11171
+ const matches2 = [];
11172
+ for (const match3 of text2.matchAll(regex)) {
11173
+ checkArraySize(matches2.length + 1, 1);
11174
+ matches2.push(match3[0]);
11175
+ }
11176
+ return matches2.length ? new Matrix(matches2.map((match3) => [match3])) : fail(ERR.NA);
11177
+ }
11178
+ const match2 = regex.exec(text2);
11179
+ if (!match2) fail(ERR.NA);
11180
+ if (mode === 0) return match2[0];
11181
+ if (match2.length === 1) fail(ERR.VALUE);
11182
+ return new Matrix([match2.slice(1).map((group) => group ?? "")]);
11169
11183
  }
11170
11184
  ),
11171
11185
  spec(
@@ -11842,7 +11856,7 @@ function makeTemplate(formula, shape2) {
11842
11856
  }
11843
11857
  const { starts } = shape2;
11844
11858
  const slotted = starts.map(() => false);
11845
- const refs = /* @__PURE__ */ new Map();
11859
+ const refs2 = /* @__PURE__ */ new Map();
11846
11860
  let run = 0;
11847
11861
  for (const token of tokens) {
11848
11862
  const end = token.start + token.text.length;
@@ -11856,9 +11870,9 @@ function makeTemplate(formula, shape2) {
11856
11870
  const indexes2 = count2 === 1 ? [at] : [at, at + 1];
11857
11871
  if (indexes2.some((i2) => formula.charCodeAt(starts[i2]) === 48)) continue;
11858
11872
  for (const i2 of indexes2) slotted[i2] = true;
11859
- refs.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11873
+ refs2.set(ref, count2 === 1 ? { start: at } : { start: at, end: at + 1 });
11860
11874
  }
11861
- return { formula, shape: shape2, ast, slotted, refs };
11875
+ return { formula, shape: shape2, ast, slotted, refs: refs2 };
11862
11876
  }
11863
11877
  function rowsFor(t, formula, shape2) {
11864
11878
  if (!sameShape(t.formula, t.shape, formula, shape2)) return void 0;
@@ -11882,11 +11896,11 @@ function rowsFor(t, formula, shape2) {
11882
11896
  return rows2;
11883
11897
  }
11884
11898
  function shiftSpec(spec2, slots, rows2) {
11885
- const startRow = rows2[slots.start];
11886
- const endRow = slots.end === void 0 ? startRow : rows2[slots.end];
11887
- if (startRow === spec2.start.row && endRow === spec2.end.row) return spec2;
11899
+ const startRow2 = rows2[slots.start];
11900
+ const endRow = slots.end === void 0 ? startRow2 : rows2[slots.end];
11901
+ if (startRow2 === spec2.start.row && endRow === spec2.end.row) return spec2;
11888
11902
  const { start: from, end: to } = spec2;
11889
- const start = { row: startRow, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11903
+ const start = { row: startRow2, col: from.col, rowAbs: from.rowAbs, colAbs: from.colAbs };
11890
11904
  if (slots.end === void 0) return { kind: spec2.kind, start, end: start };
11891
11905
  const end = { row: endRow, col: to.col, rowAbs: to.rowAbs, colAbs: to.colAbs };
11892
11906
  return { kind: spec2.kind, start, end };
@@ -13619,12 +13633,14 @@ function structuredToA1(formula, target2) {
13619
13633
 
13620
13634
  // xml/namespaces.ts
13621
13635
  var NS = {
13636
+ /** SpreadsheetML main. */
13637
+ x: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
13622
13638
  /** SpreadsheetML 2009 extensions (`x14:conditionalFormatting`, `x14:dataBar`). */
13623
13639
  x14: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"};
13624
13640
  function parseXml(xml, options = {}) {
13625
- const label2 = options.label ?? "OOXML";
13641
+ const label3 = options.label ?? "OOXML";
13626
13642
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
13627
- throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
13643
+ throw new Error(`${label3} XML with DTD or entity declarations is not supported`);
13628
13644
  let parseError = "";
13629
13645
  let parsed;
13630
13646
  try {
@@ -13635,12 +13651,12 @@ function parseXml(xml, options = {}) {
13635
13651
  }).parseFromString(xml, "application/xml");
13636
13652
  } catch (error) {
13637
13653
  throw new Error(
13638
- `Invalid ${label2} XML: ${error instanceof Error ? error.message : String(error)}`,
13654
+ `Invalid ${label3} XML: ${error instanceof Error ? error.message : String(error)}`,
13639
13655
  { cause: error }
13640
13656
  );
13641
13657
  }
13642
13658
  if (parseError || !parsed.documentElement)
13643
- throw new Error(`Invalid ${label2} XML: ${parseError || "missing root element"}`);
13659
+ throw new Error(`Invalid ${label3} XML: ${parseError || "missing root element"}`);
13644
13660
  return parsed;
13645
13661
  }
13646
13662
  var buildXml = (node) => new XMLSerializer().serializeToString(node);
@@ -13716,6 +13732,315 @@ function descendants(root, local, ns) {
13716
13732
  return Array.from(root.getElementsByTagNameNS(ns, local));
13717
13733
  }
13718
13734
 
13735
+ // xlsx/edit/sparkline-ranges.ts
13736
+ function checkedSparklineRange(raw) {
13737
+ const range2 = normalizeRange(raw);
13738
+ for (const point of [range2.start, range2.end])
13739
+ if (!Number.isInteger(point.row) || !Number.isInteger(point.col) || point.row < 0 || point.col < 0 || point.row > MAX_ROW || point.col > MAX_COL)
13740
+ throw new RangeError("The reference is not valid.");
13741
+ return range2;
13742
+ }
13743
+ function sparklineDataRange(workbook, sheet, source) {
13744
+ let ast;
13745
+ try {
13746
+ ast = parseFormula(source.trim().replace(/^=/, ""));
13747
+ } catch {
13748
+ throw new Error("The reference is not valid.");
13749
+ }
13750
+ if (ast.type !== "ref" || !ast.ref || !["cell", "area"].includes(ast.ref.kind) || ast.prefix?.book || ast.prefix?.sheet2 || ast.spill)
13751
+ throw new Error("The reference is not valid.");
13752
+ const index2 = ast.prefix ? workbook.sheets.findIndex((ws) => ws.name.toLowerCase() === ast.prefix.sheet.toLowerCase()) : sheet;
13753
+ if (!workbook.sheets[index2]) throw new Error("The reference is not valid.");
13754
+ return { sheet: index2, range: checkedSparklineRange({ start: ast.ref.start, end: ast.ref.end }) };
13755
+ }
13756
+ function newSparklines(workbook, sheet, source, locations) {
13757
+ const data = sparklineDataRange(workbook, sheet, source);
13758
+ const dest = checkedSparklineRange(locations);
13759
+ const rows2 = dest.end.row - dest.start.row + 1;
13760
+ const cols = dest.end.col - dest.start.col + 1;
13761
+ const dr = data.range.end.row - data.range.start.row + 1;
13762
+ const dc = data.range.end.col - data.range.start.col + 1;
13763
+ if (rows2 > 1 && cols > 1 || rows2 === 1 && cols === 1 && dr > 1 && dc > 1 || rows2 > 1 && rows2 !== dr || cols > 1 && cols !== dc)
13764
+ throw new Error("The data range and location range do not match.");
13765
+ if (Math.max(rows2, cols) > 1e5) throw new Error("The sparkline location range is too large.");
13766
+ const prefix = `'${workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!`;
13767
+ const out = [];
13768
+ for (let i2 = 0; i2 < Math.max(rows2, cols); i2++) {
13769
+ const range2 = structuredClone(data.range);
13770
+ if (rows2 > 1) range2.start.row = range2.end.row = data.range.start.row + i2;
13771
+ if (cols > 1) range2.start.col = range2.end.col = data.range.start.col + i2;
13772
+ const host = {
13773
+ row: dest.start.row + (rows2 > 1 ? i2 : 0),
13774
+ col: dest.start.col + (cols > 1 ? i2 : 0)
13775
+ };
13776
+ out.push({ formula: prefix + formatRange(range2), host: { start: host, end: { ...host } } });
13777
+ }
13778
+ return out;
13779
+ }
13780
+
13781
+ // xlsx/pivot/data.ts
13782
+ var PIVOT_AGGREGATES = ["sum", "count", "average", "min", "max"];
13783
+ function pivotSourceData(workbook, sheet, source) {
13784
+ const data = sparklineDataRange(workbook, sheet, source);
13785
+ const ws = workbook.sheets[data.sheet];
13786
+ const { start, end } = data.range;
13787
+ if (end.row <= start.row || (end.row - start.row + 1) * (end.col - start.col + 1) > 1e6)
13788
+ throw new Error("A PivotTable source needs headers and data, with at most one million cells.");
13789
+ const fields = [];
13790
+ for (let col = start.col; col <= end.col; col++) {
13791
+ const value2 = getCell(ws, start.row, col)?.value;
13792
+ if (value2 === void 0 || value2 === null || isCellError(value2) || !String(value2).trim())
13793
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13794
+ fields.push(String(value2));
13795
+ }
13796
+ if (new Set(fields.map((name) => name.toLowerCase())).size !== fields.length)
13797
+ throw new Error("Every PivotTable source column needs a unique, non-empty header.");
13798
+ const records = [];
13799
+ for (let row2 = start.row + 1; row2 <= end.row; row2++) {
13800
+ const record = [];
13801
+ for (let col = start.col; col <= end.col; col++)
13802
+ record.push(getCell(ws, row2, col)?.value ?? null);
13803
+ records.push(record);
13804
+ }
13805
+ return { source: `${quoteSheetName(ws.name)}!${formatRange(data.range)}`, fields, records };
13806
+ }
13807
+ function pivotValueKey(value2) {
13808
+ return value2 === null || value2 === "" ? "blank" : isCellError(value2) ? `error:${value2.error}` : `${typeof value2}:${String(value2).toLowerCase()}`;
13809
+ }
13810
+ function pivotItems(pivot, field) {
13811
+ const index2 = pivot.fields.indexOf(field);
13812
+ const items = /* @__PURE__ */ new Map();
13813
+ for (const record of pivot.records) {
13814
+ const value2 = record[index2] ?? null;
13815
+ const key = pivotValueKey(value2);
13816
+ if (!items.has(key)) items.set(key, value2);
13817
+ }
13818
+ const rank3 = (value2) => value2 === null || value2 === "" ? 4 : isCellError(value2) ? 3 : typeof value2 === "boolean" ? 2 : typeof value2 === "string" ? 1 : 0;
13819
+ return [...items.values()].sort(
13820
+ (a, b) => rank3(a) - rank3(b) || (typeof a === "number" && typeof b === "number" ? a - b : String(pivotItemLabel(a)).localeCompare(String(pivotItemLabel(b)), "en", {
13821
+ sensitivity: "base",
13822
+ numeric: true
13823
+ }))
13824
+ );
13825
+ }
13826
+ function pivotItemLabel(value2) {
13827
+ if (value2 === null || value2 === "") return "(blank)";
13828
+ if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
13829
+ return isCellError(value2) ? value2.error : value2;
13830
+ }
13831
+ function validatePivotFields(pivot) {
13832
+ const used = [
13833
+ pivot.rowField,
13834
+ ...pivot.secondRowField ? [pivot.secondRowField] : [],
13835
+ ...pivot.columnField ? [pivot.columnField] : [],
13836
+ pivot.valueField
13837
+ ];
13838
+ if (pivot.layout !== void 0 && !["tabular", "compact", "outline"].includes(pivot.layout) || pivot.subtotalPosition !== void 0 && !["top", "bottom"].includes(pivot.subtotalPosition) || !PIVOT_AGGREGATES.includes(pivot.aggregate) || used.some((field) => !pivot.fields.includes(field)) || new Set([pivot.rowField, pivot.secondRowField, pivot.columnField].filter(Boolean)).size !== [pivot.rowField, pivot.secondRowField, pivot.columnField].filter(Boolean).length || pivot.subtotals !== void 0 && typeof pivot.subtotals !== "boolean" || pivot.repeatLabels !== void 0 && typeof pivot.repeatLabels !== "boolean")
13839
+ throw new Error("Choose valid PivotTable fields; row and column fields must differ.");
13840
+ }
13841
+ function pivotCaption(aggregate3, field) {
13842
+ return `${aggregate3[0].toUpperCase()}${aggregate3.slice(1)} of ${field}`;
13843
+ }
13844
+
13845
+ // xlsx/pivot/hierarchy.ts
13846
+ var label2 = pivotItemLabel;
13847
+ function hierarchicalPivotGrid(pivot, aggregate3) {
13848
+ const rowItems = pivotItems(pivot, pivot.rowField);
13849
+ const secondRowItems = pivotItems(pivot, pivot.secondRowField);
13850
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
13851
+ const outerField = pivot.fields.indexOf(pivot.rowField);
13852
+ const innerField = pivot.fields.indexOf(pivot.secondRowField);
13853
+ const columnField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
13854
+ const valueField = pivot.fields.indexOf(pivot.valueField);
13855
+ const layout2 = pivot.layout ?? "tabular";
13856
+ const compact3 = layout2 === "compact";
13857
+ const top = layout2 !== "tabular" && pivot.subtotals !== false && (pivot.subtotalPosition ?? "top") === "top";
13858
+ const bottom = pivot.subtotals !== false && !top;
13859
+ const rowLabelColumns = compact3 ? 1 : 2;
13860
+ const groups = /* @__PURE__ */ new Map();
13861
+ const details = /* @__PURE__ */ new Map();
13862
+ const children2 = /* @__PURE__ */ new Map();
13863
+ const innerIndices = new Map(secondRowItems.map((item, index2) => [pivotValueKey(item), index2]));
13864
+ const buckets = /* @__PURE__ */ new Map();
13865
+ const collect = (map, key, record) => {
13866
+ const list = map.get(key);
13867
+ if (list) list.push(record);
13868
+ else map.set(key, [record]);
13869
+ };
13870
+ for (const record of pivot.records) {
13871
+ const outer = pivotValueKey(record[outerField] ?? null);
13872
+ const inner2 = pivotValueKey(record[innerField] ?? null);
13873
+ collect(groups, outer, record);
13874
+ collect(details, JSON.stringify([outer, inner2]), record);
13875
+ if (!children2.has(outer)) children2.set(outer, /* @__PURE__ */ new Set());
13876
+ children2.get(outer).add(inner2);
13877
+ if (pivot.columnField) {
13878
+ const column = pivotValueKey(record[columnField] ?? null);
13879
+ for (const key of [[], [outer], [outer, inner2]])
13880
+ collect(buckets, JSON.stringify([...key, column]), record);
13881
+ }
13882
+ }
13883
+ const rows2 = details.size + rowItems.length * (Number(layout2 !== "tabular") + Number(bottom)) + 3;
13884
+ if (rows2 * (columnItems.length + 3) > 1e6)
13885
+ throw new Error("The PivotTable result is too large.");
13886
+ const labels = compact3 ? ["Row Labels"] : [pivot.rowField, pivot.secondRowField];
13887
+ const values2 = pivot.columnField ? [
13888
+ [
13889
+ pivot.valueCaption,
13890
+ ...compact3 ? [] : [null],
13891
+ compact3 ? "Column Labels" : pivot.columnField,
13892
+ ...columnItems.slice(1).map(() => null),
13893
+ null
13894
+ ],
13895
+ [...labels, ...columnItems.map(label2), "Grand Total"]
13896
+ ] : [[...labels, pivot.valueCaption]];
13897
+ const indents = values2.map(() => 0);
13898
+ const rowEntries = [];
13899
+ const append = (labels2, numbers4, entry, indent = 0) => {
13900
+ values2.push([...labels2, ...numbers4]);
13901
+ rowEntries.push(entry);
13902
+ indents.push(indent);
13903
+ };
13904
+ const numbers3 = (keys, records) => [
13905
+ ...columnItems.map(
13906
+ (column) => aggregate3(
13907
+ buckets.get(JSON.stringify([...keys, pivotValueKey(column)])) ?? [],
13908
+ valueField,
13909
+ pivot.aggregate
13910
+ )
13911
+ ),
13912
+ aggregate3(records, valueField, pivot.aggregate)
13913
+ ];
13914
+ rowItems.forEach((outer, outerIndex) => {
13915
+ const key = pivotValueKey(outer);
13916
+ if (layout2 !== "tabular")
13917
+ append(
13918
+ [label2(outer), ...compact3 ? [] : [null]],
13919
+ top ? numbers3([key], groups.get(key) ?? []) : Array(columnItems.length + 1).fill(null),
13920
+ { indices: [outerIndex] }
13921
+ );
13922
+ let first2 = true;
13923
+ [...children2.get(key)].sort((a, b) => innerIndices.get(a) - innerIndices.get(b)).forEach((innerKey) => {
13924
+ const innerIndex = innerIndices.get(innerKey);
13925
+ const inner2 = secondRowItems[innerIndex];
13926
+ const keys = [key, innerKey];
13927
+ const records = details.get(JSON.stringify(keys));
13928
+ if (!records) return;
13929
+ append(
13930
+ compact3 ? [label2(inner2)] : [
13931
+ pivot.repeatLabels || layout2 === "tabular" && first2 ? label2(outer) : null,
13932
+ label2(inner2)
13933
+ ],
13934
+ numbers3(keys, records),
13935
+ { indices: [outerIndex, innerIndex] },
13936
+ compact3 ? 1 : 0
13937
+ );
13938
+ first2 = false;
13939
+ });
13940
+ if (bottom) {
13941
+ const caption = String(label2(outer));
13942
+ append(
13943
+ [`${caption} Total`, ...compact3 ? [] : [null]],
13944
+ numbers3([key], groups.get(key) ?? []),
13945
+ { indices: [outerIndex], type: "default" }
13946
+ );
13947
+ }
13948
+ });
13949
+ append(["Grand Total", ...compact3 ? [] : [null]], numbers3([], pivot.records), {
13950
+ indices: [0],
13951
+ type: "grand"
13952
+ });
13953
+ return {
13954
+ values: values2,
13955
+ rowItems,
13956
+ secondRowItems,
13957
+ columnItems,
13958
+ rowEntries,
13959
+ firstDataRow: pivot.columnField ? 2 : 1,
13960
+ rowLabelColumns,
13961
+ indents
13962
+ };
13963
+ }
13964
+
13965
+ // xlsx/pivot/aggregate.ts
13966
+ function aggregate2(records, field, type) {
13967
+ if (!records.length) return null;
13968
+ const values2 = records.map((record) => record[field] ?? null);
13969
+ if (type === "count") return values2.filter((value2) => value2 !== null && value2 !== "").length;
13970
+ const error = values2.find(isCellError);
13971
+ if (error) return error;
13972
+ const numbers3 = values2.filter((value2) => typeof value2 === "number");
13973
+ if (!numbers3.length) return type === "average" ? { error: "#DIV/0!" } : 0;
13974
+ if (type === "min") return numbers3.reduce((a, b) => Math.min(a, b));
13975
+ if (type === "max") return numbers3.reduce((a, b) => Math.max(a, b));
13976
+ const sum2 = numbers3.reduce((total2, value2) => total2 + value2, 0);
13977
+ return type === "average" ? sum2 / numbers3.length : sum2;
13978
+ }
13979
+ function pivotGrid(pivot) {
13980
+ validatePivotFields(pivot);
13981
+ if (pivot.secondRowField) return hierarchicalPivotGrid(pivot, aggregate2);
13982
+ const rowItems = pivotItems(pivot, pivot.rowField);
13983
+ const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
13984
+ if ((rowItems.length + 3) * (columnItems.length + 2) > 1e6)
13985
+ throw new Error("The PivotTable result is too large.");
13986
+ const rowField = pivot.fields.indexOf(pivot.rowField);
13987
+ const colField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
13988
+ const valueField = pivot.fields.indexOf(pivot.valueField);
13989
+ const groups = /* @__PURE__ */ new Map();
13990
+ const cells = /* @__PURE__ */ new Map();
13991
+ const columns = /* @__PURE__ */ new Map();
13992
+ const collect = (map, key, record) => {
13993
+ const found = map.get(key);
13994
+ if (found) found.push(record);
13995
+ else map.set(key, [record]);
13996
+ };
13997
+ for (const record of pivot.records) {
13998
+ const key = pivotValueKey(record[rowField] ?? null);
13999
+ collect(groups, key, record);
14000
+ if (pivot.columnField) {
14001
+ const col = pivotValueKey(record[colField] ?? null);
14002
+ collect(columns, col, record);
14003
+ collect(cells, JSON.stringify([key, col]), record);
14004
+ }
14005
+ }
14006
+ const label3 = pivotItemLabel;
14007
+ const values2 = pivot.columnField ? [
14008
+ [
14009
+ pivot.valueCaption,
14010
+ pivot.layout === "compact" ? "Column Labels" : pivot.columnField,
14011
+ ...columnItems.slice(1).map(() => null),
14012
+ null
14013
+ ],
14014
+ [
14015
+ pivot.layout === "compact" ? "Row Labels" : pivot.rowField,
14016
+ ...columnItems.map(label3),
14017
+ "Grand Total"
14018
+ ]
14019
+ ] : [[pivot.layout === "compact" ? "Row Labels" : pivot.rowField, pivot.valueCaption]];
14020
+ for (const row2 of rowItems) {
14021
+ const records = groups.get(pivotValueKey(row2)) ?? [];
14022
+ values2.push([
14023
+ label3(row2),
14024
+ ...columnItems.map(
14025
+ (col) => aggregate2(
14026
+ cells.get(JSON.stringify([pivotValueKey(row2), pivotValueKey(col)])) ?? [],
14027
+ valueField,
14028
+ pivot.aggregate
14029
+ )
14030
+ ),
14031
+ aggregate2(records, valueField, pivot.aggregate)
14032
+ ]);
14033
+ }
14034
+ values2.push([
14035
+ "Grand Total",
14036
+ ...columnItems.map(
14037
+ (col) => aggregate2(columns.get(pivotValueKey(col)) ?? [], valueField, pivot.aggregate)
14038
+ ),
14039
+ aggregate2(pivot.records, valueField, pivot.aggregate)
14040
+ ]);
14041
+ return { values: values2, rowItems, columnItems, firstDataRow: pivot.columnField ? 2 : 1 };
14042
+ }
14043
+
13719
14044
  // xlsx/read/style-parts.ts
13720
14045
  function parseColor(element2, palette) {
13721
14046
  if (!element2) return void 0;
@@ -13749,6 +14074,23 @@ function parseSqref(sqref) {
13749
14074
  return sqref.split(/\s+/).filter(Boolean).map((part) => parseRange(part)).filter((range2) => range2 !== void 0);
13750
14075
  }
13751
14076
 
14077
+ // xlsx/write/xml-out.ts
14078
+ var CONTROL2 = "\0-\b\v\f-" + String.fromCharCode(65534, 65535);
14079
+ var INVALID_XML = new RegExp(`[${CONTROL2}]`, "g");
14080
+ var escapeText = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
14081
+ var escapeAttr = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
14082
+ function attrs(values2) {
14083
+ let out = "";
14084
+ for (const [name, value2] of Object.entries(values2)) {
14085
+ if (value2 === void 0) continue;
14086
+ const text2 = typeof value2 === "boolean" ? value2 ? "1" : "0" : typeof value2 === "number" ? num2(value2) : value2;
14087
+ out += ` ${name}="${escapeAttr(text2)}"`;
14088
+ }
14089
+ return out;
14090
+ }
14091
+ var el = (name, values2 = {}, content = "") => content ? `<${name}${attrs(values2)}>${content}</${name}>` : `<${name}${attrs(values2)}/>`;
14092
+ var num2 = (value2) => Object.is(value2, -0) ? "0" : String(value2);
14093
+
13752
14094
  // xlsx/conditional-extensions.ts
13753
14095
  var XM = "http://schemas.microsoft.com/office/excel/2006/main";
13754
14096
  function dataBarLengths(rule, node) {
@@ -14331,143 +14673,386 @@ function shiftFormulaInBand(formula, formulaSheet, sheet, shift2, band) {
14331
14673
  return changed ? tokens.map((t) => t.text).join("") : formula;
14332
14674
  }
14333
14675
 
14334
- // xlsx/edit/context.ts
14335
- function sheetAt(workbook, index2) {
14336
- const sheet = Number.isInteger(index2) ? workbook.sheets[index2] : void 0;
14337
- if (!sheet) throw new RangeError(`No sheet at index ${index2}`);
14338
- return sheet;
14676
+ // xlsx/write/style-xml.ts
14677
+ var argb = (rgb2) => (rgb2.length === 6 ? `FF${rgb2}` : rgb2).toUpperCase();
14678
+ function colorXml(color, name = "color") {
14679
+ if (!color) return "";
14680
+ if (color.rgb) return el(name, { rgb: argb(color.rgb), tint: color.tint });
14681
+ if (color.theme !== void 0) return el(name, { theme: color.theme, tint: color.tint });
14682
+ if (color.indexed !== void 0) return el(name, { indexed: color.indexed, tint: color.tint });
14683
+ if (color.auto) return el(name, { auto: true });
14684
+ return "";
14339
14685
  }
14340
- function baseStyleId(sheet, row2, col) {
14341
- const rowStyle = sheet.rowInfo.get(row2)?.styleId;
14342
- if (rowStyle) return rowStyle;
14343
- const column = sheet.columns.find((c) => col >= c.min && col <= c.max);
14344
- return column?.styleId || void 0;
14686
+
14687
+ // xlsx/layout/sparkline-view.ts
14688
+ var DEFAULTS = {
14689
+ colorSeries: "#376092",
14690
+ colorNegative: "#D00000",
14691
+ colorAxis: "#000000",
14692
+ colorMarkers: "#D00000",
14693
+ colorFirst: "#D00000",
14694
+ colorLast: "#D00000",
14695
+ colorHigh: "#D00000",
14696
+ colorLow: "#D00000"
14697
+ };
14698
+ var COLUMN_GAP = 0.2;
14699
+ function extent(values2) {
14700
+ let min = Infinity;
14701
+ let max = -Infinity;
14702
+ for (const v of values2) {
14703
+ if (v === null) continue;
14704
+ if (v < min) min = v;
14705
+ if (v > max) max = v;
14706
+ }
14707
+ return min <= max ? { min, max } : void 0;
14345
14708
  }
14346
- function ensureCell(sheet, row2, col) {
14347
- const existing = getCell(sheet, row2, col);
14348
- if (existing) return existing;
14349
- const cell = { value: null };
14350
- const styleId = baseStyleId(sheet, row2, col);
14351
- if (styleId) cell.styleId = styleId;
14352
- putCell(sheet, row2, col, cell);
14353
- return cell;
14709
+ function sparklineValues(group, values2) {
14710
+ return group.displayEmptyCellsAs === "zero" ? values2.map((v) => v ?? 0) : [...values2];
14354
14711
  }
14355
- var isWholeColumns = (range2) => range2.start.row === 0 && range2.end.row >= MAX_ROW;
14356
- var isWholeRows = (range2) => range2.start.col === 0 && range2.end.col >= MAX_COL;
14357
- function clipToUsed(sheet, range2) {
14358
- const r = normalizeRange(range2);
14359
- const used = usedRange(sheet);
14360
- if (!used) return void 0;
14361
- const start = {
14362
- row: Math.max(r.start.row, used.start.row),
14363
- col: Math.max(r.start.col, used.start.col)
14712
+ function sparklineScale(group, all2, index2) {
14713
+ const own = extent(sparklineValues(group, all2[index2]?.values ?? []));
14714
+ const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
14715
+ const shared = needsGroup ? extent(all2.flatMap((data) => sparklineValues(group, data.values))) : void 0;
14716
+ const end = (type, manual, key) => {
14717
+ if (type === "custom" && manual !== void 0) return manual;
14718
+ if (type === "group" && shared) return shared[key];
14719
+ return own?.[key];
14364
14720
  };
14365
- const end = { row: Math.min(r.end.row, used.end.row), col: Math.min(r.end.col, used.end.col) };
14366
- return start.row > end.row || start.col > end.col ? void 0 : { start, end };
14367
- }
14368
- var DENSE_LIMIT = 25e4;
14369
- function forEachPosition(sheet, range2, visit2) {
14370
- let r = normalizeRange(range2);
14371
- const size = (r.end.row - r.start.row + 1) * (r.end.col - r.start.col + 1);
14372
- if (size > DENSE_LIMIT) r = clipToUsed(sheet, r);
14373
- if (!r) return;
14374
- for (let row2 = r.start.row; row2 <= r.end.row; row2++)
14375
- for (let col = r.start.col; col <= r.end.col; col++) visit2(row2, col);
14376
- }
14377
- function rawText(value2) {
14378
- if (value2 === null) return "";
14379
- if (isCellError(value2)) return value2.error;
14380
- if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
14381
- return String(value2);
14382
- }
14383
- function pruneCell(sheet, row2, col) {
14384
- const cell = getCell(sheet, row2, col);
14385
- if (!cell) return;
14386
- if (cell.value === null && cell.formula === void 0 && !cell.styleId && !cell.richText) {
14387
- const cells = sheet.rows.get(row2);
14388
- cells?.delete(col);
14389
- if (cells && cells.size === 0) sheet.rows.delete(row2);
14390
- }
14721
+ const min = end(group.minAxisType, group.manualMin, "min");
14722
+ const max = end(group.maxAxisType, group.manualMax, "max");
14723
+ return min === void 0 || max === void 0 ? void 0 : { min, max };
14391
14724
  }
14392
-
14393
- // xlsx/edit/shift-preserved.ts
14394
- var XM3 = "http://schemas.microsoft.com/office/excel/2006/main";
14395
- function hasPreservedOverflow(sheet, shift2, clipped, banded) {
14396
- const keys = banded ? ["extLst"] : [shift2.axis === "row" ? "rowBreaks" : "colBreaks", "extLst"];
14397
- for (const key of keys)
14398
- for (const xml of sheet.preserved.get(key) ?? []) {
14399
- if (!xml.includes(key === "extLst" ? "sqref" : "brk")) continue;
14400
- let root;
14401
- try {
14402
- root = parseXml(xml).documentElement;
14403
- } catch {
14404
- continue;
14405
- }
14406
- if (key === "extLst") {
14407
- if (descendants2(root, XM3, "sqref").some(
14408
- (node) => parseSqref(node.textContent ?? "").some(clipped)
14409
- ))
14410
- return true;
14411
- } else if (elements(root).some(
14412
- (node) => node.localName === "brk" && shiftIndex(Number(node.getAttribute("id") ?? "0"), shift2) === void 0
14413
- ))
14414
- return true;
14725
+ function positions(group, data, n) {
14726
+ const dates = data.dates;
14727
+ if (group.dateAxis && dates && dates.length === n) {
14728
+ const span4 = extent(dates);
14729
+ if (span4) {
14730
+ const width = span4.max - span4.min;
14731
+ return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
14415
14732
  }
14416
- return false;
14733
+ }
14734
+ if (group.dateAxis) return Array.from({ length: n }, () => null);
14735
+ return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
14417
14736
  }
14418
- function descendants2(root, ns, local) {
14419
- return Array.from(root.getElementsByTagNameNS(ns, local));
14737
+ function pointFacts(values2) {
14738
+ const numbers3 = values2.filter((x) => x !== null);
14739
+ let last = values2.length - 1;
14740
+ while (last >= 0 && values2[last] === null) last--;
14741
+ return {
14742
+ high: Math.max(...numbers3),
14743
+ low: Math.min(...numbers3),
14744
+ first: values2.findIndex((x) => x !== null),
14745
+ last
14746
+ };
14420
14747
  }
14421
- function editEntries(sheet, key, edit, quick) {
14422
- const list = sheet.preserved.get(key);
14423
- if (!list) return;
14424
- const next = [];
14425
- for (const xml of list) {
14426
- if (!quick(xml)) {
14427
- next.push(xml);
14428
- continue;
14429
- }
14430
- let doc;
14431
- try {
14432
- doc = parseXml(xml);
14433
- } catch {
14434
- next.push(xml);
14435
- continue;
14436
- }
14437
- const outcome = edit(doc.documentElement);
14438
- if (outcome === "same") next.push(xml);
14439
- else if (outcome === "changed") next.push(buildXml(doc));
14440
- }
14441
- if (next.length) sheet.preserved.set(key, next);
14442
- else sheet.preserved.delete(key);
14748
+ function pointColor(group, v, i2, facts, colors, markers) {
14749
+ let color = markers && group.markers ? colors.colorMarkers : void 0;
14750
+ if (group.negative && v < 0) color = colors.colorNegative;
14751
+ if (group.high && v === facts.high) color = colors.colorHigh;
14752
+ if (group.low && v === facts.low) color = colors.colorLow;
14753
+ if (group.first && i2 === facts.first) color = colors.colorFirst;
14754
+ if (group.last && i2 === facts.last) color = colors.colorLast;
14755
+ return color;
14443
14756
  }
14444
- function shiftBreaks(root, shift2) {
14445
- let changed = false;
14446
- for (const brk of elements(root).filter((e) => e.localName === "brk")) {
14447
- const id = Number(brk.getAttribute("id") ?? "0");
14448
- const moved = shiftIndex(id, shift2);
14449
- if (moved === id) continue;
14450
- changed = true;
14451
- if (moved === void 0 || moved === 0) root.removeChild(brk);
14452
- else brk.setAttribute("id", String(moved));
14453
- }
14454
- if (!changed) return "same";
14455
- const left2 = elements(root).filter((e) => e.localName === "brk");
14456
- if (!left2.length) return "drop";
14457
- if (root.hasAttribute("count")) root.setAttribute("count", String(left2.length));
14458
- if (root.hasAttribute("manualBreakCount")) {
14459
- const manual = left2.filter((b) => /^(1|true)$/.test(b.getAttribute("man") ?? "")).length;
14460
- root.setAttribute("manualBreakCount", String(manual));
14757
+ function resolveColors(group, theme2) {
14758
+ const out = { ...DEFAULTS };
14759
+ for (const key of Object.keys(DEFAULTS)) {
14760
+ const color = group[key];
14761
+ out[key] = resolveColor(color, theme2, DEFAULTS[key]) ?? DEFAULTS[key];
14461
14762
  }
14462
- return "changed";
14763
+ return out;
14463
14764
  }
14464
- function removeUpwards(node, root) {
14465
- let current = node;
14466
- while (current && current !== root) {
14467
- const parent = current.parentNode;
14468
- parent?.removeChild(current);
14469
- if (!parent) break;
14470
- const emptied = elements(parent).length === 0 || parent.localName === "sparklineGroup" && !elements(parent).some((e) => e.localName === "sparklines");
14765
+ function sparklineView(group, data, scale2, theme2) {
14766
+ const colors = resolveColors(group, theme2);
14767
+ const view = {
14768
+ type: group.type,
14769
+ color: colors.colorSeries,
14770
+ lineWeightPt: group.lineWeight,
14771
+ lines: [],
14772
+ markers: [],
14773
+ columns: []
14774
+ };
14775
+ const values2 = sparklineValues(group, data.values);
14776
+ const n = values2.length;
14777
+ if (!n || !scale2) return view;
14778
+ const facts = pointFacts(values2);
14779
+ const xs = positions(group, data, n);
14780
+ const flip = (x) => group.rightToLeft ? 1 - x : x;
14781
+ const range2 = scale2.max - scale2.min;
14782
+ const yOf = (v) => range2 ? Math.max(0, Math.min(1, (scale2.max - v) / range2)) : 0.5;
14783
+ if (group.type === "line") {
14784
+ let segment = [];
14785
+ values2.forEach((v, i2) => {
14786
+ const x = xs[i2];
14787
+ if (v === null || x === null || x === void 0) {
14788
+ if (group.displayEmptyCellsAs === "gap" && segment.length) {
14789
+ view.lines.push(segment);
14790
+ segment = [];
14791
+ }
14792
+ return;
14793
+ }
14794
+ const point = { x: flip(x), y: yOf(v) };
14795
+ segment.push(point);
14796
+ const color = pointColor(group, v, i2, facts, colors, true);
14797
+ if (color) view.markers.push({ ...point, color });
14798
+ });
14799
+ if (segment.length) view.lines.push(segment);
14800
+ } else {
14801
+ const dates = group.dateAxis && data.dates ? extent(data.dates) : void 0;
14802
+ const slot = dates ? 1 / Math.max(1, dates.max - dates.min + 1) : 1 / n;
14803
+ const w = slot * (1 - COLUMN_GAP);
14804
+ const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
14805
+ values2.forEach((v, i2) => {
14806
+ const position = xs[i2];
14807
+ if (v === null || position === null || position === void 0) return;
14808
+ if (v === 0) return;
14809
+ let top;
14810
+ let bottom;
14811
+ if (group.type === "stacked") [top, bottom] = v > 0 ? [0, 0.5] : [0.5, 1];
14812
+ else if (!range2) [top, bottom] = [0, 1];
14813
+ else [top, bottom] = [Math.min(base, yOf(v)), Math.max(base, yOf(v))];
14814
+ const centre = flip(slot / 2 + position * (1 - slot));
14815
+ const color = pointColor(group, v, i2, facts, colors, false) ?? view.color;
14816
+ view.columns.push({ x: centre - w / 2, y: top, w, h: bottom - top, color });
14817
+ });
14818
+ }
14819
+ if (group.type === "stacked") {
14820
+ if (group.displayXAxis) view.axis = { y: 0.5, color: colors.colorAxis };
14821
+ } else if (group.displayXAxis && range2 && scale2.min <= 0 && scale2.max >= 0)
14822
+ view.axis = { y: yOf(0), color: colors.colorAxis };
14823
+ return view;
14824
+ }
14825
+
14826
+ // xlsx/layout/sparkline-data.ts
14827
+ var MAX_POINTS = 1e4;
14828
+ var hostIndex = /* @__PURE__ */ new WeakMap();
14829
+ function hosts(sheet) {
14830
+ const groups = sheetSparklineGroups(sheet);
14831
+ let index2 = hostIndex.get(groups);
14832
+ if (!index2) {
14833
+ index2 = /* @__PURE__ */ new Map();
14834
+ for (const group of groups)
14835
+ group.sparklines.forEach((line2, i2) => {
14836
+ const key = cellKey(line2.host.start.row, line2.host.start.col);
14837
+ if (!index2.has(key)) index2.set(key, { group, index: i2 });
14838
+ });
14839
+ hostIndex.set(groups, index2);
14840
+ }
14841
+ return index2;
14842
+ }
14843
+ function hasSparklineAt(sheet, row2, col) {
14844
+ return hosts(sheet).has(cellKey(row2, col));
14845
+ }
14846
+ function resolveSparklineRange(workbook, sheet, formula) {
14847
+ const ref = formula.trim().replace(/^=/, "");
14848
+ const bang = ref.lastIndexOf("!");
14849
+ let target2 = sheet;
14850
+ if (bang >= 0) {
14851
+ const raw = ref.slice(0, bang);
14852
+ const name = /^'.*'$/.test(raw) ? raw.slice(1, -1).replace(/''/g, "'") : raw;
14853
+ target2 = sheetByName(workbook, name);
14854
+ }
14855
+ const range2 = parseRange(ref.slice(bang + 1).replace(/\$/g, ""));
14856
+ return target2 && range2 ? { sheet: target2, range: normalizeRange(range2) } : void 0;
14857
+ }
14858
+ var rowHidden = (sheet, row2) => sheet.rowInfo.get(row2)?.hidden === true;
14859
+ var colHidden = (sheet, col) => sheet.columns.some((c) => c.hidden === true && col >= c.min && col <= c.max);
14860
+ function readSparklineValues(sheet, range2, displayHidden) {
14861
+ let endRow = range2.end.row;
14862
+ if (endRow - range2.start.row >= MAX_POINTS) {
14863
+ let lastRow = range2.start.row;
14864
+ for (const row2 of sheet.rows.keys()) if (row2 > lastRow) lastRow = row2;
14865
+ endRow = Math.min(endRow, lastRow);
14866
+ }
14867
+ const out = [];
14868
+ for (let row2 = range2.start.row; row2 <= endRow && out.length < MAX_POINTS; row2++) {
14869
+ if (!displayHidden && rowHidden(sheet, row2)) continue;
14870
+ for (let col = range2.start.col; col <= range2.end.col && out.length < MAX_POINTS; col++) {
14871
+ if (!displayHidden && colHidden(sheet, col)) continue;
14872
+ const value2 = getCell(sheet, row2, col)?.value;
14873
+ out.push(typeof value2 === "number" && Number.isFinite(value2) ? value2 : null);
14874
+ }
14875
+ }
14876
+ return out;
14877
+ }
14878
+ function groupData(workbook, sheet, group) {
14879
+ const dateRange = group.dateAxis && group.dateFormula;
14880
+ const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
14881
+ const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, true) : void 0;
14882
+ return group.sparklines.map((line2) => {
14883
+ const source = line2.formula ? resolveSparklineRange(workbook, sheet, line2.formula) : void 0;
14884
+ if (group.dateAxis) {
14885
+ if (!source || !dates || !dateValues) return { values: [], dates: [] };
14886
+ const raw = readSparklineValues(source.sheet, source.range, true);
14887
+ if (raw.length !== dateValues.length) return { values: [], dates: [] };
14888
+ const hidden = (ref, i2) => {
14889
+ const columns = ref.range.end.col - ref.range.start.col + 1;
14890
+ return rowHidden(ref.sheet, ref.range.start.row + Math.floor(i2 / columns)) || colHidden(ref.sheet, ref.range.start.col + i2 % columns);
14891
+ };
14892
+ const pairs = dateValues.flatMap(
14893
+ (date, i2) => date === null || !group.displayHidden && (hidden(source, i2) || hidden(dates, i2)) ? [] : [{ date, value: raw[i2] }]
14894
+ );
14895
+ pairs.sort((a, b) => a.date - b.date);
14896
+ return { values: pairs.map((pair) => pair.value), dates: pairs.map((pair) => pair.date) };
14897
+ }
14898
+ const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
14899
+ return { values: values2 };
14900
+ });
14901
+ }
14902
+ function sparklineViewAt(workbook, sheetIndex2, row2, col) {
14903
+ const sheet = workbook.sheets[sheetIndex2];
14904
+ if (!sheet) return void 0;
14905
+ const entry = hosts(sheet).get(cellKey(row2, col));
14906
+ if (!entry) return void 0;
14907
+ const { group, index: index2 } = entry;
14908
+ const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
14909
+ const data = needsGroup ? groupData(workbook, sheet, group) : groupData(workbook, sheet, { ...group, sparklines: [group.sparklines[index2]] });
14910
+ const at = needsGroup ? index2 : 0;
14911
+ return sparklineView(
14912
+ group,
14913
+ data[at] ?? { values: [] },
14914
+ sparklineScale(group, data, at),
14915
+ workbook.theme
14916
+ );
14917
+ }
14918
+
14919
+ // xlsx/edit/context.ts
14920
+ function sheetAt(workbook, index2) {
14921
+ const sheet = Number.isInteger(index2) ? workbook.sheets[index2] : void 0;
14922
+ if (!sheet) throw new RangeError(`No sheet at index ${index2}`);
14923
+ return sheet;
14924
+ }
14925
+ function baseStyleId(sheet, row2, col) {
14926
+ const rowStyle = sheet.rowInfo.get(row2)?.styleId;
14927
+ if (rowStyle) return rowStyle;
14928
+ const column = sheet.columns.find((c) => col >= c.min && col <= c.max);
14929
+ return column?.styleId || void 0;
14930
+ }
14931
+ function ensureCell(sheet, row2, col) {
14932
+ const existing = getCell(sheet, row2, col);
14933
+ if (existing) return existing;
14934
+ const cell = { value: null };
14935
+ const styleId = baseStyleId(sheet, row2, col);
14936
+ if (styleId) cell.styleId = styleId;
14937
+ putCell(sheet, row2, col, cell);
14938
+ return cell;
14939
+ }
14940
+ var isWholeColumns = (range2) => range2.start.row === 0 && range2.end.row >= MAX_ROW;
14941
+ var isWholeRows = (range2) => range2.start.col === 0 && range2.end.col >= MAX_COL;
14942
+ function clipToUsed(sheet, range2) {
14943
+ const r = normalizeRange(range2);
14944
+ const used = usedRange(sheet);
14945
+ if (!used) return void 0;
14946
+ const start = {
14947
+ row: Math.max(r.start.row, used.start.row),
14948
+ col: Math.max(r.start.col, used.start.col)
14949
+ };
14950
+ const end = { row: Math.min(r.end.row, used.end.row), col: Math.min(r.end.col, used.end.col) };
14951
+ return start.row > end.row || start.col > end.col ? void 0 : { start, end };
14952
+ }
14953
+ var DENSE_LIMIT = 25e4;
14954
+ function forEachPosition(sheet, range2, visit2) {
14955
+ let r = normalizeRange(range2);
14956
+ const size = (r.end.row - r.start.row + 1) * (r.end.col - r.start.col + 1);
14957
+ if (size > DENSE_LIMIT) r = clipToUsed(sheet, r);
14958
+ if (!r) return;
14959
+ for (let row2 = r.start.row; row2 <= r.end.row; row2++)
14960
+ for (let col = r.start.col; col <= r.end.col; col++) visit2(row2, col);
14961
+ }
14962
+ function rawText(value2) {
14963
+ if (value2 === null) return "";
14964
+ if (isCellError(value2)) return value2.error;
14965
+ if (typeof value2 === "boolean") return value2 ? "TRUE" : "FALSE";
14966
+ return String(value2);
14967
+ }
14968
+ function pruneCell(sheet, row2, col) {
14969
+ const cell = getCell(sheet, row2, col);
14970
+ if (!cell) return;
14971
+ if (cell.value === null && cell.formula === void 0 && !cell.styleId && !cell.richText) {
14972
+ const cells = sheet.rows.get(row2);
14973
+ cells?.delete(col);
14974
+ if (cells && cells.size === 0) sheet.rows.delete(row2);
14975
+ }
14976
+ }
14977
+
14978
+ // xlsx/edit/shift-preserved.ts
14979
+ var XM3 = "http://schemas.microsoft.com/office/excel/2006/main";
14980
+ function hasPreservedOverflow(sheet, shift2, clipped, banded) {
14981
+ const keys = banded ? ["extLst"] : [shift2.axis === "row" ? "rowBreaks" : "colBreaks", "extLst"];
14982
+ for (const key of keys)
14983
+ for (const xml of sheet.preserved.get(key) ?? []) {
14984
+ if (!xml.includes(key === "extLst" ? "sqref" : "brk")) continue;
14985
+ let root;
14986
+ try {
14987
+ root = parseXml(xml).documentElement;
14988
+ } catch {
14989
+ continue;
14990
+ }
14991
+ if (key === "extLst") {
14992
+ if (descendants2(root, XM3, "sqref").some(
14993
+ (node) => parseSqref(node.textContent ?? "").some(clipped)
14994
+ ))
14995
+ return true;
14996
+ } else if (elements(root).some(
14997
+ (node) => node.localName === "brk" && shiftIndex(Number(node.getAttribute("id") ?? "0"), shift2) === void 0
14998
+ ))
14999
+ return true;
15000
+ }
15001
+ return false;
15002
+ }
15003
+ function descendants2(root, ns, local) {
15004
+ return Array.from(root.getElementsByTagNameNS(ns, local));
15005
+ }
15006
+ function editEntries(sheet, key, edit, quick) {
15007
+ const list = sheet.preserved.get(key);
15008
+ if (!list) return;
15009
+ const next = [];
15010
+ for (const xml of list) {
15011
+ if (!quick(xml)) {
15012
+ next.push(xml);
15013
+ continue;
15014
+ }
15015
+ let doc;
15016
+ try {
15017
+ doc = parseXml(xml);
15018
+ } catch {
15019
+ next.push(xml);
15020
+ continue;
15021
+ }
15022
+ const outcome = edit(doc.documentElement);
15023
+ if (outcome === "same") next.push(xml);
15024
+ else if (outcome === "changed") next.push(buildXml(doc));
15025
+ }
15026
+ if (next.length) sheet.preserved.set(key, next);
15027
+ else sheet.preserved.delete(key);
15028
+ }
15029
+ function shiftBreaks(root, shift2) {
15030
+ let changed = false;
15031
+ for (const brk of elements(root).filter((e) => e.localName === "brk")) {
15032
+ const id = Number(brk.getAttribute("id") ?? "0");
15033
+ const moved = shiftIndex(id, shift2);
15034
+ if (moved === id) continue;
15035
+ changed = true;
15036
+ if (moved === void 0 || moved === 0) root.removeChild(brk);
15037
+ else brk.setAttribute("id", String(moved));
15038
+ }
15039
+ if (!changed) return "same";
15040
+ const left2 = elements(root).filter((e) => e.localName === "brk");
15041
+ if (!left2.length) return "drop";
15042
+ if (root.hasAttribute("count")) root.setAttribute("count", String(left2.length));
15043
+ if (root.hasAttribute("manualBreakCount")) {
15044
+ const manual = left2.filter((b) => /^(1|true)$/.test(b.getAttribute("man") ?? "")).length;
15045
+ root.setAttribute("manualBreakCount", String(manual));
15046
+ }
15047
+ return "changed";
15048
+ }
15049
+ function removeUpwards(node, root) {
15050
+ let current = node;
15051
+ while (current && current !== root) {
15052
+ const parent = current.parentNode;
15053
+ parent?.removeChild(current);
15054
+ if (!parent) break;
15055
+ const emptied = elements(parent).length === 0 || parent.localName === "sparklineGroup" && !elements(parent).some((e) => e.localName === "sparklines");
14471
15056
  if (!emptied) break;
14472
15057
  current = parent;
14473
15058
  }
@@ -14577,6 +15162,13 @@ function rewriteFormulas(workbook, rewrite, formulaCells) {
14577
15162
  }
14578
15163
  function rewriteSheetFormulas(sheet, rewrite, formulaCells) {
14579
15164
  rewritePreservedFormulas(sheet, rewrite);
15165
+ for (const pivot of sheet.pivotTables ?? []) {
15166
+ const next = safe(rewrite, pivot.source, sheet.name);
15167
+ if (next !== pivot.source) {
15168
+ pivot.source = next;
15169
+ pivot.dirty = true;
15170
+ }
15171
+ }
14580
15172
  {
14581
15173
  const name = sheet.name;
14582
15174
  for (const table2 of sheet.tables)
@@ -14929,20 +15521,20 @@ function addRowIntersections(sheet, r, patcher) {
14929
15521
  }
14930
15522
 
14931
15523
  // xlsx/edit/format.ts
14932
- function stylePatcher(workbook, patch) {
15524
+ function stylePatcher(workbook, patch2) {
14933
15525
  const memo = /* @__PURE__ */ new Map();
14934
15526
  return (id) => {
14935
15527
  const key = id ?? 0;
14936
15528
  let next = memo.get(key);
14937
15529
  if (next === void 0) {
14938
- next = applyStylePatch(workbook, id, patch);
15530
+ next = applyStylePatch(workbook, id, patch2);
14939
15531
  memo.set(key, next);
14940
15532
  }
14941
15533
  return next;
14942
15534
  };
14943
15535
  }
14944
- function patchRange(workbook, sheet, range2, patch) {
14945
- patchRangeWith(sheet, range2, stylePatcher(workbook, patch));
15536
+ function patchRange(workbook, sheet, range2, patch2) {
15537
+ patchRangeWith(sheet, range2, stylePatcher(workbook, patch2));
14946
15538
  }
14947
15539
  function patchRangeWith(sheet, range2, patcher) {
14948
15540
  const r = normalizeRange(range2);
@@ -14987,11 +15579,11 @@ function formatScopes(index2, ranges) {
14987
15579
  const whole = ranges.some((r) => isWholeColumns(r) || isWholeRows(r));
14988
15580
  return whole ? [cells, { kind: "parts", sheet: index2, parts: ["columns", "rowInfo"] }] : [cells];
14989
15581
  }
14990
- function applyStyle(ctx, s, ranges, patch) {
15582
+ function applyStyle(ctx, s, ranges, patch2) {
14991
15583
  const sheet = sheetAt(ctx.workbook, s);
14992
15584
  const normalized = ranges.map(normalizeRange);
14993
15585
  if (!normalized.length) return;
14994
- const patcher = stylePatcher(ctx.workbook, patch);
15586
+ const patcher = stylePatcher(ctx.workbook, patch2);
14995
15587
  ctx.run(
14996
15588
  "Format cells",
14997
15589
  "format",
@@ -15042,13 +15634,13 @@ function linearTrend(values2) {
15042
15634
  const n = values2.length;
15043
15635
  const meanX = (n - 1) / 2;
15044
15636
  const meanY = values2.reduce((a, b) => a + b, 0) / n;
15045
- let num2 = 0;
15637
+ let num3 = 0;
15046
15638
  let den = 0;
15047
15639
  values2.forEach((y, x) => {
15048
- num2 += (x - meanX) * (y - meanY);
15640
+ num3 += (x - meanX) * (y - meanY);
15049
15641
  den += (x - meanX) ** 2;
15050
15642
  });
15051
- const slope = den ? num2 / den : 0;
15643
+ const slope = den ? num3 / den : 0;
15052
15644
  return (k) => Number((meanY + slope * (k - meanX)).toPrecision(15));
15053
15645
  }
15054
15646
  var isDigit5 = (ch) => ch !== void 0 && ch >= "0" && ch <= "9";
@@ -15651,6 +16243,17 @@ function setBorders(ctx, s, range2, preset, edge = { style: "thin" }) {
15651
16243
 
15652
16244
  // xlsx/edit/insert-guard.ts
15653
16245
  function assertInsertFits(sheet, shift2, band) {
16246
+ for (const pivot of sheet.pivotTables ?? []) {
16247
+ const start = pivot.location.start[shift2.axis];
16248
+ const end = pivot.location.end[shift2.axis];
16249
+ const other2 = shift2.axis === "row" ? "col" : "row";
16250
+ if (band && (band.hi < pivot.location.start[other2] || band.lo > pivot.location.end[other2]))
16251
+ continue;
16252
+ const partial = band && (band.lo > pivot.location.start[other2] || band.hi < pivot.location.end[other2]);
16253
+ const overlap = shift2.count > 0 ? shift2.at > start && shift2.at <= end : shift2.at <= end && shift2.at - shift2.count > start;
16254
+ if (overlap || partial && shift2.at <= end)
16255
+ throw new Error("Cannot move or remove part of a PivotTable. Delete the PivotTable first.");
16256
+ }
15654
16257
  if (shift2.count <= 0) return;
15655
16258
  const max = shift2.axis === "row" ? MAX_ROW : MAX_COL;
15656
16259
  if (shift2.at + shift2.count > max + 1)
@@ -15718,6 +16321,13 @@ function shiftSheetContent(sheet, shift2, band) {
15718
16321
  return range2 ? [{ ...c, address: range2.start }] : [];
15719
16322
  });
15720
16323
  sheet.tables = sheet.tables.flatMap((t) => shiftTable(sheet, t, shift2, moveRange));
16324
+ for (const pivot of sheet.pivotTables ?? []) {
16325
+ const location = moveRange(pivot.location);
16326
+ if (location) {
16327
+ pivot.location = location;
16328
+ pivot.dirty = true;
16329
+ }
16330
+ }
15721
16331
  for (const drawing of sheet.drawings) shiftAnchor(drawing.anchor, shift2, band);
15722
16332
  if (!band) shiftAxisFormats(sheet, shift2);
15723
16333
  if (sheet.autoFilter) {
@@ -15960,13 +16570,13 @@ function htmlHref(link) {
15960
16570
  const href = link?.target ? `${link.target}${link.location ? `#${link.location}` : ""}` : link?.location ? `#${link.location}` : void 0;
15961
16571
  return href && (href.startsWith("#") || hyperlinkPolicy(href).store) ? href : void 0;
15962
16572
  }
15963
- function hyperlinkFromHtmlAttributes(attrs, range2) {
15964
- const href = attrs?.get("href");
16573
+ function hyperlinkFromHtmlAttributes(attrs2, range2) {
16574
+ const href = attrs2?.get("href");
15965
16575
  if (!href || !href.startsWith("#") && !hyperlinkPolicy(href).store) return void 0;
15966
16576
  const link = { range: range2 };
15967
16577
  if (href.startsWith("#")) link.location = href.slice(1);
15968
16578
  else link.target = href;
15969
- const tooltip = attrs?.get("title");
16579
+ const tooltip = attrs2?.get("title");
15970
16580
  if (tooltip) link.tooltip = tooltip;
15971
16581
  return link;
15972
16582
  }
@@ -16063,21 +16673,21 @@ function toHtml(cells, theme2) {
16063
16673
  for (let c = 0; c < cells.cols; c++) {
16064
16674
  if (covered.has(`${r},${c}`)) continue;
16065
16675
  const cell = cells.data[r]?.[c] ?? null;
16066
- const attrs = [];
16676
+ const attrs2 = [];
16067
16677
  const span4 = spans2.get(`${r},${c}`);
16068
16678
  if (span4 && span4.end.row > span4.start.row)
16069
- attrs.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16679
+ attrs2.push(`rowspan="${span4.end.row - span4.start.row + 1}"`);
16070
16680
  if (span4 && span4.end.col > span4.start.col)
16071
- attrs.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16072
- if (cell && typeof cell.value === "number") attrs.push(`x:num="${cell.value}"`);
16681
+ attrs2.push(`colspan="${span4.end.col - span4.start.col + 1}"`);
16682
+ if (cell && typeof cell.value === "number") attrs2.push(`x:num="${cell.value}"`);
16073
16683
  const css = cssFor(cell?.style, theme2);
16074
- if (css) attrs.push(`style="${escapeHtml(css)}"`);
16684
+ if (css) attrs2.push(`style="${escapeHtml(css)}"`);
16075
16685
  let text2 = escapeHtml(cell?.text ?? "").replace(/\n/g, "<br>");
16076
16686
  const link = links.get(`${r},${c}`);
16077
16687
  const href = htmlHref(link);
16078
16688
  if (href)
16079
16689
  text2 = `<a href="${escapeHtml(href)}"${link?.tooltip ? ` title="${escapeHtml(link.tooltip)}"` : ""}>${text2}</a>`;
16080
- tds.push(`<td${attrs.length ? ` ${attrs.join(" ")}` : ""}>${text2}</td>`);
16690
+ tds.push(`<td${attrs2.length ? ` ${attrs2.join(" ")}` : ""}>${text2}</td>`);
16081
16691
  }
16082
16692
  rows2.push(`<tr>${tds.join("")}</tr>`);
16083
16693
  }
@@ -16137,12 +16747,12 @@ function decodeEntities(text2) {
16137
16747
  });
16138
16748
  }
16139
16749
  function parseAttributes(text2) {
16140
- const attrs = /* @__PURE__ */ new Map();
16750
+ const attrs2 = /* @__PURE__ */ new Map();
16141
16751
  for (const m of text2.matchAll(
16142
16752
  /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
16143
16753
  ))
16144
- attrs.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16145
- return attrs;
16754
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeEntities(m[2] ?? m[3] ?? m[4] ?? ""));
16755
+ return attrs2;
16146
16756
  }
16147
16757
  function parseCss(text2) {
16148
16758
  const out = /* @__PURE__ */ new Map();
@@ -16168,7 +16778,7 @@ var V_ALIGN = {
16168
16778
  bottom: "bottom"
16169
16779
  };
16170
16780
  function stylePatchFromCss(css, inner2) {
16171
- const patch = {};
16781
+ const patch2 = {};
16172
16782
  const font = {};
16173
16783
  const weight = css.get("font-weight");
16174
16784
  if (weight && (weight === "bold" || Number(weight) >= 600) || /<(b|strong)\b/i.test(inner2))
@@ -16184,16 +16794,16 @@ function stylePatchFromCss(css, inner2) {
16184
16794
  if (size) font.size = Number(size[1]) * (size[2] === "px" ? 0.75 : 1);
16185
16795
  const family = css.get("font-family")?.split(",")[0]?.trim().replace(/^["']|["']$/g, "");
16186
16796
  if (family) font.name = family;
16187
- if (Object.keys(font).length) patch.font = font;
16797
+ if (Object.keys(font).length) patch2.font = font;
16188
16798
  const background = css.get("background-color") ?? css.get("background");
16189
16799
  const fill = background && parseCssColor(background.split(/\s+/)[0] ?? "");
16190
- if (fill) patch.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16800
+ if (fill) patch2.fill = { type: "pattern", pattern: "solid", fgColor: fill };
16191
16801
  const h2 = H_ALIGN[css.get("text-align") ?? ""];
16192
16802
  const v = V_ALIGN[css.get("vertical-align") ?? ""];
16193
- if (h2 || v) patch.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16803
+ if (h2 || v) patch2.alignment = { ...h2 ? { horizontal: h2 } : {}, ...v ? { vertical: v } : {} };
16194
16804
  const numFmt = css.get("mso-number-format");
16195
- if (numFmt) patch.numFmt = decodeNumberFormat(numFmt);
16196
- return patch;
16805
+ if (numFmt) patch2.numFmt = decodeNumberFormat(numFmt);
16806
+ return patch2;
16197
16807
  }
16198
16808
  function removeComments(text2) {
16199
16809
  let out = "";
@@ -16268,18 +16878,18 @@ function parseHtmlTable(html, base) {
16268
16878
  /<t([dh])\b([^>]*)>([\s\S]*?)(?:<\/t[dh]>|(?=<t[dh]\b)|$)/gi
16269
16879
  )) {
16270
16880
  while (taken.has(`${r},${c}`)) c++;
16271
- const attrs = parseAttributes(td[2] ?? "");
16881
+ const attrs2 = parseAttributes(td[2] ?? "");
16272
16882
  const inner2 = td[3] ?? "";
16273
16883
  const css = /* @__PURE__ */ new Map();
16274
- for (const name of (attrs.get("class") ?? "").split(/\s+/))
16884
+ for (const name of (attrs2.get("class") ?? "").split(/\s+/))
16275
16885
  for (const [k, v] of parseCss(classes.get(name) ?? "")) css.set(k, v);
16276
- for (const [k, v] of parseCss(attrs.get("style") ?? "")) css.set(k, v);
16277
- const patch = stylePatchFromCss(css, inner2);
16278
- if (td[1]?.toLowerCase() === "h") patch.font = { bold: true, ...patch.font };
16886
+ for (const [k, v] of parseCss(attrs2.get("style") ?? "")) css.set(k, v);
16887
+ const patch2 = stylePatchFromCss(css, inner2);
16888
+ if (td[1]?.toLowerCase() === "h") patch2.font = { bold: true, ...patch2.font };
16279
16889
  const text2 = cellText(inner2);
16280
- row2[c] = text2 === "" && !Object.keys(patch).length ? null : toCell(text2, attrs, patch, base);
16281
- const rowSpan = Math.max(1, Number(attrs.get("rowspan") ?? 1) || 1);
16282
- const colSpan = Math.max(1, Number(attrs.get("colspan") ?? 1) || 1);
16890
+ row2[c] = text2 === "" && !Object.keys(patch2).length ? null : toCell(text2, attrs2, patch2, base);
16891
+ const rowSpan = Math.max(1, Number(attrs2.get("rowspan") ?? 1) || 1);
16892
+ const colSpan = Math.max(1, Number(attrs2.get("colspan") ?? 1) || 1);
16283
16893
  const anchor = /<a\b([^>]*)>/i.exec(inner2);
16284
16894
  const linkAttrs = anchor ? parseAttributes(anchor[1] ?? "") : void 0;
16285
16895
  const link = hyperlinkFromHtmlAttributes(linkAttrs, {
@@ -16309,17 +16919,17 @@ function parseHtmlTable(html, base) {
16309
16919
  );
16310
16920
  return rows2 && cols ? { rows: rows2, cols, data, merges, hyperlinks } : void 0;
16311
16921
  }
16312
- function toCell(text2, attrs, patch, base) {
16922
+ function toCell(text2, attrs2, patch2, base) {
16313
16923
  let value2 = text2;
16314
- const num2 = attrs.get("x:num");
16315
- if (num2 !== void 0 && num2 !== "" && Number.isFinite(Number(num2))) value2 = Number(num2);
16316
- else if (attrs.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16317
- else if (patch.numFmt !== "@" && text2 !== "") {
16924
+ const num3 = attrs2.get("x:num");
16925
+ if (num3 !== void 0 && num3 !== "" && Number.isFinite(Number(num3))) value2 = Number(num3);
16926
+ else if (attrs2.has("x:bool")) value2 = text2.toUpperCase() === "TRUE";
16927
+ else if (patch2.numFmt !== "@" && text2 !== "") {
16318
16928
  const parsed = parseCellInput(text2);
16319
16929
  if (parsed.formula === void 0) value2 = parsed.value;
16320
- if (!patch.numFmt && parsed.numFmt && typeof value2 === "number") patch.numFmt = parsed.numFmt;
16930
+ if (!patch2.numFmt && parsed.numFmt && typeof value2 === "number") patch2.numFmt = parsed.numFmt;
16321
16931
  }
16322
- return { value: value2, text: text2, style: patchStyle(base, patch) };
16932
+ return { value: value2, text: text2, style: patchStyle(base, patch2) };
16323
16933
  }
16324
16934
 
16325
16935
  // xlsx/edit/clipboard-text.ts
@@ -17866,10 +18476,10 @@ var SessionCalculator = class {
17866
18476
 
17867
18477
  // xlsx/edit/doc-properties.ts
17868
18478
  var same2 = (a, b) => JSON.stringify(a) === JSON.stringify(b);
17869
- function setDocumentProperties(ctx, patch) {
18479
+ function setDocumentProperties(ctx, patch2) {
17870
18480
  const prior = ctx.workbook.properties;
17871
18481
  const next = { ...prior };
17872
- for (const [key, value2] of Object.entries(patch)) {
18482
+ for (const [key, value2] of Object.entries(patch2)) {
17873
18483
  if (value2 === void 0) continue;
17874
18484
  if (value2 === null) delete next[key];
17875
18485
  else next[key] = structuredClone(value2);
@@ -17922,6 +18532,444 @@ function deleteDrawing(ctx, s, index2) {
17922
18532
  );
17923
18533
  }
17924
18534
 
18535
+ // xlsx/edit/sparkline-xml.ts
18536
+ var XM4 = "http://schemas.microsoft.com/office/excel/2006/main";
18537
+ var URI = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
18538
+ var COLORS2 = [
18539
+ "colorSeries",
18540
+ "colorNegative",
18541
+ "colorAxis",
18542
+ "colorMarkers",
18543
+ "colorFirst",
18544
+ "colorLast",
18545
+ "colorHigh",
18546
+ "colorLow"
18547
+ ];
18548
+ var SCALARS = [
18549
+ "type",
18550
+ "lineWeight",
18551
+ "markers",
18552
+ "high",
18553
+ "low",
18554
+ "first",
18555
+ "last",
18556
+ "negative",
18557
+ "displayEmptyCellsAs",
18558
+ "displayXAxis",
18559
+ "displayHidden",
18560
+ "rightToLeft",
18561
+ "minAxisType",
18562
+ "maxAxisType",
18563
+ "manualMin",
18564
+ "manualMax"
18565
+ ];
18566
+ function cleanSparklinePatch(patch2) {
18567
+ return Object.fromEntries(
18568
+ [...SCALARS, ...COLORS2].flatMap((key) => patch2[key] === void 0 ? [] : [[key, patch2[key]]])
18569
+ );
18570
+ }
18571
+ function patchSparklineNode(node, patch2) {
18572
+ for (const key of SCALARS) {
18573
+ const value2 = patch2[key];
18574
+ if (value2 === void 0) continue;
18575
+ node.setAttribute(key, typeof value2 === "boolean" ? value2 ? "1" : "0" : String(value2));
18576
+ }
18577
+ if (patch2.minAxisType && patch2.minAxisType !== "custom") node.removeAttribute("manualMin");
18578
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom") node.removeAttribute("manualMax");
18579
+ for (const key of COLORS2) {
18580
+ const color = patch2[key];
18581
+ if (!color) continue;
18582
+ const fresh = parseXml(
18583
+ `<x14:root xmlns:x14="${NS.x14}">${colorXml(color, `x14:${key}`)}</x14:root>`
18584
+ ).documentElement.firstChild;
18585
+ const replacement = node.ownerDocument.importNode(fresh, true);
18586
+ const old = first(node, key, NS.x14);
18587
+ if (old) node.replaceChild(replacement, old);
18588
+ else {
18589
+ const before = elements(node).find((child) => {
18590
+ const index2 = COLORS2.indexOf(child.localName);
18591
+ return index2 > COLORS2.indexOf(key) || child.localName === "f" || child.localName === "sparklines";
18592
+ });
18593
+ node.insertBefore(replacement, before ?? null);
18594
+ }
18595
+ }
18596
+ }
18597
+ function editSparklineXml(sheet, edit) {
18598
+ return (sheet.preserved.get("extLst") ?? []).map((xml) => {
18599
+ if (!xml.includes("sparklineGroup")) return xml;
18600
+ const doc = parseXml(xml);
18601
+ let changed = false;
18602
+ for (const node of Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup"))) {
18603
+ if (!edit(node, readSparklineGroup(node))) continue;
18604
+ changed = true;
18605
+ const lines = first(node, "sparklines", NS.x14);
18606
+ if (!lines || !children(lines, "sparkline", NS.x14).length) {
18607
+ const groups = node.parentNode;
18608
+ groups.removeChild(node);
18609
+ if (!children(groups, "sparklineGroup", NS.x14).length)
18610
+ groups.parentNode.removeChild(groups);
18611
+ }
18612
+ }
18613
+ return changed ? buildXml(doc.documentElement) : xml;
18614
+ });
18615
+ }
18616
+ function appendSparklineXml(sheet, groupXml) {
18617
+ const source = [...sheet.preserved.get("extLst") ?? []];
18618
+ const found = source.findIndex((xml) => xml.includes("sparklineGroups"));
18619
+ const index2 = found >= 0 ? found : 0;
18620
+ const doc = parseXml(source[index2] ?? `<extLst xmlns="${NS.x}"/>`);
18621
+ const root = doc.documentElement;
18622
+ let ext = children(root, "ext", NS.x).find(
18623
+ (node) => node.getAttribute("uri")?.toUpperCase() === URI.toUpperCase()
18624
+ );
18625
+ if (!ext) {
18626
+ ext = doc.createElementNS(NS.x, "ext");
18627
+ ext.setAttribute("uri", URI);
18628
+ ext.setAttribute("xmlns:x14", NS.x14);
18629
+ root.appendChild(ext);
18630
+ }
18631
+ ext.setAttribute("uri", URI);
18632
+ let groups = first(ext, "sparklineGroups", NS.x14);
18633
+ if (!groups) {
18634
+ groups = doc.createElementNS(NS.x14, "x14:sparklineGroups");
18635
+ groups.setAttribute("xmlns:xm", XM4);
18636
+ ext.appendChild(groups);
18637
+ }
18638
+ const fresh = doc.importNode(parseXml(groupXml).documentElement, true);
18639
+ const revision = "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2";
18640
+ if (Array.from(doc.getElementsByTagNameNS(NS.x14, "sparklineGroup")).some(
18641
+ (node) => node.hasAttributeNS(revision, "uid")
18642
+ )) {
18643
+ fresh.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xr2", revision);
18644
+ fresh.setAttributeNS(revision, "xr2:uid", `{${globalThis.crypto.randomUUID().toUpperCase()}}`);
18645
+ }
18646
+ groups.appendChild(fresh);
18647
+ source[index2] = buildXml(root);
18648
+ return source;
18649
+ }
18650
+
18651
+ // xlsx/edit/sparklines.ts
18652
+ function selectedSparklineGroups(sheet, ranges) {
18653
+ return sheetSparklineGroups(sheet).filter(
18654
+ (group) => group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host)))
18655
+ );
18656
+ }
18657
+ function validateSettings(group) {
18658
+ for (const key of [
18659
+ "markers",
18660
+ "high",
18661
+ "low",
18662
+ "first",
18663
+ "last",
18664
+ "negative",
18665
+ "displayXAxis",
18666
+ "displayHidden",
18667
+ "rightToLeft"
18668
+ ])
18669
+ if (typeof group[key] !== "boolean") throw new Error("The sparkline settings are not valid.");
18670
+ if (!["line", "column", "stacked"].includes(group.type) || !["gap", "zero", "span"].includes(group.displayEmptyCellsAs) || !["individual", "group", "custom"].includes(group.minAxisType) || !["individual", "group", "custom"].includes(group.maxAxisType))
18671
+ throw new Error("The sparkline settings are not valid.");
18672
+ if (!Number.isFinite(group.lineWeight) || group.lineWeight < 0 || group.lineWeight > 1584)
18673
+ throw new Error("The sparkline settings are not valid.");
18674
+ if (group.minAxisType === "custom" && !Number.isFinite(group.manualMin) || group.maxAxisType === "custom" && !Number.isFinite(group.manualMax) || group.minAxisType === "custom" && group.maxAxisType === "custom" && group.manualMin > group.manualMax)
18675
+ throw new Error("The sparkline axis limits are not valid.");
18676
+ if (group.manualMin !== void 0 && group.minAxisType !== "custom" || group.manualMax !== void 0 && group.maxAxisType !== "custom")
18677
+ throw new Error("The sparkline axis limits are not valid.");
18678
+ for (const key of [
18679
+ "colorSeries",
18680
+ "colorNegative",
18681
+ "colorAxis",
18682
+ "colorMarkers",
18683
+ "colorFirst",
18684
+ "colorLast",
18685
+ "colorHigh",
18686
+ "colorLow"
18687
+ ]) {
18688
+ const color = group[key];
18689
+ if (color !== void 0 && (color === null || typeof color !== "object" || Array.isArray(color) || ![color.rgb, color.theme, color.indexed].some((value2) => value2 !== void 0)))
18690
+ throw new Error("The sparkline settings are not valid.");
18691
+ if (color && (color.auto || color.rgb !== void 0 && !/^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(color.rgb) || color.theme !== void 0 && (!Number.isInteger(color.theme) || color.theme < 0 || color.theme > 11) || color.indexed !== void 0 && (!Number.isInteger(color.indexed) || color.indexed < 0 || color.indexed > 65) || color.tint !== void 0 && (!Number.isFinite(color.tint) || color.tint < -1 || color.tint > 1)))
18692
+ throw new Error("The sparkline settings are not valid.");
18693
+ }
18694
+ }
18695
+ function validatePatch(group, patch2) {
18696
+ const next = { ...group, ...patch2 };
18697
+ if (patch2.minAxisType && patch2.minAxisType !== "custom" && patch2.manualMin === void 0)
18698
+ delete next.manualMin;
18699
+ if (patch2.maxAxisType && patch2.maxAxisType !== "custom" && patch2.manualMax === void 0)
18700
+ delete next.manualMax;
18701
+ validateSettings(next);
18702
+ }
18703
+ function save(ctx, s, next, label3, ranges) {
18704
+ const sheet = sheetAt(ctx.workbook, s);
18705
+ ctx.run(
18706
+ label3,
18707
+ "annotations",
18708
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
18709
+ () => sheet.preserved.set("extLst", next),
18710
+ { sheet: s, ranges }
18711
+ );
18712
+ }
18713
+ function createSparklineGroup(ctx, s, source, locations, patch2 = {}) {
18714
+ patch2 = cleanSparklinePatch(patch2);
18715
+ locations = checkedSparklineRange(locations);
18716
+ const sheet = sheetAt(ctx.workbook, s);
18717
+ const lines = newSparklines(ctx.workbook, s, source, locations);
18718
+ if (selectedSparklineGroups(sheet, [locations]).length)
18719
+ throw new Error("The location range already contains sparklines.");
18720
+ if (sheet.merges.some((merge2) => lines.some((line2) => rangesIntersect(merge2, line2.host))))
18721
+ throw new Error("Sparklines cannot be created in merged cells.");
18722
+ const body2 = lines.map(
18723
+ (line2) => `<x14:sparkline>${el("xm:f", {}, escapeText(line2.formula))}${el("xm:sqref", {}, formatRange(line2.host))}</x14:sparkline>`
18724
+ ).join("");
18725
+ const colors = '<x14:colorSeries theme="4"/><x14:colorNegative rgb="FFD00000"/><x14:colorAxis rgb="FF000000"/>' + ["Markers", "First", "Last", "High", "Low"].map((name) => `<x14:color${name} rgb="FFD00000"/>`).join("");
18726
+ const doc = parseXml(
18727
+ `<x14:sparklineGroup xmlns:x14="${NS.x14}" xmlns:xm="${XM4}">${colors}<x14:sparklines>${body2}</x14:sparklines></x14:sparklineGroup>`
18728
+ );
18729
+ const node = doc.documentElement;
18730
+ validatePatch(readSparklineGroup(node), patch2);
18731
+ patchSparklineNode(node, { displayEmptyCellsAs: "gap", ...patch2 });
18732
+ validateSettings({ ...readSparklineGroup(node), ...patch2 });
18733
+ save(ctx, s, appendSparklineXml(sheet, buildXml(node)), "Create sparklines", [locations]);
18734
+ }
18735
+ function setSparklineGroups(ctx, s, ranges, patch2) {
18736
+ patch2 = cleanSparklinePatch(patch2);
18737
+ const sheet = sheetAt(ctx.workbook, s);
18738
+ ranges = ranges.map(checkedSparklineRange);
18739
+ const selected2 = selectedSparklineGroups(sheet, ranges);
18740
+ if (!selected2.length) return;
18741
+ for (const group of selected2) validatePatch(group, patch2);
18742
+ const next = editSparklineXml(sheet, (node, group) => {
18743
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18744
+ return false;
18745
+ patchSparklineNode(node, patch2);
18746
+ return true;
18747
+ });
18748
+ save(ctx, s, next, "Format sparklines", ranges);
18749
+ }
18750
+ function setSparklineDateRange(ctx, s, ranges, source = "") {
18751
+ ranges = ranges.map(checkedSparklineRange);
18752
+ const sheet = sheetAt(ctx.workbook, s);
18753
+ const groups = selectedSparklineGroups(sheet, ranges);
18754
+ if (!groups.length) return;
18755
+ let formula;
18756
+ if (source.trim()) {
18757
+ const data = sparklineDataRange(ctx.workbook, s, source);
18758
+ const length = (range2) => {
18759
+ const rows2 = range2.end.row - range2.start.row + 1;
18760
+ const cols = range2.end.col - range2.start.col + 1;
18761
+ if (rows2 > 1 && cols > 1) throw new Error("The date range must be one row or column.");
18762
+ return Math.max(rows2, cols);
18763
+ };
18764
+ const count2 = length(data.range);
18765
+ if (count2 > 1e4) throw new Error("The sparkline date range is too large.");
18766
+ for (const group of groups)
18767
+ for (const line2 of group.sparklines) {
18768
+ const values2 = sparklineDataRange(ctx.workbook, s, line2.formula ?? "");
18769
+ if (length(values2.range) !== count2)
18770
+ throw new Error("The data range and date range do not match.");
18771
+ }
18772
+ formula = `'${ctx.workbook.sheets[data.sheet].name.replaceAll("'", "''")}'!${formatRange(data.range)}`;
18773
+ }
18774
+ const next = editSparklineXml(sheet, (node, group) => {
18775
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18776
+ return false;
18777
+ for (const old of children(node, "f", XM4)) node.removeChild(old);
18778
+ node.setAttribute("dateAxis", formula ? "1" : "0");
18779
+ if (formula) {
18780
+ const value2 = node.ownerDocument.createElementNS(XM4, "xm:f");
18781
+ value2.textContent = formula;
18782
+ node.insertBefore(value2, first(node, "sparklines", NS.x14) ?? null);
18783
+ }
18784
+ return true;
18785
+ });
18786
+ save(ctx, s, next, "Change sparkline date axis", ranges);
18787
+ }
18788
+ function deleteSparklines(ctx, s, ranges, wholeGroups = false) {
18789
+ ranges = ranges.map(checkedSparklineRange);
18790
+ const sheet = sheetAt(ctx.workbook, s);
18791
+ if (!selectedSparklineGroups(sheet, ranges).length) return;
18792
+ const next = editSparklineXml(sheet, (node, group) => {
18793
+ if (!group.sparklines.some((line2) => ranges.some((range2) => rangesIntersect(range2, line2.host))))
18794
+ return false;
18795
+ const lines = first(node, "sparklines", NS.x14);
18796
+ const nodes = children(lines, "sparkline", NS.x14);
18797
+ for (const line2 of nodes) {
18798
+ const host = parseRange(first(line2, "sqref", XM4)?.textContent ?? "");
18799
+ if (wholeGroups || host && ranges.some((range2) => rangesIntersect(range2, host)))
18800
+ line2.parentNode?.removeChild(line2);
18801
+ }
18802
+ return true;
18803
+ });
18804
+ save(ctx, s, next, "Clear sparklines", ranges);
18805
+ }
18806
+
18807
+ // xlsx/edit/pivots.ts
18808
+ function pivotAt(ctx, sheet, name) {
18809
+ const pivot = sheetAt(ctx.workbook, sheet).pivotTables?.find((entry) => entry.name === name);
18810
+ if (!pivot) throw new Error("The selected PivotTable is not available.");
18811
+ return pivot;
18812
+ }
18813
+ function uniqueName(ctx) {
18814
+ const used = reservedPivotNames(ctx.workbook);
18815
+ for (let i2 = 1; ; i2++) if (!used.has(`pivottable${i2}`)) return `PivotTable${i2}`;
18816
+ }
18817
+ function reservedPivotNames(workbook) {
18818
+ return new Set(
18819
+ workbook.sheets.flatMap((sheet) => [
18820
+ ...(sheet.pivotTables ?? []).map((pivot) => pivot.name),
18821
+ ...sheet.preserved.get("source:unsupportedPivotNames") ?? []
18822
+ ]).map((name) => name.toLowerCase())
18823
+ );
18824
+ }
18825
+ function checkName(ctx, name) {
18826
+ if (!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(name) || name.length > 255 || parseAddress(name) || reservedPivotNames(ctx.workbook).has(name.toLowerCase()))
18827
+ throw new Error("A PivotTable name must be unique and cannot look like a cell reference.");
18828
+ }
18829
+ function plan(ctx, s, pivot, old) {
18830
+ const sheet = sheetAt(ctx.workbook, s);
18831
+ const grid6 = pivotGrid(pivot);
18832
+ const start = pivot.location.start;
18833
+ const location = {
18834
+ start,
18835
+ end: {
18836
+ row: start.row + grid6.values.length - 1,
18837
+ col: start.col + (grid6.values[0]?.length ?? 0) - 1
18838
+ }
18839
+ };
18840
+ if (![start.row, start.col].every(Number.isInteger) || start.row < 0 || start.col < 0 || location.end.row > MAX_ROW || location.end.col > MAX_COL)
18841
+ throw new Error("The PivotTable result does not fit on the worksheet.");
18842
+ const source = sparklineDataRange(ctx.workbook, s, pivot.source);
18843
+ if (source.sheet === s && rangesIntersect(source.range, location) || sheet.merges.some((range2) => rangesIntersect(range2, location)) || sheet.tables.some((table2) => rangesIntersect(table2.range, location)) || sheet.pivotTables?.some((other) => other !== old && rangesIntersect(other.location, location)))
18844
+ throw new Error("The PivotTable would overlap source data, another table or merged cells.");
18845
+ let occupied = false;
18846
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
18847
+ if ((!old || !rangeContains(old.location, { row: row2, col })) && (cell.value !== null || cell.formula !== void 0))
18848
+ occupied = true;
18849
+ });
18850
+ if (occupied) throw new Error("The PivotTable would overwrite existing cell content.");
18851
+ return { grid: grid6, location };
18852
+ }
18853
+ function write(ctx, s, pivot, old) {
18854
+ const sheet = sheetAt(ctx.workbook, s);
18855
+ const { grid: grid6, location } = plan(ctx, s, pivot, old);
18856
+ const ranges = [...old ? [old.location] : [], location];
18857
+ ctx.run(
18858
+ old ? "Refresh PivotTable" : "Create PivotTable",
18859
+ "annotations",
18860
+ [
18861
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
18862
+ { kind: "cells", sheet: s, ranges }
18863
+ ],
18864
+ () => {
18865
+ const compact3 = pivot.layout === "compact";
18866
+ const indents = [
18867
+ stylePatcher(ctx.workbook, {
18868
+ alignment: { indent: 0, ...compact3 ? { horizontal: "left" } : {} }
18869
+ }),
18870
+ stylePatcher(ctx.workbook, { alignment: { indent: 1, horizontal: "left" } })
18871
+ ];
18872
+ const styles = /* @__PURE__ */ new Map();
18873
+ forEachCellInRange(sheet, location, (cell, row2, col) => {
18874
+ if (cell.styleId !== void 0) styles.set(`${row2}:${col}`, cell.styleId);
18875
+ });
18876
+ if (old)
18877
+ forEachCellInRange(sheet, old.location, (cell, row2, col) => {
18878
+ if (cell.styleId !== void 0)
18879
+ putCell(sheet, row2, col, { value: null, styleId: cell.styleId });
18880
+ else deleteCell(sheet, row2, col);
18881
+ });
18882
+ const next = { ...pivot, location, dirty: true };
18883
+ const list = sheet.pivotTables ?? [];
18884
+ sheet.pivotTables = old ? list.map((entry) => entry === old ? next : entry) : [...list, next];
18885
+ grid6.values.forEach(
18886
+ (line2, row2) => line2.forEach((value2, col) => {
18887
+ const r = startRow(location, row2);
18888
+ const c = location.start.col + col;
18889
+ let styleId = styles.get(`${r}:${c}`);
18890
+ if (col < (grid6.rowLabelColumns ?? 1)) {
18891
+ const indent = col === 0 ? grid6.indents?.[row2] ?? 0 : 0;
18892
+ const alignment = styleAt(ctx.workbook, styleId).alignment;
18893
+ if ((alignment?.indent ?? 0) !== indent || compact3 && alignment?.horizontal !== "left")
18894
+ styleId = indents[indent](styleId);
18895
+ }
18896
+ putCell(sheet, r, c, { value: value2, ...styleId !== void 0 ? { styleId } : {} });
18897
+ })
18898
+ );
18899
+ },
18900
+ { sheet: s, ranges }
18901
+ );
18902
+ }
18903
+ var startRow = (range2, offset2) => range2.start.row + offset2;
18904
+ function createPivotTable(ctx, s, destination, options) {
18905
+ const data = pivotSourceData(ctx.workbook, s, options.source);
18906
+ const name = options.name ?? uniqueName(ctx);
18907
+ checkName(ctx, name);
18908
+ const aggregate3 = options.aggregate ?? "sum";
18909
+ const pivot = {
18910
+ ...data,
18911
+ name,
18912
+ rowField: options.rowField,
18913
+ layout: options.layout ?? "tabular",
18914
+ subtotalPosition: options.subtotalPosition ?? (options.layout && options.layout !== "tabular" ? "top" : "bottom"),
18915
+ ...options.secondRowField ? { secondRowField: options.secondRowField } : {},
18916
+ ...options.subtotals !== void 0 ? { subtotals: options.subtotals } : {},
18917
+ ...options.repeatLabels !== void 0 ? { repeatLabels: options.repeatLabels } : {},
18918
+ valueField: options.valueField,
18919
+ aggregate: aggregate3,
18920
+ valueCaption: pivotCaption(aggregate3, options.valueField),
18921
+ location: { start: { ...destination }, end: { ...destination } },
18922
+ ...options.columnField ? { columnField: options.columnField } : {}
18923
+ };
18924
+ validatePivotFields(pivot);
18925
+ write(ctx, s, pivot);
18926
+ return name;
18927
+ }
18928
+ function refreshPivotTable(ctx, s, name, patch2 = {}) {
18929
+ const old = pivotAt(ctx, s, name);
18930
+ const aggregate3 = patch2.aggregate ?? old.aggregate;
18931
+ const valueField = patch2.valueField ?? old.valueField;
18932
+ const next = {
18933
+ ...old,
18934
+ ...pivotSourceData(ctx.workbook, s, old.source),
18935
+ rowField: patch2.rowField ?? old.rowField,
18936
+ valueField,
18937
+ aggregate: aggregate3,
18938
+ valueCaption: aggregate3 === old.aggregate && valueField === old.valueField ? old.valueCaption : pivotCaption(aggregate3, valueField)
18939
+ };
18940
+ if (patch2.columnField !== void 0) {
18941
+ if (patch2.columnField) next.columnField = patch2.columnField;
18942
+ else delete next.columnField;
18943
+ }
18944
+ if (patch2.secondRowField !== void 0) {
18945
+ if (patch2.secondRowField) next.secondRowField = patch2.secondRowField;
18946
+ else delete next.secondRowField;
18947
+ }
18948
+ if (patch2.subtotals !== void 0) next.subtotals = patch2.subtotals;
18949
+ if (patch2.repeatLabels !== void 0) next.repeatLabels = patch2.repeatLabels;
18950
+ if (patch2.layout !== void 0) next.layout = patch2.layout;
18951
+ if (patch2.subtotalPosition !== void 0) next.subtotalPosition = patch2.subtotalPosition;
18952
+ validatePivotFields(next);
18953
+ write(ctx, s, next, old);
18954
+ }
18955
+ function deletePivotTable(ctx, s, name) {
18956
+ const sheet = sheetAt(ctx.workbook, s);
18957
+ const pivot = pivotAt(ctx, s, name);
18958
+ ctx.run(
18959
+ "Delete PivotTable",
18960
+ "annotations",
18961
+ [
18962
+ { kind: "parts", sheet: s, parts: ["pivotTables"] },
18963
+ { kind: "cells", sheet: s, ranges: [pivot.location] }
18964
+ ],
18965
+ () => {
18966
+ sheet.pivotTables = sheet.pivotTables.filter((entry) => entry !== pivot);
18967
+ forEachCellInRange(sheet, pivot.location, (_cell, row2, col) => deleteCell(sheet, row2, col));
18968
+ },
18969
+ { sheet: s, ranges: [pivot.location] }
18970
+ );
18971
+ }
18972
+
17925
18973
  // xlsx/edit/cell-style.ts
17926
18974
  function ensureNamedStyle(workbook, name) {
17927
18975
  const lower2 = name.toLowerCase();
@@ -18029,19 +19077,19 @@ function addChart(ctx, s, chart) {
18029
19077
  { sheet: s }
18030
19078
  );
18031
19079
  }
18032
- function updateChart(ctx, s, index2, patch) {
18033
- assertBarClusterOptions(patch);
19080
+ function updateChart(ctx, s, index2, patch2) {
19081
+ assertBarClusterOptions(patch2);
18034
19082
  const sheet = sheetAt(ctx.workbook, s);
18035
19083
  const chart = sheet.drawings[index2];
18036
19084
  if (!chart || chart.kind !== "chart") throw new RangeError(`No chart at index ${index2}`);
18037
- const formatting = patch.elementFills ? chartWithElementFills(chart, patch.elementFills).formatting : void 0;
19085
+ const formatting = patch2.elementFills ? chartWithElementFills(chart, patch2.elementFills).formatting : void 0;
18038
19086
  ctx.run(
18039
19087
  "Edit chart",
18040
19088
  "annotations",
18041
19089
  [{ kind: "sheet", sheet: s }],
18042
19090
  () => {
18043
19091
  const live = sheet.drawings[index2];
18044
- const changes = structuredClone(patch);
19092
+ const changes = structuredClone(patch2);
18045
19093
  delete changes.elementFills;
18046
19094
  if (formatting) live.formatting = formatting;
18047
19095
  changes.series?.forEach((series, i2) => {
@@ -18267,6 +19315,8 @@ function resizeTableIn(workbook, sheet, id, range2) {
18267
19315
  throw new Error("The table range is too small.");
18268
19316
  if (sheet.tables.some((t) => t !== table2 && rangesIntersect(t.range, r)))
18269
19317
  throw new Error("A table cannot overlap another table.");
19318
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
19319
+ throw new Error("A table cannot overlap a PivotTable.");
18270
19320
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
18271
19321
  throw new Error("A table cannot contain merged cells.");
18272
19322
  const oldEnd = table2.range.end.row;
@@ -18289,17 +19339,17 @@ var STYLE_KEYS = [
18289
19339
  "showFirstColumn",
18290
19340
  "showLastColumn"
18291
19341
  ];
18292
- function updateTable(ctx, s, ref, patch) {
19342
+ function updateTable(ctx, s, ref, patch2) {
18293
19343
  const { workbook } = ctx;
18294
19344
  const sheet = sheetAt(workbook, s);
18295
19345
  const current = sheet.tables[tableIndex(sheet, ref)];
18296
- const name = patch.name ?? patch.displayName;
19346
+ const name = patch2.name ?? patch2.displayName;
18297
19347
  const renaming = name !== void 0 && name !== current.name;
18298
19348
  if (renaming) {
18299
19349
  const problem = validateTableName(workbook, name, current);
18300
19350
  if (problem) throw new Error(problem);
18301
19351
  }
18302
- const wide = renaming || patch.headerRow !== void 0 || patch.totalsRow !== void 0;
19352
+ const wide = renaming || patch2.headerRow !== void 0 || patch2.totalsRow !== void 0;
18303
19353
  const scope = wide ? { kind: "workbook" } : { kind: "sheet", sheet: s };
18304
19354
  const id = current.id;
18305
19355
  ctx.run(
@@ -18310,25 +19360,25 @@ function updateTable(ctx, s, ref, patch) {
18310
19360
  const table2 = byId(sheet, id);
18311
19361
  if (renaming) renameTableIn(workbook, table2, name);
18312
19362
  for (const key of STYLE_KEYS) {
18313
- if (!(key in patch)) continue;
18314
- const value2 = patch[key];
19363
+ if (!(key in patch2)) continue;
19364
+ const value2 = patch2[key];
18315
19365
  if (value2 === void 0) delete table2[key];
18316
19366
  else table2[key] = value2;
18317
19367
  }
18318
- if (patch.columns) {
19368
+ if (patch2.columns) {
18319
19369
  const width = table2.range.end.col - table2.range.start.col + 1;
18320
- if (patch.columns.length !== width) throw new Error("Give one column per table column.");
19370
+ if (patch2.columns.length !== width) throw new Error("Give one column per table column.");
18321
19371
  const before = table2.columns;
18322
- table2.columns = structuredClone(patch.columns);
19372
+ table2.columns = structuredClone(patch2.columns);
18323
19373
  for (const [index2, column] of table2.columns.entries()) {
18324
19374
  const sourceId = before[index2]?.sourceId;
18325
19375
  if (column.sourceId === void 0 && sourceId !== void 0) column.sourceId = sourceId;
18326
19376
  }
18327
19377
  }
18328
- if (patch.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch.headerRow);
18329
- if (patch.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch.totalsRow);
18330
- else if (patch.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
18331
- if (patch.range) resizeTableIn(workbook, sheet, id, patch.range);
19378
+ if (patch2.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch2.headerRow);
19379
+ if (patch2.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch2.totalsRow);
19380
+ else if (patch2.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
19381
+ if (patch2.range) resizeTableIn(workbook, sheet, id, patch2.range);
18332
19382
  },
18333
19383
  { sheet: s, ranges: [current.range], structural: true }
18334
19384
  );
@@ -18510,36 +19560,233 @@ function compact2(value2) {
18510
19560
  if (value2[key] === void 0) delete value2[key];
18511
19561
  return value2;
18512
19562
  }
18513
- function setPageSetup(ctx, s, patch) {
19563
+ function setPageSetup(ctx, s, patch2) {
18514
19564
  const sheet = sheetAt(ctx.workbook, s);
18515
19565
  ctx.run(
18516
19566
  "Page setup",
18517
19567
  "view",
18518
19568
  [{ kind: "sheet", sheet: s }],
18519
19569
  () => {
18520
- const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch) });
19570
+ const next = compact2({ ...sheet.pageSetup, ...structuredClone(patch2) });
18521
19571
  if (Object.keys(next).length) sheet.pageSetup = next;
18522
19572
  else Reflect.deleteProperty(sheet, "pageSetup");
18523
19573
  },
18524
19574
  { sheet: s }
18525
19575
  );
18526
19576
  }
18527
- function setPrintOptions(ctx, s, patch) {
18528
- const sheet = sheetAt(ctx.workbook, s);
18529
- ctx.run(
18530
- "Print options",
18531
- "view",
18532
- [{ kind: "sheet", sheet: s }],
18533
- () => {
18534
- const next = { ...sheet.printOptions, ...patch };
18535
- for (const key of Object.keys(next))
18536
- if (!next[key]) delete next[key];
18537
- if (Object.keys(next).length) sheet.printOptions = next;
18538
- else Reflect.deleteProperty(sheet, "printOptions");
18539
- sheet.preserved.delete("printOptions");
18540
- },
18541
- { sheet: s }
18542
- );
19577
+ function setPrintOptions(ctx, s, patch2) {
19578
+ const sheet = sheetAt(ctx.workbook, s);
19579
+ ctx.run(
19580
+ "Print options",
19581
+ "view",
19582
+ [{ kind: "sheet", sheet: s }],
19583
+ () => {
19584
+ const next = { ...sheet.printOptions, ...patch2 };
19585
+ for (const key of Object.keys(next))
19586
+ if (!next[key]) delete next[key];
19587
+ if (Object.keys(next).length) sheet.printOptions = next;
19588
+ else Reflect.deleteProperty(sheet, "printOptions");
19589
+ sheet.preserved.delete("printOptions");
19590
+ },
19591
+ { sheet: s }
19592
+ );
19593
+ }
19594
+
19595
+ // xlsx/edit/page-breaks.ts
19596
+ function patch(xml, before, present, axis) {
19597
+ const doc = parseXml(xml);
19598
+ const root = doc.documentElement;
19599
+ const breaks = children(root, "brk", NS.x);
19600
+ for (const node of breaks)
19601
+ if (!present && /^(1|true)$/.test(node.getAttribute("man") ?? "") && (before === void 0 || Number(node.getAttribute("id")) === before))
19602
+ root.removeChild(node);
19603
+ if (present && before !== void 0) {
19604
+ const existing = children(root, "brk", NS.x).find(
19605
+ (node2) => Number(node2.getAttribute("id")) === before
19606
+ );
19607
+ const node = existing ?? doc.createElementNS(NS.x, "brk");
19608
+ node.setAttribute("id", String(before));
19609
+ node.setAttribute("min", "0");
19610
+ node.setAttribute("max", String(axis === "row" ? MAX_COL : MAX_ROW));
19611
+ node.setAttribute("man", "1");
19612
+ if (!existing) root.appendChild(node);
19613
+ }
19614
+ const remaining = children(root, "brk", NS.x);
19615
+ if (remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length > 1026)
19616
+ throw new Error("A worksheet can have at most 1026 manual breaks on each axis.");
19617
+ if (!elements(root).length) return void 0;
19618
+ root.setAttribute("count", String(remaining.length));
19619
+ root.setAttribute(
19620
+ "manualBreakCount",
19621
+ String(remaining.filter((node) => /^(1|true)$/.test(node.getAttribute("man") ?? "")).length)
19622
+ );
19623
+ return buildXml(root);
19624
+ }
19625
+ function setPageBreak(ctx, s, axis, before, present = true) {
19626
+ if (typeof present !== "boolean" || !["row", "col"].includes(axis) || !Number.isInteger(before) || before <= 0 || before > (axis === "row" ? MAX_ROW : MAX_COL))
19627
+ throw new RangeError("Choose a row or column after the first to set a page break.");
19628
+ const sheet = sheetAt(ctx.workbook, s);
19629
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19630
+ const source = sheet.preserved.get(key) ?? [`<${key} xmlns="${NS.x}"/>`];
19631
+ const result2 = source.flatMap((xml, index2) => {
19632
+ const next = patch(xml, before, present && index2 === 0, axis);
19633
+ return next ? [next] : [];
19634
+ });
19635
+ ctx.run(
19636
+ present ? "Insert page break" : "Remove page break",
19637
+ "view",
19638
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19639
+ () => {
19640
+ if (result2.length) sheet.preserved.set(key, result2);
19641
+ else sheet.preserved.delete(key);
19642
+ },
19643
+ { sheet: s }
19644
+ );
19645
+ }
19646
+ function resetPageBreaks(ctx, s) {
19647
+ const sheet = sheetAt(ctx.workbook, s);
19648
+ const next = ["row", "col"].map((axis) => {
19649
+ const key = axis === "row" ? "rowBreaks" : "colBreaks";
19650
+ return {
19651
+ key,
19652
+ xml: (sheet.preserved.get(key) ?? []).flatMap((xml) => {
19653
+ const result2 = patch(xml, void 0, false, axis);
19654
+ return result2 ? [result2] : [];
19655
+ })
19656
+ };
19657
+ });
19658
+ ctx.run(
19659
+ "Reset page breaks",
19660
+ "view",
19661
+ [{ kind: "parts", sheet: s, parts: ["preserved"] }],
19662
+ () => {
19663
+ for (const entry of next) {
19664
+ if (entry.xml.length) sheet.preserved.set(entry.key, entry.xml);
19665
+ else sheet.preserved.delete(entry.key);
19666
+ }
19667
+ },
19668
+ { sheet: s }
19669
+ );
19670
+ }
19671
+
19672
+ // xlsx/layout/print-titles.ts
19673
+ var PRINT_TITLES_NAME = "_xlnm.Print_Titles";
19674
+ function refs(ast) {
19675
+ return ast.type === "binary" && ast.op === "," ? [...refs(ast.left), ...refs(ast.right)] : [ast];
19676
+ }
19677
+ function printTitles(workbook, sheetIndex2) {
19678
+ const name = workbook.definedNames.find(
19679
+ (entry) => entry.name === PRINT_TITLES_NAME && entry.localSheet === sheetIndex2
19680
+ );
19681
+ if (!name) return {};
19682
+ try {
19683
+ const result2 = {};
19684
+ for (const node of refs(parseFormula(`(${name.formula})`))) {
19685
+ if (node.type !== "ref" || !node.ref || node.prefix?.book || node.prefix?.sheet2 || node.spill || node.prefix && node.prefix.sheet.toLowerCase() !== workbook.sheets[sheetIndex2]?.name.toLowerCase())
19686
+ throw new Error("Unsupported print title reference");
19687
+ const key = node.ref.kind === "rows" ? "rows" : node.ref.kind === "cols" ? "columns" : void 0;
19688
+ if (!key || result2[key]) throw new Error("Unsupported print title reference");
19689
+ const axis = key === "rows" ? "row" : "col";
19690
+ result2[key] = {
19691
+ start: Math.min(node.ref.start[axis], node.ref.end[axis]),
19692
+ end: Math.max(node.ref.start[axis], node.ref.end[axis])
19693
+ };
19694
+ }
19695
+ return result2;
19696
+ } catch {
19697
+ return { unsupported: true };
19698
+ }
19699
+ }
19700
+ function formatPrintTitleSpan(span4, axis) {
19701
+ return axis === "row" ? `$${span4.start + 1}:$${span4.end + 1}` : `$${columnLabel(span4.start)}:$${columnLabel(span4.end)}`;
19702
+ }
19703
+ function printTitlesFormula(sheet, titles) {
19704
+ return ["rows", "columns"].flatMap((key) => {
19705
+ const span4 = titles[key];
19706
+ if (!span4) return [];
19707
+ const max = key === "rows" ? MAX_ROW : MAX_COL;
19708
+ if (![span4.start, span4.end].every(Number.isInteger) || span4.start < 0 || span4.end < span4.start || span4.end > max)
19709
+ throw new Error("Print titles must be whole rows or whole columns.");
19710
+ return [
19711
+ `${quoteSheetName(sheet)}!${formatPrintTitleSpan(span4, key === "rows" ? "row" : "col")}`
19712
+ ];
19713
+ }).join(",");
19714
+ }
19715
+
19716
+ // xlsx/edit/view.ts
19717
+ function setFreeze(ctx, s, freeze) {
19718
+ const sheet = sheetAt(ctx.workbook, s);
19719
+ const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
19720
+ ctx.run(
19721
+ next ? "Freeze panes" : "Unfreeze panes",
19722
+ "view",
19723
+ [{ kind: "sheet", sheet: s }],
19724
+ () => {
19725
+ if (next) sheet.view.freeze = next;
19726
+ else delete sheet.view.freeze;
19727
+ },
19728
+ { sheet: s, structural: true }
19729
+ );
19730
+ }
19731
+ function setSheetView(ctx, s, patch2) {
19732
+ const sheet = sheetAt(ctx.workbook, s);
19733
+ ctx.run(
19734
+ "Sheet view",
19735
+ "view",
19736
+ [{ kind: "sheet", sheet: s }],
19737
+ () => {
19738
+ const view = { ...sheet.view, ...structuredClone(patch2) };
19739
+ for (const key of Object.keys(view))
19740
+ if (view[key] === void 0) delete view[key];
19741
+ if (patch2.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch2.zoom)));
19742
+ sheet.view = view;
19743
+ },
19744
+ { sheet: s, structural: patch2.zoom !== void 0 || "freeze" in patch2 }
19745
+ );
19746
+ }
19747
+ var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
19748
+ function validateDefinedName(name) {
19749
+ if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
19750
+ if (!NAME_PATTERN.test(name))
19751
+ return "A name must start with a letter, underscore or backslash and contain no spaces.";
19752
+ if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
19753
+ return "A name cannot look like a cell reference.";
19754
+ return void 0;
19755
+ }
19756
+ var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
19757
+ function setDefinedName(ctx, name) {
19758
+ const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
19759
+ if (problem) throw new Error(problem);
19760
+ if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
19761
+ const entry = structuredClone(name);
19762
+ entry.formula = entry.formula.replace(/^=/, "");
19763
+ ctx.run("Define name", "names", [{ kind: "meta" }], () => {
19764
+ const { definedNames } = ctx.workbook;
19765
+ const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
19766
+ if (index2 >= 0) definedNames[index2] = entry;
19767
+ else definedNames.push(entry);
19768
+ });
19769
+ }
19770
+ function deleteDefinedName(ctx, name, localSheet) {
19771
+ const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
19772
+ if (index2 < 0) return;
19773
+ ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
19774
+ ctx.workbook.definedNames.splice(index2, 1);
19775
+ });
19776
+ }
19777
+
19778
+ // xlsx/edit/print-titles.ts
19779
+ function setPrintTitles(ctx, sheet, patch2) {
19780
+ const ws = sheetAt(ctx.workbook, sheet);
19781
+ const existing = printTitles(ctx.workbook, sheet);
19782
+ if (existing.unsupported && !Object.hasOwn(patch2, "rows") && !Object.hasOwn(patch2, "columns"))
19783
+ return;
19784
+ if (existing.unsupported && (!Object.hasOwn(patch2, "rows") || !Object.hasOwn(patch2, "columns")))
19785
+ throw new Error("Replace both print title ranges to change unsupported titles.");
19786
+ const next = { ...existing, ...patch2 };
19787
+ const formula = printTitlesFormula(ws.name, next);
19788
+ if (formula) setDefinedName(ctx, { name: PRINT_TITLES_NAME, formula, localSheet: sheet });
19789
+ else deleteDefinedName(ctx, PRINT_TITLES_NAME, sheet);
18543
19790
  }
18544
19791
 
18545
19792
  // digest/algorithm-names.ts
@@ -19826,12 +21073,12 @@ function compress3(h2, data, offset2) {
19826
21073
  W3[i2 * 2 + 1] = lo;
19827
21074
  }
19828
21075
  let ah = h2[0], al = h2[1], bh = h2[2], bl = h2[3], ch = h2[4], cl = h2[5], dh = h2[6], dl = h2[7];
19829
- let eh = h2[8], el = h2[9], fh = h2[10], fl = h2[11], gh = h2[12], gl = h2[13], hh = h2[14], hl = h2[15];
21076
+ let eh = h2[8], el2 = h2[9], fh = h2[10], fl = h2[11], gh = h2[12], gl = h2[13], hh = h2[14], hl = h2[15];
19830
21077
  for (let i2 = 0; i2 < 80; i2++) {
19831
- const S1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (el >>> 9 | eh << 23);
19832
- const S1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (eh >>> 9 | el << 23);
21078
+ const S1h = (eh >>> 14 | el2 << 18) ^ (eh >>> 18 | el2 << 14) ^ (el2 >>> 9 | eh << 23);
21079
+ const S1l = (el2 >>> 14 | eh << 18) ^ (el2 >>> 18 | eh << 14) ^ (eh >>> 9 | el2 << 23);
19833
21080
  const chh = eh & fh ^ ~eh & gh;
19834
- const chl = el & fl ^ ~el & gl;
21081
+ const chl = el2 & fl ^ ~el2 & gl;
19835
21082
  let t1l = (hl >>> 0) + (S1l >>> 0) + (chl >>> 0) + K4[i2 * 2 + 1] + W3[i2 * 2 + 1];
19836
21083
  const t1h = hh + S1h + chh + K4[i2 * 2] + W3[i2 * 2] + Math.floor(t1l / 4294967296);
19837
21084
  t1l >>>= 0;
@@ -19847,10 +21094,10 @@ function compress3(h2, data, offset2) {
19847
21094
  gh = fh;
19848
21095
  gl = fl;
19849
21096
  fh = eh;
19850
- fl = el;
21097
+ fl = el2;
19851
21098
  let nl = (dl >>> 0) + t1l;
19852
21099
  eh = dh + t1h + Math.floor(nl / 4294967296) >>> 0;
19853
- el = nl >>> 0;
21100
+ el2 = nl >>> 0;
19854
21101
  dh = ch;
19855
21102
  dl = cl;
19856
21103
  ch = bh;
@@ -19870,7 +21117,7 @@ function compress3(h2, data, offset2) {
19870
21117
  add2(2, bh, bl);
19871
21118
  add2(4, ch, cl);
19872
21119
  add2(6, dh, dl);
19873
- add2(8, eh, el);
21120
+ add2(8, eh, el2);
19874
21121
  add2(10, fh, fl);
19875
21122
  add2(12, gh, gl);
19876
21123
  add2(14, hh, hl);
@@ -20421,6 +21668,8 @@ function merge(ctx, s, range2, mode) {
20421
21668
  if (r.start.row === r.end.row && r.start.col === r.end.col) return;
20422
21669
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
20423
21670
  throw new Error("Cells inside a table cannot be merged.");
21671
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
21672
+ throw new Error("Cells inside a PivotTable cannot be merged.");
20424
21673
  const targets = mergeTargets(r, mode);
20425
21674
  if (!targets.length) return;
20426
21675
  ctx.run(
@@ -20471,322 +21720,106 @@ function unmerge(ctx, s, range2) {
20471
21720
  "Unmerge cells",
20472
21721
  "format",
20473
21722
  [{ kind: "parts", sheet: s, parts: ["merges"] }],
20474
- () => {
20475
- sheet.merges = sheet.merges.filter((m) => !rangesIntersect(m, r));
20476
- },
20477
- { sheet: s, ranges: [r] }
20478
- );
20479
- }
20480
-
20481
- // xlsx/layout/style-view.ts
20482
- var BLACK = "#000000";
20483
- var WHITE = "#FFFFFF";
20484
- var PX_PER_PT = 96 / 72;
20485
- function mergeFont(base, font) {
20486
- if (!font) return base;
20487
- const out = { ...base };
20488
- for (const [key, value2] of Object.entries(font))
20489
- if (value2 !== void 0) out[key] = value2;
20490
- return out;
20491
- }
20492
- function fontView(font, theme2) {
20493
- const family = font.scheme === "major" ? theme2.majorFont || font.name || "Calibri Light" : font.scheme === "minor" ? theme2.minorFont || font.name || "Calibri" : font.name || theme2.minorFont || "Calibri";
20494
- const view = {
20495
- family,
20496
- sizePx: (font.size && font.size > 0 ? font.size : 11) * PX_PER_PT,
20497
- bold: font.bold === true,
20498
- italic: font.italic === true,
20499
- strike: font.strike === true,
20500
- color: resolveColor(font.color, theme2, BLACK) ?? BLACK
20501
- };
20502
- if (font.underline)
20503
- view.underline = font.underline === "double" || font.underline === "doubleAccounting" ? "double" : "single";
20504
- if (font.vertAlign === "superscript") view.vertAlign = "super";
20505
- else if (font.vertAlign === "subscript") view.vertAlign = "sub";
20506
- return view;
20507
- }
20508
- function fillView(fill, theme2, differential = false) {
20509
- if (!fill) return void 0;
20510
- if (fill.type === "gradient") {
20511
- const stops = [...fill.stops].sort((a, b) => a.position - b.position).map((stop) => `${resolveColor(stop.color, theme2, WHITE)} ${round2(stop.position * 100)}%`);
20512
- if (stops.length === 0) return void 0;
20513
- if (stops.length === 1) stops.push(stops[0] ?? WHITE);
20514
- const css = fill.gradient === "path" ? `radial-gradient(circle, ${stops.join(", ")})` : `linear-gradient(${round2(((fill.degree ?? 0) + 90) % 360)}deg, ${stops.join(", ")})`;
20515
- return { gradient: css };
20516
- }
20517
- if (fill.pattern === "none") {
20518
- if (differential && fill.bgColor)
20519
- return { background: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE };
20520
- return void 0;
20521
- }
20522
- if (fill.pattern === "solid") {
20523
- const color = differential ? fill.bgColor ?? fill.fgColor : fill.fgColor ?? fill.bgColor;
20524
- return { background: resolveColor(color, theme2, BLACK) ?? BLACK };
20525
- }
20526
- return {
20527
- pattern: fill.pattern,
20528
- fg: resolveColor(fill.fgColor, theme2, BLACK) ?? BLACK,
20529
- bg: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE
20530
- };
20531
- }
20532
- var round2 = (n) => Math.round(n * 100) / 100;
20533
- var BORDER_STYLES = {
20534
- hair: { widthPx: 1, style: "dotted" },
20535
- thin: { widthPx: 1, style: "solid" },
20536
- dotted: { widthPx: 1, style: "dotted" },
20537
- dashed: { widthPx: 1, style: "dashed" },
20538
- dashDot: { widthPx: 1, style: "dashed" },
20539
- dashDotDot: { widthPx: 1, style: "dashed" },
20540
- medium: { widthPx: 2, style: "solid" },
20541
- mediumDashed: { widthPx: 2, style: "dashed" },
20542
- mediumDashDot: { widthPx: 2, style: "dashed" },
20543
- mediumDashDotDot: { widthPx: 2, style: "dashed" },
20544
- slantDashDot: { widthPx: 2, style: "dashed" },
20545
- thick: { widthPx: 3, style: "solid" },
20546
- double: { widthPx: 3, style: "double" }
20547
- };
20548
- function edgeView(edge, theme2) {
20549
- if (!edge) return void 0;
20550
- const style2 = BORDER_STYLES[edge.style];
20551
- if (!style2) return void 0;
20552
- return { ...style2, color: resolveColor(edge.color, theme2, BLACK) ?? BLACK };
20553
- }
20554
- function mergeBorder(base, border) {
20555
- if (!border) return base;
20556
- const out = { ...base };
20557
- for (const [key, value2] of Object.entries(border))
20558
- if (value2 !== void 0) out[key] = value2;
20559
- return out;
20560
- }
20561
- function bordersView(border, theme2) {
20562
- const out = {};
20563
- const set = (key, edge) => {
20564
- const view = edgeView(edge, theme2);
20565
- if (view) out[key] = view;
20566
- };
20567
- set("top", border.top);
20568
- set("right", border.right);
20569
- set("bottom", border.bottom);
20570
- set("left", border.left);
20571
- if (border.diagonalUp) set("diagonalUp", border.diagonal);
20572
- if (border.diagonalDown) set("diagonalDown", border.diagonal);
20573
- return out;
20574
- }
20575
-
20576
- // xlsx/layout/sparkline-view.ts
20577
- var DEFAULTS = {
20578
- colorSeries: "#376092",
20579
- colorNegative: "#D00000",
20580
- colorAxis: "#000000",
20581
- colorMarkers: "#D00000",
20582
- colorFirst: "#D00000",
20583
- colorLast: "#D00000",
20584
- colorHigh: "#D00000",
20585
- colorLow: "#D00000"
20586
- };
20587
- var COLUMN_GAP = 0.2;
20588
- function extent(values2) {
20589
- let min = Infinity;
20590
- let max = -Infinity;
20591
- for (const v of values2) {
20592
- if (v === null) continue;
20593
- if (v < min) min = v;
20594
- if (v > max) max = v;
20595
- }
20596
- return min <= max ? { min, max } : void 0;
20597
- }
20598
- function sparklineValues(group, values2) {
20599
- return group.displayEmptyCellsAs === "zero" ? values2.map((v) => v ?? 0) : [...values2];
20600
- }
20601
- function sparklineScale(group, all2, index2) {
20602
- const own = extent(sparklineValues(group, all2[index2]?.values ?? []));
20603
- const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
20604
- const shared = needsGroup ? extent(all2.flatMap((data) => sparklineValues(group, data.values))) : void 0;
20605
- const end = (type, manual, key) => {
20606
- if (type === "custom" && manual !== void 0) return manual;
20607
- if (type === "group" && shared) return shared[key];
20608
- return own?.[key];
20609
- };
20610
- const min = end(group.minAxisType, group.manualMin, "min");
20611
- const max = end(group.maxAxisType, group.manualMax, "max");
20612
- return min === void 0 || max === void 0 ? void 0 : { min, max };
20613
- }
20614
- function positions(group, data, n) {
20615
- const dates = data.dates;
20616
- if (group.dateAxis && dates && dates.length === n) {
20617
- const span4 = extent(dates);
20618
- if (span4) {
20619
- const width = span4.max - span4.min;
20620
- return dates.map((d) => d === null ? null : width ? (d - span4.min) / width : 0.5);
20621
- }
20622
- }
20623
- return Array.from({ length: n }, (_, i2) => n === 1 ? 0.5 : i2 / (n - 1));
20624
- }
20625
- function pointFacts(values2) {
20626
- const numbers3 = values2.filter((x) => x !== null);
20627
- let last = values2.length - 1;
20628
- while (last >= 0 && values2[last] === null) last--;
20629
- return {
20630
- high: Math.max(...numbers3),
20631
- low: Math.min(...numbers3),
20632
- first: values2.findIndex((x) => x !== null),
20633
- last
20634
- };
20635
- }
20636
- function pointColor(group, v, i2, facts, colors, markers) {
20637
- let color = markers && group.markers ? colors.colorMarkers : void 0;
20638
- if (group.negative && v < 0) color = colors.colorNegative;
20639
- if (group.high && v === facts.high) color = colors.colorHigh;
20640
- if (group.low && v === facts.low) color = colors.colorLow;
20641
- if (group.first && i2 === facts.first) color = colors.colorFirst;
20642
- if (group.last && i2 === facts.last) color = colors.colorLast;
20643
- return color;
20644
- }
20645
- function resolveColors(group, theme2) {
20646
- const out = { ...DEFAULTS };
20647
- for (const key of Object.keys(DEFAULTS)) {
20648
- const color = group[key];
20649
- out[key] = resolveColor(color, theme2, DEFAULTS[key]) ?? DEFAULTS[key];
20650
- }
20651
- return out;
20652
- }
20653
- function sparklineView(group, data, scale2, theme2) {
20654
- const colors = resolveColors(group, theme2);
20655
- const view = {
20656
- type: group.type,
20657
- color: colors.colorSeries,
20658
- lineWeightPt: group.lineWeight,
20659
- lines: [],
20660
- markers: [],
20661
- columns: []
20662
- };
20663
- const values2 = sparklineValues(group, data.values);
20664
- const n = values2.length;
20665
- if (!n || !scale2) return view;
20666
- const facts = pointFacts(values2);
20667
- const xs = positions(group, data, n);
20668
- const flip = (x) => group.rightToLeft ? 1 - x : x;
20669
- const range2 = scale2.max - scale2.min;
20670
- const yOf = (v) => range2 ? Math.max(0, Math.min(1, (scale2.max - v) / range2)) : 0.5;
20671
- if (group.type === "line") {
20672
- let segment = [];
20673
- values2.forEach((v, i2) => {
20674
- const x = xs[i2];
20675
- if (v === null || x === null || x === void 0) {
20676
- if (group.displayEmptyCellsAs === "gap" && segment.length) {
20677
- view.lines.push(segment);
20678
- segment = [];
20679
- }
20680
- return;
20681
- }
20682
- const point = { x: flip(x), y: yOf(v) };
20683
- segment.push(point);
20684
- const color = pointColor(group, v, i2, facts, colors, true);
20685
- if (color) view.markers.push({ ...point, color });
20686
- });
20687
- if (segment.length) view.lines.push(segment);
20688
- } else {
20689
- const slot = 1 / n;
20690
- const w = slot * (1 - COLUMN_GAP);
20691
- const base = yOf(Math.max(scale2.min, Math.min(scale2.max, 0)));
20692
- values2.forEach((v, i2) => {
20693
- const position = xs[i2];
20694
- if (v === null || position === null || position === void 0) return;
20695
- if (v === 0) return;
20696
- let top;
20697
- let bottom;
20698
- if (group.type === "stacked") [top, bottom] = v > 0 ? [0, 0.5] : [0.5, 1];
20699
- else if (!range2) [top, bottom] = [0, 1];
20700
- else [top, bottom] = [Math.min(base, yOf(v)), Math.max(base, yOf(v))];
20701
- const centre = flip(slot / 2 + position * (1 - slot));
20702
- const color = pointColor(group, v, i2, facts, colors, false) ?? view.color;
20703
- view.columns.push({ x: centre - w / 2, y: top, w, h: bottom - top, color });
20704
- });
20705
- }
20706
- if (group.type === "stacked") {
20707
- if (group.displayXAxis) view.axis = { y: 0.5, color: colors.colorAxis };
20708
- } else if (group.displayXAxis && range2 && scale2.min <= 0 && scale2.max >= 0)
20709
- view.axis = { y: yOf(0), color: colors.colorAxis };
20710
- return view;
21723
+ () => {
21724
+ sheet.merges = sheet.merges.filter((m) => !rangesIntersect(m, r));
21725
+ },
21726
+ { sheet: s, ranges: [r] }
21727
+ );
20711
21728
  }
20712
21729
 
20713
- // xlsx/layout/sparkline-data.ts
20714
- var MAX_POINTS = 1e4;
20715
- var hostIndex = /* @__PURE__ */ new WeakMap();
20716
- function hosts(sheet) {
20717
- const groups = sheetSparklineGroups(sheet);
20718
- let index2 = hostIndex.get(groups);
20719
- if (!index2) {
20720
- index2 = /* @__PURE__ */ new Map();
20721
- for (const group of groups)
20722
- group.sparklines.forEach((line2, i2) => {
20723
- const key = cellKey(line2.host.start.row, line2.host.start.col);
20724
- if (!index2.has(key)) index2.set(key, { group, index: i2 });
20725
- });
20726
- hostIndex.set(groups, index2);
20727
- }
20728
- return index2;
21730
+ // xlsx/layout/style-view.ts
21731
+ var BLACK = "#000000";
21732
+ var WHITE = "#FFFFFF";
21733
+ var PX_PER_PT = 96 / 72;
21734
+ function mergeFont(base, font) {
21735
+ if (!font) return base;
21736
+ const out = { ...base };
21737
+ for (const [key, value2] of Object.entries(font))
21738
+ if (value2 !== void 0) out[key] = value2;
21739
+ return out;
20729
21740
  }
20730
- function hasSparklineAt(sheet, row2, col) {
20731
- return hosts(sheet).has(cellKey(row2, col));
21741
+ function fontView(font, theme2) {
21742
+ const family = font.scheme === "major" ? theme2.majorFont || font.name || "Calibri Light" : font.scheme === "minor" ? theme2.minorFont || font.name || "Calibri" : font.name || theme2.minorFont || "Calibri";
21743
+ const view = {
21744
+ family,
21745
+ sizePx: (font.size && font.size > 0 ? font.size : 11) * PX_PER_PT,
21746
+ bold: font.bold === true,
21747
+ italic: font.italic === true,
21748
+ strike: font.strike === true,
21749
+ color: resolveColor(font.color, theme2, BLACK) ?? BLACK
21750
+ };
21751
+ if (font.underline)
21752
+ view.underline = font.underline === "double" || font.underline === "doubleAccounting" ? "double" : "single";
21753
+ if (font.vertAlign === "superscript") view.vertAlign = "super";
21754
+ else if (font.vertAlign === "subscript") view.vertAlign = "sub";
21755
+ return view;
20732
21756
  }
20733
- function resolveSparklineRange(workbook, sheet, formula) {
20734
- const ref = formula.trim().replace(/^=/, "");
20735
- const bang = ref.lastIndexOf("!");
20736
- let target2 = sheet;
20737
- if (bang >= 0) {
20738
- const raw = ref.slice(0, bang);
20739
- const name = /^'.*'$/.test(raw) ? raw.slice(1, -1).replace(/''/g, "'") : raw;
20740
- target2 = sheetByName(workbook, name);
21757
+ function fillView(fill, theme2, differential = false) {
21758
+ if (!fill) return void 0;
21759
+ if (fill.type === "gradient") {
21760
+ const stops = [...fill.stops].sort((a, b) => a.position - b.position).map((stop) => `${resolveColor(stop.color, theme2, WHITE)} ${round2(stop.position * 100)}%`);
21761
+ if (stops.length === 0) return void 0;
21762
+ if (stops.length === 1) stops.push(stops[0] ?? WHITE);
21763
+ const css = fill.gradient === "path" ? `radial-gradient(circle, ${stops.join(", ")})` : `linear-gradient(${round2(((fill.degree ?? 0) + 90) % 360)}deg, ${stops.join(", ")})`;
21764
+ return { gradient: css };
20741
21765
  }
20742
- const range2 = parseRange(ref.slice(bang + 1).replace(/\$/g, ""));
20743
- return target2 && range2 ? { sheet: target2, range: normalizeRange(range2) } : void 0;
20744
- }
20745
- var rowHidden = (sheet, row2) => sheet.rowInfo.get(row2)?.hidden === true;
20746
- var colHidden = (sheet, col) => sheet.columns.some((c) => c.hidden === true && col >= c.min && col <= c.max);
20747
- function readSparklineValues(sheet, range2, displayHidden) {
20748
- let endRow = range2.end.row;
20749
- if (endRow - range2.start.row >= MAX_POINTS) {
20750
- let lastRow = range2.start.row;
20751
- for (const row2 of sheet.rows.keys()) if (row2 > lastRow) lastRow = row2;
20752
- endRow = Math.min(endRow, lastRow);
21766
+ if (fill.pattern === "none") {
21767
+ if (differential && fill.bgColor)
21768
+ return { background: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE };
21769
+ return void 0;
20753
21770
  }
20754
- const out = [];
20755
- for (let row2 = range2.start.row; row2 <= endRow && out.length < MAX_POINTS; row2++) {
20756
- if (!displayHidden && rowHidden(sheet, row2)) continue;
20757
- for (let col = range2.start.col; col <= range2.end.col && out.length < MAX_POINTS; col++) {
20758
- if (!displayHidden && colHidden(sheet, col)) continue;
20759
- const value2 = getCell(sheet, row2, col)?.value;
20760
- out.push(typeof value2 === "number" && Number.isFinite(value2) ? value2 : null);
20761
- }
21771
+ if (fill.pattern === "solid") {
21772
+ const color = differential ? fill.bgColor ?? fill.fgColor : fill.fgColor ?? fill.bgColor;
21773
+ return { background: resolveColor(color, theme2, BLACK) ?? BLACK };
20762
21774
  }
20763
- return out;
21775
+ return {
21776
+ pattern: fill.pattern,
21777
+ fg: resolveColor(fill.fgColor, theme2, BLACK) ?? BLACK,
21778
+ bg: resolveColor(fill.bgColor, theme2, WHITE) ?? WHITE
21779
+ };
20764
21780
  }
20765
- function groupData(workbook, sheet, group) {
20766
- const dateRange = group.dateAxis && group.dateFormula;
20767
- const dates = dateRange ? resolveSparklineRange(workbook, sheet, dateRange) : void 0;
20768
- const dateValues = dates ? readSparklineValues(dates.sheet, dates.range, group.displayHidden) : void 0;
20769
- return group.sparklines.map((line2) => {
20770
- const source = line2.formula ? resolveSparklineRange(workbook, sheet, line2.formula) : void 0;
20771
- const values2 = source ? readSparklineValues(source.sheet, source.range, group.displayHidden) : [];
20772
- return dateValues ? { values: values2, dates: dateValues } : { values: values2 };
20773
- });
21781
+ var round2 = (n) => Math.round(n * 100) / 100;
21782
+ var BORDER_STYLES = {
21783
+ hair: { widthPx: 1, style: "dotted" },
21784
+ thin: { widthPx: 1, style: "solid" },
21785
+ dotted: { widthPx: 1, style: "dotted" },
21786
+ dashed: { widthPx: 1, style: "dashed" },
21787
+ dashDot: { widthPx: 1, style: "dashed" },
21788
+ dashDotDot: { widthPx: 1, style: "dashed" },
21789
+ medium: { widthPx: 2, style: "solid" },
21790
+ mediumDashed: { widthPx: 2, style: "dashed" },
21791
+ mediumDashDot: { widthPx: 2, style: "dashed" },
21792
+ mediumDashDotDot: { widthPx: 2, style: "dashed" },
21793
+ slantDashDot: { widthPx: 2, style: "dashed" },
21794
+ thick: { widthPx: 3, style: "solid" },
21795
+ double: { widthPx: 3, style: "double" }
21796
+ };
21797
+ function edgeView(edge, theme2) {
21798
+ if (!edge) return void 0;
21799
+ const style2 = BORDER_STYLES[edge.style];
21800
+ if (!style2) return void 0;
21801
+ return { ...style2, color: resolveColor(edge.color, theme2, BLACK) ?? BLACK };
20774
21802
  }
20775
- function sparklineViewAt(workbook, sheetIndex2, row2, col) {
20776
- const sheet = workbook.sheets[sheetIndex2];
20777
- if (!sheet) return void 0;
20778
- const entry = hosts(sheet).get(cellKey(row2, col));
20779
- if (!entry) return void 0;
20780
- const { group, index: index2 } = entry;
20781
- const needsGroup = group.minAxisType === "group" || group.maxAxisType === "group";
20782
- const data = needsGroup ? groupData(workbook, sheet, group) : groupData(workbook, sheet, { ...group, sparklines: [group.sparklines[index2]] });
20783
- const at = needsGroup ? index2 : 0;
20784
- return sparklineView(
20785
- group,
20786
- data[at] ?? { values: [] },
20787
- sparklineScale(group, data, at),
20788
- workbook.theme
20789
- );
21803
+ function mergeBorder(base, border) {
21804
+ if (!border) return base;
21805
+ const out = { ...base };
21806
+ for (const [key, value2] of Object.entries(border))
21807
+ if (value2 !== void 0) out[key] = value2;
21808
+ return out;
21809
+ }
21810
+ function bordersView(border, theme2) {
21811
+ const out = {};
21812
+ const set = (key, edge) => {
21813
+ const view = edgeView(edge, theme2);
21814
+ if (view) out[key] = view;
21815
+ };
21816
+ set("top", border.top);
21817
+ set("right", border.right);
21818
+ set("bottom", border.bottom);
21819
+ set("left", border.left);
21820
+ if (border.diagonalUp) set("diagonalUp", border.diagonal);
21821
+ if (border.diagonalDown) set("diagonalDown", border.diagonal);
21822
+ return out;
20790
21823
  }
20791
21824
 
20792
21825
  // xlsx/layout/units.ts
@@ -20880,7 +21913,7 @@ function cellView(workbook, sheetIndex2, row2, col, cf, options = {}) {
20880
21913
  indentPx: indentable ? (alignment.indent ?? 0) * (options.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
20881
21914
  rotation,
20882
21915
  isNumber: isNumber2,
20883
- overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !sheet.merges.some((m) => rangeContains(m, { row: row2, col })),
21916
+ overflow: (formulaText !== void 0 || typeof value2 === "string" && value2 !== "") && !wrap2 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !(options.merged ?? sheet.merges.some((m) => rangeContains(m, { row: row2, col }))),
20884
21917
  hasComment: sheet.comments.some((c) => c.address.row === row2 && c.address.col === col),
20885
21918
  hasHyperlink: false,
20886
21919
  validationList: sheet.dataValidations.some(
@@ -21245,6 +22278,12 @@ function deleteSheet(ctx, index2) {
21245
22278
  const sheet = sheetAt(workbook, index2);
21246
22279
  if (sheet.state === "visible" && visibleCount(workbook) <= 1)
21247
22280
  throw new Error("A workbook must contain at least one visible sheet.");
22281
+ if (workbook.sheets.some(
22282
+ (other) => other !== sheet && other.pivotTables?.some(
22283
+ (pivot) => deleteSheetInFormula(pivot.source, sheet.name, []) !== pivot.source
22284
+ )
22285
+ ))
22286
+ throw new Error("Delete dependent PivotTables before deleting their source worksheet.");
21248
22287
  ctx.run(
21249
22288
  "Delete sheet",
21250
22289
  "sheets",
@@ -21348,6 +22387,17 @@ function duplicateSheet(ctx, index2) {
21348
22387
  copy2.name = copyName(workbook, sheet.name);
21349
22388
  copy2.sheetId = nextSheetId(workbook);
21350
22389
  delete copy2.partName;
22390
+ const pivotNames = reservedPivotNames(workbook);
22391
+ for (const pivot of copy2.pivotTables ?? []) {
22392
+ let suffix = 2;
22393
+ while (pivotNames.has(`${pivot.name}_${suffix}`.toLowerCase())) suffix++;
22394
+ pivot.name = `${pivot.name}_${suffix}`;
22395
+ pivotNames.add(pivot.name.toLowerCase());
22396
+ delete pivot.partName;
22397
+ delete pivot.cacheId;
22398
+ delete pivot.sourceXml;
22399
+ pivot.dirty = true;
22400
+ }
21351
22401
  let nextTableId = Math.max(0, ...workbook.sheets.flatMap((s) => s.tables.map((t) => t.id))) + 1;
21352
22402
  const used = /* @__PURE__ */ new Set();
21353
22403
  const renames = [];
@@ -21359,13 +22409,14 @@ function duplicateSheet(ctx, index2) {
21359
22409
  delete next.partName;
21360
22410
  return next;
21361
22411
  });
21362
- if (renames.length)
21363
- rewriteSheetFormulas(
21364
- copy2,
21365
- (formula) => renames.reduce((f6, [from, to]) => renameTableInFormula(f6, from, to), formula)
21366
- );
22412
+ const rewrite = (formula) => renames.reduce(
22413
+ (f6, [from, to]) => renameTableInFormula(f6, from, to),
22414
+ renameSheetInFormula(formula, sheet.name, copy2.name)
22415
+ );
22416
+ rewriteSheetFormulas(copy2, rewrite);
21367
22417
  for (const drawing of copy2.drawings) if (drawing.kind === "chart") delete drawing.partName;
21368
22418
  const copiedNames = namesForCopy(workbook, index2, sheet.name, copy2.name);
22419
+ for (const name of copiedNames) name.formula = rewrite(name.formula);
21369
22420
  workbook.sheets.splice(at, 0, copy2);
21370
22421
  remapSheets(workbook, (i2) => i2 >= at ? i2 + 1 : i2);
21371
22422
  for (const n of copiedNames) workbook.definedNames.push({ ...n, localSheet: at });
@@ -21423,6 +22474,8 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
21423
22474
  if (r.start.row === r.end.row && r.start.col === r.end.col) r = currentRegion(sheet, r.start);
21424
22475
  if (sheet.tables.some((t) => rangesIntersect(t.range, r)))
21425
22476
  throw new Error("A table cannot overlap another table.");
22477
+ if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
22478
+ throw new Error("A table cannot overlap a PivotTable.");
21426
22479
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
21427
22480
  throw new Error("A table cannot contain merged cells.");
21428
22481
  return ctx.run(
@@ -21649,68 +22702,6 @@ function failure(dv) {
21649
22702
  return result2;
21650
22703
  }
21651
22704
 
21652
- // xlsx/edit/view.ts
21653
- function setFreeze(ctx, s, freeze) {
21654
- const sheet = sheetAt(ctx.workbook, s);
21655
- const next = freeze && (freeze.rows > 0 || freeze.cols > 0) ? { rows: Math.max(0, freeze.rows), cols: Math.max(0, freeze.cols) } : void 0;
21656
- ctx.run(
21657
- next ? "Freeze panes" : "Unfreeze panes",
21658
- "view",
21659
- [{ kind: "sheet", sheet: s }],
21660
- () => {
21661
- if (next) sheet.view.freeze = next;
21662
- else delete sheet.view.freeze;
21663
- },
21664
- { sheet: s, structural: true }
21665
- );
21666
- }
21667
- function setSheetView(ctx, s, patch) {
21668
- const sheet = sheetAt(ctx.workbook, s);
21669
- ctx.run(
21670
- "Sheet view",
21671
- "view",
21672
- [{ kind: "sheet", sheet: s }],
21673
- () => {
21674
- const view = { ...sheet.view, ...structuredClone(patch) };
21675
- for (const key of Object.keys(view))
21676
- if (view[key] === void 0) delete view[key];
21677
- if (patch.zoom !== void 0) view.zoom = Math.max(10, Math.min(400, Math.round(patch.zoom)));
21678
- sheet.view = view;
21679
- },
21680
- { sheet: s, structural: patch.zoom !== void 0 || "freeze" in patch }
21681
- );
21682
- }
21683
- var NAME_PATTERN = /^[A-Za-z_\\][A-Za-z0-9_.\\?]*$/;
21684
- function validateDefinedName(name) {
21685
- if (!name || name.length > 255) return "A name must have 1 to 255 characters.";
21686
- if (!NAME_PATTERN.test(name))
21687
- return "A name must start with a letter, underscore or backslash and contain no spaces.";
21688
- if (parseAddress(name) || /^[RrCc]$/.test(name) || /^R\d*C\d*$/i.test(name))
21689
- return "A name cannot look like a cell reference.";
21690
- return void 0;
21691
- }
21692
- var sameName = (a, name, localSheet) => a.name.toLowerCase() === name.toLowerCase() && a.localSheet === localSheet;
21693
- function setDefinedName(ctx, name) {
21694
- const problem = name.name.startsWith("_xlnm.") ? void 0 : validateDefinedName(name.name);
21695
- if (problem) throw new Error(problem);
21696
- if (name.localSheet !== void 0) sheetAt(ctx.workbook, name.localSheet);
21697
- const entry = structuredClone(name);
21698
- entry.formula = entry.formula.replace(/^=/, "");
21699
- ctx.run("Define name", "names", [{ kind: "meta" }], () => {
21700
- const { definedNames } = ctx.workbook;
21701
- const index2 = definedNames.findIndex((n) => sameName(n, name.name, name.localSheet));
21702
- if (index2 >= 0) definedNames[index2] = entry;
21703
- else definedNames.push(entry);
21704
- });
21705
- }
21706
- function deleteDefinedName(ctx, name, localSheet) {
21707
- const index2 = ctx.workbook.definedNames.findIndex((n) => sameName(n, name, localSheet));
21708
- if (index2 < 0) return;
21709
- ctx.run("Delete name", "names", [{ kind: "meta" }], () => {
21710
- ctx.workbook.definedNames.splice(index2, 1);
21711
- });
21712
- }
21713
-
21714
22705
  // xlsx/edit/session.ts
21715
22706
  function createEditSession(workbook, options = {}) {
21716
22707
  const calc = createCalcEngine(workbook);
@@ -21723,8 +22714,8 @@ function createEditSession(workbook, options = {}) {
21723
22714
  };
21724
22715
  const calculator = new SessionCalculator(workbook, calc, autoRecalc);
21725
22716
  const recalc = (step, mode = "apply") => calculator.afterStep(step, mode);
21726
- const begin = (label2, kind, info) => {
21727
- const step = { label: label2, entries: [], structural: info.structural ?? false };
22717
+ const begin = (label3, kind, info) => {
22718
+ const step = { label: label3, entries: [], structural: info.structural ?? false };
21728
22719
  if (info.calc) step.calc = info.calc;
21729
22720
  return { step, kind, sheet: info.sheet, ranges: [...info.ranges ?? []] };
21730
22721
  };
@@ -21748,9 +22739,18 @@ function createEditSession(workbook, options = {}) {
21748
22739
  }
21749
22740
  current.step.entries.length = from;
21750
22741
  };
21751
- const run = (label2, kind, scopes, fn, info = {}) => {
22742
+ const run = (label3, kind, scopes, fn, info = {}) => {
22743
+ if (kind === "cells") {
22744
+ for (const scope of scopes)
22745
+ if (scope.kind === "cells" && workbook.sheets[scope.sheet]?.pivotTables?.some(
22746
+ (pivot) => scope.ranges.some((range2) => rangesIntersect(range2, pivot.location))
22747
+ ))
22748
+ throw new Error(
22749
+ "A PivotTable result cannot be edited directly. Refresh or remove the PivotTable instead."
22750
+ );
22751
+ }
21752
22752
  const outer = !open;
21753
- const current = open ?? begin(label2, kind, info);
22753
+ const current = open ?? begin(label3, kind, info);
21754
22754
  if (!outer) {
21755
22755
  delete current.step.calc;
21756
22756
  if (info.structural) current.step.structural = true;
@@ -21816,7 +22816,7 @@ function createEditSession(workbook, options = {}) {
21816
22816
  setCellValue: (s, r, c, value2) => setCellValue(ctx, s, r, c, value2),
21817
22817
  setRangeValues: (s, at, rows2) => setRangeValues(ctx, s, at, rows2),
21818
22818
  clearRange: (s, range2, what) => clearRange(ctx, s, range2, what),
21819
- applyStyle: (s, ranges, patch) => applyStyle(ctx, s, ranges, patch),
22819
+ applyStyle: (s, ranges, patch2) => applyStyle(ctx, s, ranges, patch2),
21820
22820
  setBorders: (s, range2, preset, edge) => setBorders(ctx, s, range2, preset, edge),
21821
22821
  insertRows: (s, at, count2) => insertRows(ctx, s, at, count2),
21822
22822
  deleteRows: (s, at, count2) => deleteRows(ctx, s, at, count2),
@@ -21854,24 +22854,34 @@ function createEditSession(workbook, options = {}) {
21854
22854
  filterColumn: (s, col, vals) => filterColumn(ctx, s, col, vals),
21855
22855
  sortByColumn: (s, col, descending) => sortByColumn(ctx, s, col, descending ?? false),
21856
22856
  createTable: (s, range2, hasHeader, styleName) => createTable(ctx, s, range2, hasHeader, styleName),
21857
- setSheetView: (s, patch) => setSheetView(ctx, s, patch),
22857
+ setSheetView: (s, patch2) => setSheetView(ctx, s, patch2),
21858
22858
  setDefinedName: (name) => setDefinedName(ctx, name),
21859
22859
  deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
21860
22860
  setDrawingAnchor: (s, index2, anchor) => setDrawingAnchor(ctx, s, index2, anchor),
22861
+ createPivotTable: (s, destination, options2) => createPivotTable(ctx, s, destination, options2),
22862
+ refreshPivotTable: (s, name, patch2) => refreshPivotTable(ctx, s, name, patch2),
22863
+ deletePivotTable: (s, name) => deletePivotTable(ctx, s, name),
21861
22864
  deleteDrawing: (s, index2) => deleteDrawing(ctx, s, index2),
22865
+ createSparklineGroup: (s, source, locations, patch2) => createSparklineGroup(ctx, s, source, locations, patch2),
22866
+ setSparklineGroups: (s, ranges, patch2) => setSparklineGroups(ctx, s, ranges, patch2),
22867
+ setSparklineDateRange: (s, ranges, source) => setSparklineDateRange(ctx, s, ranges, source),
22868
+ deleteSparklines: (s, ranges, wholeGroups) => deleteSparklines(ctx, s, ranges, wholeGroups),
21862
22869
  addChart: (s, chart) => addChart(ctx, s, chart),
21863
- updateChart: (s, index2, patch) => updateChart(ctx, s, index2, patch),
22870
+ updateChart: (s, index2, patch2) => updateChart(ctx, s, index2, patch2),
21864
22871
  addImage: (s, bytes, type, anchor, name) => addImage(ctx, s, bytes, type, anchor, name),
21865
22872
  replaceConditionalFormat: (s, index2, cf) => replaceConditionalFormat(ctx, s, index2, cf),
21866
22873
  removeConditionalFormat: (s, index2) => removeConditionalFormat(ctx, s, index2),
21867
22874
  setConditionalRulePriority: (s, f6, r, priority) => setConditionalRulePriority(ctx, s, f6, r, priority),
21868
22875
  moveConditionalRule: (s, f6, r, direction) => moveConditionalRule(ctx, s, f6, r, direction),
21869
- updateTable: (s, table2, patch) => updateTable(ctx, s, table2, patch),
22876
+ updateTable: (s, table2, patch2) => updateTable(ctx, s, table2, patch2),
21870
22877
  resizeTable: (s, table2, range2) => resizeTable(ctx, s, table2, range2),
21871
22878
  convertTableToRange: (s, table2) => convertTableToRange(ctx, s, table2),
21872
22879
  applyCellStyle: (s, ranges, name) => applyCellStyle(ctx, s, ranges, name),
21873
- setPageSetup: (s, patch) => setPageSetup(ctx, s, patch),
21874
- setPrintOptions: (s, patch) => setPrintOptions(ctx, s, patch),
22880
+ setPageSetup: (s, patch2) => setPageSetup(ctx, s, patch2),
22881
+ setPageBreak: (s, axis, before, present) => setPageBreak(ctx, s, axis, before, present),
22882
+ resetPageBreaks: (s) => resetPageBreaks(ctx, s),
22883
+ setPrintTitles: (s, patch2) => setPrintTitles(ctx, s, patch2),
22884
+ setPrintOptions: (s, patch2) => setPrintOptions(ctx, s, patch2),
21875
22885
  setSheetProtection: (s, p, password) => setSheetProtection(ctx, s, p, password),
21876
22886
  setWorkbookProtection: (locked, password) => setWorkbookProtection(ctx, locked, password),
21877
22887
  groupRows: (s, from, to) => groupRows(ctx, s, from, to),
@@ -21881,7 +22891,7 @@ function createEditSession(workbook, options = {}) {
21881
22891
  setDefaultColumnWidth: (s, width) => setDefaultColumnWidth(ctx, s, width),
21882
22892
  removeDuplicates: (s, range2, cols, hasHeader) => removeDuplicates(ctx, s, range2, cols, hasHeader),
21883
22893
  setCalcMode: (mode) => setCalcMode(ctx, mode),
21884
- setDocumentProperties: (patch) => setDocumentProperties(ctx, patch),
22894
+ setDocumentProperties: (patch2) => setDocumentProperties(ctx, patch2),
21885
22895
  setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
21886
22896
  autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
21887
22897
  calculateNow(options2) {
@@ -21896,12 +22906,12 @@ function createEditSession(workbook, options = {}) {
21896
22906
  validate: (s, r, c, value2) => validateCellInput(workbook, s, r, c, value2, {
21897
22907
  evaluate: (formula, at) => calc.evaluate(formula, at)
21898
22908
  }),
21899
- batch(label2, fn) {
22909
+ batch(label3, fn) {
21900
22910
  if (open) {
21901
22911
  fn();
21902
22912
  return;
21903
22913
  }
21904
- const current = begin(label2, "batch", {});
22914
+ const current = begin(label3, "batch", {});
21905
22915
  open = current;
21906
22916
  try {
21907
22917
  fn();
@@ -22856,21 +23866,21 @@ function stepFontSize(size, grow) {
22856
23866
  if (grow) return FONT_SIZES.find((s) => s > size) ?? Math.min(409, size + 10);
22857
23867
  return [...FONT_SIZES].reverse().find((s) => s < size) ?? Math.max(1, size - 1);
22858
23868
  }
22859
- var style = (ctx, patch) => {
22860
- withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch));
23869
+ var style = (ctx, patch2) => {
23870
+ withTarget(ctx, (t) => t.session.applyStyle(t.sheet, t.ranges, patch2));
22861
23871
  };
22862
23872
  function pickColor(arg) {
22863
23873
  if (arg && typeof arg === "object" && !arg.auto) return arg;
22864
23874
  return null;
22865
23875
  }
22866
- var toggle = (id, label2, glyph, shortcut, read, patch) => editing({
23876
+ var toggle = (id, label3, glyph, shortcut, read, patch2) => editing({
22867
23877
  id,
22868
- label: label2,
23878
+ label: label3,
22869
23879
  icon: icon(glyph),
22870
23880
  shortcut,
22871
23881
  lock: "formatCells",
22872
23882
  checked: read,
22873
- run: (ctx) => style(ctx, patch(!read(ctx)))
23883
+ run: (ctx) => style(ctx, patch2(!read(ctx)))
22874
23884
  });
22875
23885
  var BORDER_PRESETS = [
22876
23886
  ["bottom", "Bottom Border", "borderBottom"],
@@ -23050,10 +24060,10 @@ var mergedAtActive = (ctx) => {
23050
24060
  const t = target(ctx);
23051
24061
  return !!t && t.ws.merges.some((m) => rangesIntersect(m, t.range));
23052
24062
  };
23053
- function mergeCommand(id, label2, mode) {
24063
+ function mergeCommand(id, label3, mode) {
23054
24064
  return editing({
23055
24065
  id,
23056
- label: label2,
24066
+ label: label3,
23057
24067
  icon: icon("mergeCenter"),
23058
24068
  lock: "formatCells",
23059
24069
  ...mode === "center" ? { checked: mergedAtActive } : {},
@@ -23068,30 +24078,30 @@ function mergeCommand(id, label2, mode) {
23068
24078
  }
23069
24079
  if (t.ranges.some((range2) => mergeWouldDiscard(t.ws, range2, mode))) {
23070
24080
  const ok = await ctx.dialogs.open("confirm", {
23071
- heading: label2,
24081
+ heading: label3,
23072
24082
  message: "Merging cells only keeps the upper-left value and discards other values."
23073
24083
  });
23074
24084
  if (ok !== true) return;
23075
24085
  if (ctx.session() !== t.session || ctx.readOnly()) return;
23076
24086
  }
23077
- t.session.batch(label2, () => {
24087
+ t.session.batch(label3, () => {
23078
24088
  for (const range2 of t.ranges) t.session.merge(t.sheet, range2, mode);
23079
24089
  });
23080
24090
  }
23081
24091
  });
23082
24092
  }
23083
24093
  function alignmentCommands() {
23084
- const valign = (id, label2, value2, glyph) => editing({
24094
+ const valign = (id, label3, value2, glyph) => editing({
23085
24095
  id,
23086
- label: label2,
24096
+ label: label3,
23087
24097
  icon: icon(glyph),
23088
24098
  lock: "formatCells",
23089
24099
  checked: (ctx) => vertical(ctx) === value2,
23090
24100
  run: (ctx) => style(ctx, { alignment: { vertical: value2 === "bottom" ? UNSET : value2 } })
23091
24101
  });
23092
- const halign = (id, label2, value2, glyph) => editing({
24102
+ const halign = (id, label3, value2, glyph) => editing({
23093
24103
  id,
23094
- label: label2,
24104
+ label: label3,
23095
24105
  icon: icon(glyph),
23096
24106
  lock: "formatCells",
23097
24107
  checked: (ctx) => horizontal(ctx) === value2,
@@ -24475,6 +25485,24 @@ var MESSAGE_STRINGS = {
24475
25485
 
24476
25486
  // xlsx/ui/commands/i18n/navigation.ts
24477
25487
  var NAVIGATION_STRINGS = {
25488
+ "Sparklines (create, format and clear)": [
25489
+ "Graphiques sparkline (cr\xE9ation, mise en forme et suppression)",
25490
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
25491
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
25492
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u683C\u5F0F\u8BBE\u7F6E\u548C\u6E05\u9664\uFF09"
25493
+ ],
25494
+ "Worksheet-range PivotTables (one row field, optional column field and one value field)": [
25495
+ "Tableaux crois\xE9s dynamiques de plages (un champ de ligne, un champ de colonne facultatif et un champ de valeur)",
25496
+ "PivotTables aus Arbeitsblattbereichen (ein Zeilenfeld, optionales Spaltenfeld und ein Wertfeld)",
25497
+ "Tablas din\xE1micas de rangos (un campo de fila, columna opcional y un valor)",
25498
+ "\u5DE5\u4F5C\u8868\u533A\u57DF\u6570\u636E\u900F\u89C6\u8868\uFF08\u4E00\u4E2A\u884C\u5B57\u6BB5\u3001\u53EF\u9009\u5217\u5B57\u6BB5\u548C\u4E00\u4E2A\u503C\u5B57\u6BB5\uFF09"
25499
+ ],
25500
+ "Advanced PivotTable layouts, grouping and external data sources (preserved)": [
25501
+ "Dispositions avanc\xE9es, regroupements et sources externes de tableaux crois\xE9s dynamiques (conserv\xE9s)",
25502
+ "Erweiterte PivotTable-Layouts, Gruppierung und externe Datenquellen (erhalten)",
25503
+ "Dise\xF1os avanzados, agrupaci\xF3n y fuentes externas de tablas din\xE1micas (conservados)",
25504
+ "\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u5E03\u5C40\u3001\u5206\u7EC4\u548C\u5916\u90E8\u6570\u636E\u6E90\uFF08\u4FDD\u7559\uFF09"
25505
+ ],
24478
25506
  OK: ["OK", "OK", "Aceptar", "\u786E\u5B9A"],
24479
25507
  Cancel: ["Annuler", "Abbrechen", "Cancelar", "\u53D6\u6D88"],
24480
25508
  Close: ["Fermer", "Schlie\xDFen", "Cerrar", "\u5173\u95ED"],
@@ -26611,6 +27639,149 @@ var RIBBON_TAB_STRINGS = {
26611
27639
 
26612
27640
  // xlsx/ui/commands/i18n/tools.ts
26613
27641
  var TOOLS_STRINGS = {
27642
+ Bold: RIBBON_HOME_STRINGS.Bold,
27643
+ Italic: RIBBON_HOME_STRINGS.Italic,
27644
+ Underline: RIBBON_HOME_STRINGS.Underline,
27645
+ Strikethrough: RIBBON_HOME_STRINGS.Strikethrough,
27646
+ "Insert Formatting": [
27647
+ "Ins\xE9rer une mise en forme",
27648
+ "Formatierung einf\xFCgen",
27649
+ "Insertar formato",
27650
+ "\u63D2\u5165\u683C\u5F0F"
27651
+ ],
27652
+ 'Formatting: &B bold, &I italic, &U underline, &S strike, &18 font size, &KFF0000 RGB color, &"Arial,Regular" font.': [
27653
+ 'Format : &B gras, &I italique, &U soulign\xE9, &S barr\xE9, &18 taille, &KFF0000 couleur RVB, &"Arial,Regular" police.',
27654
+ 'Format: &B fett, &I kursiv, &U unterstrichen, &S durchgestrichen, &18 Schriftgr\xF6\xDFe, &KFF0000 RGB-Farbe, &"Arial,Regular" Schriftart.',
27655
+ 'Formato: &B negrita, &I cursiva, &U subrayado, &S tachado, &18 tama\xF1o, &KFF0000 color RGB, &"Arial,Regular" fuente.',
27656
+ '\u683C\u5F0F\uFF1A&B \u7C97\u4F53\u3001&I \u659C\u4F53\u3001&U \u4E0B\u5212\u7EBF\u3001&S \u5220\u9664\u7EBF\u3001&18 \u5B57\u53F7\u3001&KFF0000 RGB \u989C\u8272\u3001&"Arial,Regular" \u5B57\u4F53\u3002'
27657
+ ],
27658
+ "Date Range (optional):": [
27659
+ "Plage de dates (facultative) :",
27660
+ "Datumsbereich (optional):",
27661
+ "Rango de fechas (opcional):",
27662
+ "\u65E5\u671F\u8303\u56F4\uFF08\u53EF\u9009\uFF09\uFF1A"
27663
+ ],
27664
+ "Leave the date range empty for a general axis.": [
27665
+ "Laissez la plage de dates vide pour un axe g\xE9n\xE9ral.",
27666
+ "F\xFCr eine allgemeine Achse den Datumsbereich leer lassen.",
27667
+ "Deje vac\xEDo el rango de fechas para un eje general.",
27668
+ "\u5C06\u65E5\u671F\u8303\u56F4\u7559\u7A7A\u4EE5\u4F7F\u7528\u5E38\u89C4\u5750\u6807\u8F74\u3002"
27669
+ ],
27670
+ Time: ["Heure", "Zeit", "Hora", "\u65F6\u95F4"],
27671
+ "First Page Header:": [
27672
+ "En-t\xEAte de premi\xE8re page :",
27673
+ "Kopfzeile der ersten Seite:",
27674
+ "Encabezado de primera p\xE1gina:",
27675
+ "\u9996\u9875\u9875\u7709\uFF1A"
27676
+ ],
27677
+ "First Page Footer:": [
27678
+ "Pied de premi\xE8re page :",
27679
+ "Fu\xDFzeile der ersten Seite:",
27680
+ "Pie de primera p\xE1gina:",
27681
+ "\u9996\u9875\u9875\u811A\uFF1A"
27682
+ ],
27683
+ "Even Page Header:": [
27684
+ "En-t\xEAte des pages paires :",
27685
+ "Kopfzeile gerader Seiten:",
27686
+ "Encabezado de p\xE1ginas pares:",
27687
+ "\u5076\u6570\u9875\u9875\u7709\uFF1A"
27688
+ ],
27689
+ "Even Page Footer:": [
27690
+ "Pied des pages paires :",
27691
+ "Fu\xDFzeile gerader Seiten:",
27692
+ "Pie de p\xE1ginas pares:",
27693
+ "\u5076\u6570\u9875\u9875\u811A\uFF1A"
27694
+ ],
27695
+ "Different first page": [
27696
+ "Premi\xE8re page diff\xE9rente",
27697
+ "Erste Seite anders",
27698
+ "Primera p\xE1gina diferente",
27699
+ "\u9996\u9875\u4E0D\u540C"
27700
+ ],
27701
+ "Different odd and even pages": [
27702
+ "Pages paires et impaires diff\xE9rentes",
27703
+ "Gerade und ungerade Seiten unterschiedlich",
27704
+ "P\xE1ginas pares e impares diferentes",
27705
+ "\u5947\u5076\u9875\u4E0D\u540C"
27706
+ ],
27707
+ "Scale header and footer with document": [
27708
+ "Mettre l\u2019en-t\xEAte et le pied \xE0 l\u2019\xE9chelle du document",
27709
+ "Kopf- und Fu\xDFzeile mit Dokument skalieren",
27710
+ "Escalar encabezado y pie con el documento",
27711
+ "\u968F\u6587\u6863\u7F29\u653E\u9875\u7709\u548C\u9875\u811A"
27712
+ ],
27713
+ "Align header and footer with margins": [
27714
+ "Aligner l\u2019en-t\xEAte et le pied sur les marges",
27715
+ "Kopf- und Fu\xDFzeile an R\xE4ndern ausrichten",
27716
+ "Alinear encabezado y pie con los m\xE1rgenes",
27717
+ "\u5C06\u9875\u7709\u548C\u9875\u811A\u4E0E\u9875\u8FB9\u8DDD\u5BF9\u9F50"
27718
+ ],
27719
+ "Insert Field": ["Ins\xE9rer un champ", "Feld einf\xFCgen", "Insertar campo", "\u63D2\u5165\u5B57\u6BB5"],
27720
+ "Page Number": ["Num\xE9ro de page", "Seitenzahl", "N\xFAmero de p\xE1gina", "\u9875\u7801"],
27721
+ "Total Pages": ["Nombre de pages", "Gesamtseitenzahl", "Total de p\xE1ginas", "\u603B\u9875\u6570"],
27722
+ "Sheet Name": ["Nom de feuille", "Blattname", "Nombre de hoja", "\u5DE5\u4F5C\u8868\u540D\u79F0"],
27723
+ "File Name": ["Nom de fichier", "Dateiname", "Nombre de archivo", "\u6587\u4EF6\u540D"],
27724
+ "Rows to repeat at top": [
27725
+ "Lignes \xE0 r\xE9p\xE9ter en haut",
27726
+ "Wiederholungszeilen oben",
27727
+ "Filas a repetir arriba",
27728
+ "\u9876\u7AEF\u6807\u9898\u884C"
27729
+ ],
27730
+ "Columns to repeat at left": [
27731
+ "Colonnes \xE0 r\xE9p\xE9ter \xE0 gauche",
27732
+ "Wiederholungsspalten links",
27733
+ "Columnas a repetir a la izquierda",
27734
+ "\u5DE6\u7AEF\u6807\u9898\u5217"
27735
+ ],
27736
+ "Use first page number": [
27737
+ "Utiliser le premier num\xE9ro de page",
27738
+ "Erste Seitenzahl verwenden",
27739
+ "Usar primer n\xFAmero de p\xE1gina",
27740
+ "\u4F7F\u7528\u8D77\u59CB\u9875\u7801"
27741
+ ],
27742
+ "First page number": [
27743
+ "Premier num\xE9ro de page",
27744
+ "Erste Seitenzahl",
27745
+ "Primer n\xFAmero de p\xE1gina",
27746
+ "\u8D77\u59CB\u9875\u7801"
27747
+ ],
27748
+ "Enter a first page number between 0 and 32767.": [
27749
+ "Entrez un premier num\xE9ro entre 0 et 32767.",
27750
+ "Geben Sie eine erste Seitenzahl zwischen 0 und 32767 ein.",
27751
+ "Introduzca un primer n\xFAmero entre 0 y 32767.",
27752
+ "\u8BF7\u8F93\u5165 0 \u5230 32767 \u4E4B\u95F4\u7684\u8D77\u59CB\u9875\u7801\u3002"
27753
+ ],
27754
+ "Print titles must be whole rows or whole columns.": [
27755
+ "Les titres doivent \xEAtre des lignes ou colonnes enti\xE8res.",
27756
+ "Drucktitel m\xFCssen ganze Zeilen oder Spalten sein.",
27757
+ "Los t\xEDtulos deben ser filas o columnas completas.",
27758
+ "\u6253\u5370\u6807\u9898\u5FC5\u987B\u4E3A\u6574\u884C\u6216\u6574\u5217\u3002"
27759
+ ],
27760
+ "Existing print titles are unsupported. Changing a title range replaces them; leaving the fields unchanged preserves them.": [
27761
+ "Les titres existants ne sont pas pris en charge. Modifier une plage les remplace ; conserver les champs les pr\xE9serve.",
27762
+ "Vorhandene Drucktitel werden nicht unterst\xFCtzt. Eine Bereichs\xE4nderung ersetzt sie; unver\xE4nderte Felder bewahren sie.",
27763
+ "Los t\xEDtulos existentes no son compatibles. Cambiar un rango los reemplaza; dejar los campos sin cambios los conserva.",
27764
+ "\u4E0D\u652F\u6301\u73B0\u6709\u6253\u5370\u6807\u9898\u3002\u66F4\u6539\u6807\u9898\u533A\u57DF\u4F1A\u66FF\u6362\u5B83\u4EEC\uFF1B\u4FDD\u6301\u5B57\u6BB5\u4E0D\u53D8\u53EF\u4FDD\u7559\u5B83\u4EEC\u3002"
27765
+ ],
27766
+ "Use &L, &C and &R for sections. Fields: &P page, &N total pages, &A sheet, &F file, &D date, &T time. Use && for an ampersand. Unsupported formatting codes are preserved.": [
27767
+ "Utilisez &L, &C et &R pour les sections. Champs : &P page, &N total, &A feuille, &F fichier, &D date, &T heure. && affiche une esperluette. Les codes non pris en charge sont conserv\xE9s.",
27768
+ "Verwenden Sie &L, &C und &R f\xFCr Abschnitte. Felder: &P Seite, &N Gesamtseiten, &A Blatt, &F Datei, &D Datum, &T Zeit. && ergibt ein Und-Zeichen. Nicht unterst\xFCtzte Formatcodes bleiben erhalten.",
27769
+ "Use &L, &C y &R para secciones. Campos: &P p\xE1gina, &N total, &A hoja, &F archivo, &D fecha, &T hora. && muestra un ampersand. Se conservan los c\xF3digos no compatibles.",
27770
+ "\u4F7F\u7528 &L\u3001&C\u3001&R \u6307\u5B9A\u533A\u57DF\u3002\u5B57\u6BB5\uFF1A&P \u9875\u7801\u3001&N \u603B\u9875\u6570\u3001&A \u5DE5\u4F5C\u8868\u3001&F \u6587\u4EF6\u3001&D \u65E5\u671F\u3001&T \u65F6\u95F4\u3002&& \u8868\u793A &\u3002\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u683C\u5F0F\u4EE3\u7801\u3002"
27771
+ ],
27772
+ "Page order": ["Ordre des pages", "Seitenreihenfolge", "Orden de p\xE1ginas", "\u9875\u5E8F"],
27773
+ "Down, then over": [
27774
+ "Vers le bas, puis \xE0 droite",
27775
+ "Nach unten, dann nach rechts",
27776
+ "Hacia abajo, luego a la derecha",
27777
+ "\u5148\u5411\u4E0B\uFF0C\u518D\u5411\u53F3"
27778
+ ],
27779
+ "Over, then down": [
27780
+ "\xC0 droite, puis vers le bas",
27781
+ "Nach rechts, dann nach unten",
27782
+ "A la derecha, luego hacia abajo",
27783
+ "\u5148\u5411\u53F3\uFF0C\u518D\u5411\u4E0B"
27784
+ ],
26614
27785
  // Insert Chart
26615
27786
  "Insert Chart": ["Ins\xE9rer un graphique", "Diagramm einf\xFCgen", "Insertar gr\xE1fico", "\u63D2\u5165\u56FE\u8868"],
26616
27787
  "Change Chart Type": [
@@ -27079,6 +28250,508 @@ var TOOLS_STRINGS = {
27079
28250
  ]
27080
28251
  };
27081
28252
 
28253
+ // xlsx/ui/commands/i18n/sparklines.ts
28254
+ var SPARKLINE_STRINGS = {
28255
+ Mixed: ["Mixte", "Gemischt", "Mixto", "\u6DF7\u5408"],
28256
+ "Only changed settings are applied.": [
28257
+ "Seuls les param\xE8tres modifi\xE9s sont appliqu\xE9s.",
28258
+ "Nur ge\xE4nderte Einstellungen werden angewendet.",
28259
+ "Solo se aplica la configuraci\xF3n modificada.",
28260
+ "\u4EC5\u5E94\u7528\u5DF2\u66F4\u6539\u7684\u8BBE\u7F6E\u3002"
28261
+ ],
28262
+ "Colors vary between selected groups.": [
28263
+ "Les couleurs varient entre les groupes s\xE9lectionn\xE9s.",
28264
+ "Die Farben der ausgew\xE4hlten Gruppen unterscheiden sich.",
28265
+ "Los colores var\xEDan entre los grupos seleccionados.",
28266
+ "\u9009\u5B9A\u7EC4\u7684\u989C\u8272\u4E0D\u540C\u3002"
28267
+ ],
28268
+ Markers: ["Marqueurs", "Markierungen", "Marcadores", "\u6807\u8BB0"],
28269
+ Gaps: ["Espaces", "L\xFCcken", "Huecos", "\u95F4\u9699"],
28270
+ Zero: ["Z\xE9ro", "Null", "Cero", "\u96F6"],
28271
+ Axis: ["Axe", "Achse", "Eje", "\u5750\u6807\u8F74"],
28272
+ "Sparklines (create, format and clear)": [
28273
+ "Graphiques sparkline (cr\xE9er, mettre en forme et effacer)",
28274
+ "Sparklines (erstellen, formatieren und l\xF6schen)",
28275
+ "Minigr\xE1ficos (crear, dar formato y borrar)",
28276
+ "\u8FF7\u4F60\u56FE\uFF08\u521B\u5EFA\u3001\u8BBE\u7F6E\u683C\u5F0F\u548C\u6E05\u9664\uFF09"
28277
+ ],
28278
+ "Charts and sparklines support editing; pivot tables, macros and other unsupported parts are kept in the file but not shown.": [
28279
+ "Les graphiques et graphiques sparkline peuvent \xEAtre modifi\xE9s ; les tableaux crois\xE9s dynamiques, macros et autres \xE9l\xE9ments non pris en charge sont conserv\xE9s dans le fichier mais ne sont pas affich\xE9s.",
28280
+ "Diagramme und Sparklines k\xF6nnen bearbeitet werden; Pivot-Tabellen, Makros und andere nicht unterst\xFCtzte Teile bleiben in der Datei erhalten, werden aber nicht angezeigt.",
28281
+ "Los gr\xE1ficos y minigr\xE1ficos se pueden editar; las tablas din\xE1micas, macros y otras partes no compatibles se conservan en el archivo pero no se muestran.",
28282
+ "\u56FE\u8868\u548C\u8FF7\u4F60\u56FE\u652F\u6301\u7F16\u8F91\uFF1B\u6570\u636E\u900F\u89C6\u8868\u3001\u5B8F\u548C\u5176\u4ED6\u4E0D\u652F\u6301\u7684\u90E8\u5206\u4FDD\u5B58\u5728\u6587\u4EF6\u4E2D\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28283
+ ],
28284
+ Sparklines: ["Graphiques sparkline", "Sparklines", "Minigr\xE1ficos", "\u8FF7\u4F60\u56FE"],
28285
+ "Line Sparkline": [
28286
+ "Sparkline en courbe",
28287
+ "Linien-Sparkline",
28288
+ "Minigr\xE1fico de l\xEDnea",
28289
+ "\u6298\u7EBF\u8FF7\u4F60\u56FE"
28290
+ ],
28291
+ "Column Sparkline": [
28292
+ "Sparkline en colonnes",
28293
+ "S\xE4ulen-Sparkline",
28294
+ "Minigr\xE1fico de columna",
28295
+ "\u67F1\u5F62\u8FF7\u4F60\u56FE"
28296
+ ],
28297
+ "Win/Loss Sparkline": [
28298
+ "Sparkline gains/pertes",
28299
+ "Gewinn/Verlust-Sparkline",
28300
+ "Minigr\xE1fico de ganancias y p\xE9rdidas",
28301
+ "\u76C8\u4E8F\u8FF7\u4F60\u56FE"
28302
+ ],
28303
+ "Win/Loss": ["Gains/pertes", "Gewinn/Verlust", "Ganancias y p\xE9rdidas", "\u76C8\u4E8F"],
28304
+ "Create Sparklines": [
28305
+ "Cr\xE9er des graphiques sparkline",
28306
+ "Sparklines erstellen",
28307
+ "Crear minigr\xE1ficos",
28308
+ "\u521B\u5EFA\u8FF7\u4F60\u56FE"
28309
+ ],
28310
+ "Sparkline Settings": [
28311
+ "Param\xE8tres des graphiques sparkline",
28312
+ "Sparkline-Einstellungen",
28313
+ "Configuraci\xF3n de minigr\xE1ficos",
28314
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E"
28315
+ ],
28316
+ "Data Range:": ["Plage de donn\xE9es :", "Datenbereich:", "Rango de datos:", "\u6570\u636E\u8303\u56F4\uFF1A"],
28317
+ "Location Range:": [
28318
+ "Plage d\u2019emplacement :",
28319
+ "Positionsbereich:",
28320
+ "Rango de ubicaci\xF3n:",
28321
+ "\u4F4D\u7F6E\u8303\u56F4\uFF1A"
28322
+ ],
28323
+ "Sparkline Type:": [
28324
+ "Type de sparkline :",
28325
+ "Sparkline-Typ:",
28326
+ "Tipo de minigr\xE1fico:",
28327
+ "\u8FF7\u4F60\u56FE\u7C7B\u578B\uFF1A"
28328
+ ],
28329
+ "Line Weight:": ["\xC9paisseur du trait :", "Linienst\xE4rke:", "Grosor de l\xEDnea:", "\u7EBF\u6761\u7C97\u7EC6\uFF1A"],
28330
+ "Changes apply to the entire selected sparkline groups.": [
28331
+ "Les modifications s\u2019appliquent \xE0 tous les groupes de graphiques sparkline s\xE9lectionn\xE9s.",
28332
+ "\xC4nderungen gelten f\xFCr die gesamten ausgew\xE4hlten Sparkline-Gruppen.",
28333
+ "Los cambios se aplican a todos los grupos de minigr\xE1ficos seleccionados.",
28334
+ "\u66F4\u6539\u5E94\u7528\u4E8E\u6574\u4E2A\u9009\u5B9A\u7684\u8FF7\u4F60\u56FE\u7EC4\u3002"
28335
+ ],
28336
+ "High Point": ["Point haut", "H\xF6chstpunkt", "Punto alto", "\u9AD8\u70B9"],
28337
+ "Low Point": ["Point bas", "Tiefstpunkt", "Punto bajo", "\u4F4E\u70B9"],
28338
+ "First Point": ["Premier point", "Erster Punkt", "Primer punto", "\u9996\u70B9"],
28339
+ "Last Point": ["Dernier point", "Letzter Punkt", "\xDAltimo punto", "\u672B\u70B9"],
28340
+ "Negative Points": ["Points n\xE9gatifs", "Negative Punkte", "Puntos negativos", "\u8D1F\u503C\u70B9"],
28341
+ "Sparkline Color:": [
28342
+ "Couleur du sparkline :",
28343
+ "Sparkline-Farbe:",
28344
+ "Color del minigr\xE1fico:",
28345
+ "\u8FF7\u4F60\u56FE\u989C\u8272\uFF1A"
28346
+ ],
28347
+ "Negative Color:": [
28348
+ "Couleur n\xE9gative :",
28349
+ "Farbe f\xFCr negative Werte:",
28350
+ "Color negativo:",
28351
+ "\u8D1F\u503C\u989C\u8272\uFF1A"
28352
+ ],
28353
+ "Minimum Axis:": ["Axe minimum :", "Achsenminimum:", "Eje m\xEDnimo:", "\u6700\u5C0F\u5750\u6807\u8F74\uFF1A"],
28354
+ "Maximum Axis:": ["Axe maximum :", "Achsenmaximum:", "Eje m\xE1ximo:", "\u6700\u5927\u5750\u6807\u8F74\uFF1A"],
28355
+ "Minimum Value:": ["Valeur minimum :", "Mindestwert:", "Valor m\xEDnimo:", "\u6700\u5C0F\u503C\uFF1A"],
28356
+ "Maximum Value:": ["Valeur maximum :", "H\xF6chstwert:", "Valor m\xE1ximo:", "\u6700\u5927\u503C\uFF1A"],
28357
+ Individual: ["Individuel", "Individuell", "Individual", "\u5355\u72EC"],
28358
+ "Same for all sparklines": [
28359
+ "Identique pour tous les graphiques sparkline",
28360
+ "F\xFCr alle Sparklines gleich",
28361
+ "Igual para todos los minigr\xE1ficos",
28362
+ "\u6240\u6709\u8FF7\u4F60\u56FE\u76F8\u540C"
28363
+ ],
28364
+ "Empty Cells:": ["Cellules vides :", "Leere Zellen:", "Celdas vac\xEDas:", "\u7A7A\u5355\u5143\u683C\uFF1A"],
28365
+ "Connect data points": [
28366
+ "Relier les points de donn\xE9es",
28367
+ "Datenpunkte verbinden",
28368
+ "Conectar puntos de datos",
28369
+ "\u8FDE\u63A5\u6570\u636E\u70B9"
28370
+ ],
28371
+ "Show data in hidden rows and columns": [
28372
+ "Afficher les donn\xE9es des lignes et colonnes masqu\xE9es",
28373
+ "Daten in ausgeblendeten Zeilen und Spalten anzeigen",
28374
+ "Mostrar datos en filas y columnas ocultas",
28375
+ "\u663E\u793A\u9690\u85CF\u884C\u548C\u5217\u4E2D\u7684\u6570\u636E"
28376
+ ],
28377
+ "Show horizontal axis": [
28378
+ "Afficher l\u2019axe horizontal",
28379
+ "Horizontale Achse anzeigen",
28380
+ "Mostrar eje horizontal",
28381
+ "\u663E\u793A\u6C34\u5E73\u5750\u6807\u8F74"
28382
+ ],
28383
+ "Plot right to left": [
28384
+ "Tracer de droite \xE0 gauche",
28385
+ "Von rechts nach links zeichnen",
28386
+ "Trazar de derecha a izquierda",
28387
+ "\u4ECE\u53F3\u5411\u5DE6\u7ED8\u5236"
28388
+ ],
28389
+ "Clear Sparklines": [
28390
+ "Effacer les graphiques sparkline",
28391
+ "Sparklines l\xF6schen",
28392
+ "Borrar minigr\xE1ficos",
28393
+ "\u6E05\u9664\u8FF7\u4F60\u56FE"
28394
+ ],
28395
+ "Clear Selected Sparklines": [
28396
+ "Effacer les graphiques sparkline s\xE9lectionn\xE9s",
28397
+ "Ausgew\xE4hlte Sparklines l\xF6schen",
28398
+ "Borrar minigr\xE1ficos seleccionados",
28399
+ "\u6E05\u9664\u9009\u5B9A\u8FF7\u4F60\u56FE"
28400
+ ],
28401
+ "Clear Sparkline Groups": [
28402
+ "Effacer les groupes de graphiques sparkline",
28403
+ "Sparkline-Gruppen l\xF6schen",
28404
+ "Borrar grupos de minigr\xE1ficos",
28405
+ "\u6E05\u9664\u8FF7\u4F60\u56FE\u7EC4"
28406
+ ],
28407
+ "The data range and location range do not match.": [
28408
+ "La plage de donn\xE9es et la plage d\u2019emplacement ne correspondent pas.",
28409
+ "Datenbereich und Positionsbereich stimmen nicht \xFCberein.",
28410
+ "El rango de datos y el rango de ubicaci\xF3n no coinciden.",
28411
+ "\u6570\u636E\u8303\u56F4\u548C\u4F4D\u7F6E\u8303\u56F4\u4E0D\u5339\u914D\u3002"
28412
+ ],
28413
+ "The sparkline location range is too large.": [
28414
+ "La plage d\u2019emplacement des graphiques sparkline est trop grande.",
28415
+ "Der Sparkline-Positionsbereich ist zu gro\xDF.",
28416
+ "El rango de ubicaci\xF3n del minigr\xE1fico es demasiado grande.",
28417
+ "\u8FF7\u4F60\u56FE\u4F4D\u7F6E\u8303\u56F4\u8FC7\u5927\u3002"
28418
+ ],
28419
+ "The location range already contains sparklines.": [
28420
+ "La plage d\u2019emplacement contient d\xE9j\xE0 des graphiques sparkline.",
28421
+ "Der Positionsbereich enth\xE4lt bereits Sparklines.",
28422
+ "El rango de ubicaci\xF3n ya contiene minigr\xE1ficos.",
28423
+ "\u4F4D\u7F6E\u8303\u56F4\u5DF2\u5305\u542B\u8FF7\u4F60\u56FE\u3002"
28424
+ ],
28425
+ "Sparklines cannot be created in merged cells.": [
28426
+ "Impossible de cr\xE9er des graphiques sparkline dans des cellules fusionn\xE9es.",
28427
+ "Sparklines k\xF6nnen nicht in verbundenen Zellen erstellt werden.",
28428
+ "No se pueden crear minigr\xE1ficos en celdas combinadas.",
28429
+ "\u65E0\u6CD5\u5728\u5408\u5E76\u5355\u5143\u683C\u4E2D\u521B\u5EFA\u8FF7\u4F60\u56FE\u3002"
28430
+ ],
28431
+ "The sparkline settings are not valid.": [
28432
+ "Les param\xE8tres des graphiques sparkline ne sont pas valides.",
28433
+ "Die Sparkline-Einstellungen sind ung\xFCltig.",
28434
+ "La configuraci\xF3n del minigr\xE1fico no es v\xE1lida.",
28435
+ "\u8FF7\u4F60\u56FE\u8BBE\u7F6E\u65E0\u6548\u3002"
28436
+ ],
28437
+ "The sparkline axis limits are not valid.": [
28438
+ "Les limites d\u2019axe des graphiques sparkline ne sont pas valides.",
28439
+ "Die Sparkline-Achsengrenzen sind ung\xFCltig.",
28440
+ "Los l\xEDmites del eje del minigr\xE1fico no son v\xE1lidos.",
28441
+ "\u8FF7\u4F60\u56FE\u5750\u6807\u8F74\u754C\u9650\u65E0\u6548\u3002"
28442
+ ]
28443
+ };
28444
+
28445
+ // xlsx/ui/commands/i18n/pivots.ts
28446
+ var PIVOT_STRINGS = {
28447
+ "Compact Form": ["Forme compacte", "Kompaktformat", "Formato compacto", "\u538B\u7F29\u5F62\u5F0F"],
28448
+ "Outline Form": ["Forme de plan", "Gliederungsformat", "Formato de esquema", "\u5927\u7EB2\u5F62\u5F0F"],
28449
+ "Tabular Form": ["Forme tabulaire", "Tabellenformat", "Formato tabular", "\u8868\u683C\u5F62\u5F0F"],
28450
+ "Report Layout:": [
28451
+ "Disposition du rapport :",
28452
+ "Berichtslayout:",
28453
+ "Dise\xF1o del informe:",
28454
+ "\u62A5\u8868\u5E03\u5C40\uFF1A"
28455
+ ],
28456
+ "Subtotal Position:": [
28457
+ "Position des sous-totaux :",
28458
+ "Position der Teilergebnisse:",
28459
+ "Posici\xF3n de subtotales:",
28460
+ "\u5206\u7C7B\u6C47\u603B\u4F4D\u7F6E\uFF1A"
28461
+ ],
28462
+ "Above each group": [
28463
+ "Au-dessus de chaque groupe",
28464
+ "\xDCber jeder Gruppe",
28465
+ "Encima de cada grupo",
28466
+ "\u6BCF\u7EC4\u4E0A\u65B9"
28467
+ ],
28468
+ "Below each group": [
28469
+ "Sous chaque groupe",
28470
+ "Unter jeder Gruppe",
28471
+ "Debajo de cada grupo",
28472
+ "\u6BCF\u7EC4\u4E0B\u65B9"
28473
+ ],
28474
+ "Show subtotals": [
28475
+ "Afficher les sous-totaux",
28476
+ "Teilergebnisse anzeigen",
28477
+ "Mostrar subtotales",
28478
+ "\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28479
+ ],
28480
+ "Tabular layout displays subtotals below groups.": [
28481
+ "La disposition tabulaire affiche les sous-totaux sous les groupes.",
28482
+ "Das tabellarische Layout zeigt Teilergebnisse unter den Gruppen.",
28483
+ "El dise\xF1o tabular muestra subtotales debajo de los grupos.",
28484
+ "\u8868\u683C\u5E03\u5C40\u5728\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B\u3002"
28485
+ ],
28486
+ "Second Row Field:": [
28487
+ "Deuxi\xE8me champ de ligne :",
28488
+ "Zweites Zeilenfeld:",
28489
+ "Segundo campo de fila:",
28490
+ "\u7B2C\u4E8C\u884C\u5B57\u6BB5\uFF1A"
28491
+ ],
28492
+ "Show subtotals below each group": [
28493
+ "Afficher les sous-totaux sous chaque groupe",
28494
+ "Teilergebnisse unter jeder Gruppe anzeigen",
28495
+ "Mostrar subtotales debajo de cada grupo",
28496
+ "\u5728\u6BCF\u7EC4\u4E0B\u65B9\u663E\u793A\u5206\u7C7B\u6C47\u603B"
28497
+ ],
28498
+ "Repeat row labels": [
28499
+ "R\xE9p\xE9ter les \xE9tiquettes de ligne",
28500
+ "Zeilenbeschriftungen wiederholen",
28501
+ "Repetir etiquetas de fila",
28502
+ "\u91CD\u590D\u884C\u6807\u7B7E"
28503
+ ],
28504
+ "Charts, sparklines and worksheet-range PivotTables support editing. Advanced PivotTables, macros and other unsupported parts are preserved.": [
28505
+ "Les graphiques, graphiques sparkline et tableaux crois\xE9s dynamiques de plages prennent en charge la modification. Les tableaux avanc\xE9s, macros et autres \xE9l\xE9ments non pris en charge sont conserv\xE9s.",
28506
+ "Diagramme, Sparklines und PivotTables aus Arbeitsblattbereichen k\xF6nnen bearbeitet werden. Erweiterte PivotTables, Makros und andere nicht unterst\xFCtzte Teile bleiben erhalten.",
28507
+ "Los gr\xE1ficos, minigr\xE1ficos y tablas din\xE1micas de rangos admiten edici\xF3n. Se conservan las tablas avanzadas, macros y otros elementos no compatibles.",
28508
+ "\u652F\u6301\u7F16\u8F91\u56FE\u8868\u3001\u8FF7\u4F60\u56FE\u548C\u5DE5\u4F5C\u8868\u533A\u57DF\u6570\u636E\u900F\u89C6\u8868\u3002\u4FDD\u7559\u9AD8\u7EA7\u6570\u636E\u900F\u89C6\u8868\u3001\u5B8F\u548C\u5176\u4ED6\u4E0D\u652F\u6301\u7684\u5185\u5BB9\u3002"
28509
+ ],
28510
+ PivotTable: ["Tableau crois\xE9 dynamique", "PivotTable", "Tabla din\xE1mica", "\u6570\u636E\u900F\u89C6\u8868"],
28511
+ "Create PivotTable": [
28512
+ "Cr\xE9er un tableau crois\xE9 dynamique",
28513
+ "PivotTable erstellen",
28514
+ "Crear tabla din\xE1mica",
28515
+ "\u521B\u5EFA\u6570\u636E\u900F\u89C6\u8868"
28516
+ ],
28517
+ "PivotTable Settings": [
28518
+ "Param\xE8tres du tableau crois\xE9 dynamique",
28519
+ "PivotTable-Einstellungen",
28520
+ "Configuraci\xF3n de tabla din\xE1mica",
28521
+ "\u6570\u636E\u900F\u89C6\u8868\u8BBE\u7F6E"
28522
+ ],
28523
+ "Refresh PivotTable": [
28524
+ "Actualiser le tableau crois\xE9 dynamique",
28525
+ "PivotTable aktualisieren",
28526
+ "Actualizar tabla din\xE1mica",
28527
+ "\u5237\u65B0\u6570\u636E\u900F\u89C6\u8868"
28528
+ ],
28529
+ "Delete PivotTable": [
28530
+ "Supprimer le tableau crois\xE9 dynamique",
28531
+ "PivotTable l\xF6schen",
28532
+ "Eliminar tabla din\xE1mica",
28533
+ "\u5220\u9664\u6570\u636E\u900F\u89C6\u8868"
28534
+ ],
28535
+ "Source Range:": ["Plage source :", "Quellbereich:", "Rango de origen:", "\u6E90\u533A\u57DF\uFF1A"],
28536
+ "Destination Cell:": [
28537
+ "Cellule de destination :",
28538
+ "Zielzelle:",
28539
+ "Celda de destino:",
28540
+ "\u76EE\u6807\u5355\u5143\u683C\uFF1A"
28541
+ ],
28542
+ "Row Field:": ["Champ de ligne :", "Zeilenfeld:", "Campo de fila:", "\u884C\u5B57\u6BB5\uFF1A"],
28543
+ "Column Field:": ["Champ de colonne :", "Spaltenfeld:", "Campo de columna:", "\u5217\u5B57\u6BB5\uFF1A"],
28544
+ "Value Field:": ["Champ de valeur :", "Wertfeld:", "Campo de valor:", "\u503C\u5B57\u6BB5\uFF1A"],
28545
+ "Summarize Values By:": [
28546
+ "Synth\xE9tiser les valeurs par :",
28547
+ "Werte zusammenfassen nach:",
28548
+ "Resumir valores por:",
28549
+ "\u503C\u6C47\u603B\u65B9\u5F0F\uFF1A"
28550
+ ],
28551
+ "(None)": ["(Aucun)", "(Keine)", "(Ninguno)", "\uFF08\u65E0\uFF09"]
28552
+ };
28553
+
28554
+ // xlsx/ui/commands/i18n/print-layout.ts
28555
+ var PRINT_LAYOUT_STRINGS = {
28556
+ "Unsupported header/footer codes are preserved but not rendered.": [
28557
+ "Les codes d\u2019en-t\xEAte et pied non pris en charge sont conserv\xE9s mais non rendus.",
28558
+ "Nicht unterst\xFCtzte Kopf- und Fu\xDFzeilencodes bleiben erhalten, werden aber nicht dargestellt.",
28559
+ "Se conservan los c\xF3digos no compatibles del encabezado y pie, pero no se muestran.",
28560
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u4EE3\u7801\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28561
+ ],
28562
+ "Browser printing includes page setup, manual breaks, leading print titles and header/footer fields. Drawings and unsupported formatting are preserved but not rendered.": [
28563
+ "L\u2019impression du navigateur inclut la mise en page, les sauts manuels, les titres en t\xEAte et les champs d\u2019en-t\xEAte et pied. Les dessins et formats non pris en charge sont conserv\xE9s mais non rendus.",
28564
+ "Der Browserdruck umfasst Seiteneinrichtung, manuelle Umbr\xFCche, f\xFChrende Drucktitel sowie Kopf- und Fu\xDFzeilenfelder. Zeichnungen und nicht unterst\xFCtzte Formatierung bleiben erhalten, werden aber nicht dargestellt.",
28565
+ "La impresi\xF3n del navegador incluye configuraci\xF3n de p\xE1gina, saltos manuales, t\xEDtulos iniciales y campos de encabezado y pie. Se conservan dibujos y formatos no compatibles, pero no se muestran.",
28566
+ "\u6D4F\u89C8\u5668\u6253\u5370\u5305\u542B\u9875\u9762\u8BBE\u7F6E\u3001\u624B\u52A8\u5206\u9875\u7B26\u3001\u8D77\u59CB\u6253\u5370\u6807\u9898\u548C\u9875\u7709\u9875\u811A\u5B57\u6BB5\u3002\u4FDD\u7559\u7ED8\u56FE\u548C\u4E0D\u652F\u6301\u7684\u683C\u5F0F\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28567
+ ],
28568
+ "Non-leading or unsupported print titles are preserved but not rendered.": [
28569
+ "Les titres non plac\xE9s en t\xEAte ou non pris en charge sont conserv\xE9s mais non rendus.",
28570
+ "Nicht f\xFChrende oder nicht unterst\xFCtzte Drucktitel bleiben erhalten, werden aber nicht dargestellt.",
28571
+ "Se conservan los t\xEDtulos no iniciales o no compatibles, pero no se muestran.",
28572
+ "\u4FDD\u7559\u975E\u8D77\u59CB\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28573
+ ],
28574
+ "Print title ranges are too large for preview.": [
28575
+ "Les plages de titres sont trop grandes pour l\u2019aper\xE7u.",
28576
+ "Die Drucktitelbereiche sind f\xFCr die Vorschau zu gro\xDF.",
28577
+ "Los rangos de t\xEDtulos son demasiado grandes para la vista previa.",
28578
+ "\u6253\u5370\u6807\u9898\u533A\u57DF\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8\u3002"
28579
+ ],
28580
+ "Repeated titles leave no room for worksheet data.": [
28581
+ "Les titres r\xE9p\xE9t\xE9s ne laissent pas de place aux donn\xE9es.",
28582
+ "Wiederholte Titel lassen keinen Platz f\xFCr Arbeitsblattdaten.",
28583
+ "Los t\xEDtulos repetidos no dejan espacio para los datos.",
28584
+ "\u91CD\u590D\u6807\u9898\u672A\u7ED9\u5DE5\u4F5C\u8868\u6570\u636E\u7559\u51FA\u7A7A\u95F4\u3002"
28585
+ ],
28586
+ "Preview does not render drawings.": [
28587
+ "L\u2019aper\xE7u ne rend pas les dessins.",
28588
+ "Die Vorschau stellt Zeichnungen nicht dar.",
28589
+ "La vista previa no muestra dibujos.",
28590
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3002"
28591
+ ],
28592
+ "Unsupported header or footer formatting and image fields are preserved but not rendered.": [
28593
+ "Les formats et champs d\u2019image non pris en charge des en-t\xEAtes et pieds sont conserv\xE9s mais non rendus.",
28594
+ "Nicht unterst\xFCtzte Formatierungen und Bildfelder in Kopf- und Fu\xDFzeilen bleiben erhalten, werden aber nicht dargestellt.",
28595
+ "Se conservan los formatos y campos de imagen no compatibles del encabezado y pie, pero no se muestran.",
28596
+ "\u4FDD\u7559\u4E0D\u652F\u6301\u7684\u9875\u7709\u548C\u9875\u811A\u683C\u5F0F\u53CA\u56FE\u50CF\u5B57\u6BB5\uFF0C\u4F46\u4E0D\u663E\u793A\u3002"
28597
+ ],
28598
+ "Merged print ranges are too large.": [
28599
+ "Les plages fusionn\xE9es \xE0 imprimer sont trop grandes.",
28600
+ "Die verbundenen Druckbereiche sind zu gro\xDF.",
28601
+ "Los rangos combinados de impresi\xF3n son demasiado grandes.",
28602
+ "\u5408\u5E76\u6253\u5370\u533A\u57DF\u8FC7\u5927\u3002"
28603
+ ],
28604
+ "Multiple or unsupported print areas are preserved; preview uses the worksheet used range.": [
28605
+ "Les zones d\u2019impression multiples ou non prises en charge sont conserv\xE9es ; l\u2019aper\xE7u utilise la plage utilis\xE9e de la feuille.",
28606
+ "Mehrere oder nicht unterst\xFCtzte Druckbereiche bleiben erhalten; die Vorschau verwendet den benutzten Arbeitsblattbereich.",
28607
+ "Se conservan las \xE1reas m\xFAltiples o no compatibles; la vista previa usa el rango utilizado de la hoja.",
28608
+ "\u4FDD\u7559\u591A\u4E2A\u6216\u4E0D\u652F\u6301\u7684\u6253\u5370\u533A\u57DF\uFF1B\u9884\u89C8\u4F7F\u7528\u5DE5\u4F5C\u8868\u5DF2\u7528\u533A\u57DF\u3002"
28609
+ ],
28610
+ "Previous Page": ["Page pr\xE9c\xE9dente", "Vorherige Seite", "P\xE1gina anterior", "\u4E0A\u4E00\u9875"],
28611
+ "Next Page": ["Page suivante", "N\xE4chste Seite", "P\xE1gina siguiente", "\u4E0B\u4E00\u9875"],
28612
+ "Actual Size": ["Taille r\xE9elle", "Tats\xE4chliche Gr\xF6\xDFe", "Tama\xF1o real", "\u5B9E\u9645\u5927\u5C0F"],
28613
+ "Fit Page": ["Ajuster \xE0 la page", "Seite einpassen", "Ajustar p\xE1gina", "\u9002\u5408\u9875\u9762"],
28614
+ "Page {page} of {count}": [
28615
+ "Page {page} sur {count}",
28616
+ "Seite {page} von {count}",
28617
+ "P\xE1gina {page} de {count}",
28618
+ "\u7B2C {page} \u9875\uFF0C\u5171 {count} \u9875"
28619
+ ],
28620
+ "Repeated print titles are preserved but not rendered in preview.": [
28621
+ "Les titres d\u2019impression r\xE9p\xE9t\xE9s sont conserv\xE9s mais non rendus dans l\u2019aper\xE7u.",
28622
+ "Wiederholte Drucktitel bleiben erhalten, werden aber in der Vorschau nicht dargestellt.",
28623
+ "Se conservan los t\xEDtulos repetidos, pero no se muestran en la vista previa.",
28624
+ "\u4FDD\u7559\u91CD\u590D\u6253\u5370\u6807\u9898\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u663E\u793A\u3002"
28625
+ ],
28626
+ "Merged cells crossing pages are rendered separately on each page.": [
28627
+ "Les cellules fusionn\xE9es sur plusieurs pages sont rendues s\xE9par\xE9ment sur chaque page.",
28628
+ "Seiten\xFCbergreifende verbundene Zellen werden auf jeder Seite getrennt dargestellt.",
28629
+ "Las celdas combinadas entre p\xE1ginas se muestran por separado en cada p\xE1gina.",
28630
+ "\u8DE8\u9875\u5408\u5E76\u5355\u5143\u683C\u5C06\u5728\u6BCF\u9875\u5206\u522B\u663E\u793A\u3002"
28631
+ ],
28632
+ "Browser printing uses paper size, margins, scaling and manual page breaks. Drawings, headers, footers and repeated titles are not rendered.": [
28633
+ "L\u2019impression du navigateur utilise le format du papier, les marges, l\u2019\xE9chelle et les sauts manuels. Les dessins, en-t\xEAtes, pieds de page et titres r\xE9p\xE9t\xE9s ne sont pas rendus.",
28634
+ "Der Browserdruck verwendet Papierformat, R\xE4nder, Skalierung und manuelle Seitenumbr\xFCche. Zeichnungen, Kopf- und Fu\xDFzeilen sowie wiederholte Titel werden nicht dargestellt.",
28635
+ "La impresi\xF3n del navegador usa tama\xF1o de papel, m\xE1rgenes, escala y saltos manuales. No muestra dibujos, encabezados, pies ni t\xEDtulos repetidos.",
28636
+ "\u6D4F\u89C8\u5668\u6253\u5370\u4F7F\u7528\u7EB8\u5F20\u5C3A\u5BF8\u3001\u8FB9\u8DDD\u3001\u7F29\u653E\u548C\u624B\u52A8\u5206\u9875\u7B26\u3002\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u3001\u9875\u811A\u6216\u91CD\u590D\u6807\u9898\u3002"
28637
+ ],
28638
+ "Print Preview": [
28639
+ "Aper\xE7u avant impression",
28640
+ "Druckvorschau",
28641
+ "Vista previa de impresi\xF3n",
28642
+ "\u6253\u5370\u9884\u89C8"
28643
+ ],
28644
+ Breaks: ["Sauts", "Umbr\xFCche", "Saltos", "\u5206\u9875\u7B26"],
28645
+ "Insert Row Page Break": [
28646
+ "Ins\xE9rer un saut de page de ligne",
28647
+ "Zeilen-Seitenumbruch einf\xFCgen",
28648
+ "Insertar salto de p\xE1gina de fila",
28649
+ "\u63D2\u5165\u884C\u5206\u9875\u7B26"
28650
+ ],
28651
+ "Insert Column Page Break": [
28652
+ "Ins\xE9rer un saut de page de colonne",
28653
+ "Spalten-Seitenumbruch einf\xFCgen",
28654
+ "Insertar salto de p\xE1gina de columna",
28655
+ "\u63D2\u5165\u5217\u5206\u9875\u7B26"
28656
+ ],
28657
+ "Remove Row Page Break": [
28658
+ "Supprimer le saut de page de ligne",
28659
+ "Zeilen-Seitenumbruch entfernen",
28660
+ "Quitar salto de p\xE1gina de fila",
28661
+ "\u5220\u9664\u884C\u5206\u9875\u7B26"
28662
+ ],
28663
+ "Remove Column Page Break": [
28664
+ "Supprimer le saut de page de colonne",
28665
+ "Spalten-Seitenumbruch entfernen",
28666
+ "Quitar salto de p\xE1gina de columna",
28667
+ "\u5220\u9664\u5217\u5206\u9875\u7B26"
28668
+ ],
28669
+ "Reset All Page Breaks": [
28670
+ "R\xE9initialiser tous les sauts de page",
28671
+ "Alle Seitenumbr\xFCche zur\xFCcksetzen",
28672
+ "Restablecer todos los saltos de p\xE1gina",
28673
+ "\u91CD\u7F6E\u6240\u6709\u5206\u9875\u7B26"
28674
+ ],
28675
+ "Pages: {count} | Scale: {scale}%": [
28676
+ "Pages : {count} | \xC9chelle : {scale}%",
28677
+ "Seiten: {count} | Skalierung: {scale}%",
28678
+ "P\xE1ginas: {count} | Escala: {scale}%",
28679
+ "\u9875\u6570\uFF1A{count} | \u7F29\u653E\uFF1A{scale}%"
28680
+ ],
28681
+ "Preview uses worksheet dimensions. Fonts and printer margins may change pagination in Excel.": [
28682
+ "L\u2019aper\xE7u utilise les dimensions de la feuille. Les polices et marges de l\u2019imprimante peuvent modifier la pagination dans Excel.",
28683
+ "Die Vorschau verwendet die Arbeitsblattma\xDFe. Schriftarten und Druckerr\xE4nder k\xF6nnen die Seitenaufteilung in Excel \xE4ndern.",
28684
+ "La vista previa usa las dimensiones de la hoja. Las fuentes y los m\xE1rgenes de impresora pueden cambiar la paginaci\xF3n en Excel.",
28685
+ "\u9884\u89C8\u4F7F\u7528\u5DE5\u4F5C\u8868\u5C3A\u5BF8\u3002\u5B57\u4F53\u548C\u6253\u5370\u673A\u8FB9\u8DDD\u53EF\u80FD\u6539\u53D8 Excel \u4E2D\u7684\u5206\u9875\u3002"
28686
+ ],
28687
+ "Fit to pages ignores manual page breaks.": [
28688
+ "L\u2019ajustement aux pages ignore les sauts manuels.",
28689
+ "Beim Anpassen an Seiten werden manuelle Umbr\xFCche ignoriert.",
28690
+ "Ajustar a p\xE1ginas ignora los saltos manuales.",
28691
+ "\u8C03\u6574\u4E3A\u6307\u5B9A\u9875\u6570\u65F6\u5FFD\u7565\u624B\u52A8\u5206\u9875\u7B26\u3002"
28692
+ ],
28693
+ "Preview does not render drawings, headers or footers.": [
28694
+ "L\u2019aper\xE7u ne rend pas les dessins, en-t\xEAtes ou pieds de page.",
28695
+ "Die Vorschau stellt Zeichnungen, Kopf- und Fu\xDFzeilen nicht dar.",
28696
+ "La vista previa no muestra dibujos, encabezados ni pies de p\xE1gina.",
28697
+ "\u9884\u89C8\u4E0D\u663E\u793A\u7ED8\u56FE\u3001\u9875\u7709\u6216\u9875\u811A\u3002"
28698
+ ],
28699
+ "Partial page breaks are preserved but not used in preview.": [
28700
+ "Les sauts de page partiels sont conserv\xE9s mais non utilis\xE9s dans l\u2019aper\xE7u.",
28701
+ "Teilweise Seitenumbr\xFCche bleiben erhalten, werden aber in der Vorschau nicht verwendet.",
28702
+ "Se conservan los saltos parciales, pero no se usan en la vista previa.",
28703
+ "\u4FDD\u7559\u5C40\u90E8\u5206\u9875\u7B26\uFF0C\u4F46\u4E0D\u5728\u9884\u89C8\u4E2D\u4F7F\u7528\u3002"
28704
+ ],
28705
+ "This paper size is not supported in preview; Letter is used.": [
28706
+ "Ce format n\u2019est pas pris en charge dans l\u2019aper\xE7u ; Letter est utilis\xE9.",
28707
+ "Dieses Papierformat wird in der Vorschau nicht unterst\xFCtzt; Letter wird verwendet.",
28708
+ "Este tama\xF1o no se admite en la vista previa; se usa Carta.",
28709
+ "\u9884\u89C8\u4E0D\u652F\u6301\u6B64\u7EB8\u5F20\u5C3A\u5BF8\uFF0C\u4F7F\u7528 Letter\u3002"
28710
+ ],
28711
+ "The minimum scale prevents fitting the requested number of pages.": [
28712
+ "L\u2019\xE9chelle minimale emp\xEAche l\u2019ajustement au nombre de pages demand\xE9.",
28713
+ "Die minimale Skalierung verhindert die gew\xFCnschte Seitenanzahl.",
28714
+ "La escala m\xEDnima impide ajustar al n\xFAmero de p\xE1ginas solicitado.",
28715
+ "\u6700\u5C0F\u7F29\u653E\u6BD4\u4F8B\u65E0\u6CD5\u6EE1\u8DB3\u6307\u5B9A\u9875\u6570\u3002"
28716
+ ],
28717
+ "Rows or columns larger than a printed page are clipped.": [
28718
+ "Les lignes ou colonnes plus grandes qu\u2019une page sont rogn\xE9es.",
28719
+ "Zeilen oder Spalten, die gr\xF6\xDFer als eine Druckseite sind, werden abgeschnitten.",
28720
+ "Las filas o columnas mayores que una p\xE1gina se recortan.",
28721
+ "\u8D85\u8FC7\u6253\u5370\u9875\u9762\u5927\u5C0F\u7684\u884C\u6216\u5217\u5C06\u88AB\u88C1\u526A\u3002"
28722
+ ],
28723
+ "Margins do not fit the paper size.": [
28724
+ "Les marges ne correspondent pas au format du papier.",
28725
+ "Die R\xE4nder passen nicht zum Papierformat.",
28726
+ "Los m\xE1rgenes no caben en el tama\xF1o de papel.",
28727
+ "\u8FB9\u8DDD\u8D85\u51FA\u7EB8\u5F20\u5C3A\u5BF8\u3002"
28728
+ ],
28729
+ "Print preview supports at most one million cells.": [
28730
+ "L\u2019aper\xE7u prend en charge au maximum un million de cellules.",
28731
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens eine Million Zellen.",
28732
+ "La vista previa admite como m\xE1ximo un mill\xF3n de celdas.",
28733
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301\u4E00\u767E\u4E07\u4E2A\u5355\u5143\u683C\u3002"
28734
+ ],
28735
+ "Print preview supports at most 1000 pages.": [
28736
+ "L\u2019aper\xE7u prend en charge au maximum 1000 pages.",
28737
+ "Die Druckvorschau unterst\xFCtzt h\xF6chstens 1000 Seiten.",
28738
+ "La vista previa admite como m\xE1ximo 1000 p\xE1ginas.",
28739
+ "\u6253\u5370\u9884\u89C8\u6700\u591A\u652F\u6301 1000 \u9875\u3002"
28740
+ ],
28741
+ "Choose a row or column after the first to set a page break.": [
28742
+ "Choisissez une ligne ou colonne apr\xE8s la premi\xE8re pour d\xE9finir un saut de page.",
28743
+ "W\xE4hlen Sie eine Zeile oder Spalte nach der ersten f\xFCr einen Seitenumbruch.",
28744
+ "Elija una fila o columna despu\xE9s de la primera para establecer un salto.",
28745
+ "\u8BF7\u9009\u62E9\u7B2C\u4E00\u884C\u6216\u7B2C\u4E00\u5217\u4E4B\u540E\u7684\u4F4D\u7F6E\u8BBE\u7F6E\u5206\u9875\u7B26\u3002"
28746
+ ],
28747
+ "A worksheet can have at most 1026 manual breaks on each axis.": [
28748
+ "Une feuille peut contenir au maximum 1026 sauts manuels par axe.",
28749
+ "Ein Arbeitsblatt kann h\xF6chstens 1026 manuelle Umbr\xFCche pro Achse enthalten.",
28750
+ "Una hoja admite como m\xE1ximo 1026 saltos manuales por eje.",
28751
+ "\u5DE5\u4F5C\u8868\u6BCF\u4E2A\u65B9\u5411\u6700\u591A\u652F\u6301 1026 \u4E2A\u624B\u52A8\u5206\u9875\u7B26\u3002"
28752
+ ]
28753
+ };
28754
+
27082
28755
  // xlsx/ui/commands/i18n/types.ts
27083
28756
  var COLUMN = {
27084
28757
  fr: 0,
@@ -27104,7 +28777,10 @@ var COMMAND_TABLES = [
27104
28777
  FORMAT_CELLS_STRINGS,
27105
28778
  RULES_STRINGS,
27106
28779
  CORE_FEATURE_STRINGS,
27107
- CHART_SERIES_STRINGS
28780
+ CHART_SERIES_STRINGS,
28781
+ SPARKLINE_STRINGS,
28782
+ PIVOT_STRINGS,
28783
+ PRINT_LAYOUT_STRINGS
27108
28784
  ];
27109
28785
  var commandStrings = (locale) => flatten2(COMMAND_TABLES, locale);
27110
28786
 
@@ -29281,9 +30957,9 @@ function cellCommands() {
29281
30957
  ["format.hide-columns", "Hide Columns", "col", true],
29282
30958
  ["format.unhide-columns", "Unhide Columns", "col", false]
29283
30959
  ].map(
29284
- ([id, label2, axis, hidden]) => editing({
30960
+ ([id, label3, axis, hidden]) => editing({
29285
30961
  id,
29286
- label: label2,
30962
+ label: label3,
29287
30963
  icon: icon("hide"),
29288
30964
  lock: axis === "row" ? "formatRows" : "formatColumns",
29289
30965
  run: (ctx) => {
@@ -29322,47 +30998,47 @@ function cellCommands() {
29322
30998
  }
29323
30999
 
29324
31000
  // xlsx/ui/commands/cf-presets.ts
29325
- var argb = (hex2) => ({ rgb: `FF${hex2}` });
31001
+ var argb2 = (hex2) => ({ rgb: `FF${hex2}` });
29326
31002
  var HIGHLIGHT_STYLES = [
29327
31003
  [
29328
31004
  "lightRed",
29329
31005
  "Light Red Fill with Dark Red Text",
29330
31006
  {
29331
- font: { color: argb("9C0006") },
29332
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") }
31007
+ font: { color: argb2("9C0006") },
31008
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") }
29333
31009
  }
29334
31010
  ],
29335
31011
  [
29336
31012
  "yellow",
29337
31013
  "Yellow Fill with Dark Yellow Text",
29338
31014
  {
29339
- font: { color: argb("9C5700") },
29340
- fill: { type: "pattern", pattern: "solid", bgColor: argb("FFEB9C") }
31015
+ font: { color: argb2("9C5700") },
31016
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFEB9C") }
29341
31017
  }
29342
31018
  ],
29343
31019
  [
29344
31020
  "green",
29345
31021
  "Green Fill with Dark Green Text",
29346
31022
  {
29347
- font: { color: argb("006100") },
29348
- fill: { type: "pattern", pattern: "solid", bgColor: argb("C6EFCE") }
31023
+ font: { color: argb2("006100") },
31024
+ fill: { type: "pattern", pattern: "solid", bgColor: argb2("C6EFCE") }
29349
31025
  }
29350
31026
  ],
29351
31027
  [
29352
31028
  "lightRedFill",
29353
31029
  "Light Red Fill",
29354
- { fill: { type: "pattern", pattern: "solid", bgColor: argb("FFC7CE") } }
31030
+ { fill: { type: "pattern", pattern: "solid", bgColor: argb2("FFC7CE") } }
29355
31031
  ],
29356
- ["redText", "Red Text", { font: { color: argb("9C0006") } }],
31032
+ ["redText", "Red Text", { font: { color: argb2("9C0006") } }],
29357
31033
  [
29358
31034
  "redBorder",
29359
31035
  "Red Border",
29360
31036
  {
29361
31037
  border: {
29362
- left: { style: "thin", color: argb("9C0006") },
29363
- right: { style: "thin", color: argb("9C0006") },
29364
- top: { style: "thin", color: argb("9C0006") },
29365
- bottom: { style: "thin", color: argb("9C0006") }
31038
+ left: { style: "thin", color: argb2("9C0006") },
31039
+ right: { style: "thin", color: argb2("9C0006") },
31040
+ top: { style: "thin", color: argb2("9C0006") },
31041
+ bottom: { style: "thin", color: argb2("9C0006") }
29366
31042
  }
29367
31043
  }
29368
31044
  ]
@@ -29419,13 +31095,13 @@ function dataBarRule(hex2) {
29419
31095
  type: "dataBar",
29420
31096
  min: { type: "min" },
29421
31097
  max: { type: "max" },
29422
- color: argb(hex2),
31098
+ color: argb2(hex2),
29423
31099
  priority: 1
29424
31100
  };
29425
31101
  }
29426
31102
  function colorScaleRule(colors) {
29427
31103
  const thresholds = colors.length === 3 ? [{ type: "min" }, { type: "percentile", value: "50" }, { type: "max" }] : [{ type: "min" }, { type: "max" }];
29428
- return { type: "colorScale", thresholds, colors: colors.map(argb), priority: 1 };
31104
+ return { type: "colorScale", thresholds, colors: colors.map(argb2), priority: 1 };
29429
31105
  }
29430
31106
  function iconSetRule(set) {
29431
31107
  return { type: "iconSet", iconSet: set, thresholds: iconThresholds(iconCount(set)), priority: 1 };
@@ -29595,10 +31271,10 @@ function activeChart(ctx) {
29595
31271
  const picked = t.ws.drawings[index2];
29596
31272
  return picked?.kind === "chart" ? { chart: picked, index: index2 } : void 0;
29597
31273
  }
29598
- function editChart(ctx, patch) {
31274
+ function editChart(ctx, patch2) {
29599
31275
  const t = target(ctx);
29600
31276
  const found = activeChart(ctx);
29601
- if (t && found) t.session.updateChart(t.sheet, found.index, patch(found.chart));
31277
+ if (t && found) t.session.updateChart(t.sheet, found.index, patch2(found.chart));
29602
31278
  }
29603
31279
  var TABLE_FLAGS = [
29604
31280
  ["showRowStripes", "table.banded-rows", "Banded Rows"],
@@ -29637,8 +31313,8 @@ function contextualCommands() {
29637
31313
  const t = target(ctx);
29638
31314
  const found = activeChart(ctx);
29639
31315
  if (!t || !found) return;
29640
- const patch = chartColorPalettePatch(found.chart, id);
29641
- if (patch) t.session.updateChart(t.sheet, found.index, patch);
31316
+ const patch2 = chartColorPalettePatch(found.chart, id);
31317
+ if (patch2) t.session.updateChart(t.sheet, found.index, patch2);
29642
31318
  }
29643
31319
  }),
29644
31320
  tableCmd({
@@ -29684,9 +31360,9 @@ function contextualCommands() {
29684
31360
  run: (ctx) => setTableBand(ctx, "totalsRow", !activeTable(ctx)?.totalsRow)
29685
31361
  }),
29686
31362
  ...TABLE_FLAGS.map(
29687
- ([flag2, id, label2]) => tableCmd({
31363
+ ([flag2, id, label3]) => tableCmd({
29688
31364
  id,
29689
- label: label2,
31365
+ label: label3,
29690
31366
  checked: (ctx) => !!activeTable(ctx)?.[flag2],
29691
31367
  run: (ctx) => {
29692
31368
  const t = target(ctx);
@@ -30069,9 +31745,9 @@ function fillDirection(ctx, dir) {
30069
31745
  function editingCommands() {
30070
31746
  return [
30071
31747
  ...AUTOSUM_FUNCTIONS.map(
30072
- ([fn, label2]) => editing({
31748
+ ([fn, label3]) => editing({
30073
31749
  id: fn === "SUM" ? "home.autosum" : `home.autosum-${fn.toLowerCase()}`,
30074
- label: fn === "SUM" ? "AutoSum" : label2,
31750
+ label: fn === "SUM" ? "AutoSum" : label3,
30075
31751
  icon: icon("autoSum"),
30076
31752
  ...fn === "SUM" ? { shortcut: "Alt+=" } : {},
30077
31753
  run: (ctx) => autoSum(ctx, fn)
@@ -30122,16 +31798,16 @@ function editingCommands() {
30122
31798
  ["comments", "Clear Comments and Notes"],
30123
31799
  ["hyperlinks", "Clear Hyperlinks"]
30124
31800
  ].map(
30125
- ([what, label2]) => editing({
31801
+ ([what, label3]) => editing({
30126
31802
  id: `home.clear-${what}`,
30127
- label: label2,
31803
+ label: label3,
30128
31804
  icon: icon("clear"),
30129
31805
  ...what === "formats" ? { lock: "formatCells" } : {},
30130
31806
  ...what === "contents" ? { shortcut: "Delete" } : {},
30131
31807
  run: (ctx) => {
30132
31808
  const t = target(ctx);
30133
31809
  if (!t) return;
30134
- t.session.batch(label2, () => {
31810
+ t.session.batch(label3, () => {
30135
31811
  for (const range2 of t.ranges) t.session.clearRange(t.sheet, range2, what);
30136
31812
  });
30137
31813
  }
@@ -30172,9 +31848,9 @@ function editingCommands() {
30172
31848
  ["constants", "Constants"],
30173
31849
  ["validation", "Data Validation"]
30174
31850
  ].map(
30175
- ([kind, label2]) => viewing({
31851
+ ([kind, label3]) => viewing({
30176
31852
  id: `home.select-${kind}`,
30177
- label: label2,
31853
+ label: label3,
30178
31854
  icon: icon("findSelect"),
30179
31855
  run: (ctx) => {
30180
31856
  if (!selectSpecial(ctx, { kind })) ctx.toast(ctx.t("No cells were found."), "info");
@@ -30445,7 +32121,7 @@ function numberCommands() {
30445
32121
  ["home.format-date", "Date format", "d-mmm-yy", "Ctrl+Shift+#"],
30446
32122
  ["home.format-scientific", "Scientific format", "0.00E+00", "Ctrl+Shift+^"]
30447
32123
  ].map(
30448
- ([id, label2, format, shortcut]) => editing({ id, label: label2, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
32124
+ ([id, label3, format, shortcut]) => editing({ id, label: label3, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
30449
32125
  )
30450
32126
  ];
30451
32127
  }
@@ -30476,9 +32152,9 @@ var PAPER_SIZES = [
30476
32152
  [27, "Envelope DL"]
30477
32153
  ];
30478
32154
  var page = (ctx) => target(ctx)?.ws.pageSetup ?? {};
30479
- var setPage = (ctx, patch) => {
32155
+ var setPage = (ctx, patch2) => {
30480
32156
  const t = target(ctx);
30481
- if (t) t.session.setPageSetup(t.sheet, patch);
32157
+ if (t) t.session.setPageSetup(t.sheet, patch2);
30482
32158
  };
30483
32159
  function pageLayoutCommands() {
30484
32160
  return [
@@ -30611,6 +32287,43 @@ function pageLayoutCommands() {
30611
32287
  ];
30612
32288
  }
30613
32289
 
32290
+ // xlsx/ui/commands/page-breaks.ts
32291
+ function pageBreakCommands() {
32292
+ return [
32293
+ viewing({
32294
+ id: "page.preview",
32295
+ label: "Print Preview",
32296
+ icon: icon("pageSetup"),
32297
+ run: (ctx) => void ctx.dialogs.open("print-preview")
32298
+ }),
32299
+ ...["row", "col"].flatMap(
32300
+ (axis) => [true, false].map(
32301
+ (present) => editing({
32302
+ id: `page.break-${axis}-${present ? "insert" : "remove"}`,
32303
+ label: present ? axis === "row" ? "Insert Row Page Break" : "Insert Column Page Break" : axis === "row" ? "Remove Row Page Break" : "Remove Column Page Break",
32304
+ icon: icon("printArea"),
32305
+ lock: false,
32306
+ enabled: (ctx) => (target(ctx)?.active[axis] ?? 0) > 0,
32307
+ run: (ctx) => {
32308
+ const t = target(ctx);
32309
+ if (t) t.session.setPageBreak(t.sheet, axis, t.active[axis], present);
32310
+ }
32311
+ })
32312
+ )
32313
+ ),
32314
+ editing({
32315
+ id: "page.breaks-reset",
32316
+ label: "Reset All Page Breaks",
32317
+ icon: icon("printArea"),
32318
+ lock: false,
32319
+ run: (ctx) => {
32320
+ const t = target(ctx);
32321
+ if (t) t.session.resetPageBreaks(t.sheet);
32322
+ }
32323
+ })
32324
+ ];
32325
+ }
32326
+
30614
32327
  // xlsx/ui/commands/style-presets.ts
30615
32328
  var TABLE_STYLES = [
30616
32329
  ...Array.from({ length: 21 }, (_v, i2) => ({
@@ -30634,9 +32347,9 @@ function tableStyleColor(info, theme2) {
30634
32347
  if (slot === 0) return info.family === "Dark" ? "404040" : "808080";
30635
32348
  return theme2.colors[3 + slot] ?? "4472C4";
30636
32349
  }
30637
- var escapeAttr = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
32350
+ var escapeAttr2 = (s) => s.replace(/[^0-9A-Fa-f]/g, "");
30638
32351
  function tableStylePreview(info, theme2) {
30639
- const c = `#${escapeAttr(tableStyleColor(info, theme2))}`;
32352
+ const c = `#${escapeAttr2(tableStyleColor(info, theme2))}`;
30640
32353
  const dark = info.family === "Dark";
30641
32354
  const header = info.family === "Light" ? "#ffffff" : c;
30642
32355
  const band = dark ? c : info.family === "Medium" ? `${c}55` : `${c}33`;
@@ -32309,13 +34022,13 @@ function searchCommands(ctx, query, isHidden) {
32309
34022
  const seen = /* @__PURE__ */ new Set();
32310
34023
  for (const command of ctx.commands.list()) {
32311
34024
  if (isHidden(command.id) || !ctx.commands.isEnabled(command.id)) continue;
32312
- const label2 = ctx.t(command.label).toLocaleLowerCase();
34025
+ const label3 = ctx.t(command.label).toLocaleLowerCase();
32313
34026
  const english = command.label.toLocaleLowerCase();
32314
- const haystack = `${label2} ${english} ${command.id.replace(/[.-]/g, " ")}`;
34027
+ const haystack = `${label3} ${english} ${command.id.replace(/[.-]/g, " ")}`;
32315
34028
  if (!words2.every((word) => haystack.includes(word))) continue;
32316
- if (seen.has(label2)) continue;
32317
- seen.add(label2);
32318
- const score = label2.startsWith(words2[0]) ? 0 : label2.includes(words2[0]) ? 1 : 2;
34029
+ if (seen.has(label3)) continue;
34030
+ seen.add(label3);
34031
+ const score = label3.startsWith(words2[0]) ? 0 : label3.includes(words2[0]) ? 1 : 2;
32319
34032
  scored.push({ command, score });
32320
34033
  }
32321
34034
  return scored.sort(
@@ -32439,4 +34152,4 @@ function applyThemeColors(host, previous, colors) {
32439
34152
  return Object.keys(vars);
32440
34153
  }
32441
34154
 
32442
- export { ACCOUNTING_FORMATS, ALL_RANGE, AUTOSUM_FUNCTIONS, BORDER_PRESETS, CATEGORIES, COLOR_SCALES, COMMAND_TABLES, CORE_FEATURE_STRINGS, CellViewCache, DATA_BAR_COLORS, DATE_CODES, DEFAULT_OPTIONS, DirtyState, EDITOR_LOCALES, EDITOR_THEME_MODES, FONT_NAMES, FONT_SIZES, FORMAT_CELLS_STRINGS, FRACTION_CODES, FUNCTION_MENUS, GridGeometry, HIGHLIGHT_STYLES, ICON_ACCENTS, ICON_PATHS, ICON_SETS, MARGIN_PRESETS, MESSAGE_STRINGS, MORE_FUNCTION_CATEGORIES, NAVIGATION_STRINGS, ORIENTATIONS, PAPER_SIZES, QUADRANTS, RIBBON_HOME_STRINGS, RIBBON_TAB_STRINGS, RULES_STRINGS, SHEET_ICONS, SPECIAL_CODES, STRINGS, SYMBOLS, SheetSelections, TABLE_STYLES, TEMPLATES, THEME_KEYS, TIME_CODES, TOOLS_STRINGS, UNSET, absoluteReference, activeChart, activeRef, activeStyle, activeTable, addRange, alignItems, alignmentCommands, applyThemeColors, autoSumRange, buildChart, buildCode, buildItems, cellCommands, cellMenu, cellRange3 as cellRange, cellStyleItems, clampAddress, clipState, clipboardCommands, colSelected, colorScaleRule, colsOf, colsRange, columnHeaderHeight, columnHeaderMenu, commandStrings, contextualCommands, createCommandRegistry, createDialogRegistry, createEditBridge, createSelectionModel, createTemplateWorkbook, cssFont, cssFontFamily, darkTheme, dataBarRule, dataCommands, detectCategory, diagonalSvg, dxfCss, edgeCss, editBridge, editChart, editing, editingCommands, evaluateRef, expandForMerges, extendSelection, fillPaint, fillSource, fillTemplate, findDefinedName2 as findDefinedName, findSpecial, fitNumber2 as fitNumber, fontCommands, formatNumber2 as formatNumber, formulaCommands, functionsIn, guessHeader, hasBorders, hasWorkbook, hashes, helpTab, historyOf, icon, iconCount, iconSetRule, iconSvg, iconThresholds, initialSelection, insertFunctionCall, installFormatPainter, isBlankView, isMenuSeparator, isSingleCell, isTabHidden, isWholeCols, isWholeRows2 as isWholeRows, justify, lightTheme, measure, moveWithinSelection, movingEnd, nameForRange, negativeCodes, normalizeEditorLocale, normalizeThemeMode, noteFunctionUse, numberCommands, numberFormatOptions, onRibbonTabsChange, pageLayoutCommands, parseBorderArg, parseSelectionRef, parseSheetReference, pasteWith, patternImage, pickColor, rangeRef, recentFunctions, refresh, regionOf, registerRibbonTabs, repeatToFill, resetRibbonTabs, resolveNameBox, reviewTab, ribbonTabs, rowHeaderMenu, rowHeaderWidth, rowSelected, rowsOf, rowsRange, scrollToReveal, searchCommands, selectCell, selectSpecial, selectTab, selectionCellCount, selectionRef, setTabHidden, sheetBaseName, sheetLocked, sortCommands, span3 as span, spanRange, stepFontSize, structureLocked, style, styleCssFont, tabButton, tabMenu, tableAt, tableStyleColor, tableStylePreview, target, textAlign, textDecoration, themePaletteItems, themeToCssVars, translate, translator, viewTab, viewing, wholeColumns, wholeRows, withTarget };
34155
+ export { ACCOUNTING_FORMATS, ALL_RANGE, AUTOSUM_FUNCTIONS, BORDER_PRESETS, CATEGORIES, COLOR_SCALES, COMMAND_TABLES, CORE_FEATURE_STRINGS, CellViewCache, DATA_BAR_COLORS, DATE_CODES, DEFAULT_OPTIONS, DirtyState, EDITOR_LOCALES, EDITOR_THEME_MODES, FONT_NAMES, FONT_SIZES, FORMAT_CELLS_STRINGS, FRACTION_CODES, FUNCTION_MENUS, GridGeometry, HIGHLIGHT_STYLES, ICON_ACCENTS, ICON_PATHS, ICON_SETS, MARGIN_PRESETS, MESSAGE_STRINGS, MORE_FUNCTION_CATEGORIES, NAVIGATION_STRINGS, ORIENTATIONS, PAPER_SIZES, QUADRANTS, RIBBON_HOME_STRINGS, RIBBON_TAB_STRINGS, RULES_STRINGS, SHEET_ICONS, SPECIAL_CODES, STRINGS, SYMBOLS, SheetSelections, TABLE_STYLES, TEMPLATES, THEME_KEYS, TIME_CODES, TOOLS_STRINGS, UNSET, absoluteReference, activeChart, activeRef, activeStyle, activeTable, addRange, alignItems, alignmentCommands, applyThemeColors, autoSumRange, buildChart, buildCode, buildItems, cellCommands, cellMenu, cellRange3 as cellRange, cellStyleItems, clampAddress, clipState, clipboardCommands, colSelected, colorScaleRule, colsOf, colsRange, columnHeaderHeight, columnHeaderMenu, commandStrings, contextualCommands, createCommandRegistry, createDialogRegistry, createEditBridge, createSelectionModel, createTemplateWorkbook, cssFont, cssFontFamily, darkTheme, dataBarRule, dataCommands, detectCategory, diagonalSvg, dxfCss, edgeCss, editBridge, editChart, editing, editingCommands, evaluateRef, expandForMerges, extendSelection, fillPaint, fillSource, fillTemplate, findDefinedName2 as findDefinedName, findSpecial, fitNumber2 as fitNumber, fontCommands, formatNumber2 as formatNumber, formulaCommands, functionsIn, guessHeader, hasBorders, hasWorkbook, hashes, helpTab, historyOf, icon, iconCount, iconSetRule, iconSvg, iconThresholds, initialSelection, insertFunctionCall, installFormatPainter, isBlankView, isMenuSeparator, isSingleCell, isTabHidden, isWholeCols, isWholeRows2 as isWholeRows, justify, lightTheme, measure, moveWithinSelection, movingEnd, nameForRange, negativeCodes, normalizeEditorLocale, normalizeThemeMode, noteFunctionUse, numberCommands, numberFormatOptions, onRibbonTabsChange, pageBreakCommands, pageLayoutCommands, parseBorderArg, parseSelectionRef, parseSheetReference, pasteWith, patternImage, pickColor, rangeRef, recentFunctions, refresh, regionOf, registerRibbonTabs, repeatToFill, resetRibbonTabs, resolveNameBox, reviewTab, ribbonTabs, rowHeaderMenu, rowHeaderWidth, rowSelected, rowsOf, rowsRange, scrollToReveal, searchCommands, selectCell, selectSpecial, selectTab, selectionCellCount, selectionRef, setTabHidden, sheetBaseName, sheetLocked, sortCommands, span3 as span, spanRange, stepFontSize, structureLocked, style, styleCssFont, tabButton, tabMenu, tableAt, tableStyleColor, tableStylePreview, target, textAlign, textDecoration, themePaletteItems, themeToCssVars, translate, translator, viewTab, viewing, wholeColumns, wholeRows, withTarget };