@sheetxl/studio-vanilla 0.4.20 → 0.4.21

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