@sheetxl/studio-vanilla 0.4.11 → 0.4.13

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 (205) hide show
  1. package/browser/cjs/{DFspSkki779xN-Ey.cjs → -DkdmW3XP1ICRY25.cjs} +2 -2
  2. package/browser/cjs/B-KQs1Bf48nEucW7.cjs +7 -0
  3. package/browser/cjs/B1xnY7pDnbnNzknG.cjs +7 -0
  4. package/browser/cjs/B6A5w_aWHkigBc6j.cjs +7 -0
  5. package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +110 -0
  6. package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +7 -0
  7. package/browser/cjs/{DFtyXc7YFh9dIp74.cjs → BG2uV2RpxrfZyCuV.cjs} +1 -1
  8. package/browser/cjs/{DiBy6-IxLscyMW2y.cjs → BGCPG4Ip5ZijUQwi.cjs} +2 -2
  9. package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +7 -0
  10. package/browser/cjs/BLBNzBvRVl9VLynf.cjs +7 -0
  11. package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +7 -0
  12. package/browser/cjs/{CuTW2Pt-L5n-hNxV.cjs → BMaq_2S3IFrE5XeJ.cjs} +1 -1
  13. package/browser/cjs/BO7Pbclmywy-QCSV.cjs +13 -0
  14. package/browser/cjs/BPlthbyKkqCDjgxO.cjs +7 -0
  15. package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +7 -0
  16. package/browser/cjs/BdHdXCz_K1djQgI4.cjs +7 -0
  17. package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +7 -0
  18. package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +7 -0
  19. package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +7 -0
  20. package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +7 -0
  21. package/browser/cjs/BsSNzyN8kOGCKzso.cjs +7 -0
  22. package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +7 -0
  23. package/browser/cjs/{DrlS1oz9Nea8Pm3j.cjs → BwHquG4sSd7OJjxz.cjs} +2 -2
  24. package/browser/cjs/{CjZbhk41S1qO_74G.cjs → BywNBbTVRYbgRbNI.cjs} +1 -1
  25. package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +7 -0
  26. package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +7 -0
  27. package/browser/cjs/{T4SHYo66xDT3l9JN.cjs → CBpt1PBR1VfBegko.cjs} +2 -2
  28. package/browser/cjs/CED8Az5C8GWF7pUT.cjs +7 -0
  29. package/browser/cjs/{BPTHTRDvNOVkUJGa.cjs → CbD4Wa5QLTdRCYcz.cjs} +2 -2
  30. package/browser/cjs/{C5FXOMLhAu_KTjVe.cjs → CbILz9Skl6lWf6yR.cjs} +1 -1
  31. package/browser/cjs/CoFQQqIzuvS9PM77.cjs +7 -0
  32. package/browser/cjs/{BlSFY6zLlebuejdV.cjs → CpDNo2Lhwr5ZHECs.cjs} +2 -2
  33. package/browser/cjs/{D3iOk-Q2tRdUeTcn.cjs → CsamfGfFsItvSgo_.cjs} +1 -1
  34. package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +7 -0
  35. package/browser/cjs/CxLvGnG44-qNI36G.cjs +7 -0
  36. package/browser/cjs/D-xyWit7jxctQCpR.cjs +7 -0
  37. package/browser/cjs/D4XQsK7d7DRctaOO.cjs +7 -0
  38. package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +7 -0
  39. package/browser/cjs/DES2NmIRVZg-HXgs.cjs +7 -0
  40. package/browser/cjs/{BshvMtUxTJHj3JQN.cjs → DFxeLNhACFIHb0nv.cjs} +2 -2
  41. package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +7 -0
  42. package/browser/cjs/DJ6L43osbaMzEV5K.cjs +7 -0
  43. package/browser/cjs/DMjLN_HDktNzzUB8.cjs +7 -0
  44. package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +7 -0
  45. package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +7 -0
  46. package/browser/cjs/{Dx-jp_LJxWbAScyA.cjs → Dh_dFnagz7dMZlGh.cjs} +1 -1
  47. package/browser/cjs/DpF6vgGka2d-RKkb.cjs +10 -0
  48. package/browser/cjs/{C7EZCTczsC-gkRcq.cjs → DtY0Jzlwnr_YKnV4.cjs} +2 -2
  49. package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +7 -0
  50. package/browser/cjs/Dy5_viRzFls9rOzN.cjs +7 -0
  51. package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +7 -0
  52. package/browser/cjs/aN3KCqswA1SdJIMq.cjs +7 -0
  53. package/browser/cjs/{BuWtGFX0HiBezGjw.cjs → hLJbgylpETByV4wc.cjs} +2 -2
  54. package/browser/cjs/index.cjs +2 -2
  55. package/browser/cjs/qumqKlVHFx89iLeu.cjs +7 -0
  56. package/browser/cjs/{BAyEOOtO-9sHQQRW.cjs → rKZjTYQ0WpTriIv6.cjs} +2 -2
  57. package/browser/cjs/xjKotAOVt3JH36U7.cjs +7 -0
  58. package/browser/cjs/ymbPxio09Fw7I2BW.cjs +7 -0
  59. package/browser/esm/2P5dQT7wZToOh-n9.mjs +7 -0
  60. package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +110 -0
  61. package/browser/esm/7_x68v6PpvRDox_Z.mjs +7 -0
  62. package/browser/esm/9icgSuuzXq6mlgM8.mjs +7 -0
  63. package/browser/esm/B354iAatN9y9AIIP.mjs +7 -0
  64. package/browser/esm/B5EVyoxm3aSlAnxN.mjs +7 -0
  65. package/browser/esm/BD8rE7MUxuHXsdcf.mjs +7 -0
  66. package/browser/esm/BGFWI1a1PmU8_hCE.mjs +7 -0
  67. package/browser/esm/BI6JAQCQx1V0F2aC.mjs +7 -0
  68. package/browser/esm/BIYg30d_9HaluFFz.mjs +7 -0
  69. package/browser/esm/BKL-uyBp_OE47lXd.mjs +7 -0
  70. package/browser/esm/BMwJCtLAYUW8wExX.mjs +13 -0
  71. package/browser/esm/BNOfK-lGWF2S8vQE.mjs +7 -0
  72. package/browser/esm/Ba433v6lQUMtECiY.mjs +7 -0
  73. package/browser/esm/BbZWfDW2LUyjqUDy.mjs +7 -0
  74. package/browser/esm/C238uBmZN1XXqMUb.mjs +7 -0
  75. package/browser/esm/C34whwRkHO0lhq4-.mjs +7 -0
  76. package/browser/esm/C6FEpAqSZoW5Hgte.mjs +7 -0
  77. package/browser/esm/COlW5ULL29SUKN1Z.mjs +7 -0
  78. package/browser/esm/CRyxOj2xPj9qe9LK.mjs +7 -0
  79. package/browser/esm/CVeyOpbAhaBhDRye.mjs +7 -0
  80. package/browser/esm/CVyVvtlJuCTn4MDh.mjs +7 -0
  81. package/browser/esm/CapeIfjWq-_BHMlE.mjs +7 -0
  82. package/browser/esm/CcQqGNgK2CsgNtuD.mjs +7 -0
  83. package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +7 -0
  84. package/browser/esm/CdchvB_wAbv_6Whw.mjs +7 -0
  85. package/browser/esm/{Cc_VWd0wF5-39LsI.mjs → Cf8eDl3Tu5NAWWwG.mjs} +1 -1
  86. package/browser/esm/{BXUGsC1Mo3FP8vnW.mjs → Cfq9tttQlsKvfaCr.mjs} +2 -2
  87. package/browser/esm/{BDVJ7eOPpW5FnEAP.mjs → ClR6uLJoM-xKVYEc.mjs} +1 -1
  88. package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +7 -0
  89. package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +7 -0
  90. package/browser/esm/{BUSR_OK5Qi6hRPfw.mjs → CuV-bwi1vcXAqFUY.mjs} +1 -1
  91. package/browser/esm/CwVE0qelO_xgf-l1.mjs +7 -0
  92. package/browser/esm/{CFFC0SNc24a0Dxnh.mjs → D1Dzlta8ZVy08ng6.mjs} +2 -2
  93. package/browser/esm/D1TjRQiHLWhpl-dl.mjs +7 -0
  94. package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +10 -0
  95. package/browser/esm/{BlGoi1_x9rUMpWMd.mjs → DTDXNEbHVnnZONNL.mjs} +1 -1
  96. package/browser/esm/DTWfi8Dl-c2s5moT.mjs +7 -0
  97. package/browser/esm/DYVBXcu1r5KRLB-1.mjs +7 -0
  98. package/browser/esm/{BGpv6Kq7eBlJy43T.mjs → DZjWyWMvr2XHQrBg.mjs} +1 -1
  99. package/browser/esm/DhHK4QmASvgAq9Xy.mjs +7 -0
  100. package/browser/esm/{PS0cqYnlMVEGOQpI.mjs → DoFV2S6Su86IN5Ul.mjs} +2 -2
  101. package/browser/esm/Dq3ybkgattcCsF_4.mjs +7 -0
  102. package/browser/esm/DqWoZ4TjweoJWX3o.mjs +7 -0
  103. package/browser/esm/DtXxHirBm16ldE1l.mjs +7 -0
  104. package/browser/esm/DtuWZG6c_8vKRSdr.mjs +7 -0
  105. package/browser/esm/FBG8XXdIMd9PfUIo.mjs +7 -0
  106. package/browser/esm/Nh7JiwvF01PblHQ0.mjs +7 -0
  107. package/browser/esm/PVYiH9vBQM6rqXI4.mjs +7 -0
  108. package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +7 -0
  109. package/browser/esm/XhQDWZu47oe6bwHh.mjs +7 -0
  110. package/browser/esm/_BjU6TtI-mQfFpfy.mjs +7 -0
  111. package/browser/esm/{Cq8D_M0jeHLcnRjg.mjs → gOUfyCw957TzcbNB.mjs} +1 -1
  112. package/browser/esm/index.mjs +2 -2
  113. package/browser/esm/lmkbfs9sNc7f0oe5.mjs +7 -0
  114. package/browser/esm/{tFhROdVSw9KLQfUN.mjs → naa0kcRwxHEYGaQB.mjs} +2 -2
  115. package/browser/esm/qxOkQutRxmAi1vRh.mjs +7 -0
  116. package/browser/esm/tMSro0g2GM5BBTIH.mjs +7 -0
  117. package/cdn/assets/0e9wDKSn4SFxSmP5.js +27 -0
  118. package/cdn/assets/0j_nQmV1Bb0lJ6sB.js +472 -0
  119. package/cdn/assets/2mxiQm6dELsqQoX7.js +5624 -0
  120. package/cdn/assets/5XdpCWQ6AcxZ6oY1.js +10 -0
  121. package/cdn/assets/6JtXguBKwGj6dqfy.js +1577 -0
  122. package/cdn/assets/8U2WVdbZHYCBnd9L.js +23 -0
  123. package/cdn/assets/9-cIcj6CRJx5HTn9.js +10 -0
  124. package/cdn/assets/B-kFRtzNNkf4_SiP.js +1701 -0
  125. package/cdn/assets/B1Iys8a964LGNZKf.js +10 -0
  126. package/cdn/assets/B2RAJJJFkcaWUfUW.js +21 -0
  127. package/cdn/assets/BAzGoI9gE2G3F3on.js +637 -0
  128. package/cdn/assets/BBJxLS-wB_nXRnI2.js +10 -0
  129. package/cdn/assets/BDE7FUo2oiivrvBL.js +43 -0
  130. package/cdn/assets/BL6TUDSeou6wPejW.js +10 -0
  131. package/cdn/assets/BLqaorJ5Wl-1YOoy.js +3875 -0
  132. package/cdn/assets/BMiA9p1uOrwnooVT.js +10 -0
  133. package/cdn/assets/BNh9nSR83reiVMKt.js +90 -0
  134. package/cdn/assets/BQON-ToGsIBPrPkM.js +1371 -0
  135. package/cdn/assets/BUwNyHytF9St68tJ.js +10 -0
  136. package/cdn/assets/BVYDmdUGWvMG5gNK.js +241 -0
  137. package/cdn/assets/B_2bXmyji3Dr7LRM.js +50224 -0
  138. package/cdn/assets/BciokME96sykArSM.js +10 -0
  139. package/cdn/assets/BgnlshX157Ob6RLs.js +21 -0
  140. package/cdn/assets/BlYoycYtR-sUp0iC.js +27 -0
  141. package/cdn/assets/Bsa9-Itkf_SdDBM9.js +6481 -0
  142. package/cdn/assets/BwpBFv8Ks2ka07ch.js +10 -0
  143. package/cdn/assets/BxblmHGC7YxZcuak.js +10 -0
  144. package/cdn/assets/C-Z8wvIy20kJ7R-k.js +10 -0
  145. package/cdn/assets/C3EFzvmp0DcC_HAx.js +10 -0
  146. package/cdn/assets/C4vStn7wNlvrxdsp.js +10 -0
  147. package/cdn/assets/C5q0qaKi2eeDgoO8.js +10 -0
  148. package/cdn/assets/C9eQW5GKgPRmKKgJ.js +29 -0
  149. package/cdn/assets/CHTspRZD2v_dU_eV.js +22 -0
  150. package/cdn/assets/CKA4s2hlzSnrdWSD.js +10 -0
  151. package/cdn/assets/CMBDD1Mjde6UL5ep.js +84 -0
  152. package/cdn/assets/CR01MBraUPYPpwy4.js +36 -0
  153. package/cdn/assets/CT0d1P-Aav62lUvV.js +10 -0
  154. package/cdn/assets/CV8UjJPDVplXjK1E.js +49 -0
  155. package/cdn/assets/CrLrvmlJhYpNpXqR.js +10 -0
  156. package/cdn/assets/CsorxCiOoe7qX9j1.js +10 -0
  157. package/cdn/assets/CuNqTH3P8mCglRiz.js +10 -0
  158. package/cdn/assets/CwdMjMPFdIs8SAV0.js +1358 -0
  159. package/cdn/assets/D-5VYBO5_VEh6fEW.js +24 -0
  160. package/cdn/assets/DD3csu4pddGtMp3n.js +1468 -0
  161. package/cdn/assets/DFHruAftzuzBZ71r.js +393 -0
  162. package/cdn/assets/DHydjLSnijEgtpyU.js +10 -0
  163. package/cdn/assets/DPQqTIMsRLhMxPIy.js +820 -0
  164. package/cdn/assets/DUtu7r6CzW4dtW3E.js +50 -0
  165. package/cdn/assets/DXHirQMr483hJBil.js +58 -0
  166. package/cdn/assets/DXtbonLk2ESfF4Dh.js +10 -0
  167. package/cdn/assets/Dr5X-ng9wbwUWVr4.js +41 -0
  168. package/cdn/assets/DvFNLgeMJ9LdQROu.js +149 -0
  169. package/cdn/assets/Dvj7UEckqOBrgs9i.js +3947 -0
  170. package/cdn/assets/F6zW9Vj410C4yRVG.js +424 -0
  171. package/cdn/assets/Gz4u4ewyWfB-Pf-a.js +1703 -0
  172. package/cdn/assets/KDGtuIzSpkf1vsmH.js +10 -0
  173. package/cdn/assets/KtKlo5mM4kTTfFgi.js +46 -0
  174. package/cdn/assets/N3pWBoccPrTedAw-.js +12 -0
  175. package/cdn/assets/NTINjW8JjyZudT8s.js +13449 -0
  176. package/cdn/assets/R9RwlorPWfftoboH.js +2373 -0
  177. package/cdn/assets/Xwyp21e7L5fTeb_y.js +423 -0
  178. package/cdn/assets/XysyS9rk9tFdbzZh.js +2183 -0
  179. package/cdn/assets/f3_QXO8z0p-q4nJo.js +46 -0
  180. package/cdn/assets/quOP5QFyTT9soNIl.js +12 -0
  181. package/cdn/index.js +41 -37
  182. package/cdn/loader.js +1 -1
  183. package/package.json +3 -5
  184. package/browser/cjs/B0rdyyttE2Aibsag.cjs +0 -7
  185. package/browser/cjs/B2e7dDI-zKoqXpIW.cjs +0 -107
  186. package/browser/cjs/BplA5pDzOJpfTZuA.cjs +0 -7
  187. package/browser/cjs/CFcjX5-nVsgzdZ4F.cjs +0 -7
  188. package/browser/cjs/Db_Ew1r6yOMYylvA.cjs +0 -7
  189. package/browser/cjs/DgBn3aW39yjgm0X_.cjs +0 -7
  190. package/browser/cjs/SzxJv7OUs5ojl8gx.cjs +0 -7
  191. package/browser/cjs/vfUix5Di0Ro8tEID.cjs +0 -7
  192. package/browser/esm/B5kkStdEkTczERyM.mjs +0 -7
  193. package/browser/esm/B905wKzTtod-jbsD.mjs +0 -7
  194. package/browser/esm/BALnKy2Fp7fyk-lc.mjs +0 -7
  195. package/browser/esm/Bo_ZPRrOQrqOVHAF.mjs +0 -7
  196. package/browser/esm/BuURCm92KsyGHG9e.mjs +0 -7
  197. package/browser/esm/CGZ5MX7afzMxDkCe.mjs +0 -7
  198. package/browser/esm/CzmNwV9tfFYUp_gS.mjs +0 -7
  199. package/browser/esm/De6RPxc4p_jXLlT5.mjs +0 -7
  200. package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +0 -7
  201. package/browser/esm/DqXxZP6yKF4U1YfY.mjs +0 -7
  202. package/browser/esm/DtmE60AvstK9u0Ta.mjs +0 -107
  203. package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +0 -7
  204. package/browser/esm/QBGUD1XS5_pysBLL.mjs +0 -7
  205. package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +0 -7
