@sheetxl/studio-vanilla 0.7.28-beta.2 → 0.7.28-beta.3

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 (297) hide show
  1. package/browser/cjs/{Bf2M1sdVR89d3yxg.cjs → B2cX7nid45K1XRcB.cjs} +1 -1
  2. package/browser/cjs/{DMNRMppC1tGKEiCa2.cjs → BCax8eUosvZxqJum2.cjs} +1 -1
  3. package/browser/cjs/{CcLfDX6uHge33mwb2.cjs → BDSt3etlKFP344pX2.cjs} +1 -1
  4. package/browser/cjs/{Ca4DwcXOTqVuUOVq2.cjs → BHpypCDUD5cP3vR92.cjs} +1 -1
  5. package/browser/cjs/{BtuU_zhIvl9orhXJ2.cjs → BIcGM64pW8jzwXoR.cjs} +1 -1
  6. package/browser/cjs/{Cdi9twdv4KfAl5I72.cjs → BQEk2bmRsrTs-zJu2.cjs} +3 -3
  7. package/browser/cjs/{Y37Q7YjNKfaPg9qC.cjs → BW4gFAFA5vc1x_8G.cjs} +1 -1
  8. package/browser/cjs/{CVvPoEKURol1Aftd.cjs → BYp7-QW_AGEONvMr.cjs} +1 -1
  9. package/browser/cjs/{BeYzZkmTef6nGcoR.cjs → Bq7bgCz2WfVwfQSv.cjs} +2 -2
  10. package/browser/cjs/{3xD-77z5V9IlNXjn2.cjs → BzvKaJw-3G3FMhao2.cjs} +1 -1
  11. package/browser/cjs/C1tO7v57UD8xmj2X.cjs +86 -0
  12. package/browser/cjs/C9K6gYebhUCoGcyy.cjs +5 -0
  13. package/browser/cjs/{BFDhFIqPaIRivcO3.cjs → CAEF_wXnxI6o5BkS.cjs} +1 -1
  14. package/browser/cjs/{CFnnvEHNOFcAUaHE.cjs → CN8lXPB3rJ4Ux6jN.cjs} +1 -1
  15. package/browser/cjs/{X5Grge615whs1q_I2.cjs → CObKFza7rEOQcteD2.cjs} +1 -1
  16. package/browser/cjs/CcBPECGj-X0W9a3_.cjs +3 -0
  17. package/browser/cjs/{BH_9BSdzWI3sYvEo2.cjs → ChMPHLE_jFKu0JmZ2.cjs} +1 -1
  18. package/browser/cjs/{jgba8pT4LamzxlS8.cjs → CtEazH3mA0Tj8qrG.cjs} +1 -1
  19. package/browser/cjs/{0udzrkQg8Nf9nRbI.cjs → CxY5iqVeCdKKTzDq.cjs} +1 -1
  20. package/browser/cjs/{B37bgauMls6bQwyP.cjs → D2KFRZ75pzopfyVC.cjs} +1 -1
  21. package/browser/cjs/{BREMLtxkQhtNSVra.cjs → D6cjnwWR_iUSe1f62.cjs} +1 -1
  22. package/browser/cjs/D9OGD2b5RCuNVkVt.cjs +1 -0
  23. package/browser/cjs/DDGqSmEUwpCyj2-T.cjs +12 -0
  24. package/browser/cjs/{pb5LnC0Ye1NBoRvg.cjs → DMJpPocVk36TEmfa.cjs} +1 -1
  25. package/browser/cjs/{BqJIWrtud1IdCny_.cjs → DP0yIsjVWme5C-UE.cjs} +1 -1
  26. package/browser/cjs/Dmdcgm3pqGKmXPGb.cjs +33 -0
  27. package/browser/cjs/{CFSMFEE8YXmRYGPL.cjs → Ds8fgjqVz8xPRHog.cjs} +1 -1
  28. package/browser/cjs/{C1nECuaXDUkYlVQY2.cjs → DuLz-mXv6patMuVn2.cjs} +1 -1
  29. package/browser/cjs/{VRIZX6-JADRk2Iao.cjs → Eja0Zsmdah-At3rJ.cjs} +1 -1
  30. package/browser/cjs/{CxWeFfNAUvhHe9F-.cjs → QH2fF4MqkcvdkNjz.cjs} +2 -2
  31. package/browser/cjs/{CUCXS7BrMsSnSXVr.cjs → Y0B5_Kqc0UL2taRO.cjs} +2 -2
  32. package/browser/cjs/gOdLq87FmaB-hTTZ.cjs +1 -0
  33. package/browser/cjs/index.cjs +1 -1
  34. package/{cdn/assets/Cl5KKGUmrf4e7lB3.js → browser/esm/2dJqxS99uENpvAC92.mjs} +1 -1
  35. package/browser/esm/{9LhOHxxuP2jO-YDv.mjs → 4-QoxOhoR614u5tO.mjs} +12 -12
  36. package/browser/esm/{tEoFD7IKo7vDcL80.mjs → 53p_EWlOxGgrMq-q.mjs} +207 -207
  37. package/{cdn/assets/DwGeIZ6nCjk9UiXk.js → browser/esm/5XtgjihhVCzNqyYJ2.mjs} +1 -1
  38. package/browser/esm/{DpjPEgS5W70lK0GU.mjs → B1AbnDun66mq_S2f.mjs} +12 -12
  39. package/browser/esm/{BJhMeXHgj2izJPad.mjs → B3CqIagnCvfOrLBT.mjs} +7 -7
  40. package/browser/esm/{GjOmlUOFqz90L-9x2.mjs → B4094aQR3Q4KhALV2.mjs} +8 -8
  41. package/{cdn/assets/CwRqY3jy0pkU72Ty.js → browser/esm/B7kOoeXeYeZqA_mU.mjs} +1 -1
  42. package/{cdn/assets/CDVkQjbphikzy5cP.js → browser/esm/BC9RLqAWMPRx_1rS.mjs} +1 -1
  43. package/browser/esm/{DvFh-0k-PvKrKwkt.mjs → BDHrIbkTx7Ii0RYb.mjs} +5 -5
  44. package/browser/esm/{TJB9Rw8_wY-D-aKa2.mjs → BEF8kcbXgMjyCP4C2.mjs} +1 -1
  45. package/browser/esm/{DafUQqzTsegjuTX92.mjs → BEgQWG98wq54oeau2.mjs} +7 -7
  46. package/{cdn/assets/Wy-cTg0gDeXuKv0a.js → browser/esm/BG-wTTfaCHaJMI5b2.mjs} +1 -1
  47. package/{cdn/assets/9XJnug1pfQreKXZr.js → browser/esm/BG8zQEmkmTTw8LXE2.mjs} +1 -1
  48. package/browser/esm/{D0OOkDRea_6_jbt2.mjs → BHmeRWtpqOMknkon.mjs} +1 -1
  49. package/browser/esm/{DzujlnEzr0M92mNz.mjs → BIboUJ6YhTe0O5Ep.mjs} +1 -1
  50. package/{cdn/assets/MIcNDPtZ2tOqEJLi.js → browser/esm/BKX_mnqOl4t0M7Q-.mjs} +1 -1
  51. package/browser/esm/{BfkghIcy-zOKLz4c.mjs → BLq8q4tpQq7lW0jg.mjs} +2 -2
  52. package/{cdn/assets/BVRLpEysZKAgHCqC.js → browser/esm/BM3Fxh1DBzKRDnJ-2.mjs} +1 -1
  53. package/{cdn/assets/Ds-v1MKCCCRK5y__.js → browser/esm/BMlDCj6kw-JTuDJ92.mjs} +1 -1
  54. package/browser/esm/{BnFl2afy78teEcaD.mjs → BT1lb0BHqaMUHJEH.mjs} +4 -4
  55. package/browser/esm/{DbmQdZUcujE_ICGk.mjs → BTiq0pI-MmNI9sx6.mjs} +3 -3
  56. package/browser/esm/{CCH2N2D6f4m3sxHV.mjs → BV1A7fanbtryQZdr.mjs} +129 -129
  57. package/{cdn/assets/DL-6XEhXlHkvgtF_.js → browser/esm/BXf0y-wp2FQ5btCG2.mjs} +1 -1
  58. package/browser/esm/{DnS-xX8jkMERhPbF.mjs → BamGz0uoayfOfFJD.mjs} +8 -8
  59. package/{cdn/assets/Ccj-Gq_hyRtb93R-.js → browser/esm/BbRZ0cO4t2haGX-o.mjs} +1 -1
  60. package/browser/esm/{DJoktru8Ln1idAEk2.mjs → BbgnnZj965cf_RAV2.mjs} +9 -9
  61. package/{cdn/assets/7R7r4iHAxN8rnOmW2.js → browser/esm/Be2V19M8IxytN_Aa.mjs} +2 -2
  62. package/browser/esm/{EHwbgKRgADVAwQbs2.mjs → BibrryjUsSysyTSD2.mjs} +11 -11
  63. package/browser/esm/{CtPuA7JjziKZTOy4.mjs → Bk-F9XzxhuyAOQqK.mjs} +1 -1
  64. package/{cdn/assets/HA0CYoHHAU5VgVW5.js → browser/esm/Bk13V_C0eSaqMClU.mjs} +1 -1
  65. package/browser/esm/{BZDhc9cFdvb2DZp52.mjs → BlC4_SZ2XYvtnkHw.mjs} +12 -12
  66. package/{cdn/assets/BsGIsDAUk9bSNC2-.js → browser/esm/BmZX5BqczMfR2VlT2.mjs} +1 -1
  67. package/browser/esm/{BFIwPtz-TW4VvaZR.mjs → Bpp8p7LJo9K-1Tm-.mjs} +1 -1
  68. package/browser/esm/{ejd62mg_zHpVGhbH.mjs → Bpypf56n7jOOW7Ys.mjs} +9 -9
  69. package/browser/esm/{BDJXGdb3hQGrna00.mjs → Bs6uuY3i689nSdNa.mjs} +3890 -3803
  70. package/browser/esm/{me8l7609yOrUhpBU2.mjs → BwekjT1bXcBAV6hi2.mjs} +1 -1
  71. package/browser/esm/{BKY2gKXOB637hih-.mjs → Bxt5fHMZXudQ1QHA.mjs} +6 -6
  72. package/browser/esm/{DMXx0lIMiLsQgbVK.mjs → Byl6FdOyv58rFwxZ.mjs} +5 -5
  73. package/{cdn/assets/BkgfJjCizaRuC_N5.js → browser/esm/Bynpw8CnO-1JkFdZ2.mjs} +1 -1
  74. package/{cdn/assets/q1AmoBDraQE-T8im2.js → browser/esm/BzilGTs3oFGxJ5uB.mjs} +2 -2
  75. package/browser/esm/{Dr0aqIJxcsRdzQox2.mjs → C39fSQO6blxFky052.mjs} +7 -7
  76. package/browser/esm/{C5wklWg-nVHGfhda.mjs → CC52ynv81P-LwXRT.mjs} +6 -6
  77. package/browser/esm/{Bi2jbQd8mecebnRM2.mjs → CCvvNbrMzlFHlAbr2.mjs} +4 -4
  78. package/{cdn/assets/TikP0KAVISVw72_42.js → browser/esm/CEWWFcwu4AyqL0cQ.mjs} +225 -220
  79. package/browser/esm/{BmNqTvvRVjF_c1qz.mjs → CEgIZKMC4XoMmPp5.mjs} +3 -3
  80. package/browser/esm/{DyDgU8THo8GBGQ4M.mjs → CI8YyVegXUBlHR61.mjs} +1 -1
  81. package/browser/esm/{B6mzT3jt8PsKgBWH2.mjs → CI92jUOrJIKUlfGx2.mjs} +128 -128
  82. package/browser/esm/{CshVZ7dBZzXK1qdP.mjs → CKc-IOHYDEuo2FhB.mjs} +5 -5
  83. package/browser/esm/{IPVHjbNIjyMsOxUR.mjs → CNZeWICVX0x6E3-Z.mjs} +1 -1
  84. package/browser/esm/{C0Cbiq1ZKs0s-oUn.mjs → CNgKTif3Jo9FLV7d.mjs} +2 -2
  85. package/{cdn/assets/CQhIZf112hMPFsjD.js → browser/esm/CSlBZF1ezptA1LSS2.mjs} +1 -1
  86. package/{cdn/assets/B9epCKVFFaq_fX4j.js → browser/esm/CUj7kwIeQGAqyb6V.mjs} +1 -1
  87. package/browser/esm/{ytk4-EolaWr77_nC.mjs → CVDNfe5yVj7xYGeO.mjs} +2 -2
  88. package/browser/esm/{DJl3zpaAG7xtX-vB.mjs → CWQXDC8Qk5PH757v.mjs} +13 -13
  89. package/{cdn/assets/D-YuVmmS-kKcV9xr2.js → browser/esm/CX0QhwSYuHoImWlY2.mjs} +1 -1
  90. package/browser/esm/{CH-EdTSDEYE7IaBC.mjs → CZy1bU6cVChuZKag.mjs} +236 -236
  91. package/browser/esm/{Dnk-x1RHZ-HCYKGy2.mjs → C_Kd0CPQvZsJLD6b2.mjs} +1 -1
  92. package/{cdn/assets/COZ775SOX8hXz68T.js → browser/esm/CdV0VXnaW6UyTd8E.mjs} +1 -1
  93. package/browser/esm/{CTpri2fSv5dZbUwJ.mjs → CecKVsBMvvKuk2Og.mjs} +2107 -2037
  94. package/browser/esm/{BwYNDge9HsfAlKEk.mjs → Ci7qcrvyeBaD36sR.mjs} +5 -5
  95. package/{cdn/assets/ioECgEEk-HCEo_qL2.js → browser/esm/Cjq-G2Seyww6IMSH.mjs} +1 -1
  96. package/browser/esm/{BVLamiPGpKQKiyPW2.mjs → Clu5SMZriAkKa_np2.mjs} +13 -13
  97. package/browser/esm/{BrmKrgxwVxzOs8v9.mjs → CmcKdn-U2ywgYm_9.mjs} +2 -2
  98. package/browser/esm/{BfmngO7uzIcK9Lux2.mjs → CqSxZiLos0nQa69t2.mjs} +5 -5
  99. package/browser/esm/{0HCb-Mkw8Otpj9B6.mjs → CsK0x9jgM8z_DOl1.mjs} +37 -37
  100. package/browser/esm/{uwB2_ERsYGldq4on2.mjs → CsqtbHllm56zw5xh2.mjs} +1 -1
  101. package/browser/esm/{CbGZtQlImYkXEGhI.mjs → CtZ4wSjG6QUWs7Nn.mjs} +6 -6
  102. package/{cdn/assets/DcTAnKNgB4UiSyH-2.js → browser/esm/CtaapT_7WuEvy48w2.mjs} +1 -1
  103. package/browser/esm/{BIklj1nwWIcZCmKp2.mjs → CxJliRXAfjf-8FJL2.mjs} +1 -1
  104. package/browser/esm/{BXOm0hdx068QsENe.mjs → D5MuKMXqFbc9B8JP.mjs} +3 -3
  105. package/browser/esm/{D2fjpIsYf8xbJ3qt2.mjs → D7-Zv2k1IJkmQoxc.mjs} +1 -1
  106. package/browser/esm/{BVGcECvfrJsTA5kD.mjs → D99KkptfLQp60ECI.mjs} +2 -2
  107. package/browser/esm/{CySaHP1TkAtt7IqW.mjs → DA0VxVTFcWvrEQEv.mjs} +2 -2
  108. package/browser/esm/{DBVG6J7cidK5K5QE.mjs → DD-_f0jEXDy0dn6z.mjs} +6 -6
  109. package/{cdn/assets/ClIlIFc_63tI2r9S.js → browser/esm/DDg-fxiIqpuutuyu2.mjs} +1 -1
  110. package/{cdn/assets/Ba0_2fGhHSS7kV2l.js → browser/esm/DJzMm5FQXuMWHNom2.mjs} +1 -1
  111. package/{cdn/assets/CTsLj1vEfSqm_tm4.js → browser/esm/DKLwRgsx1WelayB6.mjs} +1 -1
  112. package/browser/esm/{DeY3vEbV4T2WgYP22.mjs → DNXCAcVGHeeoKPcx2.mjs} +1 -1
  113. package/{cdn/assets/BJkZVLqBoBngX2V-.js → browser/esm/DSY8maNeFb51KgKe2.mjs} +1 -1
  114. package/browser/esm/{39GslBYZKZUJpjcX.mjs → DT8AGfoENVVMPsi3.mjs} +1 -1
  115. package/browser/esm/{B9yaWiEn9khUlCmT.mjs → DUpHK7eGlzF6E3h5.mjs} +5 -5
  116. package/browser/esm/{CMBLrQ2K32IKaZHu.mjs → DX0xvH5nQ8MjqsA02.mjs} +2 -2
  117. package/{cdn/assets/CZVi5-MceLzKtZCX.js → browser/esm/DYaHqG1Xx-r7mlLq.mjs} +1 -1
  118. package/browser/esm/{ZFZ3X4ek1OFa4xKm.mjs → DZyZNxEMnIWr2n8S.mjs} +3 -3
  119. package/{cdn/assets/CpD0Rq1ei0UW4wvV2.js → browser/esm/DbGc-QtQMWI-VyUe.mjs} +1 -1
  120. package/{cdn/assets/bY52psG3lmpa706j2.js → browser/esm/DbfFQif7awKrcxxB.mjs} +3 -3
  121. package/browser/esm/{CkRTvOlXWFrTaFLB.mjs → Dcbf_tge-hZbUfUD.mjs} +4 -4
  122. package/browser/esm/{DYhGe1HslNmi3MWF.mjs → De-RIk_tQ6xW8NH2.mjs} +1 -1
  123. package/browser/esm/{CTZpbsb07-ieZ8Sv.mjs → DgGF1ZaI3ti0c_Nz.mjs} +1 -1
  124. package/browser/esm/{DqJYCOxMI0h7olt5.mjs → DhnxpW56CJ43gVOI.mjs} +1 -1
  125. package/browser/esm/{CVtQ8m0S6nnXk7XH.mjs → DjwllBVpUWlaltMT.mjs} +6 -6
  126. package/browser/esm/{AS-KiFBez1nwB_vC.mjs → DqfIf41HljTIhC84.mjs} +5 -5
  127. package/{cdn/assets/zsqoPH22vSCRd7nP.js → browser/esm/Dt8IOrB4ifUVtTff2.mjs} +1 -1
  128. package/browser/esm/{Bp1kaqNxSV0Hskwb.mjs → DwEiTFl_RN5oQzfh.mjs} +7 -7
  129. package/{cdn/assets/CTdaEmBnApCaYU--2.js → browser/esm/HQv1oLV3ax-NKXZG.mjs} +1 -1
  130. package/browser/esm/{qxXoiVui214rfZng2.mjs → IMAnmKax7yp8adEP2.mjs} +15 -15
  131. package/{cdn/assets/BXzrl80_N9hn_3462.js → browser/esm/Jw068AbKaxWlv8HJ2.mjs} +1 -1
  132. package/browser/esm/{GzFeH6oCN6eWnXbX.mjs → MJIl3u3WexRfuRxx.mjs} +4 -4
  133. package/{cdn/assets/D_olfPNNH0l8JrFu.js → browser/esm/MZKwwgG9APikaCAg.mjs} +249 -243
  134. package/{cdn/assets/DavD7unX6vAvDq492.js → browser/esm/Nj1DgowT0KN0un7b2.mjs} +1 -1
  135. package/{cdn/assets/DUVV-c3N8XuG8lyr.js → browser/esm/R3YBWWwMJAzbuwie2.mjs} +1 -1
  136. package/browser/esm/{DD_-Q_s0aq0ehCRj.mjs → RFuzM5jhOgjn2C_7.mjs} +2 -2
  137. package/{cdn/assets/COgR28nGHeL59WLY.js → browser/esm/SNsjWQUbxOQzdnCT.mjs} +1 -1
  138. package/browser/esm/{CtCW25b0E8FaH1jL.mjs → Sm94kpOe8UUYLpaZ.mjs} +3 -3
  139. package/browser/esm/{DRU8HlvNdJ-IdDad2.mjs → UOfj2s5X9yjL1iLF2.mjs} +8 -8
  140. package/browser/esm/{Z4L_LGr5jeXjCPo6.mjs → YGKMD1YfDLoo18Sy.mjs} +1 -1
  141. package/browser/esm/{B27wXIrrKNvUzMGE.mjs → iKMg-svZQSvoVzqO2.mjs} +1 -1
  142. package/browser/esm/index.mjs +4 -4
  143. package/browser/esm/{BZ6ssyp3xvgxb4Ux2.mjs → jvvKubD9MdvZCawH2.mjs} +11 -11
  144. package/browser/esm/{Btdn9KXWaFikV2VI.mjs → l9SSIWXeR5tPN95-.mjs} +3 -3
  145. package/browser/esm/{CukE7coIERV0PmeU2.mjs → nBRFIzaPeMPPvIMQ2.mjs} +6 -6
  146. package/browser/esm/{B3N4rAHBBKghSNf-.mjs → rnntZ_PYlojxr5c4.mjs} +303 -304
  147. package/browser/esm/{B609gZLpNve9hsr-2.mjs → sIWoD1UYd1XgTrIs2.mjs} +1 -1
  148. package/browser/esm/{C8KBkOocNYDNWBDu.mjs → swjGzqq7IK8YnHrV.mjs} +2 -2
  149. package/{cdn/assets/BCcFKm-VY0gZ0TzZ.js → browser/esm/uk2_KQhVX77MWa7A2.mjs} +1 -1
  150. package/{cdn/assets/BJahzXLdJMKJrGJ82.js → browser/esm/y07oKUx2vGjEEZ0w.mjs} +1 -1
  151. package/browser/esm/{CZDNrQuttGG8SW_a2.mjs → yFD3mg0KbvkE3s1Y2.mjs} +7 -7
  152. package/browser/esm/{B-cVGeAqeE1MJbcg2.mjs → yqwkS9EO5146-Xhf2.mjs} +9 -9
  153. package/cdn/assets/{CbWjq5gAF4Empxh12.js → -OScuzLTidF7HNaK2.js} +14 -14
  154. package/cdn/assets/{Cl2Y6toZDsktHGlZ.js → -wn5AXVsNdciGzNx.js} +1223 -1224
  155. package/{browser/esm/Cl5KKGUmrf4e7lB32.mjs → cdn/assets/2dJqxS99uENpvAC9.js} +1 -1
  156. package/cdn/assets/{s_afm7GAx-6Ktr_x.js → 3QC61uhcIBmRDR9w.js} +5156 -5086
  157. package/cdn/assets/{B102zq0Z2de_ly2m.js → 4Z5QgDDHi93cqy332.js} +193 -193
  158. package/{browser/esm/DwGeIZ6nCjk9UiXk2.mjs → cdn/assets/5XtgjihhVCzNqyYJ.js} +1 -1
  159. package/cdn/assets/{CyhnDYQf3_cdp52w2.js → B1WYofA6cHbr8sxv2.js} +100 -100
  160. package/cdn/assets/{Dwplym5bjb2VhwM82.js → B4aainAlYLn-Q5H62.js} +3 -3
  161. package/cdn/assets/{BQvxcrhV7qxXjTHq.js → B5G5aOCiy3kn0ADy.js} +2 -2
  162. package/{browser/esm/CwRqY3jy0pkU72Ty2.mjs → cdn/assets/B7kOoeXeYeZqA_mU2.js} +1 -1
  163. package/cdn/assets/{BwJlIoU5gbBMo6Q5.js → B8kiZt5i9HOHYeAo.js} +3 -3
  164. package/{browser/esm/CDVkQjbphikzy5cP2.mjs → cdn/assets/BC9RLqAWMPRx_1rS.js} +1 -1
  165. package/cdn/assets/{CXULuRUQ4TAsm84q.js → BDZq-VDymQAePI7X.js} +2 -2
  166. package/cdn/assets/{TJB9Rw8_wY-D-aKa.js → BEF8kcbXgMjyCP4C.js} +1 -1
  167. package/{browser/esm/Wy-cTg0gDeXuKv0a2.mjs → cdn/assets/BG-wTTfaCHaJMI5b.js} +1 -1
  168. package/{browser/esm/9XJnug1pfQreKXZr2.mjs → cdn/assets/BG8zQEmkmTTw8LXE.js} +1 -1
  169. package/cdn/assets/{DMBv9-cZDNgrEPnj.js → BGlQEwuUWK6Oz7bC.js} +105 -105
  170. package/{browser/esm/CpD0Rq1ei0UW4wvV.mjs → cdn/assets/BHmeRWtpqOMknkon.js} +1 -1
  171. package/cdn/assets/BHmeRWtpqOMknkon2.js +24 -0
  172. package/cdn/assets/{Dm-vUbnccwQ63uHt.js → BITxO-ILVNOqgbA7.js} +4 -4
  173. package/{browser/esm/MIcNDPtZ2tOqEJLi.mjs → cdn/assets/BKX_mnqOl4t0M7Q-2.js} +1 -1
  174. package/{browser/esm/BVRLpEysZKAgHCqC.mjs → cdn/assets/BM3Fxh1DBzKRDnJ-.js} +1 -1
  175. package/{browser/esm/Ds-v1MKCCCRK5y__2.mjs → cdn/assets/BMlDCj6kw-JTuDJ9.js} +1 -1
  176. package/cdn/assets/{nBpkSj6rxz09lHp42.js → BNU2ZqxIegIJr-572.js} +7 -7
  177. package/cdn/assets/{CWdwxTP6ZBP_KJE42.js → BSUsQ6-YD40bvOdG2.js} +7 -7
  178. package/cdn/assets/{BOSnQONqTqkqjHEU.js → BV3cgeOVx6QLl85F.js} +6 -6
  179. package/cdn/assets/{C5yCm-TSfx74xL002.js → BWcc3hnnAhelxjOr2.js} +10 -10
  180. package/{browser/esm/DL-6XEhXlHkvgtF_2.mjs → cdn/assets/BXf0y-wp2FQ5btCG.js} +1 -1
  181. package/cdn/assets/{Dp_KsQdcEefYydgO2.js → BZbIcyw3tiUx7ztK2.js} +766 -766
  182. package/{browser/esm/Ccj-Gq_hyRtb93R-.mjs → cdn/assets/BbRZ0cO4t2haGX-o.js} +1 -1
  183. package/cdn/assets/{DWX7iaXMf0PrhOuh.js → BdI4wcd4XWPgeQnl.js} +3 -3
  184. package/cdn/assets/{BwbtHh-oXpG5mLZu2.js → BhNQRWnlFUA4eX9Z2.js} +4 -4
  185. package/cdn/assets/{CtPuA7JjziKZTOy42.js → Bk-F9XzxhuyAOQqK2.js} +1 -1
  186. package/{browser/esm/HA0CYoHHAU5VgVW5.mjs → cdn/assets/Bk13V_C0eSaqMClU.js} +1 -1
  187. package/cdn/assets/{B9HUtdLQ29C5hAM2.js → Bk8tTxRXYv1v5QpX.js} +2 -2
  188. package/{browser/esm/BsGIsDAUk9bSNC2-2.mjs → cdn/assets/BmZX5BqczMfR2VlT.js} +1 -1
  189. package/cdn/assets/{BFIwPtz-TW4VvaZR2.js → Bpp8p7LJo9K-1Tm-2.js} +1 -1
  190. package/cdn/assets/{D5F6MTHIhDIafUlO.js → BqA9-X1PlqRSSWll.js} +2 -2
  191. package/cdn/assets/{olHQykNiRoLYpdJB.js → Bt-Xdgz1GdP9i0KH.js} +5 -5
  192. package/cdn/assets/{CkqsTJkl1cuZl14R.js → Bv8Sjub_HtVCmnyZ.js} +6 -6
  193. package/cdn/assets/{me8l7609yOrUhpBU.js → BwekjT1bXcBAV6hi.js} +1 -1
  194. package/{browser/esm/BkgfJjCizaRuC_N52.mjs → cdn/assets/Bynpw8CnO-1JkFdZ.js} +1 -1
  195. package/cdn/assets/{CzQUeHmA3XvLXm-s2.js → BzNZfg3RJdx9PRAg2.js} +9 -9
  196. package/cdn/assets/{r4hni7MWaP9SUvzC.js → C0ioCmY0K9GI3SiM.js} +7 -7
  197. package/cdn/assets/{COnOkTReK4TBuBx52.js → C8lUc_Lc03y-Whne2.js} +12 -12
  198. package/cdn/assets/{DZn5mtzClpE29qV5.js → CAgzNDmM7lJZAN5m.js} +2 -2
  199. package/cdn/assets/{DyDgU8THo8GBGQ4M.js → CI8YyVegXUBlHR61.js} +1 -1
  200. package/cdn/assets/{CvC5oy9uXPzktYaz2.js → CJMMds78eEvd6ivG2.js} +3 -3
  201. package/cdn/assets/{DzRXZ_mhd60oh-A52.js → CK4ZQnpkZHN03RHP2.js} +9 -9
  202. package/cdn/assets/{IPVHjbNIjyMsOxUR2.js → CNZeWICVX0x6E3-Z.js} +1 -1
  203. package/cdn/assets/{ByJlomQcLV_4oZGw2.js → COaJqYKx8CJ595fz2.js} +4 -4
  204. package/{browser/esm/CQhIZf112hMPFsjD2.mjs → cdn/assets/CSlBZF1ezptA1LSS.js} +1 -1
  205. package/{browser/esm/B9epCKVFFaq_fX4j.mjs → cdn/assets/CUj7kwIeQGAqyb6V.js} +1 -1
  206. package/{browser/esm/D-YuVmmS-kKcV9xr.mjs → cdn/assets/CX0QhwSYuHoImWlY.js} +1 -1
  207. package/cdn/assets/{Dnk-x1RHZ-HCYKGy.js → C_Kd0CPQvZsJLD6b.js} +1 -1
  208. package/cdn/assets/{DtFr2Mm_KqU6PZfY.js → CaLQ8stna0cEenbY.js} +8 -8
  209. package/cdn/assets/{DfzSY0wpTYYTWIY2.js → Cb1n0HtvwfvZOwZz.js} +8 -8
  210. package/cdn/assets/{_fGcdybbKg6_ekOp.js → CcJHQ6UROltFQL2I.js} +2 -2
  211. package/{browser/esm/COZ775SOX8hXz68T2.mjs → cdn/assets/CdV0VXnaW6UyTd8E.js} +1 -1
  212. package/cdn/assets/{dL4ou82v-pjouw0s2.js → CeD6pRhoV1LfiJjD.js} +12 -12
  213. package/cdn/assets/{C6v7rU3plIdoUWre2.js → ChBa56MbB_cDd9LM2.js} +8 -8
  214. package/cdn/assets/{BXRMXZjJExEHTMfL2.js → CjO9u_nQjtCD7xTH2.js} +72 -72
  215. package/{browser/esm/ioECgEEk-HCEo_qL.mjs → cdn/assets/Cjq-G2Seyww6IMSH2.js} +1 -1
  216. package/cdn/assets/{Dungsxp8KcjLsV23.js → ClHDdBXrC_nobC_N.js} +9 -9
  217. package/{browser/esm/BHdUUWliTWsGcyUW.mjs → cdn/assets/ClWQjK8wtCNyfHiY.js} +2 -2
  218. package/cdn/assets/{BvONQrMoKCUSnkqN.js → ClkL86jz-4Gf_Uwg2.js} +10 -10
  219. package/cdn/assets/{CqFZWOO-31j7rHdf.js → CsfLKTLGWgDLWY2z.js} +6 -6
  220. package/cdn/assets/{uwB2_ERsYGldq4on.js → CsqtbHllm56zw5xh.js} +1 -1
  221. package/{browser/esm/DcTAnKNgB4UiSyH-2.mjs → cdn/assets/CtaapT_7WuEvy48w2.js} +1 -1
  222. package/cdn/assets/{CKGUrocJnCQ7uGt72.js → Cwee8HXWwJj0ASk32.js} +3890 -3803
  223. package/cdn/assets/{BIklj1nwWIcZCmKp.js → CxJliRXAfjf-8FJL.js} +1 -1
  224. package/cdn/assets/{DXnM0BURZgjm8R2W.js → D-bML_q46je0p2os.js} +8 -8
  225. package/cdn/assets/{D2fjpIsYf8xbJ3qt.js → D7-Zv2k1IJkmQoxc.js} +1 -1
  226. package/{browser/esm/D8iYbJIpITf1DL9N.mjs → cdn/assets/DAN4gSLpoicGd0oX2.js} +3 -3
  227. package/{browser/esm/B2pyobtSQ_9fn__o.mjs → cdn/assets/DBDr4dkaPZ8Gd8CD.js} +249 -243
  228. package/{browser/esm/ClIlIFc_63tI2r9S2.mjs → cdn/assets/DDg-fxiIqpuutuyu.js} +1 -1
  229. package/cdn/assets/{TGZuqw2NN_OSIJO0.js → DHd5k_mCX2iTwwRi.js} +2 -2
  230. package/{browser/esm/Ba0_2fGhHSS7kV2l2.mjs → cdn/assets/DJzMm5FQXuMWHNom2.js} +1 -1
  231. package/{browser/esm/CTsLj1vEfSqm_tm42.mjs → cdn/assets/DKLwRgsx1WelayB62.js} +1 -1
  232. package/cdn/assets/{D4e9Z6yAYtli_UZy.js → DL_Jd5k5JINA7woQ.js} +12 -12
  233. package/cdn/assets/{DeY3vEbV4T2WgYP2.js → DNXCAcVGHeeoKPcx.js} +1 -1
  234. package/cdn/assets/{kaSysgj5TE-xQXsG2.js → DQrSW7F6xwljb9vw2.js} +5 -5
  235. package/cdn/assets/{w9gI9mzOHGtRSOFe.js → DR4uNNkaArYCuvNg.js} +2 -2
  236. package/{browser/esm/BJkZVLqBoBngX2V-2.mjs → cdn/assets/DSY8maNeFb51KgKe.js} +1 -1
  237. package/cdn/assets/{39GslBYZKZUJpjcX.js → DT8AGfoENVVMPsi3.js} +1 -1
  238. package/cdn/assets/{CMBLrQ2K32IKaZHu.js → DX0xvH5nQ8MjqsA0.js} +2 -2
  239. package/{browser/esm/CZVi5-MceLzKtZCX2.mjs → cdn/assets/DYaHqG1Xx-r7mlLq2.js} +1 -1
  240. package/cdn/assets/DbGc-QtQMWI-VyUe2.js +24 -0
  241. package/cdn/assets/{DYhGe1HslNmi3MWF2.js → De-RIk_tQ6xW8NH22.js} +1 -1
  242. package/cdn/assets/{Boe-L-sc0zC0Cw5N.js → DfMvz_tU8vJuV2Wl.js} +3 -3
  243. package/cdn/assets/{CTZpbsb07-ieZ8Sv.js → DgGF1ZaI3ti0c_Nz.js} +1 -1
  244. package/cdn/assets/{ko_gqiF0zCGAHO1l2.js → Dhmpgvzx9S-LYXr82.js} +9 -9
  245. package/cdn/assets/{DqJYCOxMI0h7olt52.js → DhnxpW56CJ43gVOI2.js} +1 -1
  246. package/cdn/assets/{CVuIbopxUvt0-2rL.js → Dm0riUQ_5Wg9oFgO.js} +7 -7
  247. package/{browser/esm/DCILZE5X4dLAM7Qa.mjs → cdn/assets/DmfSfK3IDzXPHkJL2.js} +225 -220
  248. package/{browser/esm/zsqoPH22vSCRd7nP2.mjs → cdn/assets/Dt8IOrB4ifUVtTff.js} +1 -1
  249. package/cdn/assets/{CiIadd7oAsvq2iR9.js → DupOTk4J52hzKr6p.js} +7 -7
  250. package/cdn/assets/{Cge4sxB_4OwAQwod.js → DyPUmQ-x13kFTQyg.js} +3 -3
  251. package/cdn/assets/{CTzZ6Xzw63GKixmU2.js → F-Y7Aw8fXxuX1LhE2.js} +207 -207
  252. package/{browser/esm/CTdaEmBnApCaYU--.mjs → cdn/assets/HQv1oLV3ax-NKXZG2.js} +1 -1
  253. package/cdn/assets/{HfJJBylzZ4Z4VNp82.js → HT9FFYzSOuRaDcHS2.js} +6 -6
  254. package/{browser/esm/BXzrl80_N9hn_346.mjs → cdn/assets/Jw068AbKaxWlv8HJ.js} +1 -1
  255. package/{browser/esm/DavD7unX6vAvDq49.mjs → cdn/assets/Nj1DgowT0KN0un7b.js} +1 -1
  256. package/{browser/esm/DUVV-c3N8XuG8lyr2.mjs → cdn/assets/R3YBWWwMJAzbuwie.js} +1 -1
  257. package/{browser/esm/COgR28nGHeL59WLY.mjs → cdn/assets/SNsjWQUbxOQzdnCT.js} +1 -1
  258. package/cdn/assets/{SHgLeVOmAOO6qQOR2.js → TO6gumfUOp2BgIlL.js} +7 -7
  259. package/cdn/assets/{CurA0H2pTTmFWY4N.js → UtYZqTCpvZMQKdR8.js} +2 -2
  260. package/cdn/assets/{Z4L_LGr5jeXjCPo62.js → YGKMD1YfDLoo18Sy2.js} +1 -1
  261. package/cdn/assets/{xH_Bg7r0fryoCvSl2.js → ZQsrI5kqNG_ZOdZD2.js} +38 -38
  262. package/cdn/assets/{WMPhjIQfI4mQp3Bg.js → _5fYV4ZbX0S6MIpD2.js} +8 -8
  263. package/cdn/assets/{C8cUmy4K0YRcXOBu2.js → dywzP082Q24_9Q5U2.js} +9 -9
  264. package/cdn/assets/{BO2RVHzXl9yxZmKM.js → i6PnYkX2rfHQQEvF.js} +3 -3
  265. package/cdn/assets/{B27wXIrrKNvUzMGE2.js → iKMg-svZQSvoVzqO.js} +1 -1
  266. package/cdn/assets/{Dctsk-QW8KKUje0b2.js → rFTMJ-_CKVUSpQ9x2.js} +13 -13
  267. package/cdn/assets/{DacWhkcqwjK3VnAA2.js → rT3DomLULA1xJhfY2.js} +16 -16
  268. package/cdn/assets/{nzKpfea1MNkFBMak.js → s2fSOFCKUPsjfoxR.js} +7 -7
  269. package/cdn/assets/{B609gZLpNve9hsr-.js → sIWoD1UYd1XgTrIs.js} +1 -1
  270. package/{browser/esm/BCcFKm-VY0gZ0TzZ.mjs → cdn/assets/uk2_KQhVX77MWa7A.js} +1 -1
  271. package/{browser/esm/gd127f9DAewQX3YF.mjs → cdn/assets/v2SkWlVj3d1y2tfT2.js} +2 -2
  272. package/cdn/assets/{Dzxg4kLxKyMklPNe2.js → wBchGa30DBwJnPZQ2.js} +3 -3
  273. package/{browser/esm/BJahzXLdJMKJrGJ8.mjs → cdn/assets/y07oKUx2vGjEEZ0w2.js} +1 -1
  274. package/cdn/assets/{B0iMXJrxCR1TmwMa2.js → ykS_w8WDHugwGY9S2.js} +8 -8
  275. package/cdn/index.js +2 -2
  276. package/package.json +3 -3
  277. package/browser/cjs/CBXWKzJggj62dtpP.cjs +0 -1
  278. package/browser/cjs/Crk724Yv2awixZFL.cjs +0 -33
  279. package/browser/cjs/DE8xPZdgqnIs7vdp.cjs +0 -86
  280. package/browser/cjs/Di-65J92p03pfERi.cjs +0 -5
  281. package/browser/cjs/LObFxO4TDyRQ2l05.cjs +0 -12
  282. package/browser/cjs/dJ3N_yPCcdiUsFNY.cjs +0 -3
  283. package/browser/cjs/jQhVJbABYXmAnYFf.cjs +0 -1
  284. package/cdn/assets/D0OOkDRea_6_jbt2.js +0 -24
  285. package/cdn/assets/D0OOkDRea_6_jbt22.js +0 -24
  286. /package/browser/cjs/{1XrWGMP3GmsQOMIX.cjs → 1XrWGMP3GmsQOMIX2.cjs} +0 -0
  287. /package/browser/cjs/{49_x589Na12sizKK2.cjs → 49_x589Na12sizKK.cjs} +0 -0
  288. /package/browser/cjs/{BWDfauDHqB6U_2ka.cjs → BWDfauDHqB6U_2ka2.cjs} +0 -0
  289. /package/browser/cjs/{Btc0Nzu40VYOpzLX2.cjs → Btc0Nzu40VYOpzLX.cjs} +0 -0
  290. /package/browser/cjs/{CRx1WvmgBjT8WVyB2.cjs → CRx1WvmgBjT8WVyB.cjs} +0 -0
  291. /package/browser/cjs/{CW-b31_-r-_raT8Y2.cjs → CW-b31_-r-_raT8Y.cjs} +0 -0
  292. /package/browser/cjs/{CXlzsh_WHCOsErJ1.cjs → CXlzsh_WHCOsErJ12.cjs} +0 -0
  293. /package/browser/cjs/{D8-KovdJ0LjxqCe22.cjs → D8-KovdJ0LjxqCe2.cjs} +0 -0
  294. /package/browser/cjs/{DNKyaSruDogoBd2H.cjs → DNKyaSruDogoBd2H2.cjs} +0 -0
  295. /package/browser/cjs/{Du4jBiFxRIF1OjD42.cjs → Du4jBiFxRIF1OjD4.cjs} +0 -0
  296. /package/browser/cjs/{aONv0Ys3C8xmnaR8.cjs → aONv0Ys3C8xmnaR82.cjs} +0 -0
  297. /package/browser/cjs/{z_rZE1OHFPpdGBh4.cjs → z_rZE1OHFPpdGBh42.cjs} +0 -0
