@sheetxl/mcp 0.8.0-beta.15 → 0.8.0-beta.16

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 (232) hide show
  1. package/LICENSE.md +8 -7
  2. package/assets/{OVRdpPUzR0-ueTxE.js → -PtBguqpLi7Nr4Df.js} +2 -2
  3. package/assets/{BOPsJmq7v7HOKUkO.js → 2GLqCzpAJP6jbaRx.js} +12 -12
  4. package/assets/{BPwmBu_aouERJjiW.js → 3_NofB4A4Qhl-4YY.js} +2 -2
  5. package/assets/{CGBGyaCGdlZFQYK0.js → 3t-I20nDzFHBd5UJ.js} +2 -2
  6. package/assets/{hulrR0PldUxMJm_F.js → 4vS8pASPZSU7QcRZ.js} +4 -4
  7. package/assets/{Bh0PNKlrR4VAqnP8.js → 5B_tapYOcjOv1wGO.js} +35528 -30074
  8. package/assets/{FS9NbEKgQvz5wqvZ.js → 8NrxfSWBHDaEJvhz.js} +2 -2
  9. package/assets/{oxjm7Yr7u7MeaO5P.js → 9MXt8KXdWlbEJNc2.js} +2 -2
  10. package/assets/{CduNzsdbTigxH-ZK.js → AjWB-QdIkr07kToW.js} +189 -189
  11. package/assets/{DvUUArnZwoYOKOuk.js → B16N6VSLY5HPgVkD.js} +2 -2
  12. package/assets/{C0CiMKC3lWK1z9p5.js → B2YEEPHIkNcezk9T.js} +3 -3
  13. package/assets/{CNz3LdmvsOEJoLO9.js → B3MqN3t5naY3moOk.js} +2 -2
  14. package/assets/BBPjYcS8XKQREith.js +199 -0
  15. package/assets/{B4VnJacrzr1x4PHR.js → BCSRsSAEPlwR59H5.js} +5 -5
  16. package/assets/{CMK6tIDVqYYvK4GZ.js → BIUUGUhypimIDg2a.js} +2 -2
  17. package/assets/{iujMYIEPx_v3sdPf.js → BNrpvJZtIL0Ex_wE.js} +996 -995
  18. package/assets/{DA_ar3QKLKtJ9fJD.js → BR66nPIzyzlOcP10.js} +2 -2
  19. package/assets/{CvngwB17_ve4W49b.js → BRLA4pJWiYdpW-69.js} +73 -73
  20. package/assets/{Crt2kLdGIlBHANgg.js → BUAq-ENCmL0XGLIu.js} +2 -2
  21. package/assets/{Bn8D2bebQ2tFfwQt.js → BYqyNLuwXl7GKuzh.js} +43 -41
  22. package/assets/{ZuYfVKlp41IJnrOS.js → BZbxPclVVopktv3l.js} +2 -2
  23. package/assets/{Cf9LpgZz-W5blzy_.js → B_nQLUWaxp-Q1IfV.js} +3 -3
  24. package/assets/{BbcUxIZe3YXywsQR.js → BbDKWV_FQAICqZjP.js} +2 -2
  25. package/assets/{B2udpZ-uIaql3AUh.js → BbXlmp8W_cbr75FN.js} +6 -6
  26. package/assets/{CxjchwpiqxPM1XKd.js → BdMebk9YSA0oxQ_d.js} +70 -70
  27. package/assets/{JO3zH9hupFSV6vj2.js → Bdt9nQs8gDIzu_IG.js} +2 -2
  28. package/assets/{Cf2dcwmmmf13Rywg.js → BiE9M6RctwQ339_7.js} +2 -2
  29. package/assets/{BJxfinOazQqqByc-.js → BiGm1tKvxUh8oWbD.js} +2 -2
  30. package/assets/{DH7sGHzxUqIQkDnd.js → BjDsx_FHl0mShqHX.js} +2 -2
  31. package/assets/{DB-tkqI6wFXDKEfB.js → BlIrJwQGEASCgJdZ.js} +2 -2
  32. package/assets/{DD8HNAUFroTCuD-b.js → BlWfQ5HPEehB_lPz.js} +3288 -2130
  33. package/assets/BpgPKKZwxXklRyo7.js +7 -0
  34. package/assets/{D7oUtYjetuykGhQ5.js → BrtLeTsrulaU6osB.js} +2 -2
  35. package/assets/{LyLlBk--VJD2V-f8.js → BsFWmVYPrLyh5Dre.js} +34 -34
  36. package/assets/{DJiLWtmPR2OQNjzi.js → BtNRIFE92ka4hATo.js} +2 -2
  37. package/assets/{DKLm4nWzynGw1Kr9.js → BuhHuKVWppW4L8AV.js} +2 -2
  38. package/assets/{C4z2IilWTuu2TWXw.js → C-AIgWmHugqMcl9J.js} +3 -3
  39. package/assets/{U1XXGEPuuqIAzYl1.js → C-gN7uBg-MWHRo4g.js} +2 -2
  40. package/assets/{vZZi_iKYHm05gAye.js → C0JSC9gVwR1QxopD.js} +2 -2
  41. package/assets/{Cfhv_Yw_LT8VzAMt.js → C2dG4GHThf9O-IJy.js} +2 -2
  42. package/assets/{Cg51xaLRUkVOMdCZ.js → C3Wibs7QGFZ1FI7W.js} +2 -2
  43. package/assets/{BuUEsifnQALe49uk.js → C75i_5ip7OhGkuiF.js} +2 -2
  44. package/assets/{DDnwKPJSznyfYDZS.js → C95HXhZkkhnUx_aE.js} +3 -3
  45. package/assets/{CWl6oHiJxkNKRixk.js → CAEhAL7-0FG7jdzN.js} +2 -2
  46. package/assets/{D-ffk16w8c5w0mxI.js → CAMrW5ypKhgn105y.js} +2 -2
  47. package/assets/{B-MqXm_7luDLwazY.js → CBPkPTmeaEokFPSI.js} +2 -2
  48. package/assets/{xnhBSX6lAcmBM65y.js → CDqG64rXHp9-2tXr.js} +2 -2
  49. package/assets/{ClNQN3vEg5b5qUDp.js → CFdJvXLSbUrvNera.js} +2435 -2447
  50. package/assets/{PpFbmF0DFeUdpb9I.js → CG8zvnxueimOY7wm.js} +2 -2
  51. package/assets/{BsQZI1vXTRE63Zy-.js → CIqJdIUKSLZkNwHy.js} +345 -235
  52. package/assets/{_fUXIv6nKvgZkhxn.js → CJa8JVvKGVBz8Q7q.js} +3 -3
  53. package/assets/{CwPBmcY6xSP8dNlh.js → CK9h6iDOreaI8GEt.js} +12 -12
  54. package/assets/CL1-ziDI0aAaVbhJ.js +7 -0
  55. package/assets/{C7ONfuYIWRmDu_vs.js → CVRc6jQcH155Z89u.js} +2 -2
  56. package/assets/{B9US2ZrF93KOjmAx.js → CVbRpT7QPHOMgwTx.js} +2 -2
  57. package/assets/CW-ivE6pl3V7vKuT.js +2563 -0
  58. package/assets/{F_f0jJqM5MrXGbwC.js → CX-6eYkcr5y0VmQm.js} +4 -4
  59. package/assets/{BlPubAFi7DY7VrAo.js → CZepo1lDTQp1myg6.js} +2 -2
  60. package/assets/{D8J14MLlN2HRXdXB.js → C_0RM0w6Pw70Bx_Y.js} +2 -2
  61. package/assets/{C2OrZ8LZ-TI6eYG0.js → Ci7-PIIhZwb2mVv5.js} +2 -2
  62. package/assets/{BleMG0hAQgjE8fTa.js → Cl98sBOj9GM2XnFe.js} +3 -3
  63. package/assets/{DwWngYJTgC0KLbih.js → CoIjAX2gECGb3Wxl.js} +2 -2
  64. package/assets/{DcWTBOi_iBFc6U4J.js → Co_y6GfwJTYtOmlt.js} +8 -8
  65. package/assets/{BQMDOjNBMjAx9WiW.js → CrwtgrD7BbXyCkx0.js} +2 -2
  66. package/assets/{CJ5WQnaoCsdr5gf4.js → CsjjeeOHE2624pGt.js} +2 -2
  67. package/assets/Ct5VTtdW77k-WcP_.js +529 -0
  68. package/assets/{DwLZpYUp85UHBE3H.js → CvJkwRgwm80S2bcd.js} +2 -2
  69. package/assets/{fDMpDhXp36CatF-G.js → D-irgQZ2WmkP9dnK.js} +2 -2
  70. package/assets/{BFdeov2e_xUQPEY_.js → D1g6IOzdvInVLV-x.js} +7 -7
  71. package/assets/{Btys7KwtvV3hz2F6.js → D2YdqNWXwSHJMPbA.js} +109 -109
  72. package/assets/{BQbF1RkUH8WyXqSD.js → D3bxrF1Ys2GSVfQH.js} +25 -19
  73. package/assets/{wfVh0olISLRWdv9Q.js → D7iU4kaxzl_PojNt.js} +2 -2
  74. package/assets/{DTfl-4Iboi6TQU5m.js → D7ibkNIu_Pn4TeBD.js} +4 -4
  75. package/assets/DBANZf_eAzaCFdIj.js +4676 -0
  76. package/assets/{DoILAmhKUOlKWRVw.js → DBMZF6PRHCko9K9R.js} +2 -2
  77. package/assets/{BFXeoFUbuc4IKTz9.js → DEIkGoOZ_WeuY0Lj.js} +2 -2
  78. package/assets/{xmTQJJVyCrcq77WR.js → DFAqI-o57Kd_Azlt.js} +2 -2
  79. package/assets/{BtjqpAKczftx91BQ.js → DFn_thWGK0_EZI5k.js} +2 -2
  80. package/assets/{DlBdhv6NHgrNp5Yo.js → DFvs1LVzXKm1N5M2.js} +3 -3
  81. package/assets/{DVchxwp6w6lu2Ihu.js → DJdRl2yX9DP_D8kh.js} +3 -3
  82. package/assets/{BG5kgbDRXMc0re6W.js → DKRa_Oc4XqB3DABB.js} +9 -9
  83. package/assets/{BZPTaa0WjpoUAbgZ.js → DLhlBqwsDnmscAuL.js} +2 -2
  84. package/assets/{BRzp6DEIYUgM3NkN.js → DMhtIFfkX-DZT_e3.js} +4 -4
  85. package/assets/{DpdHDTFOeuzDVNEe.js → DNhfziNrJGdL8BYs.js} +78 -77
  86. package/assets/{jadLBUNBVR9mbZ35.js → DOZ40EyxD3m0gCos.js} +809 -494
  87. package/assets/{SHZe9VOU1prGs1F9.js → DQcus4X_kTKIIyX6.js} +2 -2
  88. package/assets/{C7Z1li2XjWi6bkrp.js → DR9xHYH6v5G0lOqf.js} +4 -4
  89. package/assets/{DsCI_ZYm_jDjXF3J.js → DTLbKr_XIJMwQJmk.js} +52 -52
  90. package/assets/{_d5XJ7dn1CKKYrep.js → DaILIYfy-jPVTXjz.js} +3 -3
  91. package/assets/{S16s2h9qoYVBlVEa.js → Dd8CHUZz7xuYTfp-.js} +1444 -1356
  92. package/assets/{B5lHOOQ_rkP4Mi2r.js → DdrsYdX3bLixdb_9.js} +2 -2
  93. package/assets/DfWWAHOjmhqvN3m_.js +7166 -0
  94. package/assets/{9U9XCqqdn-q3i2fj.js → DfzLOnWTNL_2J90y.js} +2 -2
  95. package/assets/{BTQhJQ3e0hsiousD.js → Dg4JXbd1yPGNZOtL.js} +2 -2
  96. package/assets/Di4ehJD7muvtcrN3.js +169 -0
  97. package/assets/{BbAmA46MhQSu3ZF_.js → DmLbqbAez7Dzwyl7.js} +2 -2
  98. package/assets/{CudNpUD78SrtJIiy.js → Dp-dLoOaBndV2N5i.js} +3 -3
  99. package/assets/DsTi7zHk_Xl37bAD.js +14 -0
  100. package/assets/{Diee6f_qAmcZBd2_.js → DvFwVzuc5YfagNnH.js} +2 -2
  101. package/assets/{D0CHDsemn0S31ltt.js → Dy67BUF2yd8VRPwL.js} +2 -2
  102. package/assets/{LEJp05fjmflKgyqF.js → DzkccbbE6iXMqQDO.js} +451 -447
  103. package/assets/{B7gUyrfLln3TiyKM.js → Gqh12ggLm5KlvN3v.js} +2 -2
  104. package/assets/{BjqQjxBuoXza8oqg.js → JC8UUcu6m23qqrr3.js} +3 -4
  105. package/assets/{ChWpsFGl-BYOnX_A.js → LwFDS0HxPZKiiEnN.js} +2 -2
  106. package/assets/{BeLr36oL3jmeXFFi.js → POdlv6cpSx6ftJxx.js} +2 -2
  107. package/assets/{CMWAsUQ66V8fYrME.js → QVWayvB03YMyTKt3.js} +3 -3
  108. package/assets/{Dz8UUJ7Xc2oN5PBG.js → SB2aKOIVln0EkgXR.js} +2 -2
  109. package/assets/SaCo3me4_hw2b1L4.js +2039 -0
  110. package/assets/{CecTe22WURiXbVdY.js → TNQaiw20sEAEUiK5.js} +386 -372
  111. package/assets/{jPUOH4FHF4b-rapv.js → W2FU69Pfo4chpqtk.js} +2 -2
  112. package/assets/{CXHslDxkWCuEcCSQ.js → YXC__Myl-BuIFW6s.js} +2 -2
  113. package/assets/{DPCKMM7sgWbrtB8z.js → Z01wJImjl6lBMpf4.js} +2 -2
  114. package/assets/{C97xDe_wBbLZh_uW.js → h6EQSu5n2vTsu2yd.js} +2 -2
  115. package/assets/{FzNG48GE_wso6RII.js → iULnLPcNKVpz00r7.js} +2 -2
  116. package/assets/{DEW2GxfGYqVFvrfg.js → iqQWGoJaPha0_8lU.js} +2 -2
  117. package/assets/{BrcQmHcE7Hcr1erJ.js → nDmE2I07HvkpRdR0.js} +2 -2
  118. package/assets/{Bg95xYj5siqhHVEz.js → nmB0nnkFQf5NWo0i.js} +3 -3
  119. package/assets/{BCy1zP97fsiIcvj6.js → pQUJKbHGetb7dcOr.js} +2 -2
  120. package/assets/{B2Ek-DWpZMGJ0V1Z.js → rfwqMukKbJBeJBuC.js} +3 -3
  121. package/assets/{By-7OWXShMlFFejV.js → soSlr334Fv1j5t2m.js} +2 -2
  122. package/index.js +2010 -1944
  123. package/lib.js +2 -2
  124. package/licenses/dependencies.txt +259 -194
  125. package/package.json +4 -9
  126. package/resources/locales/@sheetxl/sdk/de/model.msg.json +82 -1
  127. package/resources/locales/@sheetxl/sdk/en/model.msg.json +80 -1
  128. package/screenshot-page/assets/{CSUd8n1H0VBfREnk.js → -N4OYIMgf6f5vgNy.js} +1 -1
  129. package/screenshot-page/assets/{B4PbXdzBe9BsoZ0e.js → B7eQ3rE-7Vayb_4O.js} +1 -1
  130. package/screenshot-page/assets/B8i4Sr2kMQAXp0rb.js +4 -0
  131. package/screenshot-page/assets/{DQWHkaQeNXft9j8b.js → B8qybUclSjEYP5FJ.js} +2 -2
  132. package/screenshot-page/assets/BIHbD4jMsk3NetOd.js +1 -0
  133. package/screenshot-page/assets/BIrVK5hdDCUYmxGO.js +1 -0
  134. package/screenshot-page/assets/{l32n8O_A78Qqduv3.js → BJ2r2WfEL3SgkBAX.js} +1 -1
  135. package/screenshot-page/assets/BJviQwDXR5L6l1DA.js +1 -0
  136. package/screenshot-page/assets/BM78thqEW6HwXFAK.js +13 -0
  137. package/screenshot-page/assets/{BcOdl17EeFSxnAiq.js → BMf827t1Ul65MHd5.js} +1 -1
  138. package/screenshot-page/assets/BMwQInar0xVS5FRu.js +1 -0
  139. package/screenshot-page/assets/{BUjI304IvdJnFXH3.js → BU5S8KEzPmIA_Flm.js} +1 -1
  140. package/screenshot-page/assets/{D6Jpaz2YkhOfzxDB.js → BYQZ8o8k3-MDoNat.js} +1 -1
  141. package/screenshot-page/assets/{CZf9s6otzzoaBlSs.js → BftXEPOuf5Uwxpud.js} +1 -1
  142. package/screenshot-page/assets/Bir0SSOHX0w2yo8h.js +1 -0
  143. package/screenshot-page/assets/{CykecBozGGFl26KA.js → Btgo0VFTT0JxuaP3.js} +74 -68
  144. package/screenshot-page/assets/C2H2lX8eyKpxpP6M.js +2 -0
  145. package/screenshot-page/assets/{B-KIwD5F_5S-NsPg.js → C71ZZMVLfHdPl441.js} +1 -1
  146. package/screenshot-page/assets/CFfgJlXaIS8QMx5O.js +1 -0
  147. package/screenshot-page/assets/{DGXDfjkGZjMRAXPg.js → CN8u05DjKwNHbUHN.js} +1 -1
  148. package/screenshot-page/assets/CQFj5AGXfIA9z9zI.js +1 -0
  149. package/screenshot-page/assets/{gG0AFZ45VxS_moMw.js → CRsTnamLrPN5-Dsi.js} +1 -1
  150. package/screenshot-page/assets/CYfkL98Zu43S8-50.js +42 -0
  151. package/screenshot-page/assets/{DXQLzGmxoyN3kfQi.js → CZa1rha3RnQUWyOk.js} +7 -7
  152. package/screenshot-page/assets/{CpbohdgEaEsVDi9J.js → C_vPl50T1L5HWnhv.js} +1 -1
  153. package/screenshot-page/assets/{CbUDukmvDZmVfhJH.js → CfkssmHURDicfYvR.js} +1 -1
  154. package/screenshot-page/assets/{Bj-vfAT28PK-tWWa.js → CguXw0IcKNPbmAbj.js} +2 -2
  155. package/screenshot-page/assets/{DmbuCapSSCYIa3yk.js → ClzJdxlUDDtBYjH8.js} +1 -1
  156. package/screenshot-page/assets/{BTboCICZ-951XWsi.js → CqyMYduWKFvmMs_Z.js} +1 -1
  157. package/screenshot-page/assets/CzsoLbEIUVK5ia1C.js +1 -0
  158. package/screenshot-page/assets/D2IHCJ1QWDKwmhge.js +1 -0
  159. package/screenshot-page/assets/D6CzedWHXTesD55R.js +1 -0
  160. package/screenshot-page/assets/D7biuwkvm3zAwsBa.js +39 -0
  161. package/screenshot-page/assets/D8s3sJnhFxbI3Dqn.js +1 -0
  162. package/screenshot-page/assets/{hp_-JA1DMK4Yoztn.js → DDkL9PZPXAggW2Yr.js} +19 -19
  163. package/screenshot-page/assets/DEpn6VGd30cHEJOS.js +1 -0
  164. package/screenshot-page/assets/{CIged53b3hHKxa-o.js → DLFFFQjTi5Ji1940.js} +1 -1
  165. package/screenshot-page/assets/DMxrNtfw275en7pm.js +1 -0
  166. package/screenshot-page/assets/{CqR3hGrC956TkCMj.js → DRncpwDkZZX8rL9S.js} +1 -1
  167. package/screenshot-page/assets/DTrnAtpccj55fGg5.js +1 -0
  168. package/screenshot-page/assets/D_kJ3WunvjIINcHC.js +1 -0
  169. package/screenshot-page/assets/{BFaiQZKle44Rhyou.js → D_rtIYQ7FDC2CoEn.js} +1 -1
  170. package/screenshot-page/assets/{Bf7xq8PyF4ohjMzP.js → Db6bZVJ-184DJIoe.js} +2 -2
  171. package/screenshot-page/assets/{DyLWQxXXTw5uwPVy.js → DeyRZ5rprDbRbuf4.js} +1 -1
  172. package/screenshot-page/assets/{D47ePD4x1lVazNdl.js → DgtqX4DiBgkepVZZ.js} +1 -1
  173. package/screenshot-page/assets/DhB6GjSJIeTmIODk.js +1 -0
  174. package/screenshot-page/assets/Dn5PwRw7rrTKNnql.js +586 -0
  175. package/screenshot-page/assets/{TfhknTx8vxQkw4zV.js → Dq7wGcTrNIshovlT.js} +2 -2
  176. package/screenshot-page/assets/{BUGXf2DEBog16Slb.js → DqXO_Zw1Cp7rAQ04.js} +2 -2
  177. package/screenshot-page/assets/{21oAESJyBGXeHegm.js → DtihumgXQ7ETaN0A.js} +2 -2
  178. package/screenshot-page/assets/DuYb_otrRZZDq6-f.js +2 -0
  179. package/screenshot-page/assets/DyiVrm8mEnEaoZHa.js +3 -0
  180. package/screenshot-page/assets/{BHqg55S-4_OoAu3P.js → LYyM_ig973jLdOU0.js} +2 -2
  181. package/screenshot-page/assets/TilS2JSBGVkd1za3.js +3 -0
  182. package/screenshot-page/assets/Tph2vYqw17-NBCtd.js +1 -0
  183. package/screenshot-page/assets/UKFgEuwI1UMhPqKF.js +2 -0
  184. package/screenshot-page/assets/XgsioU5Px1T5gKAY.js +1 -0
  185. package/screenshot-page/assets/cTMKPkmZF8FWQaMn.js +1 -0
  186. package/screenshot-page/assets/hlxJ87-H830aSZBQ.js +1 -0
  187. package/screenshot-page/assets/{DDQWM8rNYCYzKa9R.js → lgeNUp9cU20IAotv.js} +1 -1
  188. package/screenshot-page/assets/nM1r2xslndIMKlI2.js +2 -0
  189. package/screenshot-page/assets/{BSdFVGZNhU6YHbMI.js → rOzyaU7hqchMbhRL.js} +1 -1
  190. package/screenshot-page/index.html +12 -12
  191. package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +82 -1
  192. package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +80 -1
  193. package/types/scripting-api.json +9967 -9497
  194. package/types/scripting-enums.json +27 -0
  195. package/types/scripting.d.ts +2282 -166
  196. package/assets/BBb_3gEGzmEzbTIk.js +0 -359
  197. package/assets/BSxTn2BhkEEeF9x_.js +0 -2346
  198. package/assets/CWVWdbY1B1-WLl9k.js +0 -199
  199. package/assets/CZTSZL3T_f-vSXqM.js +0 -7
  200. package/assets/DaoSWy3EFlqpZaLr.js +0 -4437
  201. package/assets/Dht2mcOSyYlPY32b.js +0 -14
  202. package/assets/DkibD_CEVePaoj_y.js +0 -7
  203. package/assets/jiEe5eKV3BFPBWfi.js +0 -6294
  204. package/screenshot-page/assets/0MTaPYjKud2Q9QG9.js +0 -1
  205. package/screenshot-page/assets/B2MJPcMcsuv6FekC.js +0 -1
  206. package/screenshot-page/assets/BQfe-XTIOGeUnD9B.js +0 -1
  207. package/screenshot-page/assets/BTMW3ukmc44U2fy7.js +0 -1
  208. package/screenshot-page/assets/B_W2QroTKADz3ABp.js +0 -2
  209. package/screenshot-page/assets/BksaQEoZr5OWq-_d.js +0 -3
  210. package/screenshot-page/assets/BnoVwUBEor8NgQNs.js +0 -4
  211. package/screenshot-page/assets/BzQ5GyiXq8gTz-H-.js +0 -1
  212. package/screenshot-page/assets/C2Wh2h27c7FUb8Yk.js +0 -1
  213. package/screenshot-page/assets/C81mK8aZKZAAS-AB.js +0 -1
  214. package/screenshot-page/assets/Ca6nxdhEuLLty3d7.js +0 -2
  215. package/screenshot-page/assets/CwqNb7JYzC03lCj0.js +0 -1
  216. package/screenshot-page/assets/CzhH7lTYQrYGHct6.js +0 -1
  217. package/screenshot-page/assets/D66vSE1ConAuENmB.js +0 -586
  218. package/screenshot-page/assets/DCVUZ_ayOXFwV2d_.js +0 -3
  219. package/screenshot-page/assets/DFE-fKq5NV7_O8V6.js +0 -1
  220. package/screenshot-page/assets/DK_QSosKV62NDcuT.js +0 -42
  221. package/screenshot-page/assets/DTFRGj188QuLKEXw.js +0 -1
  222. package/screenshot-page/assets/DXWWyJlMSWgDFxs1.js +0 -10
  223. package/screenshot-page/assets/DZDRRw-62D6Zw7qs.js +0 -1
  224. package/screenshot-page/assets/DeAKjatTVaZ0u_FY.js +0 -1
  225. package/screenshot-page/assets/Dsx0NUmGIxS7SvZ8.js +0 -1
  226. package/screenshot-page/assets/IRtoU5oVgBWu9rnK.js +0 -2
  227. package/screenshot-page/assets/Q5EKmzoJZCE81Om-.js +0 -2
  228. package/screenshot-page/assets/VvqAh6BWzaD5OUPF.js +0 -1
  229. package/screenshot-page/assets/fGlPAximvsxzPzGA.js +0 -1
  230. package/screenshot-page/assets/rPOkVKdPbFpTG6AY.js +0 -1
  231. package/screenshot-page/assets/sHBomL5R4-_px8rD.js +0 -1
  232. package/screenshot-page/assets/skRJ2qjA7kcmnOsh.js +0 -39