@@ -0,0 +1,1468 @@
1
+ import { g as Ht, h as Ft, i as Ss, j as Cs, k as Gt, l as at, W as Pe, r as ks, f as As, _ as ss, R as Ds, A as Es, I as Ps, m as Os, n as hs, o as Is } from "./B_2bXmyji3Dr7LRM.js";
2
+ /**
3
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
4
+ *
5
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
+ * License: The license can be found at https://www.sheetxl.com/license.
7
+ */
8
+ const is = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Vs = new RegExp(`^[${is}][-${is}.0-9·̀-ͯ‿-⁀]*$`, "u");
9
+ function us(i) {
10
+ return i >= 65 && i <= 90 || i >= 97 && i <= 122 || i === 58 || i === 95 || i === 8204 || i === 8205 || i >= 192 && i <= 214 || i >= 216 && i <= 246 || i >= 248 && i <= 767 || i >= 880 && i <= 893 || i >= 895 && i <= 8191 || i >= 8304 && i <= 8591 || i >= 11264 && i <= 12271 || i >= 12289 && i <= 55295 || i >= 63744 && i <= 64975 || i >= 65008 && i <= 65533 || i >= 65536 && i <= 983039;
11
+ }
12
+ const os = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ls = new RegExp(`^[${os}][-${os}.0-9·̀-ͯ‿-⁀]*$`, "u");
13
+ function ds(i) {
14
+ return i >= 65 && i <= 90 || i === 95 || i >= 97 && i <= 122 || i >= 192 && i <= 214 || i >= 216 && i <= 246 || i >= 248 && i <= 767 || i >= 880 && i <= 893 || i >= 895 && i <= 8191 || i >= 8204 && i <= 8205 || i >= 8304 && i <= 8591 || i >= 11264 && i <= 12271 || i >= 12289 && i <= 55295 || i >= 63744 && i <= 64975 || i >= 65008 && i <= 65533 || i >= 65536 && i <= 983039;
15
+ }
16
+ const q = function(i) {
17
+ return i === 32 || i === 10 || i === 13 || i === 9;
18
+ }, Ns = function(i) {
19
+ return i >= 32 && i <= 55295 || i === 10 || i === 13 || i === 9 || i >= 57344 && i <= 65533 || i >= 65536 && i <= 1114111;
20
+ }, ce = us, rs = function(i) {
21
+ return us(i) || i >= 48 && i <= 57 || i === 45 || i === 46 || i === 183 || i >= 768 && i <= 879 || i >= 8255 && i <= 8256;
22
+ }, ps = [32, 10, 13, 9], Rs = Vs, $s = function(i) {
23
+ return i >= 1 && i <= 55295 || i >= 57344 && i <= 65533 || i >= 65536 && i <= 1114111;
24
+ }, Ms = ds, js = function(i) {
25
+ return ds(i) || i === 45 || i === 46 || i >= 48 && i <= 57 || i === 183 || i >= 768 && i <= 879 || i >= 8255 && i <= 8256;
26
+ }, Hs = Ls, ye = "http://www.w3.org/XML/1998/namespace", Kt = "http://www.w3.org/2000/xmlns/", Fs = { __proto__: null, xml: ye, xmlns: Kt }, Xs = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, O = -1, lt = -2, B = 13, Xt = 33, it = 10, vt = 60, Qt = 61, M = 62, F = 63, Jt = 93, Te = (i) => i === 34 || i === 39, gs = [34, 39], Bs = [...gs, 91, M], Ws = [...gs, vt, Jt], _s = [Qt, F, ...ps], qs = [...ps, M, 38, vt];
27
+ function Oe(i, t, s) {
28
+ switch (t) {
29
+ case "xml":
30
+ s !== ye && i.fail(`xml prefix must be bound to ${ye}.`);
31
+ break;
32
+ case "xmlns":
33
+ s !== Kt && i.fail(`xmlns prefix must be bound to ${Kt}.`);
34
+ }
35
+ switch (s) {
36
+ case Kt:
37
+ i.fail(t === "" ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Kt}.`);
38
+ break;
39
+ case ye:
40
+ switch (t) {
41
+ case "xml":
42
+ break;
43
+ case "":
44
+ i.fail(`the default namespace may not be set to ${s}.`);
45
+ break;
46
+ default:
47
+ i.fail("may not assign the xml namespace to another prefix.");
48
+ }
49
+ }
50
+ }
51
+ const zs = (i) => Hs.test(i), Us = (i) => Rs.test(i), ns = { xmldecl: "xmldeclHandler", text: "textHandler", processinginstruction: "piHandler", doctype: "doctypeHandler", comment: "commentHandler", opentagstart: "openTagStartHandler", attribute: "attributeHandler", opentag: "openTagHandler", closetag: "closeTagHandler", cdata: "cdataHandler", error: "errorHandler", end: "endHandler", ready: "readyHandler" };
52
+ class Gs {
53
+ constructor(t) {
54
+ this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
55
+ const s = this.xmlnsOpt = !!this.opt.xmlns;
56
+ if (this.trackPosition = this.opt.position !== !1, this.fileName = this.opt.fileName, s) {
57
+ this.nameStartCheck = Ms, this.nameCheck = js, this.isName = zs, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = { __proto__: null, ...Fs };
58
+ const o = this.opt.additionalNamespaces;
59
+ o != null && (function(n, a) {
60
+ for (const c of Object.keys(a)) Oe(n, c, a[c]);
61
+ }(this, o), Object.assign(this.ns, o));
62
+ } else this.nameStartCheck = ce, this.nameCheck = rs, this.isName = Us, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
63
+ this.stateTable = [this.sBegin, this.sBeginWhitespace, this.sDoctype, this.sDoctypeQuote, this.sDTD, this.sDTDQuoted, this.sDTDOpenWaka, this.sDTDOpenWakaBang, this.sDTDComment, this.sDTDCommentEnding, this.sDTDCommentEnded, this.sDTDPI, this.sDTDPIEnding, this.sText, this.sEntity, this.sOpenWaka, this.sOpenWakaBang, this.sComment, this.sCommentEnding, this.sCommentEnded, this.sCData, this.sCDataEnding, this.sCDataEnding2, this.sPIFirstChar, this.sPIRest, this.sPIBody, this.sPIEnding, this.sXMLDeclNameStart, this.sXMLDeclName, this.sXMLDeclEq, this.sXMLDeclValueStart, this.sXMLDeclValue, this.sXMLDeclSeparator, this.sXMLDeclEnding, this.sOpenTag, this.sOpenTagSlash, this.sAttrib, this.sAttribName, this.sAttribNameSawWhite, this.sAttribValue, this.sAttribValueQuoted, this.sAttribValueClosed, this.sAttribValueUnquoted, this.sCloseTag, this.sCloseTagSawWhite], this._init();
64
+ }
65
+ get closed() {
66
+ return this._closed;
67
+ }
68
+ _init() {
69
+ this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
70
+ const { fragmentOpt: t } = this;
71
+ this.state = t ? B : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
72
+ let { defaultXMLVersion: s } = this.opt;
73
+ if (s === void 0) {
74
+ if (this.opt.forceXMLVersion === !0) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
75
+ s = "1.0";
76
+ }
77
+ this.setXMLVersion(s), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = { version: void 0, encoding: void 0, standalone: void 0 }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Xs), this.readyHandler?.();
78
+ }
79
+ get position() {
80
+ return this.chunkPosition + this.i;
81
+ }
82
+ get columnIndex() {
83
+ return this.position - this.positionAtNewLine;
84
+ }
85
+ on(t, s) {
86
+ this[ns[t]] = s;
87
+ }
88
+ off(t) {
89
+ this[ns[t]] = void 0;
90
+ }
91
+ makeError(t) {
92
+ let s = this.fileName ?? "";
93
+ return this.trackPosition && (s.length > 0 && (s += ":"), s += `${this.line}:${this.column}`), s.length > 0 && (s += ": "), new Error(s + t);
94
+ }
95
+ fail(t) {
96
+ const s = this.makeError(t), o = this.errorHandler;
97
+ if (o === void 0) throw s;
98
+ return o(s), this;
99
+ }
100
+ write(t) {
101
+ if (this.closed) return this.fail("cannot write after close; assign an onready handler.");
102
+ let s = !1;
103
+ t === null ? (s = !0, t = "") : typeof t == "object" && (t = t.toString()), this.carriedFromPrevious !== void 0 && (t = `${this.carriedFromPrevious}${t}`, this.carriedFromPrevious = void 0);
104
+ let o = t.length;
105
+ const n = t.charCodeAt(o - 1);
106
+ !s && (n === 13 || n >= 55296 && n <= 56319) && (this.carriedFromPrevious = t[o - 1], o--, t = t.slice(0, o));
107
+ const { stateTable: a } = this;
108
+ for (this.chunk = t, this.i = 0; this.i < o; ) a[this.state].call(this);
109
+ return this.chunkPosition += o, s ? this.end() : this;
110
+ }
111
+ close() {
112
+ return this.write(null);
113
+ }
114
+ getCode10() {
115
+ const t = this.chunk, s = this.i;
116
+ if (this.prevI = s, this.i++, s >= t.length) return O;
117
+ const o = t.charCodeAt(s);
118
+ if (this.column++, o < 55296) {
119
+ if (o >= 32 || o === 9) return o;
120
+ switch (o) {
121
+ case it:
122
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, it;
123
+ case 13:
124
+ return t.charCodeAt(s + 1) === it && (this.i = s + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, lt;
125
+ default:
126
+ return this.fail("disallowed character."), o;
127
+ }
128
+ }
129
+ if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
130
+ const n = 65536 + 1024 * (o - 55296) + (t.charCodeAt(s + 1) - 56320);
131
+ return this.i = s + 2, n > 1114111 && this.fail("disallowed character."), n;
132
+ }
133
+ getCode11() {
134
+ const { chunk: t, i: s } = this;
135
+ if (this.prevI = s, this.i = s + 1, s >= t.length) return O;
136
+ const o = t.charCodeAt(s);
137
+ if (this.column++, o < 55296) {
138
+ if (o > 31 && o < 127 || o > 159 && o !== 8232 || o === 9) return o;
139
+ switch (o) {
140
+ case it:
141
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, it;
142
+ case 13: {
143
+ const a = t.charCodeAt(s + 1);
144
+ a !== it && a !== 133 || (this.i = s + 2);
145
+ }
146
+ case 133:
147
+ case 8232:
148
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, lt;
149
+ default:
150
+ return this.fail("disallowed character."), o;
151
+ }
152
+ }
153
+ if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
154
+ const n = 65536 + 1024 * (o - 55296) + (t.charCodeAt(s + 1) - 56320);
155
+ return this.i = s + 2, n > 1114111 && this.fail("disallowed character."), n;
156
+ }
157
+ getCodeNorm() {
158
+ const t = this.getCode();
159
+ return t === lt ? it : t;
160
+ }
161
+ unget() {
162
+ this.i = this.prevI, this.column--;
163
+ }
164
+ captureTo(t) {
165
+ let { i: s } = this;
166
+ const { chunk: o } = this;
167
+ for (; ; ) {
168
+ const n = this.getCode(), a = n === lt, c = a ? it : n;
169
+ if (c === O || t.includes(c)) return this.text += o.slice(s, this.prevI), c;
170
+ a && (this.text += `${o.slice(s, this.prevI)}
171
+ `, s = this.i);
172
+ }
173
+ }
174
+ captureToChar(t) {
175
+ let { i: s } = this;
176
+ const { chunk: o } = this;
177
+ for (; ; ) {
178
+ let n = this.getCode();
179
+ switch (n) {
180
+ case lt:
181
+ this.text += `${o.slice(s, this.prevI)}
182
+ `, s = this.i, n = it;
183
+ break;
184
+ case O:
185
+ return this.text += o.slice(s), !1;
186
+ }
187
+ if (n === t) return this.text += o.slice(s, this.prevI), !0;
188
+ }
189
+ }
190
+ captureNameChars() {
191
+ const { chunk: t, i: s } = this;
192
+ for (; ; ) {
193
+ const o = this.getCode();
194
+ if (o === O) return this.name += t.slice(s), O;
195
+ if (!rs(o)) return this.name += t.slice(s, this.prevI), o === lt ? it : o;
196
+ }
197
+ }
198
+ skipSpaces() {
199
+ for (; ; ) {
200
+ const t = this.getCodeNorm();
201
+ if (t === O || !q(t)) return t;
202
+ }
203
+ }
204
+ setXMLVersion(t) {
205
+ this.currentXMLVersion = t, t === "1.0" ? (this.isChar = Ns, this.getCode = this.getCode10) : (this.isChar = $s, this.getCode = this.getCode11);
206
+ }
207
+ sBegin() {
208
+ this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
209
+ }
210
+ sBeginWhitespace() {
211
+ const t = this.i, s = this.skipSpaces();
212
+ switch (this.prevI !== t && (this.xmlDeclPossible = !1), s) {
213
+ case vt:
214
+ if (this.state = 15, this.text.length !== 0) throw new Error("no-empty text at start");
215
+ break;
216
+ case O:
217
+ break;
218
+ default:
219
+ this.unget(), this.state = B, this.xmlDeclPossible = !1;
220
+ }
221
+ }
222
+ sDoctype() {
223
+ const t = this.captureTo(Bs);
224
+ switch (t) {
225
+ case M:
226
+ this.doctypeHandler?.(this.text), this.text = "", this.state = B, this.doctype = !0;
227
+ break;
228
+ case O:
229
+ break;
230
+ default:
231
+ this.text += String.fromCodePoint(t), t === 91 ? this.state = 4 : Te(t) && (this.state = 3, this.q = t);
232
+ }
233
+ }
234
+ sDoctypeQuote() {
235
+ const t = this.q;
236
+ this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
237
+ }
238
+ sDTD() {
239
+ const t = this.captureTo(Ws);
240
+ t !== O && (this.text += String.fromCodePoint(t), t === Jt ? this.state = 2 : t === vt ? this.state = 6 : Te(t) && (this.state = 5, this.q = t));
241
+ }
242
+ sDTDQuoted() {
243
+ const t = this.q;
244
+ this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.state = 4, this.q = null);
245
+ }
246
+ sDTDOpenWaka() {
247
+ const t = this.getCodeNorm();
248
+ switch (this.text += String.fromCodePoint(t), t) {
249
+ case 33:
250
+ this.state = 7, this.openWakaBang = "";
251
+ break;
252
+ case F:
253
+ this.state = 11;
254
+ break;
255
+ default:
256
+ this.state = 4;
257
+ }
258
+ }
259
+ sDTDOpenWakaBang() {
260
+ const t = String.fromCodePoint(this.getCodeNorm()), s = this.openWakaBang += t;
261
+ this.text += t, s !== "-" && (this.state = s === "--" ? 8 : 4, this.openWakaBang = "");
262
+ }
263
+ sDTDComment() {
264
+ this.captureToChar(45) && (this.text += "-", this.state = 9);
265
+ }
266
+ sDTDCommentEnding() {
267
+ const t = this.getCodeNorm();
268
+ this.text += String.fromCodePoint(t), this.state = t === 45 ? 10 : 8;
269
+ }
270
+ sDTDCommentEnded() {
271
+ const t = this.getCodeNorm();
272
+ this.text += String.fromCodePoint(t), t === M ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
273
+ }
274
+ sDTDPI() {
275
+ this.captureToChar(F) && (this.text += "?", this.state = 12);
276
+ }
277
+ sDTDPIEnding() {
278
+ const t = this.getCodeNorm();
279
+ this.text += String.fromCodePoint(t), t === M && (this.state = 4);
280
+ }
281
+ sText() {
282
+ this.tags.length !== 0 ? this.handleTextInRoot() : this.handleTextOutsideRoot();
283
+ }
284
+ sEntity() {
285
+ let { i: t } = this;
286
+ const { chunk: s } = this;
287
+ t: for (; ; ) switch (this.getCode()) {
288
+ case lt:
289
+ this.entity += `${s.slice(t, this.prevI)}
290
+ `, t = this.i;
291
+ break;
292
+ case 59: {
293
+ const { entityReturnState: o } = this, n = this.entity + s.slice(t, this.prevI);
294
+ let a;
295
+ this.state = o, n === "" ? (this.fail("empty entity name."), a = "&;") : (a = this.parseEntity(n), this.entity = ""), o === B && this.textHandler === void 0 || (this.text += a);
296
+ break t;
297
+ }
298
+ case O:
299
+ this.entity += s.slice(t);
300
+ break t;
301
+ }
302
+ }
303
+ sOpenWaka() {
304
+ const t = this.getCode();
305
+ if (ce(t)) this.state = 34, this.unget(), this.xmlDeclPossible = !1;
306
+ else switch (t) {
307
+ case 47:
308
+ this.state = 43, this.xmlDeclPossible = !1;
309
+ break;
310
+ case 33:
311
+ this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
312
+ break;
313
+ case F:
314
+ this.state = 23;
315
+ break;
316
+ default:
317
+ this.fail("disallowed character in tag name"), this.state = B, this.xmlDeclPossible = !1;
318
+ }
319
+ }
320
+ sOpenWakaBang() {
321
+ switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
322
+ case "[CDATA[":
323
+ this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0), this.state = 20, this.openWakaBang = "";
324
+ break;
325
+ case "--":
326
+ this.state = 17, this.openWakaBang = "";
327
+ break;
328
+ case "DOCTYPE":
329
+ this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
330
+ break;
331
+ default:
332
+ this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
333
+ }
334
+ }
335
+ sComment() {
336
+ this.captureToChar(45) && (this.state = 18);
337
+ }
338
+ sCommentEnding() {
339
+ const t = this.getCodeNorm();
340
+ t === 45 ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t)}`, this.state = 17);
341
+ }
342
+ sCommentEnded() {
343
+ const t = this.getCodeNorm();
344
+ t !== M ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = B;
345
+ }
346
+ sCData() {
347
+ this.captureToChar(Jt) && (this.state = 21);
348
+ }
349
+ sCDataEnding() {
350
+ const t = this.getCodeNorm();
351
+ t === Jt ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
352
+ }
353
+ sCDataEnding2() {
354
+ const t = this.getCodeNorm();
355
+ switch (t) {
356
+ case M:
357
+ this.cdataHandler?.(this.text), this.text = "", this.state = B;
358
+ break;
359
+ case Jt:
360
+ this.text += "]";
361
+ break;
362
+ default:
363
+ this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
364
+ }
365
+ }
366
+ sPIFirstChar() {
367
+ const t = this.getCodeNorm();
368
+ this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === F || q(t) ? (this.fail("processing instruction without a target."), this.state = t === F ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
369
+ }
370
+ sPIRest() {
371
+ const { chunk: t, i: s } = this;
372
+ for (; ; ) {
373
+ const o = this.getCodeNorm();
374
+ if (o === O) return void (this.piTarget += t.slice(s));
375
+ if (!this.nameCheck(o)) {
376
+ this.piTarget += t.slice(s, this.prevI);
377
+ const n = o === F;
378
+ n || q(o) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = n ? Xt : 27) : this.state = n ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(o));
379
+ break;
380
+ }
381
+ }
382
+ }
383
+ sPIBody() {
384
+ if (this.text.length === 0) {
385
+ const t = this.getCodeNorm();
386
+ t === F ? this.state = 26 : q(t) || (this.text = String.fromCodePoint(t));
387
+ } else this.captureToChar(F) && (this.state = 26);
388
+ }
389
+ sPIEnding() {
390
+ const t = this.getCodeNorm();
391
+ if (t === M) {
392
+ const { piTarget: s } = this;
393
+ s.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({ target: s, body: this.text }), this.piTarget = this.text = "", this.state = B;
394
+ } else t === F ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
395
+ this.xmlDeclPossible = !1;
396
+ }
397
+ sXMLDeclNameStart() {
398
+ const t = this.skipSpaces();
399
+ t !== F ? t !== O && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Xt;
400
+ }
401
+ sXMLDeclName() {
402
+ const t = this.captureTo(_s);
403
+ if (t === F) return this.state = Xt, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
404
+ if (q(t) || t === Qt) {
405
+ if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
406
+ case 0:
407
+ this.fail("did not expect any more name/value pairs.");
408
+ break;
409
+ case 1:
410
+ this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
411
+ break;
412
+ default:
413
+ this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
414
+ }
415
+ this.state = t === Qt ? 30 : 29;
416
+ }
417
+ }
418
+ sXMLDeclEq() {
419
+ const t = this.getCodeNorm();
420
+ if (t === F) return this.state = Xt, void this.fail("XML declaration is incomplete.");
421
+ q(t) || (t !== Qt && this.fail("value required."), this.state = 30);
422
+ }
423
+ sXMLDeclValueStart() {
424
+ const t = this.getCodeNorm();
425
+ if (t === F) return this.state = Xt, void this.fail("XML declaration is incomplete.");
426
+ q(t) || (Te(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
427
+ }
428
+ sXMLDeclValue() {
429
+ const t = this.captureTo([this.q, F]);
430
+ if (t === F) return this.state = Xt, this.text = "", void this.fail("XML declaration is incomplete.");
431
+ if (t === O) return;
432
+ const s = this.text;
433
+ switch (this.text = "", this.name) {
434
+ case "version": {
435
+ this.xmlDeclExpects = ["encoding", "standalone"];
436
+ const o = s;
437
+ this.xmlDecl.version = o, /^1\.[0-9]+$/.test(o) ? this.opt.forceXMLVersion || this.setXMLVersion(o) : this.fail("version number must match /^1\\.[0-9]+$/.");
438
+ break;
439
+ }
440
+ case "encoding":
441
+ /^[A-Za-z][A-Za-z0-9._-]*$/.test(s) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = s;
442
+ break;
443
+ case "standalone":
444
+ s !== "yes" && s !== "no" && this.fail('standalone value must match "yes" or "no".'), this.xmlDeclExpects = [], this.xmlDecl.standalone = s;
445
+ }
446
+ this.name = "", this.state = 32;
447
+ }
448
+ sXMLDeclSeparator() {
449
+ const t = this.getCodeNorm();
450
+ t !== F ? (q(t) || (this.fail("whitespace required."), this.unget()), this.state = 27) : this.state = Xt;
451
+ }
452
+ sXMLDeclEnding() {
453
+ this.getCodeNorm() === M ? (this.piTarget !== "xml" ? this.fail("processing instructions are not allowed before root.") : this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmldeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = B) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
454
+ }
455
+ sOpenTag() {
456
+ const t = this.captureNameChars();
457
+ if (t === O) return;
458
+ const s = this.tag = { name: this.name, attributes: /* @__PURE__ */ Object.create(null) };
459
+ switch (this.name = "", this.xmlnsOpt && (this.topNS = s.ns = /* @__PURE__ */ Object.create(null)), this.openTagStartHandler?.(s), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
460
+ case M:
461
+ this.openTag();
462
+ break;
463
+ case 47:
464
+ this.state = 35;
465
+ break;
466
+ default:
467
+ q(t) || this.fail("disallowed character in tag name."), this.state = 36;
468
+ }
469
+ }
470
+ sOpenTagSlash() {
471
+ this.getCode() === M ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
472
+ }
473
+ sAttrib() {
474
+ const t = this.skipSpaces();
475
+ t !== O && (ce(t) ? (this.unget(), this.state = 37) : t === M ? this.openTag() : t === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
476
+ }
477
+ sAttribName() {
478
+ const t = this.captureNameChars();
479
+ t === Qt ? this.state = 39 : q(t) ? this.state = 38 : t === M ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== O && this.fail("disallowed character in attribute name.");
480
+ }
481
+ sAttribNameSawWhite() {
482
+ const t = this.skipSpaces();
483
+ switch (t) {
484
+ case O:
485
+ return;
486
+ case Qt:
487
+ this.state = 39;
488
+ break;
489
+ default:
490
+ this.fail("attribute without value."), this.text = "", this.name = "", t === M ? this.openTag() : ce(t) ? (this.unget(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
491
+ }
492
+ }
493
+ sAttribValue() {
494
+ const t = this.getCodeNorm();
495
+ Te(t) ? (this.q = t, this.state = 40) : q(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unget());
496
+ }
497
+ sAttribValueQuoted() {
498
+ const { q: t, chunk: s } = this;
499
+ let { i: o } = this;
500
+ for (; ; ) switch (this.getCode()) {
501
+ case t:
502
+ return this.pushAttrib(this.name, this.text + s.slice(o, this.prevI)), this.name = this.text = "", this.q = null, void (this.state = 41);
503
+ case 38:
504
+ return this.text += s.slice(o, this.prevI), this.state = 14, void (this.entityReturnState = 40);
505
+ case it:
506
+ case lt:
507
+ case 9:
508
+ this.text += `${s.slice(o, this.prevI)} `, o = this.i;
509
+ break;
510
+ case vt:
511
+ return this.text += s.slice(o, this.prevI), void this.fail("disallowed character.");
512
+ case O:
513
+ return void (this.text += s.slice(o));
514
+ }
515
+ }
516
+ sAttribValueClosed() {
517
+ const t = this.getCodeNorm();
518
+ q(t) ? this.state = 36 : t === M ? this.openTag() : t === 47 ? this.state = 35 : ce(t) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = 37) : this.fail("disallowed character in attribute name.");
519
+ }
520
+ sAttribValueUnquoted() {
521
+ const t = this.captureTo(qs);
522
+ switch (t) {
523
+ case 38:
524
+ this.state = 14, this.entityReturnState = 42;
525
+ break;
526
+ case vt:
527
+ this.fail("disallowed character.");
528
+ break;
529
+ case O:
530
+ break;
531
+ default:
532
+ this.text.includes("]]>") && this.fail('the string "]]>" is disallowed in char data.'), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === M ? this.openTag() : this.state = 36;
533
+ }
534
+ }
535
+ sCloseTag() {
536
+ const t = this.captureNameChars();
537
+ t === M ? this.closeTag() : q(t) ? this.state = 44 : t !== O && this.fail("disallowed character in closing tag.");
538
+ }
539
+ sCloseTagSawWhite() {
540
+ switch (this.skipSpaces()) {
541
+ case M:
542
+ this.closeTag();
543
+ break;
544
+ case O:
545
+ break;
546
+ default:
547
+ this.fail("disallowed character in closing tag.");
548
+ }
549
+ }
550
+ handleTextInRoot() {
551
+ let { i: t, forbiddenState: s } = this;
552
+ const { chunk: o, textHandler: n } = this;
553
+ t: for (; ; ) switch (this.getCode()) {
554
+ case vt:
555
+ if (this.state = 15, n !== void 0) {
556
+ const { text: a } = this, c = o.slice(t, this.prevI);
557
+ a.length !== 0 ? (n(a + c), this.text = "") : c.length !== 0 && n(c);
558
+ }
559
+ s = 0;
560
+ break t;
561
+ case 38:
562
+ this.state = 14, this.entityReturnState = B, n !== void 0 && (this.text += o.slice(t, this.prevI)), s = 0;
563
+ break t;
564
+ case Jt:
565
+ switch (s) {
566
+ case 0:
567
+ s = 1;
568
+ break;
569
+ case 1:
570
+ s = 2;
571
+ break;
572
+ case 2:
573
+ break;
574
+ default:
575
+ throw new Error("impossible state");
576
+ }
577
+ break;
578
+ case M:
579
+ s === 2 && this.fail('the string "]]>" is disallowed in char data.'), s = 0;
580
+ break;
581
+ case lt:
582
+ n !== void 0 && (this.text += `${o.slice(t, this.prevI)}
583
+ `), t = this.i, s = 0;
584
+ break;
585
+ case O:
586
+ n !== void 0 && (this.text += o.slice(t));
587
+ break t;
588
+ default:
589
+ s = 0;
590
+ }
591
+ this.forbiddenState = s;
592
+ }
593
+ handleTextOutsideRoot() {
594
+ let { i: t } = this;
595
+ const { chunk: s, textHandler: o } = this;
596
+ let n = !1;
597
+ t: for (; ; ) {
598
+ const a = this.getCode();
599
+ switch (a) {
600
+ case vt:
601
+ if (this.state = 15, o !== void 0) {
602
+ const { text: c } = this, m = s.slice(t, this.prevI);
603
+ c.length !== 0 ? (o(c + m), this.text = "") : m.length !== 0 && o(m);
604
+ }
605
+ break t;
606
+ case 38:
607
+ this.state = 14, this.entityReturnState = B, o !== void 0 && (this.text += s.slice(t, this.prevI)), n = !0;
608
+ break t;
609
+ case lt:
610
+ o !== void 0 && (this.text += `${s.slice(t, this.prevI)}
611
+ `), t = this.i;
612
+ break;
613
+ case O:
614
+ o !== void 0 && (this.text += s.slice(t));
615
+ break t;
616
+ default:
617
+ q(a) || (n = !0);
618
+ }
619
+ }
620
+ n && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
621
+ }
622
+ pushAttribNS(t, s) {
623
+ const { prefix: o, local: n } = this.qname(t), a = { name: t, prefix: o, local: n, value: s };
624
+ if (this.attribList.push(a), this.attributeHandler?.(a), o === "xmlns") {
625
+ const c = s.trim();
626
+ this.currentXMLVersion === "1.0" && c === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[n] = c, Oe(this, n, c);
627
+ } else if (t === "xmlns") {
628
+ const c = s.trim();
629
+ this.topNS[""] = c, Oe(this, "", c);
630
+ }
631
+ }
632
+ pushAttribPlain(t, s) {
633
+ const o = { name: t, value: s };
634
+ this.attribList.push(o), this.attributeHandler?.(o);
635
+ }
636
+ end() {
637
+ this.sawRoot || this.fail("document must contain a root element.");
638
+ const { tags: t } = this;
639
+ for (; t.length > 0; ) {
640
+ const o = t.pop();
641
+ this.fail(`unclosed tag: ${o.name}`);
642
+ }
643
+ this.state !== 0 && this.state !== B && this.fail("unexpected end.");
644
+ const { text: s } = this;
645
+ return s.length !== 0 && (this.textHandler?.(s), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
646
+ }
647
+ resolve(t) {
648
+ let s = this.topNS[t];
649
+ if (s !== void 0) return s;
650
+ const { tags: o } = this;
651
+ for (let n = o.length - 1; n >= 0; n--) if (s = o[n].ns[t], s !== void 0) return s;
652
+ return s = this.ns[t], s !== void 0 ? s : this.opt.resolvePrefix?.(t);
653
+ }
654
+ qname(t) {
655
+ const s = t.indexOf(":");
656
+ if (s === -1) return { prefix: "", local: t };
657
+ const o = t.slice(s + 1), n = t.slice(0, s);
658
+ return (n === "" || o === "" || o.includes(":")) && this.fail(`malformed name: ${t}.`), { prefix: n, local: o };
659
+ }
660
+ processAttribsNS() {
661
+ const { attribList: t } = this, s = this.tag;
662
+ {
663
+ const { prefix: a, local: c } = this.qname(s.name);
664
+ s.prefix = a, s.local = c;
665
+ const m = s.uri = this.resolve(a) ?? "";
666
+ a !== "" && (a === "xmlns" && this.fail('tags may not have "xmlns" as prefix.'), m === "" && (this.fail(`unbound namespace prefix: ${JSON.stringify(a)}.`), s.uri = a));
667
+ }
668
+ if (t.length === 0) return;
669
+ const { attributes: o } = s, n = /* @__PURE__ */ new Set();
670
+ for (const a of t) {
671
+ const { name: c, prefix: m, local: v } = a;
672
+ let b, x;
673
+ m === "" ? (b = c === "xmlns" ? Kt : "", x = c) : (b = this.resolve(m), b === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(m)}.`), b = m), x = `{${b}}${v}`), n.has(x) && this.fail(`duplicate attribute: ${x}.`), n.add(x), a.uri = b, o[c] = a;
674
+ }
675
+ this.attribList = [];
676
+ }
677
+ processAttribsPlain() {
678
+ const { attribList: t } = this, s = this.tag.attributes;
679
+ for (const { name: o, value: n } of t) s[o] !== void 0 && this.fail(`duplicate attribute: ${o}.`), s[o] = n;
680
+ this.attribList = [];
681
+ }
682
+ openTag() {
683
+ this.processAttribs();
684
+ const { tags: t } = this, s = this.tag;
685
+ s.isSelfClosing = !1, this.openTagHandler?.(s), t.push(s), this.state = B, this.name = "";
686
+ }
687
+ openSelfClosingTag() {
688
+ this.processAttribs();
689
+ const { tags: t } = this, s = this.tag;
690
+ s.isSelfClosing = !0, this.openTagHandler?.(s), this.closeTagHandler?.(s), (this.tag = t[t.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = B, this.name = "";
691
+ }
692
+ closeTag() {
693
+ const { tags: t, name: s } = this;
694
+ if (this.state = B, this.name = "", s === "") return this.fail("weird empty close tag."), void (this.text += "</>");
695
+ const o = this.closeTagHandler;
696
+ let n = t.length;
697
+ for (; n-- > 0; ) {
698
+ const a = this.tag = t.pop();
699
+ if (this.topNS = a.ns, o?.(a), a.name === s) break;
700
+ this.fail("unexpected close tag.");
701
+ }
702
+ n === 0 ? this.closedRoot = !0 : n < 0 && (this.fail(`unmatched closing tag: ${s}.`), this.text += `</${s}>`);
703
+ }
704
+ parseEntity(t) {
705
+ if (t[0] !== "#") {
706
+ const o = this.ENTITIES[t];
707
+ return o !== void 0 ? o : (this.fail(this.isName(t) ? "undefined entity." : "disallowed character in entity name."), `&${t};`);
708
+ }
709
+ let s = NaN;
710
+ return t[1] === "x" && /^#x[0-9a-f]+$/i.test(t) ? s = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (s = parseInt(t.slice(1), 10)), this.isChar(s) ? String.fromCodePoint(s) : (this.fail("malformed character entity."), `&${t};`);
711
+ }
712
+ }
713
+ var Ie, yt;
714
+ (yt = Ie || (Ie = {})).Events = { XmlDecl: "xmldecl", Text: "text", ProcessingInstruction: "processinginstruction", Doctype: "doctype", Comment: "comment", OpenTagStart: "opentagstart", Attribute: "attribute", OpenTag: "opentag", CloseTag: "closetag", CDdata: "cdata", Error: "error", End: "end", Ready: "ready" }, yt.parseStream = async (i, t, s) => {
715
+ const o = new Gs({ position: !1, ...s });
716
+ let n;
717
+ if (t.onOpenTagStart && o.on(yt.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && o.on(yt.Events.OpenTag, t.onOpenTag), t.onCloseTag && o.on(yt.Events.CloseTag, t.onCloseTag), t.onAttribute && o.on(yt.Events.Attribute, t.onAttribute), t.onText && o.on(yt.Events.Text, t.onText), t.onError && o.on(yt.Events.Error, t.onError), t.onEnd) {
718
+ t.onEnd;
719
+ const a = () => {
720
+ n = t.onEnd();
721
+ };
722
+ o.on(yt.Events.End, a);
723
+ }
724
+ for (; ; ) {
725
+ const { value: a, done: c } = await i.read();
726
+ if (c) break;
727
+ o.write(a);
728
+ }
729
+ return o.close(), n;
730
+ };
731
+ const w = (i) => i === !0 || i === "1" || i === "on" || i === "true" || i !== !1 && i !== "0" && i !== "off" && i !== "false" && null, A = (i) => {
732
+ const t = parseInt(i);
733
+ return isNaN(t) ? null : t;
734
+ }, ct = (i) => {
735
+ const t = parseFloat(i);
736
+ return isNaN(t) ? null : t;
737
+ }, k = null;
738
+ class Zs {
739
+ constructor() {
740
+ this._registeredVisitors = /* @__PURE__ */ new Map();
741
+ }
742
+ registerVisitor(t) {
743
+ this._registeredVisitors.set(t.from, t);
744
+ }
745
+ createEventHandler(t, s, o) {
746
+ const n = this._registeredVisitors, a = [];
747
+ let c = null, m = null, v = null, b = null;
748
+ const x = [], D = { key: null, source: t };
749
+ let y = null, u = !1;
750
+ const E = (T, f) => {
751
+ let I = v.attributes[T];
752
+ if (f) {
753
+ if (Array.isArray(f)) {
754
+ for (let H = 0; H < f.length; H++)
755
+ if (I == null || (I = f[H](I), I == null)) return;
756
+ } else if (I == null || (I = f(I), I == null)) return;
757
+ }
758
+ return I;
759
+ }, g = { getSource: () => y.source, setSource: (T) => {
760
+ y.source = T;
761
+ }, setKey: (T) => {
762
+ y.key = T;
763
+ }, getFrom: () => v, getAttribute: (T, f) => E(T, f) ?? null, hasAttribute: (T) => g.getAttribute(T) !== null, getParent: () => x[x.length - 2].source, getPath: () => {
764
+ const T = [];
765
+ for (let f = 0; f < a.length; f++) T.push(a[f].local);
766
+ return T.join("\\");
767
+ }, parseAttribute: E, copyToObject: (T, f, I, H) => {
768
+ const W = E(H ?? f, I);
769
+ W !== void 0 && (T[f] = W);
770
+ }, copyTo: (T, f, I) => {
771
+ const H = E(I ?? T, f);
772
+ H !== void 0 && (y.source[T] = H);
773
+ }, warn: (T) => {
774
+ o ? o?.(T) : console.warn(T);
775
+ } };
776
+ return { onOpenTag: (T) => {
777
+ let f = T.name;
778
+ const I = f.indexOf(":");
779
+ I !== -1 && (f = f.slice(I + 1));
780
+ const H = n.get(f);
781
+ if (c = { local: f, visitor: H, tag: T, destination: null }, u) return a.push(c), m = f, void (v = T);
782
+ b = c?.visitor ?? null, H && (y = a.length === 0 ? D : b?.to !== null ? { key: null, source: {} } : null, c.destination = y, y && x.push(y)), a.push(c), m = f, v = T, u = b?.to === null, b?.openTag?.(g);
783
+ }, onCloseTag: (T) => {
784
+ let f = T.name;
785
+ const I = f.indexOf(":");
786
+ if (I !== -1 && (f = f.slice(I + 1)), f !== m) throw new Error(`mismatch open/close tag: '${f}'/'${m}'`);
787
+ u || b?.closeTag?.(g);
788
+ const H = a.pop() ?? null;
789
+ c = a[a.length - 1] ?? null;
790
+ const W = H?.destination;
791
+ if (W) {
792
+ x.pop(), y = x[x.length - 1] ?? D;
793
+ const ht = H.visitor;
794
+ ht && ht.to && W.source !== void 0 && (Array.isArray(ht.to) ? y.source.push ? y.source.push(W.source) : o?.(`Unable to parse array for ${ht.from} at ${g.getPath()}`) : W.key ? y.source[W.key] = W.source : typeof ht.to == "string" && (y.source[ht.to] = W.source));
795
+ }
796
+ m = c?.local ?? null, v = c?.tag ?? null, b = c?.visitor ?? null, u = !c?.destination;
797
+ }, onText: (T) => {
798
+ b?.text?.(T, g);
799
+ }, onEnd: s };
800
+ }
801
+ }
802
+ const as = (i, t, s, o = null) => {
803
+ if (!i) return null;
804
+ let n = i;
805
+ n.startsWith("/") && (n = n.substring(1));
806
+ let a = o?.parsedRefs?.get(i);
807
+ if (a !== void 0) return a;
808
+ const c = t(n);
809
+ if (!c) return null;
810
+ let m = c.content;
811
+ try {
812
+ s && (m = s(m));
813
+ } catch (v) {
814
+ console.warn(v);
815
+ }
816
+ return o?.parsedRefs?.set(i, m), m;
817
+ }, Ve = (i, t, s, o, n = null) => {
818
+ if (!i) return null;
819
+ let a = i;
820
+ a.startsWith("/") && (a = a.substring(1));
821
+ let c = n?.parsedRefs?.get(i);
822
+ if (c !== void 0) return c;
823
+ const m = t(a);
824
+ if (!m) return null;
825
+ const v = m.content;
826
+ try {
827
+ const b = new TextDecoder().decode(v), x = s.parseFromString(b, "text/xml"), D = o.convert(x, i, n);
828
+ return n?.parsedRefs?.set(i, D), D;
829
+ } catch (b) {
830
+ console.warn(b);
831
+ }
832
+ return null;
833
+ }, Zt = (i, t, s, o, n = null) => {
834
+ const a = /* @__PURE__ */ new Map();
835
+ let c = t.Directory[i];
836
+ const m = c ? c.length : 0;
837
+ for (let v = 0; v < m; v++) {
838
+ const b = c[v];
839
+ if (!b) continue;
840
+ let x = b;
841
+ x.startsWith("/") && (x = x.substring(1));
842
+ const D = Ve(x, (y) => t.files[y], s, o, n);
843
+ a.set(x, D);
844
+ }
845
+ return a;
846
+ }, Qs = ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "hlink", "folHlink"], ls = (i, t = "dk1") => {
847
+ let s;
848
+ const o = i("auto");
849
+ o === void 0 || o !== "1" && o !== "true" || (s = t);
850
+ const n = i("indexed");
851
+ n && (s = `index${n}`);
852
+ const a = i("rgb");
853
+ a && (s = a.toLowerCase(), a.length !== 8 || a.startsWith("FF") || (s = "FF" + a.substring(2, a.length)));
854
+ const c = i("theme");
855
+ c && (s = Qs[c]);
856
+ let m = i("tint");
857
+ if (m && (s += ` ${Os.AdjustmentType.ETint} ${parseFloat(m)}`), s) return s;
858
+ }, Js = (i) => i && i.replace(/^\{([\s\S]+)\}$/, "$1"), si = (i) => i ? hs.roundAccurately(parseFloat(i) / 12700, 4) : null, ii = (i) => i ? hs.roundAccurately(parseFloat(i) / 9525, 1) : null, oi = (i) => parseFloat(i) / 1e3, ri = (i) => parseFloat(i) / 6e4, Ks = (i) => i === "true" || i === "1";
859
+ class Bt {
860
+ static {
861
+ this.Collapsed = 1;
862
+ }
863
+ static {
864
+ this.CustomFormat = 2;
865
+ }
866
+ static {
867
+ this.CustomHeight = 4;
868
+ }
869
+ static {
870
+ this.Hidden = 8;
871
+ }
872
+ static {
873
+ this.Ht = 16;
874
+ }
875
+ static {
876
+ this.OutlineLevel = 32;
877
+ }
878
+ static {
879
+ this.Ph = 64;
880
+ }
881
+ static {
882
+ this.R = 128;
883
+ }
884
+ static {
885
+ this.S = 256;
886
+ }
887
+ static {
888
+ this.Spans = 512;
889
+ }
890
+ static {
891
+ this.ThickBot = 1024;
892
+ }
893
+ static {
894
+ this.ThickTop = 2048;
895
+ }
896
+ }
897
+ const Ys = (i, t, s) => {
898
+ if (i[0].value[0] === i[1].value[0]) return t;
899
+ }, cs = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, ni = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (i, t) => {
900
+ const { password: s, onWarning: o, createWorkbookOptions: n = {}, ...a } = t ?? {}, c = import("./NTINjW8JjyZudT8s.js"), m = import("./Gz4u4ewyWfB-Pf-a.js");
901
+ let v = null;
902
+ try {
903
+ v = new DOMParser();
904
+ } catch {
905
+ }
906
+ let b = null;
907
+ v || (b = import("./CwdMjMPFdIs8SAV0.js").then((u) => u.i));
908
+ let x = null, D = null, y = null;
909
+ try {
910
+ const u = await Promise.all([c, m, b]);
911
+ x = u[0], D = u[1], y = u[2];
912
+ } catch (u) {
913
+ throw new Error("Unable to load XLSX parser.", { cause: u });
914
+ }
915
+ try {
916
+ const u = x.read(i, { type: "array", sheets: [], cellStyles: !1, bookFiles: !0 });
917
+ if (!u.Directory) throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
918
+ u.Directory.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], u.Directory.richdata = ["/xl/richData/rdrichvalue.xml"];
919
+ const E = new D.FromOOXMLConverter(), g = v ?? new y.DOMParser(), T = n?.resources ?? new Ss(), f = T.beginPersist(), I = {}, H = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map();
920
+ W.set("richTypes", []);
921
+ const ht = /* @__PURE__ */ new Map(), Le = [], he = (P) => u.files[P], be = (P, z) => {
922
+ const K = P.lastIndexOf("/"), ut = P.substring(0, K + 1) + "_rels/" + P.substring(K + 1, P.length) + ".rels";
923
+ let dt = z.get(ut);
924
+ return dt || (dt = ((R, Se, Ce, ke, Wt = null) => {
925
+ if (!R) return null;
926
+ const _t = Ve(R, Se, Ce, ke, Wt);
927
+ if (!_t) return null;
928
+ const Y = /* @__PURE__ */ new Map(), pt = Object.keys(_t), Ct = pt.length;
929
+ for (let xt = 0; xt < Ct; xt++) {
930
+ const kt = pt[xt], Yt = _t[kt];
931
+ Y.set(kt, Yt);
932
+ }
933
+ return Y;
934
+ })(ut, he, g, E, bt), z.set(ut, dt)), dt;
935
+ }, ue = (P, z, K, ut = ht) => {
936
+ let dt = be(z, ut).get(P), R = dt?.target;
937
+ if (!R) return null;
938
+ if (dt.targetMode === "External") return dt.target;
939
+ const Se = z.lastIndexOf("/"), Ce = z.substring(0, Se + 1);
940
+ R.startsWith("/") || (R = Ce + R), R = ((_t) => {
941
+ const Y = _t.split(/\/+/);
942
+ return Y.reduce((Ct, xt, kt) => (xt === "." ? Ct.splice(kt, 1) : xt === ".." && Ct.splice(kt - 1, 2), Ct), Y).join("/");
943
+ })(R);
944
+ const ke = E?.getVisitorParamsState().get("dxfs");
945
+ let Wt = ut.get(R);
946
+ if (!Wt)
947
+ if (dt.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
948
+ const Y = {};
949
+ Wt = Y;
950
+ const pt = async () => {
951
+ const Ct = ((V, U, ee, _, G, Z, tt) => {
952
+ const h = new Zs(), Q = new Cs.TransposedBuilder();
953
+ let j = null;
954
+ h.registerVisitor({ from: "autoFilter", to: "filter", openTag: (e) => {
955
+ e.copyTo("ref", k);
956
+ } }), h.registerVisitor({ from: "conditionalFormatting", to: {}, openTag: (e) => {
957
+ const r = e.getParent();
958
+ r.conditionals || (r.conditionals = []), r.conditionals.push(e.getSource());
959
+ const l = e.getAttribute("sqref");
960
+ l && (e.getSource().ref = l.split(" ").join(",")), e.copyTo("pivot", w);
961
+ }, closeTag: (e) => {
962
+ const r = e.getSource();
963
+ if (r.rule) {
964
+ const l = Object.keys(r.rule);
965
+ for (let d = 0; d < l.length; d++) {
966
+ const S = l[d];
967
+ S !== "rule" && (r[S] = r.rule[S]);
968
+ }
969
+ }
970
+ delete r.rule;
971
+ } }), h.registerVisitor({ from: "cfRule", to: "rule", openTag: (e) => {
972
+ const r = e.getParent();
973
+ e.copyToObject(r, "type", k), e.copyToObject(r, "priority", A), e.copyToObject(r, "stopIfTrue", w);
974
+ const l = e.getAttribute("dxfId", A);
975
+ if (l !== null) {
976
+ let d = _?.get(l);
977
+ d || (Z?.(`Unable to load conditional color. Invalid dxfI: '${l}' at '${e.getPath()}'.`), d = {}), r.style = d;
978
+ }
979
+ e.copyToObject(r, "aboveAverage", w), e.copyToObject(r, "equalAverage", w), e.copyToObject(r, "stdDev", A), e.copyToObject(r, "bottom", w), e.copyToObject(r, "percent", w), e.copyToObject(r, "rank", A), e.copyToObject(r, "operator", k), e.copyToObject(r, "text", k), e.copyToObject(r, "timePeriod", k);
980
+ } }), h.registerVisitor({ from: "colorScale", to: "colorScale" }), h.registerVisitor({ from: "dataBar", to: "dataBar", openTag: (e) => {
981
+ e.copyTo("maxLength", A), e.copyTo("minLength", A), e.copyTo("showValue", w);
982
+ } }), h.registerVisitor({ from: "iconSet", to: "iconSet", openTag: (e) => {
983
+ e.copyTo("iconSet", k), e.copyTo("reverse", w), e.copyTo("showValue", w);
984
+ } }), h.registerVisitor({ from: "formula", to: null, text: (e, r) => {
985
+ const l = r.getParent();
986
+ let d = l.formulas;
987
+ d || (d = [], l.formulas = d), d.push(e);
988
+ } }), h.registerVisitor({ from: "cfvo", to: {}, openTag: (e) => {
989
+ const r = e.getParent();
990
+ r.conditions || (r.conditions = []), r.conditions.push(e.getSource()), e.copyTo("type", k), e.copyTo("value", ct, "val"), e.copyTo("gte", w);
991
+ } }), h.registerVisitor({ from: "color", to: {}, openTag: (e) => {
992
+ const r = e.getParent();
993
+ r.colors || (r.colors = []);
994
+ const l = ls((d) => e.getAttribute(d));
995
+ r.colors.push(l);
996
+ } }), h.registerVisitor({ from: "filterColumn", to: "filterColumn", openTag: (e) => {
997
+ const r = e.getParent();
998
+ r.fields || (r.fields = []), r.fields.push(e.getSource()), e.copyTo("offset", A, "colId"), e.copyTo("hiddenButton", w), e.copyTo("showButton", w);
999
+ } }), h.registerVisitor({ from: "colorFilter", to: "colorFilter", openTag: (e) => {
1000
+ const r = e.getParent();
1001
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Gt.Type.Color, e.copyTo("cellColor", w), e.copyTo("styleId", A, "dxfId");
1002
+ } }), h.registerVisitor({ from: "dynamicFilter", to: "dynamicFilter", openTag: (e) => {
1003
+ const r = e.getParent();
1004
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Gt.Type.Dynamic, e.copyTo("dynamicType", k, "type"), e.copyTo("val", ct), e.copyTo("maxVal", ct, "maxVal");
1005
+ } }), h.registerVisitor({ from: "iconFilter", to: "iconFilter", openTag: (e) => {
1006
+ const r = e.getParent();
1007
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Gt.Type.Icon, e.copyTo("iconId", A), e.copyTo("iconSet", k);
1008
+ } }), h.registerVisitor({ from: "top10", to: "top10", openTag: (e) => {
1009
+ const r = e.getParent();
1010
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Gt.Type.Top10, e.copyTo("filterVal", ct), e.copyTo("percent", w), e.copyTo("top", w), e.copyTo("val", ct);
1011
+ } }), h.registerVisitor({ from: "filters", to: "filters", openTag: (e) => {
1012
+ const r = e.getParent();
1013
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Gt.Type.Items, e.copyTo("blank", w), e.copyTo("calendarType", k);
1014
+ } }), h.registerVisitor({ from: "dateGroupItem", to: "dateGroupItem", openTag: (e) => {
1015
+ const r = e.getParent();
1016
+ r.dateGroups || (r.dateGroups = []), r.dateGroups.push(e.getSource()), e.copyTo("group", k, "dateTimeGrouping"), e.copyTo("day", A), e.copyTo("hour", A), e.copyTo("minute", A), e.copyTo("month", A), e.copyTo("second", A), e.copyTo("year", A);
1017
+ } }), h.registerVisitor({ from: "filter", to: "filter", openTag: (e) => {
1018
+ const r = e.getParent();
1019
+ r.items || (r.items = []), r.items.push(e.getAttribute("val", ct));
1020
+ } }), h.registerVisitor({ from: "customFilters", to: "customFilters", openTag: (e) => {
1021
+ const r = e.getParent();
1022
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Gt.Type.Custom, e.copyTo("and", w);
1023
+ } }), h.registerVisitor({ from: "customFilter", to: "customFilter", openTag: (e) => {
1024
+ const r = e.getParent();
1025
+ r.filters || (r.filters = []), r.filters.push(e.getSource()), e.copyTo("operator", k), e.copyTo("value", ct, "val");
1026
+ } }), h.registerVisitor({ from: "sortState", to: "sort", openTag: (e) => {
1027
+ e.copyTo("ref", k);
1028
+ } }), h.registerVisitor({ from: "sortCondition", to: "sortCondition", openTag: (e) => {
1029
+ const r = e.getParent();
1030
+ r.fields || (r.fields = []);
1031
+ const l = e.getSource();
1032
+ r.fields.push(l), e.copyTo("sortOn", k, "sortBy"), e.copyTo("dxfId", k, "sortBy"), e.copyTo("iconSet", k), e.copyTo("customList", k);
1033
+ const d = e.getAttribute("ref");
1034
+ if (d) {
1035
+ const S = at.fastStringToRange(d, cs).colStart, gt = at.fastStringToRange(r.ref, cs), ot = gt.colStart;
1036
+ l.offset = gt ? S - ot : S;
1037
+ }
1038
+ l.reverse = e.getAttribute("descending", w) ?? !1;
1039
+ } }), h.registerVisitor({ from: "AlternateContent", to: null });
1040
+ const fe = (e) => {
1041
+ j = e.getSource(), e.copyTo("topLeft", k, "topLeftCell");
1042
+ const r = Ks(e.getAttribute("defaultGridColor")), l = e.getAttribute("colorId");
1043
+ l === null || r || (e.getSource().gridLineColor = "index" + parseFloat(l)), e.copyTo("showZeros", w), e.copyTo("showFormulas", w), e.copyTo("zoomScale", A), e.copyTo("showRowHeaders", w, "showRowColHeaders"), e.copyTo("showColumnHeaders", w, "showRowColHeaders"), e.copyTo("showRowGridlines", w, "showGridLines"), e.copyTo("showColumnGridlines", w, "showGridLines");
1044
+ };
1045
+ h.registerVisitor({ from: "sheetView", to: "view", openTag: (e) => {
1046
+ fe(e);
1047
+ }, closeTag: () => {
1048
+ j = null;
1049
+ } }), h.registerVisitor({ from: "customSheetViews", to: "customSheetViews", openTag: (e) => {
1050
+ e.setSource([]);
1051
+ } }), h.registerVisitor({ from: "customSheetView", to: [], openTag: (e) => {
1052
+ fe(e);
1053
+ }, closeTag: () => {
1054
+ j = null;
1055
+ } }), h.registerVisitor({ from: "selection", to: "selection", openTag: (e) => {
1056
+ if (!j) return;
1057
+ e.copyTo("cell", k, "activeCell"), e.copyTo("rangeIndex", A, "activeCellId");
1058
+ const r = e.getAttribute("activeCell"), l = e.getAttribute("sqref");
1059
+ l && l !== r && (e.getSource().ranges = l.split(" "));
1060
+ } }), h.registerVisitor({ from: "pane", to: "pane", openTag: (e) => {
1061
+ if (j && e.getAttribute("state") === "frozen") {
1062
+ const r = {};
1063
+ j.freezePanes = r, e.copyToObject(r, "topLeft", k, "topLeftCell");
1064
+ const l = j.topLeft ? at.fastStringToCell(j.topLeft) : { colIndex: 0, rowIndex: 0 }, d = { colIndex: 0, rowIndex: 0 };
1065
+ e.copyToObject(d, "colIndex", A, "xSplit"), e.copyToObject(d, "rowIndex", A, "ySplit");
1066
+ const S = { colIndex: l.colIndex + d.colIndex, rowIndex: l.rowIndex + d.rowIndex };
1067
+ r.coords = at.cellToString(S);
1068
+ }
1069
+ } }), h.registerVisitor({ from: "tabColor", to: null, openTag: (e) => {
1070
+ const r = ls((l) => e.getAttribute(l));
1071
+ r && (V.tabColor = r);
1072
+ } }), h.registerVisitor({ from: "pageSetUpPr", to: "pageSetUpPr", openTag: (e) => {
1073
+ } }), h.registerVisitor({ from: "outlinePr", to: "outlinePr", openTag: (e) => {
1074
+ } }), h.registerVisitor({ from: "pageMargins", to: "pageMargins", openTag: (e) => {
1075
+ } }), h.registerVisitor({ from: "pageSetup", to: "pageSetup", openTag: (e) => {
1076
+ } }), h.registerVisitor({ from: "printOptions", to: "printOptions", openTag: (e) => {
1077
+ } }), h.registerVisitor({ from: "mergeCells", to: "merges", openTag: (e) => {
1078
+ e.setSource([]);
1079
+ } }), h.registerVisitor({ from: "mergeCell", to: [], openTag: (e) => {
1080
+ const r = e.getAttribute("ref");
1081
+ e.setSource(r);
1082
+ } }), h.registerVisitor({ from: "hyperlinks", to: "hyperlinks", openTag: (e) => {
1083
+ e.setSource([]);
1084
+ } }), h.registerVisitor({ from: "hyperlink", to: [], openTag: (e) => {
1085
+ const r = e.getAttribute("r:id"), l = e.getAttribute("ref");
1086
+ if (!l) return void console.warn("No ref found for hyperlink");
1087
+ e.setKey(l);
1088
+ let d = r ? U(r) : "";
1089
+ if (typeof d != "string") return void console.warn("Invalid address ", d);
1090
+ const S = e.getAttribute("location");
1091
+ d.endsWith("\\") && (d = d.substring(0, d.length - 1));
1092
+ const gt = e.getAttribute("location");
1093
+ if (gt && (S && S !== gt && console.warn("display and location are different", S, gt), d += "#" + gt), !d) return void console.warn("No address found for hyperlink. r:id", r);
1094
+ let ot;
1095
+ const At = e.getAttribute("tooltip");
1096
+ ot = At ? { address: d, tooltip: At } : d, e.setSource({ r: l, v: ot });
1097
+ } }), h.registerVisitor({ from: "drawing", to: "movables", openTag: (e) => {
1098
+ const r = e.getAttribute("r:id");
1099
+ if (!r) return;
1100
+ const l = U(r);
1101
+ l ? e.setSource(l.movables) : console.warn("no drawing found for rId", r);
1102
+ } }), h.registerVisitor({ from: "tableParts", to: "tables", openTag: (e) => {
1103
+ e.setSource([]);
1104
+ } }), h.registerVisitor({ from: "tablePart", to: [], openTag: (e) => {
1105
+ const r = e.getAttribute("r:id");
1106
+ if (!r) return;
1107
+ const l = U(r);
1108
+ l ? e.setSource(l) : console.warn("no table found for rId", r);
1109
+ } }), h.registerVisitor({ from: "worksheet", to: "worksheet", openTag: (e) => {
1110
+ } }), h.registerVisitor({ from: "sheetProtection", to: "protection", openTag: (e) => {
1111
+ let r = !1;
1112
+ if (e.hasAttribute("sheet") && w(e.getAttribute("sheet")) && (r = !0), !r) return void e.setSource(void 0);
1113
+ const l = (S) => S === !0 || S === "1" || S === "on" || S === "true" || S === !1 || S === "0" || S === "off" || S === "false" || null;
1114
+ e.copyTo("autoFilter", l), e.copyTo("deleteColumns", l), e.copyTo("formatCells", l), e.copyTo("formatColumns", l), e.copyTo("formatRows", l), e.copyTo("insertColumns", l), e.copyTo("insertHyperlinks", l), e.copyTo("insertRows", l), e.copyTo("objects", l), e.copyTo("pivotTables", l), e.copyTo("scenarios", l), e.copyTo("selectUnlockedCells", l), e.copyTo("selectUnlockedCells", l), e.copyTo("sort", l);
1115
+ const d = {};
1116
+ e.copyToObject(d, "hash", k, "hashValue"), e.copyToObject(d, "algorithm", k, "algorithmName"), e.copyToObject(d, "salt", k, "saltValue"), e.copyToObject(d, "spinCount", A), Object.keys(d).length > 0 && (e.getSource().password = d);
1117
+ } }), h.registerVisitor({ from: "protectedRanges", to: "protectedRanges", openTag: (e) => {
1118
+ e.setSource({});
1119
+ } }), h.registerVisitor({ from: "protectedRange", to: {}, openTag: (e) => {
1120
+ const r = e.getAttribute("sqref");
1121
+ e.setKey(r), e.copyTo("name"), e.copyTo("securityDescriptor");
1122
+ const l = {};
1123
+ e.copyToObject(l, "hash", k, "hashValue"), e.copyToObject(l, "algorithm", k, "algorithmName"), e.copyToObject(l, "salt", k, "saltValue"), e.copyToObject(l, "spinCount", A), Object.keys(l).length > 0 && (e.getSource().password = l);
1124
+ } }), h.registerVisitor({ from: "sheetFormatPr", to: "sheetFormatPr", openTag: (e) => {
1125
+ e.copyToObject(V, "defaultColSize", ct, "defaultColWidth"), e.copyToObject(V, "outlineLevelCol", A, "outlineLevelCol");
1126
+ const r = e.getAttribute("customHeight");
1127
+ r !== "1" && r !== "true" || e.copyToObject(V, "defaultRowSize", ct, "defaultRowHeight"), e.copyToObject(V, "outlineLevelRow", A, "outlineLevelRow");
1128
+ } }), h.registerVisitor({ from: "cols", to: "cols", openTag: (e) => {
1129
+ e.setSource([]);
1130
+ } }), h.registerVisitor({ from: "col", to: [], openTag: (e) => {
1131
+ e.copyTo("min", (r) => parseInt(r) - 1), e.copyTo("max", (r) => parseInt(r) - 1), e.copyTo("sz", ct, "width"), e.copyTo("cs", w, "customWidth"), e.copyTo("h", w, "hidden"), e.copyTo("l", A, "outlineLevel"), e.copyTo("s", A, "style");
1132
+ } }), h.registerVisitor({ from: "oleObjects", to: null, openTag: (e) => {
1133
+ e.warn("'OLE Objects' are not supported.");
1134
+ } });
1135
+ let se = null;
1136
+ const ws = { onOpenTag: (e) => {
1137
+ se === null && (se = "");
1138
+ }, onText: (e) => {
1139
+ se += e;
1140
+ }, onEnd: () => {
1141
+ const e = ee(se);
1142
+ return se = null, e;
1143
+ }, onError: (e) => {
1144
+ } };
1145
+ return ((e, r, l, d, S, gt) => {
1146
+ let ot = !1, At = !1, qt = [], zt = !1, Dt = null, ie = null, me = null, rt = null, Fe = null, Xe = null;
1147
+ const vs = gt?.get("richData") ?? [], Be = at.normalizeA1ToR1C1, We = Pe.createConflatingRanges(), _e = /* @__PURE__ */ new Map(), Ae = [];
1148
+ let oe = null;
1149
+ const qe = Pe.createConflatingRanges();
1150
+ let re, Et = !1, X = -1, J = -1, ft = null, ne = null;
1151
+ const De = [];
1152
+ let Ee = null, ze = -2, mt = 0, Ut = "", Pt = "", Ot = "", It = "", Vt = "", Lt = "", Nt = "", Ue = "", Ge = "", Ze = "", Qe = "", Je = "", Ke = "", Ye = "", Tt = !0, Rt = null;
1153
+ return { ...l, onEnd: () => {
1154
+ De.length > 0 && (r.rows = De);
1155
+ let p = We.done(Ys);
1156
+ const C = p.length;
1157
+ if (C > 0) {
1158
+ const $ = new Array(C);
1159
+ for (let L = 0; L < C; L++) {
1160
+ const nt = p[L], $t = at.rangeToString(nt), Mt = nt.value[1], ae = at.resolveRelativeToA1(Mt, nt.rowStart, nt.colStart);
1161
+ $[L] = [$t, ae];
1162
+ }
1163
+ r.formulas = $;
1164
+ }
1165
+ const et = qe.done(!0), N = et.length;
1166
+ if (N > 0) {
1167
+ const $ = new Array(N);
1168
+ for (let L = 0; L < N; L++) {
1169
+ const nt = et[L], $t = at.rangeToString(nt);
1170
+ $[L] = $t;
1171
+ }
1172
+ r.volatile = $;
1173
+ }
1174
+ if (Ae.length > 0 && (r.dynamicArray = [...Ae]), qt.length > 0) {
1175
+ qt.sort(Pe.createRangeComparator(As.Orientation.Column));
1176
+ const $ = [];
1177
+ let L = null, nt = -1, $t = -1, Mt = -1, ae = -1, wt = null;
1178
+ const ts = qt.length;
1179
+ ts > 0 && (L = qt[0], nt = L.colStart, $t = L.colEnd, Mt = L.rowEnd, ae = L.value, $.push(L));
1180
+ for (let jt = 1; jt < ts; jt++) wt = qt[jt], ae !== wt.value || nt !== wt.colStart || $t !== wt.colEnd || Mt + 1 !== wt.rowEnd ? ($.push(wt), L = wt, nt = L.colStart, $t = L.colEnd, Mt = L.rowEnd, ae = L.value) : (Mt = wt.rowEnd, L.rowEnd = Mt);
1181
+ let es = [];
1182
+ for (let jt = 0; jt < $.length; jt++) {
1183
+ const le = $[jt];
1184
+ es.push({ r: { colStart: le.colStart, colEnd: le.colEnd, rowStart: le.rowStart, rowEnd: le.rowEnd }, v: le.value });
1185
+ }
1186
+ r.directStyles = es;
1187
+ }
1188
+ const st = e.build();
1189
+ if (st) {
1190
+ const $ = st.tuples;
1191
+ r.data = $;
1192
+ }
1193
+ l?.onEnd?.();
1194
+ }, onOpenTag: (p) => {
1195
+ let C = p.name;
1196
+ const et = C.indexOf(":");
1197
+ if (et !== -1 && (C = C.slice(et + 1)), re) {
1198
+ const N = p.attributes;
1199
+ switch (C) {
1200
+ case "v":
1201
+ At = !0;
1202
+ break;
1203
+ case "f":
1204
+ switch (N.t ?? null) {
1205
+ case null:
1206
+ case "normal":
1207
+ zt = !0;
1208
+ break;
1209
+ case "shared":
1210
+ const st = N.si;
1211
+ ie = N.ref, Dt = st;
1212
+ break;
1213
+ case "array":
1214
+ zt = !0, ie = N.ref, oe = [ie, !1];
1215
+ break;
1216
+ case "datatable":
1217
+ zt = !0, ie = N.ref, zt = !0;
1218
+ }
1219
+ N.ca !== void 0 && qe.append(X, J);
1220
+ break;
1221
+ case "is":
1222
+ return void (Et = !0);
1223
+ }
1224
+ return void (Et && S?.onOpenTag(p));
1225
+ }
1226
+ if (ot) {
1227
+ if (C === "c") {
1228
+ re = p;
1229
+ const N = p.attributes.r;
1230
+ J = at.fastStringToCol(N);
1231
+ const st = p.attributes.t;
1232
+ st === void 0 ? ne = null : (ne = st, ne === "str" && (Et = !0));
1233
+ let $ = p.attributes.s;
1234
+ $ !== void 0 && ($ = parseInt($), Rt && Rt.value === $ && Rt.colEnd + 1 === J ? Rt.colEnd = J : (Rt = { colStart: J, rowStart: X, colEnd: J, rowEnd: X, value: $ }, qt.push(Rt)));
1235
+ }
1236
+ } else {
1237
+ if (C === "row") {
1238
+ ot = !0;
1239
+ const N = p.attributes.r;
1240
+ if (X = parseInt(N) - 1, mt = 0, Pt = p.attributes.customHeight, Pt !== void 0 && (mt |= Bt.CustomHeight), Pt !== Ge && (Tt = !0, Ge = Pt), Ut = p.attributes.ht, Ut !== void 0 && (mt |= Bt.Ht), Ut !== Ue && (Tt = !0, Ue = Ut), Ot = p.attributes.hidden, Ot !== void 0 && (mt |= Bt.Hidden), Ot !== Ze && (Tt = !0, Ze = Ot), Vt = p.attributes.s, Vt !== void 0 && (mt |= Bt.S), Vt !== Je && (Tt = !0, Je = Vt), It = p.attributes.customFormat, It !== void 0 && (mt |= Bt.CustomFormat), It !== Qe && (Tt = !0, Qe = It), Lt = p.attributes.outlineLevel, Lt !== void 0 && (mt |= Bt.OutlineLevel), Lt !== Ke && (Tt = !0, Ke = Lt), Nt = p.attributes.collapsed, Nt !== void 0 && (mt |= Bt.Collapsed), Nt !== Ye && (Tt = !0, Ye = Nt), mt !== 0) if (ze + 1 !== X || Tt) {
1241
+ const st = Pt !== void 0 && (Pt === "1" || Pt === "true"), $ = It !== void 0 && (It === "1" || It === "true");
1242
+ Ee = { min: X, max: X, sz: st && Ut !== void 0 ? parseFloat(Ut) : -1, csz: st, h: Ot !== void 0 && (Ot === "1" || Ot === "true"), s: st && Vt !== void 0 && Vt !== "0" ? parseInt(Vt) : 0, cs: $, l: Lt === void 0 || Lt === "0" ? 0 : parseInt(Lt), cl: Nt !== void 0 && (Nt === "1" || Nt === "true") }, De.push(Ee);
1243
+ } else Ee.max = X;
1244
+ return ze = X, void (Tt = !1);
1245
+ }
1246
+ l?.onOpenTag(p);
1247
+ }
1248
+ }, onCloseTag: (p) => {
1249
+ if (re) {
1250
+ let C = p.name;
1251
+ const et = C.indexOf(":");
1252
+ if (et !== -1 && (C = C.slice(et + 1)), Et) if (C === "is" || C === "v") {
1253
+ const N = S?.onEnd();
1254
+ N !== null && e.addValue(X, J, "" + N);
1255
+ } else S?.onCloseTag?.(p);
1256
+ return At && (At = !1), void (C === "c" && (re = null, Et = !1));
1257
+ }
1258
+ if (ot) return ot = !1, void (Rt = null);
1259
+ l?.onCloseTag(p);
1260
+ }, onText: (p) => {
1261
+ if (p = p.trim(), At) {
1262
+ switch (ft = null, ne) {
1263
+ case null:
1264
+ case "n":
1265
+ ft = parseFloat(p);
1266
+ break;
1267
+ case "b":
1268
+ ft = p === "1" || p === "true";
1269
+ break;
1270
+ case "s":
1271
+ ft = p;
1272
+ break;
1273
+ case "e":
1274
+ if (p === "#VALUE!") {
1275
+ const et = re.attributes.vm;
1276
+ if (et !== void 0) {
1277
+ const N = vs[parseInt(et) - 1];
1278
+ if (N && N.isFormulaError) {
1279
+ ft = { t: Ft.Error, v: N.getCode() };
1280
+ break;
1281
+ }
1282
+ }
1283
+ }
1284
+ const C = ks.getBuiltInByLabel(p);
1285
+ C ? ft = { t: Ft.Error, v: C.getCode() } : (ft = p, d?.(`Unknown formula error '${p}' in cell ${at.cellToString({ colIndex: J, rowIndex: X })}`));
1286
+ break;
1287
+ case "str":
1288
+ case "inlineStr":
1289
+ Et = !0;
1290
+ }
1291
+ ft !== null && e.addValue(X, J, ft);
1292
+ }
1293
+ if (oe && (ne === "e" && (oe[1] = !0), Ae.push(oe), oe = null), Dt) if (Fe === Dt) rt = Xe;
1294
+ else {
1295
+ if (rt = _e.get(Dt), !rt) {
1296
+ const C = [];
1297
+ me = Be(p, X, J, C), rt = [me, C, p], _e.set(Dt, rt);
1298
+ }
1299
+ Fe = Dt, Xe = rt;
1300
+ }
1301
+ if (zt) {
1302
+ const C = [];
1303
+ me = Be(p, X, J, C), rt = [me, C, p];
1304
+ }
1305
+ if (rt) return We.append(X, J, rt), rt = null, zt = !1, Dt = null, void (ie = null);
1306
+ Et ? S?.onText(p) : ot || l?.onText(p);
1307
+ } };
1308
+ })(Q, V, h.createEventHandler(V, () => {
1309
+ }, Z), Z, ws, tt);
1310
+ })(Y, (V, U = !1) => ue(V, R, U) ?? null, ms, ke, 0, (V) => {
1311
+ o && (V = R + ": " + V, o?.(V));
1312
+ }, W), xt = as(R, he), kt = await (async (V, U = 8388608) => {
1313
+ await (async () => {
1314
+ if (typeof ReadableStream > "u") if (typeof window > "u") {
1315
+ const { ReadableStream: Z } = await import("./B-kFRtzNNkf4_SiP.js");
1316
+ globalThis.ReadableStream = Z;
1317
+ } else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
1318
+ })();
1319
+ const ee = new TextDecoder("utf-8");
1320
+ let _ = 0;
1321
+ const G = V instanceof Uint8Array ? V : new Uint8Array(V);
1322
+ return new ReadableStream({ pull(Z) {
1323
+ if (_ >= G.byteLength) return void Z.close();
1324
+ const tt = G.subarray(_, Math.min(_ + U, G.byteLength)), h = ee.decode(tt, { stream: _ + U < G.byteLength });
1325
+ Z.enqueue(h), _ += tt.length;
1326
+ } }).getReader();
1327
+ })(xt);
1328
+ try {
1329
+ await Ie.parseStream(kt, Ct, { xmlns: !1 });
1330
+ } catch (V) {
1331
+ throw console.warn(`Error parsing sheet: '${R}'`, V), new Error(`Error parsing sheet: '${R}'`, { cause: V });
1332
+ }
1333
+ const Yt = be(R, ut);
1334
+ let te, He = /* @__PURE__ */ new Map();
1335
+ if (Yt) {
1336
+ const V = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
1337
+ let U;
1338
+ Yt.forEach((_, G) => {
1339
+ _.type === V && (te = ue(G, R, !1, ut)?.comments, te && te.forEach((tt) => {
1340
+ He.set(tt.id, tt);
1341
+ }));
1342
+ });
1343
+ const ee = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
1344
+ if (Yt.forEach((_, G) => {
1345
+ _.type === ee && (U = ue(G, R, !1, ut));
1346
+ }), U || te) {
1347
+ const _ = te ?? [], G = U?.comments;
1348
+ if (G) {
1349
+ const Z = U?.authors;
1350
+ for (let tt = 0; tt < G.length; tt++) {
1351
+ const h = G[tt];
1352
+ let Q = h.authorId !== void 0 ? Z[h.authorId] : void 0;
1353
+ if ((!Q || Q.startsWith("tc=")) && (Q = Js(Q.substring(3)), He.has(Q))) continue;
1354
+ let j = pe.get(Q);
1355
+ j || (j = $e.get(Q)), j || (j = { id: ss.uuidV4(), displayName: Q }, $e.set(j.displayName, j), pe.set(j.id, j)), Q = j?.id ?? null;
1356
+ const fe = { id: ss.uuidV4(), personId: Q, ref: h.ref, done: !1, asNote: !0, content: h.content };
1357
+ _.push(fe);
1358
+ }
1359
+ }
1360
+ Y.comments = _;
1361
+ }
1362
+ }
1363
+ };
1364
+ Le.push(pt());
1365
+ } else Wt = K ? as(R, he, (Y) => {
1366
+ const pt = T.add({ buffer: Y });
1367
+ return pt.addReference(I), H.add(pt), f.toResourceId(pt);
1368
+ }, bt) : Ve(R, he, g, E, bt);
1369
+ return Wt;
1370
+ }, bt = { paramMap: W, getRefs: be, getRef: ue, parsedRefs: ht, onWarning: o, addPerson: (P) => null }, de = [];
1371
+ let xe = 0;
1372
+ u.Strings && (xe = parseInt(u.Strings.Unique ?? u.Strings.length ?? 0));
1373
+ const fs = u.Strings ?? [];
1374
+ for (let P = 0; P < xe; P++) de.push(fs[P]?.t ?? "");
1375
+ const Ne = /* @__PURE__ */ new Map();
1376
+ let Re = xe;
1377
+ const ms = (P) => {
1378
+ const z = Ne.get(P);
1379
+ if (z !== void 0) return z;
1380
+ const K = Re;
1381
+ return Ne.set(P, Re++), de.push(P), K;
1382
+ }, pe = (Zt("richstructure", u, g, E, bt), Zt("richdata", u, g, E, bt), /* @__PURE__ */ new Map()), $e = /* @__PURE__ */ new Map(), Me = Zt("people", u, g, E);
1383
+ let St = null;
1384
+ if (Me.size > 0 && (St = Me.entries().next()?.value?.[1]?.persons, St)) {
1385
+ const P = St.length;
1386
+ for (let z = 0; z < P; z++) {
1387
+ const K = St[z];
1388
+ pe.set(K.id, K), pe.set(K.displayName, K);
1389
+ }
1390
+ }
1391
+ const we = Zt("themes", u, g, E, bt);
1392
+ let je = null;
1393
+ if (we && we.entries) {
1394
+ let P = we.entries().next();
1395
+ P?.value?.[1] && (je = P.value[1]);
1396
+ }
1397
+ const Ts = new Ds(je);
1398
+ let ge = Zt("styles", u, g, E, bt).entries().next()?.value[1];
1399
+ ge && (ge = JSON.parse(Es(ge)));
1400
+ const ys = Zt("workbooks", u, g, E, bt);
1401
+ await Promise.all(Le);
1402
+ const ve = { ...ys.entries().next().value[1], styles: ge, theme: Ts.toJSON() };
1403
+ de.length > 0 && (ve.strings = de), St && St.length > 0 && (ve.people = St);
1404
+ const bs = { ...n, resources: T, json: ve }, xs = new Ps(bs);
1405
+ return H.forEach((P) => {
1406
+ P.deleteReference(I);
1407
+ }), f.endPersist(), xs;
1408
+ } catch (u) {
1409
+ let E = "Unable to parse XLSX.";
1410
+ throw u instanceof Is && (E = "Unable to open XLSX. There are too many rows or columns."), new Error(E, { cause: u });
1411
+ }
1412
+ }, toBufferXLSX: async (i, t) => {
1413
+ const s = await import("./NTINjW8JjyZudT8s.js"), o = await i.toJSON(!0), n = s.utils.book_new();
1414
+ for (let a = 0; a < o.sheets.length; a++) {
1415
+ const c = o.sheets[a], m = s.utils.json_to_sheet([{}]);
1416
+ s.utils.book_append_sheet(n, m, c.name);
1417
+ const v = c.sheet, b = i.getSheetAt(a), x = b.getUsedRange();
1418
+ if (x ? (m["!ref"] = x.getA1(), x.forEach((D, y) => {
1419
+ const u = { t: "z" }, E = y.getCell().getStyle();
1420
+ if (!E.isNormal()) {
1421
+ let g = E.getNumberFormat();
1422
+ g !== Ht.Type.General && (g === Ht.Type.ShortDate ? g = "m/d/yyyy" : g === Ht.Type.MediumDate ? g = "d-mmm-yy" : g === Ht.Type.LongDate ? g = "[$-x-sysdate]dddd, mmmm dd, yyyy" : g === Ht.Type.ShortTime ? g = "h:mm" : g === Ht.Type.MediumTime ? g = "h:mm AM/PM" : g === Ht.Type.LongTime && (g = "h:mm:ss AM/PM"), u.z = g);
1423
+ }
1424
+ if (D !== null) switch (y.getType()) {
1425
+ case Ft.Number:
1426
+ u.t = "n", u.v = D;
1427
+ break;
1428
+ case Ft.String:
1429
+ u.t = "s", u.v = D;
1430
+ break;
1431
+ case Ft.Boolean:
1432
+ u.t = "b", u.v = D;
1433
+ break;
1434
+ case Ft.Error:
1435
+ u.t = "e", u.v = D.toString();
1436
+ case Ft.RichData:
1437
+ }
1438
+ m[y.getA1()] = u;
1439
+ })) : m["!ref"] = "A1:A1", v.merges?.length > 0) {
1440
+ const D = [];
1441
+ m["!merges"] = D;
1442
+ for (let y = 0; y < v.merges.length; y++) D.push(s.utils.decode_range(v.merges[y]));
1443
+ }
1444
+ if (v.cols?.length > 0) {
1445
+ const D = [];
1446
+ m["!cols"] = D;
1447
+ const y = v.cols, u = { width: v.defaultColSize ?? b.getColumnWidthAsFontUnit(b.getColumnHeaders().getDefaultSize()) };
1448
+ for (let E = 0; E < y.length; E++) {
1449
+ const g = y[E];
1450
+ for (let f = D.length; f <= g.min - 1; f++) D.push(u);
1451
+ const T = {};
1452
+ g.sz !== void 0 && (T.width = g.sz), g.h !== void 0 && (T.hidden = g.h), g.l !== void 0 && (T.level = g.l);
1453
+ for (let f = g.min; f <= g.max; f++) D.push(T);
1454
+ }
1455
+ }
1456
+ }
1457
+ return s.write(n, { type: "array", bookType: "xlsx" }), s.write(n, { type: "array", bookType: "xlsx" });
1458
+ } }, Symbol.toStringTag, { value: "Module" }));
1459
+ export {
1460
+ oi as a,
1461
+ Ks as b,
1462
+ ii as c,
1463
+ ls as d,
1464
+ ni as i,
1465
+ ri as p,
1466
+ Js as r,
1467
+ si as t
1468
+ };