@sheetxl/studio-mui 0.4.20 → 0.4.22

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 (98) hide show
  1. package/browser/cjs/2d2J6QkipnGWfI99.cjs +6 -0
  2. package/browser/cjs/BY09bxecVOSMwQA3.cjs +6 -0
  3. package/browser/cjs/BYJI3FMxQ-z5UGsU.cjs +6 -0
  4. package/browser/cjs/B_nvuo0kEXu5G0Gf.cjs +7 -0
  5. package/browser/cjs/BfnxiVEhzO5reOYH.cjs +42 -0
  6. package/browser/cjs/Bil3fXnJ3lk7aGF5.cjs +6 -0
  7. package/browser/cjs/{DItuuqkIamMzp7Im.cjs → BzbKSVugPof6dqQI.cjs} +1 -1
  8. package/browser/cjs/CU0utErelA1oX0n8.cjs +6 -0
  9. package/browser/cjs/CWp8_mrz0htdOXMM.cjs +20 -0
  10. package/browser/cjs/D2Cp7gwb6bRupSZY.cjs +6 -0
  11. package/browser/cjs/DC70SHoaPVkOUEHx.cjs +6 -0
  12. package/browser/cjs/DRUx3PLS_NrkJ6Yw.cjs +18 -0
  13. package/browser/cjs/index.cjs +2 -2
  14. package/browser/esm/-0XEuwqNVFTlDKEX.mjs +25 -0
  15. package/browser/esm/-AR3L_VjwMbtQVbL.mjs +62 -0
  16. package/browser/esm/BLhZj1SgWlsmeviw.mjs +4443 -0
  17. package/browser/esm/{BW3_mz5_8i9VLBYB.mjs → BXNl9EEQzO53Hoh5.mjs} +87 -85
  18. package/browser/esm/BqnVpwK0Q2fKGA2S.mjs +53 -0
  19. package/browser/esm/D4rFOqwrrtVMpgbc.mjs +49 -0
  20. package/browser/esm/DEbllEGmvtLkCug_.mjs +2156 -0
  21. package/browser/esm/{C60ZnLCvtztDLuoT.mjs → DXRFs7VZM4IShMju.mjs} +100 -98
  22. package/browser/esm/{C5xUbwpUPDeNua-i.mjs → DeGATuYv4-5bhQcD.mjs} +1 -1
  23. package/browser/esm/{5u-JEG1IfQBstjq0.mjs → EMqbYi0X_krk5yOL.mjs} +11 -10
  24. package/browser/esm/fWsCG2WBM3kCpC5p.mjs +46 -0
  25. package/browser/esm/index.mjs +29 -29
  26. package/browser/esm/{CxXpPYi4eOFhBNt2.mjs → pARZF2O230qNvxWd.mjs} +27 -26
  27. package/licenses/dependencies.txt +0 -271
  28. package/node/esm/{D6A_o47zvz5ITIJK.mjs → 0JTY0jNrXiIiOqWY.mjs} +79 -78
  29. package/node/esm/{Ds5dinNcyNdC8ta6.mjs → BqQ6JNhQ1K321g9U.mjs} +13 -11
  30. package/node/esm/{CrDbLKJh9omVo_TF.mjs → Bu58psaOsDy_zPOJ.mjs} +29 -28
  31. package/node/esm/BzBHqe1ThbCP-l_d.mjs +88 -0
  32. package/node/esm/CE_I2ijQF8MeexHD.mjs +63 -0
  33. package/node/esm/{Bv12-Yyv0C86Iquy.mjs → CuomeW-4DDc1ywFW.mjs} +7 -6
  34. package/node/esm/DRt8kMDuCJn53CIE.mjs +46 -0
  35. package/node/esm/{CH6p2H0CMCoz4NgJ.mjs → DgHCTCARk1Gv_msN.mjs} +23 -22
  36. package/node/esm/{Bn5TJPQAEMY-lGpF.mjs → Do7y7aKPA48-93AV.mjs} +4 -3
  37. package/node/esm/{rlqvGCJlj4a2UcSM.mjs → X11ONmg6R1Y6hfue.mjs} +11 -10
  38. package/node/esm/index.mjs +2381 -18514
  39. package/package.json +8 -8
  40. package/browser/cjs/-Z37a-mzY5SKXy--.cjs +0 -6
  41. package/browser/cjs/B384kb1_rsiCsdZG.cjs +0 -6
  42. package/browser/cjs/B8nWvy4zDv1CZsr_.cjs +0 -110
  43. package/browser/cjs/BBnMJiXp9lru0Rcq.cjs +0 -6
  44. package/browser/cjs/BFbHTu65n1oE-l0N.cjs +0 -6
  45. package/browser/cjs/BQMSHnQdWtqeakER.cjs +0 -6
  46. package/browser/cjs/BvjA0ybox6653eb5.cjs +0 -6
  47. package/browser/cjs/Cocgl4ghzWE9yVYS.cjs +0 -161
  48. package/browser/cjs/D21Q1NdM1zQ7uFlH.cjs +0 -6
  49. package/browser/cjs/D4LmaKqYiwjxp0Hs.cjs +0 -15
  50. package/browser/cjs/D6egUillMqBwTaEq.cjs +0 -6
  51. package/browser/cjs/D9lY6pd9tRxPeLKs.cjs +0 -18
  52. package/browser/cjs/DNqIYSqRYZkUpFxW.cjs +0 -7
  53. package/browser/cjs/DUImSlPsM-OipgBZ.cjs +0 -6
  54. package/browser/cjs/DUVLcBcwkTsuLb6q.cjs +0 -6
  55. package/browser/cjs/Db7IyKXFzo8IocDa.cjs +0 -145
  56. package/browser/cjs/DsHPj69dMFG09uD_.cjs +0 -16
  57. package/browser/cjs/DypblOPNMRx5Twgx.cjs +0 -12
  58. package/browser/cjs/QK7YNBstmN86K-xL.cjs +0 -6
  59. package/browser/cjs/VNWvn2kP6ZF0Snzw.cjs +0 -11
  60. package/browser/cjs/dc1YAArM3bSHvRcF.cjs +0 -7
  61. package/browser/cjs/mInXvB8P6r6q7pRY.cjs +0 -11
  62. package/browser/cjs/nop6N-Oi_LKy1Bpc.cjs +0 -42
  63. package/browser/cjs/s45oNHeIvJVeRjn5.cjs +0 -6
  64. package/browser/esm/1y10o01h14oGJtKG.mjs +0 -43
  65. package/browser/esm/BFpc8KBa-fb0nLSt.mjs +0 -46
  66. package/browser/esm/Bmjhrc6YMmfx_1Yi.mjs +0 -1703
  67. package/browser/esm/BnlJVFlQeWerd3KW.mjs +0 -3803
  68. package/browser/esm/BpuH_QvBidPOXgAR.mjs +0 -392
  69. package/browser/esm/CAiWSkkPRgUjk8CN.mjs +0 -424
  70. package/browser/esm/CW8taieVozHhyBOC.mjs +0 -1467
  71. package/browser/esm/CzyEerZmfWrW3i3U.mjs +0 -59
  72. package/browser/esm/D0FBHwm0Oz_wf0tR.mjs +0 -12
  73. package/browser/esm/DM9GPrZpbCcKOnyU.mjs +0 -1352
  74. package/browser/esm/DO1doKZhwYiL7vbF.mjs +0 -1672
  75. package/browser/esm/DS3anstzAV3EJBRw.mjs +0 -84
  76. package/browser/esm/DuEmdSQsXlkCWZIB.mjs +0 -1366
  77. package/browser/esm/FvK-pQsicRjtrKoS.mjs +0 -48
  78. package/browser/esm/KCTJzQeDChqf1yBO.mjs +0 -52
  79. package/browser/esm/P-3pIbidOtRCNsw3.mjs +0 -23
  80. package/browser/esm/W3EFMOPLR1aNXWvF.mjs +0 -2250
  81. package/browser/esm/Z_Sh-N3xHHWLCbEw.mjs +0 -23412
  82. package/browser/esm/mOmzoYDWAtgYndCA.mjs +0 -13391
  83. package/browser/esm/tnJECoiQzUzgUQZE.mjs +0 -44
  84. package/node/esm/54SjtcD6mOreKcCy.mjs +0 -1719
  85. package/node/esm/B2BlMiDOVpIp1FDQ.mjs +0 -1706
  86. package/node/esm/BNEvR1srnnwBgnrF.mjs +0 -1479
  87. package/node/esm/BZ20_F64yjZgn-_G.mjs +0 -1246
  88. package/node/esm/BfzRLuswtxg9uDsX.mjs +0 -78
  89. package/node/esm/C0ZBbkFa-24tJTnw.mjs +0 -60
  90. package/node/esm/CEVO60fX3MAPG0Hg.mjs +0 -1378
  91. package/node/esm/CdFmhVFplZFgBvTo.mjs +0 -44
  92. package/node/esm/Cx4mn0YEVkG-M1VL.mjs +0 -553
  93. package/node/esm/DDWek3aquTe_okr_.mjs +0 -392
  94. package/node/esm/DSLWcwr4qgHARs36.mjs +0 -13464
  95. package/node/esm/iXG86MN0JrtJkpqe.mjs +0 -44
  96. package/node/esm/m2teXjBzZLfLDFPx.mjs +0 -46
  97. package/node/esm/oykDy4erHC0NNHHq.mjs +0 -3776
  98. package/node/esm/sVOd1y3oNBREsKJ7.mjs +0 -86