@@ -1,3 +0,0 @@
1
- const e=require("./BnccBYHCCq9TGFx4.cjs"),t=require("./CHFOXPbNUaeZbrXn.cjs"),n=require("./DDPxHIqx8aIbqTRE.cjs"),r=require("./Crk724Yv2awixZFL.cjs"),i=require("./CUCXS7BrMsSnSXVr.cjs");var a;a||={};var o=class extends e.m{constructor(e,t=50){super(t),this._transactions=e,this._floorId=e?e.getCurrentCommit(!1).getId():null,this._removeListener=e?.addListener({onCommitChange:()=>this._notifyOnStackChange()})}_undoCommits(e=this.maxStack){let t=this._transactions;if(!t)return[];let n=t.getLog(t.getCurrentCommit(!1).getId(),2**53-1),r=[];for(let t=0;t<n.length&&r.length<e;t++){let e=n[t];if(e.getId()===this._floorId||t===n.length-1)break;e.getDescription()&&r.push(e)}return r}_redoCommits(e=this.maxStack){let t=this._transactions;if(!t)return[];let n=t.getCurrentCommit(!1).getId(),r=t.getTipCommit().getId();if(r===n)return[];let i=t.getLog(r,2**53-1),a=[],o=!1;for(let e of i){if(e.getId()===n){o=!0;break}a.push(e)}if(!o)return[];a.reverse();let s=[];for(let t of a)if(t.getDescription()&&s.push(t),s.length>=e)break;return s}undo(e=1){let t=this._transactions;if(!t)return;let n=!1;try{for(let r=0;r<e;r++){let[e]=this._undoCommits(1);if(!e)break;t.revert(e.getId()),n=!0}}finally{n&&this._notifyOnStackChange()}}redo(e=1){let t=this._transactions;if(!t)return;let n=!1;try{for(let r=0;r<e;r++){let[e]=this._redoCommits(1);if(!e){r===0&&this._repeatOperation?.repeat();break}t.restore(e.getId()),n=!0}}finally{n&&this._notifyOnStackChange()}}hasUndo(){return this._undoCommits(1).length>0}hasRedo(){return this._redoCommits(1).length>0||this._repeatOperation!==null}getTopUndoDescription(){return this._undoCommits(1)[0]?.getDescription()??null}getTopRedoDescription(){return this._repeatOperation===null?this._redoCommits(1)[0]?.getDescription()??null:this._repeatOperation.description}getUndoDescriptions(){return this._undoCommits().map(e=>e.getDescription())}getRedoDescriptions(){let e=this._redoCommits().map(e=>e.getDescription());return e.length===0&&this._repeatOperation!==null&&e.push(this._repeatOperation.description),Object.freeze(e)}addUndoOperation(){throw Error(`TransactionUndoManager derives its stack from the commit log; commit a described transaction instead.`)}clear(e=!0){this._transactions&&(this._floorId=this._transactions.getCurrentCommit(!1).getId()),super.clear(e)}close(){this._removeListener?.()}},s=class{constructor(e,t){this._dirty=!1,this._store=e,this._savedCommitId=e.getCurrentCommit()?.getId()??null,this._emitter=new r.yt(this);let n=this;this._removeStoreListener=e.addListener({onCommitEnd(){n._recompute()},onCommitChange(){n._recompute()}}),this._removeCommitListener=t?.addCommitListener({onCommit(e){e.store===n._store&&n.markSaved(e.commitId)}})}getStore(){return this._store}isDirty(){return(this._store.getCurrentCommit()?.getId()??null)!==this._savedCommitId}getSavedCommitId(){return this._savedCommitId}markSaved(e=this._store.getCurrentCommit()?.getId()??null){e!==this._savedCommitId&&(this._savedCommitId=e??null,this._recompute())}addListeners(e,t){return this._emitter.addListeners(e,t)}_recompute(){let e=this.isDirty();e!==this._dirty&&(this._dirty=e,this._emitter.notify(e?`onDirty`:`onClean`,{transactional:!1}))}close(){this._removeStoreListener?.(),this._removeCommitListener?.(),this._emitter.close()}},c=class e{constructor(t,n={}){this._password=null,this._emitter=new r.yt(this),this._path=t??null,this._name=n.name??null,this._format=n.format??null,this._size=n.size??null,this._canWrite=n.canWrite??e._defaultCanWrite(this._path),this._encryption=n.encryption??null}static _defaultCanWrite(e){return!!e&&!/^(https?:|data:|blob:)/i.test(e)}_cleanPath(){return this._path?this._path.split(/[?#]/)[0]:null}getName(){if(this._name!==null&&this._name!==void 0)return this._name;let e=this._cleanPath();return e&&r.at(e)||null}getPath(){return this._path}getFormat(){return this._format?this._format:this.getExtension()}getExtension(){let e=this._cleanPath();if(!e)return null;let t=r.xt(e);return t?t.toLowerCase():null}getEncryption(){return this._encryption}isEncrypted(){return this._encryption!==null||this._password!==null}setPassword(e){this._password!==(e??null)&&(this._password=e??null,this._password===null&&(this._encryption=null),this._emitter.notify(`onChange`))}getPassword(){return this._password}getSize(){return this._size}canWrite(){return this._canWrite}setName(e){this.update({name:e})}update(e){let t=!1;return e.path!==void 0&&e.path!==this._path&&(this._path=e.path,t=!0),e.name!==void 0&&e.name!==this._name&&(this._name=e.name,t=!0),e.format!==void 0&&e.format!==this._format&&(this._format=e.format,t=!0),e.size!==void 0&&e.size!==this._size&&(this._size=e.size,t=!0),e.canWrite!==void 0&&e.canWrite!==this._canWrite&&(this._canWrite=e.canWrite,t=!0),e.encryption!==void 0&&e.encryption!==this._encryption&&(this._encryption=e.encryption,t=!0),t&&this._emitter.notify(`onChange`),this}addListeners(e,t){return this._emitter.addListeners(e,t)}get[Symbol.toStringTag](){return`[Origin]`}toString(){let e=this._cleanPath(),t=e?e.split(/[/\\]/).pop()||e:this._name??`(unbound)`,n=this._size;if(n==null)return t;if(n<1024)return`${t} ${n}B`;let r=Math.floor(Math.log(n)/Math.log(1024)),i=[`B`,`KB`,`MB`,`GB`,`TB`];return`${t} ${(n/1024**r).toFixed(2)}${i[Math.min(r,i.length-1)]}`}},l=class{constructor(){this._defaultStringSourceType=`filepath`}async read(t){let n=t.options??{},i=t.source;if(typeof i==`function`&&(i=i()),i&&typeof i==`object`&&typeof i.then==`function`&&(i=await Promise.resolve(i)),i==null&&(i=await this.resolveSource(t),i==null))return null;let a=n.format,o=this._detectSourceType(i);if(!o)throw Error(`Unable to detect source type from provided input.`);let s,c,l=!1;if(o===`filepath`){let e=typeof i==`string`&&i.startsWith(`file://`)?i.slice(7):i;i=await this.filePathToFile(e),o=`file`,l=!0}switch(o){case`file`:{let e=i,t=e?.name,n=t?`${r.at(t)}`:``;s=await e.arrayBuffer(),c={format:a,ext:r.xt(t),name:n,absolutePath:t,size:e.size,canWrite:l&&this._canWriteLocalPath()};break}case`blob`:{let e=i;s=await e.arrayBuffer(),c={format:a,size:e.size};break}case`base64`:{let t;if(i&&typeof i==`object`&&`base64`in i)t=i.base64;else if(typeof i==`string`&&i.startsWith(`data:`)){let[,e]=i.split(`,`);t=e}else t=i;s=e.F.base64ToArrayBuffer(t),c={format:a,size:t.length};break}case`fetch`:{let e,t,n;if(typeof i==`string`)e=i;else{if(!i||typeof i!=`object`||!(`input`in i))throw Error(`Invalid fetch source provided.`);{let r=i;e=r.input,t=r.init,n=r.timeout}}let o=n||3e4,l=new AbortController,u=setTimeout(()=>l.abort(),o),d=typeof e==`string`?e:e.toString(),f=r.xt(d);try{let n=await fetch(e,{...t,signal:l.signal});if(clearTimeout(u),!n.ok)throw Error(`Failed to fetch: ${n.status} ${n.statusText}`);let i=await n.arrayBuffer();if(!i)throw Error(`Unable to fetched content: ${d}`);s=i,c={format:a,ext:f,name:r.at(d,!0),absolutePath:d}}catch(e){throw clearTimeout(u),e.name===`AbortError`?Error(`Fetch timeout after ${o}ms: ${d}`):e}break}case`buffer`:s=i,c={format:a};break;case`stream`:{let e=i.getReader(),t=[],n=0;try{for(;;){let{done:r,value:i}=await e.read();if(r)break;t.push(i),n+=i.length}}finally{e.releaseLock()}let r=new ArrayBuffer(n),o=new Uint8Array(r),l=0;for(let e of t)o.set(e,l),l+=e.length;s=r,c={format:a};break}default:throw Error(`Unsupported source type: ${o}`)}let u=await t.decode(s,{sourceType:o,...c});return u?(await this.onWorkbookRead(u,i),u):null}async resolveSource(e){return null}async onWorkbookRead(e,t){}_canWriteLocalPath(){return!1}_detectSourceType(t){if(t&&typeof t==`object`&&`base64`in t)return`base64`;if(t&&typeof t==`object`&&`input`in t)return`fetch`;if(typeof t==`string`){if(t.startsWith(`data:`))return`base64`;if(t.startsWith(`http://`)||t.startsWith(`https://`))return`fetch`;if(t.startsWith(`file://`))return`filepath`;let e=this._defaultStringSourceType;return t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||/^[a-zA-Z]:[/\\]/.test(t),e}if(typeof File<`u`&&t instanceof File)return`file`;if(typeof Blob<`u`&&t instanceof Blob)return`blob`;let n=t instanceof ArrayBuffer||Object.prototype.toString.call(t)===`[object ArrayBuffer]`,r=ArrayBuffer.isView(t),i=e.F.isNodeBuffer(t);return n||r||i?`buffer`:typeof ReadableStream<`u`&&t instanceof ReadableStream||Object.prototype.toString.call(t)===`[object ReadableStream]`||t&&typeof t.getReader==`function`&&t.locked!==void 0?`stream`:null}},u=class extends l{constructor(e,t){super(),this._getWriteFormats=e,this._getReadFormats=t,this._defaultStringSourceType=`fetch`,this._handleCache=new WeakMap,this._pendingOpenHandle=null}async read(e){let t=e.source;return t&&t.kind===`file`&&typeof t.getFile==`function`?(this._pendingOpenHandle=t,super.read({...e,source:await t.getFile()})):super.read(e)}async resolveSource(){let t=await this._getReadFormats?.()??[];if(typeof globalThis.showOpenFilePicker==`function`)try{let e=function(e){let t=d(e);if(t.length<=1)return t;let n=new Set,r={};for(let e of t)for(let[t,i]of Object.entries(e.accept))for(let e of i)n.has(e)||(n.add(e),(r[t]??=[]).push(e));return[{description:`All Supported`,accept:r},...t]}(t),[n]=await globalThis.showOpenFilePicker(e.length?{types:e}:void 0);return this._pendingOpenHandle=n,await n.getFile()}catch(e){if(e?.name===`AbortError`)return null;throw e}let n=t.flatMap(e=>e.exts.map(e=>`.`+e)).join(`, `);return e.t.openFileDialog(n)}async onWorkbookRead(e){if(this._pendingOpenHandle){let t=e.getOrigin?.();t&&(this._handleCache.set(t,this._pendingOpenHandle),t instanceof c&&t.update({canWrite:!0})),this._pendingOpenHandle=null}}async filePathToFile(e){throw Error(`Cannot read local file path '${e}' in browser environment. Use a file input element or fetch for remote URLs.`)}async write(e){let{origin:t,suggestedName:n,format:r,encode:i,prompt:a}=e,o=[r,...(await this._getWriteFormats()).filter(e=>e.key!==r.key)],s=typeof globalThis.showSaveFilePicker==`function`,l=!a&&t.canWrite()?this._handleCache.get(t):void 0;if(l?.name){let e=t.getPath()?.split(/[/\\]/).pop();e&&l.name!==e&&(l=void 0)}let u=!!l;if(s)try{if(l){let e=await async function(e){try{if(typeof e.queryPermission!=`function`)return`granted`;let t={mode:`readwrite`};return await e.queryPermission(t)===`granted`||await e.requestPermission(t)===`granted`?`granted`:`denied`}catch{return`unavailable`}}(l);if(e===`denied`)return null;e!==`granted`&&(l=void 0)}l||=await globalThis.showSaveFilePicker({suggestedName:n,types:d(o)});let e=p(l.name??n),a=o.find(t=>t.exts.some(t=>t.toLowerCase()===e))??r,s=await i(a.key),m=new Blob([f(s)],{type:a.mimeType||`application/octet-stream`}),h=await l.createWritable();return await h.write(m),await h.close(),this._handleCache.set(t,l),t instanceof c&&t.update({size:m.size,...u?null:{path:l.name??n,name:null,format:a.key,canWrite:!0}}),t}catch(e){if(e?.name===`AbortError`)return null}let m=await i(r.key),h=new Blob([f(m)],{type:r.mimeType||`application/octet-stream`}),g=t.getPath(),_=g?g.split(/[/\\]/).pop():null,v=_&&p(_)?_:n;return function(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.style.display=`none`,r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}(h,v),t instanceof c&&t.update({size:h.size,...t.getPath()===v?null:{path:v,name:null,format:r.key,canWrite:!1}}),t}};function d(e){return e.map(e=>{let t=e.mimeType&&e.mimeType.includes(`/`)?e.mimeType:`application/octet-stream`;return{description:e.description??e.key,accept:{[t]:e.exts.map(e=>`.`+e)}}})}function f(e){if(typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}return e}function p(e){let t=e.lastIndexOf(`.`);return t>=0?e.slice(t+1).toLowerCase():``}var m=class{constructor(e){this._private={input:e},typeof e==`string`?this._private.name=e:Object.assign(this._private,e)}toJSON(){return this._private.input}getFamily(){return this._private.name}getPitch(){return this._private.pitch}getPanose(){return this._private.panose}toString(){return typeof this._private.input==`string`?this._private.input:JSON.stringify(this._private.input)}get isIFont(){return!0}},h=t.r({findBestMatch:()=>ee,getFontList:()=>S,setFontList:()=>x}),g=[`Arial`,`Arial Black`,`Brush Script MT`,`Calibri`,`Comic Sans MS`,`Courier New`,`Garamond`,`Georgia`,`Impact`,`Luminari`,`Palatino Linotype`,`Tahoma`,`Times New Roman`,`Trebuchet MS`,`Verdana`],_=new Map;_.set(r.H.GenericName.Serif,[`Tahoma`]),_.set(r.H.GenericName.SanSerif,[`Calibri`]),_.set(r.H.GenericName.MonoSpace,[`Courier New`]),_.set(r.H.GenericName.Cursive,[`Comic Sans MS`]),_.set(r.H.GenericName.Fantasy,[`Luminari`]),_.set(r.H.GenericName.UISystem,[`Arial`]),_.set(r.H.GenericName.UISerif,[`Tahoma`]),_.set(r.H.GenericName.UISanSerif,[`Arial`]),_.set(r.H.GenericName.UIMonoSpace,[`Courier New`]),_.set(r.H.GenericName.UIRounded,[`Arial`]),_.set(r.H.GenericName.Math,[]),_.set(r.H.GenericName.Emoji,[]),_.set(r.H.GenericName.Fangsong,[]);var v=new Map,y=[];x(g);var b=eval;function x(e){e||x(g);let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r==`string`&&(r=new m(r));let i=!0;try{i=b(`document.fonts.check('12px ${r.getFamily()}')`)}catch{}let a={fontRef:r,loaded:i};t.push(a),v.set(r.getFamily(),a)}y=Object.freeze(t)}function S(){return y}var C,w,T,E,D=new Map;function ee(e,t){let n=D.get(e);if(n)return n.fontRef===null?null:n;let r=[e];t?.fallbacks&&(r=r.concat(t.fallbacks));let i=null;for(let e=0;!i&&e<r.length;e++){let t=r[e];if(i=v.get(t),!i){let e=_.get(t);if(e)for(let t=0;!i&&t<e.length;t++)i=v.get(e[t])}}return i?D.set(e,i):D.set(e,{fontRef:null,loaded:!1}),i}var te=t.r({DefaultFontSizes:()=>O,findNextFontSize:()=>ne}),O=Object.freeze([8,9,10,11,12,14,16,18,20,22,24,26,28,30,36,48,72]);function ne(t,n=!0,r=O){if(!r||r.length===0)return t;if(t===void 0)return r[0];if(n&&t>=r[r.length-1]||!n&&t<=r[0])return t;let i=e.A.findEqualOrGreater(r,t);return n?(r[i]===t&&(i+=1),r[i]||--i,r[i]):(--i,r[i])}(C||={}).SortOn={Value:`value`,FillColor:`fillColor`,FontColor:`fontColor`,Icon:`icon`},(T=w||={}).Compound={Single:`sng`,Double:`dbl`,ThickThin:`thickThin`,ThinThick:`thinThick`,Triple:`tri`},T.Align={Center:`ctr`,Inset:`in`,Outset:`outset`},T.LineCap={Butt:`butt`,Round:`round`,Square:`square`},T.LineJoin={Bevel:`bevel`,Miter:`miter`,Round:`round`},T.PresetMarkerShape={Single:`none`,Double:`double`,ThickThin:`thickThin`,ThinThick:`thickThin`},T.StrokeStyle={None:`none`,Dashed:`dashed`,Dotted:`dotted`,LargeDash:`lgDash`,LargeDashDot:`lgDashDot`,LargeDashDotDot:`lgDashDotDot`,Solid:`solid`,SysDash:`sysDash`,SysDashDot:`sysDashDot`,SysDashDotDot:`sysDashDotDot`,SysDot:`sysDot`},(E||={}).Type={OuterShadow:`outerShadow`,InnerShadow:`innerShadow`,PresetShadow:`presetShadow`,Glow:`glow`,SoftEdge:`softEdge`,Reflection:`reflection`};var k,re,ie,A,j=r.Z.BuiltInName,M={[j.Normal]:e.v(`style.builtin.normal`),[j.Comma]:e.v(`style.builtin.comma`),[j.Currency]:e.v(`style.builtin.currency`),[j.Percent]:e.v(`style.builtin.percent`),[j.Comma0]:e.v(`style.builtin.comma0`),[j.Currency0]:e.v(`style.builtin.currency0`),[j.Hyperlink]:e.v(`style.builtin.hyperlink`),[j.FollowedHyperlink]:e.v(`style.builtin.followedHyperlink`),[j.Note]:e.v(`style.builtin.note`),[j.WarningText]:e.v(`style.builtin.warningText`),[j.Title]:e.v(`style.builtin.title`),[j.Input]:e.v(`style.builtin.input`),[j.Output]:e.v(`style.builtin.output`),[j.Calculation]:e.v(`style.builtin.calculation`),[j.CheckCell]:e.v(`style.builtin.checkCell`),[j.LinkedCell]:e.v(`style.builtin.linkedCell`),[j.Total]:e.v(`style.builtin.total`),[j.Good]:e.v(`style.builtin.good`),[j.Bad]:e.v(`style.builtin.bad`),[j.Neutral]:e.v(`style.builtin.neutral`),[j.ExplanatoryText]:e.v(`style.builtin.explanatoryText`)},ae=e.v(`style.builtin.heading`),oe=e.v(`style.builtin.accent`),se=e.v(`style.builtin.accentTint`),ce=/^Heading ([1-4])$/,le=/^Accent([1-6])$/,ue=/^(20|40|60)% - Accent([1-6])$/;function de(e){let t=M[e];if(t)return{key:t};let n=ce.exec(e);return n?{key:ae,params:{n:+n[1]}}:(n=le.exec(e),n?{key:oe,params:{n:+n[1]}}:(n=ue.exec(e),n?{key:se,params:{pct:+n[1],n:+n[2]}}:null))}var fe=(t,n,i,a,o)=>{let s=JSON.parse(JSON.stringify(t.definition));s.adjs||=[];let c=``,l=0,u=0;n>0?(u=n,l=100-n,c=e._(`op.lighterPercent`,{percent:n})):n<0&&(l=100+n,c=e._(`op.darkerPercent`,{percent:-n})),l&&s.adjs.push({[r.y.AdjustmentType.LumMod]:l}),u&&s.adjs.push({[r.y.AdjustmentType.LumOff]:u});let d=new r.C({val:s.val,adjs:s.adjs},i),f=d.toString();a?.set(f,d);let p=d.toRGBA().toString();return o?.set(p,d),{description:t.description+`, `+c,definition:s}};function pe(e){let t,n=e.trim();if(!n)return;try{let e=i.r.shared().tokenize(n,!1);if(e.errors.length>0)return;t=e.tokens}catch{return}let a=0,o=0;if(t.length===2){let e=t[0].tokenType?.name;e===`MinOp`?(a=-1,o=1):e===`PlusOp`&&(a=1,o=1)}if(t.length-o!==1)return;let s=t[o],c=s.image;try{switch(s.tokenType?.name){case`NumberToken`:case`ScientificDigit`:case`DigitToken`:{let e=r.Ut(c).value;return a===0?e:a*e}case`StringToken`:return a===0?r.It(c).value:void 0;case`BooleanToken`:return a===0?r.ot(c).value:void 0;case`LiteralError`:case`RefError`:return a===0?r.rn(c).value:void 0;default:return}}catch{return}}function N(e,t){let r=P(e),i=P(t);return r===i?e===t?0:typeof e==`number`&&typeof t==`number`?e<t?-1:1:typeof e==`string`&&typeof t==`string`?e<t?-1:+(e>t):typeof e==`boolean`?e?1:-1:n.a.isError(e)&&n.a.isError(t)?e.getCode()-t.getCode():0:r-i}function P(e){if(e===null)return 0;switch(typeof e){case`number`:return 1;case`string`:return 2;case`boolean`:return 3;default:return n.a.isError(e)?4:5}}(k||={}).buildPalette=function(e,t,n,i){let a=[];for(let o=0;o<e.length;o++){let s=[];a.push(s);let c=r=>{for(let a=0;a<r.length;a++)s.push(fe(e[o],r[a],t,n,i))},l=new r.C({val:e[o].definition.val,adjs:e[o].definition.adjs},t).toHSLA().lum;c(l===0?[50,35,25,15,5]:l===100?[-5,-15,-25,-35,-50]:l<=20?[90,75,50,25,10]:l>=80?[-10,-25,-50,-75,-90]:[80,60,40,-25,-50])}return a},re||={},ie||={},A||={};var F=class{constructor(e){this._children=e}getSize(){let e=this._children,t=e.length,n=0;for(let r=0;r<t;r++)n+=e[r].getSize();return n}getCount(){let e=this._children,t=e.length,n=0;for(let r=0;r<t;r++)n+=e[r].getCount();return n}getAggregates(e){if(e)return this._mergeAggregates(e);let t=this._aggregates;return t||(t=this._mergeAggregates(),this._aggregates=t),t}getSnappedSum(e){let t=e??this.getAggregates().sum??0,n=this._children;for(let e=n.length-1;e>=0;e--)if(n[e].getAggregates().numericalCount>0)return n[e].getSnappedSum(t);return t}getSortedNumbers(){let e=this._sortedNumbers;if(!e){let t=this._children,n=t.length,i=[];for(let e=0;e<n;e++){let n=t[e].getSortedNumbers().getValues();n.length>0&&i.push(n)}e=new r.sn(function(e){let t=e.length;if(t===0)return I;if(t===1)return e[0];let n=e[0];for(let r=1;r<t;r++)n=L(n,e[r]);return Object.freeze(n)}(i)),this._sortedNumbers=e}return e}getRanked(e){return r.St(this._children,e,N)[Symbol.iterator]()}getFrequencies(e){if(e)return this._mergeFrequencies(e);let t=this._frequencies;return t||(t=this._mergeFrequencies(),this._frequencies=t),t}_mergeFrequencies(e){let t=e?.keyFn??r.in,n=e?.limit,i=new Map,a=this._children,o=a.length,s=0,c=0,l=!1;for(let r=0;r<o;r++){let o=a[r].getFrequencies(e);s+=o.getVisitedCount(),c+=o.getTotalCount(),l||=o.isTruncated();let u=o.getValueCounts(),d=u.next();for(;!d.done;){let[e,r]=d.value,a=t(e),o=i.get(a);o?o.count+=r:n===void 0||i.size<n?i.set(a,{value:e,count:r}):l=!0,d=u.next()}}return r.d.fromGroups(i,t,e,N,s,c,l)}getTypedCounts(e){let t=this._typedCounts;if(!t){let e={[n.n.Number]:0,[n.n.String]:0,[n.n.Boolean]:0,[n.n.Error]:0,[n.n.RichData]:0,[n.n.Null]:0},r=this._children,i=r.length;for(let t=0;t<i;t++){let i=r[t].getTypedCounts();e[n.n.Number]+=i[n.n.Number]??0,e[n.n.String]+=i[n.n.String]??0,e[n.n.Boolean]+=i[n.n.Boolean]??0,e[n.n.Error]+=i[n.n.Error]??0,e[n.n.RichData]+=i[n.n.RichData]??0,e[n.n.Null]+=i[n.n.Null]??0}t=Object.freeze(e),this._typedCounts=t}if(e===void 0)return t;let r={},i=e.length;for(let n=0;n<i;n++)r[e[n]]=t[e[n]]??0;return r}get isIRangeStats(){return!0}_mergeAggregates(e){let t=this._children,i=t.length,a={count:0,min:void 0,max:void 0,numericalCount:0,sum:0,sumSq:0,typed:{[n.n.Number]:0,[n.n.String]:0,[n.n.Boolean]:0,[n.n.Error]:0,[n.n.RichData]:0,[n.n.Null]:0}};for(let n=0;n<i;n++){let r=t[n].getAggregates(e);a.count+=r.count;let i=r.numericalCount;i<=0||(a.numericalCount+=i,a.sum+=r.sum,a.sumSq+=r.varP*i+r.sum*r.sum/i,(a.min===void 0||r.min<a.min)&&(a.min=r.min),(a.max===void 0||r.max>a.max)&&(a.max=r.max))}return r.Dt(a)}},I=Object.freeze([]);function L(e,t){let n=e.length,r=t.length,i=Array(n+r),a=0,o=0,s=0;for(;a<n&&o<r;)i[s++]=e[a]<=t[o]?e[a++]:t[o++];for(;a<n;)i[s++]=e[a++];for(;o<r;)i[s++]=t[o++];return i}var R=class{constructor(e){this.isIExternalBook=!0,this._json=e}getIdentity(){return this._json.identity}getSheetNames(){return this._json.sheetNames}getDefinedNames(){return this._json.definedNames??[]}getSheetData(e){return this._json.sheetDataSet?.find(t=>t.sheetIndex===e)??null}toJSON(){return this._json}},z=class{constructor(e){this.isIExternalBookCollection=!0,this._items=(e?.json??[]).map(e=>e?new R(e):null)}[Symbol.iterator](){return this.getItems()[Symbol.iterator]()}getItems(){let e=[],t=this._items.length;for(let n=0;n<t;n++){let t=this._items[n];t&&e.push(t)}return e}getCount(){return this.getItems().length}getByIndex(e){return this._items[e-1]??null}toJSON(){return this._items.length===0?null:this._items.map(e=>e?.toJSON()??null)}},B=class{constructor(e){this._closed=!1,this._options={...e};let t=this;this._transactions=this._options.transactions??new r.ht({transient:!0}),this._stateId=this._transactions.create(),this._transactionsRemoveListener=this._transactions.addStateListener(this._stateId,{onAfterStateChange(e,n,r){t._emitter.notify(`onCollectionChange`)}}),this._emitter=new r.yt(this,this._transactions),this._initState(e?.initial)}add(t,n,r){let i=this;n&&n.addListeners({onDelete:n=>{i._updateState(e=>{if(!e.modules[t])return;let n=e.modules[t];if(n){let r={...e};return i._options.onRemove?.(t,n),i._emitter.notify(`onCollectionChange`),delete r.modules[t],r}return e},e.v(`op.deleteModule`))}},{once:!0});let a=this._getState()?.modules,o=a?.[t],s=r?.replace??!1;if(o&&!s)throw Error(`Already existing '${t}'`);let c={...a};n?(c[t]=n,i._options.onAdd?.(t,n),this._updateState({modules:c},e.v(s?`op.saveScripts`:`op.addScript`))):(delete c[t],i._options.onRemove?.(t,null),this._updateState({modules:c},e.v(`op.removeScript`))),i._emitter.notify(`onCollectionChange`)}*[Symbol.iterator](){yield*this.getItems()}getItems(t){let n=this._getState();if(!n)return e.A.EmptyArray;let r=n.modules,i=Object.keys(r),a=i.length;if(a===0)return e.A.EmptyArray;let o=[],s=t?.name?t.name.toUpperCase():null;for(let e=0;e<a;e++){let t=i[e],n=r[t],a=!0;s&&s!==t.toUpperCase()&&(a=!1),a&&o.push(n)}return o??e.A.EmptyArray}getByName(e){if(!e)return null;let t=this._getState();if(!t)return null;let n=e.toUpperCase(),r=t.modules,i=Object.keys(r),a=i.length;for(let e=0;e<a;e++){let t=i[e];if(n===t.toUpperCase())return r[t]}return null}getCount(){let e=this._getState();return e?Object.keys(e.modules).length:0}beginCommit(e){return this._beginCommit(e)}_getState(){if(this._closed)throw Error(e._(`error.model.modelClosed`));return this._transactions.getState(this._stateId)}_beginCommit(e){return this._transactions.beginCommit(typeof e==`string`?{description:e}:e)}_updateState(t,n=e.v(`op.update`),r){if(!t)return;let i=this._beginCommit(n);try{i.updateState(this._stateId,t),i.commit(r)}catch(e){throw i.rollback(),e}}_initState(t){let n=t??{};this._updateState({modules:n},e.v(`op.initialize`),{forceAmend:!0});let r=this._options.onAdd;if(r){let e=Object.keys(n),t=e.length;for(let i=0;i<t;i++){let t=e[i];r(t,n[t])}}}addListeners(e,t){return this._emitter.addListeners(e,t)}toJSON(){let t=this._getState();if(!t)return e.A.EmptyArray;let n=t.modules,r=Object.keys(n),i=r.length,a={};for(let e=0;e<i;e++){let t=r[e];a[t]=n[t].toJSON()}return a}isClosed(){return this._closed}close(){this._closed||(this._emitter.notify(`onClose`),this._closed=!0,this._transactionsRemoveListener?.())}get isFunctionCollection(){return!0}},me=class{constructor(e){this._options=e,this._emitter=new r.yt(this),this._initState()}_initState(){}getModules(){return this._modules}_builtInNames(){try{let t=this._options.getBuiltInFunctions?.();if(!t)return e.A.EmptyArray;let n=[];for(let e of t.getItems())e.isBuiltIn()&&n.push(e.getName());return n}catch{return e.A.EmptyArray}}async createModule(e){let t=await(await Promise.resolve().then(()=>require("./pb5LnC0Ye1NBoRvg.cjs")).then(e=>e.t)).ScriptCompiler.compile({builtInNames:this._builtInNames(),...e});return t.module?await r.h(`scripts`,t.module,e?.declarationsOnly??!1,t.diagnostics):null}addModule(e,t,n){this._modules.add(e,t,n)}async addModuleFromJSON(e,t,n){let i=await r.h(e,t);return this.addModule(e,i,n),i}executeMacro(e,t,n){let r=this._modules.getItems({name:t}),i=r.length;for(let t=0;t<i;t++){let i=r[t].getFunctions().getByName(e);if(i)return i.execute(this._options.workbook,{applyResult:!0,...n})}throw Error(`No macro ${e} found.`)}async run(e,t){try{let n=typeof e==`string`?await this.createModule({source:e}):await r.h(`scripts`,e),i=typeof e==`string`?e:e?.source??``;return await this._runModule(n,i,t)}catch(e){return{ok:!1,error:e}}}async _runModule(e,t,n){let r=this._options?.workbook;if(!e)return{ok:!1,error:Error(`The script did not compile to a module.`)};let i=e.getDiagnostics(),a=i.filter(e=>e.severity===`error`);if(a.length>0){let e=Error(((e,t)=>{let n=[0];for(let t=0;t<e.length;t++)e[t]===`
2
- `&&n.push(t+1);let r=t.map(e=>` ${(e=>{let t=0,r=n.length-1;for(;t<r;){let i=t+r+1>>1;n[i]<=e?t=i:r=i-1}return`${t+1}:${e-n[t]+1}`})(e.start)} ${e.code}: ${e.message}`),i=t.length;return`Script has ${i} compile error${i===1?``:`s`}:\n${r.join(`
3
- `)}`})(t,a));return e.diagnostics=a,{ok:!1,error:e,diagnostics:i}}let o=e.getFunctions(),s=(await o.search({type:`autoRun`}))[0]??(await o.search({type:`macro`}))[0]??null;if(!s)return{ok:!1,error:Error("The script has no runnable entry. Export a default function taking the script context, e.g. `export default function run(ctx: IScript.ScriptContext) { ... }` (the workbook is `ctx.wb`; a macro may instead take its target first, e.g. `(sheet: ISheet, ctx)`).")};let c=await s.execute(r,n);return{ok:!0,result:c?.results,commitId:c?.commitId,diagnostics:i}}async _searchable(e){let t=[];if(e?.includeBuiltIn){await this._options.workbook?.getCalculation()?.start();let e=this._options.getBuiltInFunctions?.();e&&t.push(e)}let n=this._modules;if(!n||n.getCount()===0)return t;let r=e?.moduleName,i=r?n.getItems({name:r}):n.getItems(),a=i.length;for(let e=0;e<a;e++)t.push(i[e].getFunctions());return t}async searchFunctions(t){await this._emitter.notify(`onBeforeSearch`,{async:!0});let n=await this._searchable(t);if(n.length===0)return e.A.EmptyArray;let i,a=t?.limit,o=a===void 0?t:{...t,limit:void 0},s=new Set;for(let e=0;e<n.length;e++){let t=await n[e].search(o);if(t.length!==0){i||=[];for(let e=0;e<t.length;e++){let n=t[e],r=n.getName().toUpperCase();s.has(r)||(s.add(r),i.push(n))}}}if(!i||i.length===0)return e.A.EmptyArray;let c=t?.text?t.text.trim().toUpperCase():null;return c&&n.length>1&&r.i(i,c),a!==void 0&&i.length>a?i.slice(0,a):i}async getFunctionCategories(t){await this._emitter.notify(`onBeforeSearch`,{async:!0});let n=await this._searchable(t);if(n.length===0)return e.A.EmptyArray;if(n.length===1)return n[0].getCategories(t);let r=t?.includeDeprecated??!1,i=new Map,a=e=>{let t=e.toUpperCase(),n=i.get(t);n?n.count++:i.set(t,{name:e,count:1})};for(let e of await n[0].getCategories(t))i.set(e.name.toUpperCase(),{name:e.name,count:e.count});for(let e=1;e<n.length;e++){let i=await n[e].search(t?.type?{type:t.type}:void 0);for(let t=0;t<i.length;t++){let o=i[t],s=o.getName().toUpperCase(),c=!1;for(let t=0;t<e&&!c;t++)c=!!n[t].getByName(s);if(c)continue;let l=await o.getDescriptor().catch(()=>null);!r&&l?.isDeprecated()||a(l?.getCategory()??`Uncategorized`)}}let o=Array.from(i.values());return o.sort((e,t)=>e.name.localeCompare(t.name)),o}async start(){if(!this._modules)return this._startPromise||(this._startPromise=this._doStart(),this._startPromise.catch(()=>{this._startPromise=void 0})),this._startPromise}async _doStart(){let t=this._options?.workbook,n=this._options?.json,i={};if(n){let t=Object.keys(n);for(let a=0;a<t.length;a++){let o=t[a],s=n[o];try{i[o]=await r.h(o,s)}catch(t){e.V.error(`Could not load script '${o}'; it will be unavailable.`,t)}}}let a=this,o=new B({transactions:this._options?.transactions,initial:i,onRemove:(e,t)=>{a._options?.onRemove?.(e,t)},onAdd:(e,t)=>{a._emitter.notify(`onChange`),a._options?.onAdd?.(e,t)}});this._modules=o;let s=o.getItems();if(s.length===0)return Promise.resolve(e.A.EmptyArray);let c=s.length;for(let n=0;n<c;n++){let r=s[n];try{let e=await r.getFunctions().search({type:`autoRun`}),n=e.length;for(let r=0;r<n;r++)await e[r].execute(t)}catch(t){e.V.error(`Error executing autoRun script:`,t)}}}addListeners(e,t){return this._emitter.addListeners(e,t)}isReadOnly(){return!1===this._options.workbook?.getProtection().isStructureAllowed()}toJSON(){this._emitter.notify(`onBeforeSave`);let e=this._modules;if(!e)throw Error(`Scripts is initializing.`);return e.toJSON()}},he=class{constructor(t,n,i,a){this._mergedReading=[],this._colsReading=[],this._rowsReading=[],this._styles=i,this._topLeft=n??e.l.EmptyCell,this._sheet=new r.Zt({runtime:t,styles:this._styles,container:{getName:()=>a,getIndex:()=>1}}),this._builder=this._sheet.getEntireRange().createSparseBuilder()}applyCSSStyle(e,t){let n=!1;e.style||(e.style={},n=!0);let i=e.style,a={...t};if(t.msoIgnore){let e=t.msoIgnore.split(`,`),n=Object.keys(a);for(let t=0;t<n.length;t++){let r=n[t];e.includes(r)&&delete a[r]}}let o=r.At(a.fontFamily);i.font={},o&&(i.font.family=o.family,i.font.fallbacks=o.fallbacks,i.font.size=o.size),i.font.size=a.fontSize,i.font.weight=a.fontWeight,i.font.style=a.fontStyle,i.font.color=a.color;let s=r.M(a.textDecoration);i.font.underline=s.underline,i.font.strike=s.strike,a.textUnderlineStyle&&(i.font.underline=r.g(a.textUnderlineStyle)),i.alignment={},a?.textAlign&&(i.alignment.horizontal=r.Et(a.textAlign)),a?.textAlign&&!i.alignment.horizontal&&a?.textAlign!==`general`&&(a.textAlign===`center-across`?i.alignment.horizontal=r.ln.HorizontalAlignment.CenterContinuous:a.textAlign===`fill`?i.alignment.horizontal=r.ln.HorizontalAlignment.Fill:a.textAlign===`121`||a.textAlign===`010`?(i.alignment.horizontal=r.ln.HorizontalAlignment.Distributed,i.alignment.justifyLastLine=a.textAlign===`121`):console.warn(`unknown text-align`,a.textAlign)),a.verticalAlign&&(a.verticalAlign.toLowerCase()===`super`?i.font.verticalAlign=r.H.VerticalAlignment.Super:a.verticalAlign.toLowerCase()===`sup`?i.font.verticalAlign=r.H.VerticalAlignment.Sub:i.alignment.vertical=r.zt(a.verticalAlign),i.alignment.vertical||(a.verticalAlign===`121`?i.alignment.vertical=r.ln.VerticalAlignment.Distributed:console.warn(`unknown vertical-align`,a.verticalAlign))),a.msoCharIndentCount&&(i.alignment.indent=a.msoCharIndentCount),a.whiteSpace&&(i.alignment.overflow=a.whiteSpace===`no-wrap`||a.whiteSpace===`nowrap`?r.ln.Overflow.Visible:r.ln.Overflow.Wrap),a.msoTextControl===`shrinktofit`&&(i.alignment.overflow=r.ln.Overflow.Shrink);let c=null;if(a.background?c=a.background:a.backgroundColor&&(c=a.backgroundColor),c&&(i.fill={color:c}),a.msoPattern){let e=r.p(a.msoPattern);e&&(e.patternType===r.tt.BuiltInSheetPattern.Solid?i.fill={color:e.foreground}:e.patternType!==r.tt.BuiltInSheetPattern.None&&(c&&(e.background=c),i.fill=e))}a.msoRotate!==void 0&&(i.alignment.rotation=r.O(a.msoRotate));let l=(e,t)=>{e&&(i.border||={},i.border[e]=t)};a.border&&a.border!==`none`&&(l(`top`,a.border),l(`left`,a.border),l(`right`,a.border),l(`bottom`,a.border)),a.borderTop&&l(`top`,a.borderTop),a.borderLeft&&l(`left`,a.borderLeft),a.borderRight&&l(`right`,a.borderRight),a.borderBottom&&l(`bottom`,a.borderBottom),a.msoDiagonalUp&&l(`diagonalUp`,a.msoDiagonalUp),a.msoDiagonalDown&&l(`diagonalDown`,a.msoDiagonalDown);let u=i.numberFormat;a.msoNumberFormat&&(u=r.c(a.msoNumberFormat),u.includes(`\\`)?u=null:u===`Fixed`?u=r.Y.Styles.lookupStyle(i.numberFormat).formatType===r.Y.Type.Number?null:r.Y.Type.Number:u===`Percent`&&(u=r.Y.Styles.lookupStyle(i.numberFormat).formatType===r.Y.Type.Percentage?null:r.Y.Type.Percentage)),u&&(i.numberFormat=u),e.style=this._styles.normalize(i),n&&Object.keys(e.style).length===0&&delete e.style}onCell(t,n,i,a,o){let s=a(o),c={value:n===void 0?i??``:n};if(typeof c.value==`string`&&c.value.length===0&&(c.value=void 0),s&&this.applyCSSStyle(c,s),o?.tagName.toUpperCase()===`TD`){let e=c.style,t=e?.font??{};(o.querySelectorAll(`s`).length>0||o.querySelectorAll(`strike`).length>0)&&(t.strike=!0),o.querySelectorAll(`sub`).length>0&&(t.verticalAlign=r.H.VerticalAlignment.Sub),o.querySelectorAll(`sup`).length>0&&(t.verticalAlign=r.H.VerticalAlignment.Super),(o.querySelectorAll(`b`).length>0||o.querySelectorAll(`strong`).length>0)&&(t.weight=700),o.querySelectorAll(`i`).length>0&&(t.style=r.H.Style.Italic),o.querySelectorAll(`u`).length>0&&(t.underline=r.H.UnderlineStyle.Single),Object.keys(t).length>0&&(e||(e={},c.style=e),e.font||=t);let n=o.querySelectorAll(`a`);if(n.length>0){let e=n[0].getAttribute(`href`);e&&(c.hyperlink=e)}}if(!e.l.isSingleCell(t)){let e={rowStart:this._topLeft.rowIndex+t.rowStart,colStart:this._topLeft.colIndex+t.colStart,rowEnd:this._topLeft.rowIndex+t.rowEnd,colEnd:this._topLeft.colIndex+t.colEnd};this._mergedReading.push(e)}if(c.value===void 0&&!c.style&&Object.keys(c).length<=1)return;let l=this._builder,u=this._topLeft;if(l.pushAt(u.rowIndex+t.rowStart,u.colIndex+t.colStart,c),!e.l.isSingleCell(t)&&s.msoIgnore){if(s.msoIgnore.includes(`colspan`)){let e={};s&&this.applyCSSStyle(e,s);let n=t.colEnd-t.colStart,r=u.rowIndex+t.rowStart;for(let i=1;i<=n;i++)l.pushAt(r,u.colIndex+t.colStart+i,e);t={...t,colEnd:t.colStart}}s.msoIgnore.includes(`rowspan`)&&(t={...t,rowEnd:t.rowStart})}}onNoTable(e,t,n){this.onCell({rowStart:this._topLeft.rowIndex,colStart:this._topLeft.colIndex,rowEnd:this._topLeft.rowIndex,colEnd:this._topLeft.colIndex},e,null,t,n)}onRowStart(e,t,n,i){let a=n(i);if(a.msoHeightSource!==`userset`||!i)return;let o=i.getAttribute(`height`)??a.height,s=null;if(o&&(s=r.z(o,this._styles.getNormal().getFont().getSize(),`px`)),s===null)for(let e=0;e<i.cells.length;e++){let t=i.cells[e],a=r.z(t.getAttribute(`height`)??n(t).height,this._styles.getNormal().getFont().getSize(),`px`);a!==null&&(s=Math.max(a,s??0))}s!==null&&this._rowsReading.push({address:{min:this._topLeft.rowIndex+e,max:this._topLeft.rowIndex+e+t-1},update:{size:s*r.H.getDeviceScale()}})}onColumn(e,t,n,i){let a=n(i);if(a.msoWidthSource!==`userset`||!i)return;let o=i.getAttribute(`width`)??a.width,s=null;o&&(s=r.z(o,this._styles.getNormal().getFont().getSize(),`px`)),s!==null&&this._colsReading.push({address:{min:this._topLeft.colIndex+e,max:this._topLeft.colIndex+e+t-1},update:{size:s*r.H.getDeviceScale()}})}onDone(){this._colsReading.length>0&&this._sheet.getColumnHeaders().updateHeaderPairs(this._colsReading),this._rowsReading.length>0&&this._sheet.getRowHeaders().updateHeaderPairs(this._rowsReading),this._sheet.doBatch(()=>{this._builder.apply()}),this._mergedReading.length>0&&this._sheet.getRanges(this._mergedReading).merge()}sheet(){return this._sheet}},V=class{constructor(t){if(!t)throw new e.O(`snapshot is required.`);this._snapshot=t}getItemType(){return`range`}getItem(){return this._snapshot}editMode(){return this._snapshot?.getMarkOptions().editMode??null}isCut(){return this._snapshot?.getMarkOptions().isCut??!1}getName(){return this._snapshot.getName()}toText(){return this._snapshot.toText()}toHtml(){return this._snapshot.toHtml()}toImage(){return this._snapshot.toImage()}get isClipboardItem(){return!0}},ge=class{constructor(t,n,r,i,a){if(this._parsed=void 0,this._runtime=t,!n)throw new e.O(`nativeItems are required.`);this._topLeft=r??e.l.EmptyCell,this._native=n,this._markOptions=Object.freeze(i??{}),this._styles=a}getItemType(){return`range`}isCut(){return!1}toText(){return this._native?.text}toHtml(){return this._native?.html?.documentElement.outerHTML||null}toImage(){return this._native?.image}getItem(){let e=this._parsed;if(e===void 0)throw Error(`Must call 'parse()' before getItem().`);if(e===null)return null;if(this._snapshot)return this._snapshot;let t=this;return this._snapshot={copyTo:(n,r)=>e.copyTo(n,{...t._markOptions,...r}),getMarkOptions:()=>t._markOptions,getName:()=>e?.getName()??`Clipboard Data`,getCoords:()=>e?.getCoords?.()??null,toText:()=>t.toText(),toHtml:()=>t.toHtml(),toImage:()=>t.toImage(),getSource:()=>e?.getSource?.()??null,isISnapshot:!0},this._snapshot}async parse(){let t,n=this._native?.text,i=this._native.html;if(i===null&&n&&n.includes(`<table`))try{let t=new DOMParser().parseFromString(n,e.r.Html),r=t.querySelector(`parsererror`);if(r)throw new e.s(`Unable to parse: `+r);i=t,n=null}catch{console.warn(`Discovered text as html table but could could not parse.`)}try{let e=new he(this._runtime,this._topLeft,this._styles,i?`HTML`:`Text`);await e.sheet().getCalculation().ready(),await e.sheet().getCalculation().stop();let a,o=await Promise.resolve(n?r.k(n):[[]]);if(r.kt(i,o,e)?(t=e.sheet(),a=t.getUsedRange()):i=null,a)return this._parsed={copyTo:async(e,t)=>(await e.copyFrom(a,t))?.getCoords()??null,getCoords:()=>a.getCoords(),getSource:()=>t,getName:()=>t.getName()},!0}catch(e){throw e}if(!n&&!i&&this._native.image){let t=this;return this._parsed={async copyTo(n,r){let i=n.getSheet(),a=await t._native.image.arrayBuffer(),o=await i.getMovables().addPicture({source:{buffer:a}},{type:`picture`,description:e.v(`op.copyImageFromClipboard`)});return i.getView().selectMovables([o]),null},getName:()=>`Image`},!0}return!1}get isClipboardItem(){return!0}},H={showFormulaBar:!0,showTabs:!0,tabRatio:600,showHorizontalScrollbar:!0,showVerticalScrollbar:!0,showStatusBar:!0,activeSheetId:0},U=class{constructor(e){this._emitter=new r.yt(this),this._state={...H},e?.json&&this._fromJSON(e?.json)}isShowFormulaBar(){return this._state.showFormulaBar}setShowFormulaBar(e){return this._state.showFormulaBar=e,this._emitter.notify(`onViewChange`),this}isShowTabs(){return this._state.showTabs}setShowTabs(e){return this._state.showTabs=e,this._emitter.notify(`onViewChange`),this}getTabRatio(){return this._state.tabRatio}setTabRatio(e){return this._state.tabRatio=e,this._emitter.notify(`onViewChange`),this}isShowHorizontalScrollbar(){return this._state.showHorizontalScrollbar}setShowHorizontalScrollbar(e){return this._state.showHorizontalScrollbar=e,this._emitter.notify(`onViewChange`),this}isShowVerticalScrollbar(){return this._state.showVerticalScrollbar}setShowVerticalScrollbar(e){return this._state.showVerticalScrollbar=e,this._emitter.notify(`onViewChange`),this}isShowStatusBar(){return this._state.showStatusBar}setShowStatusBar(e){return this._state.showStatusBar=e,this._emitter.notify(`onViewChange`),this}getActiveSheetId(){return this._state.activeSheetId}setActiveSheetId(e){let t=this._state,n=t.activeSheetId;return t.activeSheetId=e,n!==e&&this._emitter.notify(`onViewChange`),this}addListeners(e,t){return this._emitter.addListeners(e,t)}toJSON(){let e={},t=Object.keys(this._state),n=t.length;for(let r=0;r<n;r++){let n=t[r],i=this._state[n];i!=null&&i!==H[n]&&(e[n]=i)}return Object.keys(e).length===0&&(e=null),e}_fromJSON(e,t=!0){let n=e||{};this.update(n,t)}update(e,t=!0){this._state={...H,...this._state,...e},t&&this._emitter.notify(`onViewChange`)}get[Symbol.toStringTag](){return`[WorkbookView]`}toString(){let e=this.toJSON();return e?JSON.stringify(e):`DefaultWorkbookView`}},_e=Object.freeze({structure:!1,windows:!1,revision:!1,password:null,revisionsPassword:null}),W=class extends r.s{isWindowsAllowed(){return this._isPropertyAllowed(`windows`)}isRevisionAllowed(){return this._isPropertyAllowed(`revision`)}isStructureAllowed(){return this._isPropertyAllowed(`structure`)}_fromJSON(e){this._properties=e}_toJSON(e){let t=this._properties;if(t){e={...e,...t};let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=n[i],a=t[r];a!=null&&a!==_e[r]&&(e[r]=a)}}return super._toJSON(e)}get[Symbol.toStringTag](){return`[WorkbookProtection]`}};function G(t){return e._(`error.workbook.invalidSheetKey`,{key:t})}var ve,ye,be=class{constructor(e,t){this._add=e,this._get=t}add(e){return this._add(e)}*[Symbol.iterator](){yield*this.getItems()}getItems(e){return this._get(e?.name,e?.visibility)}getByName(e){return this._get(e)?.[0]??null}getCount(){return this._get().length}},K=new RegExp(/[\\/\\*?:[\]]+/),xe=new RegExp(/\(((\d+)(?!.*\d))\)$/,`g`);function Se(t){let n=e._(e.v(`workbook.defaultSheetName`),{n:t+1});return n===`workbook.defaultSheetName`?`Sheet${t+1}`:n}function q(e,t){return{...r.I,getSheet:()=>null,toString:()=>r.E(e,t)}}function J(t,n=!1){if(!t)throw Error(e._(`error.workbook.sheetNameBlank`));if(K.test(t)){if(!n)throw Error(function(t){return t?e._(`error.workbook.sheetNameInvalidCharsNamed`,{sheetName:t}):e._(`error.workbook.sheetNameInvalidChars`)}(t));t=t.replace(K,``)}if(t.length===0)throw Error(e._(`error.workbook.sheetNameBlank`));let r=t.length;if(r>31){if(!n)throw Error(e._(`error.workbook.sheetNameTooLong`));t=t.substring(0,31)}if(t.charAt(0)===`'`||t.charAt(r-1)===`'`){if(!n)throw Error(e._(`error.workbook.sheetNameQuotes`));t=t.replace(/^'|'$/g,``)}return t}var Ce,Y=class e extends r.l{constructor(e,t,n,r){super(e,t,r),this._workbook=n}getSource(){return this._workbook}_createRanges(t,n){let i=this._options;return n&&(i={...this._options,getOptions:r.Mt(this._options?.getOptions,n)}),new e(t,this._internal,this._workbook,i)}_createRange(e,t){let n=e?{...e}:null,i=n?this._workbook._getSheetRef(n.scope,r.S.Visibility.VeryHidden):null;if(!i){let e=this._workbook.getSelectedSheet();return delete n?.scope,q(n,n?{scope:r.nn,...e.getEntireRange().getCoords()}:null)}let a=this._options;return t&&(a={...this._options,getOptions:r.Mt(this._options.getOptions,t)}),new X(e,r.U(i.sheet),this._workbook,a)}async select(e){let t=[],n=null,r=this.getCoords();for(let e=0;e<r.length;e++){let i=r[e];i&&(n||=i.scope,i&&i.scope===n&&t.push(i))}n||=this._workbook.getSelectedSheet().getName();let i=this._workbook.getSheets().getByName(n);if(!i)return;let a=await i.getRanges(t).select(e),o=this._workbook._rangesAddressToCoords(a.getCoords());return this._createRanges(o)}addListener(e,t){if(!this.getCoords())return()=>{};let n=this._workbook._sheetToWBEvent(e);return super.addListener(n,t)}get[Symbol.toStringTag](){return`[WorkbookRanges]`}getAddress(e){let t=this._internal.getSheet(),n=t.getEntireRange().getCoords();return r.fn(this.getCoords(),{...n,scope:t.getName()},r.E,r.m,e)}toString(){return this.getAddress()}},X=class e extends r.dn{constructor(e,t,n,r){super(e,t,r),this._workbook=n}_createRanges(e,t){let n=this._options;return t&&(n={...this._options,getOptions:r.Mt(this._options?.getOptions,t)}),new Y(e,this._internal,this._workbook,n)}_createRange(t,n){let i=this._internal;if(!t)return r.Wt(i.getSheet(),i.getSheet().getEntireCoords());if(i.validateCoords(t),i.getSheet().isClosed())return r.Wt(null,i.getSheet().getEntireCoords(),t);let a=this._options;return n&&(a={...this._options,getOptions:r.Mt(this._options?.getOptions,n)}),new e(t,this._internal,this._workbook,a)}addListener(e,t){if(!this.getCoords())return()=>{};let n=this._workbook._sheetToWBEvent(e);return super.addListener(n,t)}get[Symbol.toStringTag](){return`[WorkbookRange]`}getAddress(e){let t=this._internal.getSheet(),n=t?.getEntireRange().getCoords()??null;return r.E(this.getCoords(),{...n,scope:t.getName()})}toString(){return this.getAddress()}},Z=class{constructor(t){this._lastTransactionUUID=null,this._closed=!1,this._listenerOrigin=null,this._lastOriginName=null,this._initializing=!0,this._isDate1904=!1,this._locale=null,this._localeOverrides=null;let n=typeof t==`string`?{origin:t}:{...t},i=n.origin;this._origin=typeof i==`string`?new c(null,{name:i}):i??new c(null),delete n.origin,this._lastOriginName=this._origin.getName(),this._listenerOrigin=this._origin.addListeners({onChange:()=>{if(this._closed)return;let e=this._origin.getName();e!==this._lastOriginName&&(this._lastOriginName=e,this._emitter.notify(`onNameChange`))}});let a=n.json;delete n.json,this._transactions=n.transactions??new r.ht,this._id=this._transactions.create(),this._ownTransactions=!n.transactions,this._emitter=new r.yt(this,this._transactions),this._runtime=n.runtime??new r.on(`Workbook Runtime`,{isDate1904:()=>this._isDate1904,getLocale:()=>this._locale??r.pt()??r.tn(),getLocaleOverrides:()=>this._localeOverrides}),this._listenerLanguage=e.d.addChangeListener(()=>{this._locale!==null||this._closed||this._notifyAllChange()});let o=this,s=this._beginCommit({description:e.v(a?`op.openWorkbook`:`op.newWorkbook`)});try{this._strings=n.strings??new r.gt,this._ownStrings=!n.strings,this._externalBooks=new z({json:a?.externalBooks}),this._resources=n.resources??new r.Yt,this._ownResources=!n.resources,this._createSheetName=n.createSheetNameCallback??Se;let t=n.createSheetCallback;t||=e=>new r.Zt(e),this._sheetOnNameChange=new Map,this._sheetOnVisibilityChange=new Map,this._sheetOnIndexChange=new Map,this._createSheet=(e,n,i,a,s)=>{let c=null,l={runtime:o._runtime,readonly:o._options.readonly??!1,disableLoadAutoFit:o._options.disableLoadAutoFit??!1,formulaTransform:o._options.formulaTransform,opener:o._options.opener,transactions:o._transactions,styles:o._styles,strings:o._strings,resources:o._resources,names:o._names,workbook:o,calculation:o._calculation,resolveRange:e=>o._options.resolveRange?.(e)??o.getRange(e),container:{beforeFromJSON:t=>{c=t,o._addSheetRef({name:n,id:e,visibility:i??r.S.Visibility.Visible,sheet:t},a)},getName:()=>{let e=o._getSheetRef(c);return e?e.name:n},setName:(e,t)=>{o._getSheetRef(c)&&o._setSheetName(c,e,t)},setNameChangeCallback:t=>{o._sheetOnNameChange.set(e,t)},getVisibility:()=>{let e=o._getSheetRef(c);return e?e.visibility:r.S.Visibility.Visible},setVisibility:(e,t)=>{o._setSheetVisibility(c,e,t)},setVisibilityCallback:t=>{o._sheetOnVisibilityChange.set(e,t)},duplicate:()=>o._duplicateSheet(c),getIndex:()=>{let e=o._getSheetRef(c);return e?o._getOffsetForId(e.id,o._getSheetRefs(r.S.Visibility.VeryHidden)):a},setIndex:(e,t)=>{let n=o._getSheetRef(c,r.S.Visibility.VeryHidden);return!!n&&(o._moveSheet(n,e,t),!0)},setIndexCallback:t=>{o._sheetOnIndexChange.set(e,t)},requestSelect:async()=>(o._setSelectedSheet(c),await this._emitter.notify(`onRequestSelect`,{source:o,params:c,async:!0}),o.getSelectedSheet()===c)}};return s&&(l.json=s),c=t(l,n,a,i),c},this._namedTableSource=new r.mt({getSheets:()=>o._sheets?o.getSheets().getItems():e.A.EmptyArray,addSheetsListener:(e,t)=>o.addListeners({onSheetsChange:e},t)}),this._names=n.names??new r.a({addressToRanges:e=>o.getRanges(e),getCurrentScope:()=>o.getSelectedSheet().getName(),isReadOnly:()=>o._options.readonly??!1,transactions:o._transactions,getSources:()=>o._calculation?[o._calculation.getNamedFormulas(),o._namedTableSource]:e.A.EmptyArray}),this._ownNames=!n.names,this._calculation=n.calculation??new r.nt({runtime:o._runtime,functions:n.functions,getActiveCell:()=>{let e=o.getSelectedSheet(),t=e?.getSelectedRange()?.getCoords();return t?{rowIndex:t.rowStart,colIndex:t.colStart,scope:e.getId()}:null},getRange:o.getRange.bind(o),getRanges:o.getRanges.bind(o),createGraphRanges:(e,t)=>o._createGraphRanges(e,t),getSheetIndex:e=>{if(e===void 0){let e=o.getSelectedSheet();return e?this._getSheetRefs(r.S.Visibility.VeryHidden).findIndex(t=>t.sheet===e):-1}let t=this._getSheetRefs(r.S.Visibility.VeryHidden);e=e.toLowerCase();let n=t.length;for(let r=0;r<n;r++)if(t[r].name.toLowerCase()===e)return r;try{Q.address=e;let t=this._names.getItems(Q);if(!t||t.length===0)return-1;let n=t[0].getRanges?.()?.getCoords()?.[0]?.scope;if(!n)return-1;let i=this._getSheetRefs(r.S.Visibility.VeryHidden);n=n.toLowerCase();let a=i.length;for(let e=0;e<a;e++)if(i[e].name.toLowerCase()===n)return e}catch{return-1}return-1},getSheetCount:()=>o.getSheets().getItems({visibility:r.S.Visibility.VeryHidden}).length,getSheetById:e=>{let t=o.getSheets().getItems({visibility:r.S.Visibility.VeryHidden}),n=t.length;for(let r=0;r<n;r++)if(t[r].getId()===e)return t[r];return null},getSheetByName:e=>{try{return o.getSheets().getByName(e)??null}catch{return null}},namedCollection:o._names,strings:o._strings,transactions:o._transactions,names:a?.names,formulaTransform:n.formulaTransform}),this._ownCalculation=!n.calculation,this._scripts=this._createScripts(),this._ownNames=!n.names,this._options=Object.freeze({...n});let i=async()=>{this._ownCalculation&&await this._calculation.start(),await this._scripts.start(),this._starting=null};this._starting=i(),this._starting?.catch(()=>{}),a?this._fromJSON(a):(this._initState(),this._addSheet(!1)),this._sheets=new be(e=>o._addSheetOptions(e),(t,n)=>{if(t){let r=this._getSheetRef(t,n);return r?[r.sheet]:e.A.EmptyArray}return this._getSheets(n)}),this._ownCalculation&&this._calculation.hydrateNames(),this._emitter.notify(`onLoad`),s.commit({forceAmend:this._ownTransactions})}catch(e){throw s.rollback(),e}this._initializing=!1}_initState(){let e=this._getSheetRefs();for(let t=(e?e.length:0)-1;t>=0;t--);let t=this._options;this._isDate1904=t.runtime?.isDate1904()??!1,this._locale=null,this._localeOverrides=null,this._theme=t.theme??new r.wt().getDefaultTheme(),this._styles=t?.styles??new r.K(this._theme),this._ownStyles=!t.styles,this._styles.getTheme()||this._styles.setTheme(this.getTheme()),this._activeSheetOffset=0,this.setView(new U),this._listenerProtection?.(),this._protection=new W(void 0,this._options.readonly??!1),this._listenerProtection=this._protection.addListeners({onChange:e=>{n._emitter.notify(`onProtectionChange`)}});let n=this;this._transactionsRemoveListener=this._transactions.addStateListener(this._id,{async onAfterStateChange(e,t,r){if(t&&t.activeSheetId!==void 0&&t.view===n.getView()&&r.getId()===n._lastTransactionUUID&&await n._getSheetRef({id:t.activeSheetId})?.sheet.select(),t&&r.getId()!==n._lastTransactionUUID){let r=n.getView().getActiveSheetId();t.view===n.getView()&&(r=t.activeSheetId);let i=0;try{i=n._getOffsetForId(r,e.sheetRefsVisible)}catch{}n._adjustRemoveSelectionIfRequired(i,r)}n._lastTransactionUUID=r.getId(),n._notifyAllChange()},onRestoreOrRevert(){n._ownCalculation,n._emitter.notify(`onInvalidated`)}});let i=this._getState();i?.listenersSheets&&(i?.listenersSheets.forEach(e=>{e()}),i?.listenersSheets.clear()),this._updateState({sheetRefsAll:[],sheetRefsVisibleAndHidden:[],sheetRefsVisible:[],refsById:new Map,sheetsById:new Map,refsByLowerCaseName:new Map,sheetsByLowerCaseName:new Map,refsByInstance:new Map,lastId:-1,sheetsCreated:new Set,listenersSheets:new Map})}getId(){return this._id}getVersionId(){return this._transactions.getVersionId(this._id)}getName(){return this._closed?null:this._origin.getName()}getOrigin(){return this._origin}getView(){return this._view}setView(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!t)throw new e.s(e._(`error.sheet.emptyView`));this._listenerWorkbookView?.();let n=this,r=-1;return this._listenerWorkbookView=t.addListeners({onViewChange:e=>{let t=n._getState(),i=this._view.getActiveSheetId(),a=t.sheetRefsVisible,o=this._getOffsetForId(i,a);this._activeSheetOffset=o,n._emitter.notify(`onViewChange`),r!==i&&(n._emitter.notify(`onSelectionChange`),n._emitter.notify(`onSelectedSheetChange`)),r=i}}),this._view=t,n._emitter.notify(`onViewChange`),this}getRuntime(){return this._runtime}setDate1904(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));return this._isDate1904=t,this._notifyAllChange(),this}getLocale(){return this._runtime.getLocale()}getPinnedLocale(){return this._locale}setLocale(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(t)try{new Intl.Locale(t)}catch{throw Error(e._(`error.workbook.invalidLocale`,{locale:t}))}return this._locale===t||(this._locale=t,this._notifyAllChange()),this}getLocaleOverrides(){return this._localeOverrides}setLocaleOverrides(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));let n=t&&Object.keys(t).length>0?t:null;return this._localeOverrides=n,this._notifyAllChange(),this}getStyles(){return this._styles}getResources(){return this._resources}getTransactions(){return this._transactions}getStrings(){return this._strings}getExternalBooks(){return this._externalBooks}getTheme(){return this._theme}setTheme(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!t)throw new e.s(e._(`error.workbook.notSetValue`));let n=this._theme;return this._theme=t,this.getStyles().setTheme(t),this._emitter.notify(`onThemeChange`),n}getSelectedSheetIndex(){return this._activeSheetOffset}getSelectedSheet(){let e=this._getSheetRef(this.getSelectedSheetIndex());return e?e?.sheet:null}getSheet(t,n=r.S.Visibility.Visible){if(t===void 0)return this.getSelectedSheet();if(!t)throw Error(e._(`error.workbook.sheetNameNotProvided`));let i=this._getSheetRef(t,n);if(!i)throw new e.C(e._(`error.workbook.sheetNameNotFound`,{sheetName:t}));return i.sheet}getSheetAt(t,n=r.S.Visibility.Visible){let i=this._getSheetRef(t,n);if(!i)throw new e.C(function(t){return e._(`error.workbook.sheetIndexNotFound`,{index:t})}(t));return i.sheet}getSheets(){return this._sheets}addSheet(e){return this.getSheets().add(e)}_getSheets(e=r.S.Visibility.Visible){let t=this._getSheetRefs(e),n=[],i=t.length;for(let e=0;e<i;e++)n.push(t[e].sheet);return n}_getSheetRefs(t=r.S.Visibility.Visible){let n=this._getState();return n?t===r.S.Visibility.Visible?n.sheetRefsVisible:t===r.S.Visibility.Hidden?n.sheetRefsVisibleAndHidden:t===r.S.Visibility.VeryHidden?n.sheetRefsAll:e.A.EmptyArray:[]}_getSheetRef(e,t=r.S.Visibility.Visible){let n=null;return typeof e==`number`?this._getSheetRefs(t)[e]:(typeof e==`string`?n=this._getState().refsByLowerCaseName.get(e.toLowerCase()):e instanceof r.Zt?n=this._getState().refsByInstance.get(e):e?.id!==void 0&&(n=this._getState().refsById.get(e.id)),n)}_validateNewSheetName(t,n=!0){if(t==null)return t;if(J(t),n&&this._getState().sheetsByLowerCaseName.has(t.toLowerCase()))throw new e.s(e._(`error.workbook.nameTaken`));return t.substring(0,31)}findValidSheetName(e){e&&=J(e,!0);try{return function(e,t){try{if(t(e))return e}catch{}let n,r,i=xe.exec(e);for(i===null?(n=e+` `,r=1):(n=e.substring(0,i.index),r=parseFloat(i[1]));r<256;){r++;let e=`(`+r+`)`,i=n.substring(0,31-e.length)+e;try{if(t(i))return i}catch{}}throw Error(e+` is not a valid sheet name`)}(e,e=>this._validateNewSheetName(e))}catch{return this._nextSheetName()}}isValidSheetNameCharacter(e){return!K.test(e)}_addSheetOptions(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let n,r=null;n=typeof t==`string`?{name:t}:typeof t==`number`?{index:t}:t,n={...n,description:n?.description??e.v(`op.addSheet`)};let i=this.beginCommit(n);try{let t=n?.autoSelect??!1;r=this._addSheet(!0,n.name,n.index??null);let a,o,s=this.getView().getActiveSheetId();if(!1!==t){let e=this.getView().getActiveSheetId();e=this._getSheetRef(r).id,t&&(a={view:this.getView(),activeSheetId:s},o={view:this.getView(),activeSheetId:e})}if(i.commit({description:e._(`op.addSheetNamed`,{name:r.getName()}),viewBefore:a,viewAfter:o}),!1!==t){let e=typeof t==`boolean`?void 0:t;r.select(e)}}catch(e){throw i.rollback(),e}return r}_nextSheetName(t=null){let n=t?t.toLowerCase():null,r=this._getState(),i=r.sheetsByLowerCaseName;if(t&&i.has(n))throw new e.s(function(t){return e._(`error.workbook.nameDuplicate`,{sheetName:t})}(t));n=(t=this._validateNewSheetName(t))?t.toLowerCase():null;let a=r.lastId+1;for(;!t;){let e=this._createSheetName(a),n=e.toLowerCase();i.has(n)?a++:t=e}return this._updateState({lastId:a}),t}_addSheet(t,n=null,i=null){n=this._nextSheetName(n);let a=this._getState(),o=this._createSheet(a.lastId,n,r.S.Visibility.Visible,i,null);if(!o)throw new e.s(e._(`error.workbook.sheetNameBlank`));return t&&this._emitter.notify(`onSheetsChange`),o}_updateSheetRefStates(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this._initializing&&!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let n=t,i=[],a=[],o=n.length;for(let e=0;e<o;e++)n[e].visibility===r.S.Visibility.Visible?(i.push(n[e]),a.push(n[e])):n[e].visibility===r.S.Visibility.Hidden&&a.push(n[e]);this._updateState({sheetRefsAll:n,sheetRefsVisible:i,sheetRefsVisibleAndHidden:a})}_addSheetRef(t,n=null){let i=this._getState(),a=i.sheetRefsAll,o=Math.max(0,Math.min(a.length,n??a.length)),s=[...a.slice(0,o),t,...a.slice(o)];this._updateSheetRefStates(s);let c=t.sheet,l=t.name.toLowerCase(),u=new Map(i.refsById);u.set(t.id,t);let d=new Map(i.refsByLowerCaseName);d.set(l,t);let f=new Map(i.refsByInstance);f.set(c,t);let p=new Map(i.sheetsById);p.set(t.id,c);let m=new Map(i.sheetsByLowerCaseName);m.set(l,c);let h=this,g=i.listenersSheets;if(c!==void 0){let n=c.addListeners({onBeforeDelete:e=>{h._validateDeleteSheet(e)},onDelete(t){let n=h._getSheetRef(t,r.S.Visibility.VeryHidden);if(!n)return;let i=h._beginCommit({description:e._(`op.deleteSheet`,{name:n.name})});try{let e=h._getState(),r=e.sheetRefsAll,a=h._getOffsetForId(n.id,r),o=[...r];o.splice(a,1),h._updateSheetRefStates(o);let s=new Map(e.refsById);s.delete(n.id);let l=new Map(e.sheetsById);l.delete(n.id);let u=n.name.toLowerCase(),d=new Map(e.refsByLowerCaseName);d.delete(u);let f=new Map(e.sheetsByLowerCaseName);f.delete(u);let p=new Map(e.refsByInstance);p.delete(t),e.listenersSheets.get(n.id)();let m=new Map(e.listenersSheets);m.delete(n.id),h._adjustRemoveSelectionIfRequired(a,n.id),h._adjustSheetNamesIfRequired(),h._sheetOnNameChange.delete(n.id),h._sheetOnVisibilityChange.delete(n.id),h._sheetOnIndexChange.delete(n.id),h._emitter.notify(`onSheetsChange`);let g=new Set(e.sheetsCreated);g.has(c)&&g.delete(c),h._updateState({refsById:s,sheetsById:l,refsByLowerCaseName:d,sheetsByLowerCaseName:f,refsByInstance:p,sheetsCreated:g,listenersSheets:m}),i.commit()}catch(e){throw i.rollback(),e}}}),a=c.addListeners({onSelectionChange:e=>{h.getView().getActiveSheetId()===h._getSheetRef(e)?.id&&h._emitter.notify(`onSelectionChange`,{source:h,params:e})}},{transactional:!1});g=new Map(i.listenersSheets),g.set(t.id,()=>{n(),a()})}let _=i.lastId;_!==-1&&(_=Math.max(_,t.id)),this._updateState({lastId:_}),this._updateState({refsById:u,refsByLowerCaseName:d,refsByInstance:f,sheetsById:p,sheetsByLowerCaseName:m,listenersSheets:g}),this._adjustSheetNamesIfRequired();let v=new Set(this._getState().sheetsCreated);return v.add(t.sheet),this._updateState({sheetsCreated:v}),t}_adjustRemoveSelectionIfRequired(e,t){if(this._view.getActiveSheetId()===t){let t,n=this._getState().sheetRefsVisible;t=e<n.length?n[e].id:n[e-1].id,this._view.setActiveSheetId(t)}}_adjustSheetNamesIfRequired(){let e=this._getState(),t=e.lastId;if(t===-1)return;let n=this._view.getActiveSheetId();n??=(this._view.setActiveSheetId(t),t);let i=e.refsById.get(n);i||(this._view.setActiveSheetId(t),i=e.refsById.get(t),n=t),i.visibility===r.S.Visibility.Visible&&(this._activeSheetOffset=this._getOffsetForId(n,e.sheetRefsVisible))}_validateDeleteSheet(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let n=this._getSheetRef(t);if(!n)throw new e.s(function(t){return e._(`error.workbook.deleteKey`,{key:t})}(t));let r=this._getState().sheetRefsVisible;if(r.length===1&&r[0].id===n.id)throw new e.s(e._(`error.workbook.sheetOne`))}_getOffsetForId(t,n){let r=n.length;for(let e=0;e<r;e++)if(n[e].id===t)return e;throw new e.s(e._(`error.workbook.noVisibleRefs`))}find(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));let n=this._getSheets();if(n.length===1)return n[0].find(t);typeof t==`string`&&(t={text:t});let i=!t?.reverse,a=t?.disableWrap??!1,o=this.getSelectedSheetIndex(),s=o,c=n[s],l=!1;t={...t,disableWrap:!0};let u,d=c.find(t),f=d.next(),p=!1;if(t?.from){let e=this._rangesAddressToCoords(t?.from);u={colIndex:e[0].colStart,rowIndex:e[0].rowStart}}let m=e.l.createCellComparator(t?.axis,t?.reverse);delete(t={...t}).from;let h=()=>{if(!p&&f.done&&(l&&s===o?p=!0:i?(s++,s>n.length-1&&(s=0,l=!0)):(s--,s<0&&(s=n.length-1,l=!0)),a&&l&&(p=!0),p||u||!l||s!==o||(p=!0),!p)){c=n[s],d=c.find(t);let e=f;return f=d.next(),e}if(!p&&l&&s===o&&(f.done||!u||!f.done&&m(f.value.getCoords(),u)>=0)&&(p=!0),p){let e=f;return f=r._,e}let e=f;return f=d.next(),e};return{next:()=>{let e=h();for(;!p&&e.done;)e=h();return e}}}replace(t,n,i){let a=0,o=null,s=typeof n==`function`,c=i?.maxCount??2**53-1,l=!i?.maxCount,u=``,d=typeof n==`string`?r.ft(n):null,f=i?.description??e.v(`op.replace`),p=this._transactions.beginCommit({description:f});try{let r=null,f=null,m=t.next();for(;!m.done&&a<c;){let e=m.value,c=e.getSheet();c!==r&&(r=c,f!==null&&f.apply(),f=r.getEntireRange().createSparseBuilder({axis:i?.axis,allowUnorderedWrites:!0}));let l=s?n(e):n;l!==void 0&&l!==e&&(f.push(e,l),a++,o=e),m=t.next()}f?.apply(),a===1&&c===1&&o&&(u=o.getAddress()),a===0?p.rollback():p.commit({description:i?.description??(l?d===null?e.v(`op.replaceAll`):e._(`op.replaceAllWith`,{value:d}):u?d===null?e._(`op.replaceAt`,{address:u}):e._(`op.replaceAtWith`,{address:u,value:d}):d===null?e.v(`op.replace`):e._(`op.replaceWith`,{value:d})),viewAfter:{selection:null}})}catch(e){throw p.rollback(),e}return{count:a,last:o}}_nextSheetIndex(e,t=this._getSheetRefs()){let n=t.length;return n===1?0:(e===void 0&&(e=this.getSelectedSheetIndex()),(e=Math.max(0,Math.min(e,n-1)))>=n-1?0:e+1)}_prevSheetIndex(e,t=this._getSheetRefs()){let n=t.length;return n===1?0:(e===void 0&&(e=this.getSelectedSheetIndex()),(e=Math.max(0,Math.min(e,n-1)))<=0?n-1:e-1)}getNextSheet(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));let n=this._getSheetRefs();return n[this._nextSheetIndex(t,n)]?.sheet??null}getPreviousSheet(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));let n=this._getSheetRefs();return n[this._prevSheetIndex(t,n)]?.sheet??null}async _duplicateSheet(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let n=this._getSheetRefs(),r=this.getSelectedSheetIndex(),i=null;if(t){if(i=this._getSheetRef(t),!i)throw new e.s(G(i))}else i=n[r];if(!i)return null;let a=i.sheet,o=this._strings.beginPersist(),s=this.getResources().beginPersist(),c=this.getStyles().beginPersist(),l=null,u=this.beginCommit(e._(`op.duplicateNamed`,{name:a.getName()}));try{let e=this._getState().refsByInstance.get(a),t=await a.toJSON(),i=n.length+1,o=this.findValidSheetName(e.name),s=this._createSheet(i,o,e.visibility,r,t);this._emitter.notify(`onSheetsChange`),l=s,u.commit()}catch(e){throw u.rollback(),e}finally{c.endPersist(),s.endPersist(),o.endPersist()}return l}_createRange(t,n){let i=t?{...t}:null,a=i?this._getSheetRef(i.scope,r.S.Visibility.VeryHidden):null;if(!a){let t=this.getSelectedSheet();return t?(delete i?.scope,q(i,i?{scope:r.nn,...t.getEntireRange().getCoords()}:null)):void console.warn(e._(`error.workbook.noVisibleRefs`))}let o=a.sheet,s=null;return n&&(s={getOptions:n}),new X(t,r.U(o),this,s)}_createRanges(e,t){let n=this.getSelectedSheet(),i=null;return t&&(i={getOptions:t}),new Y(e,r.U(n),this,i)}getRange(t,n){if(t===void 0)return this.getSelectedRange(n);try{let r=this._rangesAddressToCoords(t);if(r.length!==1)throw new e.s(e._(`error.address.singleRangeOnlyAlt`));return this._createRange(r[0],n)}catch(n){throw n instanceof e.C?new e.C(n.message):new e.s(n.message??r.W(t))}}getCell(t){if(t===void 0)return this.getSelectedCell();let n=this.getRange(t);if(n.size>1)throw new e.s(e._(`error.address.singleCellOnly`));return n.getCell()}getRanges(t,n){let i=this._rangesAddressToCoords(t);if(i.length===0)throw new e.s(r.W(t));return this._createRanges(i,n)}_createGraphRanges(e,t){let n=[];for(let e=0;e<t.length;e++){let i=t[e],a=(i.sheetName?this._getSheetRef(i.sheetName,r.S.Visibility.VeryHidden):null)?.sheet??this.getSelectedSheet();a&&n.push(new r.G(i,r.U(a),null))}for(let t=0;t<e.length;t++)n.push(e[t]);return n.length===0?null:new Y(n,r.U(this.getSelectedSheet()),this,null)}getStats(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));let n=this._getSheets(r.S.Visibility.VeryHidden),i=n.length;if(i===1)return n[0].getStats(t);let a=Array(i);for(let e=0;e<i;e++)a[e]=n[e].getStats(t);return new F(a)}_activeRangeCoords(){let e=this.getSelectedSheet(),t=e.getSelection().getRanges().getCoords(),n=e.getName(),r=t.length,i=Array(r);for(let e=0;e<r;e++){let r=t[e];i[e]={colStart:r.colStart,colEnd:r.colEnd,rowStart:r.rowStart,rowEnd:r.rowEnd,scope:n}}return i}getSelectedRange(e){return this.getRange(this._activeRangeCoords()[0],e)}getSelectedRanges(e){return this.getRanges(this._activeRangeCoords(),e)}getSelectedCell(){return this.getSelectedSheet().getSelectedCell()}_rangesAddressToCoords(t,n=!0,i=r.S.Visibility.Hidden){if(!t)throw new e.s(e._(`error.address.noAddress`));let a=this.getSelectedSheet(),o={...a?.getEntireRange().getCoords()},s=a?.getName();if(s&&(o.scope=s),typeof t==`string`){let e=t.trim().toLowerCase();if(e===`r`||e===`c`){let n=this.getSelectedCell().getCoords(),r={};e===`r`?r.rowStart=r.rowEnd=n.rowIndex:r.colStart=r.colEnd=n.colIndex,t=r}}let c=this,l=r.v(t,o,r.T,t=>{if(!n)return null;if(typeof t==`string`){let e=c.getNames().getByName(t)?.getRanges?.();if(e)return e.getCoords()}throw new e.s(`Invalid sheet reference '${t}'.`)}),u=l.length;for(let e=0;e<u;e++)this._validateCoords(l[e],i);return l}_validateCoords(t,n=r.S.Visibility.Visible,i=e._(`error.sheet.oobRange`)){if(t===null)return;let a=this.getSheet(t.scope,n).getEntireRange().getCoords();if(!e.l.isRangeWithinRange(t,a))throw new e.C(i);if(t.rowEnd<t.rowStart||t.colEnd<t.colStart)throw new e.s(e._(`error.address.invalidRangeInverted`))}_updateSheetRef(e,t){let n=this._getState(),r=[...n.sheetRefsAll];r[this._getOffsetForId(e.id,n.sheetRefsAll)]=t,this._updateSheetRefStates(r);let i=new Map(n.refsById);i.set(e.id,t);let a=e.name.toLowerCase(),o=t.name.toLowerCase(),s=new Map(n.refsByLowerCaseName);s.delete(a),s.set(o,t);let c=new Map(n.sheetsByLowerCaseName),l=c.get(a);c.delete(a),c.set(o,l);let u=new Map(n.refsByInstance);return u.set(l,t),this._updateState({refsById:i,refsByLowerCaseName:s,sheetsByLowerCaseName:c,refsByInstance:u}),t}_setSheetName(t,n,r){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let i=this._getSheetRef(t);if(!i)throw new e.s(G(t));if(n===i.name)return i.sheet;if((n=this._validateNewSheetName(n))==null)throw new e.s(e._(`error.workbook.sheetNameNotProvided`));let a=Object.freeze({...i,name:n}),o=null,s=this.beginCommit(e.v(`op.renameSheet`));try{let e=this._updateSheetRef(i,a);this._adjustSheetNamesIfRequired(),this._sheetOnNameChange.forEach((e,t)=>{i.id===t&&e()}),this._emitter.notify(`onSheetsChange`),i.id===this.getView().getActiveSheetId()&&this._emitter.notify(`onSelectionChange`),o=e.sheet,s.commit(r)}catch(e){throw s.rollback(),e}return o}_setSheetVisibility(t,n=r.S.Visibility.Visible,i){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let a=this._getSheetRef(t,r.S.Visibility.VeryHidden);if(!a)return null;if(n===a.visibility)return;let o=null,s=``;n===r.S.Visibility.Visible?s=e.v(`op.unhideSheet`):n===r.S.Visibility.Hidden?s=e.v(`op.hideSheet`):n===r.S.Visibility.VeryHidden&&(s=e.v(`op.veryHideSheet`));let c=this.beginCommit(s);try{let t=this._getState().sheetRefsVisible;if(n!==r.S.Visibility.Visible&&t.length===1&&t[0].id===a.id)throw new e.s(e._(`error.workbook.sheetOne`));let s={...a,visibility:n},l=-1;n!==r.S.Visibility.Visible&&(l=this._getOffsetForId(a.id,t)),o=this._updateSheetRef(a,s).sheet,n!==r.S.Visibility.Visible&&this._adjustRemoveSelectionIfRequired(l,a.id),this._adjustSheetNamesIfRequired(),c.commit(i)}catch(e){throw c.rollback(),e}return this._sheetOnVisibilityChange.forEach((e,t)=>{a.id===t&&e()}),this._emitter.notify(`onSheetsChange`),o}_moveSheet(t,n,r){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new e.s(e._(`error.workbook.protection`));let i=null,a=this.beginCommit(e._(`op.moveSheetNamed`,{name:t.name}));try{let o=this._getState(),s=o.sheetRefsVisible;if(n<0||n>s.length-1)throw new e.s(`Invalid to index: ${n}`);let c={view:this.getView(),activeSheetId:this.getView().getActiveSheetId()},l=o.sheetRefsAll,u=this._getOffsetForId(t.id,l),d=this._getOffsetForId(s[n].id,l);if(u===d)return;let f=l[u],p=[...l];p.splice(u,1),p.splice(d,0,f),this._updateSheetRefStates(p),this._adjustSheetNamesIfRequired(),this._sheetOnIndexChange.forEach((e,t)=>{t>=u&&t<=d&&e()}),this._emitter.notify(`onSheetsChange`),i=f.sheet,a.commit({...r,viewBefore:c,viewAfter:{view:this.getView(),activeSheetId:this.getView().getActiveSheetId()}})}catch(e){throw a.rollback(),e}return i}_setSelectedSheet(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));let n=this._getSheetRef(t);if(!n)throw new e.s(G(t));let i=null;return n.visibility!==r.S.Visibility.Visible&&this._setSheetVisibility(n,r.S.Visibility.Visible),this._view.setActiveSheetId(n.id),i=n.sheet,i}getProtection(){return this._protection}getNames(){return this._names}getCalculation(){return this._calculation}createFormula(e,t){return this.getCalculation().createFormula(e,t)}evaluate(e,t){return this.getCalculation().evaluate(e,t)}whenCalculationReady(){return this.getCalculation().ready()}getScripts(){return this._scripts||=this._createScripts(),this._scripts}_notifyAllChange(){this._emitter.notify(`onSheetsChange`),this._emitter.notify(`onSelectedSheetChange`),this._emitter.notify(`onViewChange`)}addListeners(e,t){return this._emitter.addListeners(e,t)}_sheetToWBEvent(e){let t=this;return n=>{let r=()=>{let e=n.getSource();if(e.isICellRanges){let n=[...e.getCoords()],r=n.length;for(let t=0;t<r;t++){let r=n[t];!r.scope&&e.getSheet().getName()&&(n[t]={...r,scope:e.getSheet().getName()})}return t.getRanges(n)}if(e.isICellRange){let n=e.getCoords(),r=e.getSheet().getName();return t.getRange({...n,scope:r})}};e({getSource:r,trigger:n.trigger,getFrom:()=>t.getRanges(n.getFrom()),getTo:()=>t.getRange(n.getTo()),isDataChange:n.isDataChange,getTransactionId:n.getTransactionId,isUndo:n.isUndo,toString:()=>`WorkbookRangeEvent: ('${n.trigger}', ${r().toString()})`,timeStamp:Date.now()})}}_fromJSON(t){if(this._emitter.notify(`onBeforeLoad`,{params:t}),this._initState(),!t.sheets||t.sheets.length===0)throw new e.s(e._(`error.workbook.sheetOne`));t.theme&&(this._theme=new r.Ht(t.theme),this._styles.setTheme(this._theme));let n=this._strings.beginPersist(),i=this._resources.beginPersist(),a=this._styles.beginPersist();try{n.fromJSON(t.strings),i.fromJSON(t.resources),a.fromJSON(t.styles),t.date1904&&(this._isDate1904=!0),t.locale&&(this._locale=t.locale),t.localeOverrides&&(this._localeOverrides=t.localeOverrides),t.view||={};let e=t.sheets,o=e.length,s=t.view.activeSheetId??null;s!==null&&(s=Math.min(Math.max(0,s),o-1));let c=null,l=null,u=-1;for(let t=0;t<o;t++){let n=e[t],i=n.visibility||r.S.Visibility.Visible,a=t;l=a,i===r.S.Visibility.Visible?(u++,c===null&&(c=a)):s!==null&&s===a&&(s=null),this._createSheet(a,n.name,i,u,n.sheet)}this._updateState({lastId:l}),t.view.activeSheetId=s??c,this.setView(new U({json:t.view})),this._adjustSheetNamesIfRequired(),this._listenerProtection?.();let d=this;this._protection=new W(t?.protection,this._options?.readonly),this._listenerProtection=this._protection.addListeners({onChange:e=>{d._emitter.notify(`onProtectionChange`,{source:e})}}),t.scripts&&(this._scripts=this._createScripts(t.scripts)),this._emitter.notify(`onLoad`)}finally{a.endPersist(),i.endPersist(),n.endPersist()}}_createScripts(t){let n=this;return new me({transactions:this._transactions,json:t,workbook:n,getBuiltInFunctions:()=>n._calculation?.getFunctions(),onAdd:(t,i)=>{let a=n._calculation;a.getStatus()!==r.D.Status.Off&&a.start().then(async()=>{let t=i.getFunctions().getItems({type:`formula`}),n=t.length;for(let r=0;r<n;r++){let n=t[r];try{await this._calculation.getFunctions().add(n)}catch(t){e.V.error(t?.message??String(t),t)}}}).catch(()=>{})},onRemove:(e,t)=>{}})}async toJSON(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));await Promise.resolve(this._starting),await this._emitter.notify(`onBeforeSave`,{async:!0});let n={sheets:[]},i=t?.ignoreStyles??!1;if(!i){let e=this._theme.toJSON();(e?Object.keys(e).length:0)>0&&(n.theme=e)}if(this._scripts){let e=this._scripts.toJSON();e&&Object.keys(e).length>0&&(n.scripts=e)}this._isDate1904&&(n.date1904=!0),this._locale&&(n.locale=this._locale),this._localeOverrides&&(n.localeOverrides=this._localeOverrides);let a=t?.ignoreResources??!1,o=this._strings.beginPersist(),s=a?null:this._resources.beginPersist(),c=this._styles.beginPersist();try{let e=this._getSheetRef(this.getSelectedSheetIndex()).id,l=e,u=null,d=this._getState(),f=d.sheetRefsAll,p=d.sheetsById,m=f.length;for(let i=0;i<m;i++){let a=f[i],o=i+1,s=await p.get(a.id).toJSON(t),c={name:a.name,sheet:s};a.visibility===r.S.Visibility.Visible?u===null&&(u=o):c.visibility=a.visibility,a.id===e&&(l=o),n.sheets.push(c)}if(!i){let e=c.toJSON();e&&Object.keys(e).length>0&&(n.styles=e)}let h=this.getProtection().toJSON();h&&(n.protection=h);let g=await o.toJSONAsync();g&&g.length>0&&(n.strings=g);let _=this._externalBooks.toJSON();if(_&&(n.externalBooks=_),!a){let e=await s.toJSONAsync();e&&e.length>0&&(n.resources=e)}let v=this._calculation.getNamedFormulas().toJSON();v&&v.length>0&&(n.names=v);let y=this._view.toJSON();y&&(l===u?delete y.activeSheetId:y.activeSheetId=l,Object.keys(y).length>0&&(n.view=y))}finally{c.endPersist(),a||s.endPersist(),o.endPersist()}return this._emitter.notify(`onSave`,{params:n}),n}isClosed(){return this._closed}close(){if(this._closed)return;this._emitter.notify(`onClose`);let e=this._getState();e.listenersSheets.forEach(e=>{e()}),e.listenersSheets.clear();let t=e.sheetRefsAll;for(let e=t.length-1;e>=0;e--)try{t[e].sheet.close()}catch(e){console.warn(`error on close`,e)}this._ownResources,this._ownNames&&this._names.close(),this._ownCalculation&&this._calculation.close(),this._ownStyles,this._transactionsRemoveListener?.(),this._listenerLanguage?.(),this._listenerOrigin?.(),this._closed=!0}beginCommit(t){if(this._closed)throw Error(e._(`error.workbook.modelClosed`));return this._beginCommit(typeof t==`string`?{description:t}:t)}doBatch(t,n){let r=this;return n=typeof n==`string`?{description:n}:{description:e.v(`op.updateWorkbook`),...n},this._transactions.doBatch(t,n,(e,t)=>{e.getDepth()===0&&(r._lastTransactionUUID=e.getId())})}_beginCommit(e){let t=this;return this._transactions.beginCommit(typeof e==`string`?{description:e}:e,e=>{e.getDepth()===0&&(t._lastTransactionUUID=e.getId())})}_getState(){return this._transactions.getState(this._id)}_updateState(t,n=e.v(`op.updateWorkbook`),r){if(!t)return;let i=this._beginCommit(n);try{i.updateState(this._id,t),i.commit(r)}catch(e){throw i.rollback(),e}}get options(){return this._options}get[Symbol.toStringTag](){return`[Workbook]`}toString(){return`[${this.getName()??`(untitled)`}]`}get isIWorkbook(){return!0}},Q={address:null},we=class{constructor(){this._readFormats=[],this._writeFormats=[],this._encryptions=[]}async registerReadFormat(e){this._readFormats=await this._registerFormatType(e,this._readFormats)}async registerWriteFormat(e){this._writeFormats=await this._registerFormatType(e,this._writeFormats)}async registerEncryption(e){if(!e)throw Error(`encryption must be provided.`);if(!e.key)throw Error(`encryption.key must be provided.`);let t=e.key.toLowerCase(),n=this._encryptions.findIndex(e=>e.key.toLowerCase()===t);if(n!==-1){let t=[...this._encryptions];t[n]=e,this._encryptions=Object.freeze(t);return}this._encryptions=Object.freeze([...this._encryptions,e])}async getEncryption(e){return this.peekEncryption(e)}peekEncryption(e){if(!e)return this._encryptions[0]??null;let t=e.toLowerCase();return this._encryptions.find(e=>e.key.toLowerCase()===t)??null}async detectEncryption(e){for(let t of this._encryptions)if(await t.detect(e))return t;return null}async getReadFormats(e){return e?this._filterFormats(e,this._readFormats):[...this._readFormats]}async getWriteFormats(e){return this._writeFormats?e?this._filterFormats(e,this._writeFormats):[...this._writeFormats]:[]}async _registerFormatType(e,t){return this._registerFormatTypeSync(e,t)}_registerFormatTypeSync(e,t){if(!e)throw Error(`format must be provided.`);if(!e.key)throw Error(`format.key must be provided.`);let n=e.key.toLowerCase(),r=t.findIndex(e=>e.key.toLowerCase()===n);if(r!==-1){let n=[...t];return n[r]=e,Object.freeze(n)}return Object.freeze([...t,e])}_filterFormats(e,t,n){if(!e||Object.keys(e).length===0){if(!n)return[...t];e={ext:n}}let r=e.search?.toLocaleLowerCase();return t.filter(t=>{if(r){let e=t.key.toLocaleLowerCase().includes(r),n=!!t.exts&&t.exts.some(e=>e.toLocaleLowerCase().includes(r)),i=!!t.mimeType&&t.mimeType.toLocaleLowerCase().includes(r),a=!!t.tags&&t.tags.some(e=>e.toLocaleLowerCase().includes(r)),o=!!t.description&&t.description.toLocaleLowerCase().includes(r);if(!(e||n||i||a||o))return!1}let i=e.ext||n;if(i){let e=i.toLocaleLowerCase();if(!t.exts.some(t=>t.toLocaleLowerCase()===e))return!1}if(e.mimeType&&t.mimeType!==e.mimeType||e.key&&t.key.toLocaleLowerCase()!==e.key.toLocaleLowerCase())return!1;if(e.tags){let n=t.tags||[];if(!(typeof e.tags==`string`?[e.tags]:e.tags).every(e=>n.includes(e)))return!1}return!0})}},$=e=>!!e&&typeof e==`object`&&typeof e.getPath==`function`&&typeof e.canWrite==`function`,Te=new class{constructor(){this._setInstalled=new WeakSet,this._backingStore=null,this._emitter=new r.yt(this),this._registry=new we,this._defaultStore=new u(()=>this.getWriteFormats(),()=>this.getReadFormats())}getBackingStore(){return this._backingStore??this._defaultStore}setBackingStore(e){this._backingStore=e??null}canWrite(){return typeof this.getBackingStore().write==`function`}canRead(){return typeof this.getBackingStore().read==`function`}async install(e){this._setInstalled.has(e)||(await e.register(this._registry),this._setInstalled.add(e))}addListeners(e,t){return this._emitter.addListeners(e,t)}addCommitListener(e){return this._emitter.addListeners({onWrite:(t,n)=>{n.save&&e.onCommit?.({store:n.workbook.getTransactions(),commitId:n.commitId})}})}async getReadFormats(e){return this._registry.getReadFormats(e)}async getWriteFormats(e){return this._registry.getWriteFormats(e)}getOrigin(e){return new c(e)}async read(e){let t=null;if(typeof e==`string`)e={source:e};else if($(e)){let n=e.getPath();if(!n)throw Error(`Cannot read from an unbound origin (no path).`);t=e,e={source:n}}let n=e??{},{source:r=null,...i}=n,a=this.getBackingStore();return(a.read?a:this._defaultStore).read({source:r,options:i,decode:(e,r)=>this._decodeBuffer(e,r,n,t)})}async _decodeBuffer(e,t={},n,r=null){let i=t.format,a=t.ext;if(!i&&!a)throw Error(`Either format or file extension must be provided to determine read type.`);let o=(await this._registry.getReadFormats({search:i,ext:a}))[0];if(!o)throw Error(`No read format available for '${i??a}' input.`);let s=n?.typedCreateWorkbookOptions,l=s?Object.keys(s).find(e=>e.toLowerCase()===o.key.toLowerCase()):void 0,u={...n,...l===void 0?void 0:s[l]};delete u.typedCreateWorkbookOptions,delete u.source;let d=r??new c(t.absolutePath??null,{name:t.name??null,format:o.key,size:t.size??null,canWrite:t.canWrite??!1});r instanceof c&&r.update({format:o.key,size:t.size??null}),u.createWorkbookOptions={...u.createWorkbookOptions||{},origin:d},u.readonly!==void 0&&(u.createWorkbookOptions={readonly:u.readonly,...u.createWorkbookOptions},delete u.readonly),u.calcOnly&&(u.createWorkbookOptions={disableLoadAutoFit:!0,...u.createWorkbookOptions});let f=await this._decrypt(e,d,u);if(f===null)return null;e=f.bytes;let p=u?.progress?.onStart?.bind(u.progress);p&&await Promise.resolve(p(d,t.size));try{let t=await this._readArrayBuffer(e,o,u);return f.password!==null&&d.setPassword(f.password),u?.progress?.onComplete?.(d),this._emitter.notify(`onRead`,{params:{workbook:t,origin:d},transactional:!1}),t}catch(e){throw u?.progress?.onError?.(e),u?.progress?.onComplete?.(null),e}}async _decrypt(t,n,r){let i=await this._registry.detectEncryption(t);if(n instanceof c&&n.update({encryption:i?i.key:null}),!i)return{bytes:t,password:null};let a=null,o=async n=>{try{return a=await i.decode(t,n),!0}catch(t){if(!(t instanceof e.P))throw t;return!1}};if(r?.password&&await o(r.password))return{bytes:a,password:r.password};if(!r?.onPassword)throw new e.T(`'${n.getName()??`This file`}' is encrypted. Supply options.password or options.onPassword to open it.`);let s=await Promise.resolve(r.onPassword({origin:n,encryption:i.key,validate:o}));if(s==null)return null;if(a!==null||await o(s))return{bytes:a,password:s};throw new e.P}async writeArrayBuffer(e,t){if(!t?.format)throw Error(`A format must be specified to write to an ArrayBuffer (e.g. { format: 'xlsx' }).`);let n=(await this._registry.getWriteFormats({search:t.format}))[0];if(!n)throw Error(`No write format available for '${t.format}'.`);return this._writeArrayBuffer(e,n,t)}async write(t,n,i){if(!t)throw Error(`Workbook must be provided.`);if(!t.isIWorkbook)throw Error(`Invalid workbook model provided. Must be an instance of IWorkbook.`);let a=i,o=null;typeof n==`string`?o=this.getOrigin(n):$(n)?o=n:n&&(a=n);let s,l=!o,u=o??t.getOrigin(),d=u.getFormat();if((a?.format||d)&&(s=(await this._registry.getWriteFormats({search:a?.format??d??void 0}))[0]),s||u.getPath()&&u.canWrite()&&u.getExtension()||(s=(await this._registry.getWriteFormats({ext:`sxl`}))[0]??(await this._registry.getWriteFormats())[0]),!s)throw Error(`Unable to determine a write format. Specify options.format, or a destination with a known extension.`);if(o&&typeof n==`string`){let e=o.getPath();e&&!r.xt(e)&&o.update?.({path:`${e}.${s.exts[0]}`})}let f=u.getEncryption(),p=t.getOrigin?.(),m=(u instanceof c?u.getPassword():null)??(p instanceof c?p.getPassword():null),h=u.isEncrypted()||(p?.isEncrypted()??!1),g=a?.password===void 0?m??(h?void 0:null):a.password,_=null;if(g===void 0){if(h)throw new e.T(`'${u.getName()??`This file`}' is encrypted. Supply options.password to re-encrypt it, or options.password = null to write it without a password.`)}else if(g!==null&&(_=await this._registry.getEncryption(f),!_))throw Error(`No encryption support is installed, so this workbook cannot be password protected.`);let v=`${u.getName()??`workbook`}.${s.exts[0]}`,y=a?.progress,b=!1,x=this,S=null,C={workbook:t,format:s,origin:u,suggestedName:v,prompt:a?.prompt,async encode(e){await(async()=>{b||(b=!0,y?.onStart&&await Promise.resolve(y.onStart(u)))})(),S=t.getTransactions?.()?.getCurrentCommit()??S;let n=e?(await x._registry.getWriteFormats({search:e}))[0]??s:s,r=await x._writeArrayBuffer(t,n,a);return _?_.encode(r,g):r}},w=null;try{let e=this.getBackingStore();if(!e.write)throw Error(`The active backing store is read-only (no write implementation).`);if(w=await e.write(C),w){g!==void 0&&w instanceof c&&(w.setPassword(g),w.update({encryption:_?_.key:null}));let e=S??t.getTransactions?.()?.getCurrentCommit()??null;this._emitter.notify(`onWrite`,{params:{workbook:t,origin:w,commitId:e?.getId()??null,save:l},transactional:!1})}y?.onComplete&&await Promise.resolve(y.onComplete(w))}catch(e){let t=e instanceof Error?e:Error(String(e));throw y?.onError&&await Promise.resolve(y.onError(t)),y?.onComplete&&await Promise.resolve(y.onComplete(null)),Error(`Unable to write workbook.`,{cause:e})}return w}async writeAs(e,t,n){if(!t)throw Error(`A target must be provided for writeAs (use write(workbook) for a plain save).`);let i=e?.getOrigin?.();if(!(i instanceof c))return this.write(e,t,n);let a=typeof t==`string`?t:t.getPath(),o=a&&r.xt(a)?.toLowerCase()||null,s=o?(await this._registry.getWriteFormats({search:o}))[0]?.key??o:null,l={path:i.getPath(),name:i.getName(),format:i.getFormat(),canWrite:i.canWrite()};i.update({path:a,name:typeof t==`string`?null:t.getName(),format:s,canWrite:a!=null});let u=null;try{u=await this.write(e,void 0,n)}finally{u||i.update(l)}return u}_stripExtension(e){let t=r.xt(e);return t?e.slice(0,e.length-t.length-1):e}_baseName(e){if(!e)return null;let t=e.split(/[?#]/)[0],n=t.split(/[/\\]/).pop()??t;return this._stripExtension(n)||null}async _writeArrayBuffer(e,t,n){if(!t)throw Error(`Invalid write type for '${t}'.`);try{let r=t.handler;if(!r)throw Error(`Unable to resolve handler for type: ${t.description??t}.`);return r(e,{...n,format:t.key})}catch(e){throw Error(`Unable to load handler for '${t}.'`,{cause:e})}}async _readArrayBuffer(e,t,n){if(!e)throw Error(`ArrayBuffer must be specified.`);if(!t)throw Error(`format must be specified.`);if(e.byteLength===0)return new Z(n?.createWorkbookOptions);let r,i=t.handler;if(!i)throw Error(`Unable to resolve handler for format type: ${t?.description??t}.`);try{r=await i(e,n)}catch(e){throw Error(`Unable to read ${t.description??t.key} — ${e?.message??String(e)}`,{cause:e})}return r}};[`.woff2`,`.woff`,`.ttf`,`.otf`,`.ttc`].map(e=>({suffix:e,place:(e,t)=>t?`${t}/${e}`:e})),ve||={},ye||={};var Ee=t.r({nowWithPrecision:()=>De});function De(e=6e4){return new Date(Math.floor(Date.now()/e)*e)}Ce||={};var Oe=class extends r.st{constructor(e){super(e)}_initializeOptions(e){return e={...e,coords:{colStart:0,rowStart:0,colEnd:(e?.size?.width??5)-1,rowEnd:(e?.size?.height??5)-1},getRanges:e=>null},super._initializeOptions(e)}};Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return c}});
@@ -1 +0,0 @@
1
- const e=require("./BnccBYHCCq9TGFx4.cjs"),t=require("./DDPxHIqx8aIbqTRE.cjs"),n=require("./Crk724Yv2awixZFL.cjs"),r=require("./dJ3N_yPCcdiUsFNY.cjs"),i=require("./CHMgm0vAbEBS1mVW.cjs"),a=require("./BqJIWrtud1IdCny_.cjs");var o=class{constructor(e){this.list=e}get length(){return this.list.length}item(e){return this.list[e]}forEach(e,t){let n=this.list,r=n.length;for(let t=0;t<r;t++)e(n[t],t,this)}entries(){return this.list.entries()}keys(){return this.list.keys()}values(){return this.list.values()}[Symbol.iterator](){return this.list.values()}},s=e=>!0===e||e===`1`||e===`on`||e===`true`||!1!==e&&e!==`0`&&e!==`off`&&e!==`false`&&null,c=e=>{let t=parseInt(e);return isNaN(t)?null:t},l=e=>{let t=parseFloat(e);return isNaN(t)?null:t},u=new Map,d=class{constructor(t,n,r,i,a,o=null,s=e.A.EmptyObject){this._fileLocation=``,this._parent=t,this.sharedShared=n,this.currentPath=r,this.elemRoot=i,this.jsonRoot=a,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs,this._serializeElement=t._serializeElement):(o&&(this._fileLocation=o),s?.getRef&&(this._getRef=(e,t,n)=>s?.getRef?.(e,t,n,s?.parsedRefs)),s?.getRefs&&(this._getRefs=e=>s?.getRefs?.(e,s?.parsedRefs)),this._onWarning=s?.onWarning,this._addPerson=s?.addPerson,this._serializeElement=s?.serializeElement)}getRef(e,t=!1){return this._getRef?.(e,this._fileLocation,t)??null}getRelationships(){return this._getRefs?.(this._fileLocation)??u}getPath(){return this.currentPath}getFileLocation(){return this._fileLocation}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(e){this._onWarning?this._onWarning(e):this._parent?this._parent?.warn?.(e):console.warn(e)}serializeElement(e){return this._serializeElement?.(e)??null}addPerson(e){return typeof e==`string`&&(e={displayName:e}),this._addPerson?this._addPerson(e):this._parent?this._parent?._addPerson?.(e)??null:null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(e,t){if(!e)return t;let n=[t],r=e.split(`/`),i=r.length;for(let e=0;e<i;e++){let t=r[e];if(t===``||t===`.`)continue;let a=[],o=(t===`*`||t===`**`)&&e!==i-1;for(let i of n)if(i)if(o){let t=r[e+1];t&&t!==``&&t!==`.`&&(this._findDescendants(i,t,a),e++)}else if(t===`*`||t===`**`){if(!i.childNodes)continue;let e=i.childNodes,t=e.length;for(let n=0;n<t;n++){let t=e[n];t.nodeType===1&&a.push(t)}}else{if(!i.childNodes)continue;let e=i.childNodes,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n.nodeType!==1)continue;let i=n;this._matchesElementName(i,t)&&a.push(i)}}if(n=a,n.length===0)return null}return n.length===1?n[0]:n.length===0?null:new o(n)}_matchesElementName(e,t){return t.includes(`:`)?(e.tagName||e.nodeName)===t:e.localName===t}_findDescendants(e,t,n){if(!e||!e.childNodes)return;let r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r[e];if(i.nodeType!==1)continue;let a=i;this._matchesElementName(a,t)&&n.push(a),this._findDescendants(a,t,n)}}getFromPath(t,n){return e.A.getFromPath(t,n)}setToPath(t,n,r){return e.A.setToPath(t,n,r)}getValAttrAsString(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?n.getAttribute(`val`)??null:null}getValAttrAsBoolean(e,t,n=!1){let r=this.evaluate(e,t);if(!r)return null;let i=r.hasAttribute(`val`)?r.getAttribute(`val`):void 0;return i==null?n:i===`1`||i===`on`||i===`true`||i!==`0`&&i!==`off`&&i!==`false`&&n}getValAttrAsInteger(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseInt(n.getAttribute(`val`))??null:null}getValAttrAsFloat(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseFloat(n.getAttribute(`val`))??null:null}get BOOLEAN_COPY(){return s}get INT_COPY(){return c}get FLOAT_COPY(){return l}copyFromAttribute(e,t,n,r=t,i=null){if(!e||!n||!e.hasAttribute(t))return;let a=e.getAttribute(t);if(i){if(Array.isArray(i)){let e=i.length;for(let t=0;t<e;t++)if(a==null||(a=i[t](a),a==null))return}else if(a==null||(a=i(a),a==null))return}this.setToPath(n,r,a)}},f=i.r({isBlank:()=>v,isNotBlank:()=>y,length:()=>b,parseRotation:()=>p,parseValAttrAsBoolean:()=>h,parseValAttrAsFloat:()=>_,parseValAttrAsInteger:()=>g,parseValAttrAsString:()=>m}),p=(t,n)=>{if(!t||!t.hasAttribute(`rot`))return;let r=t.getAttribute(`rot`),i=e.A.roundAccurately(a.f(r),2);i!==-1e3&&(n.rotation=i)},m=(e,t,n,r,i)=>{let a=e.getValAttrAsString(r,t);a!==null&&(n[i]=a)},h=(e,t,n,r,i=r,a=null)=>{let o=e.getValAttrAsBoolean(r,t,a);o!==null&&(n[i]=o)},g=(e,t,n,r,i)=>{let a=e.getValAttrAsInteger(r,t);a!==null&&(n[i]=a)},_=(e,t,n,r,i,a=1)=>{let o=e.getValAttrAsFloat(r,t);o!==null&&(n[i]=o*a)},v=e=>!e||e.trim().length===0,y=e=>!v(e),b=e=>e?.length??0,x=class{constructor(e){this.jsonKey=e}visit(e,t,n){let r={};return n[this.jsonKey]=r,r}},S=class{visit(e,t,n){}getStroke(e,t){let n=e.evaluate(`ln`,t);return n?this.parseLn(e,n):{}}parseLn(e,t){let n={};t.hasAttribute(`algn`)&&(n.align=t.getAttribute(`algn`)),t.hasAttribute(`cap`)&&(n.lineCap=w(t.getAttribute(`cap`))),t.hasAttribute(`cmpd`)&&(n.compound=t.getAttribute(`cmpd`)),t.hasAttribute(`w`)&&(n.width=a.s(t.getAttribute(`w`)));let r=e.evaluate(`miter`,t);r&&(n.lineJoin=`miter`,r.hasAttribute(`lim`)&&(n.miterLimit=parseFloat(r.getAttribute(`lim`))/1e5)),e.evaluate(`bevel`,t)&&(n.lineJoin=`bevel`),e.evaluate(`round`,t)&&(n.lineJoin=`round`);let i=e.evaluate(`custDash`,t);if(i){let t=e.evaluate(`ds`,i);if(t&&t.length>0){let e=[];for(let n=0;n<t.length;n++){let r=t.item(n);e.push(a.t(r.getAttribute(`d`)??``)),e.push(a.t(r.getAttribute(`sp`)??``))}n.dash=e}}let o=e.evaluate(`prstDash`,t);o&&o.hasAttribute(`val`)&&(n.dash=o.getAttribute(`val`)),this.parseEndElement(e,t,n,`headEnd`,`head`),this.parseEndElement(e,t,n,`tailEnd`,`tail`);let s=this.getFill(e,t);return s&&(n.fill=s),n}parseEndElement(e,t,n,r,i){let a=e.evaluate(r,t);if(a&&(a.hasAttribute(`type`)&&(n[i+`Type`]=a.getAttribute(`type`)),a.hasAttribute(`len`)||a.hasAttribute(`w`))){let e=a.getAttribute(`len`)||`med`,t=a.getAttribute(`w`)||`med`;n[i+`Size`]=e+`-`+t}}getEffects(e,t){let n=e.evaluate(`effectLst`,t);if(!n)return null;let r=[],i=n.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1)continue;let a=this.processEffectElement(e,n,n.localName);if(a===void 0)return;r.push(a)}return r}processEffectElement(e,t,n){switch(n){case`outerShdw`:{let n={type:r.o.Type.OuterShadow,color:this.processAdjColor(e,t)};return t.hasAttribute(`dist`)&&(n.distance=a.s(t.getAttribute(`dist`))),t.hasAttribute(`dir`)&&(n.angle=a.f(t.getAttribute(`dir`))),t.hasAttribute(`blurRad`)&&(n.blur=a.s(t.getAttribute(`blurRad`))),t.hasAttribute(`algn`)&&(n.alignment=t.getAttribute(`algn`)),t.hasAttribute(`rotWithShape`)&&(n.isRotatedWithShape=a.p(t.getAttribute(`rotWithShape`))),t.hasAttribute(`sx`)&&(n.scaleX=a.t(t.getAttribute(`sx`))),t.hasAttribute(`sy`)&&(n.scaleY=a.t(t.getAttribute(`sy`))),t.hasAttribute(`kx`)&&(n.skewX=a.f(t.getAttribute(`kx`))),t.hasAttribute(`ky`)&&(n.skewY=a.f(t.getAttribute(`ky`))),n}case`innerShdw`:{let n={type:r.o.Type.InnerShadow,color:this.processAdjColor(e,t)};return t.hasAttribute(`dist`)&&(n.distance=a.s(t.getAttribute(`dist`))),t.hasAttribute(`dir`)&&(n.angle=a.f(t.getAttribute(`dir`))),t.hasAttribute(`blurRad`)&&(n.blur=a.s(t.getAttribute(`blurRad`))),n}case`prstShdw`:{let n={type:r.o.Type.PresetShadow,color:this.processAdjColor(e,t),preset:t.getAttribute(`prst`)??void 0};return t.hasAttribute(`dist`)&&(n.distance=a.s(t.getAttribute(`dist`))),t.hasAttribute(`dir`)&&(n.angle=a.f(t.getAttribute(`dir`))),n}case`glow`:{let n={type:r.o.Type.Glow,color:this.processAdjColor(e,t)};return t.hasAttribute(`rad`)&&(n.radius=a.s(t.getAttribute(`rad`))),n}case`softEdge`:{let e={type:r.o.Type.SoftEdge};return t.hasAttribute(`rad`)&&(e.radius=a.s(t.getAttribute(`rad`))),e}case`reflection`:{let e={type:r.o.Type.Reflection};return t.hasAttribute(`blurRad`)&&(e.blur=a.s(t.getAttribute(`blurRad`))),t.hasAttribute(`dist`)&&(e.distance=a.s(t.getAttribute(`dist`))),t.hasAttribute(`dir`)&&(e.angle=a.f(t.getAttribute(`dir`))),t.hasAttribute(`fadeDir`)&&(e.fadeAngle=a.f(t.getAttribute(`fadeDir`))),t.hasAttribute(`stA`)&&(e.startAlpha=a.t(t.getAttribute(`stA`))),t.hasAttribute(`stPos`)&&(e.startPosition=a.t(t.getAttribute(`stPos`))),t.hasAttribute(`endA`)&&(e.endAlpha=a.t(t.getAttribute(`endA`))),t.hasAttribute(`endPos`)&&(e.endPosition=a.t(t.getAttribute(`endPos`))),t.hasAttribute(`sx`)&&(e.scaleX=a.t(t.getAttribute(`sx`))),t.hasAttribute(`sy`)&&(e.scaleY=a.t(t.getAttribute(`sy`))),t.hasAttribute(`kx`)&&(e.skewX=a.f(t.getAttribute(`kx`))),t.hasAttribute(`ky`)&&(e.skewY=a.f(t.getAttribute(`ky`))),t.hasAttribute(`algn`)&&(e.alignment=t.getAttribute(`algn`)),t.hasAttribute(`rotWithShape`)&&(e.isRotatedWithShape=a.p(t.getAttribute(`rotWithShape`))),e}default:return}}getFill(e,t){if(e.evaluate(`noFill`,t))return{type:n.tt.Type.None};let r=e.evaluate(`solidFill`,t);if(r){let t=this.processAdjColor(e,r);if(t)return{type:n.tt.Type.Solid,color:t}}let i=e.evaluate(`gradFill`,t);if(i)return this.processGradFill(e,i);let a=e.evaluate(`pattFill`,t);if(a)return this.processPatternFill(e,a);let o=e.evaluate(`blipFill`,t);return o?this.processImageFill(e,o):null}processGradFill(e,t){let r={type:n.tt.Type.Gradient};t.hasAttribute(`rotWithShape`)&&(r.isRotatedWithShape=t.getAttribute(`rotWithShape`)===`1`);let i=e.evaluate(`lin`,t);i&&(r.gradientType=n.tt.GradientType.Linear,i.hasAttribute(`ang`)&&(r.angle=a.f(i.getAttribute(`ang`))),i.hasAttribute(`scaled`)&&(r.scaled=a.p(i.getAttribute(`scaled`))));let o={};t.hasAttribute(`flip`)&&(o.mirror=t.getAttribute(`flip`)),Object.keys(o).length>0&&(r.tile=o);let s=e.evaluate(`path`,t);if(s){s.hasAttribute(`path`)&&(r.gradientType=C(s.getAttribute(`path`)));let t=e.evaluate(`fillToRect`,s);t&&(r.focus=this.getRect(t))}let c=e.evaluate(`tileRect`,t);c&&(r.tile||={},r.tile.bounds=this.getRect(c));let l=[],u=e.evaluate(`gsLst/gs`,t),d=u?u.length:0;for(let t=0;t<d;t++){let n=u.item(t),r={offset:a.t(n.getAttribute(`pos`)??``),color:this.processAdjColor(e,n)};l.push(r)}return l.length>0&&(r.stops=l),r}getRect(e){let t={};return e.hasAttribute(`t`)&&(t.t=a.t(e.getAttribute(`t`))),e.hasAttribute(`l`)&&(t.l=a.t(e.getAttribute(`l`))),e.hasAttribute(`b`)&&(t.b=a.t(e.getAttribute(`b`))),e.hasAttribute(`r`)&&(t.r=a.t(e.getAttribute(`r`))),Object.keys(t).length===0?null:t}processImageFill(e,t){let r={type:n.tt.Type.Image};return t.hasAttribute(`rotWithShape`)&&(r.isRotatedWithShape=a.p(t.getAttribute(`rotWithShape`))),t.hasAttribute(`dpi`)&&(r.dpi=t.getAttribute(`dpi`)),r.ref=`https://www.sheetxl.com/logo-color-padded-white.jpg`,r.tile=!1,r}processPatternFill(e,t){let r={type:n.tt.Type.Pattern};r.patternType=t.getAttribute(`prst`);let i=e.evaluate(`bgClr`,t);if(i){let t=this.processAdjColor(e,i);t&&(r.background=t)}let a=e.evaluate(`fgClr`,t);if(a){let t=this.processAdjColor(e,a);t&&(r.foreground=t)}return r}processAdjColor(e,t){let n=e.evaluate(`hslClr`,t);if(n)return this.processHslClr(e,n);let r=e.evaluate(`prstClr`,t);if(r)return this.processClrWithValAttribute(e,r);let i=e.evaluate(`schemeClr`,t);if(i)return this.processClrWithValAttribute(e,i);let a=e.evaluate(`sysClr`,t);if(a){let t=this.processClrWithValAttribute(e,a),n=a.getAttribute(`lastClr`);return t&&n&&(t+=` lastClr ${n}`),t}let o=e.evaluate(`scrgbClr`,t);if(o)return this.processScrgbClrElement(e,o);let s=e.evaluate(`srgbClr`,t);return s?this.processSrgbClrElement(e,s):null}processScrgbClrElement(e,t){let n=`lrgba(`+a.t(t.getAttribute(`r`)??``)+`,`+a.t(t.getAttribute(`g`)??``)+`,`+a.t(t.getAttribute(`b`)??``)+`)`;return n+=this.processAdjustments(e,t),n}processSrgbClrElement(e,t){let n=t.getAttribute(`val`);return n+=this.processAdjustments(e,t),n}processHslClr(e,t){let n=`hsl(`+a.f(t.getAttribute(`hue`)??``)+`,`+a.t(t.getAttribute(`sat`)??``)+`,`+a.t(t.getAttribute(`lum`)??``)+`)`;return n+=this.processAdjustments(e,t),n}processClrWithValAttribute(e,t){let n=t.getAttribute(`val`);if(!n)return null;let r=n;return r+=this.processAdjustments(e,t),r}processAdjustments(e,t){let n=``,r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1){let t=i.localName;n+=t===`hue`||t===`hueOff`||t===`hueMod`?this.processAdjustmentElement(e,i,t,6e4):t===`gray`||t===`comp`||t===`inv`||t===`gamma`||t===`invGamma`?this.processAdjustmentElement(e,i,t,1):t===`alpha`||t===`alphaOff`||t===`alphaMod`?this.processAdjustmentElement(e,i,t,1e5):this.processAdjustmentElement(e,i,t)}}return n}processAdjustmentElement(e,t,n,r=1e3){let i=t.getAttribute(`val`);return i?` ${n} ${!i||parseFloat(i)/r}`:` ${n}`}},C=e=>e===`circle`?`radial`:e,w=e=>{if(e===`rnd`)return`round`;if(e===`flat`)return`butt`;if(e===`sq`)return`square`;throw Error(`Invalid lineCap type: `+e)},T=class extends S{visit(e,t,n){try{let r=e.evaluate(`xfrm`,t);if(r){p(r,n);let t={x:0,y:0,width:0,height:0},i=e.evaluate(`off`,r);i&&(t.x=a.i(i.getAttribute(`x`))??0,t.y=a.i(i.getAttribute(`y`))??0);let o=e.evaluate(`ext`,r);i&&(t.width=a.i(o.getAttribute(`cx`))??0,t.height=a.i(o.getAttribute(`cy`))??0),n.bounds=t}let i=e.evaluate(`prstGeom`,t);i?.hasAttribute(`prst`)?n.geometry=i?.getAttribute(`prst`):e.evaluate(`customGeom`,t)&&console.warn(`customGeom not supported yet`);let o=this.getFill(e,t);o&&Object.keys(o).length>0&&(n.fill=o);let s=this.getStroke(e,t);return s&&Object.keys(s).length>0&&(n.stroke=s),n}catch(e){console.warn(e)}}},E=class{visit(e,t,n){let r={};if(m(e,t,r,`grouping`,`grouping`),h(e,t,r,`varyColors`,`varyColors`),_(e,t,r,`gapWidth`,`gapWidth`,.01),_(e,t,r,`overlap`,`overlap`,.01),this.parseType(e,t,r),g(e,t,r,`bubbleScale`,`bubbleScale`),h(e,t,r,`showNegBubbles`,`showNegativeBubbleValues`),h(e,t,r,`sizeRepresents`,`bubbleSizeRepresentsWidth`),g(e,t,r,`firstSliceAng`,`startAngle`),g(e,t,r,`holeSize`,`holeSize`),m(e,t,r,`scatterStyle`,`scatterStyle`),this.parseAxisIds(e,t,r),Object.keys(r).length>0){let t=e.getVisitorParamsState().get(`types`);t||(console.warn(`Uninitialized types array in ChartTypeVisitor`),t=[],e.getVisitorParamsState().set(`types`,t)),t.push(r)}return r}parseType(e,t,n){switch(t.localName){case`areaChart`:n.type=`area`;break;case`bubbleChart`:n.type=`bubble`;break;case`doughnutChart`:case`ofPieType`:case`pieChart`:n.type=`pie`;break;case`lineChart`:n.type=`line`;break;case`scatterChart`:n.type=`scatter`}}parseAxisIds(e,t,n){let r=e.evaluate(`axId`,t);r&&r.length!==0&&(n.xAxisId=r.item(0).getAttribute(`val`),n.yAxisId=r.item(1).getAttribute(`val`))}},D=(e,t,n)=>{if(!0===e.getValAttrAsBoolean(`invertIfNegative`,t))if(e.evaluate(`extLst/ext/invertSolidFillFmt`,t)){if(n.fill&&n.fillNegative){let t=e.getFromPath(n,`fill.solid.adjs`);t&&e.setToPath(n,`fillNegative.solid.adjs`,t)}}else{let e={val:`FFFFFF`},t={};t.solid=e,n.fillNegative=t;let r={val:`000000`},i={};i.solid=r;let a={};a.fill=i,n.strokeNegative=a}},O=class extends S{constructor(e=`text`){super(),this._jsonKey=e}getTextPath(){return this._jsonKey}visit(e,t,n){let r=e.getFromPath(n,this.getTextPath());return r||={},this.parseTextElement(e,t,r,!1),Object.keys(r).length>0&&e.setToPath(n,this.getTextPath(),r),n}parseTextElement(e,t,n,r){let i=e.evaluate(`p/pPr/defRPr`,t)??e.evaluate(`defRPr`,t);i&&(this.parseTextProperties(e,i,n),new T().visit(e,i,n));let a=n.runs??[],o=e.evaluate(`p/r`,t)??e.evaluate(`r`,t),s=t=>{let n={},r=e.evaluate(`t`,t),i=e.evaluate(`rPr`,t);i&&this.parseTextProperties(e,i,n),r&&r.firstChild?n.text=r.firstChild.textContent??``:t.textContent&&(n.text=t.textContent??``),Object.keys(n).length>0&&a.push(n)};if(o?.length!==void 0)for(let e=0;o&&e<o.length;e++)s(o.item(e));else s(o||t);a.length>0&&(n.runs=a);let c=e.evaluate(`bodyPr`,t);c&&p(c,n)}parseTextProperties(e,t,r){if(!t)return;t.hasAttribute(`sz`)&&(r.size=parseFloat(t.getAttribute(`sz`))/100),t.hasAttribute(`b`)&&(r.weight=t.getAttribute(`b`)===`1`?700:400),t.hasAttribute(`i`)&&(r.italic=t.getAttribute(`i`)===`1`),t.hasAttribute(`u`)&&(r.underline=t.getAttribute(`u`)),t.hasAttribute(`strike`)&&(r.strike=t.getAttribute(`strike`));let i=this.getFill(e,t);i&&Object.keys(i).length>0&&(r.color=i);let a=e.evaluate(`latin`,t);if(a&&!a.getAttribute(`typeface`).startsWith(`+`)){let e=r.font??{};if(a.hasAttribute(`typeface`)&&(e.family=a.getAttribute(`typeface`)),a.hasAttribute(`panose`)){let t=a.getAttribute(`panose`);t&&(e.fallbacks=[n.H.getPanoseFallback(t)])}a.hasAttribute(`pitchFamily`)&&(e.pitch=a.getAttribute(`pitchFamily`)),a.hasAttribute(`charset`)&&(e.charset=a.getAttribute(`charset`)),Object.keys(e).length>0&&(r.font=e)}}},k=class{visit(e,t,n){}processDataBarColor(e,t,n,r,i=`auto`){if(!t)return;let o=a.o(e=>t.getAttribute(e),i);return o&&(n[r]=o),n}processFonts(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);if(a.nodeType===1&&a.localName===`font`){let t={};this.processFont(e,a,t),n[i++]=t}}return n}processFont(e,t,r){e.getValAttrAsBoolean(`b`,t,!0)&&(r.weight=700),e.getValAttrAsBoolean(`i`,t,!0)&&(r.style=n.H.Style.Italic),e.getValAttrAsBoolean(`strike`,t,!0)&&(r.strike=!0);let i=e.evaluate(`u`,t);i&&(r.underline=i.getAttribute(`val`)||n.H.UnderlineStyle.Single),m(e,t,r,`vertAlign`,`verticalAlign`),r.verticalAlign===`superscript`?r.verticalAlign=n.H.VerticalAlignment.Super:r.verticalAlign===`subscript`&&(r.verticalAlign=n.H.VerticalAlignment.Sub),_(e,t,r,`sz`,`size`);let a=e.evaluate(`color`,t);this.processDataBarColor(e,a,r,`color`),r.color||=`auto`,m(e,t,r,`name`,`family`),m(e,t,r,`rFont`,`family`);let o=e.evaluate(`family`,t);if(o){let e=o.getAttribute(`val`);if(e)switch(e){case`1`:r.fallbacks=[`serif`];break;case`2`:r.fallbacks=[`sans-serif`];break;case`3`:r.fallbacks=[`monospace`];break;case`4`:r.fallbacks=[`cursive`];break;case`5`:r.fallbacks=[`fantasy`]}}return m(e,t,r,`scheme`,`scheme`),h(e,t,r,`shadow`,`shadow`,!0),h(e,t,r,`outline`,`outline`,!0),e.getValAttrAsBoolean(`condense`,t,!0)&&(r.letterSpacing=-1),e.getValAttrAsBoolean(`extend`,t,!0)&&(r.letterSpacing=1),g(e,t,r,`charset`,`charset`),r}processFills(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`fill`&&this.processFill(e,a,n,i++)}return n}processFill(e,t,r,i){let a={type:n.tt.Type.None},o=t.childNodes,s=!1,c=o.length;for(let t=0;!s&&t<c;t++){let n=o.item(t);n.nodeType===1&&(n.localName===`gradientFill`?(this.processGradientFill(e,n,a),s=!0):n.localName===`patternFill`&&(this.processPatternFill(e,n,a),s=!0))}return r[i]=a,r}processGradientFill(e,t,r){if(!t)return;r.type=n.tt.Type.Gradient;let i=[];r.stops=i;let a=t.getAttribute(`type`);a&&(r.gradientType=a);let o=t.hasAttribute(`degree`)?parseFloat(t.getAttribute(`degree`)):0;(o+90)%360!=0&&(r.angle=(o+90)%360),(t.hasAttribute(`left`)||t.hasAttribute(`top`)||t.hasAttribute(`right`)||t.hasAttribute(`bottom`))&&(r.focus={left:A(t.getAttribute(`left`)),top:A(t.getAttribute(`top`)),right:A(t.getAttribute(`right`)),bottom:A(t.getAttribute(`bottom`))});let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`stop`){let t={};i.push(t),t.offset=parseFloat(n.getAttribute(`position`)??``);let r=e.evaluate(`color`,n);this.processDataBarColor(e,r,t,`color`)}}return r}processPatternFill(e,t,r){if(!t)return;let i=e.getVisitorParamsState().get(`processingDXFs`),a=t.getAttribute(`patternType`)||(i?n.tt.BuiltInSheetPattern.Solid:n.tt.BuiltInSheetPattern.None);if(a===n.tt.BuiltInSheetPattern.None)return{none:!0};r.type=n.tt.Type.Pattern,a&&(r.patternType=a);let o=`foreground`,s=`background`,c=r.patternType===n.tt.BuiltInSheetPattern.Solid&&i,l=c?`dk1`:`lt1`,u=c?`lt1`:`dk1`;if(c){let e=o;o=s,s=e}let d=e.evaluate(`fgColor`,t);this.processDataBarColor(e,d,r,o,l);let f=e.evaluate(`bgColor`,t);return this.processDataBarColor(e,f,r,s,u),c&&(r.foreground||=`lt1`,r.background||=`dk1`),r}processBorders(e,t,n,r){if(!t)return;let i=t.childNodes,a=0,o=i.length;for(let t=0;t<o;t++){let o=i.item(t);o.nodeType===1&&o.localName===`border`&&this.processBorder(e,o,n,a++,r)}return n}processBorder(e,t,r,i,a){if(!t)return;let o={};return this.processBorderStroke(e,t,o,n.J.Edge.Left),this.processBorderStroke(e,t,o,n.J.Edge.Right),a?(o.right||o.left)&&(o.right?o.vertical={...o.right}:o.vertical={...o.left}):this.processBorderStroke(e,t,o,n.J.Edge.Vertical),this.processBorderStroke(e,t,o,n.J.Edge.Top),this.processBorderStroke(e,t,o,n.J.Edge.Bottom),a?(o.bottom||o.top)&&(o.bottom?o.horizontal={...o.bottom}:o.horizontal={...o.top}):this.processBorderStroke(e,t,o,n.J.Edge.Horizontal),r[i]=o,r}processBorderStroke(e,t,r,i){if(!t)return;let a=e.evaluate(i,t);if(!a)return;let o={};a.hasAttribute(`style`)?o.style=a.getAttribute(`style`):e.getVisitorParamsState().get(`processingDXFs`)&&(o.style=n.J.StrokeStyle.None);let s=e.evaluate(`color`,a);return s&&this.processDataBarColor(e,s,o,`color`),Object.keys(o).length>0?r[i]=o:null}},A=e=>{if(!e)return 0;let t=parseFloat(e);return isNaN(t)?0:t},j=class{visit(e,t,n){if(!t)return;let r=e.evaluate(`*/cNvPr`,t);return r.item&&(r=r.item(0)),r&&(e.copyFromAttribute(r,`name`,n),e.copyFromAttribute(r,`descr`,n,`description`),e.copyFromAttribute(r,`hidden`,n,`hidden`,e.BOOLEAN_COPY),e.copyFromAttribute(r,`id`,n)),n}},M=class extends j{visit(e,t,n){if(!t)return;if(e.getPath().includes(`Fallback`)&&n.content)return n;n=super.visit(e,t,n);let r=e.evaluate(`nvSpPr/cNvSpPr`,t);if(r){let t=e.evaluate(`spLocks`,r);if(t){t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`);let e={};Object.keys(e).length>0&&(n.locks=e)}}e.warn(`'${n.name}' is not editable; imported as a fixed drawing.`);let i=e.evaluate(`*/cNvPr`,t);i?.item&&(i=i.item(0));let a=i?.getAttribute?.(`id`),o=a?parseInt(a,10):void 0,s={type:`sp`,xml:e.serializeElement(t)??void 0,sourceId:o===void 0||isNaN(o)?void 0:o};return n.content={type:`sp`,json:s},s}},N=`richTypes`,P=`richData`,F=class{visit(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);i.nodeType===1&&i.localName===`Relationship`&&this.processRelationship(e,i,n)}return n}processRelationship(e,t,n){let r={};e.copyFromAttribute(t,`Target`,r,`target`),e.copyFromAttribute(t,`Type`,r,`type`),e.copyFromAttribute(t,`TargetMode`,r,`targetMode`),n[t.getAttribute(`Id`)]=r}},ee=class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1)continue;let a=this.processProperty(e,n);a&&r.push(a)}return r.length>0&&(n.properties=r),r}processProperty(e,t){if(t)return t.getAttribute(`xsi:type`),{key:t.localName,value:t.textContent||``}}},te=class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1)continue;let a=this.processProperty(e,n);a&&r.push(a)}return r.length>0&&(n.properties=r),r}processProperty(e,t){if(t)return{key:t.localName,value:t.textContent||``}}},ne=class{visit(e,t,n){return h(e,t,n,`roundedCorners`,`roundedCorners`),g(e,t,n,`.//AlternateContent/Fallback/style`,`styleId`),e.getVisitorParamsState().set(`types`,[]),e.getVisitorParamsState().set(`axes`,new Map),n.range=null,n}afterVisit(e,t,n){let r={};n.types=r;let i={},a=0,o={},s=0,c=e.getVisitorParamsState().get(`axes`),l=e.getVisitorParamsState().get(`types`),u=l.length;for(let e=0;e<u;e++){let t=l[e];if(t.xAxisId){let r=t.xAxisId,o=c.get(r);i[e+``]=o,t.offsetXAxis=e,delete t.xAxisId,n.xAxes=i,i.length=++a}if(t.yAxisId){let r=t.yAxisId,i=c.get(r);o[e+``]=i,t.offsetYAxis=e,delete t.yAxisId,n.yAxes=o,o.length=++s}r[e+``]=t}r.length=l.length;let d=e.getVisitorParamsState().get(`series`);if(!d||d.length===0)return;let f={};n.series=f;let p=d.length;for(let e=0;e<p;e++)f[e+``]=d[e];f.length=p,e.getVisitorParamsState().delete(`types`),e.getVisitorParamsState().delete(`axes`),e.getVisitorParamsState().delete(`series`)}},I=class{visit(e,t,n){let r={};return n.plotArea=r,r}},L=T,R=class extends E{parseType(e,t,n){let r=e.getValAttrAsString(`barDir`,t);r&&(n.type=r===`col`?`column`:`bar`)}},z=E,B=class{constructor(e){this.jsonKey=e}visit(e,t,n){let r={},i=r,a=e.getValAttrAsString(`idx`,t);a!==null&&(i={},i[a]=r);let o=e.getValAttrAsBoolean(`delete`,t);this.parseNumFormat(e,t,r),!0===o?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(h(e,t,r,`showBubbleSize`,`showBubbleSize`),h(e,t,r,`showCatName`,`showCatName`),h(e,t,r,`showLeaderLines`,`showLeaderLines`),h(e,t,r,`showPercent`,`showPercentage`),h(e,t,r,`showSerName`,`showSerName`),h(e,t,r,`showVal`,`showVal`),h(e,t,r,`showLegendKey`,`showLegendKey`));let s=e.evaluate(`separator`,t);return s!==null&&(r.separator=s.textContent),m(e,t,r,`dLblPos`,`position`),n[this.jsonKey]=i,r}parseNumFormat(e,t,n){let r=e.evaluate(`numFmt`,t);r&&(n.formatCode=r.getAttribute(`formatCode`),r.hasAttribute(`sourceLinked`)&&(n.sourceLinked=r.getAttribute(`sourceLinked`)===`1`))}},V=class{visit(e,t,n){let r={};g(e,t,r,`explosion`,`explosion`);let i=e.evaluate(`cat/*/f`,t);i||=e.evaluate(`xVal/*/f`,t);let a=null;i!==null&&i.firstChild!==null&&(a=i.firstChild.nodeValue),i||(i=e.evaluate(`cat/strLit`,t),i||=e.evaluate(`cat/numLit`,t),i&&(a=this.parsePointsAsString(e,i))),a!==null&&(r.xRange=a);let o=e.evaluate(`val/*/f`,t);o||=e.evaluate(`yVal/*/f`,t);let s=null;o&&o.firstChild&&(s=o.firstChild.nodeValue),o||(o=e.evaluate(`val/numLit`,t),o!==null&&(s=this.parsePointsAsString(e,o))),s!==null&&(r.valRange=s),this.parseTitleRangeOrValue(e,t,r),g(e,t,r,`idx`,`idx`),h(e,t,r,`smooth`,`smooth`),r.offsetChart=e.getVisitorParamsState().get(`types`).length-1;let c=e.getVisitorParamsState().get(`series`);return c||(c=[],e.getVisitorParamsState().set(`series`,c)),c.push(r),r}parseTitleRangeOrValue(e,t,n){let r=e.evaluate(`tx/strRef/f`,t);if(r!==null){let t=r.firstChild.nodeValue;e.setToPath(n,`title.range`,t)}else{let r=e.evaluate(`tx/v`,t);r!==null&&e.setToPath(n,`title.text.simpleRun`,r.firstChild.nodeValue)}}parsePointsAsString(e,t){let n=`{`,r=e.getValAttrAsInteger(`ptCount`,t),i=e.evaluate(`pt`,t),a=[];for(let n=0;i&&r&&n<r;n++){let r=null,i=e.evaluate(`pt[@idx='`+n+`']/v`,t);i&&(r=i.textContent),a[n]=r}for(let e=0;e<a.length;e++)e>0&&(n+=`,`),a[e]!==void 0&&(n+=a[e]);return n+=`}`,n}afterVisit(e,t,n){D(e,t,n);let r=e.getFromPath(n,`points`);if(r){let t=Object.keys(r);for(let i=0;i<t.length;i++){let a=t[i],o=e.getFromPath(r,a);if(!o)continue;let s=e.getFromPath(o,`markers`);s&&(e.setToPath(n,`markers.points.`+a,s),delete o.markers)}}}},H=class{DataPointVisitor(){}visit(e,t,n){let r=e.getFromPath(n,`points`),i=null;r?i=r:(i={},e.setToPath(n,`points`,i));let a={},o=e.getValAttrAsString(`idx`,t);return o!==null&&(i[o]=a),h(e,t,a,`bubble3D`,`bubble3D`),g(e,t,a,`explosion`,`explosion`),D(e,t,a),a}},U=class{visit(e,t,n){let r=t.parentNode.localName;if(r===`ser`||r===`dPt`){let r={},i=e.getValAttrAsString(`size`,t);i!==null&&(r.size=i);let a=e.getValAttrAsString(`symbol`,t);return a&&(r.type=a),n.markers=r,r}return null}},W=class{visit(e,t,n){let r={};this.parseScaling(e,t,r),_(e,t,r,`majorUnit`,`majorUnits`),_(e,t,r,`minorUnit`,`minorUnits`),h(e,t,r,`delete`,`shown`),this.parseOrientation(e,t,r),this.parseNumFormat(e,t,r),m(e,t,r,`majorTickMark`,`majorTickMarks`),m(e,t,r,`minorTickMark`,`minorTickMarks`),m(e,t,r,`crosses`,`crosses`),_(e,t,r,`crossesAt`,`crosses`),m(e,t,r,`crossBetween`,`crossBetween`),this.parseLabelAlign(e,t,r),g(e,t,r,`lblOffset`,`labelOffset`),m(e,t,r,`tickLblPos`,`labelPosition`);let i=e.getValAttrAsInteger(`noMultiLvlLbl`,t);r.labelMultiLevel=i!==null&&i===0,g(e,t,r,`tickMarkSkip`,`tickMarkSkip`),g(e,t,r,`tickLblSkip`,`labelInterval`),this.parseDisplayCustOrBuiltInUnit(t,e,r),this.parseTimeUnits(e,t,r,`majorUnitDates`,`majorTimeUnit`,`majorUnit`),this.parseTimeUnits(e,t,r,`minorUnitDates`,`minorTimeUnit`,`minorUnit`),m(e,t,r,`baseTimeUnit`,`baseUnitDates`),e.getVisitorParamsState().get(`axes`)||(console.warn(`Uninitialized axes map in AxisVisitor`),e.getVisitorParamsState().set(`axes`,new Map));let a=e.getValAttrAsString(`axId`,t);return e.getVisitorParamsState().get(`axes`).set(a,r),r}parseTimeUnits(e,t,n,r,i,a){let o={},s=e.getValAttrAsString(i,t);s!==null&&(o.dem=s,o.amt=e.getValAttrAsString(a,t)),Object.keys(o).length>0&&(n[r]=o)}parseDisplayCustOrBuiltInUnit(e,t,n){let r=t.getValAttrAsString(`dispUnits/builtInUnit`,e);r||=t.getValAttrAsString(`dispUnits/custUnit`,e),r&&(n.displayUnits=r)}parseLabelAlign(e,t,n){let r=e.getValAttrAsString(`lblAlgn`,t);r!==null&&(r===`ctr`?n.labelAlign=`center`:r===`l`?n.labelAlign=`left`:r===`r`&&(n.labelAlign=`right`))}parseOrientation(e,t,n){let r=e.getValAttrAsString(`AxPos`,t);r!==null&&(r===`b`?n.orientation=`bottom`:r===`l`?n.orientation=`left`:r===`r`?n.orientation=`right`:r===`t`&&(n.orientation=`top`))}parseNumFormat(e,t,n){let r={},i=e.evaluate(`numFmt`,t);i!==null&&(i.hasAttribute(`formatCode`)&&(r.formatCode=i.getAttribute(`formatCode`)),i.hasAttribute(`sourceLinked`)&&(r.sourceLinked=i.getAttribute(`sourceLinked`)===`1`)),Object.keys(r).length>0&&(n.labels=r)}parseScaling(e,t,n){let r=e.getValAttrAsString(`scaling/orientation`,t);r!==null&&(n.inverted=r!==`minMax`);let i=e.getValAttrAsFloat(`scaling/logBase`,t);i!==null&&(n.logBase=i,n.scaleType=`log`),_(e,t,n,`scaling/max`,`max`),_(e,t,n,`scaling/min`,`min`)}afterVisit(e,t,n){n.fill&&n.labels&&(n.labels.fill=n.fill,delete n.fill);let r=e.getValAttrAsBoolean(`delete`,t);r!==null&&(e.setToPath(n,`labels.shown`,!0!==r),e.setToPath(n,`shown`,!0!==r));let i=e.getFromPath(n,`dispUnits.displayUnitsLabel`);i&&(e.setToPath(n,`displayUnitsLabel`,i),delete n.dispUnits);let a=e.evaluate(`title`,t);e.setToPath(n,`title.shown`,a!==null);let o=e.evaluate(`minorGridlines`,t);e.setToPath(n,`gridLinesMinor.shown`,o!==null);let s=e.evaluate(`majorGridlines`,t);e.setToPath(n,`gridLinesMajor.shown`,s!==null)}},G=O,K=class{visit(e,t,n){let r=e.getVisitorParamsState().get(`series`),i=e.getValAttrAsInteger(`idx`,t),a=i===null?void 0:r[i];if(a){let n=e.getFromPath(a,`title`);n||(n={},e.setToPath(a,`title`,n));let r=n,i=e.getValAttrAsBoolean(`delete`,t);return i!==null&&(r.shown=!i),r}return n}},q=class{visit(e,t,n){let r={};return h(e,t,r,`overlay`,`overlay`),m(e,t,r,`legendPos`,`position`),n.legend=r,r}},J=class extends T{visit(e,t,n){let r=this.getFill(e,t);Object.keys(r).length>0&&(n.fillNegative=r);let i=this.getStroke(e,t);return Object.keys(i).length>0&&(n.strokeNegative=i),n}},Y=class extends O{constructor(e=`title`){super(e)}parseTitleRangeOrValue(e,t,n){let r=e.evaluate(`tx/strRef/f`,t)??null;if(r){let t=r.firstElementChild.nodeValue;e.setToPath(n,`range`,t)}}visit(e,t,n){let r={};h(e,t,r,`overlay`,`overlay`),n[this._jsonKey]=r;let i=e.getFromPath(r,this.getTextPath());i||={},this.parseTitleRangeOrValue(e,t,r);let a=e.evaluate(`txPr`,t);a&&this.parseTextElement(e,a,i,!1);let o=e.evaluate(`tx/rich`,t);return o&&this.parseTextElement(e,o,i,!0),Object.keys(i).length>0&&e.setToPath(r,`text`,i),r}afterVisit(e,t,n){if(n?.text){let e=n.text?.rotation??null;e!==null&&(n.rotation=parseInt(e),delete n.title.rotation)}}},X=class{visit(e,t,n){let r=e.evaluate(`manualLayout`,t);if(r){let t={};_(e,r,t,`x`,`x`),_(e,r,t,`y`,`y`),_(e,r,t,`w`,`w`),_(e,r,t,`h`,`h`),m(e,r,t,`xMode`,`xMode`),m(e,r,t,`yMode`,`yMode`),m(e,r,t,`wMode`,`wMode`),m(e,r,t,`hMode`,`hMode`),Object.keys(t).length>0&&(n.manualLayout=t)}return n}},Z=class{visit(e,t,n){return n.name=t.getAttribute(`name`),n}},re=class extends S{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=t.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1){let n=a.localName,i=e.evaluate(n,t);r[n]=this.processAdjColor(e,i)}}return Object.keys(r).length>0&&(n.colors=r),r}},ie=class{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=e.evaluate(`majorFont`,t),a=this.processFontElement(e,i,{});a&&(r.majorFont=a.family,a.fallbacks&&(r.majorFallbacks=a.fallbacks));let o=e.evaluate(`minorFont`,t),s=this.processFontElement(e,o,{});return s&&(r.minorFont=s.family,s.fallbacks&&(r.minorFallbacks=s.fallbacks)),n.fonts=r,r}processFontElement(e,t,r){if(!t)return;let i=e.evaluate(`latin`,t);if(!i)return;let a=i.getAttribute(`typeface`);a&&(r.family=a);let o=i.getAttribute(`panose`);return o&&(r.fallbacks=[n.H.getPanoseFallback(o)]),r}},ae=class extends S{visit(e,t,n){let r=this.parseFillList(e,t,`fillStyleLst`),i=this.parseLnList(e,t,`lnStyleLst`),a=this.parseEffectStyleList(e,t,`effectStyleLst`),o=this.parseFillList(e,t,`bgFillStyleLst`);if(r&&i&&a&&o)return n.fillStyleLst=r,n.lnStyleLst=i,n.effectStyleLst=a,void(n.bgFillStyleLst=o);let s=e.serializeElement(t);s&&(n.formatSchemeXml=s)}parseFillList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;let r=this.parseFillListItem(e,n);if(r===void 0)return;i.push(r)}return i}parseFillListItem(e,t){switch(t.localName){case`noFill`:return{type:n.tt.Type.None};case`solidFill`:{let r=this.processAdjColor(e,t);return r?{type:n.tt.Type.Solid,color:r}:void 0}case`gradFill`:return this.processGradFill(e,t);case`pattFill`:return this.processPatternFill(e,t);default:return}}parseLnList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType===1){if(e.evaluate(`headEnd`,n)||e.evaluate(`tailEnd`,n))return;i.push(this.parseLn(e,n))}}return i}parseEffectStyleList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;if(e.evaluate(`scene3d`,n)||e.evaluate(`sp3d`,n))return;let r=this.getEffects(e,n);if(r===void 0)return;i.push(r??[])}return i}},oe=class{visit(e,t,n){if(!t)return;let r={},i=t.getAttribute(`r:id`);if(i){let t=e.getRef(i);typeof t==`string`&&(r.address=t)}return e.copyFromAttribute(t,`tooltip`,r,`screenTip`),e.copyFromAttribute(t,`history`,r,`history`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`tgtFrame`,r,`target`),n.hyperlink=r,r}},se=class{visit(e,t,n){if(!t)return;let r={},i=[];return this.processFilterColumns(e,t,i,n),i.length>0&&(r.conditions=i),Object.keys(r).length>0&&(n.filter=r),r}processColorFilter(e,t){let r={},i={operator:n.F.BuiltInOperatorNames.Color,param:r};return e.copyFromAttribute(t,`cellColor`,r,`cellColor`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`dxfId`,r,`styleId`,e.INT_COPY),i}processCustomFilter(e,t){return{operator:t.getAttribute(`operator`),param:t.getAttribute(`val`)}}processCustomFilters(e,t){let r=t.getAttribute(`and`),i=r===`and`||r===`1`;t.getAttribute(`val`);let a=[],o={operator:i?n.F.BuiltInOperatorNames.And:n.F.BuiltInOperatorNames.Or,param:a},s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType!==1)continue;let r=null;n.localName===`customFilter`&&(r=this.processCustomFilter(e,n)),r&&a.push(r)}return o}processDynamicFilter(e,t){let r={},i={operator:n.F.BuiltInOperatorNames.TimePeriod,param:r},a=t.getAttribute(`type`);return a===`aboveAverage`?a=n.F.AverageType.Above:a===`belowAverage`&&(a=n.F.AverageType.Below),Object.values(n.F.AverageType).includes(a)?(i.operator=n.F.BuiltInOperatorNames.Average,e.copyFromAttribute(t,`val`,r,`stdDevs`,e.INT_COPY)):e.copyFromAttribute(t,`val`,r,`anchorDate`,e.INT_COPY),e.copyFromAttribute(t,`type`,r,`operator`),e.copyFromAttribute(t,`maxVal`,r,`maxVal`,e.INT_COPY),i}processDateGroupItem(e,t){let n={};return e.copyFromAttribute(t,`dateTimeGrouping`,n,`group`),e.copyFromAttribute(t,`day`,n,`day`,e.INT_COPY),e.copyFromAttribute(t,`hour`,n,`hour`,e.INT_COPY),e.copyFromAttribute(t,`minute`,n,`minute`,e.INT_COPY),e.copyFromAttribute(t,`month`,n,`month`,e.INT_COPY),e.copyFromAttribute(t,`second`,n,`second`,e.INT_COPY),e.copyFromAttribute(t,`year`,n,`year`,e.INT_COPY),n}processFilterItem(e,t){if(t.hasAttribute(`val`))return t.getAttribute(`val`)}processFilters(e,t){let r={},i={operator:n.F.BuiltInOperatorNames.InSet,param:r};e.copyFromAttribute(t,`blank`,i,`blank`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calendarType`,i,`calendarType`);let a=[],o=[],s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1){if(n.localName===`dateGroupItem`){let t=this.processDateGroupItem(e,n);t&&a.push(t)}else if(n.localName===`filter`){let t=this.processFilterItem(e,n);t!==void 0&&o.push(t)}}}return a.length>0&&(r.dateGroups=a),o.length>0&&(r.items=o),i}processIcon(e,t){let r={},i={operator:n.F.BuiltInOperatorNames.Icon,param:r};return e.copyFromAttribute(t,`iconId`,r,`iconId`,e.INT_COPY),e.copyFromAttribute(t,`iconSet`,r),i}processTop10(e,t){let r={},i={operator:n.F.BuiltInOperatorNames.TopN,param:r};return e.copyFromAttribute(t,`filterVal`,r,`filterVal`,e.FLOAT_COPY),e.copyFromAttribute(t,`percent`,r,`percent`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`top`,r,`top`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`val`,r,`val`,e.FLOAT_COPY),i}processFilterCriteria(e,t){if(!t)return;let n,r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);i.nodeType===1&&(i.localName===`colorFilter`?n=this.processColorFilter(e,i):i.localName===`customFilters`?n=this.processCustomFilters(e,i):i.localName===`dynamicFilter`?n=this.processDynamicFilter(e,i):i.localName===`filters`?n=this.processFilters(e,i):i.localName===`iconFilter`?n=this.processIcon(e,i):i.localName===`top10`&&(n=this.processTop10(e,i)))}return n}processFilterColumn(e,t,n){if(!t)return null;if(!t.hasAttribute(`colId`))return;let r=parseInt(t.getAttribute(`colId`)),i=!1;if(t.hasAttribute(`hiddenButton`)&&(i=a.p(t.getAttribute(`hiddenButton`))),i&&n){let e=n.hiddenButtons;e||(e=[],n.hiddenButtons=e),e.push(r)}let o=!1;if(t.hasAttribute(`showButton`)&&(o=a.p(t.getAttribute(`showButton`))),o&&n){let e=n.showButtons;!0!==e&&(e||(e=[],n.showButtons=e),e[r]=!0)}let s=this.processFilterCriteria(e,t);return s?(s.index=r,s):null}processFilterColumns(e,t,n,r){if(!t)return;let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`filterColumn`){let t=this.processFilterColumn(e,a,r);t&&n.push(t)}}return n}},ce=class{visit(e,r,i){if(!r)return;let o=r.getAttribute(`ref`),s={};r.hasAttribute(`caseSensitive`)&&(s.collatorOptions=a.p(r.getAttribute(`caseSensitive`))?n.P.CaseSensitiveOptions:n.P.CaseInsensitiveOptions);let c=r.getAttribute(`sortMethod`);c!=null&&c!==`none`&&(c===`stroke`?s.collatorOptions={...s.collatorOptions,collation:`stroke`}:c===`pinYin`&&(s.collatorOptions={...s.collatorOptions,collation:`pinyin`}));let l={};r.hasAttribute(`columnSort`)&&a.p(r.getAttribute(`columnSort`))&&(l.axis=t.l.Axis.Column);let u=n.X.fastStringToRange(o),d=[];return this.processSortConditions(e,r,d,u,s),d.length>0&&(l.sorts=d),Object.keys(d).length>0&&(i.sort=l),l}processSortCondition(e,t,r,i){if(!t)return null;let o={};if(!t.hasAttribute(`ref`))return void console.warn(`no ref for sort conditional`,e.getPath());if(t.hasAttribute(`ref`)){let e=t.getAttribute(`ref`),i=n.X.fastStringToRange(e);o.index=r?i.colStart-r.colStart:i.colStart}let s={...i};return o.criteria=s,s.reverse=!1,t.hasAttribute(`descending`)&&(s.reverse=a.p(t.getAttribute(`descending`))),e.copyFromAttribute(t,`sortBy`,s,`sortOn`),e.copyFromAttribute(t,`dxfId`,s),e.copyFromAttribute(t,`iconSet`,s),e.copyFromAttribute(t,`customList`,s),o}processSortConditions(e,t,n,r,i){if(!t)return;let a=t.childNodes,o=a.length;for(let t=0;t<o;t++){let o=a.item(t);if(o.nodeType===1&&o.localName===`sortCondition`){let t=this.processSortCondition(e,o,r,i);t&&n.push(t)}}}},le=class extends k{visit(e,t,r){this.processNumFmts(e,e.evaluate(`numFmts`,t),null),e.getVisitorParamsState().set(`colorsToProcess`,new Set);let i={fills:{},fonts:{},borders:{}};this.processFonts(e,e.evaluate(`fonts`,t),i.fonts),this.processFills(e,e.evaluate(`fills`,t),i.fills),this.processBorders(e,e.evaluate(`borders`,t),i.borders,!0),i.fills[0]={type:n.tt.Type.None},i.fills[1]={type:n.tt.Type.Pattern,patternType:n.tt.BuiltInSheetPattern.Gray125},i.borders[0]={bottom:{style:n.J.StrokeStyle.None},left:{style:n.J.StrokeStyle.None},right:{style:n.J.StrokeStyle.None},top:{style:n.J.StrokeStyle.None}};let a=[];this.processXFs(e,e.evaluate(`cellStyleXfs`,t),a,i,null,!1);let o=new Map;if(a.length>0){let n=[];this.processCellStyles(e,e.evaluate(`cellStyles`,t),n,a,o),r.named=n}let s=[];this.processXFs(e,e.evaluate(`cellXfs`,t),s,i,o),Object.keys(s).length>0&&(r.direct=s);let c=[];return this.processDXFs(e,e.evaluate(`dxfs`,t),c),this.processTableStyles(e,e.evaluate(`tableStyles`,t),r,c),this.processIndexColors(e,e.evaluate(`colors/indexedColors`,t),r),this.processMruColors(e,e.evaluate(`colors/mruColors`,t),r),r}processIndexColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`rgbColor`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}n.indexedColors=r}processMruColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`color`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}r.length>0&&(n.mruColors=r)}processNumFmts(e,t,n){if(!t)return;let r=new Map;if(e.getVisitorParamsState().set(`numFmts`,r),!t)return;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType===1&&t.localName===`numFmt`){let e=t.getAttribute(`numFmtId`),n=t.getAttribute(`formatCode`);if(e&&n){let t=n;r.set(parseInt(e),t)}}}}processXFs(e,t,n,r,i=null,a=!0){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`xf`){let t={};this.processXF(e,s,t,r,i,a),n.push(t)}}}processXF(e,t,r,i,o,s){if(!t)return;let c=t.getAttribute(`xfId`);if(c&&o){let e=o.get(parseInt(c));e&&e!==n.Z.BuiltInName.Normal&&(r.named=e)}let l=e=>!(!s&&t.hasAttribute(e))||a.p(t.getAttribute(e)),u=e=>!s||t.hasAttribute(e)&&a.p(t.getAttribute(e)),d=s?`0`:void 0;if(l(`applyFont`)){let e=t.getAttribute(`fontId`)??d;if(e!==void 0&&(e!==`0`||u(`applyFont`))){let t=i.fonts[e];t!==void 0&&(r.font=t)}}if(l(`applyFill`)){let e=t.getAttribute(`fillId`)??d;if(e!==void 0&&(e!==`0`||u(`applyFill`))){let t=i.fills[e];t!==void 0&&Object.keys(t).length>0&&(r.fill=t)}}if(l(`applyBorder`)){let e=t.getAttribute(`borderId`)??d;if(e!==void 0&&(e!==`0`||u(`applyBorder`))){let t=i.borders[e];t!==void 0&&(r.border=t)}}if(l(`applyNumberFormat`)){let n=t.getAttribute(`numFmtId`)??d;if(n!==void 0&&(n!==`0`||u(`applyNumberFormat`))){let t,i=parseInt(n),a=e.getVisitorParamsState();if(a){let e=a.get(`numFmts`);e&&(t=e.get(i)),r.numberFormat=t??i}else console.warn(`no visitor params state`)}}if(l(`applyAlignment`)){let n=e.evaluate(`alignment`,t);(n||u(`applyAlignment`))&&this.processAlignment(e,n,r)}if(l(`applyProtection`)){let n=e.evaluate(`protection`,t);(n||u(`applyProtection`))&&this.processProtection(e,n,r)}let f=a.p(t.getAttribute(`quotePrefix`)??``);f&&(r.quotePrefix=f)}processAlignment(e,t,r){let i={};if(t?.hasAttribute(`horizontal`)?i.horizontal=t.getAttribute(`horizontal`):i.horizontal=n.ln.HorizontalAlignment.General,t?.hasAttribute(`vertical`)?i.vertical=t.getAttribute(`vertical`):i.vertical=n.ln.VerticalAlignment.Bottom,t?.hasAttribute(`indent`)?i.indent=parseInt(t.getAttribute(`indent`)):i.indent=0,t?.hasAttribute(`relativeIndent`)?i.relativeIndent=parseInt(t.getAttribute(`relativeIndent`)):i.relativeIndent=0,a.p(t?.getAttribute(`wrapText`)??``)?i.overflow=n.ln.Overflow.Wrap:i.overflow=n.ln.Overflow.Visible,a.p(t?.getAttribute(`shrinkToFit`)??``)&&(i.overflow=n.ln.Overflow.Shrink),t?.hasAttribute(`textRotation`)){let e=parseFloat(t.getAttribute(`textRotation`));e>0&&e<=90?e=360-e:e>90&&e<=180?e-=90:e===255&&(e=0,i.stacked=!0),i.rotation=e}else i.rotation=0;t?.hasAttribute(`justifyLastLine`)&&(i.justifyLastLine=a.p(t.getAttribute(`justifyLastLine`)));let o=t?.getAttribute(`readingOrder`);return o&&(o===`0`?i.readingDirection=n.ln.ReadingDirection.Auto:o===`1`?i.readingDirection=n.ln.ReadingDirection.LeftToRight:o===`2`?i.readingDirection=n.ln.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${o}`)),Object.keys(i).length>0&&(r.alignment=i),r}processProtection(e,t,n){if(!t)return;let r={},i=t.getAttribute(`locked`);i&&!a.p(i)&&(r.edit=!0);let o=t.getAttribute(`hidden`);return o&&a.p(o)&&(r.formulaHidden=!0),Object.keys(r).length>0&&(n.protection=r),n}processDXF(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`font`){let t={};this.processFont(e,i,t),n.font=t}else if(i.nodeType===1&&i.localName===`fill`){let t=[];this.processFill(e,i,t,0),t.length>0&&t[0]&&(n.fill=t[0])}else if(i.nodeType===1&&i.localName===`border`){let t=[];this.processBorder(e,i,t,0,!1),t.length>0&&t[0]&&(n.border=t[0])}else if(i.nodeType===1&&i.localName===`numFmt`){let e=i.getAttribute(`formatCode`);if(e)n.numberFormat=e;else{let e=i.getAttribute(`numFmtId`);e&&(n.numberFormat=Number(e))}}else i.nodeType===1&&i.localName===`alignment`&&this.processAlignment(e,i,n)}}processDXFs(e,t,n){if(!t)return;e.getVisitorParamsState().set(`processingDXFs`,!0);let r=new Map;e.getVisitorParamsState().set(`dxfs`,r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`dxf`){let t={};this.processDXF(e,a,t);let i=n.length;r.set(i,t),n.push(t)}}e.getVisitorParamsState().delete(`processingDXFs`)}processTableStyle(e,t,n,r,i=!1){let o=t.getAttribute(`name`),s={name:o};t.hasAttribute(`table`)&&(s.table=a.p(t.getAttribute(`table`))),t.hasAttribute(`pivot`)&&(s.pivot=a.p(t.getAttribute(`pivot`))),i&&!s.pivot&&r.unshift(null);let c=t.childNodes,l=c.length;for(let e=0;e<l;e++){let t=c.item(e);if(t.nodeType===1&&t.localName===`tableStyleElement`){let e=t.getAttribute(`type`),n=t.getAttribute(`dxfId`),i=n==null?void 0:r?.[n];i||=(console.warn(`invalid dfx id`,n),{}),s[e]=i;let a=null;t.hasAttribute(`size`)&&(a=parseInt(t.getAttribute(`size`))),a&&!isNaN(a)&&(i.size=a)}}delete s.name,n[o]=s}processTableStyles(e,t,n,r,i){if(!t)return;let a={},o=t.getAttribute(`defaultTableStyle`);o&&(a.defaultTableStyle=o);let s=t.getAttribute(`defaultPivotStyle`);s&&(a.defaultPivotStyle=s);let c=t.childNodes,l={},u=c.length;for(let t=0;t<u;t++){let n=c.item(t);n.nodeType===1&&n.localName===`tableStyle`&&this.processTableStyle(e,n,l,r,i)}return Object.keys(l).length>0&&(a.styles=l),Object.keys(a).length>0&&(n.tables=a),n}processCellStyles(e,t,r,i,o){if(!t)return;let s=t.childNodes,c=s.length;for(let e=0;e<c;e++){let t=s.item(e);if(t.nodeType===1&&t.localName===`cellStyle`){let e=parseInt(t.getAttribute(`xfId`)??``),s=t.getAttribute(`name`),c=t.getAttribute(`builtinId`),l=s;if(c!==null){let e=n.Z.builtInNameFromId(parseInt(c));e!==void 0&&(l=e)}if(o.set(e,l),!i[e])continue;let u={name:l,style:i[e]};t.getAttribute(`hidden`)&&(u.hidden=a.p(t.getAttribute(`hidden`))),t.getAttribute(`iLevel`)&&(u.iLevel=parseInt(t.getAttribute(`iLevel`))),r.push(u)}}}afterVisit(e,t,n){}},ue=class extends k{visit(e,t,n){return this.processSheetRefs(e,e.evaluate(`sheets`,t),n),this.processExternalReferences(e,e.evaluate(`externalReferences`,t),n),this.processBookViews(e,e.evaluate(`bookViews`,t),n),this.processDefinedNames(e,e.evaluate(`definedNames`,t),n),this.processCalcPr(e,e.evaluate(`calcPr`,t),n),this.processWorkbookProtection(e,e.evaluate(`workbookProtection`,t),n),this.processWorkbookPr(e,e.evaluate(`workbookPr`,t),n),n}processPassword(e,t,n,r=`workbook`,i=`password`){if(!t)return;let a={};e.copyFromAttribute(t,`${r}AlgorithmName`,a,`algorithm`),e.copyFromAttribute(t,`${r}HashValue`,a,`hash`),e.copyFromAttribute(t,`${r}SaltValue`,a,`salt`),e.copyFromAttribute(t,`${r}SpinCount`,a,`spinCount`,e.INT_COPY),Object.keys(a).length>0&&(n[i]=a)}processWorkbookProtection(e,t,n){if(!t)return;let r={};return this.processPassword(e,t,r,`workbook`,`password`),this.processPassword(e,t,r,`revisions`,`revisionsPassword`),e.copyFromAttribute(t,`lockStructure`,r,`structure`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`lockWindows`,r,`windows`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`lockRevision`,r,`revision`,e.BOOLEAN_COPY),n.protection=r,n}processCalcPr(e,t,n){t&&(n.calc={})}processSheetRefs(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`sheet`&&this.processSheetRef(e,n,r)}n.sheets=r}processSheetRef(e,t,n){let r={};e.copyFromAttribute(t,`name`,r,`name`),e.copyFromAttribute(t,`state`,r,`visibility`);let i=t.getAttribute(`r:id`),a=e.getRef(i);a&&(r.sheet=a),n.push(r)}processExternalReferences(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`externalReference`){let t=n.getAttribute(`r:id`),i=t?e.getRef(t):null;r.push(i??null)}}r.length>0&&(n.externalBooks=r)}processBookViews(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;i<1&&t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`workbookView`&&(this.processWorkbookView(e,a,n),i++)}}processWorkbookView(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`activeTab`,r,`activeSheetId`,[e.INT_COPY,e=>e]),t.hasAttribute(`activeTab`)||(r.activeSheetId=0),e.copyFromAttribute(t,`showHorizontalScroll`,r,`showHorizontalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showVerticalScroll`,r,`showVerticalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showSheetTabs`,r,`showTabs`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`tabRatio`,r,`tabRatio`,[e.FLOAT_COPY,e=>e]),Object.keys(r).length>0&&(n.view=r)}processDefineName(e,t,n,r){if(!t)return;let i={},a=t.firstChild;if(a&&a.nodeType===3&&(i.ref=a.textContent),e.copyFromAttribute(t,`name`,i),e.copyFromAttribute(t,`comment`,i),e.copyFromAttribute(t,`hidden`,i,`hidden`,e.BOOLEAN_COPY),t.hasAttribute(`localSheetId`)){let e=t.getAttribute(`localSheetId`);if(!r[e]?.name)return void console.warn(`Defined name '${t.getAttribute(`name`)}' references a sheet with localSheetId '${e}' which does not exist.`);i.scope=r[e].name}e.copyFromAttribute(t,`customMenu`,i),e.copyFromAttribute(t,`description`,i),e.copyFromAttribute(t,`statusBar`,i),e.copyFromAttribute(t,`help`,i),e.copyFromAttribute(t,`shortcutKey`,i),e.copyFromAttribute(t,`function`,i,`function`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`functionGroupId`,i,`functionGroupId`,e.INT_COPY),e.copyFromAttribute(t,`publishToServer`,i,`publishToServer`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`vbProcedure`,i,`vbProcedure`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`xlm`,i,`xlm`,e.BOOLEAN_COPY),Object.keys(i).length>0&&n.push(i)}processDefinedNames(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);a.nodeType===1&&a.localName===`definedName`&&this.processDefineName(e,a,r,n.sheets)}r.length>0&&(n.names=r)}processWorkbookPr(e,t,n){t&&e.copyFromAttribute(t,`date1904`,n,`date1904`,e.BOOLEAN_COPY)}afterVisit(e,t,n){}},de=class{visit(e,t,n){let r={};return e.copyFromAttribute(t,`ref`,n,`r`),e.getVisitorParamsState().set(`ref`,n.r),n.v=r,e.copyFromAttribute(t,`name`,r),e.copyFromAttribute(t,`displayName`,r),e.copyFromAttribute(t,`headerRowCount`,r,`headerRowCount`,e.INT_COPY),e.copyFromAttribute(t,`totalsRowCount`,r,`totalsRowCount`,e.INT_COPY),this.processTableColumns(e,t,r),this.processTableStyleInfo(e,t,r),e.copyFromAttribute(t,`id`,r),e.copyFromAttribute(t,`comment`,r,`description`),e.copyFromAttribute(t,`connectionId`,r,`connectionId`,e.INT_COPY),e.copyFromAttribute(t,`tableType`,r),e.copyFromAttribute(t,`published`,r,`published`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRow`,r,`insertRow`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRowShift`,r,`insertRowShift`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`totalsRowShown`,r,`totalsRowShown`,e.BOOLEAN_COPY),r}afterVisit(e,t,n){let r=n.v;if(e.evaluate(`autoFilter`,t)){if(Array.isArray(r.hiddenButtons)){let e=r.hiddenButtons.length;e===0?r.hiddenButtons=!1:e===r.columns?.length&&(r.hiddenButtons=!0)}}else r.hiddenButtons=!0,r.showButtons=!1;return r}processTableStyleInfo(e,t,n){if(!t)return;let r=t.childNodes,i={},a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableStyleInfo`&&(e.copyFromAttribute(n,`name`,i),e.copyFromAttribute(n,`showColumnStripes`,i,`showColumnStripes`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showFirstColumn`,i,`showFirstColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showLastColumn`,i,`showLastColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showRowStripes`,i,`showRowStripes`,e.BOOLEAN_COPY))}Object.keys(i).length>0&&(n.style=i)}processTableColumn(e,t,n){if(!t)return null;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`tableColumn`){let t={};e.copyFromAttribute(i,`name`,t),e.copyFromAttribute(i,`id`,t),e.copyFromAttribute(i,`uniqueName`,t),e.copyFromAttribute(i,`queryTableFieldId`,t),e.copyFromAttribute(i,`totalsRowLabel`,t);let r=i.getAttribute(`totalsRowFunction`);if(r!==null)if(r===`custom`){let n=e.evaluate(`totalsRowFormula`,i);n&&(t.totalsRowFormula=n.textContent)}else t.totalsRowFormula=r;e.copyFromAttribute(i,`totalsRowLabel`,t),n.push(t)}}return n}processTableColumns(e,t,n){let r=t.childNodes,i=[],a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableColumns`&&this.processTableColumn(e,n,i)}i.length>0&&(n.columns=i)}},fe=class{visit(e,t,n){let r=e.getVisitorParamsState().get(`ref`);if(r){let n=e.getVisitorParamsState().get(`descriptions`);n&&(n.add(r,t.getAttribute(`altText`)),n.add(r,t.getAttribute(`altTextSummary`)))}return e.copyFromAttribute(t,`altText`,n),e.copyFromAttribute(t,`altTextSummary`,n),n}},pe=class{visit(e,t,n){let r=t.childNodes,i=r.length,a=null;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1){t.localName===`externalBook`&&(a=t);break}}return a?(t.getAttribute(`mc:Ignorable`)&&(n.mceIgnorable=!0),n.sheetNames=[],this.processSheetNames(e,a,n),this.processDefinedNames(e,a,n),this.processSheetDataSet(e,a,n),n):n}processSheetNames(e,t,n){let r=this._findChild(t,`sheetNames`);if(!r)return;let i=r.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);t.nodeType===1&&t.localName===`sheetName`&&n.sheetNames.push(t.getAttribute(`val`)??``)}}processDefinedNames(e,t,n){let r=this._findChild(t,`definedNames`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let e=0;e<o;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`definedName`)continue;let n=t.getAttribute(`name`);if(!n)continue;let r={name:n,refersTo:t.getAttribute(`refersTo`)??``},o=t.getAttribute(`sheetId`);o!==null&&(r.sheetIndex=parseInt(o,10)),i.push(r)}i.length>0&&(n.definedNames=i)}processSheetDataSet(e,t,n){let r=this._findChild(t,`sheetDataSet`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1||n.localName!==`sheetData`)continue;let r=n.getAttribute(`sheetId`);if(r===null)continue;let o=this.processSheetData(e,n);o.sheetIndex=parseInt(r,10),n.getAttribute(`refreshError`)===`1`&&(o.refreshError=!0),i.push(o)}i.length>0&&(n.sheetDataSet=i)}processSheetData(e,t){let r=new n.r.Builder,i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType!==1||t.localName!==`row`)continue;let a=t.childNodes,o=a.length;for(let e=0;e<o;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`cell`)continue;let i=t.getAttribute(`r`);if(!i)continue;let o=n.X.fastStringToCell(i);if(o?.rowIndex===void 0||o?.colIndex===void 0)continue;let s=this._readCellValue(t);s!==void 0&&r.pushAt(o.rowIndex,o.colIndex,s)}}return{sheetIndex:-1,data:r.build()?.tuples??[]}}_readCellValue(e){let n=this._findChild(e,`v`)?.textContent?.trim();if(n!==void 0&&n!==``)switch(e.getAttribute(`t`)){case null:case`n`:return parseFloat(n);case`b`:return n===`1`||n===`true`;case`str`:default:return n;case`e`:{let e=t.a.getBuiltInByLabel(n);return e?{t:`e`,v:e.getCode()}:n}}}_findChild(e,t){let n=e.childNodes,r=n.length;for(let e=0;e<r;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null}},me=class{visit(e,t,n){e.copyFromAttribute(t,`name`,n),e.copyFromAttribute(t,`sourceName`,n);let r=e.evaluate(`*/tableSlicerCache`,t);return r?(e.copyFromAttribute(r,`tableId`,n),e.copyFromAttribute(r,`column`,n,`columnId`),e.copyFromAttribute(r,`crossFilter`,n),n):(console.warn(`SlicerCacheDefinitionVisitor: missing tableSlicerCache element`),n)}},he=class{visit(e,t,n){let r=n.slicers;r||(r={},n.slicers=r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`slicer`&&this.processSlicer(e,n,r)}return r}processSlicer(e,t,n){if(!t)return;let r={};n[t.getAttribute(`name`)]=r;let i=t.getAttribute(`cache`),a=e.getVisitorParamsState().get(`slicerCaches`);if(i){let e=a.get(i);e&&(r.columnId=e.columnId,r.tableId=e.tableId)}e.copyFromAttribute(t,`caption`,r),e.copyFromAttribute(t,`startItem`,r,`startItem`,e.INT_COPY),e.copyFromAttribute(t,`columnCount`,r,`columnCount`,e.INT_COPY),e.copyFromAttribute(t,`showCaption`,r,`showCaption`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`level`,r,`level`,e.INT_COPY),e.copyFromAttribute(t,`style`,r),e.copyFromAttribute(t,`locked`,r,`locked`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`rowHeight`,r,`rowHeight`,e.INT_COPY)}},ge=class{visit(e,t,n){return n}},Q=class{visit(e,t,n){if(!t)return;let r={};return e.copyFromAttribute(t,`editAs`,r,`anchorType`),r.anchor={},t.localName===`absoluteAnchor`?(r.anchorType=`absolute`,this.processAbsoluteCoord(e,e.evaluate(`xdr:pos`,t),r.anchor,`from`,`x`,`y`),this.processAbsoluteCoord(e,e.evaluate(`xdr:ext`,t),r.anchor,`to`,`cx`,`cy`)):t.localName===`oneCellAnchor`?(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processAbsoluteCoord(e,e.evaluate(`xdr:ext`,t),r.anchor,`to`,`cx`,`cy`)):(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processOffsetCoord(e,e.evaluate(`to`,t),r.anchor,`to`)),n.movables||=[],n.movables.push(r),r}processAbsoluteCoord(e,t,n,r,i,o){if(!t)return;let s={x:0,y:0};return s.x=a.i(t.getAttribute(i)),s.y=a.i(t.getAttribute(o)),r===`from`?n.tl=s:n.br=s,n}processOffsetCoord(e,t,n,r){if(!t)return;let i={c:0,r:0,x:0,y:0};return e.evaluate(`col`,t)&&(i.c=parseInt(e.evaluate(`col`,t).textContent)),e.evaluate(`row`,t)&&(i.r=parseInt(e.evaluate(`row`,t).textContent)),e.evaluate(`colOff`,t)&&(i.x=a.i(e.evaluate(`colOff`,t).textContent)),e.evaluate(`rowOff`,t)&&(i.y=a.i(e.evaluate(`rowOff`,t).textContent)),r===`from`?n.tl=i:n.br=i,n}},_e=class extends j{visit(e,t,n){if(!t)return;n=super.visit(e,t,n);let r=e.evaluate(`nvGraphicFramePr/cNvGraphicFramePr`,t);if(r){let t=e.evaluate(`graphicFrameLocks`,r);if(t){t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`);let e={};Object.keys(e).length>0&&(n.locks=e)}}let i={type:`graphicFrame`,json:{}},o=e.evaluate(`graphic/graphicData`,t).childNodes,s=o.length;for(let n=0;n<s;n++){let r=o.item(n);if(r.nodeType===1)try{let n=r.localName;n===`chart`?n=`chart`:n===`slicer`&&(n=`slicer`),i.type=n;let o=r.getAttribute(`r:id`);if(n===`chart`&&o){let n=e.evaluate(`*/cNvPr`,t);n?.item&&(n=n.item(0));let r,s=n?.getAttribute?.(`id`),c=s?parseInt(s,10):void 0,l=e.getRelationships().get(o);if(l?.target){let t=e.getFileLocation(),n=t.slice(0,t.lastIndexOf(`/`)+1);r=a.u(l.target.startsWith(`/`)?l.target:n+l.target)}i.json={xml:e.serializeElement(t)??void 0,sourceId:c===void 0||isNaN(c)?void 0:c,chartRelId:o,chartTargetPath:r}}else o&&(i.json=e.getRef(o))}catch(e){console.warn(`Unable to parse graphicFrame`,e)}}return i&&(n.content=i),i}},ve=M,ye=class extends j{visit(e,t,n){if(!t)return;let r=super.visit(e,t,n),i=e.evaluate(`nvPicPr/cNvPicPr`,t);if(i){e.copyFromAttribute(t,`preferRelativeResize`,r,`preferRelativeResize`,e.BOOLEAN_COPY);let n=e.evaluate(`picLocks`,i);if(n){n.hasAttribute(`noChangeAspect`)&&(r.lockAspect=n.getAttribute(`noChangeAspect`)===`1`);let t={};e.copyFromAttribute(n,`noChangeArrowheads`,r,`noChangeArrowheads`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noChangeShapeType`,r,`noChangeShapeType`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noEditPoints`,r,`noEditPoints`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noAdjustHandles`,r,`noAdjustHandles`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noCrop`,r,`noCrop`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noGrp`,r,`noGrp`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noMove`,r,`noMove`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noResize`,r,`noResize`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noRot`,r,`noRot`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`noSelect`,r,`noSelect`,e.BOOLEAN_COPY),Object.keys(t).length>0&&(r.locks=t)}}let a,o=e.evaluate(`blipFill/blip`,t);if(o){let t;if(t=o.getAttribute(`r:embed`)??o.getAttribute(`embed`),t||=o.getAttribute(`r:link`)??o.getAttribute(`link`),!t)return void console.warn(`no rId found for blip`,o);a=e.getRef(t,!0)}return n.content={type:`picture`,json:{resId:a}},r}},be=class extends M{visit(e,t,n){if(!t)return;n=super.visit(e,t,n);let r=e.evaluate(`nvGrpSpPr/cNvGrpSpPr`,t);if(r){let t=e.evaluate(`grpSpLocks`,r);if(t){t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`);let e={};Object.keys(e).length>0&&(n.locks=e)}}e.warn(`Unable to import '${n.name}', group shapes are not supported.`);let i={};return n.content={type:`grpSp`,json:i},i}},$=class extends M{visit(e,t,n){if(!t)return;n=super.visit(e,t,n);let r=e.evaluate(`nvCxnSpPr/cNvCxnSpPr`,t);if(r){let t=e.evaluate(`cxnSpLocks`,r);if(t){t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`);let e={};Object.keys(e).length>0&&(n.locks=e)}}e.warn(`'${n.name}' is not editable; imported as a fixed drawing.`);let i=e.evaluate(`*/cNvPr`,t);i?.item&&(i=i.item(0));let a=i?.getAttribute?.(`id`),o=a?parseInt(a,10):void 0,s={type:`cxnSp`,xml:e.serializeElement(t)??void 0,sourceId:o===void 0||isNaN(o)?void 0:o};return n.content={type:`cxnSp`,json:s},s}},xe=class{visit(e,t,n){let r=[],i=new Map,a={cells:[],values:[]},o=t.childNodes;for(let e=0;e<o.length;e++){let t=o.item(e);if(t.nodeType===1)switch(t.localName){case`metadataTypes`:this._parseMetadataTypes(t,r,i);break;case`futureMetadata`:this._attachFutureMetadata(t,i);break;case`cellMetadata`:this._resolveBlocks(t,r,a.cells);break;case`valueMetadata`:this._resolveBlocks(t,r,a.values)}}return n.metadata=a,a}_parseMetadataTypes(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1&&i.localName===`metadataType`){let e=this._parseMetadataType(i);t.push(e),n.set(e.name,e)}}}_parseMetadataType(e){let t={name:e.getAttribute(`name`)??``,_blocks:[]},n=e.getAttribute(`minSupportedVersion`);n!=null&&(t.minSupportedVersion=Number(n));for(let n of[`copy`,`pasteAll`,`pasteValues`,`merge`,`splitFirst`,`splitAll`,`rowColShift`,`clearFormats`,`clearComments`,`assign`,`coerce`,`cellMeta`,`adjust`,`trans`,`delete`,`edit`])e.getAttribute(n)===`1`&&(t[n]=!0);return t}_attachFutureMetadata(e,t){let n=e.getAttribute(`name`)??``,r=t.get(n);if(!r)return;let i=e.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bk`&&r._blocks.push(this._parseFutureBlock(t))}}_parseFutureBlock(e){let t={},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`extLst`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`ext`)continue;let r=n.childNodes;for(let e=0;e<r.length;e++){let n=r.item(e);n.nodeType===1&&(n.localName===`dynamicArrayProperties`?(t.fDynamic=n.getAttribute(`fDynamic`)===`1`,t.fCollapsed=n.getAttribute(`fCollapsed`)===`1`):n.localName===`rvb`&&(t.richValueIndex=Number(n.getAttribute(`i`)??`0`)))}}}return t}_resolveBlocks(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);i.nodeType===1&&i.localName===`bk`&&n.push(this._resolveBlock(i,t))}}_resolveBlock(e,t){let n=new Map,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType!==1||i.localName!==`rc`)continue;let a=Number(i.getAttribute(`t`)),o=Number(i.getAttribute(`v`)),s=t[a-1];if(!s)continue;let{_blocks:c,...l}=s,u={...l};for(let e of Object.keys(u))u[e]===void 0&&delete u[e];let d=c[o];d&&(d.fDynamic!==void 0&&(u.fDynamic=d.fDynamic,u.fCollapsed=d.fCollapsed??!1),d.richValueIndex!==void 0&&(u.richValueIndex=d.richValueIndex)),n.set(s.name,u)}return n}},Se=class{visit(e,t,n){let r=e.getVisitorParamsState().get(N);r||(r=[],e.getVisitorParamsState().set(N,r));let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`s`){let t={type:n.getAttribute(`t`)??`n`,keys:[]};this.processKeys(e,n,t),r.push(t)}}return n.richTypes=r,r}processKeys(e,t,n){let r=t.childNodes,i=r.length,a=n.keys;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1&&t.localName===`k`){let e=t.getAttribute(`n`),n=t.getAttribute(`t`);a.push([e,n])}}}},Ce=class{visit(e,t,n){let r=e.getVisitorParamsState().get(`richTypes`);if(!r)return void e.warn(`RichValueFound but not type.`);let i=e.getVisitorParamsState().get(P);i||(i=[],e.getVisitorParamsState().set(P,i));let a=t.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType===1&&n.localName===`rv`){let t=r[n.getAttribute(`s`)],a={type:t.type};this.processValues(e,n,a,t);let o=this.mapType(e,a);i.push(o)}}return n.richData=i,i}mapType(e,n){if(n.type===`_error`){let e=n.errorType;if(e)try{n=t.a.getBuiltInByCode(e+1)??t.a.BuiltIn.Unknown}catch{}}return n}processValues(e,t,n,r){let i=t.childNodes,a=i.length;r.type;let o=r.keys;for(let t=0;t<a;t++){let r=i.item(t);if(r.nodeType===1&&r.localName===`v`){let i=o[t];if(!i)return void e.warn(`Invalid richData`);let a=i[0],s=i[1],c=r.textContent;s===`i`&&(c=Number(c)),n[a]=c}}}},we=class{visit(e,t,n){if(!t)return;let r=[];this.processAuthors(e,e.evaluate(`authors`,t),r),r.length>0&&(n.authors=r);let i=[];return n.comments=i,i}processAuthors(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1&&t.localName===`author`){let e=t.firstChild;e&&e.nodeType===3&&n.push(e.textContent)}}}},Te=class{visit(e,t,n){if(!t)return;let r={},i=t.getAttribute(`ref`);e.copyFromAttribute(t,`authorId`,r,`personId`,e.INT_COPY),r.asNote=!0;let a={r:i,v:r};return n.push(a),r}},Ee=class{visit(e,t,n){if(!t)return;let r=[];return n.comments=r,r}},De=class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`id`,r,`id`,a.d);let i=t.getAttribute(`ref`);e.copyFromAttribute(t,`personId`,r,`personId`,a.d),e.copyFromAttribute(t,`parentId`,r,`parentId`,a.d),e.copyFromAttribute(t,`dT`,r),t.hasAttribute(`done`)&&(r.done=a.p(t.getAttribute(`done`)));let o={r:i,v:r};return n.push(o),r}},Oe=class{visit(e,t,n){let r=[],i=t.childNodes,o=i.length;for(let t=0;t<o;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`person`){let t={};e.copyFromAttribute(n,`id`,t,`id`,a.d),e.copyFromAttribute(n,`displayName`,t),e.copyFromAttribute(n,`userId`,t,`userId`,a.d),e.copyFromAttribute(n,`providerId`,t),r.push(t)}}return r.length>0&&(n.persons=r),r}},ke=class{constructor(e,t){this.path=e,this.visitor=t}};exports.DOMTransformer=class{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor(`Relationships`,new F),this.registerVisitor(`cp:coreProperties`,new ee),this.registerVisitor(`Properties`,new te),this.registerVisitor(`spPr`,new L),this.registerVisitor(`txBody`,new G),this.registerVisitor(`txPr`,new G),this.registerVisitor(`c:chartSpace`,new ne),this.registerVisitor(`c:plotArea`,new I),this.registerVisitor(`c:barChart`,new R),this.registerVisitor(`c:doughnutChart`,new z),this.registerVisitor(`c:lineChart`,new z),this.registerVisitor(`c:ofPieType`,new z),this.registerVisitor(`c:pieChart`,new z),this.registerVisitor(`c:scatterChart`,new z),this.registerVisitor(`c:barChart`,new B(`dataLabels`),`dLbls`),this.registerVisitor(`c:doughnutChart`,new B(`dataLabels`),`dLbls`),this.registerVisitor(`c:lineChart`,new B(`dataLabels`),`dLbls`),this.registerVisitor(`c:ofPieType`,new B(`dataLabels`),`dLbls`),this.registerVisitor(`c:pieChart`,new B(`dataLabels`),`dLbls`),this.registerVisitor(`c:scatterChart`,new B(`dataLabels`),`dLbls`),this.registerVisitor(`c:ser`,new V),this.registerVisitor(`c:dPt`,new H),this.registerVisitor(`c:marker`,new U),this.registerVisitor(`c:catAx`,new W),this.registerVisitor(`c:valAx`,new W),this.registerVisitor(`c:dateAx`,new W),this.registerVisitor(`c:majorGridlines`,new x(`gridLinesMajor`)),this.registerVisitor(`c:minorGridlines`,new x(`gridLinesMinor`)),this.registerVisitor(`c:chartSpace`,null,`txPr`),this.registerVisitor(`c:catAx`,new G(`labels.text`),`txPr`),this.registerVisitor(`c:valAx`,new G(`labels.text`),`txPr`),this.registerVisitor(`c:dateAx`,new G(`labels.text`),`txPr`),this.registerVisitor(`c:legend`,new q),this.registerVisitor(`c:legend`,new G(`labels.text`),`txPr`),this.registerVisitor(`c:legendEntry`,new K),this.registerVisitor(`c:ser`,new J,`extLst/ext/invertSolidFillFmt/spPr`),this.registerVisitor(`c:ser`,new B(`labels`),`dLbls`),this.registerVisitor(`c:dLbl`,new B(`points`)),this.registerVisitor(`c:title`,new Y),this.registerVisitor(`c:title`,null,`tx/rich`),this.registerVisitor(`c:title`,null,`txPr`),this.registerVisitor(`c:layout`,new X),this.registerVisitor(`c:dispUnits`,new x(`dispUnits`)),this.registerVisitor(`c:dispUnitsLbl`,new Y(`displayUnitsLabel`)),this.registerVisitor(`c:dispUnitsLbl`,new G,`tx/rich`),this.registerVisitor(`a:theme`,new Z),this.registerVisitor(`a:theme`,new re,`themeElements/clrScheme`),this.registerVisitor(`a:theme`,new ie,`themeElements/fontScheme`),this.registerVisitor(`a:theme`,new ae,`themeElements/fmtScheme`),this.registerVisitor(`autoFilter`,new se),this.registerVisitor(`sortState`,new ce),this.registerVisitor(`s:workbook`,new ue),this.registerVisitor(`styleSheet`,new le),this.registerVisitor(`x14:table`,new fe),this.registerVisitor(`table`,new de),this.registerVisitor(`externalLink`,new pe),this.registerVisitor(`hlinkClick`,new oe),this.registerVisitor(`wsDr`,new ge),this.registerVisitor(`twoCellAnchor`,new Q),this.registerVisitor(`oneCellAnchor`,new Q),this.registerVisitor(`absoluteAnchor`,new Q),this.registerVisitor(`graphicFrame`,new _e),this.registerVisitor(`sp`,new ve),this.registerVisitor(`grpSp`,new be),this.registerVisitor(`cxnSp`,new $),this.registerVisitor(`pic`,new ye),this.registerVisitor(`metadata`,new xe),this.registerVisitor(`rvStructures`,new Se),this.registerVisitor(`rvData`,new Ce),this.registerVisitor(`comments`,new we),this.registerVisitor(`comment`,new Te),this.registerVisitor(`comment`,new G(`content`),`text`),this.registerVisitor(`ThreadedComments`,new Ee),this.registerVisitor(`threadedComment`,new De),this.registerVisitor(`threadedComment`,new G(`content`),`text`),this.registerVisitor(`personList`,new Oe),this.registerVisitor(`slicerCacheDefinition`,new me),this.registerVisitor(`slicers`,new he)}registerVisitor(e,t,n=null){e.indexOf(`:`)===-1&&(e=`*:`+e);let r=e.split(`:`),i=r.length>1?r[1]:r[0];if(!n)return this.visitorsByXmlTagName.set(i,t),void this.visitorsByXmlTagName.set(e,t);let a=this.scopedVisitorsByXmlTagName.get(i);a||(a=[],this.scopedVisitorsByXmlTagName.set(i,a),this.scopedVisitorsByXmlTagName.set(e,a)),a.push(new ke(n,t))}getVisitorParamsState(){return this.visitorParamsState}transform(t,n,r=e.A.EmptyObject){let i=t.documentElement;this.visitorParamsState&&!r?.paramMap||(this.visitorParamsState=r?.paramMap??new Map);let a={},o=this.visitorsByXmlTagName.get(i.nodeName);if(o||=this.visitorsByXmlTagName.get(i.localName),!o)throw Error(`A visitor for the root element: '${i.nodeName}' or '${i.localName}' must be registered.`);let s=`/`+i.localName,c=new d(null,this,s,i,a,n,r),l=[];this._doWalk(o,c,l,i,a,n,r);let u=l.length;for(let e=0;e<u;e++){let t=l[e];try{t.visitor?.afterVisit?.(t.context,t.elemParent,t.jsonParent)}catch(e){console.warn(`Error in afterVisit: ${t.context.getPath()}`,e)}}return a}_walkScoped(e,t,n,r,i,a,o){let s=this.scopedVisitorsByXmlTagName.get(e),c=s?s.length:0;for(let l=0;l<c;l++){let c=s[l],u=null;try{u=t.evaluate(c.path,r)}catch{console.warn(`"Invalid path '${c.path}' for '${e}'.`)}if(!u)continue;let f=e=>{let s=e.localName,l=e.parentNode;for(;l&&l!==r;)s=l.localName+`/`+s,l=l.parentNode;let u=t.getPath()+`/`+s;if(c.visitor){let r=new d(t,this,u,t.getElemRoot(),t.getJsonRoot(),a,o);this._doWalk(c.visitor,r,n,e,i,a,o)}};if(u.length>0){let e=u,t=e.length;for(let n=0;n<t;n++)f(e.item(n))}else f(u)}}_doWalk(e,t,n,r,i,a,o){let s=null;e&&(n.push({visitor:e,context:t,elemParent:r,jsonParent:i}),s=e.visit(t,r,i)),s||=i;let c=r.localName;this._walkScoped(c,t,n,r,s,a,o);let l=this.visitorsByXmlTagName,u=t.getElemRoot(),f=t.getJsonRoot(),p=r.childNodes,m=p.length;for(let e=0;e<m;e++){let r=p.item(e);if(r.nodeType!==1)continue;let c=r,m=c.nodeName,h=l.get(m);h||=(m=c.localName,l.get(m));let g=t.getPath()+`/`+m,_=new d(t,this,g,u,f,a,o);this._doWalk(h,_,n,c,s??i,a,o)}return s}},exports.ExecutionContext=d,exports.NumberUtils=a.r,exports.VisitorUtils=f;
@@ -1,24 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.7.28-beta.2
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
8
- let r = {};
9
- for (var i in e) t(r, i, {
10
- get: e[i],
11
- enumerable: !0
12
- });
13
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
14
- }, c = (o, s, c) => (c = o == null ? {} : e(i(o)), ((e, i, o, s) => {
15
- if (i && typeof i == "object" || typeof i == "function") for (var c, l = r(i), u = 0, d = l.length; u < d; u++) c = l[u], a.call(e, c) || c === void 0 || t(e, c, {
16
- get: ((e) => i[e]).bind(null, c),
17
- enumerable: !(s = n(i, c)) || s.enumerable
18
- });
19
- return e;
20
- })(!s && o && o.__esModule ? c : t(c, "default", {
21
- value: o,
22
- enumerable: !0
23
- }), o));
24
- export { o as n, s as r, c as t };
@@ -1,24 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.7.28-beta.2
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
8
- let r = {};
9
- for (var i in e) t(r, i, {
10
- get: e[i],
11
- enumerable: !0
12
- });
13
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
14
- }, c = (o, s, c) => (c = o == null ? {} : e(i(o)), ((e, i, o, s) => {
15
- if (i && typeof i == "object" || typeof i == "function") for (var c, l = r(i), u = 0, d = l.length; u < d; u++) c = l[u], a.call(e, c) || c === void 0 || t(e, c, {
16
- get: ((e) => i[e]).bind(null, c),
17
- enumerable: !(s = n(i, c)) || s.enumerable
18
- });
19
- return e;
20
- })(!s && o && o.__esModule ? c : t(c, "default", {
21
- value: o,
22
- enumerable: !0
23
- }), o));
24
- export { o as n, s as r, c as t };