@@ -1,4437 +0,0 @@
1
- /**
2
- * @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.15
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { r as t } from "./BCy1zP97fsiIcvj6.js";
8
- import { Q as e, Z as s, h as o, ht as r, ot as n, tt as i, xt as a } from "./BQMDOjNBMjAx9WiW.js";
9
- import { U as l, yt as c } from "./iujMYIEPx_v3sdPf.js";
10
- import { d as h, m as u, o as d } from "./BQbF1RkUH8WyXqSD.js";
11
- import { $r as p, Gt as f, Vt as g, Wr as m, an as b, ca as y, d as x, lt as v, vi as w } from "./Bh0PNKlrR4VAqnP8.js";
12
- import { O as T, P as S, g as C, n as A } from "./jadLBUNBVR9mbZ35.js";
13
- import { F as k, _t as E, ft as I, vt as P } from "./CecTe22WURiXbVdY.js";
14
- import { $ as O, $t as D, An as _, B as N, Bt as $, C as V, Cn as R, Ct as L, En as M, Et as j, Gn as B, Gt as F, H, In as W, It as z, Jt as X, K as q, Kt as U, Mn as G, Mt as K, On as Z, Ot as J, P as Q, Pt as Y, Q as tt, R as et, Rt as st, St as ot, T as rt, Tn as nt, Un as it, Ut as at, V as lt, Vn as ct, Vt as ht, X as ut, Y as dt, Yt as pt, Z as ft, Zt as gt, _ as mt, _t as bt, at as yt, bn as xt, bt as vt, d as wt, et as Tt, f as St, g as Ct, gn as At, gt as kt, hn as Et, in as It, j as Pt, mn as Ot, nt as Dt, on as _t, ot as Nt, p as $t, pt as Vt, q as Rt, qt as Lt, un as Mt, vn as jt, vt as Bt, wt as Ft, xn as Ht, z as Wt, zn as zt, zt as Xt } from "./DD8HNAUFroTCuD-b.js";
15
- var qt = {
16
- ascending: "ascending",
17
- descending: "descending",
18
- natural: "dataSource"
19
- };
20
- function Ut(t, e) {
21
- if (!e) return null;
22
- for (let s = 0; s < t.length; s++) if (void 0 !== t[s].id && String(t[s].id) === e) return t[s];
23
- const s = Number(e);
24
- return Number.isInteger(s) && s >= 1 && s <= t.length ? t[s - 1] : null;
25
- }
26
- function Gt(t, e, s) {
27
- const o = {
28
- ...e,
29
- source: s
30
- };
31
- if (void 0 !== t.caption && t.caption !== t.sourceName && (o.caption = t.caption), !1 === t.showCaption && (o.hiddenCaption = !0), void 0 !== t.columnCount && t.columnCount > 1 && (o.columnCount = t.columnCount), void 0 !== t.rowHeight) {
32
- const e = Math.round(t.rowHeight / 9525);
33
- e > 0 && 27 !== e && (o.rowHeight = e);
34
- }
35
- t.style && "SlicerStyleLight1" !== t.style && (o.style = t.style);
36
- const r = t.sortOrder ? qt[t.sortOrder] : void 0;
37
- return r && "ascending" !== r && (o.sortOrder = r), t.crossFilter && "showItemsWithDataAtTop" !== t.crossFilter && (o.crossFilter = t.crossFilter), t.lockedPosition && (o.lockedPosition = !0), !1 === t.customListSort && (o.disabledCustomListSort = !0), t.cacheName && (o.cacheName = t.cacheName), t.startItem && (o.startItem = t.startItem), void 0 !== t.level && (o.level = t.level), t.uid && (o.uid = t.uid), o;
38
- }
39
- var Kt = (t, e) => {
40
- const s = [], o = t?.childNodes, r = o?.length ?? 0;
41
- for (let t = 0; t < r; t++) {
42
- const r = o.item(t);
43
- 1 !== r.nodeType || e && r.localName !== e || s.push(r);
44
- }
45
- return s;
46
- }, Zt = (t) => Kt(t, "k").map((t) => [t.getAttribute("n") ?? "", t.getAttribute("t") || null]), Jt = (t) => Kt(t, "v").map((t) => ({
47
- t: t.getAttribute("t") || null,
48
- text: t.textContent ?? ""
49
- })), Qt = (t) => {
50
- const e = /* @__PURE__ */ new Map();
51
- for (const s of Kt(t, "key")) {
52
- const t = /* @__PURE__ */ new Map();
53
- for (const e of Kt(s, "flag")) t.set(e.getAttribute("name") ?? "", e.getAttribute("value") ?? "");
54
- e.set(s.getAttribute("name") ?? "", t);
55
- }
56
- return e;
57
- }, Yt = /* @__PURE__ */ new Uint8Array(0), te = class t {
58
- constructor(t, e, s) {
59
- this.buffers = /* @__PURE__ */ new Map(), this.zip = t, this.entries = e, this.rawBuffer = s;
60
- }
61
- static normalize(t) {
62
- return t.startsWith("/") ? t.slice(1) : t;
63
- }
64
- static async create(e) {
65
- const s = e instanceof Blob ? Yt : e instanceof Uint8Array ? e : new Uint8Array(e), o = e instanceof Blob ? new I(e) : new E(s), r = new k(o), n = /* @__PURE__ */ new Map();
66
- for (const t of await r.getEntries()) t.directory || n.set(t.filename, t);
67
- return new t(r, n, s);
68
- }
69
- getNames() {
70
- return [...this.entries.keys()];
71
- }
72
- has(e) {
73
- return this.entries.has(t.normalize(e));
74
- }
75
- uncompressedSize(e) {
76
- return this.entries.get(t.normalize(e))?.uncompressedSize ?? 0;
77
- }
78
- async getBuffer(e) {
79
- const s = t.normalize(e), o = this.buffers.get(s);
80
- if (o) return o;
81
- const r = this.entries.get(s);
82
- if (!r) return null;
83
- const n = await r.getData(new P());
84
- return this.buffers.set(s, n), n;
85
- }
86
- async prefetch(t) {
87
- const e = [];
88
- for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new P()).then((t) => {
89
- this.buffers.set(s, t);
90
- }));
91
- await Promise.all(e);
92
- }
93
- getEntry(e) {
94
- return this.buffers.get(t.normalize(e)) ?? null;
95
- }
96
- async getTextStream(e, s) {
97
- const o = this.entries.get(t.normalize(e));
98
- if (!o) return null;
99
- const r = new TransformStream();
100
- o.getData(r.writable).catch(() => {});
101
- const n = r.readable.getReader(), i = new TextDecoder("utf-8");
102
- return new ReadableStream({ async pull(t) {
103
- const { value: e, done: o } = await n.read();
104
- if (o) {
105
- const e = i.decode();
106
- e && t.enqueue(e), t.close();
107
- return;
108
- }
109
- s?.(e.byteLength);
110
- const r = i.decode(e, { stream: !0 });
111
- r && t.enqueue(r);
112
- } }).getReader();
113
- }
114
- getRawEntry(e) {
115
- const s = this.entries.get(t.normalize(e));
116
- if (!s || s.encrypted || void 0 === s.crc32) return null;
117
- const o = s.offset;
118
- if (o + 30 > this.rawBuffer.byteLength) return null;
119
- const r = new DataView(this.rawBuffer.buffer, this.rawBuffer.byteOffset + o, 30);
120
- if (67324752 !== r.getUint32(0, !0)) return null;
121
- const n = o + 30 + r.getUint16(26, !0) + r.getUint16(28, !0), i = n + s.compressedSize;
122
- return i > this.rawBuffer.byteLength ? null : {
123
- data: this.rawBuffer.subarray(n, i),
124
- compressionMethod: s.compressionMethod,
125
- signature: s.crc32
126
- };
127
- }
128
- async close() {
129
- await this.zip.close();
130
- }
131
- }, ee = class {
132
- constructor(t) {
133
- this._sink = t, this._samples = [], this._t0 = se(), this._tPrev = this._t0, this._heapPrev = oe();
134
- }
135
- mark(t) {
136
- const e = se(), s = oe(), o = {
137
- label: t,
138
- tMs: e - this._t0,
139
- dtMs: e - this._tPrev,
140
- heapBytes: s,
141
- dHeapBytes: void 0 !== s && void 0 !== this._heapPrev ? s - this._heapPrev : void 0,
142
- rssBytes: re()
143
- };
144
- this._tPrev = e, this._heapPrev = s, this._samples.push(o), this._sink?.(o);
145
- }
146
- samples() {
147
- return this._samples;
148
- }
149
- toTable() {
150
- return this._samples.map((t) => ({
151
- phase: t.label,
152
- tMs: Math.round(t.tMs),
153
- dtMs: Math.round(t.dtMs),
154
- heapMB: void 0 !== t.heapBytes ? ne(t.heapBytes / 1048576) : "—",
155
- dHeapMB: void 0 !== t.dHeapBytes ? ne(t.dHeapBytes / 1048576) : "—",
156
- rssMB: void 0 !== t.rssBytes ? ne(t.rssBytes / 1048576) : "—"
157
- }));
158
- }
159
- }, se = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
160
- function oe() {
161
- const t = "object" == typeof performance ? performance.memory : void 0;
162
- if (t && "number" == typeof t.usedJSHeapSize) return t.usedJSHeapSize;
163
- const e = globalThis.process;
164
- return "object" == typeof e && "function" == typeof e.memoryUsage ? e.memoryUsage().heapUsed : void 0;
165
- }
166
- function re() {
167
- const t = globalThis.process;
168
- if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
169
- }
170
- function ne(t) {
171
- return Math.round(10 * t) / 10;
172
- }
173
- var ie = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", ae = `-${ie}.0-9·̀-ͯ‿-⁀`, le = (new RegExp(`^[${ie}]$`, "u"), new RegExp(`^[${ae}]$`, "u"), new RegExp(`^[${ie}][${ae}]*$`, "u")), ce = (new RegExp(`^[${ae}]+$`, "u"), [
174
- 32,
175
- 10,
176
- 13,
177
- 9
178
- ]);
179
- function he(t) {
180
- return t >= 65 && t <= 90 || t >= 97 && t <= 122 || 58 === t || 95 === t || 8204 === t || 8205 === t || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
181
- }
182
- var ue = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", de = `-${ue}.0-9·̀-ͯ‿-⁀`;
183
- new RegExp(`^[${ue}]$`, "u"), new RegExp(`^[${de}]$`, "u"), new RegExp(`^[${ue}][${de}]*$`, "u"), new RegExp(`^[${de}]+$`, "u");
184
- var pe = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", fe = `-${pe}.0-9·̀-ͯ‿-⁀`, ge = (new RegExp(`^[${pe}]$`, "u"), new RegExp(`^[${fe}]$`, "u"), new RegExp(`^[${pe}][${fe}]*$`, "u"));
185
- function me(t) {
186
- return t >= 65 && t <= 90 || 95 === t || t >= 97 && t <= 122 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
187
- }
188
- var be, ye = function(t) {
189
- return 32 === t || 10 === t || 13 === t || 9 === t;
190
- }, xe = function(t) {
191
- return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
192
- }, ve = he, we = function(t) {
193
- return he(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
194
- }, Te = ce, Se = le, Ce = function(t) {
195
- return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
196
- }, Ae = me, ke = function(t) {
197
- return me(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
198
- }, Ee = ge, Ie = "http://www.w3.org/XML/1998/namespace", Pe = "http://www.w3.org/2000/xmlns/", Oe = {
199
- __proto__: null,
200
- xml: Ie,
201
- xmlns: Pe
202
- }, De = {
203
- __proto__: null,
204
- amp: "&",
205
- gt: ">",
206
- lt: "<",
207
- quot: "\"",
208
- apos: "'"
209
- }, _e = -1, Ne = -2, $e = 13, Ve = 33, Re = 10, Le = 60, Me = 61, je = 62, Be = 63, Fe = 93, He = (t) => 34 === t || 39 === t, We = [34, 39], ze = [
210
- ...We,
211
- 91,
212
- je
213
- ], Xe = [
214
- ...We,
215
- Le,
216
- Fe
217
- ], qe = [
218
- Me,
219
- Be,
220
- ...Te
221
- ], Ue = [
222
- ...Te,
223
- je,
224
- 38,
225
- Le
226
- ];
227
- function Ge(t, e, s) {
228
- switch (e) {
229
- case "xml":
230
- s !== Ie && t.fail(`xml prefix must be bound to ${Ie}.`);
231
- break;
232
- case "xmlns": s !== Pe && t.fail(`xmlns prefix must be bound to ${Pe}.`);
233
- }
234
- switch (s) {
235
- case Pe:
236
- t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Pe}.`);
237
- break;
238
- case Ie: switch (e) {
239
- case "xml": break;
240
- case "":
241
- t.fail(`the default namespace may not be set to ${s}.`);
242
- break;
243
- default: t.fail("may not assign the xml namespace to another prefix.");
244
- }
245
- }
246
- }
247
- var Ke = (t) => Ee.test(t), Ze = (t) => Se.test(t), Je = {
248
- xmldecl: "xmlDeclHandler",
249
- text: "textHandler",
250
- processinginstruction: "piHandler",
251
- doctype: "doctypeHandler",
252
- comment: "commentHandler",
253
- opentagstart: "openTagStartHandler",
254
- attribute: "attributeHandler",
255
- opentag: "openTagHandler",
256
- closetag: "closeTagHandler",
257
- cdata: "cdataHandler",
258
- error: "errorHandler",
259
- end: "endHandler",
260
- ready: "readyHandler"
261
- }, Qe = class {
262
- get closed() {
263
- return this._closed;
264
- }
265
- constructor(t) {
266
- this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
267
- const e = this.xmlnsOpt = !!this.opt.xmlns;
268
- if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, e) {
269
- this.nameStartCheck = Ae, this.nameCheck = ke, this.isName = Ke, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
270
- __proto__: null,
271
- ...Oe
272
- };
273
- const t = this.opt.additionalNamespaces;
274
- null != t && (function(t, e) {
275
- for (const s of Object.keys(e)) Ge(t, s, e[s]);
276
- }(this, t), Object.assign(this.ns, t));
277
- } else this.nameStartCheck = ve, this.nameCheck = we, this.isName = Ze, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
278
- this.stateTable = [
279
- this.sBegin,
280
- this.sBeginWhitespace,
281
- this.sDoctype,
282
- this.sDoctypeQuote,
283
- this.sDTD,
284
- this.sDTDQuoted,
285
- this.sDTDOpenWaka,
286
- this.sDTDOpenWakaBang,
287
- this.sDTDComment,
288
- this.sDTDCommentEnding,
289
- this.sDTDCommentEnded,
290
- this.sDTDPI,
291
- this.sDTDPIEnding,
292
- this.sText,
293
- this.sEntity,
294
- this.sOpenWaka,
295
- this.sOpenWakaBang,
296
- this.sComment,
297
- this.sCommentEnding,
298
- this.sCommentEnded,
299
- this.sCData,
300
- this.sCDataEnding,
301
- this.sCDataEnding2,
302
- this.sPIFirstChar,
303
- this.sPIRest,
304
- this.sPIBody,
305
- this.sPIEnding,
306
- this.sXMLDeclNameStart,
307
- this.sXMLDeclName,
308
- this.sXMLDeclEq,
309
- this.sXMLDeclValueStart,
310
- this.sXMLDeclValue,
311
- this.sXMLDeclSeparator,
312
- this.sXMLDeclEnding,
313
- this.sOpenTag,
314
- this.sOpenTagSlash,
315
- this.sAttrib,
316
- this.sAttribName,
317
- this.sAttribNameSawWhite,
318
- this.sAttribValue,
319
- this.sAttribValueQuoted,
320
- this.sAttribValueClosed,
321
- this.sAttribValueUnquoted,
322
- this.sCloseTag,
323
- this.sCloseTagSawWhite
324
- ], this._init();
325
- }
326
- _init() {
327
- 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 = [];
328
- const { fragmentOpt: t } = this;
329
- this.state = t ? $e : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
330
- let { defaultXMLVersion: e } = this.opt;
331
- if (void 0 === e) {
332
- if (!0 === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
333
- e = "1.0";
334
- }
335
- this.setXMLVersion(e), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = {
336
- version: void 0,
337
- encoding: void 0,
338
- standalone: void 0
339
- }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(De), this.readyHandler?.();
340
- }
341
- get position() {
342
- return this.chunkPosition + this.i;
343
- }
344
- get columnIndex() {
345
- return this.position - this.positionAtNewLine;
346
- }
347
- on(t, e) {
348
- this[Je[t]] = e;
349
- }
350
- off(t) {
351
- this[Je[t]] = void 0;
352
- }
353
- makeError(t) {
354
- let e = this.fileName ?? "";
355
- return this.trackPosition && (e.length > 0 && (e += ":"), e += `${this.line}:${this.column}`), e.length > 0 && (e += ": "), new Error(e + t);
356
- }
357
- fail(t) {
358
- const e = this.makeError(t), s = this.errorHandler;
359
- if (void 0 === s) throw e;
360
- return s(e), this;
361
- }
362
- write(t) {
363
- if (this.closed) return this.fail("cannot write after close.");
364
- let e = !1;
365
- null === t ? (e = !0, t = "") : "object" == typeof t && (t = t.toString()), void 0 !== this.carriedFromPrevious && (t = `${this.carriedFromPrevious}${t}`, this.carriedFromPrevious = void 0);
366
- let s = t.length;
367
- const o = t.charCodeAt(s - 1);
368
- !e && (13 === o || o >= 55296 && o <= 56319) && (this.carriedFromPrevious = t[s - 1], s--, t = t.slice(0, s));
369
- const { stateTable: r } = this;
370
- for (this.chunk = t, this.i = 0; this.i < s;) r[this.state].call(this);
371
- return this.chunkPosition += s, e ? this.end() : this;
372
- }
373
- close() {
374
- return this.write(null);
375
- }
376
- getCode10() {
377
- const t = this.chunk, e = this.i;
378
- if (this.prevI = e, this.i++, e >= t.length) return _e;
379
- const s = t.charCodeAt(e);
380
- if (this.column++, s < 55296) {
381
- if (s >= 32 || 9 === s) return s;
382
- switch (s) {
383
- case Re: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Re;
384
- case 13: return t.charCodeAt(e + 1) === Re && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, Ne;
385
- default: return this.fail("disallowed character."), s;
386
- }
387
- }
388
- if (s > 56319) return s >= 57344 && s <= 65533 || this.fail("disallowed character."), s;
389
- const o = 65536 + 1024 * (s - 55296) + (t.charCodeAt(e + 1) - 56320);
390
- return this.i = e + 2, o > 1114111 && this.fail("disallowed character."), o;
391
- }
392
- getCode11() {
393
- const { chunk: t, i: e } = this;
394
- if (this.prevI = e, this.i = e + 1, e >= t.length) return _e;
395
- const s = t.charCodeAt(e);
396
- if (this.column++, s < 55296) {
397
- if (s > 31 && s < 127 || s > 159 && 8232 !== s || 9 === s) return s;
398
- switch (s) {
399
- case Re: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Re;
400
- case 13: {
401
- const s = t.charCodeAt(e + 1);
402
- s !== Re && 133 !== s || (this.i = e + 2);
403
- }
404
- case 133:
405
- case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Ne;
406
- default: return this.fail("disallowed character."), s;
407
- }
408
- }
409
- if (s > 56319) return s >= 57344 && s <= 65533 || this.fail("disallowed character."), s;
410
- const o = 65536 + 1024 * (s - 55296) + (t.charCodeAt(e + 1) - 56320);
411
- return this.i = e + 2, o > 1114111 && this.fail("disallowed character."), o;
412
- }
413
- getCodeNorm() {
414
- const t = this.getCode();
415
- return t === Ne ? Re : t;
416
- }
417
- unGet() {
418
- this.i = this.prevI, this.column--;
419
- }
420
- captureTo(t) {
421
- let { i: e } = this;
422
- const { chunk: s } = this;
423
- for (;;) {
424
- const o = this.getCode(), r = o === Ne, n = r ? Re : o;
425
- if (n === _e || t.includes(n)) return this.text += s.slice(e, this.prevI), n;
426
- r && (this.text += `${s.slice(e, this.prevI)}\n`, e = this.i);
427
- }
428
- }
429
- captureToChar(t) {
430
- let { i: e } = this;
431
- const { chunk: s } = this;
432
- for (;;) {
433
- let o = this.getCode();
434
- switch (o) {
435
- case Ne:
436
- this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = Re;
437
- break;
438
- case _e: return this.text += s.slice(e), !1;
439
- }
440
- if (o === t) return this.text += s.slice(e, this.prevI), !0;
441
- }
442
- }
443
- captureNameChars() {
444
- const { chunk: t, i: e } = this;
445
- for (;;) {
446
- const s = this.getCode();
447
- if (s === _e) return this.name += t.slice(e), _e;
448
- if (!we(s)) return this.name += t.slice(e, this.prevI), s === Ne ? Re : s;
449
- }
450
- }
451
- skipSpaces() {
452
- for (;;) {
453
- const t = this.getCodeNorm();
454
- if (t === _e || !ye(t)) return t;
455
- }
456
- }
457
- setXMLVersion(t) {
458
- this.currentXMLVersion = t, "1.0" === t ? (this.isChar = xe, this.getCode = this.getCode10) : (this.isChar = Ce, this.getCode = this.getCode11);
459
- }
460
- sBegin() {
461
- 65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
462
- }
463
- sBeginWhitespace() {
464
- const t = this.i, e = this.skipSpaces();
465
- switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
466
- case Le:
467
- if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
468
- break;
469
- case _e: break;
470
- default: this.unGet(), this.state = $e, this.xmlDeclPossible = !1;
471
- }
472
- }
473
- sDoctype() {
474
- const t = this.captureTo(ze);
475
- switch (t) {
476
- case je:
477
- this.doctypeHandler?.(this.text), this.text = "", this.state = $e, this.doctype = !0;
478
- break;
479
- case _e: break;
480
- default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : He(t) && (this.state = 3, this.q = t);
481
- }
482
- }
483
- sDoctypeQuote() {
484
- const t = this.q;
485
- this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
486
- }
487
- sDTD() {
488
- const t = this.captureTo(Xe);
489
- t !== _e && (this.text += String.fromCodePoint(t), t === Fe ? this.state = 2 : t === Le ? this.state = 6 : He(t) && (this.state = 5, this.q = t));
490
- }
491
- sDTDQuoted() {
492
- const t = this.q;
493
- this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.state = 4, this.q = null);
494
- }
495
- sDTDOpenWaka() {
496
- const t = this.getCodeNorm();
497
- switch (this.text += String.fromCodePoint(t), t) {
498
- case 33:
499
- this.state = 7, this.openWakaBang = "";
500
- break;
501
- case Be:
502
- this.state = 11;
503
- break;
504
- default: this.state = 4;
505
- }
506
- }
507
- sDTDOpenWakaBang() {
508
- const t = String.fromCodePoint(this.getCodeNorm()), e = this.openWakaBang += t;
509
- this.text += t, "-" !== e && (this.state = "--" === e ? 8 : 4, this.openWakaBang = "");
510
- }
511
- sDTDComment() {
512
- this.captureToChar(45) && (this.text += "-", this.state = 9);
513
- }
514
- sDTDCommentEnding() {
515
- const t = this.getCodeNorm();
516
- this.text += String.fromCodePoint(t), this.state = 45 === t ? 10 : 8;
517
- }
518
- sDTDCommentEnded() {
519
- const t = this.getCodeNorm();
520
- this.text += String.fromCodePoint(t), t === je ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
521
- }
522
- sDTDPI() {
523
- this.captureToChar(Be) && (this.text += "?", this.state = 12);
524
- }
525
- sDTDPIEnding() {
526
- const t = this.getCodeNorm();
527
- this.text += String.fromCodePoint(t), t === je && (this.state = 4);
528
- }
529
- sText() {
530
- 0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
531
- }
532
- sEntity() {
533
- let { i: t } = this;
534
- const { chunk: e } = this;
535
- t: for (;;) switch (this.getCode()) {
536
- case Ne:
537
- this.entity += `${e.slice(t, this.prevI)}\n`, t = this.i;
538
- break;
539
- case 59: {
540
- const { entityReturnState: s } = this, o = this.entity + e.slice(t, this.prevI);
541
- let r;
542
- this.state = s, "" === o ? (this.fail("empty entity name."), r = "&;") : (r = this.parseEntity(o), this.entity = ""), s === $e && void 0 === this.textHandler || (this.text += r);
543
- break t;
544
- }
545
- case _e:
546
- this.entity += e.slice(t);
547
- break t;
548
- }
549
- }
550
- sOpenWaka() {
551
- const t = this.getCode();
552
- if (ve(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
553
- else switch (t) {
554
- case 47:
555
- this.state = 43, this.xmlDeclPossible = !1;
556
- break;
557
- case 33:
558
- this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
559
- break;
560
- case Be:
561
- this.state = 23;
562
- break;
563
- default: this.fail("disallowed character in tag name"), this.state = $e, this.xmlDeclPossible = !1;
564
- }
565
- }
566
- sOpenWakaBang() {
567
- switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
568
- case "[CDATA[":
569
- 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 = "";
570
- break;
571
- case "--":
572
- this.state = 17, this.openWakaBang = "";
573
- break;
574
- case "DOCTYPE":
575
- this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
576
- break;
577
- default: this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
578
- }
579
- }
580
- sComment() {
581
- this.captureToChar(45) && (this.state = 18);
582
- }
583
- sCommentEnding() {
584
- const t = this.getCodeNorm();
585
- 45 === t ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t)}`, this.state = 17);
586
- }
587
- sCommentEnded() {
588
- const t = this.getCodeNorm();
589
- t !== je ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = $e;
590
- }
591
- sCData() {
592
- this.captureToChar(Fe) && (this.state = 21);
593
- }
594
- sCDataEnding() {
595
- const t = this.getCodeNorm();
596
- t === Fe ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
597
- }
598
- sCDataEnding2() {
599
- const t = this.getCodeNorm();
600
- switch (t) {
601
- case je:
602
- this.cdataHandler?.(this.text), this.text = "", this.state = $e;
603
- break;
604
- case Fe:
605
- this.text += "]";
606
- break;
607
- default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
608
- }
609
- }
610
- sPIFirstChar() {
611
- const t = this.getCodeNorm();
612
- this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === Be || ye(t) ? (this.fail("processing instruction without a target."), this.state = t === Be ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
613
- }
614
- sPIRest() {
615
- const { chunk: t, i: e } = this;
616
- for (;;) {
617
- const s = this.getCodeNorm();
618
- if (s === _e) return void (this.piTarget += t.slice(e));
619
- if (!this.nameCheck(s)) {
620
- this.piTarget += t.slice(e, this.prevI);
621
- const o = s === Be;
622
- o || ye(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? Ve : 27) : this.state = o ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s));
623
- break;
624
- }
625
- }
626
- }
627
- sPIBody() {
628
- if (0 === this.text.length) {
629
- const t = this.getCodeNorm();
630
- t === Be ? this.state = 26 : ye(t) || (this.text = String.fromCodePoint(t));
631
- } else this.captureToChar(Be) && (this.state = 26);
632
- }
633
- sPIEnding() {
634
- const t = this.getCodeNorm();
635
- if (t === je) {
636
- const { piTarget: t } = this;
637
- "xml" === t.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
638
- target: t,
639
- body: this.text
640
- }), this.piTarget = this.text = "", this.state = $e;
641
- } else t === Be ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
642
- this.xmlDeclPossible = !1;
643
- }
644
- sXMLDeclNameStart() {
645
- const t = this.skipSpaces();
646
- t !== Be ? t !== _e && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Ve;
647
- }
648
- sXMLDeclName() {
649
- const t = this.captureTo(qe);
650
- if (t === Be) return this.state = Ve, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
651
- if (ye(t) || t === Me) {
652
- if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
653
- case 0:
654
- this.fail("did not expect any more name/value pairs.");
655
- break;
656
- case 1:
657
- this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
658
- break;
659
- default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
660
- }
661
- this.state = t === Me ? 30 : 29;
662
- }
663
- }
664
- sXMLDeclEq() {
665
- const t = this.getCodeNorm();
666
- if (t === Be) return this.state = Ve, void this.fail("XML declaration is incomplete.");
667
- ye(t) || (t !== Me && this.fail("value required."), this.state = 30);
668
- }
669
- sXMLDeclValueStart() {
670
- const t = this.getCodeNorm();
671
- if (t === Be) return this.state = Ve, void this.fail("XML declaration is incomplete.");
672
- ye(t) || (He(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
673
- }
674
- sXMLDeclValue() {
675
- const t = this.captureTo([this.q, Be]);
676
- if (t === Be) return this.state = Ve, this.text = "", void this.fail("XML declaration is incomplete.");
677
- if (t === _e) return;
678
- const e = this.text;
679
- switch (this.text = "", this.name) {
680
- case "version": {
681
- this.xmlDeclExpects = ["encoding", "standalone"];
682
- const t = e;
683
- this.xmlDecl.version = t, /^1\.[0-9]+$/.test(t) ? this.opt.forceXMLVersion || this.setXMLVersion(t) : this.fail("version number must match /^1\\.[0-9]+$/.");
684
- break;
685
- }
686
- case "encoding":
687
- /^[A-Za-z][A-Za-z0-9._-]*$/.test(e) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = e;
688
- break;
689
- case "standalone": "yes" !== e && "no" !== e && this.fail("standalone value must match \"yes\" or \"no\"."), this.xmlDeclExpects = [], this.xmlDecl.standalone = e;
690
- }
691
- this.name = "", this.state = 32;
692
- }
693
- sXMLDeclSeparator() {
694
- const t = this.getCodeNorm();
695
- t !== Be ? (ye(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Ve;
696
- }
697
- sXMLDeclEnding() {
698
- this.getCodeNorm() === je ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = $e) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
699
- }
700
- sOpenTag() {
701
- const t = this.captureNameChars();
702
- if (t === _e) return;
703
- const e = this.tag = {
704
- name: this.name,
705
- attributes: Object.create(null)
706
- };
707
- switch (this.name = "", this.xmlnsOpt && (this.topNS = e.ns = Object.create(null)), this.openTagStartHandler?.(e), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
708
- case je:
709
- this.openTag();
710
- break;
711
- case 47:
712
- this.state = 35;
713
- break;
714
- default: ye(t) || this.fail("disallowed character in tag name."), this.state = 36;
715
- }
716
- }
717
- sOpenTagSlash() {
718
- this.getCode() === je ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
719
- }
720
- sAttrib() {
721
- const t = this.skipSpaces();
722
- t !== _e && (ve(t) ? (this.unGet(), this.state = 37) : t === je ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
723
- }
724
- sAttribName() {
725
- const t = this.captureNameChars();
726
- t === Me ? this.state = 39 : ye(t) ? this.state = 38 : t === je ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== _e && this.fail("disallowed character in attribute name.");
727
- }
728
- sAttribNameSawWhite() {
729
- const t = this.skipSpaces();
730
- switch (t) {
731
- case _e: return;
732
- case Me:
733
- this.state = 39;
734
- break;
735
- default: this.fail("attribute without value."), this.text = "", this.name = "", t === je ? this.openTag() : ve(t) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
736
- }
737
- }
738
- sAttribValue() {
739
- const t = this.getCodeNorm();
740
- He(t) ? (this.q = t, this.state = 40) : ye(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
741
- }
742
- sAttribValueQuoted() {
743
- const { q: t, chunk: e } = this;
744
- let { i: s } = this;
745
- for (;;) switch (this.getCode()) {
746
- case t:
747
- this.pushAttrib(this.name, this.text + e.slice(s, this.prevI)), this.name = this.text = "", this.q = null, this.state = 41;
748
- return;
749
- case 38:
750
- this.text += e.slice(s, this.prevI), this.state = 14, this.entityReturnState = 40;
751
- return;
752
- case Re:
753
- case Ne:
754
- case 9:
755
- this.text += `${e.slice(s, this.prevI)} `, s = this.i;
756
- break;
757
- case Le:
758
- this.text += e.slice(s, this.prevI), this.fail("disallowed character.");
759
- return;
760
- case _e:
761
- this.text += e.slice(s);
762
- return;
763
- }
764
- }
765
- sAttribValueClosed() {
766
- const t = this.getCodeNorm();
767
- ye(t) ? this.state = 36 : t === je ? this.openTag() : 47 === t ? this.state = 35 : ve(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
768
- }
769
- sAttribValueUnquoted() {
770
- const t = this.captureTo(Ue);
771
- switch (t) {
772
- case 38:
773
- this.state = 14, this.entityReturnState = 42;
774
- break;
775
- case Le:
776
- this.fail("disallowed character.");
777
- break;
778
- case _e: break;
779
- default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === je ? this.openTag() : this.state = 36;
780
- }
781
- }
782
- sCloseTag() {
783
- const t = this.captureNameChars();
784
- t === je ? this.closeTag() : ye(t) ? this.state = 44 : t !== _e && this.fail("disallowed character in closing tag.");
785
- }
786
- sCloseTagSawWhite() {
787
- switch (this.skipSpaces()) {
788
- case je:
789
- this.closeTag();
790
- break;
791
- case _e: break;
792
- default: this.fail("disallowed character in closing tag.");
793
- }
794
- }
795
- handleTextInRoot() {
796
- let { i: t, forbiddenState: e } = this;
797
- const { chunk: s, textHandler: o } = this;
798
- t: for (;;) switch (this.getCode()) {
799
- case Le:
800
- if (this.state = 15, void 0 !== o) {
801
- const { text: e } = this, r = s.slice(t, this.prevI);
802
- 0 !== e.length ? (o(e + r), this.text = "") : 0 !== r.length && o(r);
803
- }
804
- e = 0;
805
- break t;
806
- case 38:
807
- this.state = 14, this.entityReturnState = $e, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
808
- break t;
809
- case Fe:
810
- switch (e) {
811
- case 0:
812
- e = 1;
813
- break;
814
- case 1:
815
- e = 2;
816
- break;
817
- case 2: break;
818
- default: throw new Error("impossible state");
819
- }
820
- break;
821
- case je:
822
- 2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
823
- break;
824
- case Ne:
825
- void 0 !== o && (this.text += `${s.slice(t, this.prevI)}\n`), t = this.i, e = 0;
826
- break;
827
- case _e:
828
- void 0 !== o && (this.text += s.slice(t));
829
- break t;
830
- default: e = 0;
831
- }
832
- this.forbiddenState = e;
833
- }
834
- handleTextOutsideRoot() {
835
- let { i: t } = this;
836
- const { chunk: e, textHandler: s } = this;
837
- let o = !1;
838
- t: for (;;) {
839
- const r = this.getCode();
840
- switch (r) {
841
- case Le:
842
- if (this.state = 15, void 0 !== s) {
843
- const { text: o } = this, r = e.slice(t, this.prevI);
844
- 0 !== o.length ? (s(o + r), this.text = "") : 0 !== r.length && s(r);
845
- }
846
- break t;
847
- case 38:
848
- this.state = 14, this.entityReturnState = $e, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
849
- break t;
850
- case Ne:
851
- void 0 !== s && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
852
- break;
853
- case _e:
854
- void 0 !== s && (this.text += e.slice(t));
855
- break t;
856
- default: ye(r) || (o = !0);
857
- }
858
- }
859
- o && (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));
860
- }
861
- pushAttribNS(t, e) {
862
- const { prefix: s, local: o } = this.qName(t), r = {
863
- name: t,
864
- prefix: s,
865
- local: o,
866
- value: e
867
- };
868
- if (this.attribList.push(r), this.attributeHandler?.(r), "xmlns" === s) {
869
- const t = e.trim();
870
- "1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t, Ge(this, o, t);
871
- } else if ("xmlns" === t) {
872
- const t = e.trim();
873
- this.topNS[""] = t, Ge(this, "", t);
874
- }
875
- }
876
- pushAttribPlain(t, e) {
877
- const s = {
878
- name: t,
879
- value: e
880
- };
881
- this.attribList.push(s), this.attributeHandler?.(s);
882
- }
883
- end() {
884
- this.sawRoot || this.fail("document must contain a root element.");
885
- const { tags: t } = this;
886
- for (; t.length > 0;) {
887
- const e = t.pop();
888
- this.fail(`unclosed tag: ${e.name}`);
889
- }
890
- 0 !== this.state && this.state !== $e && this.fail("unexpected end.");
891
- const { text: e } = this;
892
- return 0 !== e.length && (this.textHandler?.(e), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
893
- }
894
- resolve(t) {
895
- let e = this.topNS[t];
896
- if (void 0 !== e) return e;
897
- const { tags: s } = this;
898
- for (let o = s.length - 1; o >= 0; o--) if (e = s[o].ns[t], void 0 !== e) return e;
899
- return e = this.ns[t], void 0 !== e ? e : this.opt.resolvePrefix?.(t);
900
- }
901
- qName(t) {
902
- const e = t.indexOf(":");
903
- if (-1 === e) return {
904
- prefix: "",
905
- local: t
906
- };
907
- const s = t.slice(e + 1), o = t.slice(0, e);
908
- return ("" === o || "" === s || s.includes(":")) && this.fail(`malformed name: ${t}.`), {
909
- prefix: o,
910
- local: s
911
- };
912
- }
913
- processAttribsNS() {
914
- const { attribList: t } = this, e = this.tag;
915
- {
916
- const { prefix: t, local: s } = this.qName(e.name);
917
- e.prefix = t, e.local = s;
918
- const o = e.uri = this.resolve(t) ?? "";
919
- "" !== t && ("xmlns" === t && this.fail("tags may not have \"xmlns\" as prefix."), "" === o && (this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`), e.uri = t));
920
- }
921
- if (0 === t.length) return;
922
- const { attributes: s } = e, o = /* @__PURE__ */ new Set();
923
- for (const e of t) {
924
- const { name: t, prefix: r, local: n } = e;
925
- let i, a;
926
- "" === r ? (i = "xmlns" === t ? Pe : "", a = t) : (i = this.resolve(r), void 0 === i && (this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`), i = r), a = `{${i}}${n}`), o.has(a) && this.fail(`duplicate attribute: ${a}.`), o.add(a), e.uri = i, s[t] = e;
927
- }
928
- this.attribList = [];
929
- }
930
- processAttribsPlain() {
931
- const { attribList: t } = this, e = this.tag.attributes;
932
- for (const { name: s, value: o } of t) void 0 !== e[s] && this.fail(`duplicate attribute: ${s}.`), e[s] = o;
933
- this.attribList = [];
934
- }
935
- openTag() {
936
- this.processAttribs();
937
- const { tags: t } = this, e = this.tag;
938
- e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = $e, this.name = "";
939
- }
940
- openSelfClosingTag() {
941
- this.processAttribs();
942
- const { tags: t } = this, e = this.tag;
943
- e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state = $e, this.name = "";
944
- }
945
- closeTag() {
946
- const { tags: t, name: e } = this;
947
- if (this.state = $e, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
948
- const s = this.closeTagHandler;
949
- let o = t.length;
950
- for (; o-- > 0;) {
951
- const o = this.tag = t.pop();
952
- if (this.topNS = o.ns, s?.(o), o.name === e) break;
953
- this.fail(`unexpected close tag: ${e}.`);
954
- }
955
- 0 === o ? this.closedRoot = !0 : o < 0 && (this.fail(`unmatched closing tag: ${e}.`), this.text += `</${e}>`);
956
- }
957
- parseEntity(t) {
958
- if ("#" !== t[0]) {
959
- const e = this.ENTITIES[t];
960
- return void 0 !== e ? e : (this.fail(this.isName(t) ? "undefined entity." : "disallowed character in entity name."), `&${t};`);
961
- }
962
- let e = NaN;
963
- return "x" === t[1] && /^#x[0-9a-f]+$/i.test(t) ? e = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (e = parseInt(t.slice(1), 10)), this.isChar(e) ? String.fromCodePoint(e) : (this.fail("malformed character entity."), `&${t};`);
964
- }
965
- }, Ye = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, ts = {
966
- amp: "&",
967
- lt: "<",
968
- gt: ">",
969
- quot: "\"",
970
- apos: "'"
971
- }, es = (t, e) => {
972
- const s = ts[e];
973
- if (void 0 !== s) return s;
974
- const o = 120 === e.charCodeAt(1) ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
975
- return o > 0 && o <= 1114111 ? String.fromCodePoint(o) : t;
976
- }, ss = (t) => {
977
- let e = t;
978
- return -1 !== e.indexOf("\r") && (e = e.replace(/\r\n?/g, "\n")), -1 !== e.indexOf("&") && (e = e.replace(Ye, es)), e;
979
- }, os = (t) => {
980
- let e = t;
981
- const s = e.length;
982
- for (let t = 0; t < s; t++) {
983
- const s = e.charCodeAt(t);
984
- if (9 === s || 10 === s || 13 === s) {
985
- e = e.replace(/\r\n|[\t\n\r]/g, " ");
986
- break;
987
- }
988
- }
989
- return -1 !== e.indexOf("&") && (e = e.replace(Ye, es)), e;
990
- }, rs = (t) => 32 === t || 9 === t || 10 === t || 13 === t, ns = class t {
991
- constructor() {
992
- this._openTagHandler = void 0, this._closeTagHandler = void 0, this._textHandler = void 0, this._cdataHandler = void 0, this._errorHandler = void 0, this._endHandler = void 0, this._scanners = null, this._carry = "", this._text = "", this._tags = [], this._sawRoot = !1, this._closed = !1;
993
- }
994
- static {
995
- this.NEED_MORE = -1;
996
- }
997
- static {
998
- this.NOT_HANDLED = -2;
999
- }
1000
- static decodeText(t) {
1001
- return ss(t);
1002
- }
1003
- on(t, e) {
1004
- switch (t) {
1005
- case "opentag":
1006
- this._openTagHandler = e;
1007
- break;
1008
- case "closetag":
1009
- this._closeTagHandler = e;
1010
- break;
1011
- case "text":
1012
- this._textHandler = e;
1013
- break;
1014
- case "cdata":
1015
- this._cdataHandler = e;
1016
- break;
1017
- case "error":
1018
- this._errorHandler = e;
1019
- break;
1020
- case "end": this._endHandler = e;
1021
- }
1022
- }
1023
- setElementScanners(t) {
1024
- if (!t || 0 === t.length) return void (this._scanners = null);
1025
- const e = new Array(128);
1026
- for (const s of t) {
1027
- const t = s.name.charCodeAt(0);
1028
- if (!(t < 128) || void 0 !== e[t]) throw new Error(`Element scanner '${s.name}' needs an ASCII first character no other scanner uses.`);
1029
- e[t] = s;
1030
- }
1031
- this._scanners = e;
1032
- }
1033
- fail(t) {
1034
- const e = new Error(t), s = this._errorHandler;
1035
- if (void 0 === s) throw e;
1036
- s(e);
1037
- }
1038
- write(t) {
1039
- if (this._closed) return this.fail("cannot write after close."), this;
1040
- let e = t;
1041
- 0 !== this._carry.length && (e = this._carry + t, this._carry = "");
1042
- const s = e.length;
1043
- let o = 0;
1044
- for (; o < s;) {
1045
- const t = e.indexOf("<", o);
1046
- if (-1 === t) return this._text += e.slice(o), this;
1047
- t > o && (this._text += e.slice(o, t));
1048
- const r = this._markup(e, t, s);
1049
- if (-1 === r) return this._carry = e.slice(t), this;
1050
- o = r;
1051
- }
1052
- return this;
1053
- }
1054
- close() {
1055
- 0 !== this._carry.length && (this.fail("unexpected end."), this._carry = ""), this._sawRoot || this.fail("document must contain a root element.");
1056
- const t = this._tags;
1057
- for (; t.length > 0;) {
1058
- const e = t.pop();
1059
- this.fail(`unclosed tag: ${e.name}`);
1060
- }
1061
- return this._flushText(), this._closed = !0, this._endHandler?.(), this;
1062
- }
1063
- _flushText() {
1064
- const t = this._text;
1065
- if (0 === t.length) return;
1066
- this._text = "";
1067
- const e = this._textHandler;
1068
- void 0 !== e && 0 !== this._tags.length && e(ss(t));
1069
- }
1070
- _markup(e, s, o) {
1071
- if (s + 1 >= o) return -1;
1072
- const r = e.charCodeAt(s + 1);
1073
- if (47 === r) {
1074
- const t = e.indexOf(">", s + 2);
1075
- return -1 === t ? -1 : (this._flushText(), this._closeTag(e.slice(s + 2, t).trimEnd()), t + 1);
1076
- }
1077
- if (63 === r) {
1078
- const t = e.indexOf("?>", s + 2);
1079
- return -1 === t ? -1 : t + 2;
1080
- }
1081
- if (33 === r) {
1082
- if (s + 4 > o) return -1;
1083
- if (45 === e.charCodeAt(s + 2) && 45 === e.charCodeAt(s + 3)) {
1084
- const t = e.indexOf("-->", s + 4);
1085
- return -1 === t ? -1 : t + 3;
1086
- }
1087
- if (s + 9 > o) return -1;
1088
- if (e.startsWith("[CDATA[", s + 2)) {
1089
- const t = e.indexOf("]]>", s + 9);
1090
- return -1 === t ? -1 : (this._flushText(), this._cdataHandler?.(e.slice(s + 9, t)), t + 3);
1091
- }
1092
- const t = e.indexOf("[", s + 2), r = e.indexOf(">", s + 2);
1093
- if (-1 === r) return -1;
1094
- if (-1 !== t && t < r) {
1095
- const s = e.indexOf("]>", t);
1096
- return -1 === s ? -1 : s + 2;
1097
- }
1098
- return r + 1;
1099
- }
1100
- const n = this._scanners;
1101
- if (null !== n) {
1102
- const i = r < 128 ? n[r] : void 0;
1103
- if (void 0 !== i && e.startsWith(i.name, s + 1)) {
1104
- const r = s + 1 + i.name.length;
1105
- if (r >= o) return -1;
1106
- const n = e.charCodeAt(r);
1107
- if (62 === n || 47 === n || rs(n)) {
1108
- this._flushText();
1109
- const r = i.scan(e, s, o);
1110
- if (r !== t.NOT_HANDLED) {
1111
- if (r !== t.NEED_MORE) {
1112
- this._sawRoot = !0;
1113
- const t = i.openTag;
1114
- void 0 !== t && this._tags.push(t);
1115
- }
1116
- return r;
1117
- }
1118
- }
1119
- }
1120
- }
1121
- return this._openTag(e, s, o);
1122
- }
1123
- _openTag(t, e, s) {
1124
- let o = e + 1, r = 0;
1125
- for (; o < s && (r = t.charCodeAt(o), 62 !== r && 47 !== r && !rs(r));) o++;
1126
- if (o >= s) return -1;
1127
- const n = t.slice(e + 1, o), i = {};
1128
- let a = !1;
1129
- for (;;) {
1130
- for (; o < s && rs(r = t.charCodeAt(o));) o++;
1131
- if (o >= s) return -1;
1132
- if (62 === r) {
1133
- o++;
1134
- break;
1135
- }
1136
- if (47 === r) {
1137
- if (o + 1 >= s) return -1;
1138
- if (62 !== t.charCodeAt(o + 1)) {
1139
- this.fail("forward-slash in opening tag not followed by >."), o++;
1140
- continue;
1141
- }
1142
- a = !0, o += 2;
1143
- break;
1144
- }
1145
- const e = o;
1146
- for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !rs(r));) o++;
1147
- if (o >= s) return -1;
1148
- const n = t.slice(e, o);
1149
- for (; o < s && rs(r = t.charCodeAt(o));) o++;
1150
- if (o >= s) return -1;
1151
- if (61 !== r) {
1152
- this.fail("attribute without value.");
1153
- continue;
1154
- }
1155
- for (o++; o < s && rs(r = t.charCodeAt(o));) o++;
1156
- if (o >= s) return -1;
1157
- if (34 !== r && 39 !== r) {
1158
- this.fail("unquoted attribute value.");
1159
- continue;
1160
- }
1161
- const l = t.indexOf(34 === r ? "\"" : "'", o + 1);
1162
- if (-1 === l) return -1;
1163
- "__proto__" !== n && (i[n] = os(t.slice(o + 1, l))), o = l + 1;
1164
- }
1165
- this._flushText(), this._sawRoot = !0;
1166
- const l = {
1167
- name: n,
1168
- attributes: i,
1169
- isSelfClosing: a
1170
- };
1171
- return this._openTagHandler?.(l), a ? this._closeTagHandler?.(l) : this._tags.push(l), o;
1172
- }
1173
- _closeTag(t) {
1174
- if ("" === t) return void this.fail("weird empty close tag.");
1175
- const e = this._tags, s = this._closeTagHandler;
1176
- let o = e.length;
1177
- for (; o-- > 0;) {
1178
- const o = e.pop();
1179
- if (s?.(o), o.name === t) return;
1180
- this.fail(`unexpected close tag: ${t}.`);
1181
- }
1182
- this.fail(`unmatched closing tag: ${t}.`);
1183
- }
1184
- };
1185
- (function(t) {
1186
- t.Events = {
1187
- XmlDecl: "xmldecl",
1188
- Text: "text",
1189
- ProcessingInstruction: "processinginstruction",
1190
- Doctype: "doctype",
1191
- Comment: "comment",
1192
- OpenTagStart: "opentagstart",
1193
- Attribute: "attribute",
1194
- OpenTag: "opentag",
1195
- CloseTag: "closetag",
1196
- CDdata: "cdata",
1197
- Error: "error",
1198
- End: "end",
1199
- Ready: "ready"
1200
- }, t.parseStream = async (t, e, s) => {
1201
- if (s?.lean) return (async (t, e) => {
1202
- const s = new ns();
1203
- let o;
1204
- e.elementScanners && s.setElementScanners(e.elementScanners), e.onOpenTag && s.on("opentag", e.onOpenTag), e.onCloseTag && s.on("closetag", e.onCloseTag), e.onText && s.on("text", e.onText), e.onError && s.on("error", e.onError);
1205
- const r = e.onEnd;
1206
- for (r && s.on("end", () => {
1207
- o = r();
1208
- });;) {
1209
- const { value: e, done: o } = await t.read();
1210
- if (o) break;
1211
- s.write(e);
1212
- }
1213
- return s.close(), o;
1214
- })(t, e);
1215
- const o = new Qe({
1216
- position: !1,
1217
- ...s
1218
- });
1219
- let r;
1220
- e.onOpenTagStart && o.on(be.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(be.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(be.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(be.Events.Attribute, e.onAttribute), e.onText && o.on(be.Events.Text, e.onText), e.onError && o.on(be.Events.Error, e.onError);
1221
- const n = e.onEnd;
1222
- if (n) {
1223
- const t = () => {
1224
- r = n();
1225
- };
1226
- o.on(be.Events.End, t);
1227
- }
1228
- for (;;) {
1229
- const { value: e, done: s } = await t.read();
1230
- if (s) break;
1231
- o.write(e);
1232
- }
1233
- return o.close(), r;
1234
- };
1235
- })(be || (be = {}));
1236
- var is = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, as = (t) => {
1237
- const e = parseInt(t);
1238
- return isNaN(e) ? null : e;
1239
- }, ls = (t) => {
1240
- const e = parseFloat(t);
1241
- return isNaN(e) ? null : e;
1242
- }, cs = null, hs = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), us = (t) => hs(t).replace(/"/g, "&quot;"), ds = class {
1243
- constructor() {
1244
- this._registeredVisitors = /* @__PURE__ */ new Map();
1245
- }
1246
- registerVisitor(t) {
1247
- this._registeredVisitors.set(t.from, t);
1248
- }
1249
- createEventHandler(t, e, s) {
1250
- const o = this._registeredVisitors, r = [], n = [];
1251
- let i = null, a = null, l = null, c = null;
1252
- const h = [], u = {
1253
- key: null,
1254
- source: t,
1255
- parent: null
1256
- };
1257
- let d = null, p = !1, f = null, g = null, m = null;
1258
- const b = (t, e) => {
1259
- let s = l.attributes[t];
1260
- if (e) if (Array.isArray(e)) {
1261
- const t = e.length;
1262
- for (let o = 0; o < t; o++) {
1263
- if (null == s) return;
1264
- if (s = e[o](s), null == s) return;
1265
- }
1266
- } else {
1267
- if (null == s) return;
1268
- if (s = e(s), null == s) return;
1269
- }
1270
- return s;
1271
- }, y = {
1272
- getSource: () => d?.source ?? null,
1273
- setSource: (t) => {
1274
- d.source = t;
1275
- },
1276
- setKey: (t) => {
1277
- d.key = t;
1278
- },
1279
- getFrom: () => l,
1280
- getAttribute: (t, e) => b(t, e) ?? null,
1281
- hasAttribute: (t) => null !== y.getAttribute(t),
1282
- getParent: () => {
1283
- const t = h[h.length - 2];
1284
- return t.parent ?? t.source;
1285
- },
1286
- getPath: () => {
1287
- const t = [], e = n.length;
1288
- for (let s = 0; s < e; s++) t.push(n[s].local);
1289
- return t.join("\\");
1290
- },
1291
- parseAttribute: b,
1292
- getRawXml: () => m,
1293
- copyToObject: (t, e, s, o) => {
1294
- const r = b(o ?? e, s);
1295
- void 0 !== r && (t[e] = r);
1296
- },
1297
- copyTo: (t, e, s) => {
1298
- const o = b(s ?? t, e);
1299
- void 0 !== o && (d.source[t] = o);
1300
- },
1301
- warn: (t, e) => {
1302
- s ? s(t, void 0, e?.onceKey) : console.warn(t);
1303
- }
1304
- };
1305
- return {
1306
- onOpenTag: (t) => {
1307
- let e = t.name;
1308
- const s = e.indexOf(":");
1309
- if (-1 !== s && (e = e.slice(s + 1)), f) return f.push(((t) => {
1310
- const e = t.attributes ?? {};
1311
- let s = `<${t.name}`;
1312
- for (const t in e) {
1313
- const o = e[t];
1314
- s += ` ${t}="${us("string" == typeof o ? o : o?.value ?? "")}"`;
1315
- }
1316
- return s + ">";
1317
- })(t)), i = {
1318
- local: e,
1319
- tag: t,
1320
- destination: null
1321
- }, n.push(i), a = e, void (l = t);
1322
- const m = (r.length > 0 ? r[r.length - 1] : o).get(e);
1323
- if (i = {
1324
- local: e,
1325
- visitor: m,
1326
- tag: t,
1327
- destination: null
1328
- }, p) return n.push(i), a = e, void (l = t);
1329
- c = i?.visitor ?? null, a = e, l = t;
1330
- let b = !!m && null === m.to;
1331
- if (m && !b && m.scope) {
1332
- const t = m.scope(y);
1333
- null === t ? b = !0 : t && (r.push(t), i.pushedScope = !0);
1334
- }
1335
- m && (0 === n.length ? (d = u, i.destination = d, i.pushedDestination = !0, h.push(d)) : b ? (d = null, i.destination = null) : m.transparent ? i.destination = d : (d = {
1336
- key: null,
1337
- source: {},
1338
- parent: null
1339
- }, i.destination = d, i.pushedDestination = !0, h.push(d))), n.push(i), p = b;
1340
- const x = c?.openTag?.(y);
1341
- void 0 !== x && (d.parent = x), m?.raw && !b && (f = [], g = i);
1342
- },
1343
- onCloseTag: (t) => {
1344
- let e = t.name;
1345
- const o = e.indexOf(":");
1346
- if (-1 !== o && (e = e.slice(o + 1)), e !== a) throw new Error(`mismatch open/close tag: '${e}'/'${a}'`);
1347
- let b = !1;
1348
- if (f) {
1349
- if (n[n.length - 1] !== g) return f.push(`</${t.name}>`), n.pop(), i = n[n.length - 1] ?? null, a = i?.local ?? null, void (l = i?.tag ?? null);
1350
- m = f.join(""), f = null, g = null, b = !0;
1351
- }
1352
- p || c?.closeTag?.(y), b && (m = null);
1353
- const x = n.pop() ?? null;
1354
- i = n[n.length - 1] ?? null, x?.pushedScope && r.pop();
1355
- const v = x?.destination;
1356
- if (v && x.pushedDestination) {
1357
- h.pop(), d = h[h.length - 1] ?? u;
1358
- const t = x.visitor;
1359
- t && t.to && void 0 !== v.source && (Array.isArray(t.to) ? d.source.push ? d.source.push(v.source) : s?.(`Unable to parse array for ${t.from} at ${y.getPath()}`) : v.key ? d.source[v.key] = v.source : "string" == typeof t.to && (d.source[t.to] = v.source));
1360
- } else v || (d = h[h.length - 1] ?? u);
1361
- a = i?.local ?? null, l = i?.tag ?? null, c = i?.visitor ?? null, p = !i?.destination;
1362
- },
1363
- onText: (t) => {
1364
- f ? f.push(hs(t)) : c?.text?.(t, y);
1365
- },
1366
- onEnd: e
1367
- };
1368
- }
1369
- }, ps = `IFERROR(${Wt}(`, fs = ps.toUpperCase(), gs = Q.toUpperCase(), ms = { kind: "none" }, bs = { kind: "spilled" }, ys = (t, e) => {
1370
- if (34 !== t.charCodeAt(e)) return null;
1371
- let s = "", o = e + 1;
1372
- for (; o < t.length;) if (34 === t.charCodeAt(o)) {
1373
- if (34 !== t.charCodeAt(o + 1)) return {
1374
- value: s,
1375
- end: o + 1
1376
- };
1377
- s += "\"", o += 2;
1378
- } else s += t[o], o++;
1379
- return null;
1380
- }, xs = (t) => {
1381
- const e = [];
1382
- let s = 0;
1383
- for (; s < t.length;) {
1384
- const o = t.charCodeAt(s);
1385
- if (34 === o) {
1386
- const e = ys(t, s);
1387
- if (null === e) break;
1388
- s = e.end;
1389
- continue;
1390
- }
1391
- if (!(o >= 65 && o <= 90 || o >= 97 && o <= 122 || 95 === o)) {
1392
- s++;
1393
- continue;
1394
- }
1395
- let r = s + 1;
1396
- for (; r < t.length;) {
1397
- const e = t.charCodeAt(r);
1398
- if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || 95 === e || 46 === e)) break;
1399
- r++;
1400
- }
1401
- 40 === t.charCodeAt(r) && e.push(t.slice(s, r).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), s = r;
1402
- }
1403
- return e;
1404
- }, vs = class {
1405
- constructor(t) {
1406
- this._restored = [], this._byColumn = /* @__PURE__ */ new Map(), this._isKnown = t;
1407
- }
1408
- anchor(t, e, s) {
1409
- const o = this._byColumn.get(e);
1410
- o && t === o.rowEnd + 1 && t > o.rowStart && (o.closed = !0);
1411
- const r = xs(s);
1412
- let n = !0;
1413
- for (let t = 0; t < r.length && n; t++) n = this._isKnown(r[t]);
1414
- const i = {
1415
- rowStart: t,
1416
- colStart: e,
1417
- rowEnd: t,
1418
- colEnd: e,
1419
- closed: !1,
1420
- restored: n
1421
- };
1422
- return this._byColumn.set(e, i), n && this._restored.push(i), n;
1423
- }
1424
- placeholder(t, e) {
1425
- const s = this._byColumn.get(e);
1426
- if (s && !s.closed && t > s.rowStart && t <= s.rowEnd + 1 && e >= s.colStart && e <= s.colEnd) return s.rowEnd = t, s.restored;
1427
- const o = this._byColumn.get(e - 1);
1428
- return !(!o || o.rowStart !== t || o.colEnd !== e - 1) && (o.colEnd = e, this._byColumn.set(e, o), o.restored);
1429
- }
1430
- getFormulaArray() {
1431
- return this._restored.map((t) => [p.rangeToString(t), "dynamic"]);
1432
- }
1433
- }, ws = /^\s*TABLE\s*\(([^()]*)\)\s*$/i, Ts = /^\s*(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})\s*$/, Ss = (t) => {
1434
- const e = Ts.exec(t);
1435
- if (!e) return null;
1436
- const s = p.fastStringToCol(e[2]), o = parseInt(e[4], 10) - 1;
1437
- return s < 0 || o < 0 ? null : {
1438
- row: o,
1439
- col: s,
1440
- colAbsolute: "$" === e[1],
1441
- rowAbsolute: "$" === e[3]
1442
- };
1443
- }, Cs = (t) => p.cellToString({
1444
- rowIndex: t.row,
1445
- colIndex: t.col
1446
- }), As = (t, e) => {
1447
- const s = ws.exec(t);
1448
- if (!s) return null;
1449
- const o = s[1].split(",");
1450
- if (3 !== o.length && 5 !== o.length) return null;
1451
- const r = [];
1452
- for (let t = 0; t < o.length; t++) {
1453
- const e = Ss(o[t]);
1454
- if (!e) return null;
1455
- r.push(e);
1456
- }
1457
- const n = e.rowStart, i = e.colStart, a = (t) => t.colAbsolute && !t.rowAbsolute && t.col === i - 1 && t.row === n, l = (t) => t.rowAbsolute && !t.colAbsolute && t.row === n - 1 && t.col === i, c = {
1458
- rowStart: n,
1459
- colStart: i,
1460
- rowEnd: e.rowEnd,
1461
- colEnd: e.colEnd
1462
- }, h = r[0];
1463
- if (3 === r.length) {
1464
- const [, t, e] = r;
1465
- return a(e) && l(h) ? {
1466
- ref: c,
1467
- columnInput: Cs(t)
1468
- } : l(e) && a(h) ? {
1469
- ref: c,
1470
- rowInput: Cs(t)
1471
- } : null;
1472
- }
1473
- if (!h.rowAbsolute || !h.colAbsolute || h.row !== n - 1 || h.col !== i - 1) return null;
1474
- const [, u, d, p, f] = r;
1475
- return a(d) && l(f) ? {
1476
- ref: c,
1477
- rowInput: Cs(p),
1478
- columnInput: Cs(u)
1479
- } : l(d) && a(f) ? {
1480
- ref: c,
1481
- rowInput: Cs(u),
1482
- columnInput: Cs(p)
1483
- } : null;
1484
- }, ks = /^(?:(\d{4})-(\d{2})-(\d{2}))?T?(?:(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/, Es = /^PT(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?$/, Is = (t, e, s) => {
1485
- const o = Math.floor((14 - e) / 12), r = t + 4800 - o, n = e + 12 * o - 3;
1486
- return s + Math.floor((153 * n + 2) / 5) + 365 * r + Math.floor(r / 4) - Math.floor(r / 100) + Math.floor(r / 400) - 32045;
1487
- }, Ps = Is(1899, 12, 30), Os = (t) => {
1488
- const e = t.indexOf(":");
1489
- return -1 === e ? t : t.slice(e + 1);
1490
- }, Ds = class {
1491
- constructor() {
1492
- this._runs = null, this._text = "", this._font = null, this._inRun = !1, this._inRPr = !1;
1493
- }
1494
- reset() {
1495
- this._runs = null, this._inRun = !1, this._inRPr = !1;
1496
- }
1497
- onOpenTag(t, e) {
1498
- "r" === t ? (this._inRun = !0, this._text = "", this._font = null, this._runs ??= []) : "rPr" === t ? this._inRun && (this._inRPr = !0) : this._inRPr && function(t, e, s) {
1499
- switch (t) {
1500
- case "b":
1501
- s.weight = $s(e) ? 700 : 400;
1502
- break;
1503
- case "i":
1504
- s.style = $s(e) ? l.Style.Italic : l.Style.Normal;
1505
- break;
1506
- case "strike":
1507
- s.strike = Y($s(e));
1508
- break;
1509
- case "outline":
1510
- s.outline = $s(e);
1511
- break;
1512
- case "shadow":
1513
- s.shadow = $s(e);
1514
- break;
1515
- case "condense":
1516
- case "extend": {
1517
- const o = M(t, $s(e));
1518
- void 0 !== o && (s.letterSpacing = o);
1519
- break;
1520
- }
1521
- case "u":
1522
- s.underline = At(e.val);
1523
- break;
1524
- case "vertAlign": {
1525
- const t = kt(e.val);
1526
- void 0 !== t && (s.baseline = t);
1527
- break;
1528
- }
1529
- case "sz": {
1530
- const t = parseFloat(e.val ?? "");
1531
- isNaN(t) || (s.size = t);
1532
- break;
1533
- }
1534
- case "rFont": {
1535
- const t = e.val;
1536
- t && (s.family = t);
1537
- break;
1538
- }
1539
- case "family": {
1540
- const t = Ns[e.val ?? ""];
1541
- t && (s.fallbacks = [t]);
1542
- break;
1543
- }
1544
- case "charset": {
1545
- const t = parseInt(e.val ?? "", 10);
1546
- isNaN(t) || (s.charset = t);
1547
- break;
1548
- }
1549
- case "scheme":
1550
- nt(s, e.val);
1551
- break;
1552
- case "color": {
1553
- const t = e.rgb;
1554
- if (t && void 0 === e.theme) {
1555
- s.color = "#" + (8 === t.length ? t.substring(2) : t).toUpperCase();
1556
- break;
1557
- }
1558
- const o = $t((t) => e[t]);
1559
- o && (s.color = o);
1560
- break;
1561
- }
1562
- }
1563
- }(t, e, this._font ??= {});
1564
- }
1565
- onText(t) {
1566
- this._inRun && (this._text += t);
1567
- }
1568
- onCloseTag(t) {
1569
- if ("rPr" === t) this._inRPr = !1, this._font ??= {};
1570
- else if ("r" === t && this._inRun) {
1571
- const t = ct(this._text), e = this._font;
1572
- this._runs.push(e ? {
1573
- text: t,
1574
- font: e
1575
- } : { text: t }), this._inRun = !1;
1576
- }
1577
- }
1578
- take() {
1579
- const t = this._runs;
1580
- if (this.reset(), !t) return null;
1581
- for (let e = 0; e < t.length; e++) if (t[e].font) return t;
1582
- return null;
1583
- }
1584
- };
1585
- function _s(t, e) {
1586
- const s = {
1587
- family: "Calibri",
1588
- size: 11,
1589
- ...e,
1590
- weight: 400,
1591
- style: l.Style.Normal,
1592
- underline: l.UnderlineStyle.None,
1593
- strike: l.StrikeStyle.None,
1594
- baseline: 0
1595
- }, o = new Array(t.length);
1596
- for (let e = 0; e < t.length; e++) {
1597
- const r = t[e];
1598
- if (!r.font) {
1599
- o[e] = r;
1600
- continue;
1601
- }
1602
- const n = {
1603
- ...s,
1604
- ...r.font
1605
- };
1606
- o[e] = {
1607
- text: r.text,
1608
- font: n
1609
- };
1610
- }
1611
- return o;
1612
- }
1613
- var Ns = {
1614
- 1: "serif",
1615
- 2: "sans-serif",
1616
- 3: "monospace",
1617
- 4: "cursive",
1618
- 5: "fantasy"
1619
- }, $s = (t) => {
1620
- const e = t.val;
1621
- return void 0 === e || "1" === e || "true" === e;
1622
- }, Vs = (t) => {
1623
- const e = (e) => {
1624
- if (t) return new RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([^<]*)<`).exec(t)?.[1];
1625
- }, s = (t) => {
1626
- const e = parseInt(t ?? "", 10);
1627
- return isNaN(e) ? 0 : e;
1628
- };
1629
- return {
1630
- c: s(e("col")),
1631
- r: s(e("row")),
1632
- x: Rt(e("colOff") ?? "0") ?? 0,
1633
- y: Rt(e("rowOff") ?? "0") ?? 0
1634
- };
1635
- }, Rs = "formulaDialect", Ls = "isKnownFunction", Ms = "date1904", js = "richStrings", Bs = "defaultFont", Fs = (t, e, s, o, r, n, i, a) => {
1636
- const l = new ds(), c = (t) => {
1637
- const e = t.getAttribute("dxfId", as);
1638
- if (null !== e) return o?.get(e) || (n?.(`A color filter or sort names a format that does not exist (dxfId '${e}').`), {});
1639
- };
1640
- let h = !1;
1641
- const d = a?.get("parseInlineDxf"), f = a?.get(Rs), g = (t) => f && t ? f.readDetached(t) : t, b = new w.TransposedBuilder();
1642
- let y = null, T = "topLeft";
1643
- l.registerVisitor({
1644
- from: "autoFilter",
1645
- to: "autoTable",
1646
- openTag: (t) => {
1647
- const e = t.getAttribute("ref"), s = p.fastStringToRange(e);
1648
- t.getSource().r = s, t.getSource().v = {};
1649
- },
1650
- closeTag: (t) => {
1651
- const e = t.getSource(), s = e.v, o = s.hiddenButtons;
1652
- if (Array.isArray(o)) {
1653
- const t = o.length, r = e.r, n = r.colEnd - r.colStart + 1;
1654
- 0 === t ? s.hiddenButtons = !1 : t === n && (s.hiddenButtons = !0);
1655
- }
1656
- }
1657
- }), l.registerVisitor({
1658
- from: "conditionalFormatting",
1659
- to: {},
1660
- openTag: (t) => {
1661
- const e = t.getParent();
1662
- e.conditionals || (e.conditionals = []);
1663
- let s = t.getAttribute("sqref");
1664
- s && (s = s.trim().split(/\s+/).join(","));
1665
- const o = {
1666
- r: s,
1667
- conditionals: e.conditionals
1668
- }, r = t.getAttribute("pivot", is);
1669
- null !== r && (o.pivot = r), t.setSource(o);
1670
- }
1671
- }), l.registerVisitor({
1672
- from: "cfRule",
1673
- to: {},
1674
- openTag: (t) => {
1675
- const e = t.getParent();
1676
- if (!e?.r) return;
1677
- const s = t.getSource() ?? {};
1678
- void 0 !== e.pivot && (s.pivot = e.pivot), e.conditionals.push({
1679
- r: e.r,
1680
- v: null,
1681
- rule: s
1682
- }), t.copyToObject(s, "type", cs), t.copyToObject(s, "priority", as), t.copyToObject(s, "stopIfTrue", is);
1683
- const r = t.getAttribute("dxfId", as);
1684
- if (null !== r) {
1685
- let e = o?.get(r);
1686
- e || (n?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${t.getPath()}'.`), e = {}), s.style = e;
1687
- }
1688
- t.copyToObject(s, "aboveAverage", is), t.copyToObject(s, "equalAverage", is), t.copyToObject(s, "stdDev", as), t.copyToObject(s, "bottom", is), t.copyToObject(s, "percent", is), t.copyToObject(s, "rank", as), t.copyToObject(s, "operator", cs), t.copyToObject(s, "text", cs), t.copyToObject(s, "timePeriod", cs);
1689
- },
1690
- closeTag: (t) => {
1691
- const e = t.getParent();
1692
- if (!e?.r) return;
1693
- const s = e.conditionals[e.conditionals.length - 1], o = s?.rule;
1694
- if (!o) return;
1695
- const r = {}, i = Nt(o, n);
1696
- i && (r.condition = i), o.style && (r.style = o.style), o.scale && (r.scale = o.scale), o.stopIfTrue && (r.stopIfTrue = !0), o.pivot && (r.pivot = !0), s.v = r, s.priority = o.priority, o.x14Id && (s.x14Id = o.x14Id), delete s.rule;
1697
- }
1698
- });
1699
- const S = (t) => {
1700
- const e = t.conditions ?? [], s = [];
1701
- for (let t = 0; t < e.length; t++) {
1702
- const o = e[t], r = {};
1703
- o.type && (r.type = o.type), void 0 !== o.value && (r.value = o.value), o.exclusive && (r.exclusive = !0), s.push(r);
1704
- }
1705
- return s;
1706
- };
1707
- l.registerVisitor({
1708
- from: "colorScale",
1709
- to: {},
1710
- openTag: (t) => {},
1711
- closeTag: (t) => {
1712
- const e = t.getSource(), s = e.colors ?? [], o = S(e);
1713
- for (let t = 0; t < o.length; t++) o[t].color = s[t];
1714
- t.getParent().scale = {
1715
- type: x.ScaleType.ColorScale,
1716
- stops: o
1717
- };
1718
- }
1719
- }), l.registerVisitor({
1720
- from: "dataBar",
1721
- to: {},
1722
- openTag: (t) => {
1723
- t.copyTo("maxLength", as), t.copyTo("minLength", as), t.copyTo("showValue", is);
1724
- },
1725
- closeTag: (t) => {
1726
- const e = t.getSource(), s = {
1727
- type: x.ScaleType.DataBar,
1728
- stops: S(e)
1729
- }, o = e.colors?.[0];
1730
- o && (s.color = o), void 0 !== e.minLength && (s.minLength = e.minLength), void 0 !== e.maxLength && (s.maxLength = e.maxLength), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
1731
- }
1732
- }), l.registerVisitor({
1733
- from: "iconSet",
1734
- to: {},
1735
- openTag: (t) => {
1736
- t.copyTo("iconSet", cs), t.copyTo("reverse", is), t.copyTo("showValue", is);
1737
- },
1738
- closeTag: (t) => {
1739
- const e = t.getSource(), s = {
1740
- type: x.ScaleType.IconSet,
1741
- stops: S(e)
1742
- };
1743
- void 0 !== e.iconSet && (s.iconSet = e.iconSet), void 0 !== e.reverse && (s.reverse = e.reverse), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
1744
- }
1745
- }), l.registerVisitor({
1746
- from: "formula",
1747
- to: {},
1748
- text: (t, e) => {
1749
- const s = e.getParent();
1750
- let o = s.formulas;
1751
- o || (o = [], s.formulas = o), o.push(g(t));
1752
- }
1753
- }), l.registerVisitor({
1754
- from: "cfvo",
1755
- to: {},
1756
- openTag: (t) => {
1757
- const e = t.getParent();
1758
- e.conditions || (e.conditions = []);
1759
- const s = t.getSource();
1760
- if (e.conditions.push(s), t.copyTo("type", cs), s.type === x.ColorStopType.Formula) {
1761
- const e = t.getAttribute("val");
1762
- null != e && (s.value = g(String(e)));
1763
- } else t.copyTo("value", ls, "val");
1764
- !1 === t.getAttribute("gte", is) && (s.exclusive = !0);
1765
- }
1766
- }), l.registerVisitor({
1767
- from: "color",
1768
- to: {},
1769
- openTag: (t) => {
1770
- const e = t.getParent();
1771
- e.colors || (e.colors = []);
1772
- const s = $t((e) => t.getAttribute(e));
1773
- e.colors.push(s);
1774
- }
1775
- }), l.registerVisitor({
1776
- from: "filterColumn",
1777
- to: {},
1778
- openTag: (t) => {
1779
- const e = t.getParent().v, s = parseInt(t.getAttribute("colId")), o = t.getSource();
1780
- o.index = s;
1781
- let r = e.filter;
1782
- r || (r = { conditions: [] }, e.filter = r);
1783
- let n = r.conditions;
1784
- if (n || (n = [], r.conditions = n), n.push(o), t.getAttribute("hiddenButton", is) && e) {
1785
- let t = e.hiddenButtons;
1786
- t || (t = [], e.hiddenButtons = t), t.push(s);
1787
- }
1788
- if (t.getAttribute("showButton", is) && e) {
1789
- let t = e.showButtons;
1790
- t || (t = [], e.showButtons = t), t.push(s);
1791
- }
1792
- return o;
1793
- }
1794
- }), l.registerVisitor({
1795
- from: "colorFilter",
1796
- openTag: (t) => {
1797
- const e = t.getParent(), s = {};
1798
- e.operator = m.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor", is);
1799
- const o = c(t);
1800
- o && (s.style = o);
1801
- }
1802
- }), l.registerVisitor({
1803
- from: "iconFilter",
1804
- openTag: (t) => {
1805
- const e = t.getParent(), s = {};
1806
- e.operator = m.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", as), t.copyToObject(s, "iconSet", cs);
1807
- }
1808
- }), l.registerVisitor({
1809
- from: "top10",
1810
- openTag: (t) => {
1811
- const e = t.getParent(), s = {};
1812
- e.operator = m.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", ls), t.copyToObject(s, "percent", is), t.copyToObject(s, "top", is), t.copyToObject(s, "limit", ls, "val");
1813
- }
1814
- }), l.registerVisitor({
1815
- from: "dynamicFilter",
1816
- openTag: (t) => {
1817
- const e = t.getParent(), s = R(t.getAttribute("type"));
1818
- e.operator = s.operator, e.param = s.param;
1819
- }
1820
- });
1821
- const C = {
1822
- from: "filters",
1823
- to: {},
1824
- openTag: (t) => {
1825
- const e = t.getParent(), s = {};
1826
- return e.selector = m.BuiltInSelectorNames.Display, e.operator = m.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", is), t.copyToObject(s, "calendarType", cs), s;
1827
- }
1828
- };
1829
- l.registerVisitor(C);
1830
- const A = {
1831
- from: "filter",
1832
- openTag: (t) => {
1833
- const e = t.getParent();
1834
- let s = e.items;
1835
- s || (s = [], e.items = s), s.push(t.getAttribute("val", cs));
1836
- }
1837
- };
1838
- l.registerVisitor(A);
1839
- const k = {
1840
- from: "dateGroupItem",
1841
- to: {},
1842
- openTag: (t) => {
1843
- const e = t.getParent();
1844
- let s = e.dateGroups;
1845
- s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", cs, "dateTimeGrouping"), t.copyTo("day", as), t.copyTo("hour", as), t.copyTo("minute", as), t.copyTo("month", as), t.copyTo("second", as), t.copyTo("year", as);
1846
- }
1847
- };
1848
- l.registerVisitor(k);
1849
- const E = /* @__PURE__ */ new Map();
1850
- E.set("filterColumn", {
1851
- from: "filterColumn",
1852
- transparent: !0
1853
- }), E.set("filters", C), E.set("filter", A), E.set("dateGroupItem", k), l.registerVisitor({
1854
- from: "customFilters",
1855
- openTag: (t) => {
1856
- const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s, r = [];
1857
- return e.operator = o ? m.BuiltInOperatorNames.And : m.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
1858
- },
1859
- closeTag: (t) => {
1860
- const e = t.getSource(), s = e?.param;
1861
- if (!e || !s) return;
1862
- const o = 1 === s.length ? s[0] : O(e);
1863
- o !== e && (e.operator = o.operator, e.param = o.param);
1864
- }
1865
- }), l.registerVisitor({
1866
- from: "customFilter",
1867
- openTag: (t) => {
1868
- const e = t.getParent();
1869
- let s;
1870
- Array.isArray(e) ? (s = {}, e.push(s)) : s = e;
1871
- const o = Lt({
1872
- operator: t.getAttribute("operator"),
1873
- val: t.getAttribute("val")
1874
- }, (e) => t.warn(e));
1875
- o && (s.operator = o.operator, s.param = o.param);
1876
- }
1877
- });
1878
- let I = {}, P = null;
1879
- l.registerVisitor({
1880
- from: "sortState",
1881
- to: {},
1882
- openTag: (t) => {
1883
- const e = t.getParent();
1884
- let s = e.v;
1885
- if (!s) return;
1886
- const o = {};
1887
- I = {};
1888
- const r = t.getAttribute("caseSensitive", is);
1889
- null != r && (I.collatorOptions = r ? v.CaseSensitiveOptions : v.CaseInsensitiveOptions);
1890
- const n = t.getAttribute("sortMethod");
1891
- "stroke" !== n && "pinYin" !== n || (I.collatorOptions = {
1892
- ...I.collatorOptions,
1893
- collation: "stroke" === n ? "stroke" : "pinyin"
1894
- }), t.getAttribute("columnSort", is) && (o.axis = u.Axis.Column);
1895
- const i = t.getAttribute("ref"), a = e.r;
1896
- P = i && a ? p.fastStringToRange(i) : null, P && (o.extent = { range: vt(a, P) }), s.sort = o, t.setSource(e);
1897
- }
1898
- }), l.registerVisitor({
1899
- from: "sortCondition",
1900
- to: {},
1901
- openTag: (t) => {
1902
- const e = t.getParent(), s = e.v;
1903
- if (!s) return;
1904
- const o = s.sort;
1905
- if (!o) return;
1906
- let r = o.sorts;
1907
- r || (r = [], o.sorts = r);
1908
- const n = t.getAttribute("ref");
1909
- let i = 0, a = null;
1910
- if (n) {
1911
- const t = p.fastStringToRange(n, Xs), s = t.colStart, o = e.r, r = o.colStart;
1912
- i = o ? s - r : s, o && P && (a = Vt(o, P, t));
1913
- }
1914
- o.extent && (o.extent.sorts ??= []).push(a);
1915
- const l = { ...I }, h = B(t.getAttribute("sortBy"));
1916
- h && (l.sortOn = h);
1917
- const u = c(t);
1918
- u && (l.style = u), t.copyToObject(l, "iconSet", cs), t.copyToObject(l, "customList", cs), l.reverse = t.getAttribute("descending", is) ?? !1;
1919
- const d = {
1920
- index: i,
1921
- criteria: l
1922
- };
1923
- r.push(d);
1924
- }
1925
- });
1926
- const D = (t) => {
1927
- y = t.getSource(), T = "topLeft", t.copyTo("topLeft", cs, "topLeftCell");
1928
- const e = zt(t.getAttribute("defaultGridColor")), s = t.getAttribute("colorId");
1929
- null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros", is), t.copyTo("showFormulas", is), t.copyTo("zoomScale", as), t.copyTo("viewMode", cs, "view");
1930
- const o = {};
1931
- for (const [e, s] of xt) {
1932
- const r = t.getAttribute(s, as);
1933
- r && (o[e] = Math.min(400, Math.max(10, r)));
1934
- }
1935
- Object.keys(o).length > 0 && (t.getSource().zoomScales = o), t.copyTo("showRuler", is), t.copyTo("showWhitespace", is, "showWhiteSpace"), t.copyTo("windowProtection", is), t.copyTo("showRowHeaders", is, "showRowColHeaders"), t.copyTo("showColumnHeaders", is, "showRowColHeaders"), t.copyTo("showRowGridlines", is, "showGridLines"), t.copyTo("showColumnGridlines", is, "showGridLines"), t.copyTo("rightToLeft", is), t.copyTo("showOutlineSymbols", is);
1936
- };
1937
- l.registerVisitor({
1938
- from: "sheetView",
1939
- to: "view",
1940
- openTag: (t) => {
1941
- D(t);
1942
- },
1943
- closeTag: () => {
1944
- y = null;
1945
- }
1946
- }), l.registerVisitor({
1947
- from: "customSheetViews",
1948
- to: "customSheetViews",
1949
- openTag: (t) => {
1950
- t.setSource([]);
1951
- }
1952
- }), l.registerVisitor({
1953
- from: "customSheetView",
1954
- to: [],
1955
- openTag: (t) => {
1956
- _ = !0, D(t);
1957
- },
1958
- closeTag: () => {
1959
- _ = !1, y = null;
1960
- }
1961
- }), l.registerVisitor({
1962
- from: "selection",
1963
- to: null,
1964
- openTag: (t) => {
1965
- if (!y) return;
1966
- const e = t.getAttribute("activeCell")?.replace(/\$/g, ""), s = t.getAttribute("sqref")?.replace(/\$/g, ""), o = t.getAttribute("pane") ?? "topLeft";
1967
- if (o !== T) {
1968
- const t = y.freezePanes;
1969
- if (t && e) {
1970
- const r = { activeCell: e };
1971
- s && s !== e && (r.sqref = s), (t.paneSelections ??= {})[o] = r;
1972
- }
1973
- return;
1974
- }
1975
- const r = {};
1976
- e && (r.cell = e);
1977
- const n = t.getAttribute("activeCellId", as);
1978
- null !== n && (r.rangeIndex = n), s && s !== e && (r.ranges = s.trim().split(/\s+/)), y.selection = r;
1979
- }
1980
- }), l.registerVisitor({
1981
- from: "pane",
1982
- to: null,
1983
- openTag: (t) => {
1984
- if (!y) return;
1985
- T = t.getAttribute("activePane") ?? "topLeft";
1986
- const e = t.getAttribute("state");
1987
- if ("frozen" === e || "frozenSplit" === e) {
1988
- const e = {};
1989
- y.freezePanes = e, t.copyToObject(e, "topLeft", cs, "topLeftCell");
1990
- const s = (y.topLeft ? p.fastStringToCell(y.topLeft) : void 0) ?? {
1991
- colIndex: 0,
1992
- rowIndex: 0
1993
- }, o = {
1994
- colIndex: 0,
1995
- rowIndex: 0
1996
- };
1997
- t.copyToObject(o, "colIndex", as, "xSplit"), t.copyToObject(o, "rowIndex", as, "ySplit");
1998
- const r = {
1999
- colIndex: s.colIndex + o.colIndex,
2000
- rowIndex: s.rowIndex + o.rowIndex
2001
- };
2002
- e.coords = p.cellToString(r);
2003
- }
2004
- }
2005
- }), l.registerVisitor({
2006
- from: "sheetPr",
2007
- transparent: !0,
2008
- openTag: (e) => {
2009
- const s = e.getAttribute("codeName");
2010
- s && (t.codeName = s), !1 === e.getAttribute("enableFormatConditionsCalculation", is) && (t.conditionalFormatCalculation = !1), !0 === e.getAttribute("transitionEvaluation", is) && (t.transitionFormulaEvaluation = !0), !0 === e.getAttribute("transitionEntry", is) && (t.transitionFormulaEntry = !0), !1 === e.getAttribute("published", is) && (t.excludeFromPublishing = !0);
2011
- const o = {};
2012
- !0 === e.getAttribute("syncHorizontal", is) && (o.horizontal = !0), !0 === e.getAttribute("syncVertical", is) && (o.vertical = !0);
2013
- const r = e.getAttribute("syncRef");
2014
- r && (o.anchor = r), Object.keys(o).length > 0 && (t.syncScroll = o);
2015
- }
2016
- }), l.registerVisitor({
2017
- from: "tabColor",
2018
- to: null,
2019
- openTag: (e) => {
2020
- const s = $t((t) => e.getAttribute(t));
2021
- s && (t.tabColor = s);
2022
- }
2023
- });
2024
- let _ = !1;
2025
- const N = () => t.pageLayout ??= {};
2026
- l.registerVisitor({
2027
- from: "pageSetUpPr",
2028
- to: null,
2029
- openTag: (t) => {
2030
- !0 === t.getAttribute("fitToPage", is) && (N().fitToPage = !0), !1 === t.getAttribute("autoPageBreaks", is) && (N().hideAutoPageBreaks = !0);
2031
- }
2032
- }), l.registerVisitor({
2033
- from: "outlinePr",
2034
- to: null,
2035
- openTag: (e) => {
2036
- const s = (t) => {
2037
- const s = e.getAttribute(t);
2038
- return "0" === s || "false" === s;
2039
- }, o = {};
2040
- s("summaryBelow") && (o.summaryRow = "up"), s("summaryRight") && (o.summaryColumn = "left"), (() => {
2041
- const t = e.getAttribute("applyStyles");
2042
- return "1" === t || "true" === t;
2043
- })() && (o.automaticStyles = !0), Object.keys(o).length > 0 && (t.outline = o);
2044
- }
2045
- }), l.registerVisitor({
2046
- from: "pageMargins",
2047
- to: null,
2048
- openTag: (t) => {
2049
- if (_) return;
2050
- const e = (e, s) => t.getAttribute(e, ls) ?? s, s = {
2051
- left: e("left", .7),
2052
- right: e("right", .7),
2053
- top: e("top", .75),
2054
- bottom: e("bottom", .75),
2055
- header: e("header", .3),
2056
- footer: e("footer", .3)
2057
- };
2058
- .7 === s.left && .7 === s.right && .75 === s.top && .75 === s.bottom && .3 === s.header && .3 === s.footer || (N().margins = s);
2059
- }
2060
- }), l.registerVisitor({
2061
- from: "pageSetup",
2062
- to: null,
2063
- openTag: (t) => {
2064
- if (_) return;
2065
- const s = N(), o = (e) => t.getAttribute(e, as) ?? void 0, r = (e) => t.getAttribute(e, is), n = t.getAttribute("orientation");
2066
- "landscape" !== n && "portrait" !== n || (s.orientation = n);
2067
- for (const t of [
2068
- "paperSize",
2069
- "scale",
2070
- "fitToWidth",
2071
- "fitToHeight",
2072
- "firstPageNumber",
2073
- "horizontalDpi",
2074
- "verticalDpi",
2075
- "copies"
2076
- ]) {
2077
- const e = o(t);
2078
- void 0 !== e && (s[t] = e);
2079
- }
2080
- const i = t.getAttribute("paperHeight");
2081
- i && (s.paperHeight = i);
2082
- const a = t.getAttribute("paperWidth");
2083
- a && (s.paperWidth = a), "overThenDown" === t.getAttribute("pageOrder") && (s.printOrder = "overThenDown"), !0 === r("blackAndWhite") && (s.blackAndWhite = !0), !0 === r("draft") && (s.draftMode = !0), !0 === r("useFirstPageNumber") && (s.useFirstPageNumber = !0), !1 === r("usePrinterDefaults") && (s.ignorePrinterDefaults = !0);
2084
- const l = t.getAttribute("cellComments"), c = Xt.find(([t]) => t === l)?.[1];
2085
- c && (s.printComments = c);
2086
- const h = t.getAttribute("errors"), u = K.find(([t]) => t === h)?.[1];
2087
- u && (s.printErrors = u);
2088
- const d = t.getAttribute("r:id"), p = d ? e(d, "part") : null;
2089
- p && (s.printerSettings = p);
2090
- }
2091
- }), l.registerVisitor({
2092
- from: "printOptions",
2093
- to: null,
2094
- openTag: (t) => {
2095
- if (_) return;
2096
- const e = (e) => !0 === t.getAttribute(e, is);
2097
- e("horizontalCentered") && (N().centerHorizontally = !0), e("verticalCentered") && (N().centerVertically = !0), e("gridLines") && (N().printGridlines = !0), e("headings") && (N().printHeadings = !0);
2098
- }
2099
- }), l.registerVisitor({
2100
- from: "headerFooter",
2101
- to: {},
2102
- openTag: (t) => {
2103
- if (_) return;
2104
- const e = {}, s = (e) => t.getAttribute(e, is);
2105
- !0 === s("differentOddEven") && (e.differentOddEven = !0), !0 === s("differentFirst") && (e.differentFirst = !0), !1 === s("scaleWithDoc") && (e.ignoreSheetScale = !0), !1 === s("alignWithMargins") && (e.ignoreSheetMargins = !0), Object.keys(e).length > 0 && (N().headerFooter = e);
2106
- }
2107
- });
2108
- for (const t of mt) l.registerVisitor({
2109
- from: t,
2110
- to: {},
2111
- text: (e, s) => {
2112
- if (_) return;
2113
- const o = N(), r = o.headerFooter ??= {};
2114
- r[t] = (r[t] ?? "") + ct(e);
2115
- }
2116
- });
2117
- let $ = "rowBreaks";
2118
- for (const [t, e] of [["rowBreaks", "rowBreaks"], ["colBreaks", "columnBreaks"]]) l.registerVisitor({
2119
- from: t,
2120
- to: {},
2121
- openTag: () => {
2122
- $ = e;
2123
- }
2124
- });
2125
- l.registerVisitor({
2126
- from: "brk",
2127
- to: null,
2128
- openTag: (t) => {
2129
- if (_) return;
2130
- const e = t.getAttribute("id", as);
2131
- if (null == e) return;
2132
- const s = { index: e }, o = t.getAttribute("min", as);
2133
- null != o && (s.min = o);
2134
- const r = t.getAttribute("max", as);
2135
- null != r && (s.max = r), !0 !== t.getAttribute("man", is) && (s.automatic = !0), !0 === t.getAttribute("pt", is) && (s.pivot = !0);
2136
- const n = N();
2137
- (n[$] ??= []).push(s);
2138
- }
2139
- }), l.registerVisitor({
2140
- from: "ignoredErrors",
2141
- transparent: !0
2142
- }), l.registerVisitor({
2143
- from: "ignoredError",
2144
- to: null,
2145
- openTag: (e) => {
2146
- const s = e.getAttribute("sqref");
2147
- if (!s) return;
2148
- const o = [];
2149
- for (const t of F) !0 === e.getAttribute(t, is) && o.push(t);
2150
- if (0 !== o.length) for (const e of s.trim().split(/\s+/)) (t.ignoredErrors ??= []).push({
2151
- r: e,
2152
- v: o
2153
- });
2154
- }
2155
- }), l.registerVisitor({
2156
- from: "mergeCells",
2157
- to: "merges",
2158
- openTag: (t) => {
2159
- t.setSource([]);
2160
- }
2161
- }), l.registerVisitor({
2162
- from: "dataValidations",
2163
- to: "validations",
2164
- openTag: (e) => {
2165
- e.setSource([]);
2166
- const s = {};
2167
- !0 === e.getAttribute("disablePrompts", is) && (s.disablePrompts = !0);
2168
- const o = e.getAttribute("xWindow", as);
2169
- null !== o && (s.windowX = o);
2170
- const r = e.getAttribute("yWindow", as);
2171
- null !== r && (s.windowY = r), Object.keys(s).length > 0 && (t.validationSettings = {
2172
- ...t.validationSettings,
2173
- ...s
2174
- });
2175
- }
2176
- });
2177
- const V = {
2178
- from: "dataValidation",
2179
- to: [],
2180
- openTag: (t) => {
2181
- let e = t.getAttribute("sqref");
2182
- e && (e = e.trim().split(/\s+/).join(","));
2183
- const s = {}, o = {
2184
- r: e,
2185
- v: s,
2186
- rule: {
2187
- type: t.getAttribute("type") ?? void 0,
2188
- operator: t.getAttribute("operator") ?? void 0
2189
- }
2190
- };
2191
- !0 === t.getAttribute("showDropDown", is) && (s.hideDropdown = !0), t.copyToObject(s, "alert", cs, "error"), t.copyToObject(s, "alertTitle", cs, "errorTitle"), t.copyToObject(s, "showAlertMessage", is, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", is, "showInputMessage"), t.setSource(o);
2192
- },
2193
- closeTag: (t) => {
2194
- const e = t.getSource();
2195
- if (!e?.rule) return;
2196
- const s = Dt(e.rule, n);
2197
- s && (t.getAttribute("allowBlank", is) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
2198
- }
2199
- };
2200
- l.registerVisitor(V), l.registerVisitor({
2201
- from: "formula1",
2202
- to: {},
2203
- text: (t, e) => {
2204
- const s = e.getParent().rule;
2205
- s?.type && (s.formula1 = wt(g(t), s.type));
2206
- }
2207
- }), l.registerVisitor({
2208
- from: "formula2",
2209
- to: {},
2210
- text: (t, e) => {
2211
- const s = e.getParent().rule;
2212
- s?.type && (s.formula2 = wt(g(t), s.type));
2213
- }
2214
- }), l.registerVisitor({
2215
- from: "picture",
2216
- to: "picture",
2217
- openTag: (t) => {
2218
- const s = t.getAttribute("r:id");
2219
- if (!s) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.sheet.picture.noRel" });
2220
- const o = e(s, "resource");
2221
- t.getSource().resId = o;
2222
- }
2223
- });
2224
- const M = {
2225
- from: "slicer",
2226
- to: {},
2227
- openTag: (t) => {
2228
- const s = t.getAttribute("r:id");
2229
- if (!s) return void t.warn("A slicer names no cache; it was not imported.", { onceKey: "xlsx.sheet.slicer.noRel" });
2230
- const o = e(s)?.slicers, r = t.getParent();
2231
- r.slicers || (r.slicers = {});
2232
- const n = Object.keys(o);
2233
- for (const t of n) r.slicers[t] = o[t];
2234
- }
2235
- };
2236
- l.registerVisitor(M);
2237
- const j = (t, e) => ({
2238
- from: t,
2239
- to: {},
2240
- openTag: (t) => {
2241
- t.setSource("");
2242
- },
2243
- text: (t, e) => {
2244
- e.setSource((e.getSource() ?? "") + t);
2245
- },
2246
- closeTag: (t) => {
2247
- e(String(t.getSource() ?? ""), t);
2248
- }
2249
- }), H = /* @__PURE__ */ new Map();
2250
- H.set("dataValidations", {
2251
- from: "dataValidations",
2252
- to: "validations",
2253
- openTag: (t) => {
2254
- const e = t.getParent();
2255
- t.setSource(e.validations ?? []);
2256
- },
2257
- closeTag: (t) => {
2258
- 0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
2259
- }
2260
- }), H.set("dataValidation", {
2261
- ...V,
2262
- closeTag: (t) => {
2263
- V.closeTag(t);
2264
- const e = t.getSource();
2265
- e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
2266
- }
2267
- });
2268
- const z = (t) => ({
2269
- from: t,
2270
- to: {},
2271
- openTag: (e) => {
2272
- e.setSource({
2273
- rule: e.getParent()?.rule,
2274
- key: t
2275
- });
2276
- }
2277
- });
2278
- H.set("formula1", z("formula1")), H.set("formula2", z("formula2")), H.set("f", j("f", (t, e) => {
2279
- const s = e.getParent(), o = s?.rule;
2280
- o && (o[s.key] = wt(g(t), o.type));
2281
- })), H.set("sqref", j("sqref", (t, e) => {
2282
- const s = e.getParent(), o = t.trim();
2283
- s && o && (s.r = o.split(/\s+/).join(","));
2284
- }));
2285
- const X = /* @__PURE__ */ new Map(), q = [], G = /* @__PURE__ */ new Map();
2286
- G.set("conditionalFormattings", {
2287
- from: "conditionalFormattings",
2288
- transparent: !0
2289
- }), G.set("conditionalFormatting", {
2290
- from: "conditionalFormatting",
2291
- to: {},
2292
- openTag: (t) => {
2293
- t.setSource({ rules: [] });
2294
- },
2295
- closeTag: (t) => {
2296
- const e = t.getSource(), s = e?.rules ?? [];
2297
- for (let t = 0; t < s.length; t++) {
2298
- const o = s[t];
2299
- o.sqref = e.sqref, o.id ? X.set(o.id, o) : q.push(o);
2300
- }
2301
- }
2302
- }), G.set("cfRule", {
2303
- from: "cfRule",
2304
- to: {},
2305
- openTag: (t) => {
2306
- t.copyTo("id", cs), t.copyTo("type", cs), t.copyTo("priority", as), t.copyTo("stopIfTrue", is), t.copyTo("operator", cs), t.copyTo("text", cs), t.copyTo("timePeriod", cs), t.copyTo("aboveAverage", is), t.copyTo("equalAverage", is), t.copyTo("stdDev", as), t.copyTo("bottom", is), t.copyTo("percent", is), t.copyTo("rank", as);
2307
- },
2308
- closeTag: (t) => {
2309
- const e = t.getSource();
2310
- e && t.getParent()?.rules?.push(e);
2311
- }
2312
- }), G.set("sqref", j("sqref", (t, e) => {
2313
- const s = e.getParent(), o = t.trim();
2314
- s && o && (s.sqref = o);
2315
- })), G.set("dataBar", {
2316
- from: "dataBar",
2317
- to: {},
2318
- openTag: (t) => {
2319
- t.copyTo("minLength", as), t.copyTo("maxLength", as), t.copyTo("gradient", is), t.copyTo("border", is), t.copyTo("direction", cs), t.copyTo("axisPosition", cs), t.copyTo("negativeBarColorSameAsPositive", is), t.copyTo("negativeBarBorderColorSameAsPositive", is);
2320
- },
2321
- closeTag: (t) => {
2322
- t.getParent().dataBar = t.getSource();
2323
- }
2324
- }), G.set("iconSet", {
2325
- from: "iconSet",
2326
- to: {},
2327
- openTag: (t) => {
2328
- t.copyTo("iconSet", cs), t.copyTo("custom", is), t.copyTo("reverse", is), t.copyTo("showValue", is);
2329
- },
2330
- closeTag: (t) => {
2331
- t.getParent().iconSet = t.getSource();
2332
- }
2333
- });
2334
- const Q = /* @__PURE__ */ new Map();
2335
- Q.set("f", j("f", (t, e) => {
2336
- const s = e.getParent();
2337
- if (!s) return;
2338
- const o = t.trim(), r = Number(o);
2339
- s.value = o.length > 0 && Number.isFinite(r) ? r : g(t);
2340
- })), G.set("cfvo", {
2341
- from: "cfvo",
2342
- to: {},
2343
- scope: () => Q,
2344
- openTag: (t) => {
2345
- const e = t.getParent();
2346
- e.conditions || (e.conditions = []);
2347
- const s = t.getSource();
2348
- e.conditions.push(s), t.copyTo("type", cs), !1 === t.getAttribute("gte", is) && (s.exclusive = !0);
2349
- }
2350
- }), G.set("f", j("f", (t, e) => {
2351
- const s = e.getParent();
2352
- s && (s.formulas ??= []).push(g(t));
2353
- })), G.set("dxf", {
2354
- from: "dxf",
2355
- to: {},
2356
- raw: !0,
2357
- closeTag: (t) => {
2358
- if (!d) return;
2359
- const e = t.getParent();
2360
- if (!e) return;
2361
- const s = d(t.getRawXml() ?? "");
2362
- s && (e.style = s);
2363
- }
2364
- });
2365
- const Y = (t) => ({
2366
- from: t,
2367
- to: {},
2368
- openTag: (e) => {
2369
- const s = $t((t) => e.getAttribute(t));
2370
- s && (e.getParent()[t] = s);
2371
- }
2372
- });
2373
- G.set("borderColor", Y("borderColor")), G.set("negativeFillColor", Y("negativeFillColor")), G.set("negativeBorderColor", Y("negativeBorderColor")), G.set("axisColor", Y("axisColor")), G.set("cfIcon", {
2374
- from: "cfIcon",
2375
- to: {},
2376
- openTag: (t) => {
2377
- const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", as);
2378
- if (null === e || null === s) return;
2379
- const o = t.getParent();
2380
- o.icons || (o.icons = []), o.icons.push({
2381
- set: e,
2382
- id: s
2383
- });
2384
- }
2385
- });
2386
- const tt = /* @__PURE__ */ new Map();
2387
- tt.set("id", j("id", (t, e) => {
2388
- const s = e.getParent(), o = t.trim();
2389
- s && o && (s.x14Id = o);
2390
- }));
2391
- const et = /* @__PURE__ */ new Map();
2392
- et.set("slicerList", {
2393
- from: "slicerList",
2394
- transparent: !0
2395
- }), et.set("slicer", M);
2396
- const rt = /* @__PURE__ */ new Map([
2397
- [ht(Z), H],
2398
- [ht(ot), G],
2399
- [ht(pt), G],
2400
- [ht(It), tt],
2401
- [ht(W), et],
2402
- [ht(jt), et],
2403
- [ht(Ct), E]
2404
- ]), nt = /* @__PURE__ */ new Set();
2405
- l.registerVisitor({
2406
- from: "extLst",
2407
- transparent: !0
2408
- }), l.registerVisitor({
2409
- from: "ext",
2410
- transparent: !0,
2411
- scope: (t) => {
2412
- const e = t.getAttribute("uri"), s = ht(e), o = rt.get(s);
2413
- if (o) return o;
2414
- if (!ut.has(s) && !nt.has(s)) {
2415
- nt.add(s);
2416
- const o = U[s];
2417
- t.warn(o ? `Extension content '${o}' (${e}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${e}) is not read; it will be lost on resave.`);
2418
- }
2419
- return null;
2420
- }
2421
- }), l.registerVisitor({
2422
- from: "mergeCell",
2423
- to: [],
2424
- openTag: (t) => {
2425
- const e = t.getAttribute("ref");
2426
- t.setSource(e);
2427
- }
2428
- }), l.registerVisitor({
2429
- from: "hyperlinks",
2430
- to: "hyperlinks",
2431
- openTag: (t) => {
2432
- t.setSource([]);
2433
- }
2434
- }), l.registerVisitor({
2435
- from: "hyperlink",
2436
- to: [],
2437
- openTag: (t) => {
2438
- const s = t.getAttribute("r:id"), o = t.getAttribute("ref");
2439
- if (!o) return void t.warn("A hyperlink has no ref; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.noRef" });
2440
- t.setKey(o);
2441
- let r = s ? e(s) : "";
2442
- if ("string" != typeof r) return void t.warn("A hyperlink has an invalid address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
2443
- r.endsWith("\\") && (r = r.substring(0, r.length - 1));
2444
- const n = t.getAttribute("location");
2445
- if (n && (r += "#" + n), !r) return void t.warn("A hyperlink has no address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
2446
- let i;
2447
- const a = t.getAttribute("tooltip"), l = t.getAttribute("display");
2448
- a || l ? (i = { address: r }, a && (i.screenTip = a), l && (i.display = l)) : i = r, t.setSource({
2449
- r: o,
2450
- v: i
2451
- });
2452
- }
2453
- }), l.registerVisitor({
2454
- from: "drawing",
2455
- to: "movables",
2456
- openTag: (t) => {
2457
- const s = t.getAttribute("r:id");
2458
- if (!s) return;
2459
- const o = e(s);
2460
- o ? t.setSource(o.movables) : t.warn("A drawing part is missing; its shapes were not imported.", { onceKey: "xlsx.sheet.drawing.missing" });
2461
- }
2462
- }), l.registerVisitor({
2463
- from: "legacyDrawing",
2464
- to: "legacyDrawing",
2465
- openTag: (t) => {
2466
- t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2467
- }
2468
- }), l.registerVisitor({
2469
- from: "legacyDrawingHF",
2470
- to: "legacyDrawingHF",
2471
- openTag: (t) => {
2472
- t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2473
- }
2474
- });
2475
- let it = null, at = !1;
2476
- const lt = /* @__PURE__ */ new Map(), dt = {
2477
- from: "Fallback",
2478
- to: null
2479
- }, ft = {
2480
- from: "Choice",
2481
- transparent: !0
2482
- };
2483
- lt.set("Fallback", dt), lt.set("Choice", ft), lt.set("control", {
2484
- from: "control",
2485
- transparent: !0,
2486
- openTag: (t) => {
2487
- const s = t.getAttribute("name"), o = t.getAttribute("r:id"), r = o ? e(o, "formControl") : null;
2488
- if (!r) return t.warn(`The form control '${s ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (it = null);
2489
- const n = r.json, i = parseInt(t.getAttribute("shapeId") ?? "", 10);
2490
- isNaN(i) || (n.shapeId = i);
2491
- const a = {
2492
- anchor: {
2493
- tl: {
2494
- c: 0,
2495
- r: 0,
2496
- x: 0,
2497
- y: 0
2498
- },
2499
- br: {
2500
- c: 0,
2501
- r: 0,
2502
- x: 0,
2503
- y: 0
2504
- }
2505
- },
2506
- content: {
2507
- type: r.type,
2508
- json: n
2509
- }
2510
- };
2511
- s && (a.content.name = s), it = {
2512
- movable: a,
2513
- control: n
2514
- };
2515
- },
2516
- closeTag: () => {
2517
- it && (t.movables || (t.movables = []), t.movables.push(it.movable), it = null);
2518
- }
2519
- }), lt.set("controlPr", {
2520
- from: "controlPr",
2521
- transparent: !0,
2522
- raw: !0,
2523
- openTag: (t) => {
2524
- if (!it) return;
2525
- const e = t.getFrom().attributes ?? {}, s = {};
2526
- for (const t in e) {
2527
- const o = e[t];
2528
- s[t] = "string" == typeof o ? o : o?.value ?? "";
2529
- }
2530
- st(s, it.control);
2531
- },
2532
- closeTag: (t) => {
2533
- if (!it) return;
2534
- const e = ((t) => {
2535
- const e = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(t);
2536
- if (!e) return null;
2537
- const s = e[2], o = (t) => new RegExp(`<(?:[\\w.-]+:)?${t}\\b[^>]*>([\\s\\S]*?)<\\/(?:[\\w.-]+:)?${t}>`).exec(s)?.[1], r = e[1], n = /\bmoveWithCells="(?:1|true)"/.test(r), i = /\bsizeWithCells="(?:1|true)"/.test(r);
2538
- return {
2539
- anchor: {
2540
- tl: Vs(o("from")),
2541
- br: Vs(o("to"))
2542
- },
2543
- anchorType: n ? i ? "twoCell" : "oneCell" : "absolute",
2544
- rest: (t.slice(0, e.index) + t.slice(e.index + e[0].length)).trim()
2545
- };
2546
- })(t.getRawXml() ?? "");
2547
- e ? (it.movable.anchor = e.anchor, "twoCell" !== e.anchorType && (it.movable.anchorType = e.anchorType), e.rest && (it.control.xml = e.rest)) : at || (at = !0, t.warn("A form control has no anchor; it is placed at the top left of the sheet."));
2548
- }
2549
- });
2550
- const gt = {
2551
- from: "controls",
2552
- transparent: !0,
2553
- scope: () => lt
2554
- };
2555
- l.registerVisitor(gt);
2556
- const bt = /* @__PURE__ */ new Map([
2557
- ["Choice", ft],
2558
- ["Fallback", dt],
2559
- ["controls", gt]
2560
- ]);
2561
- l.registerVisitor({
2562
- from: "AlternateContent",
2563
- transparent: !0,
2564
- scope: () => bt
2565
- }), l.registerVisitor({
2566
- from: "tableParts",
2567
- to: "tables",
2568
- openTag: (t) => {
2569
- t.setSource([]);
2570
- }
2571
- }), l.registerVisitor({
2572
- from: "tablePart",
2573
- to: [],
2574
- openTag: (t) => {
2575
- const s = t.getAttribute("r:id");
2576
- if (!s) return;
2577
- const o = e(s);
2578
- o ? t.setSource(o) : t.warn("A table part is missing; the table was not imported.", { onceKey: "xlsx.sheet.table.missing" });
2579
- }
2580
- });
2581
- const yt = (t, e) => {
2582
- e.conditions?.length && (t.stops = S(e)), void 0 !== e.minLength && (t.minLength = e.minLength), void 0 !== e.maxLength && (t.maxLength = e.maxLength), (e.gradient ?? 1) && (t.gradient = !0), e.border && e.borderColor && (t.borderColor = e.borderColor), !e.negativeBarColorSameAsPositive && e.negativeFillColor && (t.negativeFillColor = e.negativeFillColor), !(e.negativeBarBorderColorSameAsPositive ?? 1) && e.negativeBorderColor && (t.negativeBorderColor = e.negativeBorderColor), e.axisColor && (t.axisColor = e.axisColor), "middle" !== e.axisPosition && "none" !== e.axisPosition || (t.axisPosition = e.axisPosition), "leftToRight" !== e.direction && "rightToLeft" !== e.direction || (t.direction = e.direction);
2583
- }, Tt = (t, e) => {
2584
- e.conditions?.length && (t.stops = S(e)), e.iconSet && e.iconSet !== t.iconSet && (t.iconSet = e.iconSet), e.icons?.length && (t.icon = e.icons), void 0 !== e.reverse && (t.reverse = e.reverse), void 0 !== e.showValue && (t.showValue = e.showValue);
2585
- }, St = (t) => {
2586
- if (!t.sqref) return null;
2587
- const e = t.sqref.split(/\s+/).join(",");
2588
- if ("iconSet" === t.type) {
2589
- if (!t.iconSet) return null;
2590
- const s = {
2591
- type: x.ScaleType.IconSet,
2592
- stops: []
2593
- };
2594
- return Tt(s, t.iconSet), {
2595
- r: e,
2596
- v: { scale: s },
2597
- priority: t.priority
2598
- };
2599
- }
2600
- const s = Nt(t, n);
2601
- if (!s) return null;
2602
- const o = { condition: s };
2603
- return t.style && (o.style = t.style), t.stopIfTrue && (o.stopIfTrue = !0), {
2604
- r: e,
2605
- v: o,
2606
- priority: t.priority
2607
- };
2608
- };
2609
- l.registerVisitor({
2610
- from: "worksheet",
2611
- to: {},
2612
- openTag: (t) => {},
2613
- closeTag: (t) => {
2614
- const e = t.getSource();
2615
- let s = e?.conditionals;
2616
- if (s) for (let t = 0; t < s.length; t++) {
2617
- const e = s[t], o = e.x14Id;
2618
- if (!o) continue;
2619
- delete e.x14Id;
2620
- const r = X.get(o);
2621
- if (!r) continue;
2622
- X.delete(o);
2623
- const n = e.v?.scale;
2624
- r.dataBar && n?.type === x.ScaleType.DataBar ? yt(n, r.dataBar) : r.iconSet && n?.type === x.ScaleType.IconSet && Tt(n, r.iconSet);
2625
- }
2626
- const o = [...X.values(), ...q], r = /* @__PURE__ */ new Set();
2627
- let i = 0;
2628
- for (let t = 0; t < o.length; t++) {
2629
- const n = St(o[t]);
2630
- n ? (s || (s = [], e.conditionals = s), s.push(n)) : (r.add(o[t].type ?? "unknown"), i++);
2631
- }
2632
- if (i > 0) {
2633
- const t = [...r].map((t) => `'${t}'`).join(", ");
2634
- n?.(1 === i ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${i} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
2635
- }
2636
- if (s) {
2637
- s.length > 1 && s.sort((t, e) => (t.priority ?? 1 / 0) - (e.priority ?? 1 / 0));
2638
- for (let t = 0; t < s.length; t++) delete s[t].priority;
2639
- }
2640
- }
2641
- }), l.registerVisitor({
2642
- from: "customProperties",
2643
- to: "customProperties",
2644
- openTag: (t) => {
2645
- t.setSource([]);
2646
- },
2647
- closeTag: (t) => {
2648
- const e = t.getSource();
2649
- e.length > 0 && (t.getParent().customProperties = e);
2650
- }
2651
- }), l.registerVisitor({
2652
- from: "customPr",
2653
- to: {},
2654
- openTag: (t) => {
2655
- const s = t.getParent();
2656
- t.copyTo("name");
2657
- const o = t.getAttribute("r:id");
2658
- if (!o) return void t.warn("A custom property names no part; it was not imported.", { onceKey: "xlsx.sheet.customProperty.noRel" });
2659
- const r = e(o, "resource"), n = t.getSource();
2660
- n.resId = r, s.push(n);
2661
- }
2662
- }), l.registerVisitor({
2663
- from: "sheetProtection",
2664
- to: "protection",
2665
- openTag: (t) => {
2666
- const e = t.getSource();
2667
- for (const s of L) {
2668
- const o = t.hasAttribute(s.attribute) ? t.getAttribute(s.attribute) : null;
2669
- e[s.key] = J(s, o);
2670
- }
2671
- if (e.sheet) return;
2672
- const s = {};
2673
- t.copyToObject(s, "hash", cs, "hashValue"), t.copyToObject(s, "algorithm", cs, "algorithmName"), t.copyToObject(s, "salt", cs, "saltValue"), t.copyToObject(s, "spinCount", as), t.copyToObject(s, "legacyHash", cs, "password"), Object.keys(s).length > 0 && (t.getSource().password = s);
2674
- }
2675
- }), l.registerVisitor({
2676
- from: "protectedRanges",
2677
- to: "protectedRanges",
2678
- openTag: (t) => {
2679
- t.setSource([]);
2680
- }
2681
- }), l.registerVisitor({
2682
- from: "protectedRange",
2683
- to: [],
2684
- openTag: (t) => {
2685
- let e = t.getAttribute("sqref");
2686
- e && (e = e.trim().split(/\s+/).join(","));
2687
- const s = {}, o = {
2688
- r: e,
2689
- v: s
2690
- };
2691
- t.copyToObject(s, "name"), t.copyToObject(s, "securityDescriptor");
2692
- const r = {};
2693
- t.copyToObject(r, "hash", cs, "hashValue"), t.copyToObject(r, "algorithm", cs, "algorithmName"), t.copyToObject(r, "salt", cs, "saltValue"), t.copyToObject(r, "spinCount", as), t.copyToObject(r, "legacyHash", cs, "password"), Object.keys(r).length > 0 && (s.password = r), t.setSource(o);
2694
- },
2695
- closeTag: (t) => {
2696
- const e = t.getSource();
2697
- e?.r && e.v.name || t.setSource(void 0);
2698
- }
2699
- }), l.registerVisitor({
2700
- from: "sheetFormatPr",
2701
- to: "sheetFormatPr",
2702
- openTag: (e) => {
2703
- e.copyToObject(t, "defaultColSize", ls, "defaultColWidth");
2704
- const s = e.getAttribute("customHeight");
2705
- "1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize", ls, "defaultRowHeight");
2706
- const o = e.getAttribute("baseColWidth", as);
2707
- o && 8 !== o && (t.baseColSize = o), h = !!e.getAttribute("zeroHeight", is);
2708
- }
2709
- }), l.registerVisitor({
2710
- from: "cols",
2711
- to: "cols",
2712
- openTag: (t) => {
2713
- t.setSource([]);
2714
- }
2715
- }), l.registerVisitor({
2716
- from: "col",
2717
- to: [],
2718
- openTag: (t) => {
2719
- const e = t.getSource(), s = t.getAttribute("min"), o = t.getAttribute("max"), r = void 0 === s ? 0 : parseInt(s) - 1, n = void 0 === o ? r : parseInt(o) - 1;
2720
- e.r = p.runToString(r, n, !0);
2721
- const i = {};
2722
- e.v = i, t.copyToObject(i, "sz", ls, "width"), t.copyToObject(i, "csz", is, "customWidth"), t.copyToObject(i, "h", is, "hidden"), t.copyToObject(i, "l", as, "outlineLevel"), t.copyToObject(i, "cl", is, "collapsed"), t.getAttribute("bestFit", is) && (i.bf = !0), t.copyToObject(i, "s", as, "style");
2723
- }
2724
- }), l.registerVisitor({
2725
- from: "oleObjects",
2726
- to: null,
2727
- openTag: (t) => {
2728
- t.warn("'OLE Objects' are not supported.");
2729
- }
2730
- });
2731
- let At = !1, kt = !1, Et = 0, Pt = "", Ot = "";
2732
- const _t = (t) => {
2733
- const e = t.indexOf(":");
2734
- return -1 === e ? t : t.slice(e + 1);
2735
- }, Rt = new Ds();
2736
- return Us(b, t, l.createEventHandler(t, r, n), n, i, {
2737
- onOpenTag: (t) => {
2738
- At = !0;
2739
- const e = _t(t.name);
2740
- "t" === e || "v" === e ? 0 === Et && (kt = !0) : "rPh" === e || "phoneticPr" === e ? Et++ : 0 === Et && Rt.onOpenTag(e, t.attributes);
2741
- },
2742
- onText: (t) => {
2743
- kt && (Pt += t, Rt.onText(t));
2744
- },
2745
- onCloseTag: (t) => {
2746
- const e = _t(t.name);
2747
- "t" === e || "v" === e ? kt = !1 : "rPh" === e || "phoneticPr" === e ? Et > 0 && Et-- : Rt.onCloseTag(e);
2748
- },
2749
- onEnd: () => {
2750
- if (!At) return;
2751
- const t = Rt.take();
2752
- At = !1, kt = !1, Et = 0;
2753
- const e = ct(Pt);
2754
- return Pt = "", Ot = e, t ? {
2755
- t: "r",
2756
- v: {
2757
- type: "richText",
2758
- data: { runs: _s(t, a?.get(Bs)) }
2759
- }
2760
- } : s(e);
2761
- },
2762
- onError: (t) => {}
2763
- }, a, s, () => h, () => Ot);
2764
- }, Hs = class {
2765
- static {
2766
- this.Collapsed = 1;
2767
- }
2768
- static {
2769
- this.CustomFormat = 2;
2770
- }
2771
- static {
2772
- this.CustomHeight = 4;
2773
- }
2774
- static {
2775
- this.Hidden = 8;
2776
- }
2777
- static {
2778
- this.Ht = 16;
2779
- }
2780
- static {
2781
- this.OutlineLevel = 32;
2782
- }
2783
- static {
2784
- this.Ph = 64;
2785
- }
2786
- static {
2787
- this.R = 128;
2788
- }
2789
- static {
2790
- this.S = 256;
2791
- }
2792
- static {
2793
- this.Spans = 512;
2794
- }
2795
- }, Ws = (t, e, s) => {
2796
- if (t[0].value[0] === t[1].value[0]) return e;
2797
- }, zs = /^\s*TABLE\s*\(/i, Xs = {
2798
- colStart: 0,
2799
- colEnd: 0,
2800
- rowStart: 0,
2801
- rowEnd: 0
2802
- }, qs = (t) => "1" === t || "true" === t, Us = (t, e, s, o, i, a, l, c, g, m) => {
2803
- let b = !1;
2804
- const y = [], x = l?.get(js), v = l?.get(Bs), w = /* @__PURE__ */ new Map();
2805
- let T = !1, S = [], A = !1, k = null, E = null, I = null, P = null, O = null, D = null;
2806
- const _ = l?.get("richData") ?? r.EmptyArray;
2807
- let N = null, $ = !1;
2808
- const V = p.normalizeA1ToR1C1, R = n.createConflatingRanges(), L = /* @__PURE__ */ new Map(), M = [], j = [];
2809
- let B = !1, F = !1, H = null;
2810
- const W = (t) => {
2811
- const e = (l?.get("metadata"))?.values;
2812
- if (!e) return;
2813
- const s = parseInt(t, 10);
2814
- if (!Number.isFinite(s) || s < 1) return;
2815
- const o = e[s - 1]?.get("XLRICHVALUE");
2816
- return void 0 !== o?.richValueIndex ? _[o.richValueIndex] : void 0;
2817
- };
2818
- let z = !1;
2819
- const X = n.createConflatingRanges();
2820
- let q, U = !1, G = -1, K = -1, Z = null, J = null;
2821
- const Q = (t) => ({
2822
- t: "r",
2823
- v: {
2824
- type: "hyperlink",
2825
- data: {
2826
- address: q,
2827
- friendly: t
2828
- }
2829
- }
2830
- });
2831
- let Y = null;
2832
- const tt = [];
2833
- let et = null, st = -2, ot = 0, rt = "", nt = "", it = "", at = "", lt = "", ct = "", ht = "", ut = "", pt = "", ft = "", gt = "", mt = "", bt = "", yt = "", xt = !0, vt = null, wt = !1, Tt = !1, Ct = !1, At = null, kt = 0;
2834
- const Et = (t) => {
2835
- let o = t.name;
2836
- const r = o.indexOf(":");
2837
- if (-1 !== r && (o = o.slice(r + 1)), kt++, kt % 196608 == 0 && i?.(kt), J) {
2838
- const e = t.attributes;
2839
- switch (o) {
2840
- case "v":
2841
- T = !0;
2842
- break;
2843
- case "f":
2844
- switch (A = !0, e.t ?? null) {
2845
- case null:
2846
- case "normal": break;
2847
- case "shared":
2848
- const t = e.si;
2849
- E = e.ref, k = t;
2850
- break;
2851
- case "array":
2852
- E = e.ref, H = E;
2853
- break;
2854
- case "dataTable": {
2855
- const t = ((t, e, s) => {
2856
- const o = t.r1, r = qs(t.del1);
2857
- if (!o && !r) return null;
2858
- const n = t.ref ?? p.cellToString({
2859
- rowIndex: e,
2860
- colIndex: s
2861
- }), i = p.fastStringToRange(n);
2862
- if (!i) return null;
2863
- const a = { ref: {
2864
- rowStart: i.rowStart,
2865
- colStart: i.colStart,
2866
- rowEnd: i.rowEnd,
2867
- colEnd: i.colEnd
2868
- } }, l = qs(t.dt2D);
2869
- if (l || qs(t.dtr) ? (o && (a.rowInput = o), r && (a.rowInputDeleted = !0)) : (o && (a.columnInput = o), r && (a.columnInputDeleted = !0)), l) {
2870
- const e = t.r2;
2871
- e && (a.columnInput = e), qs(t.del2) && (a.columnInputDeleted = !0);
2872
- }
2873
- return a;
2874
- })(e, G, K);
2875
- t && (j.push(t), qs(e.ca) && X.append(G, K));
2876
- return;
2877
- }
2878
- }
2879
- const t = e.ca;
2880
- void 0 !== t && (z = "1" === t);
2881
- break;
2882
- case "is":
2883
- U = !0;
2884
- return;
2885
- }
2886
- U && !A && a?.onOpenTag?.(t);
2887
- return;
2888
- }
2889
- if (b) {
2890
- if ("c" === o) {
2891
- J = t, q = void 0;
2892
- const e = t.attributes, s = e.r;
2893
- K = void 0 !== s ? p.fastStringToCol(s) : K + 1;
2894
- const o = e.t;
2895
- void 0 === o ? Y = null : (Y = o, "str" === Y && (U = !0));
2896
- let r = e.s;
2897
- void 0 === r && (null !== At || Ct) && (r = "0"), void 0 !== r && (r = parseInt(r), vt && vt.value === r && vt.colEnd + 1 === K ? vt.colEnd = K : (vt = {
2898
- colStart: K,
2899
- rowStart: G,
2900
- colEnd: K,
2901
- rowEnd: G,
2902
- value: r
2903
- }, S.push(vt))), H = null, F = !1, $ = !1;
2904
- const n = e.cm;
2905
- B = void 0 !== n && ((t) => {
2906
- const e = (l?.get("metadata"))?.cells;
2907
- if (!e) return !1;
2908
- const s = parseInt(t, 10);
2909
- return !(!Number.isFinite(s) || s < 1) && !0 === (e[s - 1]?.get("XLDAPR"))?.fDynamic;
2910
- })(n);
2911
- const i = e.vm;
2912
- if (void 0 !== i) {
2913
- const t = W(i);
2914
- if (h.isError(t)) {
2915
- const e = t.getCode();
2916
- Z = {
2917
- t: "e",
2918
- v: e
2919
- }, B && e === h.Code.Spill && (F = !0);
2920
- }
2921
- }
2922
- }
2923
- } else {
2924
- if (Tt && "row" === o) {
2925
- b = !0;
2926
- const e = t.attributes.r;
2927
- if (G = void 0 !== e ? parseInt(e) - 1 : G + 1, K = -1, g?.()) {
2928
- const t = y[y.length - 1];
2929
- t && t.max + 1 === G ? t.max = G : y.push({
2930
- min: G,
2931
- max: G
2932
- });
2933
- }
2934
- if (ot = 0, nt = t.attributes.customHeight, void 0 !== nt && (ot |= Hs.CustomHeight), nt !== pt && (xt = !0, pt = nt), rt = t.attributes.ht, void 0 !== rt && (ot |= Hs.Ht), rt !== ut && (xt = !0, ut = rt), it = t.attributes.hidden, void 0 !== it && (ot |= Hs.Hidden), it !== ft && (xt = !0, ft = it), lt = t.attributes.s, void 0 !== lt && (ot |= Hs.S), lt !== mt && (xt = !0, mt = lt), at = t.attributes.customFormat, void 0 !== at && (ot |= Hs.CustomFormat), at !== gt && (xt = !0, gt = at), ct = t.attributes.outlineLevel, void 0 !== ct && (ot |= Hs.OutlineLevel), ct !== bt && (xt = !0, bt = ct), ht = t.attributes.collapsed, void 0 !== ht && (ot |= Hs.Collapsed), ht !== yt && (xt = !0, yt = ht), 0 !== ot) if (st + 1 !== G || xt) {
2935
- const t = void 0 !== nt && ("1" === nt || "true" === nt), e = void 0 !== at && ("1" === at || "true" === at);
2936
- At = e && void 0 !== lt ? lt : null, e && null === At && (At = "0"), et = {
2937
- min: G,
2938
- max: G,
2939
- value: {
2940
- sz: void 0 === rt ? -1 : parseFloat(rt),
2941
- csz: t,
2942
- h: void 0 !== it && ("1" === it || "true" === it),
2943
- s: null === At ? void 0 : "0" === At ? 0 : parseInt(At),
2944
- l: void 0 === ct || "0" === ct ? 0 : parseInt(ct),
2945
- cl: void 0 !== ht && ("1" === ht || "true" === ht)
2946
- }
2947
- }, tt.push(et);
2948
- } else et.max = G;
2949
- st = G, xt = !1;
2950
- return;
2951
- }
2952
- if ("sheetData" === o && (Tt = !0), !wt && "sheetData" === o) {
2953
- wt = !0;
2954
- const t = e.cols, s = t ? t.length : 0;
2955
- for (let e = 0; !Ct && e < s; e++) t[e].v.s && (Ct = !0);
2956
- }
2957
- s?.onOpenTag?.(t);
2958
- }
2959
- }, It = (e) => {
2960
- let o = e.name;
2961
- if ("sheetData" === o && (Tt = !1), !A || "c" !== o && "f" !== o || (k && (P = L.get(k) ?? null), P && (q = ((t) => {
2962
- if (t.length < 11 || 104 != (32 | t.charCodeAt(0))) return;
2963
- if (!/^HYPERLINK\(/i.test(t)) return;
2964
- let e = 1, s = !1, o = 10;
2965
- for (; o < t.length && e > 0; o++) {
2966
- const r = t.charCodeAt(o);
2967
- s ? 34 === r && (34 === t.charCodeAt(o + 1) ? o++ : s = !1) : 34 === r ? s = !0 : 40 === r ? e++ : 41 === r && e--;
2968
- }
2969
- if (0 !== e || t.slice(o).trim().length > 0) return;
2970
- const r = /^HYPERLINK\(\s*"((?:[^"]|"")*)"\s*[,)]/i.exec(t);
2971
- return r ? r[1].replace(/""/g, "\"") : null;
2972
- })(P[2]), R.append(G, K, P), z && X.append(G, K)), null !== H && M.push([H, B ? F ? "error" : "dynamic" : "fixed"]), A = !1, P = null, k = null, E = null, T = !1, z = !1, H = null, B = !1, F = !1), J) {
2973
- const s = o.indexOf(":");
2974
- if (-1 !== s && (o = o.slice(s + 1)), U) if ("is" === o || "v" === o) {
2975
- const e = a?.onEnd?.();
2976
- null == e || $ && "" === m?.() || t.pushAt(G, K, void 0 !== q && "number" == typeof e ? Q(m?.() ?? "") : "number" == typeof e ? "" + e : e);
2977
- } else "f" !== o && a?.onCloseTag?.(e);
2978
- T && (T = !1), "c" === o && (J = null, U = !1);
2979
- return;
2980
- }
2981
- if (b) return b = !1, void (vt = null);
2982
- s?.onCloseTag?.(e);
2983
- }, Pt = (e) => {
2984
- const r = e.trim();
2985
- if (T) {
2986
- switch (Z = null, Y) {
2987
- case null:
2988
- case "n":
2989
- Z = d.flushSubnormal(parseFloat(r));
2990
- break;
2991
- case "b":
2992
- Z = "1" === r || "true" === r;
2993
- break;
2994
- case "s": {
2995
- const t = parseInt(r, 10);
2996
- let e = w.get(t);
2997
- if (void 0 === e) {
2998
- const s = x?.get(t);
2999
- e = s ? _s(s, v) : null, w.set(t, e);
3000
- }
3001
- Z = e ? {
3002
- t: "r",
3003
- v: {
3004
- type: "richText",
3005
- data: { runs: e }
3006
- }
3007
- } : r;
3008
- break;
3009
- }
3010
- case "d": {
3011
- const t = ((t, e = !1) => {
3012
- if (!t) return null;
3013
- const s = Es.exec(t);
3014
- if (s) {
3015
- const [, t, e, o] = s;
3016
- return void 0 === t && void 0 === e && void 0 === o ? null : (3600 * parseFloat(t ?? "0") + 60 * parseFloat(e ?? "0") + parseFloat(o ?? "0")) / 86400;
3017
- }
3018
- const o = ks.exec(t);
3019
- if (!o) return null;
3020
- const [, r, n, i, a, l, c, h] = o;
3021
- if (void 0 === r && void 0 === a) return null;
3022
- let u = 0;
3023
- if (void 0 !== r) {
3024
- const t = parseInt(r, 10), s = parseInt(n, 10), o = parseInt(i, 10);
3025
- if (s < 1 || s > 12 || o < 1 || o > 31) return null;
3026
- const a = Is(t, s, o) - Ps;
3027
- if (u = a <= 60 ? a - 1 : a, e && (u -= 1462), u < 0) return null;
3028
- }
3029
- return void 0 !== a && (u += (3600 * parseInt(a, 10) + 60 * parseInt(l, 10) + (void 0 !== c ? parseInt(c, 10) : 0) + (void 0 !== h ? parseFloat(h) : 0)) / 86400), u;
3030
- })(r, !0 === l?.get(Ms));
3031
- null !== t ? Z = t : c && (o?.(`Date '${r}' in cell ${p.cellToString({
3032
- colIndex: K,
3033
- rowIndex: G
3034
- })} is not a date this workbook can hold; kept as text.`, void 0, "xlsx.cell.isoDateText"), Z = "" + c(r));
3035
- break;
3036
- }
3037
- case "e":
3038
- if ("#VALUE!" === r) {
3039
- const t = J.attributes.vm;
3040
- if (void 0 !== t) {
3041
- const e = W(t);
3042
- if (h.isError(e)) {
3043
- Z = {
3044
- t: "e",
3045
- v: e.getCode()
3046
- };
3047
- break;
3048
- }
3049
- if (f.isJSON(e)) {
3050
- Z = {
3051
- t: "r",
3052
- v: e
3053
- };
3054
- break;
3055
- }
3056
- }
3057
- }
3058
- const t = h.getBuiltInByLabel(r);
3059
- t ? Z = {
3060
- t: "e",
3061
- v: t.getCode()
3062
- } : (Z = r, o?.(`Unknown formula error '${r}' in cell ${p.cellToString({
3063
- colIndex: K,
3064
- rowIndex: G
3065
- })}`));
3066
- break;
3067
- case "str":
3068
- case "inlineStr": U = !0;
3069
- }
3070
- null !== Z && t.pushAt(G, K, void 0 === q || "number" != typeof Z && "boolean" != typeof Z ? Z : Q(Z));
3071
- }
3072
- const n = null !== k;
3073
- if (k) {
3074
- if (O === k) P = D;
3075
- else {
3076
- if (P = L.get(k) ?? null, !P) {
3077
- const t = [];
3078
- I = V(r, G, K, t), P = [
3079
- I,
3080
- t,
3081
- r
3082
- ], L.set(k, P);
3083
- }
3084
- O = k, D = P;
3085
- }
3086
- k = null;
3087
- }
3088
- if (A) {
3089
- let t = r;
3090
- const e = n ? void 0 : l?.get(Ls);
3091
- if (e) {
3092
- const s = ((t) => {
3093
- if (t.length < ps.length) return ms;
3094
- if (t.slice(0, ps.length).toUpperCase() !== fs) return ms;
3095
- const e = ys(t, ps.length);
3096
- if (null === e) return ms;
3097
- if (41 !== t.charCodeAt(e.end)) return ms;
3098
- if (44 !== t.charCodeAt(e.end + 1)) return ms;
3099
- if (41 !== t.charCodeAt(t.length - 1)) return ms;
3100
- const s = e.value;
3101
- return s.toUpperCase() === gs ? bs : 0 === s.length ? ms : {
3102
- kind: "formula",
3103
- formula: s
3104
- };
3105
- })(r);
3106
- "none" !== s.kind && (N ??= new vs(e), "spilled" === s.kind ? $ = N.placeholder(G, K) : N.anchor(G, K, s.formula) && (t = s.formula, z ||= ((t) => xs(t).some((t) => dt(t) || !0 === C.get(t)?.getDeclaration().getReturnType()?.isVolatile()))(t)));
3107
- }
3108
- if ($) z = !1;
3109
- else {
3110
- const e = [];
3111
- I = V(t, G, K, e), P = [
3112
- I,
3113
- e,
3114
- t
3115
- ];
3116
- }
3117
- }
3118
- U ? a?.onText?.(e) : b || s?.onText?.(r);
3119
- }, Ot = {
3120
- r: void 0,
3121
- t: void 0,
3122
- s: void 0,
3123
- cm: void 0,
3124
- vm: void 0
3125
- }, Dt = {
3126
- name: "c",
3127
- attributes: Ot,
3128
- isSelfClosing: !1
3129
- }, _t = {
3130
- t: void 0,
3131
- si: void 0,
3132
- ref: void 0,
3133
- ca: void 0
3134
- }, Nt = {
3135
- name: "f",
3136
- attributes: _t,
3137
- isSelfClosing: !1
3138
- }, $t = {
3139
- name: "v",
3140
- attributes: {},
3141
- isSelfClosing: !1
3142
- }, Vt = {
3143
- r: void 0,
3144
- s: void 0,
3145
- ht: void 0,
3146
- hidden: void 0,
3147
- collapsed: void 0,
3148
- customHeight: void 0,
3149
- customFormat: void 0,
3150
- outlineLevel: void 0
3151
- }, Rt = {
3152
- name: "row",
3153
- attributes: Vt,
3154
- isSelfClosing: !1
3155
- }, Lt = ns.NEED_MORE, Mt = ns.NOT_HANDLED, jt = ns.decodeText;
3156
- let Bt = !1;
3157
- const Ft = (t, e, s, o) => {
3158
- for (;;) {
3159
- let r = 0;
3160
- for (; e < s && (32 === (r = t.charCodeAt(e)) || 9 === r || 10 === r || 13 === r);) e++;
3161
- if (e >= s) return Lt;
3162
- if (62 === r) return Bt = !1, e + 1;
3163
- if (47 === r) return e + 1 >= s ? Lt : 62 !== t.charCodeAt(e + 1) ? Mt : (Bt = !0, e + 2);
3164
- const n = e;
3165
- for (; e < s && 61 !== (r = t.charCodeAt(e));) {
3166
- if (62 === r || 47 === r || 32 === r || 9 === r || 10 === r || 13 === r) return Mt;
3167
- e++;
3168
- }
3169
- if (e + 1 >= s) return Lt;
3170
- const i = e - n, a = t.charCodeAt(e + 1);
3171
- if (34 !== a && 39 !== a) return Mt;
3172
- const l = e + 2;
3173
- let c = l;
3174
- for (; c < s && (r = t.charCodeAt(c)) !== a;) {
3175
- if (38 === r || r < 32) return Mt;
3176
- c++;
3177
- }
3178
- if (c >= s) return Lt;
3179
- e = c + 1;
3180
- const h = t.charCodeAt(n);
3181
- if (2 === o) switch (i) {
3182
- case 1:
3183
- 114 === h ? Vt.r = t.slice(l, c) : 115 === h && (Vt.s = t.slice(l, c));
3184
- break;
3185
- case 2:
3186
- t.startsWith("ht", n) && (Vt.ht = t.slice(l, c));
3187
- break;
3188
- case 6:
3189
- t.startsWith("hidden", n) && (Vt.hidden = t.slice(l, c));
3190
- break;
3191
- case 9:
3192
- t.startsWith("collapsed", n) && (Vt.collapsed = t.slice(l, c));
3193
- break;
3194
- case 12: t.startsWith("customHeight", n) ? Vt.customHeight = t.slice(l, c) : t.startsWith("customFormat", n) ? Vt.customFormat = t.slice(l, c) : t.startsWith("outlineLevel", n) && (Vt.outlineLevel = t.slice(l, c));
3195
- }
3196
- else if (0 === o) 1 === i ? 114 === h ? Ot.r = t.slice(l, c) : 116 === h ? Ot.t = t.slice(l, c) : 115 === h && (Ot.s = t.slice(l, c)) : 2 === i && 109 === t.charCodeAt(n + 1) && (99 === h ? Ot.cm = t.slice(l, c) : 118 === h && (Ot.vm = t.slice(l, c)));
3197
- else if (1 === i) 116 === h && (_t.t = t.slice(l, c));
3198
- else if (2 === i) {
3199
- const e = t.charCodeAt(n + 1);
3200
- 115 === h && 105 === e ? _t.si = t.slice(l, c) : 99 === h && 97 === e && (_t.ca = t.slice(l, c));
3201
- } else 3 === i && t.startsWith("ref", n) && (_t.ref = t.slice(l, c));
3202
- }
3203
- }, Ht = (t, e, s) => 47 === t.charCodeAt(e + 1) && t.charCodeAt(e + 2) === s && 62 === t.charCodeAt(e + 3);
3204
- return {
3205
- ...s,
3206
- onEnd: () => {
3207
- if (g?.()) {
3208
- let t = 0;
3209
- const e = [], s = (t, e) => ({
3210
- min: t,
3211
- max: e,
3212
- value: {
3213
- sz: -1,
3214
- csz: !1,
3215
- h: !0,
3216
- s: void 0,
3217
- l: 0,
3218
- cl: !1
3219
- }
3220
- });
3221
- for (const o of y) o.min > t && e.push(s(t, o.min - 1)), t = Math.max(t, o.max + 1);
3222
- t <= 1048575 && e.push(s(t, 1048575)), e.length > 0 && (tt.push(...e), tt.sort((t, e) => t.min - e.min));
3223
- }
3224
- tt.length > 0 && (e.rows = p.runsToRefs(tt, !1));
3225
- let o = R.done(Ws);
3226
- o = ((t, e) => {
3227
- let s = null;
3228
- for (let e = 0; e < t.length; e++) {
3229
- const o = t[e];
3230
- if (!zs.test(o.value[2])) continue;
3231
- s ??= /* @__PURE__ */ new Map();
3232
- const r = o.value[0], n = s.get(r);
3233
- n ? n.push(o) : s.set(r, [o]);
3234
- }
3235
- if (null === s) return t;
3236
- const o = /* @__PURE__ */ new Set();
3237
- for (const t of s.values()) {
3238
- const s = t[0], r = {
3239
- rowStart: s.rowStart,
3240
- colStart: s.colStart,
3241
- rowEnd: s.rowEnd,
3242
- colEnd: s.colEnd
3243
- };
3244
- let n = 0;
3245
- for (let e = 0; e < t.length; e++) {
3246
- const s = t[e];
3247
- s.rowStart < r.rowStart && (r.rowStart = s.rowStart), s.colStart < r.colStart && (r.colStart = s.colStart), s.rowEnd > r.rowEnd && (r.rowEnd = s.rowEnd), s.colEnd > r.colEnd && (r.colEnd = s.colEnd), n += (s.rowEnd - s.rowStart + 1) * (s.colEnd - s.colStart + 1);
3248
- }
3249
- if (n !== (r.rowEnd - r.rowStart + 1) * (r.colEnd - r.colStart + 1)) continue;
3250
- const i = As(p.resolveRelativeToA1(s.value[1], r.rowStart, r.colStart), r);
3251
- if (i) {
3252
- e.push(i);
3253
- for (let e = 0; e < t.length; e++) o.add(t[e]);
3254
- }
3255
- }
3256
- return 0 === o.size ? t : t.filter((t) => !o.has(t));
3257
- })(o, j);
3258
- const r = o.length;
3259
- if (r > 0 || j.length > 0) {
3260
- const t = new Array(r);
3261
- for (let e = 0; e < r; e++) {
3262
- const s = o[e], r = p.rangeToString(s), n = s.value[1], i = p.resolveRelativeToA1(n, s.rowStart, s.colStart);
3263
- t[e] = [r, i];
3264
- }
3265
- for (let e = 0; e < j.length; e++) {
3266
- const s = j[e], o = s.ref;
3267
- t.push([p.cellToString({
3268
- rowIndex: o.rowStart,
3269
- colIndex: o.colStart
3270
- }), St(s)]), M.push([p.rangeToString(o), "dynamic"]);
3271
- }
3272
- e.formulas = t;
3273
- }
3274
- const i = X.done(!0), a = i.length;
3275
- if (a > 0) {
3276
- const t = new Array(a);
3277
- for (let e = 0; e < a; e++) {
3278
- const s = i[e], o = p.rangeToString(s);
3279
- t[e] = o;
3280
- }
3281
- e.volatile = t;
3282
- }
3283
- N && M.push(...N.getFormulaArray()), M.length > 0 && (e.formulaArray = [...M]);
3284
- const l = S.length;
3285
- if (l > 0) {
3286
- S.sort(n.createRangeComparator(u.Axis.Column));
3287
- let t = S[0], s = t.colStart, o = t.colEnd, r = t.rowEnd, i = t.value;
3288
- const a = [];
3289
- a.push(t);
3290
- let c = null;
3291
- for (let e = 1; e < l; e++) c = S[e], i !== c.value || s !== c.colStart || o !== c.colEnd || r + 1 !== c.rowEnd ? (a.push(c), t = c, s = t.colStart, o = t.colEnd, r = t.rowEnd, i = t.value) : (r = c.rowEnd, t.rowEnd = r);
3292
- const h = a.length, d = new Array(h);
3293
- for (let t = 0; t < h; t++) {
3294
- const e = a[t], s = p.rangeToString(e);
3295
- d[t] = [s, e.value];
3296
- }
3297
- e.directStyles = d;
3298
- }
3299
- const c = t.build();
3300
- c && (e.data = c.tuples), s?.onEnd?.();
3301
- },
3302
- onOpenTag: Et,
3303
- onCloseTag: It,
3304
- onText: Pt,
3305
- elementScanners: [{
3306
- name: "c",
3307
- scan: (t, e, s) => {
3308
- if (!b || null !== J) return Mt;
3309
- Ot.r = Ot.t = Ot.s = Ot.cm = Ot.vm = void 0;
3310
- let o = Ft(t, e + 2, s, 0);
3311
- if (o < 0) return o;
3312
- const r = Ot.t;
3313
- if (void 0 === Ot.r || "str" === r || "inlineStr" === r) return Mt;
3314
- let n = !1, i = -1, a = -1, l = -1, c = -1, h = o;
3315
- if (!Bt) for (_t.t = _t.si = _t.ref = _t.ca = void 0;;) {
3316
- const e = t.indexOf("<", o);
3317
- if (-1 === e || e + 3 >= s) return Lt;
3318
- for (let s = o; s < e; s++) {
3319
- const e = t.charCodeAt(s);
3320
- if (32 !== e && 9 !== e && 10 !== e && 13 !== e) return Mt;
3321
- }
3322
- const r = t.charCodeAt(e + 1), u = t.charCodeAt(e + 2);
3323
- if (47 === r) {
3324
- if (!Ht(t, e, 99)) return Mt;
3325
- h = e + 4;
3326
- break;
3327
- }
3328
- if (102 === r && !n && -1 === l && (32 === u || 62 === u || 47 === u)) {
3329
- if (n = !0, o = Ft(t, e + 2, s, 1), o < 0) return o;
3330
- if ("dataTable" === _t.t) return Mt;
3331
- if (Bt) continue;
3332
- const r = t.indexOf("<", o);
3333
- if (-1 === r || r + 3 >= s) return Lt;
3334
- if (!Ht(t, r, 102)) return Mt;
3335
- i = o, a = r, o = r + 4;
3336
- continue;
3337
- }
3338
- if (118 === r && 62 === u && -1 === l) {
3339
- const r = t.indexOf("<", e + 3);
3340
- if (-1 === r || r + 3 >= s) return Lt;
3341
- if (!Ht(t, r, 118)) return Mt;
3342
- l = e + 3, c = r, o = r + 4;
3343
- continue;
3344
- }
3345
- return Mt;
3346
- }
3347
- return Et(Dt), n && (Et(Nt), a > i && Pt(jt(t.slice(i, a))), It(Nt)), -1 !== l && (Et($t), c > l && Pt(jt(t.slice(l, c))), It($t)), It(Dt), h;
3348
- }
3349
- }, {
3350
- name: "row",
3351
- openTag: Rt,
3352
- scan: (t, e, s) => {
3353
- if (!Tt || b || null !== J) return Mt;
3354
- Vt.r = Vt.s = Vt.ht = Vt.hidden = Vt.collapsed = Vt.customHeight = Vt.customFormat = Vt.outlineLevel = void 0;
3355
- const o = Ft(t, e + 4, s, 2);
3356
- return o < 0 ? o : Bt || void 0 === Vt.r ? Mt : (Et(Rt), o);
3357
- }
3358
- }]
3359
- };
3360
- }, Gs = /* @__PURE__ */ new Map([
3361
- ["urn:schemas-microsoft-com:vml", "v"],
3362
- ["urn:schemas-microsoft-com:office:office", "o"],
3363
- ["urn:schemas-microsoft-com:office:excel", "x"]
3364
- ]), Ks = [...Gs].map(([t, e]) => ` xmlns:${e}="${t}"`).join(""), Zs = /<(\/?)([A-Za-z_][\w.-]*(?::[\w.-]+)?)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g, Js = /(\s+)([A-Za-z_][\w.-]*(?::[\w.-]+)?)(\s*=\s*)("[^"]*"|'[^']*')/g, Qs = /\sxmlns(?::([\w.-]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
3365
- function Ys(t) {
3366
- if (!t || !((t) => {
3367
- let e;
3368
- for (Qs.lastIndex = 0; null !== (e = Qs.exec(t));) {
3369
- const t = Gs.get(e[2] ?? e[3] ?? "");
3370
- if (t && t !== (e[1] ?? "")) return !0;
3371
- }
3372
- return !1;
3373
- })(t)) return t;
3374
- const e = [], s = (t, s, o) => {
3375
- const r = t.indexOf(":");
3376
- if (-1 === r && o) return null;
3377
- const n = -1 === r ? "" : t.substring(0, r);
3378
- if ("xmlns" === n) return null;
3379
- const i = ((t, s) => {
3380
- const o = s?.get(t);
3381
- if (void 0 !== o) return o;
3382
- for (let s = e.length - 1; s >= 0; s--) {
3383
- const o = e[s].bindings.get(t);
3384
- if (void 0 !== o) return o;
3385
- }
3386
- })(n, s), a = void 0 !== i ? Gs.get(i) : void 0;
3387
- return a ? `${a}:${-1 === r ? t : t.substring(r + 1)}` : null;
3388
- };
3389
- let o = !1, r = !1;
3390
- const n = t.replace(Zs, (t, n, i, a, l) => {
3391
- if (n) {
3392
- const o = e[e.length - 1], r = s(i, null, !1);
3393
- return o && o.name === i && (o.nested > 0 ? o.nested-- : e.pop()), r ? `</${r}>` : t;
3394
- }
3395
- const c = ((t) => {
3396
- let e, s = null;
3397
- for (Qs.lastIndex = 0; null !== (e = Qs.exec(t));) (s ??= /* @__PURE__ */ new Map()).set(e[1] ?? "", e[2] ?? e[3] ?? "");
3398
- return s;
3399
- })(a);
3400
- c?.forEach((t, e) => {
3401
- const s = [...Gs].find(([, t]) => t === e)?.[0];
3402
- s && s !== t && (o = !0);
3403
- });
3404
- const h = s(i, c, !1);
3405
- let u = a.replace(Js, (t, e, o, r, n) => {
3406
- if ("xmlns" === o || o.startsWith("xmlns:")) {
3407
- const e = n.slice(1, -1);
3408
- return Gs.has(e) ? "" : t;
3409
- }
3410
- const i = s(o, c, !0);
3411
- return i ? `${e}${i}${r}${n}` : t;
3412
- });
3413
- if (r || (r = !0, u = u.replace(/\s+$/, "") + Ks), !l) {
3414
- const t = e[e.length - 1];
3415
- c ? e.push({
3416
- name: i,
3417
- bindings: c,
3418
- nested: 0
3419
- }) : t && t.name === i && t.nested++;
3420
- }
3421
- return `<${h ?? i}${u}${l}>`;
3422
- });
3423
- return o ? t : n;
3424
- }
3425
- var to = {
3426
- creator: "author",
3427
- category: "category",
3428
- description: "comments",
3429
- contentStatus: "contentStatus",
3430
- created: "creationDate",
3431
- keywords: "keywords",
3432
- lastModifiedBy: "lastAuthor",
3433
- modified: "lastModifiedDate",
3434
- lastPrinted: "lastPrinted",
3435
- revision: "revisionNumber",
3436
- subject: "subject",
3437
- title: "title"
3438
- }, eo = {
3439
- Company: "company",
3440
- Manager: "manager"
3441
- }, so = {
3442
- lpwstr: A.Type.String,
3443
- lpstr: A.Type.String,
3444
- bstr: A.Type.String,
3445
- i1: A.Type.Number,
3446
- i2: A.Type.Number,
3447
- i4: A.Type.Number,
3448
- i8: A.Type.Number,
3449
- int: A.Type.Number,
3450
- ui1: A.Type.Number,
3451
- ui2: A.Type.Number,
3452
- ui4: A.Type.Number,
3453
- ui8: A.Type.Number,
3454
- uint: A.Type.Number,
3455
- r4: A.Type.Float,
3456
- r8: A.Type.Float,
3457
- decimal: A.Type.Float,
3458
- bool: A.Type.Boolean,
3459
- filetime: A.Type.Date,
3460
- date: A.Type.Date
3461
- }, oo = (t) => {
3462
- const e = t.kind ? so[t.kind] : void 0;
3463
- if (!e) return null;
3464
- const s = t.value.trim();
3465
- let o;
3466
- if (e === A.Type.String) o = {
3467
- key: t.key,
3468
- type: e,
3469
- value: t.value
3470
- };
3471
- else if (e === A.Type.Boolean) {
3472
- if ("true" !== s && "false" !== s && "1" !== s && "0" !== s) return null;
3473
- o = {
3474
- key: t.key,
3475
- type: e,
3476
- value: "true" === s || "1" === s
3477
- };
3478
- } else if (e === A.Type.Date) {
3479
- const r = new Date(s);
3480
- if (!s || isNaN(r.getTime())) return null;
3481
- o = {
3482
- key: t.key,
3483
- type: e,
3484
- value: r.toISOString()
3485
- };
3486
- } else {
3487
- const r = Number(s);
3488
- if (!s || !Number.isFinite(r)) return null;
3489
- const n = e === A.Type.Number && r >= -2147483648 && r <= 2147483647;
3490
- o = {
3491
- key: t.key,
3492
- type: n ? e : A.Type.Float,
3493
- value: r
3494
- };
3495
- }
3496
- return t.linkTarget && (o.linkTarget = t.linkTarget), o;
3497
- }, ro = "hiddenXfs", no = (t) => (Array.isArray(t) ? t[1] : t?.v)?.s, io = (t) => {
3498
- if (!t || 0 === t.length) return !1;
3499
- const e = p.refsToRuns(t, !0);
3500
- let s = 0;
3501
- for (const t of e) {
3502
- if (t.min > s || void 0 === t.value?.s) return !1;
3503
- s = Math.max(s, t.max + 1);
3504
- }
3505
- return s > at;
3506
- }, ao = (t, e) => {
3507
- t.protection = {
3508
- ...t.protection,
3509
- showFormulas: e
3510
- };
3511
- }, lo = "xfComplements", co = (t, e) => {
3512
- if ("string" == typeof t) return void e.push(t);
3513
- const s = Array.isArray(t) ? t : [t];
3514
- for (let t = 0; t < s.length; t++) {
3515
- const o = p.rangeToString(s[t]);
3516
- o && e.push(o);
3517
- }
3518
- }, ho = (t) => {
3519
- const e = Array.isArray(t) ? t[1] : t.v;
3520
- if (!e || !("s" in e)) return;
3521
- const s = e.s;
3522
- return delete e.s, s;
3523
- }, uo = (t, e, s, o) => {
3524
- if (!t) return;
3525
- const r = e ? 2 : 1, n = e ? s.rowStart : s.colStart, i = e ? s.rowEnd : s.colEnd;
3526
- let a, l = -1;
3527
- for (const s of t) {
3528
- const t = p.refToRun(s, e), c = ho(s);
3529
- t && void 0 !== c ? c !== l || (e ? a.colEnd : a.rowEnd) + 1 !== t.min ? (a = {
3530
- colStart: e ? t.min : n,
3531
- rowStart: e ? n : t.min,
3532
- colEnd: e ? t.max : i,
3533
- rowEnd: e ? i : t.max,
3534
- value: {
3535
- kind: r,
3536
- index: c
3537
- }
3538
- }, l = c, o.push(a)) : e ? a.colEnd = t.max : a.rowEnd = t.max : l = -1;
3539
- }
3540
- }, po = {
3541
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
3542
- "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
3543
- "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
3544
- "application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
3545
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
3546
- "application/vnd.ms-excel.template.macroEnabled.main+xml": "workbooks",
3547
- "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
3548
- "application/vnd.ms-excel.worksheet": "sheets",
3549
- "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
3550
- "application/vnd.ms-excel.chartsheet": "charts",
3551
- "application/vnd.ms-excel.macrosheet+xml": "macros",
3552
- "application/vnd.ms-excel.macrosheet": "macros",
3553
- "application/vnd.ms-excel.intlmacrosheet+xml": "macros",
3554
- "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
3555
- "application/vnd.ms-excel.dialogsheet": "dialogs",
3556
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
3557
- "application/vnd.ms-excel.sharedStrings": "strs",
3558
- "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles",
3559
- "application/vnd.ms-excel.styles": "styles",
3560
- "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
3561
- "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
3562
- "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
3563
- "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
3564
- "application/vnd.ms-excel.comments": "comments",
3565
- "application/vnd.ms-excel.threadedcomments+xml": "threadedcomments",
3566
- "application/vnd.ms-excel.person+xml": "people",
3567
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
3568
- "application/vnd.ms-excel.sheetMetadata": "metadata",
3569
- "application/vnd.ms-excel.featurepropertybag+xml": "featurePropertyBag",
3570
- "application/vnd.ms-excel.externalLink": "links",
3571
- "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
3572
- "application/vnd.openxmlformats-officedocument.theme+xml": "themes"
3573
- }, fo = lt({ readXLSX: () => xo }), go = (t) => t.startsWith("/") ? t.slice(1) : t, mo = [
3574
- 208,
3575
- 207,
3576
- 17,
3577
- 224,
3578
- 161,
3579
- 177,
3580
- 26,
3581
- 225
3582
- ], bo = /^xl\/worksheets\/[^/]+\.xml$/i, yo = (t) => "string" == typeof t ? t : (t?.runs ?? []).map((t) => t.text ?? "").join(""), xo = async (n, l) => {
3583
- const { password: h, onVBA: u, profile: d, calcOnLoad: f = "auto", createWorkbookOptions: m = {}, ...x } = l ?? {};
3584
- await g.load();
3585
- const v = !!m.origin && "string" != typeof m.origin, w = d ? new ee("function" == typeof d ? d : void 0) : null, A = [], k = (t, e, s) => {
3586
- A.push([
3587
- t,
3588
- e ?? "",
3589
- s
3590
- ]);
3591
- }, E = { onWarning: k }, I = l?.progress, P = I?.onProgress ? I.onProgress.bind(I) : void 0, O = n.byteLength;
3592
- let R = 0, L = 0;
3593
- const M = P ? (t) => {
3594
- if (R <= 0) return;
3595
- L += t;
3596
- const e = Math.min(O, Math.round(L / R * O));
3597
- P(e, O);
3598
- } : void 0, B = import("./BsQZI1vXTRE63Zy-.js");
3599
- let F = null;
3600
- try {
3601
- F = new DOMParser();
3602
- } catch (t) {}
3603
- let W = null;
3604
- try {
3605
- W = new XMLSerializer();
3606
- } catch (t) {}
3607
- let U, K, Z, J = null;
3608
- F || (J = import("./C4z2IilWTuu2TWXw.js").then((e) => t(e.default, 1)));
3609
- try {
3610
- const [t, e] = await Promise.all([J, B]);
3611
- U = new e.DOMTransformer(), K = F ?? new t.DOMParser(), Z = W ?? new t.XMLSerializer();
3612
- } catch (t) {
3613
- throw new Error("Unable to load XLSX parser.", { cause: t });
3614
- }
3615
- const Q = (t) => Z.serializeToString(t);
3616
- if (((t) => {
3617
- if (t.byteLength < mo.length) return !1;
3618
- const e = new Uint8Array(t, 0, mo.length);
3619
- return mo.every((t, s) => e[s] === t);
3620
- })(n)) throw new i("This is an Excel 97-2003 workbook (.xls), which cannot be read. Save it as '.xlsx' and try again.");
3621
- let Y;
3622
- try {
3623
- Y = await te.create(n);
3624
- } catch (t) {
3625
- throw new i("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
3626
- }
3627
- w?.mark("zip-open");
3628
- try {
3629
- if (!Y.has("[Content_Types].xml")) throw new i("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
3630
- const t = (t) => {
3631
- const e = Y.getEntry(t);
3632
- return e ? { content: e } : void 0;
3633
- }, s = {
3634
- workbooks: [],
3635
- sheets: [],
3636
- charts: [],
3637
- dialogs: [],
3638
- macros: [],
3639
- strs: [],
3640
- comments: [],
3641
- threadedcomments: [],
3642
- links: [],
3643
- coreprops: [],
3644
- extprops: [],
3645
- custprops: [],
3646
- themes: [],
3647
- styles: [],
3648
- metadata: [],
3649
- people: [],
3650
- featurePropertyBag: [],
3651
- overrides: {},
3652
- sst: "",
3653
- style: "",
3654
- defaults: {}
3655
- };
3656
- {
3657
- const t = ((t) => ({
3658
- onOpenTag: (e) => {
3659
- const s = ((t) => {
3660
- const e = t.indexOf(":");
3661
- return -1 === e ? t : t.slice(e + 1);
3662
- })(e.name), o = e.attributes;
3663
- if ("Override" === s) {
3664
- const e = o.ContentType, s = o.PartName;
3665
- if (!e || !s) return;
3666
- t.overrides[s.startsWith("/") ? s.slice(1) : s] = e;
3667
- const r = po[e], n = r ? t[r] : void 0;
3668
- Array.isArray(n) && n.push(s);
3669
- } else if ("Default" === s) {
3670
- const e = o.Extension, s = o.ContentType;
3671
- e && (t.defaults[e.toLowerCase()] = s);
3672
- }
3673
- },
3674
- onEnd: () => {
3675
- t.sst = t.strs.length > 0 ? t.strs[0] : "", t.style = t.styles.length > 0 ? t.styles[0] : "";
3676
- },
3677
- onError: (t) => {
3678
- ((t) => {
3679
- A.push([t, "[Content_Types].xml"]);
3680
- })(`Error parsing content types: ${t?.message ?? t}`);
3681
- }
3682
- }))(s), e = await Y.getTextStream("[Content_Types].xml");
3683
- if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
3684
- try {
3685
- await be.parseStream(e, t, { xmlns: !1 });
3686
- } catch (t) {
3687
- throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: t });
3688
- }
3689
- v && await Y.getBuffer("[Content_Types].xml");
3690
- }
3691
- w?.mark("content-types");
3692
- const n = s.sst, l = /* @__PURE__ */ new Set();
3693
- for (const t of s.sheets) l.add(go(t));
3694
- n && l.add(go(n));
3695
- for (const t of l) R += Y.uncompressedSize(t);
3696
- if (await Y.prefetch((t) => !l.has(t) && !bo.test(t)), w?.mark("prefetch-side-parts"), 0 === s.workbooks.length) {
3697
- const e = j("_rels/.rels", t, K, U, E), o = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
3698
- if (e) {
3699
- for (const t of e.values()) if (t.type === o && t.target) {
3700
- s.workbooks.push(t.target);
3701
- break;
3702
- }
3703
- }
3704
- }
3705
- if (0 === s.workbooks.length) throw new i("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
3706
- const h = m?.resources ?? new b(), x = h.beginPersist(), L = {}, B = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Map();
3707
- F.set("parseInlineDxf", (t) => {
3708
- if (!t) return;
3709
- const e = K.parseFromString(`<dxf xmlns:x14="${Mt}" xmlns:xm="${Et}">${t}</dxf>`, "text/xml")?.documentElement;
3710
- if (!e) return;
3711
- const s = U.parseDxf(e, "", E);
3712
- return Object.keys(s).length > 0 ? s : void 0;
3713
- });
3714
- const W = N("metadata", s, t, K, U, E).entries().next()?.value?.[1]?.metadata;
3715
- W && F.set("metadata", W), F.set(Rs, _());
3716
- const Z = /* @__PURE__ */ new Map(), J = [], st = /* @__PURE__ */ new Set(), ot = (t) => {
3717
- st.add(go(t));
3718
- }, nt = (e, s = Z) => {
3719
- const o = e.lastIndexOf("/"), r = e.substring(0, o + 1) + "_rels/" + e.substring(o + 1, e.length) + ".rels";
3720
- let n = s.get(r);
3721
- return n || (n = j(r, t, K, U, kt), s.set(r, n)), n;
3722
- }, lt = (e, s, o, r = Z) => {
3723
- let n = nt(s, r).get(e), i = n?.target;
3724
- if (!i) return null;
3725
- if ("External" === n.targetMode) {
3726
- if (!o) return n.target;
3727
- const t = h.add({ source: { external: n.target } });
3728
- return t.addReference(L), B.add(t), x.toResourceId(t);
3729
- }
3730
- const a = s.lastIndexOf("/"), l = s.substring(0, a + 1);
3731
- i.startsWith("/") || (i = l + i), i = it(i);
3732
- const c = U?.getVisitorParamsState().get("dxfs");
3733
- let u = r.get(i);
3734
- if (!u) {
3735
- const e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
3736
- if (n.type === e) {
3737
- const t = {};
3738
- u = t;
3739
- const e = async () => {
3740
- const e = Fs(t, (t, e) => "legacyDrawing" === e ? dt(t, i) : "formControl" === e ? pt(t, i) : "part" === e ? mt(t, i) : lt(t, i, "resource" === e) ?? null, Rt, c, () => {}, (t, e, s) => {
3741
- k(t, e ? `${e} (${i})` : i, s);
3742
- }, void 0, F), s = await Y.getTextStream(i, M);
3743
- if (s) try {
3744
- await be.parseStream(s, e, {
3745
- xmlns: !1,
3746
- lean: !0
3747
- });
3748
- } catch (t) {
3749
- throw new Error(`Error parsing sheet: '${i}'`, { cause: t });
3750
- }
3751
- const o = nt(i, r);
3752
- if (o) {
3753
- ut(t, i, o, r), ft(t), Bt(t);
3754
- const e = [];
3755
- o.forEach((t, s) => {
3756
- if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" !== t.type) return;
3757
- const o = mt(s, i, t.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
3758
- if (!o?.xml) return;
3759
- const r = /<pivotTableDefinition\b[^>]*>/.exec(o.xml)?.[0] ?? "", n = parseInt(/\scacheId="(\d+)"/.exec(r)?.[1] ?? "", 10);
3760
- if (isNaN(n)) return void A.push([`Pivot table '${o.name}' names no cache and was dropped.`, i]);
3761
- const a = /\sname="([^"]*)"/.exec(r)?.[1];
3762
- e.push({
3763
- ...a ? { name: Ot(a) } : {},
3764
- cacheId: n,
3765
- part: o
3766
- });
3767
- }), e.length > 0 && (t.pivotTables = e);
3768
- }
3769
- };
3770
- J.push(e());
3771
- } else if (n.type === s) {
3772
- const e = q(i, t, K, U, kt);
3773
- if (e && 0 !== Object.keys(e).length) {
3774
- const t = e, s = t.__bookRelId, o = t.__absoluteUrlRelId;
3775
- delete t.__bookRelId, delete t.__absoluteUrlRelId;
3776
- const n = [];
3777
- nt(i, r)?.forEach((t, e) => {
3778
- if ("External" === t.targetMode && t.type && t.target) {
3779
- const r = {
3780
- type: t.type,
3781
- target: t.target
3782
- };
3783
- e === s ? r.role = "book" : e === o && (r.role = "absoluteUrl"), n.push(r);
3784
- }
3785
- }), n.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), t.sources = n, ot(i), u = t;
3786
- } else u = null;
3787
- } else u = o ? rt(i, t, (t, e) => {
3788
- const s = h.add({ source: { buffer: t } });
3789
- return s.addReference(L), B.add(s), x.toResourceId(s);
3790
- }, kt) : q(i, t, K, U, kt);
3791
- }
3792
- return u;
3793
- }, ht = (t, e) => {
3794
- if (!t) return null;
3795
- const s = nt(e, Z)?.get(t);
3796
- if (!s?.target || "External" === s.targetMode) return null;
3797
- let o = s.target;
3798
- return o.startsWith("/") || (o = e.substring(0, e.lastIndexOf("/") + 1) + o), it(o);
3799
- }, ut = (t, e, s, o) => {
3800
- const n = [], i = /* @__PURE__ */ new Map(), a = [];
3801
- s.forEach((t, s) => {
3802
- if ("http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" !== t.type) return;
3803
- const r = lt(s, e, !1, o)?.comments;
3804
- if (!r) return;
3805
- for (let t = 0; t < r.length; t++) {
3806
- const e = r[t];
3807
- if (!e?.v?.id) continue;
3808
- const { parentId: s, done: o, content: l, ...c } = e.v, h = {
3809
- ...c,
3810
- content: yo(l)
3811
- };
3812
- s ? a.push({
3813
- parentId: s,
3814
- json: h
3815
- }) : (o && (h.done = !0), i.set(h.id, h), n.push({
3816
- r: e.r,
3817
- v: h
3818
- }));
3819
- }
3820
- const l = ht(s, e);
3821
- l && ot(l);
3822
- });
3823
- for (let t = 0; t < a.length; t++) {
3824
- const { parentId: e, json: s } = a[t], o = i.get(e);
3825
- o && (o.replies ??= []).push(s);
3826
- }
3827
- const l = [];
3828
- if (s.forEach((t, s) => {
3829
- if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" !== t.type) return;
3830
- const n = lt(s, e, !1, o), a = n?.comments;
3831
- if (!a) return;
3832
- const c = n?.authors;
3833
- for (let t = 0; t < a.length; t++) {
3834
- const e = a[t];
3835
- if (!e?.r) continue;
3836
- let s = c && void 0 !== e.v.authorId ? c[e.v.authorId] : void 0;
3837
- if (s && s.startsWith("tc=")) {
3838
- if (i.has(et(s.substring(3)))) continue;
3839
- s = void 0;
3840
- }
3841
- const o = {
3842
- id: r.uuidV4().toUpperCase(),
3843
- asNote: !0,
3844
- content: e.v.content ?? ""
3845
- }, n = s ? At({ displayName: s }) : void 0;
3846
- n && (o.personId = n.id), l.push({
3847
- r: e.r,
3848
- v: o
3849
- });
3850
- }
3851
- const h = ht(s, e);
3852
- h && ot(h);
3853
- }), 0 === n.length && 0 === l.length) return;
3854
- const c = [...n, ...l], h = t.legacyDrawing;
3855
- if (h?.xml) {
3856
- const { rest: e, notes: s } = H(h.xml);
3857
- if (s.length > 0) {
3858
- const o = /* @__PURE__ */ new Map();
3859
- for (let t = 0; t < s.length; t++) {
3860
- const e = s[t];
3861
- o.set(p.cellToString({
3862
- rowIndex: e.row,
3863
- colIndex: e.col
3864
- }), e);
3865
- }
3866
- for (let t = 0; t < c.length; t++) {
3867
- const e = c[t], s = o.get(String(e.r).toUpperCase());
3868
- if (!s) continue;
3869
- if (o.delete(String(e.r).toUpperCase()), !e.v.asNote) continue;
3870
- const r = V(s.xml), n = {};
3871
- if (r.anchor) {
3872
- const [t, e, o, i, a, l, c, h] = r.anchor;
3873
- n.anchor = {
3874
- tl: {
3875
- c: t - s.col,
3876
- x: e,
3877
- r: o - s.row,
3878
- y: i
3879
- },
3880
- br: {
3881
- c: a - s.col,
3882
- x: l,
3883
- r: c - s.row,
3884
- y: h
3885
- }
3886
- };
3887
- } else r.bounds && (n.bounds = r.bounds);
3888
- r.style.fill && (n.fill = r.style.fill), r.style.stroke && (n.stroke = r.style.stroke), r.xml && (n.xml = r.xml), (n.anchor || n.bounds || n.fill || n.stroke || n.xml) && (e.v.box = n), r.visible && (e.v.shown = !0), r.alt && (e.v.description = r.alt);
3889
- }
3890
- const r = [];
3891
- o.forEach((t) => {
3892
- r.push(t.xml);
3893
- });
3894
- const n = yt(e, r);
3895
- n ? h.xml = n : delete t.legacyDrawing;
3896
- }
3897
- }
3898
- t.comments = c;
3899
- }, dt = (e, s) => {
3900
- const o = ht(e, s);
3901
- if (!o) return null;
3902
- const r = t(go(o));
3903
- if (!r) return null;
3904
- const n = { xml: Ys(new TextDecoder("utf-8").decode(r.content)) }, i = [];
3905
- return nt(o, Z)?.forEach((t, e) => {
3906
- if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" !== t.type) return;
3907
- const s = lt(e, o, !0);
3908
- "number" == typeof s && i.push({
3909
- id: e,
3910
- resId: s
3911
- });
3912
- }), i.length > 0 && (n.images = i), ot(o), n;
3913
- }, pt = (e, s) => {
3914
- const o = ht(e, s);
3915
- if (!o) return null;
3916
- const r = q(o, t, K, U, kt)?.formControl ?? null;
3917
- return r && ot(o), r;
3918
- }, mt = (e, o, r, n, i = /* @__PURE__ */ new Set()) => {
3919
- const a = ht(e, o);
3920
- if (!a || i.has(a)) return null;
3921
- const l = r ?? nt(o, Z)?.get(e)?.type;
3922
- if (!l) return null;
3923
- const c = t(go(a));
3924
- if (!c) return null;
3925
- i.add(a);
3926
- const h = a.substring(a.lastIndexOf("/") + 1), u = s.overrides[go(a)] ?? s.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], d = {
3927
- id: e,
3928
- type: l,
3929
- name: h
3930
- };
3931
- if (u && (d.contentType = u), ((t, e) => t ? t.endsWith("+xml") || "application/xml" === t : /\.(xml|rels|vml)$/i.test(e))(u, h)) d.xml = new TextDecoder("utf-8").decode(c.content);
3932
- else {
3933
- const t = lt(e, o, !0);
3934
- if ("number" != typeof t) return null;
3935
- d.resId = t;
3936
- }
3937
- const p = [];
3938
- return nt(a, Z)?.forEach((t, e) => {
3939
- if (!t?.type) return;
3940
- if (n && !n(t.type)) return;
3941
- if ("External" === t.targetMode) {
3942
- const s = lt(e, a, !0);
3943
- "number" == typeof s && p.push({
3944
- id: e,
3945
- type: t.type,
3946
- resId: s
3947
- });
3948
- return;
3949
- }
3950
- const s = mt(e, a, t.type, n, i);
3951
- s && p.push(s);
3952
- }), p.length > 0 && (d.parts = p), ot(a), d;
3953
- }, xt = N("coreprops", s, t, K, U, E), vt = N("extprops", s, t, K, U, E), wt = N("custprops", s, t, K, U, E);
3954
- wt.forEach((t, e) => {
3955
- t?.custom && ot(e);
3956
- });
3957
- const St = new T(), Ct = N("people", s, t, K, U, E);
3958
- if (Ct.size > 0) {
3959
- const [t, e] = Ct.entries().next().value;
3960
- St.fromJSON(e?.persons), ot(t);
3961
- }
3962
- const At = (t) => {
3963
- if (t) return St.add(t).toJSON();
3964
- }, kt = {
3965
- paramMap: F,
3966
- getRefs: nt,
3967
- getRef: lt,
3968
- parsedRefs: Z,
3969
- readEmbeddedPart: (t, e) => mt(t, e),
3970
- addPerson: At,
3971
- serializeElement: Q,
3972
- onWarning: k
3973
- }, It = [], Dt = /* @__PURE__ */ new Map();
3974
- if (F.set(js, Dt), n) {
3975
- const t = await Y.getTextStream(n, M);
3976
- if (t) {
3977
- const e = (() => {
3978
- let t = !1, e = !1, s = 0, o = "";
3979
- const r = new Ds();
3980
- return {
3981
- onOpenTag: (n) => {
3982
- const i = Os(n.name);
3983
- "t" === i ? t && 0 === s && (e = !0) : "si" === i ? (t = !0, o = "", r.reset(), s = 0) : "rPh" === i || "phoneticPr" === i ? s++ : t && 0 === s && r.onOpenTag(i, n.attributes);
3984
- },
3985
- onText: (t) => {
3986
- e && (o += t, r.onText(t));
3987
- },
3988
- onCloseTag: (n) => {
3989
- const i = Os(n.name);
3990
- "t" === i ? e = !1 : "si" === i ? (((t, e) => {
3991
- e && Dt.set(It.length, e), It.push(t);
3992
- })(ct(o), r.take() ?? void 0), t = !1, o = "") : "rPh" === i || "phoneticPr" === i ? s > 0 && s-- : r.onCloseTag(i);
3993
- },
3994
- onError: (t) => {
3995
- ((t) => {
3996
- k(t, n);
3997
- })(`Error parsing shared strings: ${t?.message ?? t}`);
3998
- }
3999
- };
4000
- })();
4001
- try {
4002
- await be.parseStream(t, e, { xmlns: !1 });
4003
- } catch (t) {
4004
- throw new Error(`Error parsing shared strings: '${n}'`, { cause: t });
4005
- }
4006
- }
4007
- }
4008
- w?.mark("shared-strings");
4009
- let Nt = It.length;
4010
- const $t = /* @__PURE__ */ new Map();
4011
- let Vt = Nt;
4012
- const Rt = (t) => {
4013
- const e = $t.get(t);
4014
- if (void 0 !== e) return e;
4015
- const s = Vt;
4016
- return $t.set(t, Vt++), It.push(t), s;
4017
- }, Lt = [];
4018
- s.slicersCache = Lt;
4019
- const jt = Y.getNames(), Wt = jt.length;
4020
- for (let t = 0; t < Wt; t++) {
4021
- const e = jt[t];
4022
- e && e.startsWith("xl/slicerCache") && Lt.push(`/${e}`);
4023
- }
4024
- const zt = N("slicersCache", s, t, K, U, kt), Xt = /* @__PURE__ */ new Map();
4025
- zt.forEach((t, e) => {
4026
- t?.cacheName && (t.cachePath = e, Xt.set(t.cacheName, t));
4027
- }), F.set("slicerCaches", Xt);
4028
- const qt = [];
4029
- s.slicers = qt;
4030
- for (let t = 0; t < Wt; t++) {
4031
- const e = jt[t];
4032
- e && e.startsWith("xl/slicers/") && e.endsWith(".xml") && qt.push(`/${e}`);
4033
- }
4034
- const Yt = {
4035
- getFile: t,
4036
- domParser: K,
4037
- getAddress: (t, e) => {
4038
- const s = lt(e, t, !1);
4039
- return "string" == typeof s ? s : null;
4040
- },
4041
- getBytes: (e, s) => {
4042
- const o = ht(s, e), r = o ? t(o.substring(1))?.content : void 0;
4043
- return r ? r.slice().buffer : null;
4044
- },
4045
- addFetched: (t, e) => {
4046
- const s = h.add({
4047
- source: { buffer: t },
4048
- fetchedFrom: e
4049
- });
4050
- return s.addReference(L), B.add(s), x.toResourceId(s);
4051
- },
4052
- markAbsorbed: ot
4053
- }, te = /* @__PURE__ */ new Map();
4054
- for (const t of _t.getAll()) te.set(t.structure, t.beginRead(Yt));
4055
- const ee = ((t, e) => {
4056
- const s = (s) => {
4057
- const o = t(s);
4058
- return o ? e.parseFromString(new TextDecoder().decode(o.content), "text/xml").documentElement ?? null : null;
4059
- }, o = Kt(s("xl/richData/rdrichvaluestructure.xml"), "s").map((t) => ({
4060
- t: t.getAttribute("t") ?? "",
4061
- keys: Zt(t)
4062
- })), r = Kt(s("xl/richData/rdrichvalue.xml"), "rv").map((t) => {
4063
- const e = Kt(t, "fb")[0];
4064
- return {
4065
- s: parseInt(t.getAttribute("s") ?? "-1", 10),
4066
- values: Kt(t, "v").map((t) => t.textContent ?? ""),
4067
- fb: e ? e.textContent ?? "" : null
4068
- };
4069
- }), n = Kt(s("xl/richData/rdarray.xml"), "a").map((t) => {
4070
- const e = Jt(t), s = parseInt(t.getAttribute("r") ?? "", 10), o = parseInt(t.getAttribute("c") ?? "", 10), r = s > 0 ? s : e.length;
4071
- return {
4072
- rows: r,
4073
- columns: o > 0 ? o : Math.max(1, Math.ceil(e.length / Math.max(1, r))),
4074
- items: e
4075
- };
4076
- }), i = Kt(s("xl/richData/rdsupportingpropertybagstructure.xml"), "s").map(Zt), a = s("xl/richData/rdsupportingpropertybag.xml"), l = Kt(Kt(a, "spbArrays")[0], "a").map(Jt), c = Kt(Kt(a, "spbData")[0], "spb").map((t) => ({
4077
- s: parseInt(t.getAttribute("s") ?? "-1", 10),
4078
- values: Kt(t, "v").map((t) => t.textContent ?? "")
4079
- })), h = s("xl/richData/rdRichValueTypes.xml"), u = Qt(Kt(Kt(h, "global")[0], "keyFlags")[0]), d = /* @__PURE__ */ new Map();
4080
- for (const t of Kt(Kt(h, "types")[0], "type")) d.set(t.getAttribute("name") ?? "", Qt(Kt(t, "keyFlags")[0]));
4081
- const p = s("xl/richData/richStyles.xml"), f = Kt(Kt(p, "dxfs")[0], "dxf").map((t) => Kt(t, "numFmt")[0]?.getAttribute("formatCode") ?? null), g = Kt(Kt(p, "richProperties")[0], "rPr").map((t) => t.getAttribute("n") ?? "");
4082
- return {
4083
- structures: o,
4084
- values: r,
4085
- arrays: n,
4086
- bagStructures: i,
4087
- bagArrays: l,
4088
- bags: c,
4089
- globalKeyFlags: u,
4090
- typeKeyFlags: d,
4091
- richStyles: Kt(Kt(p, "richStyles")[0], "rSty").map((t) => {
4092
- const e = /* @__PURE__ */ new Map();
4093
- for (const s of Kt(t, "rpv")) {
4094
- const t = g[parseInt(s.getAttribute("i") ?? "-1", 10)];
4095
- t && e.set(t, s.textContent ?? "");
4096
- }
4097
- const s = parseInt(t.getAttribute("dxfid") ?? "", 10);
4098
- return {
4099
- numberFormat: e.get("NumberFormat") ?? (s >= 0 ? f[s] ?? null : null),
4100
- isTitle: "1" === e.get("IsTitleField"),
4101
- isHero: "1" === e.get("IsHeroField")
4102
- };
4103
- })
4104
- };
4105
- })(t, K), se = z(ee, te, (t) => {
4106
- k(t, "/xl/richData/rdrichvalue.xml");
4107
- });
4108
- F.set("richData", ee.values.map((t, e) => se.cellValue(e)));
4109
- for (let t = 0; t < Wt; t++) {
4110
- const e = jt[t];
4111
- e.startsWith("xl/richData/") && !e.includes("/_rels/") && ot(e);
4112
- }
4113
- const oe = N("themes", s, t, K, U, kt);
4114
- let re = null;
4115
- if (oe && oe.entries) {
4116
- let t = oe.entries().next();
4117
- t?.value?.[1] && (re = t.value[1]);
4118
- }
4119
- const ne = new y(re);
4120
- let ie = N("styles", s, t, K, U, kt).entries().next()?.value?.[1];
4121
- ie && (ie = JSON.parse(a.JSONStableStringify(ie)));
4122
- const ae = N("workbooks", s, t, K, U, kt);
4123
- F.set(Ms, !0 === ae.entries().next().value?.[1]?.date1904), "none" !== (m.calcOnLoad ?? f) && F.set(Ls, ((t, e) => {
4124
- const s = /* @__PURE__ */ new Set();
4125
- if (t) for (let e = 0; e < t.length; e++) s.add(String(t[e]?.name).toUpperCase());
4126
- if (e) for (let t = 0; t < e.length; t++) try {
4127
- const o = e[t](() => {
4128
- throw new Error("Not evaluating.");
4129
- }, (t, e, o, r) => {
4130
- for (const t of Object.keys(r)) s.add(t.toUpperCase());
4131
- }, /* @__PURE__ */ new Map());
4132
- for (const t of o.keys()) s.add(t.toUpperCase());
4133
- } catch {}
4134
- return (t) => s.has(t) || C.has(t);
4135
- })(ae.entries().next().value?.[1]?.names, m.functions)), w?.mark("side-parts-json"), await Promise.all(J);
4136
- {
4137
- const t = ae.entries().next().value?.[1], e = _(t?.names), s = t?.sheets ?? [];
4138
- for (let t = 0; t < s.length; t++) {
4139
- const o = s[t], r = gt(o);
4140
- if ("macro" === o?.kind && r?.part.xml) {
4141
- r.part.xml = G(r.part.xml, It);
4142
- continue;
4143
- }
4144
- const n = bt(o);
4145
- n && Ft(n, e);
4146
- }
4147
- const o = t?.names;
4148
- if (o) for (let t = 0; t < o.length; t++) {
4149
- const s = o[t]?.ref;
4150
- "string" == typeof s && (o[t].ref = e.readDetached(s));
4151
- }
4152
- }
4153
- P && R > 0 && (P(O, O), await new Promise((t) => setTimeout(t, 0))), w?.mark("sheets");
4154
- const le = {
4155
- ...ae.entries().next().value?.[1],
4156
- styles: ie,
4157
- theme: ne.toJSON()
4158
- }, ce = ((t, e, s, o) => {
4159
- const r = {}, n = (t, e) => {
4160
- if (t) for (const { key: s, value: o } of t) {
4161
- const t = e[s];
4162
- if (t && o) if ("revisionNumber" === t) {
4163
- const t = parseInt(o, 10);
4164
- Number.isFinite(t) && (r.revisionNumber = t);
4165
- } else r[t] = o;
4166
- }
4167
- };
4168
- if (n(t, to), n(e, eo), s) {
4169
- const t = [];
4170
- for (const e of s) {
4171
- const s = oo(e);
4172
- s ? t.push(s) : o?.(`The custom document property '${e.key}' holds a value of a kind that is not read (${e.kind ? "vt:" + e.kind : "none"}); it was dropped.`, "xlsx.docProps.custom.kind");
4173
- }
4174
- t.length > 0 && (r.custom = t);
4175
- }
4176
- return Object.keys(r).length > 0 ? r : void 0;
4177
- })(xt.values().next().value?.properties, vt.values().next().value?.properties, wt.values().next().value?.custom, (t, e) => {
4178
- k(t, "docProps/custom.xml", e);
4179
- });
4180
- ce && (le.properties = ce), ((t, e) => {
4181
- if (!e || 0 === e.size) return;
4182
- const s = t.styles;
4183
- if (!s) return;
4184
- const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
4185
- for (const s of t.sheets ?? []) {
4186
- const t = bt(s);
4187
- if (!t) continue;
4188
- const n = /* @__PURE__ */ new Set();
4189
- io(t.cols) || n.add(0);
4190
- for (const e of t.directStyles ?? []) n.add(Array.isArray(e) ? e[1] : e.v);
4191
- for (const e of t.rows ?? []) {
4192
- const t = no(e);
4193
- void 0 !== t && n.add(t);
4194
- }
4195
- for (const e of t.cols ?? []) {
4196
- const t = no(e);
4197
- void 0 !== t && n.add(t);
4198
- }
4199
- let i = !1;
4200
- for (const t of n) if (e.has(t)) {
4201
- i = !0;
4202
- break;
4203
- }
4204
- if (i) {
4205
- t.protection = {
4206
- ...t.protection ?? { sheet: !0 },
4207
- showFormulas: !1
4208
- };
4209
- for (const t of n) (e.has(t) ? r : o).add(t);
4210
- }
4211
- }
4212
- if (0 === o.size) return;
4213
- const n = s.direct ?? (s.direct = []);
4214
- for (const t of o) 0 !== t && ao(n[t] ?? (n[t] = {}), !0);
4215
- for (const t of r) 0 !== t && ao(n[t] ?? (n[t] = {}), !1);
4216
- if (o.has(0)) {
4217
- const t = s.named ?? (s.named = []), e = c.BuiltInName.Normal.toLowerCase();
4218
- let o = t.find((t) => t.name?.toLowerCase() === e);
4219
- o || (o = {
4220
- name: c.BuiltInName.Normal,
4221
- style: {}
4222
- }, t.push(o)), ao(o.style, !0);
4223
- }
4224
- })(le, F.get(ro)), ((t) => {
4225
- const s = {
4226
- colStart: 0,
4227
- rowStart: 0,
4228
- colEnd: at,
4229
- rowEnd: tt
4230
- };
4231
- for (const r of t.sheets ?? []) {
4232
- const t = bt(r);
4233
- if (!t) continue;
4234
- const n = [];
4235
- if (uo(t.cols, !0, s, n), uo(t.rows, !1, s, n), 0 === n.length) continue;
4236
- const i = [];
4237
- for (const [e, s] of t.directStyles ?? []) i.push({
4238
- ...p.fastStringToRange(e),
4239
- value: {
4240
- kind: 0,
4241
- index: s
4242
- }
4243
- });
4244
- i.push(...n);
4245
- const a = [], l = new o.IteratorInstance(i, { axis: e.Column });
4246
- for (let t = l.next(); !t.done; t = l.next()) {
4247
- const e = t.value.overlaps;
4248
- let o;
4249
- if (1 === e.length) {
4250
- if (o = e[0].value, 0 === o.index) continue;
4251
- } else {
4252
- let t, s, r;
4253
- for (let o = 0; !t && o < e.length; o++) {
4254
- const n = e[o].value;
4255
- 0 === n.kind ? t = n : 1 === n.kind ? s = n : r = n;
4256
- }
4257
- o = t ?? s ?? r;
4258
- }
4259
- a.push([p.rangeToString(t.value.range, s), o.index]);
4260
- }
4261
- a.length > 0 ? t.directStyles = a : delete t.directStyles;
4262
- }
4263
- })(le);
4264
- {
4265
- const e = F.get(lo);
4266
- e && ((t, e, s) => {
4267
- if (!e || 0 === e.size || !s) return;
4268
- const o = (t) => {
4269
- if (void 0 === t || 0 === t) return null;
4270
- const o = e.get(t);
4271
- return void 0 !== o ? s.controls[o] ?? null : null;
4272
- };
4273
- for (const e of t.sheets ?? []) {
4274
- const t = bt(e);
4275
- if (!t) continue;
4276
- const s = /* @__PURE__ */ new Map();
4277
- for (const e of t.directStyles ?? []) {
4278
- const t = Array.isArray(e) ? e[0] : e.r, r = o(Array.isArray(e) ? e[1] : e.v);
4279
- if (!r) continue;
4280
- const n = JSON.stringify(r);
4281
- let i = s.get(n);
4282
- i || (i = {
4283
- control: r,
4284
- addresses: []
4285
- }, s.set(n, i)), co(t, i.addresses);
4286
- }
4287
- if (0 === s.size) continue;
4288
- const r = [...t.cellControls ?? []];
4289
- for (const { control: t, addresses: e } of s.values()) r.push({
4290
- r: e.join(","),
4291
- v: t
4292
- });
4293
- t.cellControls = r;
4294
- }
4295
- })(le, e, N("featurePropertyBag", s, t, K, U, kt).values().next().value?.featurePropertyBag);
4296
- }
4297
- {
4298
- const e = /* @__PURE__ */ new Map();
4299
- N("slicers", s, t, K, U, kt).forEach((t, s) => {
4300
- t?.slicers && e.set(s, t.slicers);
4301
- }), function(t, e) {
4302
- const s = t.sheets ?? [], o = /* @__PURE__ */ new Map();
4303
- for (let t = 0; t < s.length; t++) {
4304
- const e = s[t], r = bt(e)?.tables ?? [];
4305
- for (let t = 0; t < r.length; t++) {
4306
- const e = r[t], s = Array.isArray(e) ? e[1] : e?.v;
4307
- if (!s?.id) continue;
4308
- const n = (s.columns ?? []).map((t) => "string" == typeof t ? { name: t } : t);
4309
- o.set(String(s.id), {
4310
- name: s.name ?? "",
4311
- columns: n
4312
- });
4313
- }
4314
- }
4315
- const r = /* @__PURE__ */ new Set();
4316
- for (let t = 0; t < s.length; t++) {
4317
- const n = s[t], i = bt(n);
4318
- if (!i) continue;
4319
- const a = i.slicers, l = i.movables;
4320
- if (a && l) for (let t = l.length - 1; t >= 0; t--) {
4321
- const s = l[t].content;
4322
- if ("slicer" !== s?.type || s.json?.source) continue;
4323
- const n = s.name ?? "", i = a[n];
4324
- if (!i?.tableId) continue;
4325
- const c = o.get(String(i.tableId)), h = c ? Ut(c.columns, i.columnId) : null;
4326
- c && h ? (s.json = Gt(i, s.json, g.structuredReference(c.name, h.name)), r.add(n), i.cachePath && e.markAbsorbed(i.cachePath)) : (e.warn("A slicer names no table; it was not imported.", "xlsx.slicer.cacheDefinition"), l.splice(t, 1));
4327
- }
4328
- delete i.slicers;
4329
- }
4330
- e.slicerParts.forEach((t, s) => {
4331
- const o = Object.keys(t);
4332
- o.length > 0 && o.every((t) => r.has(t)) && e.markAbsorbed(s);
4333
- });
4334
- }(le, {
4335
- warn: (t, e) => {
4336
- k(t, "xl/slicers", e);
4337
- },
4338
- markAbsorbed: ot,
4339
- slicerParts: e
4340
- });
4341
- }
4342
- le.calc = {
4343
- ...le.calc ?? {},
4344
- legacyIntersect: !0
4345
- }, It.length > 0 && (le.strings = It);
4346
- const he = St.toJSON();
4347
- he && he.length > 0 && (le.people = he);
4348
- const ue = Y.getEntry("xl/vbaProject.bin");
4349
- if (ue) try {
4350
- const { VBAProject: t } = await import("./CMWAsUQ66V8fYrME.js"), e = t.extract(ue);
4351
- if (e) {
4352
- const s = /* @__PURE__ */ new Map();
4353
- for (const t of le.sheets ?? []) {
4354
- const e = bt(t), o = e?.codeName;
4355
- o && s.set(o, e);
4356
- }
4357
- for (const o of e.modules) {
4358
- const e = { language: "vba" }, { header: r, body: n } = t.splitAttributes(o.code);
4359
- n && (e.source = n), r && (e.sourceHeader = r);
4360
- const i = "document" === o.type ? s.get(o.name) : void 0;
4361
- i || "document" !== o.type || (e.scope = "workbook");
4362
- const a = i ? i.modules ??= {} : le.modules ??= {};
4363
- a[o.name] || (a[o.name] = e);
4364
- }
4365
- u?.(e);
4366
- } else A.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
4367
- } catch (t) {
4368
- A.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
4369
- }
4370
- const de = F.get("calcId"), pe = void 0 === de || !(Number(de) >= 191029), fe = m.calcOnLoad ?? ("auto" === f && pe ? "full" : f), ge = {
4371
- ...m,
4372
- calcOnLoad: fe,
4373
- resources: h,
4374
- json: le
4375
- };
4376
- if (void 0 === ge.disableLoadAutoFit) {
4377
- const t = F.get(D);
4378
- ge.disableLoadAutoFit = !!t?.declared && t.normalIsThemeFont && await Pt(t.faces);
4379
- }
4380
- w?.mark("json-assembled");
4381
- const me = new S(ge);
4382
- if (w?.mark("workbook-constructed"), B.forEach((t) => {
4383
- t.deleteReference(L);
4384
- }), x.endPersist(), v) {
4385
- Tt(me);
4386
- const t = /* @__PURE__ */ new Map();
4387
- let e = 0;
4388
- for (const s of Y.getNames()) {
4389
- const o = Y.getEntry(s);
4390
- if (!o) continue;
4391
- const r = Y.getRawEntry(s), n = r ? {
4392
- data: o,
4393
- uncompressedSize: Y.uncompressedSize(s),
4394
- raw: {
4395
- compressedData: r.data,
4396
- compressionMethod: r.compressionMethod,
4397
- signature: r.signature
4398
- }
4399
- } : {
4400
- data: o,
4401
- uncompressedSize: Y.uncompressedSize(s)
4402
- };
4403
- t.set(s, n), e += o.byteLength;
4404
- }
4405
- if (e > 67108864) A.push([`Source package too large to retain (${e} bytes, limit ${Ht}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
4406
- else if (t.size > 0) {
4407
- const e = new $(t, st);
4408
- X(me, e);
4409
- let s = me.getWorksheets().getItems();
4410
- const o = me.getTransactions().addListener({ onCommitEnd: (t) => {
4411
- const s = t.getOperation()?.name;
4412
- "insertCells" !== s && "deleteCells" !== s || e.markStructuralChange();
4413
- } }), r = me.addListeners({ onSheetsChange: () => {
4414
- const t = me.getWorksheets().getItems();
4415
- (t.length !== s.length || t.some((t, e) => t !== s[e])) && e.markStructuralChange(), s = t;
4416
- } });
4417
- me.addListeners({ onClose: () => {
4418
- o(), r(), Tt(me);
4419
- } });
4420
- }
4421
- }
4422
- if (A.length && I?.onWarning) {
4423
- const t = /* @__PURE__ */ new Set();
4424
- for (const e of A) {
4425
- const [s, o, r] = e, n = r ?? s;
4426
- t.has(n) || (t.add(n), I.onWarning(s, o));
4427
- }
4428
- }
4429
- return w && !0 === d && console.table(w.toTable()), await me.whenFontsReady(), me;
4430
- } catch (t) {
4431
- let e = "Unable to parse XLSX.";
4432
- throw t instanceof s && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
4433
- } finally {
4434
- await Y.close().catch(() => {});
4435
- }
4436
- };
4437
- export { ro as a, lo as i, Bs as n, fo as r, xo as t };