@@ -1,1479 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.20
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { NumberFormat as t, ScalarType as e, ResourceCollection as s, Tuple as i, IAutoFilter as o, AddressUtils as r, CommonUtils as n, Theme as a, JSONStableStringify as l, Workbook as c, IColor as h, CoordUtils as u, IRange as d, OutOfBoundsError as p, FormulaError as g } from "@sheetxl/sdk";
8
- import { Y as f } from "./index.mjs";
9
- const m = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", T = new RegExp(`^[${m}][-${m}.0-9·̀-ͯ‿-⁀]*$`, "u");
10
- function y(t2) {
11
- return t2 >= 65 && t2 <= 90 || t2 >= 97 && t2 <= 122 || 58 === t2 || 95 === t2 || 8204 === t2 || 8205 === t2 || t2 >= 192 && t2 <= 214 || t2 >= 216 && t2 <= 246 || t2 >= 248 && t2 <= 767 || t2 >= 880 && t2 <= 893 || t2 >= 895 && t2 <= 8191 || t2 >= 8304 && t2 <= 8591 || t2 >= 11264 && t2 <= 12271 || t2 >= 12289 && t2 <= 55295 || t2 >= 63744 && t2 <= 64975 || t2 >= 65008 && t2 <= 65533 || t2 >= 65536 && t2 <= 983039;
12
- }
13
- const b = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", x = new RegExp(`^[${b}][-${b}.0-9·̀-ͯ‿-⁀]*$`, "u");
14
- function w(t2) {
15
- return t2 >= 65 && t2 <= 90 || 95 === t2 || t2 >= 97 && t2 <= 122 || t2 >= 192 && t2 <= 214 || t2 >= 216 && t2 <= 246 || t2 >= 248 && t2 <= 767 || t2 >= 880 && t2 <= 893 || t2 >= 895 && t2 <= 8191 || t2 >= 8204 && t2 <= 8205 || t2 >= 8304 && t2 <= 8591 || t2 >= 11264 && t2 <= 12271 || t2 >= 12289 && t2 <= 55295 || t2 >= 63744 && t2 <= 64975 || t2 >= 65008 && t2 <= 65533 || t2 >= 65536 && t2 <= 983039;
16
- }
17
- const v = function(t2) {
18
- return 32 === t2 || 10 === t2 || 13 === t2 || 9 === t2;
19
- }, S = function(t2) {
20
- return t2 >= 32 && t2 <= 55295 || 10 === t2 || 13 === t2 || 9 === t2 || t2 >= 57344 && t2 <= 65533 || t2 >= 65536 && t2 <= 1114111;
21
- }, C = y, k = function(t2) {
22
- return y(t2) || t2 >= 48 && t2 <= 57 || 45 === t2 || 46 === t2 || 183 === t2 || t2 >= 768 && t2 <= 879 || t2 >= 8255 && t2 <= 8256;
23
- }, A = [32, 10, 13, 9], D = T, E = function(t2) {
24
- return t2 >= 1 && t2 <= 55295 || t2 >= 57344 && t2 <= 65533 || t2 >= 65536 && t2 <= 1114111;
25
- }, P = w, O = function(t2) {
26
- return w(t2) || 45 === t2 || 46 === t2 || t2 >= 48 && t2 <= 57 || 183 === t2 || t2 >= 768 && t2 <= 879 || t2 >= 8255 && t2 <= 8256;
27
- }, I = x, V = "http://www.w3.org/XML/1998/namespace", L = "http://www.w3.org/2000/xmlns/", N = { __proto__: null, xml: V, xmlns: L }, R = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, $ = -1, M = -2, j = 13, H = 33, F = 10, X = 60, B = 61, W = 62, _ = 63, q = 93, z = (t2) => 34 === t2 || 39 === t2, U = [34, 39], G = [...U, 91, W], Z = [...U, X, q], Q = [B, _, ...A], J = [...A, W, 38, X];
28
- function K(t2, e2, s2) {
29
- switch (e2) {
30
- case "xml":
31
- s2 !== V && t2.fail(`xml prefix must be bound to ${V}.`);
32
- break;
33
- case "xmlns":
34
- s2 !== L && t2.fail(`xmlns prefix must be bound to ${L}.`);
35
- }
36
- switch (s2) {
37
- case L:
38
- t2.fail("" === e2 ? `the default namespace may not be set to ${s2}.` : `may not assign a prefix (even "xmlns") to the URI ${L}.`);
39
- break;
40
- case V:
41
- switch (e2) {
42
- case "xml":
43
- break;
44
- case "":
45
- t2.fail(`the default namespace may not be set to ${s2}.`);
46
- break;
47
- default:
48
- t2.fail("may not assign the xml namespace to another prefix.");
49
- }
50
- }
51
- }
52
- const Y = (t2) => I.test(t2), tt = (t2) => D.test(t2), et = { 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" };
53
- class st {
54
- constructor(t2) {
55
- this.i = 0, this.prevI = 0, this.opt = t2 ?? {}, this.fragmentOpt = !!this.opt.fragment;
56
- const e2 = this.xmlnsOpt = !!this.opt.xmlns;
57
- if (this.trackPosition = false !== this.opt.position, this.fileName = this.opt.fileName, e2) {
58
- this.nameStartCheck = P, this.nameCheck = O, this.isName = Y, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = { __proto__: null, ...N };
59
- const t3 = this.opt.additionalNamespaces;
60
- null != t3 && (function(t4, e3) {
61
- for (const s2 of Object.keys(e3)) K(t4, s2, e3[s2]);
62
- }(this, t3), Object.assign(this.ns, t3));
63
- } else this.nameStartCheck = C, this.nameCheck = k, this.isName = tt, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
64
- 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();
65
- }
66
- get closed() {
67
- return this._closed;
68
- }
69
- _init() {
70
- 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 = [];
71
- const { fragmentOpt: t2 } = this;
72
- this.state = t2 ? j : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t2, this.xmlDeclPossible = !t2, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
73
- let { defaultXMLVersion: e2 } = this.opt;
74
- if (void 0 === e2) {
75
- if (true === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
76
- e2 = "1.0";
77
- }
78
- this.setXMLVersion(e2), this.positionAtNewLine = 0, this.doctype = false, this._closed = false, this.xmlDecl = { version: void 0, encoding: void 0, standalone: void 0 }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(R), this.readyHandler?.();
79
- }
80
- get position() {
81
- return this.chunkPosition + this.i;
82
- }
83
- get columnIndex() {
84
- return this.position - this.positionAtNewLine;
85
- }
86
- on(t2, e2) {
87
- this[et[t2]] = e2;
88
- }
89
- off(t2) {
90
- this[et[t2]] = void 0;
91
- }
92
- makeError(t2) {
93
- let e2 = this.fileName ?? "";
94
- return this.trackPosition && (e2.length > 0 && (e2 += ":"), e2 += `${this.line}:${this.column}`), e2.length > 0 && (e2 += ": "), new Error(e2 + t2);
95
- }
96
- fail(t2) {
97
- const e2 = this.makeError(t2), s2 = this.errorHandler;
98
- if (void 0 === s2) throw e2;
99
- return s2(e2), this;
100
- }
101
- write(t2) {
102
- if (this.closed) return this.fail("cannot write after close; assign an onready handler.");
103
- let e2 = false;
104
- null === t2 ? (e2 = true, t2 = "") : "object" == typeof t2 && (t2 = t2.toString()), void 0 !== this.carriedFromPrevious && (t2 = `${this.carriedFromPrevious}${t2}`, this.carriedFromPrevious = void 0);
105
- let s2 = t2.length;
106
- const i2 = t2.charCodeAt(s2 - 1);
107
- !e2 && (13 === i2 || i2 >= 55296 && i2 <= 56319) && (this.carriedFromPrevious = t2[s2 - 1], s2--, t2 = t2.slice(0, s2));
108
- const { stateTable: o2 } = this;
109
- for (this.chunk = t2, this.i = 0; this.i < s2; ) o2[this.state].call(this);
110
- return this.chunkPosition += s2, e2 ? this.end() : this;
111
- }
112
- close() {
113
- return this.write(null);
114
- }
115
- getCode10() {
116
- const t2 = this.chunk, e2 = this.i;
117
- if (this.prevI = e2, this.i++, e2 >= t2.length) return $;
118
- const s2 = t2.charCodeAt(e2);
119
- if (this.column++, s2 < 55296) {
120
- if (s2 >= 32 || 9 === s2) return s2;
121
- switch (s2) {
122
- case F:
123
- return this.line++, this.column = 0, this.positionAtNewLine = this.position, F;
124
- case 13:
125
- return t2.charCodeAt(e2 + 1) === F && (this.i = e2 + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, M;
126
- default:
127
- return this.fail("disallowed character."), s2;
128
- }
129
- }
130
- if (s2 > 56319) return s2 >= 57344 && s2 <= 65533 || this.fail("disallowed character."), s2;
131
- const i2 = 65536 + 1024 * (s2 - 55296) + (t2.charCodeAt(e2 + 1) - 56320);
132
- return this.i = e2 + 2, i2 > 1114111 && this.fail("disallowed character."), i2;
133
- }
134
- getCode11() {
135
- const { chunk: t2, i: e2 } = this;
136
- if (this.prevI = e2, this.i = e2 + 1, e2 >= t2.length) return $;
137
- const s2 = t2.charCodeAt(e2);
138
- if (this.column++, s2 < 55296) {
139
- if (s2 > 31 && s2 < 127 || s2 > 159 && 8232 !== s2 || 9 === s2) return s2;
140
- switch (s2) {
141
- case F:
142
- return this.line++, this.column = 0, this.positionAtNewLine = this.position, F;
143
- case 13: {
144
- const s3 = t2.charCodeAt(e2 + 1);
145
- s3 !== F && 133 !== s3 || (this.i = e2 + 2);
146
- }
147
- case 133:
148
- case 8232:
149
- return this.line++, this.column = 0, this.positionAtNewLine = this.position, M;
150
- default:
151
- return this.fail("disallowed character."), s2;
152
- }
153
- }
154
- if (s2 > 56319) return s2 >= 57344 && s2 <= 65533 || this.fail("disallowed character."), s2;
155
- const i2 = 65536 + 1024 * (s2 - 55296) + (t2.charCodeAt(e2 + 1) - 56320);
156
- return this.i = e2 + 2, i2 > 1114111 && this.fail("disallowed character."), i2;
157
- }
158
- getCodeNorm() {
159
- const t2 = this.getCode();
160
- return t2 === M ? F : t2;
161
- }
162
- unget() {
163
- this.i = this.prevI, this.column--;
164
- }
165
- captureTo(t2) {
166
- let { i: e2 } = this;
167
- const { chunk: s2 } = this;
168
- for (; ; ) {
169
- const i2 = this.getCode(), o2 = i2 === M, r2 = o2 ? F : i2;
170
- if (r2 === $ || t2.includes(r2)) return this.text += s2.slice(e2, this.prevI), r2;
171
- o2 && (this.text += `${s2.slice(e2, this.prevI)}
172
- `, e2 = this.i);
173
- }
174
- }
175
- captureToChar(t2) {
176
- let { i: e2 } = this;
177
- const { chunk: s2 } = this;
178
- for (; ; ) {
179
- let i2 = this.getCode();
180
- switch (i2) {
181
- case M:
182
- this.text += `${s2.slice(e2, this.prevI)}
183
- `, e2 = this.i, i2 = F;
184
- break;
185
- case $:
186
- return this.text += s2.slice(e2), false;
187
- }
188
- if (i2 === t2) return this.text += s2.slice(e2, this.prevI), true;
189
- }
190
- }
191
- captureNameChars() {
192
- const { chunk: t2, i: e2 } = this;
193
- for (; ; ) {
194
- const s2 = this.getCode();
195
- if (s2 === $) return this.name += t2.slice(e2), $;
196
- if (!k(s2)) return this.name += t2.slice(e2, this.prevI), s2 === M ? F : s2;
197
- }
198
- }
199
- skipSpaces() {
200
- for (; ; ) {
201
- const t2 = this.getCodeNorm();
202
- if (t2 === $ || !v(t2)) return t2;
203
- }
204
- }
205
- setXMLVersion(t2) {
206
- this.currentXMLVersion = t2, "1.0" === t2 ? (this.isChar = S, this.getCode = this.getCode10) : (this.isChar = E, this.getCode = this.getCode11);
207
- }
208
- sBegin() {
209
- 65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
210
- }
211
- sBeginWhitespace() {
212
- const t2 = this.i, e2 = this.skipSpaces();
213
- switch (this.prevI !== t2 && (this.xmlDeclPossible = false), e2) {
214
- case X:
215
- if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
216
- break;
217
- case $:
218
- break;
219
- default:
220
- this.unget(), this.state = j, this.xmlDeclPossible = false;
221
- }
222
- }
223
- sDoctype() {
224
- const t2 = this.captureTo(G);
225
- switch (t2) {
226
- case W:
227
- this.doctypeHandler?.(this.text), this.text = "", this.state = j, this.doctype = true;
228
- break;
229
- case $:
230
- break;
231
- default:
232
- this.text += String.fromCodePoint(t2), 91 === t2 ? this.state = 4 : z(t2) && (this.state = 3, this.q = t2);
233
- }
234
- }
235
- sDoctypeQuote() {
236
- const t2 = this.q;
237
- this.captureToChar(t2) && (this.text += String.fromCodePoint(t2), this.q = null, this.state = 2);
238
- }
239
- sDTD() {
240
- const t2 = this.captureTo(Z);
241
- t2 !== $ && (this.text += String.fromCodePoint(t2), t2 === q ? this.state = 2 : t2 === X ? this.state = 6 : z(t2) && (this.state = 5, this.q = t2));
242
- }
243
- sDTDQuoted() {
244
- const t2 = this.q;
245
- this.captureToChar(t2) && (this.text += String.fromCodePoint(t2), this.state = 4, this.q = null);
246
- }
247
- sDTDOpenWaka() {
248
- const t2 = this.getCodeNorm();
249
- switch (this.text += String.fromCodePoint(t2), t2) {
250
- case 33:
251
- this.state = 7, this.openWakaBang = "";
252
- break;
253
- case _:
254
- this.state = 11;
255
- break;
256
- default:
257
- this.state = 4;
258
- }
259
- }
260
- sDTDOpenWakaBang() {
261
- const t2 = String.fromCodePoint(this.getCodeNorm()), e2 = this.openWakaBang += t2;
262
- this.text += t2, "-" !== e2 && (this.state = "--" === e2 ? 8 : 4, this.openWakaBang = "");
263
- }
264
- sDTDComment() {
265
- this.captureToChar(45) && (this.text += "-", this.state = 9);
266
- }
267
- sDTDCommentEnding() {
268
- const t2 = this.getCodeNorm();
269
- this.text += String.fromCodePoint(t2), this.state = 45 === t2 ? 10 : 8;
270
- }
271
- sDTDCommentEnded() {
272
- const t2 = this.getCodeNorm();
273
- this.text += String.fromCodePoint(t2), t2 === W ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
274
- }
275
- sDTDPI() {
276
- this.captureToChar(_) && (this.text += "?", this.state = 12);
277
- }
278
- sDTDPIEnding() {
279
- const t2 = this.getCodeNorm();
280
- this.text += String.fromCodePoint(t2), t2 === W && (this.state = 4);
281
- }
282
- sText() {
283
- 0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
284
- }
285
- sEntity() {
286
- let { i: t2 } = this;
287
- const { chunk: e2 } = this;
288
- t: for (; ; ) switch (this.getCode()) {
289
- case M:
290
- this.entity += `${e2.slice(t2, this.prevI)}
291
- `, t2 = this.i;
292
- break;
293
- case 59: {
294
- const { entityReturnState: s2 } = this, i2 = this.entity + e2.slice(t2, this.prevI);
295
- let o2;
296
- this.state = s2, "" === i2 ? (this.fail("empty entity name."), o2 = "&;") : (o2 = this.parseEntity(i2), this.entity = ""), s2 === j && void 0 === this.textHandler || (this.text += o2);
297
- break t;
298
- }
299
- case $:
300
- this.entity += e2.slice(t2);
301
- break t;
302
- }
303
- }
304
- sOpenWaka() {
305
- const t2 = this.getCode();
306
- if (C(t2)) this.state = 34, this.unget(), this.xmlDeclPossible = false;
307
- else switch (t2) {
308
- case 47:
309
- this.state = 43, this.xmlDeclPossible = false;
310
- break;
311
- case 33:
312
- this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = false;
313
- break;
314
- case _:
315
- this.state = 23;
316
- break;
317
- default:
318
- this.fail("disallowed character in tag name"), this.state = j, this.xmlDeclPossible = false;
319
- }
320
- }
321
- sOpenWakaBang() {
322
- switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
323
- case "[CDATA[":
324
- this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = true), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = true), this.state = 20, this.openWakaBang = "";
325
- break;
326
- case "--":
327
- this.state = 17, this.openWakaBang = "";
328
- break;
329
- case "DOCTYPE":
330
- this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
331
- break;
332
- default:
333
- this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
334
- }
335
- }
336
- sComment() {
337
- this.captureToChar(45) && (this.state = 18);
338
- }
339
- sCommentEnding() {
340
- const t2 = this.getCodeNorm();
341
- 45 === t2 ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t2)}`, this.state = 17);
342
- }
343
- sCommentEnded() {
344
- const t2 = this.getCodeNorm();
345
- t2 !== W ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t2)}`, this.state = 17) : this.state = j;
346
- }
347
- sCData() {
348
- this.captureToChar(q) && (this.state = 21);
349
- }
350
- sCDataEnding() {
351
- const t2 = this.getCodeNorm();
352
- t2 === q ? this.state = 22 : (this.text += `]${String.fromCodePoint(t2)}`, this.state = 20);
353
- }
354
- sCDataEnding2() {
355
- const t2 = this.getCodeNorm();
356
- switch (t2) {
357
- case W:
358
- this.cdataHandler?.(this.text), this.text = "", this.state = j;
359
- break;
360
- case q:
361
- this.text += "]";
362
- break;
363
- default:
364
- this.text += `]]${String.fromCodePoint(t2)}`, this.state = 20;
365
- }
366
- }
367
- sPIFirstChar() {
368
- const t2 = this.getCodeNorm();
369
- this.nameStartCheck(t2) ? (this.piTarget += String.fromCodePoint(t2), this.state = 24) : t2 === _ || v(t2) ? (this.fail("processing instruction without a target."), this.state = t2 === _ ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t2), this.state = 24);
370
- }
371
- sPIRest() {
372
- const { chunk: t2, i: e2 } = this;
373
- for (; ; ) {
374
- const s2 = this.getCodeNorm();
375
- if (s2 === $) return void (this.piTarget += t2.slice(e2));
376
- if (!this.nameCheck(s2)) {
377
- this.piTarget += t2.slice(e2, this.prevI);
378
- const i2 = s2 === _;
379
- i2 || v(s2) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = i2 ? H : 27) : this.state = i2 ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s2));
380
- break;
381
- }
382
- }
383
- }
384
- sPIBody() {
385
- if (0 === this.text.length) {
386
- const t2 = this.getCodeNorm();
387
- t2 === _ ? this.state = 26 : v(t2) || (this.text = String.fromCodePoint(t2));
388
- } else this.captureToChar(_) && (this.state = 26);
389
- }
390
- sPIEnding() {
391
- const t2 = this.getCodeNorm();
392
- if (t2 === W) {
393
- const { piTarget: t3 } = this;
394
- "xml" === t3.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({ target: t3, body: this.text }), this.piTarget = this.text = "", this.state = j;
395
- } else t2 === _ ? this.text += "?" : (this.text += `?${String.fromCodePoint(t2)}`, this.state = 25);
396
- this.xmlDeclPossible = false;
397
- }
398
- sXMLDeclNameStart() {
399
- const t2 = this.skipSpaces();
400
- t2 !== _ ? t2 !== $ && (this.state = 28, this.name = String.fromCodePoint(t2)) : this.state = H;
401
- }
402
- sXMLDeclName() {
403
- const t2 = this.captureTo(Q);
404
- if (t2 === _) return this.state = H, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
405
- if (v(t2) || t2 === B) {
406
- if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
407
- case 0:
408
- this.fail("did not expect any more name/value pairs.");
409
- break;
410
- case 1:
411
- this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
412
- break;
413
- default:
414
- this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
415
- }
416
- this.state = t2 === B ? 30 : 29;
417
- }
418
- }
419
- sXMLDeclEq() {
420
- const t2 = this.getCodeNorm();
421
- if (t2 === _) return this.state = H, void this.fail("XML declaration is incomplete.");
422
- v(t2) || (t2 !== B && this.fail("value required."), this.state = 30);
423
- }
424
- sXMLDeclValueStart() {
425
- const t2 = this.getCodeNorm();
426
- if (t2 === _) return this.state = H, void this.fail("XML declaration is incomplete.");
427
- v(t2) || (z(t2) ? this.q = t2 : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
428
- }
429
- sXMLDeclValue() {
430
- const t2 = this.captureTo([this.q, _]);
431
- if (t2 === _) return this.state = H, this.text = "", void this.fail("XML declaration is incomplete.");
432
- if (t2 === $) return;
433
- const e2 = this.text;
434
- switch (this.text = "", this.name) {
435
- case "version": {
436
- this.xmlDeclExpects = ["encoding", "standalone"];
437
- const t3 = e2;
438
- this.xmlDecl.version = t3, /^1\.[0-9]+$/.test(t3) ? this.opt.forceXMLVersion || this.setXMLVersion(t3) : this.fail("version number must match /^1\\.[0-9]+$/.");
439
- break;
440
- }
441
- case "encoding":
442
- /^[A-Za-z][A-Za-z0-9._-]*$/.test(e2) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = e2;
443
- break;
444
- case "standalone":
445
- "yes" !== e2 && "no" !== e2 && this.fail('standalone value must match "yes" or "no".'), this.xmlDeclExpects = [], this.xmlDecl.standalone = e2;
446
- }
447
- this.name = "", this.state = 32;
448
- }
449
- sXMLDeclSeparator() {
450
- const t2 = this.getCodeNorm();
451
- t2 !== _ ? (v(t2) || (this.fail("whitespace required."), this.unget()), this.state = 27) : this.state = H;
452
- }
453
- sXMLDeclEnding() {
454
- this.getCodeNorm() === W ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmldeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = j) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = false;
455
- }
456
- sOpenTag() {
457
- const t2 = this.captureNameChars();
458
- if (t2 === $) return;
459
- const e2 = this.tag = { name: this.name, attributes: /* @__PURE__ */ Object.create(null) };
460
- switch (this.name = "", this.xmlnsOpt && (this.topNS = e2.ns = /* @__PURE__ */ Object.create(null)), this.openTagStartHandler?.(e2), this.sawRoot = true, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t2) {
461
- case W:
462
- this.openTag();
463
- break;
464
- case 47:
465
- this.state = 35;
466
- break;
467
- default:
468
- v(t2) || this.fail("disallowed character in tag name."), this.state = 36;
469
- }
470
- }
471
- sOpenTagSlash() {
472
- this.getCode() === W ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
473
- }
474
- sAttrib() {
475
- const t2 = this.skipSpaces();
476
- t2 !== $ && (C(t2) ? (this.unget(), this.state = 37) : t2 === W ? this.openTag() : 47 === t2 ? this.state = 35 : this.fail("disallowed character in attribute name."));
477
- }
478
- sAttribName() {
479
- const t2 = this.captureNameChars();
480
- t2 === B ? this.state = 39 : v(t2) ? this.state = 38 : t2 === W ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t2 !== $ && this.fail("disallowed character in attribute name.");
481
- }
482
- sAttribNameSawWhite() {
483
- const t2 = this.skipSpaces();
484
- switch (t2) {
485
- case $:
486
- return;
487
- case B:
488
- this.state = 39;
489
- break;
490
- default:
491
- this.fail("attribute without value."), this.text = "", this.name = "", t2 === W ? this.openTag() : C(t2) ? (this.unget(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
492
- }
493
- }
494
- sAttribValue() {
495
- const t2 = this.getCodeNorm();
496
- z(t2) ? (this.q = t2, this.state = 40) : v(t2) || (this.fail("unquoted attribute value."), this.state = 42, this.unget());
497
- }
498
- sAttribValueQuoted() {
499
- const { q: t2, chunk: e2 } = this;
500
- let { i: s2 } = this;
501
- for (; ; ) switch (this.getCode()) {
502
- case t2:
503
- return this.pushAttrib(this.name, this.text + e2.slice(s2, this.prevI)), this.name = this.text = "", this.q = null, void (this.state = 41);
504
- case 38:
505
- return this.text += e2.slice(s2, this.prevI), this.state = 14, void (this.entityReturnState = 40);
506
- case F:
507
- case M:
508
- case 9:
509
- this.text += `${e2.slice(s2, this.prevI)} `, s2 = this.i;
510
- break;
511
- case X:
512
- return this.text += e2.slice(s2, this.prevI), void this.fail("disallowed character.");
513
- case $:
514
- return void (this.text += e2.slice(s2));
515
- }
516
- }
517
- sAttribValueClosed() {
518
- const t2 = this.getCodeNorm();
519
- v(t2) ? this.state = 36 : t2 === W ? this.openTag() : 47 === t2 ? this.state = 35 : C(t2) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = 37) : this.fail("disallowed character in attribute name.");
520
- }
521
- sAttribValueUnquoted() {
522
- const t2 = this.captureTo(J);
523
- switch (t2) {
524
- case 38:
525
- this.state = 14, this.entityReturnState = 42;
526
- break;
527
- case X:
528
- this.fail("disallowed character.");
529
- break;
530
- case $:
531
- break;
532
- default:
533
- this.text.includes("]]>") && this.fail('the string "]]>" is disallowed in char data.'), this.pushAttrib(this.name, this.text), this.name = this.text = "", t2 === W ? this.openTag() : this.state = 36;
534
- }
535
- }
536
- sCloseTag() {
537
- const t2 = this.captureNameChars();
538
- t2 === W ? this.closeTag() : v(t2) ? this.state = 44 : t2 !== $ && this.fail("disallowed character in closing tag.");
539
- }
540
- sCloseTagSawWhite() {
541
- switch (this.skipSpaces()) {
542
- case W:
543
- this.closeTag();
544
- break;
545
- case $:
546
- break;
547
- default:
548
- this.fail("disallowed character in closing tag.");
549
- }
550
- }
551
- handleTextInRoot() {
552
- let { i: t2, forbiddenState: e2 } = this;
553
- const { chunk: s2, textHandler: i2 } = this;
554
- t: for (; ; ) switch (this.getCode()) {
555
- case X:
556
- if (this.state = 15, void 0 !== i2) {
557
- const { text: e3 } = this, o2 = s2.slice(t2, this.prevI);
558
- 0 !== e3.length ? (i2(e3 + o2), this.text = "") : 0 !== o2.length && i2(o2);
559
- }
560
- e2 = 0;
561
- break t;
562
- case 38:
563
- this.state = 14, this.entityReturnState = j, void 0 !== i2 && (this.text += s2.slice(t2, this.prevI)), e2 = 0;
564
- break t;
565
- case q:
566
- switch (e2) {
567
- case 0:
568
- e2 = 1;
569
- break;
570
- case 1:
571
- e2 = 2;
572
- break;
573
- case 2:
574
- break;
575
- default:
576
- throw new Error("impossible state");
577
- }
578
- break;
579
- case W:
580
- 2 === e2 && this.fail('the string "]]>" is disallowed in char data.'), e2 = 0;
581
- break;
582
- case M:
583
- void 0 !== i2 && (this.text += `${s2.slice(t2, this.prevI)}
584
- `), t2 = this.i, e2 = 0;
585
- break;
586
- case $:
587
- void 0 !== i2 && (this.text += s2.slice(t2));
588
- break t;
589
- default:
590
- e2 = 0;
591
- }
592
- this.forbiddenState = e2;
593
- }
594
- handleTextOutsideRoot() {
595
- let { i: t2 } = this;
596
- const { chunk: e2, textHandler: s2 } = this;
597
- let i2 = false;
598
- t: for (; ; ) {
599
- const o2 = this.getCode();
600
- switch (o2) {
601
- case X:
602
- if (this.state = 15, void 0 !== s2) {
603
- const { text: i3 } = this, o3 = e2.slice(t2, this.prevI);
604
- 0 !== i3.length ? (s2(i3 + o3), this.text = "") : 0 !== o3.length && s2(o3);
605
- }
606
- break t;
607
- case 38:
608
- this.state = 14, this.entityReturnState = j, void 0 !== s2 && (this.text += e2.slice(t2, this.prevI)), i2 = true;
609
- break t;
610
- case M:
611
- void 0 !== s2 && (this.text += `${e2.slice(t2, this.prevI)}
612
- `), t2 = this.i;
613
- break;
614
- case $:
615
- void 0 !== s2 && (this.text += e2.slice(t2));
616
- break t;
617
- default:
618
- v(o2) || (i2 = true);
619
- }
620
- }
621
- i2 && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = true), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = true));
622
- }
623
- pushAttribNS(t2, e2) {
624
- const { prefix: s2, local: i2 } = this.qname(t2), o2 = { name: t2, prefix: s2, local: i2, value: e2 };
625
- if (this.attribList.push(o2), this.attributeHandler?.(o2), "xmlns" === s2) {
626
- const t3 = e2.trim();
627
- "1.0" === this.currentXMLVersion && "" === t3 && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[i2] = t3, K(this, i2, t3);
628
- } else if ("xmlns" === t2) {
629
- const t3 = e2.trim();
630
- this.topNS[""] = t3, K(this, "", t3);
631
- }
632
- }
633
- pushAttribPlain(t2, e2) {
634
- const s2 = { name: t2, value: e2 };
635
- this.attribList.push(s2), this.attributeHandler?.(s2);
636
- }
637
- end() {
638
- this.sawRoot || this.fail("document must contain a root element.");
639
- const { tags: t2 } = this;
640
- for (; t2.length > 0; ) {
641
- const e3 = t2.pop();
642
- this.fail(`unclosed tag: ${e3.name}`);
643
- }
644
- 0 !== this.state && this.state !== j && this.fail("unexpected end.");
645
- const { text: e2 } = this;
646
- return 0 !== e2.length && (this.textHandler?.(e2), this.text = ""), this._closed = true, this.endHandler?.(), this._init(), this;
647
- }
648
- resolve(t2) {
649
- let e2 = this.topNS[t2];
650
- if (void 0 !== e2) return e2;
651
- const { tags: s2 } = this;
652
- for (let i2 = s2.length - 1; i2 >= 0; i2--) if (e2 = s2[i2].ns[t2], void 0 !== e2) return e2;
653
- return e2 = this.ns[t2], void 0 !== e2 ? e2 : this.opt.resolvePrefix?.(t2);
654
- }
655
- qname(t2) {
656
- const e2 = t2.indexOf(":");
657
- if (-1 === e2) return { prefix: "", local: t2 };
658
- const s2 = t2.slice(e2 + 1), i2 = t2.slice(0, e2);
659
- return ("" === i2 || "" === s2 || s2.includes(":")) && this.fail(`malformed name: ${t2}.`), { prefix: i2, local: s2 };
660
- }
661
- processAttribsNS() {
662
- const { attribList: t2 } = this, e2 = this.tag;
663
- {
664
- const { prefix: t3, local: s3 } = this.qname(e2.name);
665
- e2.prefix = t3, e2.local = s3;
666
- const i3 = e2.uri = this.resolve(t3) ?? "";
667
- "" !== t3 && ("xmlns" === t3 && this.fail('tags may not have "xmlns" as prefix.'), "" === i3 && (this.fail(`unbound namespace prefix: ${JSON.stringify(t3)}.`), e2.uri = t3));
668
- }
669
- if (0 === t2.length) return;
670
- const { attributes: s2 } = e2, i2 = /* @__PURE__ */ new Set();
671
- for (const e3 of t2) {
672
- const { name: t3, prefix: o2, local: r2 } = e3;
673
- let n2, a2;
674
- "" === o2 ? (n2 = "xmlns" === t3 ? L : "", a2 = t3) : (n2 = this.resolve(o2), void 0 === n2 && (this.fail(`unbound namespace prefix: ${JSON.stringify(o2)}.`), n2 = o2), a2 = `{${n2}}${r2}`), i2.has(a2) && this.fail(`duplicate attribute: ${a2}.`), i2.add(a2), e3.uri = n2, s2[t3] = e3;
675
- }
676
- this.attribList = [];
677
- }
678
- processAttribsPlain() {
679
- const { attribList: t2 } = this, e2 = this.tag.attributes;
680
- for (const { name: s2, value: i2 } of t2) void 0 !== e2[s2] && this.fail(`duplicate attribute: ${s2}.`), e2[s2] = i2;
681
- this.attribList = [];
682
- }
683
- openTag() {
684
- this.processAttribs();
685
- const { tags: t2 } = this, e2 = this.tag;
686
- e2.isSelfClosing = false, this.openTagHandler?.(e2), t2.push(e2), this.state = j, this.name = "";
687
- }
688
- openSelfClosingTag() {
689
- this.processAttribs();
690
- const { tags: t2 } = this, e2 = this.tag;
691
- e2.isSelfClosing = true, this.openTagHandler?.(e2), this.closeTagHandler?.(e2), null === (this.tag = t2[t2.length - 1] ?? null) && (this.closedRoot = true), this.state = j, this.name = "";
692
- }
693
- closeTag() {
694
- const { tags: t2, name: e2 } = this;
695
- if (this.state = j, this.name = "", "" === e2) return this.fail("weird empty close tag."), void (this.text += "</>");
696
- const s2 = this.closeTagHandler;
697
- let i2 = t2.length;
698
- for (; i2-- > 0; ) {
699
- const i3 = this.tag = t2.pop();
700
- if (this.topNS = i3.ns, s2?.(i3), i3.name === e2) break;
701
- this.fail("unexpected close tag.");
702
- }
703
- 0 === i2 ? this.closedRoot = true : i2 < 0 && (this.fail(`unmatched closing tag: ${e2}.`), this.text += `</${e2}>`);
704
- }
705
- parseEntity(t2) {
706
- if ("#" !== t2[0]) {
707
- const e3 = this.ENTITIES[t2];
708
- return void 0 !== e3 ? e3 : (this.fail(this.isName(t2) ? "undefined entity." : "disallowed character in entity name."), `&${t2};`);
709
- }
710
- let e2 = NaN;
711
- return "x" === t2[1] && /^#x[0-9a-f]+$/i.test(t2) ? e2 = parseInt(t2.slice(2), 16) : /^#[0-9]+$/.test(t2) && (e2 = parseInt(t2.slice(1), 10)), this.isChar(e2) ? String.fromCodePoint(e2) : (this.fail("malformed character entity."), `&${t2};`);
712
- }
713
- }
714
- var it, ot;
715
- (ot = it || (it = {})).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" }, ot.parseStream = async (t2, e2, s2) => {
716
- const i2 = new st({ position: false, ...s2 });
717
- let o2;
718
- if (e2.onOpenTagStart && i2.on(ot.Events.OpenTagStart, e2.onOpenTagStart), e2.onOpenTag && i2.on(ot.Events.OpenTag, e2.onOpenTag), e2.onCloseTag && i2.on(ot.Events.CloseTag, e2.onCloseTag), e2.onAttribute && i2.on(ot.Events.Attribute, e2.onAttribute), e2.onText && i2.on(ot.Events.Text, e2.onText), e2.onError && i2.on(ot.Events.Error, e2.onError), e2.onEnd) {
719
- e2.onEnd;
720
- const t3 = () => {
721
- o2 = e2.onEnd();
722
- };
723
- i2.on(ot.Events.End, t3);
724
- }
725
- for (; ; ) {
726
- const { value: e3, done: s3 } = await t2.read();
727
- if (s3) break;
728
- i2.write(e3);
729
- }
730
- return i2.close(), o2;
731
- };
732
- const rt = (t2) => true === t2 || "1" === t2 || "on" === t2 || "true" === t2 || false !== t2 && "0" !== t2 && "off" !== t2 && "false" !== t2 && null, nt = (t2) => {
733
- const e2 = parseInt(t2);
734
- return isNaN(e2) ? null : e2;
735
- }, at = (t2) => {
736
- const e2 = parseFloat(t2);
737
- return isNaN(e2) ? null : e2;
738
- }, lt = null;
739
- class ct {
740
- constructor() {
741
- this._registeredVisitors = /* @__PURE__ */ new Map();
742
- }
743
- registerVisitor(t2) {
744
- this._registeredVisitors.set(t2.from, t2);
745
- }
746
- createEventHandler(t2, e2, s2) {
747
- const i2 = this._registeredVisitors, o2 = [];
748
- let r2 = null, n2 = null, a2 = null, l2 = null;
749
- const c2 = [], h2 = { key: null, source: t2 };
750
- let u2 = null, d2 = false;
751
- const p2 = (t3, e3) => {
752
- let s3 = a2.attributes[t3];
753
- if (e3) if (Array.isArray(e3)) for (let t4 = 0; t4 < e3.length; t4++) {
754
- if (null == s3) return;
755
- if (s3 = e3[t4](s3), null == s3) return;
756
- }
757
- else {
758
- if (null == s3) return;
759
- if (s3 = e3(s3), null == s3) return;
760
- }
761
- return s3;
762
- }, g2 = { getSource: () => u2.source, setSource: (t3) => {
763
- u2.source = t3;
764
- }, setKey: (t3) => {
765
- u2.key = t3;
766
- }, getFrom: () => a2, getAttribute: (t3, e3) => p2(t3, e3) ?? null, hasAttribute: (t3) => null !== g2.getAttribute(t3), getParent: () => c2[c2.length - 2].source, getPath: () => {
767
- const t3 = [];
768
- for (let e3 = 0; e3 < o2.length; e3++) t3.push(o2[e3].local);
769
- return t3.join("\\");
770
- }, parseAttribute: p2, copyToObject: (t3, e3, s3, i3) => {
771
- const o3 = p2(i3 ?? e3, s3);
772
- void 0 !== o3 && (t3[e3] = o3);
773
- }, copyTo: (t3, e3, s3) => {
774
- const i3 = p2(s3 ?? t3, e3);
775
- void 0 !== i3 && (u2.source[t3] = i3);
776
- }, warn: (t3) => {
777
- s2 ? s2?.(t3) : console.warn(t3);
778
- } };
779
- return { onOpenTag: (t3) => {
780
- let e3 = t3.name;
781
- const s3 = e3.indexOf(":");
782
- -1 !== s3 && (e3 = e3.slice(s3 + 1));
783
- const p3 = i2.get(e3);
784
- if (r2 = { local: e3, visitor: p3, tag: t3, destination: null }, d2) return o2.push(r2), n2 = e3, void (a2 = t3);
785
- l2 = r2?.visitor ?? null, p3 && (u2 = 0 === o2.length ? h2 : null !== l2?.to ? { key: null, source: {} } : null, r2.destination = u2, u2 && c2.push(u2)), o2.push(r2), n2 = e3, a2 = t3, d2 = null === l2?.to, l2?.openTag?.(g2);
786
- }, onCloseTag: (t3) => {
787
- let e3 = t3.name;
788
- const i3 = e3.indexOf(":");
789
- if (-1 !== i3 && (e3 = e3.slice(i3 + 1)), e3 !== n2) throw new Error(`mismatch open/close tag: '${e3}'/'${n2}'`);
790
- d2 || l2?.closeTag?.(g2);
791
- const p3 = o2.pop() ?? null;
792
- r2 = o2[o2.length - 1] ?? null;
793
- const f2 = p3?.destination;
794
- if (f2) {
795
- c2.pop(), u2 = c2[c2.length - 1] ?? h2;
796
- const t4 = p3.visitor;
797
- t4 && t4.to && void 0 !== f2.source && (Array.isArray(t4.to) ? u2.source.push ? u2.source.push(f2.source) : s2?.(`Unable to parse array for ${t4.from} at ${g2.getPath()}`) : f2.key ? u2.source[f2.key] = f2.source : "string" == typeof t4.to && (u2.source[t4.to] = f2.source));
798
- }
799
- n2 = r2?.local ?? null, a2 = r2?.tag ?? null, l2 = r2?.visitor ?? null, d2 = !r2?.destination;
800
- }, onText: (t3) => {
801
- l2?.text?.(t3, g2);
802
- }, onEnd: e2 };
803
- }
804
- }
805
- const ht = (t2, e2, s2, i2 = null) => {
806
- if (!t2) return null;
807
- let o2 = t2;
808
- o2.startsWith("/") && (o2 = o2.substring(1));
809
- let r2 = i2?.parsedRefs?.get(t2);
810
- if (void 0 !== r2) return r2;
811
- const n2 = e2(o2);
812
- if (!n2) return null;
813
- let a2 = n2.content;
814
- try {
815
- s2 && (a2 = s2(a2));
816
- } catch (t3) {
817
- console.warn(t3);
818
- }
819
- return i2?.parsedRefs?.set(t2, a2), a2;
820
- }, ut = (t2, e2, s2, i2, o2 = null) => {
821
- if (!t2) return null;
822
- let r2 = t2;
823
- r2.startsWith("/") && (r2 = r2.substring(1));
824
- let n2 = o2?.parsedRefs?.get(t2);
825
- if (void 0 !== n2) return n2;
826
- const a2 = e2(r2);
827
- if (!a2) return null;
828
- const l2 = a2.content;
829
- try {
830
- const e3 = new TextDecoder().decode(l2), r3 = s2.parseFromString(e3, "text/xml"), n3 = i2.convert(r3, t2, o2);
831
- return o2?.parsedRefs?.set(t2, n3), n3;
832
- } catch (t3) {
833
- console.warn(t3);
834
- }
835
- return null;
836
- }, dt = (t2, e2, s2, i2, o2 = null) => {
837
- const r2 = /* @__PURE__ */ new Map();
838
- let n2 = e2.Directory[t2];
839
- const a2 = n2 ? n2.length : 0;
840
- for (let t3 = 0; t3 < a2; t3++) {
841
- const a3 = n2[t3];
842
- if (!a3) continue;
843
- let l2 = a3;
844
- l2.startsWith("/") && (l2 = l2.substring(1));
845
- const c2 = ut(l2, (t4) => e2.files[t4], s2, i2, o2);
846
- r2.set(l2, c2);
847
- }
848
- return r2;
849
- }, pt = ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "hlink", "folHlink"], gt = (t2, e2 = "dk1") => {
850
- let s2;
851
- const i2 = t2("auto");
852
- void 0 === i2 || "1" !== i2 && "true" !== i2 || (s2 = e2);
853
- const o2 = t2("indexed");
854
- o2 && (s2 = `index${o2}`);
855
- const r2 = t2("rgb");
856
- r2 && (s2 = r2.toLowerCase(), 8 !== r2.length || r2.startsWith("FF") || (s2 = "FF" + r2.substring(2, r2.length)));
857
- const n2 = t2("theme");
858
- n2 && (s2 = pt[n2]);
859
- let a2 = t2("tint");
860
- if (a2 && (s2 += ` ${h.AdjustmentType.ETint} ${parseFloat(a2)}`), s2) return s2;
861
- }, ft = (t2) => t2 ? t2.replace(/^\{([\s\S]+)\}$/, "$1") : t2, mt = (t2) => t2 ? f.roundAccurately(parseFloat(t2) / 12700, 4) : null, Tt = (t2) => t2 ? f.roundAccurately(parseFloat(t2) / 9525, 1) : null, yt = (t2) => parseFloat(t2) / 1e3, bt = (t2) => parseFloat(t2) / 6e4, xt = (t2) => "true" === t2 || "1" === t2;
862
- class wt {
863
- static {
864
- this.Collapsed = 1;
865
- }
866
- static {
867
- this.CustomFormat = 2;
868
- }
869
- static {
870
- this.CustomHeight = 4;
871
- }
872
- static {
873
- this.Hidden = 8;
874
- }
875
- static {
876
- this.Ht = 16;
877
- }
878
- static {
879
- this.OutlineLevel = 32;
880
- }
881
- static {
882
- this.Ph = 64;
883
- }
884
- static {
885
- this.R = 128;
886
- }
887
- static {
888
- this.S = 256;
889
- }
890
- static {
891
- this.Spans = 512;
892
- }
893
- static {
894
- this.ThickBot = 1024;
895
- }
896
- static {
897
- this.ThickTop = 2048;
898
- }
899
- }
900
- const vt = (t2, e2, s2) => {
901
- if (t2[0].value[0] === t2[1].value[0]) return e2;
902
- }, St = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, Ct = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (t2, h2) => {
903
- const { password: f2, onWarning: m2, createWorkbookOptions: T2 = {}, ...y2 } = h2 ?? {}, b2 = import("./DSLWcwr4qgHARs36.mjs"), x2 = import("./B2BlMiDOVpIp1FDQ.mjs");
904
- let w2 = null;
905
- try {
906
- w2 = new DOMParser();
907
- } catch (t3) {
908
- }
909
- let v2 = null;
910
- w2 || (v2 = import("./CEVO60fX3MAPG0Hg.mjs").then((t3) => t3.i));
911
- let S2 = null, C2 = null, k2 = null;
912
- try {
913
- const t3 = await Promise.all([b2, x2, v2]);
914
- S2 = t3[0], C2 = t3[1], k2 = t3[2];
915
- } catch (t3) {
916
- throw new Error("Unable to load XLSX parser.", { cause: t3 });
917
- }
918
- try {
919
- const h3 = S2.read(t2, { type: "array", sheets: [], cellStyles: false, bookFiles: true });
920
- if (!h3.Directory) throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
921
- h3.Directory.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], h3.Directory.richdata = ["/xl/richData/rdrichvalue.xml"];
922
- const p2 = new C2.FromOOXMLConverter(), f3 = w2 ?? new k2.DOMParser(), y3 = T2?.resources ?? new s(), b3 = y3.beginPersist(), x3 = {}, v3 = /* @__PURE__ */ new Set(), A2 = /* @__PURE__ */ new Map();
923
- A2.set("richTypes", []);
924
- const D2 = /* @__PURE__ */ new Map(), E2 = [], P2 = (t3) => h3.files[t3], O2 = (t3, e2) => {
925
- const s2 = t3.lastIndexOf("/"), i2 = t3.substring(0, s2 + 1) + "_rels/" + t3.substring(s2 + 1, t3.length) + ".rels";
926
- let o2 = e2.get(i2);
927
- return o2 || (o2 = ((t4, e3, s3, i3, o3 = null) => {
928
- if (!t4) return null;
929
- const r2 = ut(t4, e3, s3, i3, o3);
930
- if (!r2) return null;
931
- const n2 = /* @__PURE__ */ new Map(), a2 = Object.keys(r2), l2 = a2.length;
932
- for (let t5 = 0; t5 < l2; t5++) {
933
- const e4 = a2[t5], s4 = r2[e4];
934
- n2.set(e4, s4);
935
- }
936
- return n2;
937
- })(i2, P2, f3, p2, V2), e2.set(i2, o2)), o2;
938
- }, I2 = (t3, s2, a2, l2 = D2) => {
939
- let c2 = O2(s2, l2).get(t3), h4 = c2?.target;
940
- if (!h4) return null;
941
- if ("External" === c2.targetMode) return c2.target;
942
- const T3 = s2.lastIndexOf("/"), w3 = s2.substring(0, T3 + 1);
943
- h4.startsWith("/") || (h4 = w3 + h4), h4 = ((t4) => {
944
- const e2 = t4.split(/\/+/);
945
- return e2.reduce((t5, e3, s3) => ("." === e3 ? t5.splice(s3, 1) : ".." === e3 && t5.splice(s3 - 1, 2), t5), e2).join("/");
946
- })(h4);
947
- const S3 = p2?.getVisitorParamsState().get("dxfs");
948
- let C3 = l2.get(h4);
949
- if (!C3) {
950
- const t4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";
951
- if (c2.type === t4) {
952
- const t5 = {};
953
- C3 = t5;
954
- const s3 = async () => {
955
- const s4 = ((t6, s5, n2, a4, l3, c4, h5) => {
956
- const p4 = new ct(), f5 = new i.TransposedBuilder();
957
- let m3 = null;
958
- p4.registerVisitor({ from: "autoFilter", to: "filter", openTag: (t7) => {
959
- t7.copyTo("ref", lt);
960
- } }), p4.registerVisitor({ from: "conditionalFormatting", to: {}, openTag: (t7) => {
961
- const e2 = t7.getParent();
962
- e2.conditionals || (e2.conditionals = []), e2.conditionals.push(t7.getSource());
963
- const s6 = t7.getAttribute("sqref");
964
- s6 && (t7.getSource().ref = s6.split(" ").join(",")), t7.copyTo("pivot", rt);
965
- }, closeTag: (t7) => {
966
- const e2 = t7.getSource();
967
- if (e2.rule) {
968
- const t8 = Object.keys(e2.rule);
969
- for (let s6 = 0; s6 < t8.length; s6++) {
970
- const i2 = t8[s6];
971
- "rule" !== i2 && (e2[i2] = e2.rule[i2]);
972
- }
973
- }
974
- delete e2.rule;
975
- } }), p4.registerVisitor({ from: "cfRule", to: "rule", openTag: (t7) => {
976
- const e2 = t7.getParent();
977
- t7.copyToObject(e2, "type", lt), t7.copyToObject(e2, "priority", nt), t7.copyToObject(e2, "stopIfTrue", rt);
978
- const s6 = t7.getAttribute("dxfId", nt);
979
- if (null !== s6) {
980
- let i2 = a4?.get(s6);
981
- i2 || (c4?.(`Unable to load conditional color. Invalid dxfI: '${s6}' at '${t7.getPath()}'.`), i2 = {}), e2.style = i2;
982
- }
983
- t7.copyToObject(e2, "aboveAverage", rt), t7.copyToObject(e2, "equalAverage", rt), t7.copyToObject(e2, "stdDev", nt), t7.copyToObject(e2, "bottom", rt), t7.copyToObject(e2, "percent", rt), t7.copyToObject(e2, "rank", nt), t7.copyToObject(e2, "operator", lt), t7.copyToObject(e2, "text", lt), t7.copyToObject(e2, "timePeriod", lt);
984
- } }), p4.registerVisitor({ from: "colorScale", to: "colorScale" }), p4.registerVisitor({ from: "dataBar", to: "dataBar", openTag: (t7) => {
985
- t7.copyTo("maxLength", nt), t7.copyTo("minLength", nt), t7.copyTo("showValue", rt);
986
- } }), p4.registerVisitor({ from: "iconSet", to: "iconSet", openTag: (t7) => {
987
- t7.copyTo("iconSet", lt), t7.copyTo("reverse", rt), t7.copyTo("showValue", rt);
988
- } }), p4.registerVisitor({ from: "formula", to: null, text: (t7, e2) => {
989
- const s6 = e2.getParent();
990
- let i2 = s6.formulas;
991
- i2 || (i2 = [], s6.formulas = i2), i2.push(t7);
992
- } }), p4.registerVisitor({ from: "cfvo", to: {}, openTag: (t7) => {
993
- const e2 = t7.getParent();
994
- e2.conditions || (e2.conditions = []), e2.conditions.push(t7.getSource()), t7.copyTo("type", lt), t7.copyTo("value", at, "val"), t7.copyTo("gte", rt);
995
- } }), p4.registerVisitor({ from: "color", to: {}, openTag: (t7) => {
996
- const e2 = t7.getParent();
997
- e2.colors || (e2.colors = []);
998
- const s6 = gt((e3) => t7.getAttribute(e3));
999
- e2.colors.push(s6);
1000
- } }), p4.registerVisitor({ from: "filterColumn", to: "filterColumn", openTag: (t7) => {
1001
- const e2 = t7.getParent();
1002
- e2.fields || (e2.fields = []), e2.fields.push(t7.getSource()), t7.copyTo("offset", nt, "colId"), t7.copyTo("hiddenButton", rt), t7.copyTo("showButton", rt);
1003
- } }), p4.registerVisitor({ from: "colorFilter", to: "colorFilter", openTag: (t7) => {
1004
- const e2 = t7.getParent();
1005
- e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Color, t7.copyTo("cellColor", rt), t7.copyTo("styleId", nt, "dxfId");
1006
- } }), p4.registerVisitor({ from: "dynamicFilter", to: "dynamicFilter", openTag: (t7) => {
1007
- const e2 = t7.getParent();
1008
- e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Dynamic, t7.copyTo("dynamicType", lt, "type"), t7.copyTo("val", at), t7.copyTo("maxVal", at, "maxVal");
1009
- } }), p4.registerVisitor({ from: "iconFilter", to: "iconFilter", openTag: (t7) => {
1010
- const e2 = t7.getParent();
1011
- e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Icon, t7.copyTo("iconId", nt), t7.copyTo("iconSet", lt);
1012
- } }), p4.registerVisitor({ from: "top10", to: "top10", openTag: (t7) => {
1013
- const e2 = t7.getParent();
1014
- e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Top10, t7.copyTo("filterVal", at), t7.copyTo("percent", rt), t7.copyTo("top", rt), t7.copyTo("val", at);
1015
- } }), p4.registerVisitor({ from: "filters", to: "filters", openTag: (t7) => {
1016
- const e2 = t7.getParent();
1017
- e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Items, t7.copyTo("blank", rt), t7.copyTo("calendarType", lt);
1018
- } }), p4.registerVisitor({ from: "dateGroupItem", to: "dateGroupItem", openTag: (t7) => {
1019
- const e2 = t7.getParent();
1020
- e2.dateGroups || (e2.dateGroups = []), e2.dateGroups.push(t7.getSource()), t7.copyTo("group", lt, "dateTimeGrouping"), t7.copyTo("day", nt), t7.copyTo("hour", nt), t7.copyTo("minute", nt), t7.copyTo("month", nt), t7.copyTo("second", nt), t7.copyTo("year", nt);
1021
- } }), p4.registerVisitor({ from: "filter", to: "filter", openTag: (t7) => {
1022
- const e2 = t7.getParent();
1023
- e2.items || (e2.items = []), e2.items.push(t7.getAttribute("val", at));
1024
- } }), p4.registerVisitor({ from: "customFilters", to: "customFilters", openTag: (t7) => {
1025
- const e2 = t7.getParent();
1026
- e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Custom, t7.copyTo("and", rt);
1027
- } }), p4.registerVisitor({ from: "customFilter", to: "customFilter", openTag: (t7) => {
1028
- const e2 = t7.getParent();
1029
- e2.filters || (e2.filters = []), e2.filters.push(t7.getSource()), t7.copyTo("operator", lt), t7.copyTo("value", at, "val");
1030
- } }), p4.registerVisitor({ from: "sortState", to: "sort", openTag: (t7) => {
1031
- t7.copyTo("ref", lt);
1032
- } }), p4.registerVisitor({ from: "sortCondition", to: "sortCondition", openTag: (t7) => {
1033
- const e2 = t7.getParent();
1034
- e2.fields || (e2.fields = []);
1035
- const s6 = t7.getSource();
1036
- e2.fields.push(s6), t7.copyTo("sortOn", lt, "sortBy"), t7.copyTo("dxfId", lt, "sortBy"), t7.copyTo("iconSet", lt), t7.copyTo("customList", lt);
1037
- const i2 = t7.getAttribute("ref");
1038
- if (i2) {
1039
- const t8 = r.fastStringToRange(i2, St).colStart, o2 = r.fastStringToRange(e2.ref, St), n3 = o2.colStart;
1040
- s6.offset = o2 ? t8 - n3 : t8;
1041
- }
1042
- s6.reverse = t7.getAttribute("descending", rt) ?? false;
1043
- } }), p4.registerVisitor({ from: "AlternateContent", to: null });
1044
- const T5 = (t7) => {
1045
- m3 = t7.getSource(), t7.copyTo("topLeft", lt, "topLeftCell");
1046
- const e2 = xt(t7.getAttribute("defaultGridColor")), s6 = t7.getAttribute("colorId");
1047
- null === s6 || e2 || (t7.getSource().gridLineColor = "index" + parseFloat(s6)), t7.copyTo("showZeros", rt), t7.copyTo("showFormulas", rt), t7.copyTo("zoomScale", nt), t7.copyTo("showRowHeaders", rt, "showRowColHeaders"), t7.copyTo("showColumnHeaders", rt, "showRowColHeaders"), t7.copyTo("showRowGridlines", rt, "showGridLines"), t7.copyTo("showColumnGridlines", rt, "showGridLines");
1048
- };
1049
- p4.registerVisitor({ from: "sheetView", to: "view", openTag: (t7) => {
1050
- T5(t7);
1051
- }, closeTag: () => {
1052
- m3 = null;
1053
- } }), p4.registerVisitor({ from: "customSheetViews", to: "customSheetViews", openTag: (t7) => {
1054
- t7.setSource([]);
1055
- } }), p4.registerVisitor({ from: "customSheetView", to: [], openTag: (t7) => {
1056
- T5(t7);
1057
- }, closeTag: () => {
1058
- m3 = null;
1059
- } }), p4.registerVisitor({ from: "selection", to: "selection", openTag: (t7) => {
1060
- if (!m3) return;
1061
- t7.copyTo("cell", lt, "activeCell"), t7.copyTo("rangeIndex", nt, "activeCellId");
1062
- const e2 = t7.getAttribute("activeCell"), s6 = t7.getAttribute("sqref");
1063
- s6 && s6 !== e2 && (t7.getSource().ranges = s6.split(" "));
1064
- } }), p4.registerVisitor({ from: "pane", to: "pane", openTag: (t7) => {
1065
- if (m3 && "frozen" === t7.getAttribute("state")) {
1066
- const e2 = {};
1067
- m3.freezePanes = e2, t7.copyToObject(e2, "topLeft", lt, "topLeftCell");
1068
- const s6 = m3.topLeft ? r.fastStringToCell(m3.topLeft) : { colIndex: 0, rowIndex: 0 }, i2 = { colIndex: 0, rowIndex: 0 };
1069
- t7.copyToObject(i2, "colIndex", nt, "xSplit"), t7.copyToObject(i2, "rowIndex", nt, "ySplit");
1070
- const o2 = { colIndex: s6.colIndex + i2.colIndex, rowIndex: s6.rowIndex + i2.rowIndex };
1071
- e2.coords = r.cellToString(o2);
1072
- }
1073
- } }), p4.registerVisitor({ from: "tabColor", to: null, openTag: (e2) => {
1074
- const s6 = gt((t7) => e2.getAttribute(t7));
1075
- s6 && (t6.tabColor = s6);
1076
- } }), p4.registerVisitor({ from: "pageSetUpPr", to: "pageSetUpPr", openTag: (t7) => {
1077
- } }), p4.registerVisitor({ from: "outlinePr", to: "outlinePr", openTag: (t7) => {
1078
- } }), p4.registerVisitor({ from: "pageMargins", to: "pageMargins", openTag: (t7) => {
1079
- } }), p4.registerVisitor({ from: "pageSetup", to: "pageSetup", openTag: (t7) => {
1080
- } }), p4.registerVisitor({ from: "printOptions", to: "printOptions", openTag: (t7) => {
1081
- } }), p4.registerVisitor({ from: "mergeCells", to: "merges", openTag: (t7) => {
1082
- t7.setSource([]);
1083
- } }), p4.registerVisitor({ from: "mergeCell", to: [], openTag: (t7) => {
1084
- const e2 = t7.getAttribute("ref");
1085
- t7.setSource(e2);
1086
- } }), p4.registerVisitor({ from: "hyperlinks", to: "hyperlinks", openTag: (t7) => {
1087
- t7.setSource([]);
1088
- } }), p4.registerVisitor({ from: "hyperlink", to: [], openTag: (t7) => {
1089
- const e2 = t7.getAttribute("r:id"), i2 = t7.getAttribute("ref");
1090
- if (!i2) return void console.warn("No ref found for hyperlink");
1091
- t7.setKey(i2);
1092
- let o2 = e2 ? s5(e2) : "";
1093
- if ("string" != typeof o2) return void console.warn("Invalid address ", o2);
1094
- const r2 = t7.getAttribute("location");
1095
- o2.endsWith("\\") && (o2 = o2.substring(0, o2.length - 1));
1096
- const n3 = t7.getAttribute("location");
1097
- if (n3 && (r2 && r2 !== n3 && console.warn("display and location are different", r2, n3), o2 += "#" + n3), !o2) return void console.warn("No address found for hyperlink. r:id", e2);
1098
- let a5;
1099
- const l4 = t7.getAttribute("tooltip");
1100
- a5 = l4 ? { address: o2, tooltip: l4 } : o2, t7.setSource({ r: i2, v: a5 });
1101
- } }), p4.registerVisitor({ from: "drawing", to: "movables", openTag: (t7) => {
1102
- const e2 = t7.getAttribute("r:id");
1103
- if (!e2) return;
1104
- const i2 = s5(e2);
1105
- i2 ? t7.setSource(i2.movables) : console.warn("no drawing found for rId", e2);
1106
- } }), p4.registerVisitor({ from: "tableParts", to: "tables", openTag: (t7) => {
1107
- t7.setSource([]);
1108
- } }), p4.registerVisitor({ from: "tablePart", to: [], openTag: (t7) => {
1109
- const e2 = t7.getAttribute("r:id");
1110
- if (!e2) return;
1111
- const i2 = s5(e2);
1112
- i2 ? t7.setSource(i2) : console.warn("no table found for rId", e2);
1113
- } }), p4.registerVisitor({ from: "worksheet", to: "worksheet", openTag: (t7) => {
1114
- } }), p4.registerVisitor({ from: "sheetProtection", to: "protection", openTag: (t7) => {
1115
- let e2 = false;
1116
- if (t7.hasAttribute("sheet") && rt(t7.getAttribute("sheet")) && (e2 = true), !e2) return void t7.setSource(void 0);
1117
- const s6 = (t8) => true === t8 || "1" === t8 || "on" === t8 || "true" === t8 || false === t8 || "0" === t8 || "off" === t8 || "false" === t8 || null;
1118
- t7.copyTo("autoFilter", s6), t7.copyTo("deleteColumns", s6), t7.copyTo("formatCells", s6), t7.copyTo("formatColumns", s6), t7.copyTo("formatRows", s6), t7.copyTo("insertColumns", s6), t7.copyTo("insertHyperlinks", s6), t7.copyTo("insertRows", s6), t7.copyTo("objects", s6), t7.copyTo("pivotTables", s6), t7.copyTo("scenarios", s6), t7.copyTo("selectUnlockedCells", s6), t7.copyTo("selectUnlockedCells", s6), t7.copyTo("sort", s6);
1119
- const i2 = {};
1120
- t7.copyToObject(i2, "hash", lt, "hashValue"), t7.copyToObject(i2, "algorithm", lt, "algorithmName"), t7.copyToObject(i2, "salt", lt, "saltValue"), t7.copyToObject(i2, "spinCount", nt), Object.keys(i2).length > 0 && (t7.getSource().password = i2);
1121
- } }), p4.registerVisitor({ from: "protectedRanges", to: "protectedRanges", openTag: (t7) => {
1122
- t7.setSource({});
1123
- } }), p4.registerVisitor({ from: "protectedRange", to: {}, openTag: (t7) => {
1124
- const e2 = t7.getAttribute("sqref");
1125
- t7.setKey(e2), t7.copyTo("name"), t7.copyTo("securityDescriptor");
1126
- const s6 = {};
1127
- t7.copyToObject(s6, "hash", lt, "hashValue"), t7.copyToObject(s6, "algorithm", lt, "algorithmName"), t7.copyToObject(s6, "salt", lt, "saltValue"), t7.copyToObject(s6, "spinCount", nt), Object.keys(s6).length > 0 && (t7.getSource().password = s6);
1128
- } }), p4.registerVisitor({ from: "sheetFormatPr", to: "sheetFormatPr", openTag: (e2) => {
1129
- e2.copyToObject(t6, "defaultColSize", at, "defaultColWidth"), e2.copyToObject(t6, "outlineLevelCol", nt, "outlineLevelCol");
1130
- const s6 = e2.getAttribute("customHeight");
1131
- "1" !== s6 && "true" !== s6 || e2.copyToObject(t6, "defaultRowSize", at, "defaultRowHeight"), e2.copyToObject(t6, "outlineLevelRow", nt, "outlineLevelRow");
1132
- } }), p4.registerVisitor({ from: "cols", to: "cols", openTag: (t7) => {
1133
- t7.setSource([]);
1134
- } }), p4.registerVisitor({ from: "col", to: [], openTag: (t7) => {
1135
- t7.copyTo("min", (t8) => parseInt(t8) - 1), t7.copyTo("max", (t8) => parseInt(t8) - 1), t7.copyTo("sz", at, "width"), t7.copyTo("cs", rt, "customWidth"), t7.copyTo("h", rt, "hidden"), t7.copyTo("l", nt, "outlineLevel"), t7.copyTo("s", nt, "style");
1136
- } }), p4.registerVisitor({ from: "oleObjects", to: null, openTag: (t7) => {
1137
- t7.warn("'OLE Objects' are not supported.");
1138
- } });
1139
- let y4 = null;
1140
- const b4 = { onOpenTag: (t7) => {
1141
- null === y4 && (y4 = "");
1142
- }, onText: (t7) => {
1143
- y4 += t7;
1144
- }, onEnd: () => {
1145
- const t7 = n2(y4);
1146
- return y4 = null, t7;
1147
- }, onError: (t7) => {
1148
- } };
1149
- return ((t7, s6, i2, o2, n3, a5) => {
1150
- let l4 = false, c5 = false, h6 = [], p5 = false, f6 = null, m4 = null, T6 = null, y5 = null, b5 = null, x4 = null;
1151
- const w4 = a5?.get("richData") ?? [], v4 = r.normalizeA1ToR1C1, S4 = u.createConflatingRanges(), C4 = /* @__PURE__ */ new Map(), k3 = [];
1152
- let A3 = null;
1153
- const D3 = u.createConflatingRanges();
1154
- let E3, P3 = false, O3 = -1, I3 = -1, V3 = null, L3 = null;
1155
- const N3 = [];
1156
- let R3 = null, $3 = -2, M3 = 0, j3 = "", H3 = "", F3 = "", X3 = "", B3 = "", W3 = "", _3 = "", q3 = "", z3 = "", U3 = "", G3 = "", Z3 = "", Q3 = "", J3 = "", K2 = true, Y2 = null;
1157
- return { ...i2, onEnd: () => {
1158
- N3.length > 0 && (s6.rows = N3);
1159
- let e2 = S4.done(vt);
1160
- const o3 = e2.length;
1161
- if (o3 > 0) {
1162
- const t8 = new Array(o3);
1163
- for (let s7 = 0; s7 < o3; s7++) {
1164
- const i3 = e2[s7], o4 = r.rangeToString(i3), n5 = i3.value[1], a7 = r.resolveRelativeToA1(n5, i3.rowStart, i3.colStart);
1165
- t8[s7] = [o4, a7];
1166
- }
1167
- s6.formulas = t8;
1168
- }
1169
- const n4 = D3.done(true), a6 = n4.length;
1170
- if (a6 > 0) {
1171
- const t8 = new Array(a6);
1172
- for (let e3 = 0; e3 < a6; e3++) {
1173
- const s7 = n4[e3], i3 = r.rangeToString(s7);
1174
- t8[e3] = i3;
1175
- }
1176
- s6.volatile = t8;
1177
- }
1178
- if (k3.length > 0 && (s6.dynamicArray = [...k3]), h6.length > 0) {
1179
- h6.sort(u.createRangeComparator(d.Orientation.Column));
1180
- const t8 = [];
1181
- let e3 = null, i3 = -1, o4 = -1, r2 = -1, n5 = -1, a7 = null;
1182
- const l6 = h6.length;
1183
- l6 > 0 && (e3 = h6[0], i3 = e3.colStart, o4 = e3.colEnd, r2 = e3.rowEnd, n5 = e3.value, t8.push(e3));
1184
- for (let s7 = 1; s7 < l6; s7++) a7 = h6[s7], n5 !== a7.value || i3 !== a7.colStart || o4 !== a7.colEnd || r2 + 1 !== a7.rowEnd ? (t8.push(a7), e3 = a7, i3 = e3.colStart, o4 = e3.colEnd, r2 = e3.rowEnd, n5 = e3.value) : (r2 = a7.rowEnd, e3.rowEnd = r2);
1185
- let c6 = [];
1186
- for (let e4 = 0; e4 < t8.length; e4++) {
1187
- const s7 = t8[e4];
1188
- c6.push({ r: { colStart: s7.colStart, colEnd: s7.colEnd, rowStart: s7.rowStart, rowEnd: s7.rowEnd }, v: s7.value });
1189
- }
1190
- s6.directStyles = c6;
1191
- }
1192
- const l5 = t7.build();
1193
- if (l5) {
1194
- const t8 = l5.tuples;
1195
- s6.data = t8;
1196
- }
1197
- i2?.onEnd?.();
1198
- }, onOpenTag: (t8) => {
1199
- let e2 = t8.name;
1200
- const s7 = e2.indexOf(":");
1201
- if (-1 !== s7 && (e2 = e2.slice(s7 + 1)), E3) {
1202
- const s8 = t8.attributes;
1203
- switch (e2) {
1204
- case "v":
1205
- c5 = true;
1206
- break;
1207
- case "f":
1208
- switch (s8.t ?? null) {
1209
- case null:
1210
- case "normal":
1211
- p5 = true;
1212
- break;
1213
- case "shared":
1214
- const t9 = s8.si;
1215
- m4 = s8.ref, f6 = t9;
1216
- break;
1217
- case "array":
1218
- p5 = true, m4 = s8.ref, A3 = [m4, false];
1219
- break;
1220
- case "datatable":
1221
- p5 = true, m4 = s8.ref, p5 = true;
1222
- }
1223
- void 0 !== s8.ca && D3.append(O3, I3);
1224
- break;
1225
- case "is":
1226
- return void (P3 = true);
1227
- }
1228
- return void (P3 && n3?.onOpenTag(t8));
1229
- }
1230
- if (l4) {
1231
- if ("c" === e2) {
1232
- E3 = t8;
1233
- const e3 = t8.attributes.r;
1234
- I3 = r.fastStringToCol(e3);
1235
- const s8 = t8.attributes.t;
1236
- void 0 === s8 ? L3 = null : (L3 = s8, "str" === L3 && (P3 = true));
1237
- let i3 = t8.attributes.s;
1238
- void 0 !== i3 && (i3 = parseInt(i3), Y2 && Y2.value === i3 && Y2.colEnd + 1 === I3 ? Y2.colEnd = I3 : (Y2 = { colStart: I3, rowStart: O3, colEnd: I3, rowEnd: O3, value: i3 }, h6.push(Y2)));
1239
- }
1240
- } else {
1241
- if ("row" === e2) {
1242
- l4 = true;
1243
- const e3 = t8.attributes.r;
1244
- if (O3 = parseInt(e3) - 1, M3 = 0, H3 = t8.attributes.customHeight, void 0 !== H3 && (M3 |= wt.CustomHeight), H3 !== z3 && (K2 = true, z3 = H3), j3 = t8.attributes.ht, void 0 !== j3 && (M3 |= wt.Ht), j3 !== q3 && (K2 = true, q3 = j3), F3 = t8.attributes.hidden, void 0 !== F3 && (M3 |= wt.Hidden), F3 !== U3 && (K2 = true, U3 = F3), B3 = t8.attributes.s, void 0 !== B3 && (M3 |= wt.S), B3 !== Z3 && (K2 = true, Z3 = B3), X3 = t8.attributes.customFormat, void 0 !== X3 && (M3 |= wt.CustomFormat), X3 !== G3 && (K2 = true, G3 = X3), W3 = t8.attributes.outlineLevel, void 0 !== W3 && (M3 |= wt.OutlineLevel), W3 !== Q3 && (K2 = true, Q3 = W3), _3 = t8.attributes.collapsed, void 0 !== _3 && (M3 |= wt.Collapsed), _3 !== J3 && (K2 = true, J3 = _3), 0 !== M3) if ($3 + 1 !== O3 || K2) {
1245
- const t9 = void 0 !== H3 && ("1" === H3 || "true" === H3), e4 = void 0 !== X3 && ("1" === X3 || "true" === X3);
1246
- R3 = { min: O3, max: O3, sz: t9 && void 0 !== j3 ? parseFloat(j3) : -1, csz: t9, h: void 0 !== F3 && ("1" === F3 || "true" === F3), s: t9 && void 0 !== B3 && "0" !== B3 ? parseInt(B3) : 0, cs: e4, l: void 0 === W3 || "0" === W3 ? 0 : parseInt(W3), cl: void 0 !== _3 && ("1" === _3 || "true" === _3) }, N3.push(R3);
1247
- } else R3.max = O3;
1248
- return $3 = O3, void (K2 = false);
1249
- }
1250
- i2?.onOpenTag(t8);
1251
- }
1252
- }, onCloseTag: (e2) => {
1253
- if (E3) {
1254
- let s7 = e2.name;
1255
- const i3 = s7.indexOf(":");
1256
- if (-1 !== i3 && (s7 = s7.slice(i3 + 1)), P3) if ("is" === s7 || "v" === s7) {
1257
- const e3 = n3?.onEnd();
1258
- null !== e3 && t7.addValue(O3, I3, "" + e3);
1259
- } else n3?.onCloseTag?.(e2);
1260
- return c5 && (c5 = false), void ("c" === s7 && (E3 = null, P3 = false));
1261
- }
1262
- if (l4) return l4 = false, void (Y2 = null);
1263
- i2?.onCloseTag(e2);
1264
- }, onText: (s7) => {
1265
- if (s7 = s7.trim(), c5) {
1266
- switch (V3 = null, L3) {
1267
- case null:
1268
- case "n":
1269
- V3 = parseFloat(s7);
1270
- break;
1271
- case "b":
1272
- V3 = "1" === s7 || "true" === s7;
1273
- break;
1274
- case "s":
1275
- V3 = s7;
1276
- break;
1277
- case "e":
1278
- if ("#VALUE!" === s7) {
1279
- const t9 = E3.attributes.vm;
1280
- if (void 0 !== t9) {
1281
- const s8 = w4[parseInt(t9) - 1];
1282
- if (s8 && s8.isFormulaError) {
1283
- V3 = { t: e.Error, v: s8.getCode() };
1284
- break;
1285
- }
1286
- }
1287
- }
1288
- const t8 = g.getBuiltInByLabel(s7);
1289
- t8 ? V3 = { t: e.Error, v: t8.getCode() } : (V3 = s7, o2?.(`Unknown formula error '${s7}' in cell ${r.cellToString({ colIndex: I3, rowIndex: O3 })}`));
1290
- break;
1291
- case "str":
1292
- case "inlineStr":
1293
- P3 = true;
1294
- }
1295
- null !== V3 && t7.addValue(O3, I3, V3);
1296
- }
1297
- if (A3 && ("e" === L3 && (A3[1] = true), k3.push(A3), A3 = null), f6) if (b5 === f6) y5 = x4;
1298
- else {
1299
- if (y5 = C4.get(f6), !y5) {
1300
- const t8 = [];
1301
- T6 = v4(s7, O3, I3, t8), y5 = [T6, t8, s7], C4.set(f6, y5);
1302
- }
1303
- b5 = f6, x4 = y5;
1304
- }
1305
- if (p5) {
1306
- const t8 = [];
1307
- T6 = v4(s7, O3, I3, t8), y5 = [T6, t8, s7];
1308
- }
1309
- if (y5) return S4.append(O3, I3, y5), y5 = null, p5 = false, f6 = null, void (m4 = null);
1310
- P3 ? n3?.onText(s7) : l4 || i2?.onText(s7);
1311
- } };
1312
- })(f5, t6, p4.createEventHandler(t6, () => {
1313
- }, c4), c4, b4, h5);
1314
- })(t5, (t6, e2 = false) => I2(t6, h4, e2) ?? null, j2, S3, 0, (t6) => {
1315
- m2 && (t6 = h4 + ": " + t6, m2?.(t6));
1316
- }, A2), a3 = ht(h4, P2), c3 = await (async (t6, e2 = 8388608) => {
1317
- await (async () => {
1318
- if ("undefined" == typeof ReadableStream) if ("undefined" == typeof window) {
1319
- const { ReadableStream: t7 } = await import("./54SjtcD6mOreKcCy.mjs");
1320
- globalThis.ReadableStream = t7;
1321
- } else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
1322
- })();
1323
- const s5 = new TextDecoder("utf-8");
1324
- let i2 = 0;
1325
- const o2 = t6 instanceof Uint8Array ? t6 : new Uint8Array(t6);
1326
- return new ReadableStream({ pull(t7) {
1327
- if (i2 >= o2.byteLength) return void t7.close();
1328
- const r2 = o2.subarray(i2, Math.min(i2 + e2, o2.byteLength)), n2 = s5.decode(r2, { stream: i2 + e2 < o2.byteLength });
1329
- t7.enqueue(n2), i2 += r2.length;
1330
- } }).getReader();
1331
- })(a3);
1332
- try {
1333
- await it.parseStream(c3, s4, { xmlns: false });
1334
- } catch (t6) {
1335
- throw console.warn(`Error parsing sheet: '${h4}'`, t6), new Error(`Error parsing sheet: '${h4}'`, { cause: t6 });
1336
- }
1337
- const p3 = O2(h4, l2);
1338
- let f4, T4 = /* @__PURE__ */ new Map();
1339
- if (p3) {
1340
- const e2 = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
1341
- let s5;
1342
- p3.forEach((t6, s6) => {
1343
- if (t6.type === e2) {
1344
- const t7 = I2(s6, h4, false, l2);
1345
- f4 = t7?.comments, f4 && f4.forEach((t8) => {
1346
- T4.set(t8.id, t8);
1347
- });
1348
- }
1349
- });
1350
- const i2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
1351
- if (p3.forEach((t6, e3) => {
1352
- if (t6.type === i2) {
1353
- const t7 = I2(e3, h4, false, l2);
1354
- s5 = t7;
1355
- }
1356
- }), s5 || f4) {
1357
- const e3 = f4 ?? [], i3 = s5?.comments;
1358
- if (i3) {
1359
- const t6 = s5?.authors;
1360
- for (let s6 = 0; s6 < i3.length; s6++) {
1361
- const o2 = i3[s6];
1362
- let r2 = void 0 !== o2.authorId ? t6[o2.authorId] : void 0;
1363
- if ((!r2 || r2.startsWith("tc=")) && (r2 = ft(r2.substring(3)), T4.has(r2))) continue;
1364
- let a4 = H2.get(r2);
1365
- a4 || (a4 = F2.get(r2)), a4 || (a4 = { id: n.uuidV4(), displayName: r2 }, F2.set(a4.displayName, a4), H2.set(a4.id, a4)), r2 = a4?.id ?? null;
1366
- const l3 = { id: n.uuidV4(), personId: r2, ref: o2.ref, done: false, asNote: true, content: o2.content };
1367
- e3.push(l3);
1368
- }
1369
- }
1370
- t5.comments = e3;
1371
- }
1372
- }
1373
- };
1374
- E2.push(s3());
1375
- } else C3 = a2 ? ht(h4, P2, (t5) => {
1376
- const e2 = y3.add({ buffer: t5 });
1377
- return e2.addReference(x3), v3.add(e2), b3.toResourceId(e2);
1378
- }, V2) : ut(h4, P2, f3, p2, V2);
1379
- }
1380
- return C3;
1381
- }, V2 = { paramMap: A2, getRefs: O2, getRef: I2, parsedRefs: D2, onWarning: m2, addPerson: (t3) => null }, L2 = [];
1382
- let N2 = 0;
1383
- h3.Strings && (N2 = parseInt(h3.Strings.Unique ?? h3.Strings.length ?? 0));
1384
- const R2 = h3.Strings ?? [];
1385
- for (let t3 = 0; t3 < N2; t3++) L2.push(R2[t3]?.t ?? "");
1386
- const $2 = /* @__PURE__ */ new Map();
1387
- let M2 = N2;
1388
- const j2 = (t3) => {
1389
- const e2 = $2.get(t3);
1390
- if (void 0 !== e2) return e2;
1391
- const s2 = M2;
1392
- return $2.set(t3, M2++), L2.push(t3), s2;
1393
- }, H2 = (dt("richstructure", h3, f3, p2, V2), dt("richdata", h3, f3, p2, V2), /* @__PURE__ */ new Map()), F2 = /* @__PURE__ */ new Map(), X2 = dt("people", h3, f3, p2);
1394
- let B2 = null;
1395
- if (X2.size > 0 && (B2 = X2.entries().next()?.value?.[1]?.persons, B2)) {
1396
- const t3 = B2.length;
1397
- for (let e2 = 0; e2 < t3; e2++) {
1398
- const t4 = B2[e2];
1399
- H2.set(t4.id, t4), H2.set(t4.displayName, t4);
1400
- }
1401
- }
1402
- const W2 = dt("themes", h3, f3, p2, V2);
1403
- let _2 = null;
1404
- if (W2 && W2.entries) {
1405
- let t3 = W2.entries().next();
1406
- t3?.value?.[1] && (_2 = t3.value[1]);
1407
- }
1408
- const q2 = new a(_2), z2 = dt("styles", h3, f3, p2, V2);
1409
- let U2 = z2.entries().next()?.value[1];
1410
- U2 && (U2 = JSON.parse(l(U2)));
1411
- const G2 = dt("workbooks", h3, f3, p2, V2);
1412
- await Promise.all(E2);
1413
- const Z2 = { ...G2.entries().next().value[1], styles: U2, theme: q2.toJSON() };
1414
- L2.length > 0 && (Z2.strings = L2), B2 && B2.length > 0 && (Z2.people = B2);
1415
- const Q2 = { ...T2, resources: y3, json: Z2 }, J2 = new c(Q2);
1416
- return v3.forEach((t3) => {
1417
- t3.deleteReference(x3);
1418
- }), b3.endPersist(), J2;
1419
- } catch (t3) {
1420
- let e2 = "Unable to parse XLSX.";
1421
- throw t3 instanceof p && (e2 = "Unable to open XLSX. There are too many rows or columns."), new Error(e2, { cause: t3 });
1422
- }
1423
- }, toBufferXLSX: async (s2, i2) => {
1424
- const o2 = await import("./DSLWcwr4qgHARs36.mjs"), r2 = await s2.toJSON(true), n2 = o2.utils.book_new();
1425
- for (let i3 = 0; i3 < r2.sheets.length; i3++) {
1426
- const a2 = r2.sheets[i3], l2 = o2.utils.json_to_sheet([{}]);
1427
- o2.utils.book_append_sheet(n2, l2, a2.name);
1428
- const c2 = a2.sheet, h2 = s2.getSheetAt(i3), u2 = h2.getUsedRange();
1429
- if (u2 ? (l2["!ref"] = u2.getA1(), u2.forEach((s3, i4) => {
1430
- const o3 = { t: "z" }, r3 = i4.getCell().getStyle();
1431
- if (!r3.isNormal()) {
1432
- let e2 = r3.getNumberFormat();
1433
- e2 !== t.Type.General && (e2 === t.Type.ShortDate ? e2 = "m/d/yyyy" : e2 === t.Type.MediumDate ? e2 = "d-mmm-yy" : e2 === t.Type.LongDate ? e2 = "[$-x-sysdate]dddd, mmmm dd, yyyy" : e2 === t.Type.ShortTime ? e2 = "h:mm" : e2 === t.Type.MediumTime ? e2 = "h:mm AM/PM" : e2 === t.Type.LongTime && (e2 = "h:mm:ss AM/PM"), o3.z = e2);
1434
- }
1435
- if (null !== s3) switch (i4.getType()) {
1436
- case e.Number:
1437
- o3.t = "n", o3.v = s3;
1438
- break;
1439
- case e.String:
1440
- o3.t = "s", o3.v = s3;
1441
- break;
1442
- case e.Boolean:
1443
- o3.t = "b", o3.v = s3;
1444
- break;
1445
- case e.Error:
1446
- o3.t = "e", o3.v = s3.toString();
1447
- case e.RichData:
1448
- }
1449
- l2[i4.getA1()] = o3;
1450
- })) : l2["!ref"] = "A1:A1", c2.merges?.length > 0) {
1451
- const t2 = [];
1452
- l2["!merges"] = t2;
1453
- for (let e2 = 0; e2 < c2.merges.length; e2++) t2.push(o2.utils.decode_range(c2.merges[e2]));
1454
- }
1455
- if (c2.cols?.length > 0) {
1456
- const t2 = [];
1457
- l2["!cols"] = t2;
1458
- const e2 = c2.cols, s3 = { width: c2.defaultColSize ?? h2.getColumnWidthAsFontUnit(h2.getColumnHeaders().getDefaultSize()) };
1459
- for (let i4 = 0; i4 < e2.length; i4++) {
1460
- const o3 = e2[i4];
1461
- for (let e3 = t2.length; e3 <= o3.min - 1; e3++) t2.push(s3);
1462
- const r3 = {};
1463
- void 0 !== o3.sz && (r3.width = o3.sz), void 0 !== o3.h && (r3.hidden = o3.h), void 0 !== o3.l && (r3.level = o3.l);
1464
- for (let e3 = o3.min; e3 <= o3.max; e3++) t2.push(r3);
1465
- }
1466
- }
1467
- }
1468
- return o2.write(n2, { type: "array", bookType: "xlsx" }), o2.write(n2, { type: "array", bookType: "xlsx" });
1469
- } }, Symbol.toStringTag, { value: "Module" }));
1470
- export {
1471
- yt as a,
1472
- xt as b,
1473
- Tt as c,
1474
- gt as d,
1475
- Ct as i,
1476
- bt as p,
1477
- ft as r,
1478
- mt as t
1479
- };