@fileverse-dev/dsheet 3.0.2-patch.8 → 3.0.2-patch.9

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.
@@ -1,45 +1,45 @@
1
- import { g as Ke } from "./executeStringFunction-DVN2p-9G.js";
2
- import * as et from "yjs";
3
- import { m as tt, y as rt, r as nt } from "./index-BghvCwFN.js";
1
+ import { g as et } from "./executeStringFunction-DVN2p-9G.js";
2
+ import * as Ge from "yjs";
3
+ import { m as tt, y as rt, r as nt } from "./index-T7U1EYEU.js";
4
4
  import { n as at } from "./xlsx-hyperlink-inline-DzewAypN.js";
5
- import { toast as Ge } from "@fileverse/ui";
6
- var Ze = { exports: {} };
5
+ import { toast as ze } from "@fileverse/ui";
6
+ var Je = { exports: {} };
7
7
  (function(y) {
8
- var u = {}, g = function(p) {
9
- p.version = "0.11.2";
8
+ var u = {}, g = function(w) {
9
+ w.version = "0.11.2";
10
10
  function C(t) {
11
- for (var e = "", r = t.length - 1; r >= 0; ) e += t.charAt(r--);
11
+ for (var e = "", n = t.length - 1; n >= 0; ) e += t.charAt(n--);
12
12
  return e;
13
13
  }
14
14
  function S(t, e) {
15
- for (var r = ""; r.length < e; ) r += t;
16
- return r;
15
+ for (var n = ""; n.length < e; ) n += t;
16
+ return n;
17
17
  }
18
18
  function F(t, e) {
19
- var r = "" + t;
20
- return r.length >= e ? r : S("0", e - r.length) + r;
19
+ var n = "" + t;
20
+ return n.length >= e ? n : S("0", e - n.length) + n;
21
21
  }
22
22
  function R(t, e) {
23
- var r = "" + t;
24
- return r.length >= e ? r : S(" ", e - r.length) + r;
23
+ var n = "" + t;
24
+ return n.length >= e ? n : S(" ", e - n.length) + n;
25
25
  }
26
- function j(t, e) {
27
- var r = "" + t;
28
- return r.length >= e ? r : r + S(" ", e - r.length);
26
+ function B(t, e) {
27
+ var n = "" + t;
28
+ return n.length >= e ? n : n + S(" ", e - n.length);
29
29
  }
30
30
  function ee(t, e) {
31
- var r = "" + Math.round(t);
32
- return r.length >= e ? r : S("0", e - r.length) + r;
31
+ var n = "" + Math.round(t);
32
+ return n.length >= e ? n : S("0", e - n.length) + n;
33
33
  }
34
34
  function ke(t, e) {
35
- var r = "" + t;
36
- return r.length >= e ? r : S("0", e - r.length) + r;
35
+ var n = "" + t;
36
+ return n.length >= e ? n : S("0", e - n.length) + n;
37
37
  }
38
38
  var D = Math.pow(2, 32);
39
39
  function Z(t, e) {
40
40
  if (t > D || t < -D) return ee(t, e);
41
- var r = Math.round(t);
42
- return ke(r, e);
41
+ var n = Math.round(t);
42
+ return ke(n, e);
43
43
  }
44
44
  function le(t, e) {
45
45
  return e = e || 0, t.length >= 7 + e && (t.charCodeAt(e) | 32) === 103 && (t.charCodeAt(e + 1) | 32) === 101 && (t.charCodeAt(e + 2) | 32) === 110 && (t.charCodeAt(e + 3) | 32) === 101 && (t.charCodeAt(e + 4) | 32) === 114 && (t.charCodeAt(e + 5) | 32) === 97 && (t.charCodeAt(e + 6) | 32) === 108;
@@ -69,76 +69,76 @@ var Ze = { exports: {} };
69
69
  function $e(t) {
70
70
  t[0] = "General", t[1] = "0", t[2] = "0.00", t[3] = "#,##0", t[4] = "#,##0.00", t[9] = "0%", t[10] = "0.00%", t[11] = "0.00E+00", t[12] = "# ?/?", t[13] = "# ??/??", t[14] = "m/d/yy", t[15] = "d-mmm-yy", t[16] = "d-mmm", t[17] = "mmm-yy", t[18] = "h:mm AM/PM", t[19] = "h:mm:ss AM/PM", t[20] = "h:mm", t[21] = "h:mm:ss", t[22] = "m/d/yy h:mm", t[37] = "#,##0 ;(#,##0)", t[38] = "#,##0 ;[Red](#,##0)", t[39] = "#,##0.00;(#,##0.00)", t[40] = "#,##0.00;[Red](#,##0.00)", t[45] = "mm:ss", t[46] = "[h]:mm:ss", t[47] = "mmss.0", t[48] = "##0.0E+0", t[49] = "@", t[56] = '"上午/下午 "hh"時"mm"分"ss"秒 "';
71
71
  }
72
- var ie = {};
73
- $e(ie);
74
- var J = [], x = 0;
75
- for (x = 5; x <= 8; ++x) J[x] = 32 + x;
76
- for (x = 23; x <= 26; ++x) J[x] = 0;
77
- for (x = 27; x <= 31; ++x) J[x] = 14;
78
- for (x = 50; x <= 58; ++x) J[x] = 14;
79
- for (x = 59; x <= 62; ++x) J[x] = x - 58;
80
- for (x = 67; x <= 68; ++x) J[x] = x - 58;
81
- for (x = 72; x <= 75; ++x) J[x] = x - 58;
82
- for (x = 67; x <= 68; ++x) J[x] = x - 57;
83
- for (x = 76; x <= 78; ++x) J[x] = x - 56;
84
- for (x = 79; x <= 81; ++x) J[x] = x - 34;
72
+ var ce = {};
73
+ $e(ce);
74
+ var J = [], M = 0;
75
+ for (M = 5; M <= 8; ++M) J[M] = 32 + M;
76
+ for (M = 23; M <= 26; ++M) J[M] = 0;
77
+ for (M = 27; M <= 31; ++M) J[M] = 14;
78
+ for (M = 50; M <= 58; ++M) J[M] = 14;
79
+ for (M = 59; M <= 62; ++M) J[M] = M - 58;
80
+ for (M = 67; M <= 68; ++M) J[M] = M - 58;
81
+ for (M = 72; M <= 75; ++M) J[M] = M - 58;
82
+ for (M = 67; M <= 68; ++M) J[M] = M - 57;
83
+ for (M = 76; M <= 78; ++M) J[M] = M - 56;
84
+ for (M = 79; M <= 81; ++M) J[M] = M - 34;
85
85
  var z = [];
86
86
  z[5] = z[63] = '"$"#,##0_);\\("$"#,##0\\)', z[6] = z[64] = '"$"#,##0_);[Red]\\("$"#,##0\\)', z[7] = z[65] = '"$"#,##0.00_);\\("$"#,##0.00\\)', z[8] = z[66] = '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', z[41] = '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)', z[42] = '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)', z[43] = '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)', z[44] = '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)';
87
- function fe(t, e, r) {
88
- for (var m = t < 0 ? -1 : 1, i = t * m, o = 0, n = 1, h = 0, M = 1, d = 0, _ = 0, A = Math.floor(i); d < e && (A = Math.floor(i), h = A * n + o, _ = A * d + M, !(i - A < 5e-8)); )
89
- i = 1 / (i - A), o = n, n = h, M = d, d = _;
90
- if (_ > e && (d > e ? (_ = M, h = o) : (_ = d, h = n)), !r) return [0, m * h, _];
87
+ function ge(t, e, n) {
88
+ for (var m = t < 0 ? -1 : 1, i = t * m, o = 0, r = 1, h = 0, x = 1, d = 0, _ = 0, A = Math.floor(i); d < e && (A = Math.floor(i), h = A * r + o, _ = A * d + x, !(i - A < 5e-8)); )
89
+ i = 1 / (i - A), o = r, r = h, x = d, d = _;
90
+ if (_ > e && (d > e ? (_ = x, h = o) : (_ = d, h = r)), !n) return [0, m * h, _];
91
91
  var P = Math.floor(m * h / _);
92
92
  return [P, m * h - P * _, _];
93
93
  }
94
- function ge(t, e, r) {
94
+ function de(t, e, n) {
95
95
  if (t > 2958465 || t < 0) return null;
96
- var m = t | 0, i = Math.floor(86400 * (t - m)), o = 0, n = [], h = { D: m, T: i, u: 86400 * (t - m) - i, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
96
+ var m = t | 0, i = Math.floor(86400 * (t - m)), o = 0, r = [], h = { D: m, T: i, u: 86400 * (t - m) - i, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
97
97
  if (Math.abs(h.u) < 1e-6 && (h.u = 0), e && e.date1904 && (m += 1462), h.u > 0.9999 && (h.u = 0, ++i == 86400 && (h.T = i = 0, ++m, ++h.D)), m === 60)
98
- n = r ? [1317, 10, 29] : [1900, 2, 29], o = 3;
98
+ r = n ? [1317, 10, 29] : [1900, 2, 29], o = 3;
99
99
  else if (m === 0)
100
- n = r ? [1317, 8, 29] : [1900, 1, 0], o = 6;
100
+ r = n ? [1317, 8, 29] : [1900, 1, 0], o = 6;
101
101
  else {
102
102
  m > 60 && --m;
103
- var M = new Date(1900, 0, 1);
104
- M.setDate(M.getDate() + m - 1), n = [M.getFullYear(), M.getMonth() + 1, M.getDate()], o = M.getDay(), m < 60 && (o = (o + 6) % 7), r && (o = xe(M, n));
103
+ var x = new Date(1900, 0, 1);
104
+ x.setDate(x.getDate() + m - 1), r = [x.getFullYear(), x.getMonth() + 1, x.getDate()], o = x.getDay(), m < 60 && (o = (o + 6) % 7), n && (o = xe(x, r));
105
105
  }
106
- return h.y = n[0], h.m = n[1], h.d = n[2], h.S = i % 60, i = Math.floor(i / 60), h.M = i % 60, i = Math.floor(i / 60), h.H = i, h.q = o, h;
106
+ return h.y = r[0], h.m = r[1], h.d = r[2], h.S = i % 60, i = Math.floor(i / 60), h.M = i % 60, i = Math.floor(i / 60), h.H = i, h.q = o, h;
107
107
  }
108
- p.parse_date_code = ge;
108
+ w.parse_date_code = de;
109
109
  var Ne = new Date(1899, 11, 31, 0, 0, 0), Re = Ne.getTime(), Le = new Date(1900, 2, 1, 0, 0, 0);
110
110
  function Te(t, e) {
111
- var r = t.getTime();
112
- return e ? r -= 1262304e5 : t >= Le && (r += 864e5), (r - (Re + (t.getTimezoneOffset() - Ne.getTimezoneOffset()) * 6e4)) / 864e5;
111
+ var n = t.getTime();
112
+ return e ? n -= 1262304e5 : t >= Le && (n += 864e5), (n - (Re + (t.getTimezoneOffset() - Ne.getTimezoneOffset()) * 6e4)) / 864e5;
113
113
  }
114
114
  function He(t) {
115
115
  return t.toString(10);
116
116
  }
117
- p._general_int = He;
117
+ w._general_int = He;
118
118
  var Fe = /* @__PURE__ */ function() {
119
119
  var e = /(?:\.0*|(\.\d*[1-9])0+)$/;
120
- function r(d) {
120
+ function n(d) {
121
121
  return d.indexOf(".") == -1 ? d : d.replace(e, "$1");
122
122
  }
123
123
  var m = /(?:\.0*|(\.\d*[1-9])0+)[Ee]/, i = /(E[+-])(\d)$/;
124
124
  function o(d) {
125
125
  return d.indexOf("E") == -1 ? d : d.replace(m, "$1E").replace(i, "$10$2");
126
126
  }
127
- function n(d) {
128
- var _ = d < 0 ? 12 : 11, A = r(d.toFixed(12));
127
+ function r(d) {
128
+ var _ = d < 0 ? 12 : 11, A = n(d.toFixed(12));
129
129
  return A.length <= _ || (A = d.toPrecision(10), A.length <= _) ? A : d.toExponential(5);
130
130
  }
131
131
  function h(d) {
132
- var _ = r(d.toFixed(11));
132
+ var _ = n(d.toFixed(11));
133
133
  return _.length > (d < 0 ? 12 : 11) || _ === "0" || _ === "-0" ? d.toPrecision(6) : _;
134
134
  }
135
- function M(d) {
135
+ function x(d) {
136
136
  var _ = Math.floor(Math.log(Math.abs(d)) * Math.LOG10E), A;
137
- return _ >= -4 && _ <= -1 ? A = d.toPrecision(10 + _) : Math.abs(_) <= 9 ? A = n(d) : _ === 10 ? A = d.toFixed(10).substr(0, 12) : A = h(d), r(o(A.toUpperCase()));
137
+ return _ >= -4 && _ <= -1 ? A = d.toPrecision(10 + _) : Math.abs(_) <= 9 ? A = r(d) : _ === 10 ? A = d.toFixed(10).substr(0, 12) : A = h(d), n(o(A.toUpperCase()));
138
138
  }
139
- return M;
139
+ return x;
140
140
  }();
141
- p._general_num = Fe;
141
+ w._general_num = Fe;
142
142
  function Ae(t, e) {
143
143
  switch (typeof t) {
144
144
  case "string":
@@ -155,25 +155,25 @@ var Ze = { exports: {} };
155
155
  }
156
156
  throw new Error("unsupported value in General format: " + t);
157
157
  }
158
- p._general = Ae;
158
+ w._general = Ae;
159
159
  function xe(t, e) {
160
160
  e[0] -= 581;
161
- var r = t.getDay();
162
- return t < 60 && (r = (r + 6) % 7), r;
161
+ var n = t.getDay();
162
+ return t < 60 && (n = (n + 6) % 7), n;
163
163
  }
164
- function Ve(t, e, r, m) {
165
- var i = "", o = 0, n = 0, h = r.y, M, d = 0;
164
+ function Ve(t, e, n, m) {
165
+ var i = "", o = 0, r = 0, h = n.y, x, d = 0;
166
166
  switch (t) {
167
167
  case 98:
168
- h = r.y + 543;
168
+ h = n.y + 543;
169
169
  case 121:
170
170
  switch (e.length) {
171
171
  case 1:
172
172
  case 2:
173
- M = h % 100, d = 2;
173
+ x = h % 100, d = 2;
174
174
  break;
175
175
  default:
176
- M = h % 1e4, d = 4;
176
+ x = h % 1e4, d = 4;
177
177
  break;
178
178
  }
179
179
  break;
@@ -181,33 +181,33 @@ var Ze = { exports: {} };
181
181
  switch (e.length) {
182
182
  case 1:
183
183
  case 2:
184
- M = r.m, d = e.length;
184
+ x = n.m, d = e.length;
185
185
  break;
186
186
  case 3:
187
- return _e[r.m - 1][1];
187
+ return _e[n.m - 1][1];
188
188
  case 5:
189
- return _e[r.m - 1][0];
189
+ return _e[n.m - 1][0];
190
190
  default:
191
- return _e[r.m - 1][2];
191
+ return _e[n.m - 1][2];
192
192
  }
193
193
  break;
194
194
  case 100:
195
195
  switch (e.length) {
196
196
  case 1:
197
197
  case 2:
198
- M = r.d, d = e.length;
198
+ x = n.d, d = e.length;
199
199
  break;
200
200
  case 3:
201
- return Ee[r.q][0];
201
+ return Ee[n.q][0];
202
202
  default:
203
- return Ee[r.q][1];
203
+ return Ee[n.q][1];
204
204
  }
205
205
  break;
206
206
  case 104:
207
207
  switch (e.length) {
208
208
  case 1:
209
209
  case 2:
210
- M = 1 + (r.H + 11) % 12, d = e.length;
210
+ x = 1 + (n.H + 11) % 12, d = e.length;
211
211
  break;
212
212
  default:
213
213
  throw "bad hour format: " + e;
@@ -217,7 +217,7 @@ var Ze = { exports: {} };
217
217
  switch (e.length) {
218
218
  case 1:
219
219
  case 2:
220
- M = r.H, d = e.length;
220
+ x = n.H, d = e.length;
221
221
  break;
222
222
  default:
223
223
  throw "bad hour format: " + e;
@@ -227,7 +227,7 @@ var Ze = { exports: {} };
227
227
  switch (e.length) {
228
228
  case 1:
229
229
  case 2:
230
- M = r.M, d = e.length;
230
+ x = n.M, d = e.length;
231
231
  break;
232
232
  default:
233
233
  throw "bad minute format: " + e;
@@ -235,20 +235,20 @@ var Ze = { exports: {} };
235
235
  break;
236
236
  case 115:
237
237
  if (e != "s" && e != "ss" && e != ".0" && e != ".00" && e != ".000") throw "bad second format: " + e;
238
- return r.u === 0 && (e == "s" || e == "ss") ? F(r.S, e.length) : (m >= 2 ? n = m === 3 ? 1e3 : 100 : n = m === 1 ? 10 : 1, o = Math.round(n * (r.S + r.u)), o >= 60 * n && (o = 0), e === "s" ? o === 0 ? "0" : "" + o / n : (i = F(o, 2 + m), e === "ss" ? i.substr(0, 2) : "." + i.substr(2, e.length - 1)));
238
+ return n.u === 0 && (e == "s" || e == "ss") ? F(n.S, e.length) : (m >= 2 ? r = m === 3 ? 1e3 : 100 : r = m === 1 ? 10 : 1, o = Math.round(r * (n.S + n.u)), o >= 60 * r && (o = 0), e === "s" ? o === 0 ? "0" : "" + o / r : (i = F(o, 2 + m), e === "ss" ? i.substr(0, 2) : "." + i.substr(2, e.length - 1)));
239
239
  case 90:
240
240
  switch (e) {
241
241
  case "[h]":
242
242
  case "[hh]":
243
- M = r.D * 24 + r.H;
243
+ x = n.D * 24 + n.H;
244
244
  break;
245
245
  case "[m]":
246
246
  case "[mm]":
247
- M = (r.D * 24 + r.H) * 60 + r.M;
247
+ x = (n.D * 24 + n.H) * 60 + n.M;
248
248
  break;
249
249
  case "[s]":
250
250
  case "[ss]":
251
- M = ((r.D * 24 + r.H) * 60 + r.M) * 60 + Math.round(r.S + r.u);
251
+ x = ((n.D * 24 + n.H) * 60 + n.M) * 60 + Math.round(n.S + n.u);
252
252
  break;
253
253
  default:
254
254
  throw "bad abstime format: " + e;
@@ -256,21 +256,21 @@ var Ze = { exports: {} };
256
256
  d = e.length === 3 ? 1 : 2;
257
257
  break;
258
258
  case 101:
259
- M = h, d = 1;
259
+ x = h, d = 1;
260
260
  break;
261
261
  }
262
- var _ = d > 0 ? F(M, d) : "";
262
+ var _ = d > 0 ? F(x, d) : "";
263
263
  return _;
264
264
  }
265
- function ce(t) {
265
+ function oe(t) {
266
266
  var e = 3;
267
267
  if (t.length <= e) return t;
268
- for (var r = t.length % e, m = t.substr(0, r); r != t.length; r += e) m += (m.length > 0 ? "," : "") + t.substr(r, e);
268
+ for (var n = t.length % e, m = t.substr(0, n); n != t.length; n += e) m += (m.length > 0 ? "," : "") + t.substr(n, e);
269
269
  return m;
270
270
  }
271
271
  var ae = /* @__PURE__ */ function() {
272
272
  var e = /%/g;
273
- function r(f, a, c) {
273
+ function n(f, a, c) {
274
274
  var k = a.replace(e, ""), l = a.length - k.length;
275
275
  return ae(f, k, c * Math.pow(10, 2 * l)) + S("%", l);
276
276
  }
@@ -292,21 +292,21 @@ var Ze = { exports: {} };
292
292
  c = c.charAt(0) + c.substr(2, l) + "." + c.substr(2 + l), c = c.replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
293
293
  c = c.replace(/\+-/, "-");
294
294
  }
295
- c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, B, W, N) {
296
- return B + W + N.substr(0, (l + s) % l) + "." + N.substr(s) + "E";
295
+ c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, j, W, N) {
296
+ return j + W + N.substr(0, (l + s) % l) + "." + N.substr(s) + "E";
297
297
  });
298
298
  } else c = a.toExponential(k);
299
299
  return f.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), f.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
300
300
  }
301
301
  var o = /# (\?+)( ?)\/( ?)(\d+)/;
302
- function n(f, a, c) {
302
+ function r(f, a, c) {
303
303
  var k = parseInt(f[4], 10), l = Math.round(a * k), s = Math.floor(l / k), O = l - s * k, L = k;
304
304
  return c + (s === 0 ? "" : "" + s) + " " + (O === 0 ? S(" ", f[1].length + 1 + f[4].length) : R(O, f[1].length) + f[2] + "/" + f[3] + F(L, f[4].length));
305
305
  }
306
306
  function h(f, a, c) {
307
307
  return c + (a === 0 ? "" : "" + a) + S(" ", f[1].length + 2 + f[4].length);
308
308
  }
309
- var M = /^#*0*\.([0#]+)/, d = /\).*[0#]/, _ = /\(###\) ###\\?-####/;
309
+ var x = /^#*0*\.([0#]+)/, d = /\).*[0#]/, _ = /\(###\) ###\\?-####/;
310
310
  function A(f) {
311
311
  for (var a = "", c, k = 0; k != f.length; ++k) switch (c = f.charCodeAt(k)) {
312
312
  case 35:
@@ -326,7 +326,7 @@ var Ze = { exports: {} };
326
326
  var c = Math.pow(10, a);
327
327
  return "" + Math.round(f * c) / c;
328
328
  }
329
- function I(f, a) {
329
+ function U(f, a) {
330
330
  var c = f - Math.floor(f), k = Math.pow(10, a);
331
331
  return a < ("" + Math.round(c * k)).length ? 0 : Math.round(c * k);
332
332
  }
@@ -342,24 +342,24 @@ var Ze = { exports: {} };
342
342
  return c >= 0 ? $("n", k, c) : "(" + $("n", k, -c) + ")";
343
343
  }
344
344
  if (a.charCodeAt(a.length - 1) === 44) return m(f, a, c);
345
- if (a.indexOf("%") !== -1) return r(f, a, c);
345
+ if (a.indexOf("%") !== -1) return n(f, a, c);
346
346
  if (a.indexOf("E") !== -1) return i(a, c);
347
347
  if (a.charCodeAt(0) === 36) return "$" + $(f, a.substr(a.charAt(1) == " " ? 2 : 1), c);
348
- var l, s, O, L, B = Math.abs(c), W = c < 0 ? "-" : "";
349
- if (a.match(/^00+$/)) return W + Z(B, a.length);
348
+ var l, s, O, L, j = Math.abs(c), W = c < 0 ? "-" : "";
349
+ if (a.match(/^00+$/)) return W + Z(j, a.length);
350
350
  if (a.match(/^[#?]+$/))
351
351
  return l = Z(c, 0), l === "0" && (l = ""), l.length > a.length ? l : A(a.substr(0, a.length - l.length)) + l;
352
- if (s = a.match(o)) return n(s, B, W);
353
- if (a.match(/^#+0+$/)) return W + Z(B, a.length - a.indexOf("0"));
354
- if (s = a.match(M))
352
+ if (s = a.match(o)) return r(s, j, W);
353
+ if (a.match(/^#+0+$/)) return W + Z(j, a.length - a.indexOf("0"));
354
+ if (s = a.match(x))
355
355
  return l = P(c, s[1].length).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])).replace(/\.(\d*)$/, function(q, pe) {
356
356
  return "." + pe + S("0", A(s[1]).length - pe.length);
357
357
  }), a.indexOf("0.") !== -1 ? l : l.replace(/^0\./, ".");
358
358
  if (a = a.replace(/^#+([0.])/, "$1"), s = a.match(/^(0*)\.(#*)$/))
359
- return W + P(B, s[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
360
- if (s = a.match(/^#{1,3},##0(\.?)$/)) return W + ce(Z(B, 0));
359
+ return W + P(j, s[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
360
+ if (s = a.match(/^#{1,3},##0(\.?)$/)) return W + oe(Z(j, 0));
361
361
  if (s = a.match(/^#,##0\.([#0]*0)$/))
362
- return c < 0 ? "-" + $(f, a, -c) : ce("" + (Math.floor(c) + Y(c, s[1].length))) + "." + F(I(c, s[1].length), s[1].length);
362
+ return c < 0 ? "-" + $(f, a, -c) : oe("" + (Math.floor(c) + Y(c, s[1].length))) + "." + F(U(c, s[1].length), s[1].length);
363
363
  if (s = a.match(/^#,#*,#0/)) return $(f, a.replace(/^#,#*,/, ""), c);
364
364
  if (s = a.match(/^([0#]+)(\\?-([0#]+))+$/))
365
365
  return l = C($(f, a.replace(/[\\-]/g, ""), c)), O = 0, C(C(a.replace(/\\/g, "")).replace(/[0#]/g, function(q) {
@@ -369,9 +369,9 @@ var Ze = { exports: {} };
369
369
  return l = $(f, "##########", c), "(" + l.substr(0, 3) + ") " + l.substr(3, 3) + "-" + l.substr(6);
370
370
  var N = "";
371
371
  if (s = a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
372
- return O = Math.min(s[4].length, 7), L = fe(B, Math.pow(10, O) - 1, !1), l = "" + W, N = ae("n", s[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), l += N + s[2] + "/" + s[3], N = j(L[2], O), N.length < s[4].length && (N = A(s[4].substr(s[4].length - N.length)) + N), l += N, l;
372
+ return O = Math.min(s[4].length, 7), L = ge(j, Math.pow(10, O) - 1, !1), l = "" + W, N = ae("n", s[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), l += N + s[2] + "/" + s[3], N = B(L[2], O), N.length < s[4].length && (N = A(s[4].substr(s[4].length - N.length)) + N), l += N, l;
373
373
  if (s = a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
374
- return O = Math.min(Math.max(s[1].length, s[4].length), 7), L = fe(B, Math.pow(10, O) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? R(L[1], O) + s[2] + "/" + s[3] + j(L[2], O) : S(" ", 2 * O + 1 + s[2].length + s[3].length));
374
+ return O = Math.min(Math.max(s[1].length, s[4].length), 7), L = ge(j, Math.pow(10, O) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? R(L[1], O) + s[2] + "/" + s[3] + B(L[2], O) : S(" ", 2 * O + 1 + s[2].length + s[3].length));
375
375
  if (s = a.match(/^[#0?]+$/))
376
376
  return l = Z(c, 0), a.length <= l.length ? l : A(a.substr(0, a.length - l.length)) + l;
377
377
  if (s = a.match(/^([#0?]+)\.([#0]+)$/)) {
@@ -380,7 +380,7 @@ var Ze = { exports: {} };
380
380
  return A(a.substr(0, be) + l + a.substr(a.length - Ce));
381
381
  }
382
382
  if (s = a.match(/^00,000\.([#0]*0)$/))
383
- return O = I(c, s[1].length), c < 0 ? "-" + $(f, a, -c) : ce(E(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(q) {
383
+ return O = U(c, s[1].length), c < 0 ? "-" + $(f, a, -c) : oe(E(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(q) {
384
384
  return "00," + (q.length < 3 ? F(0, 3 - q.length) : "") + q;
385
385
  }) + "." + F(O, s[1].length);
386
386
  switch (a) {
@@ -389,7 +389,7 @@ var Ze = { exports: {} };
389
389
  case "###,###":
390
390
  case "##,###":
391
391
  case "#,###":
392
- var me = ce(Z(B, 0));
392
+ var me = oe(Z(j, 0));
393
393
  return me !== "0" ? W + me : "";
394
394
  case "###,###.00":
395
395
  return $(f, "###,##0.00", c).replace(/^0\./, ".");
@@ -418,8 +418,8 @@ var Ze = { exports: {} };
418
418
  var O = Math.floor(Math.log(a) * Math.LOG10E);
419
419
  c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (O - c.length + s) : c += "E+" + (O - s), c = c.replace(/\+-/, "-");
420
420
  }
421
- c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, B, W, N) {
422
- return B + W + N.substr(0, (l + s) % l) + "." + N.substr(s) + "E";
421
+ c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(L, j, W, N) {
422
+ return j + W + N.substr(0, (l + s) % l) + "." + N.substr(s) + "E";
423
423
  });
424
424
  } else c = a.toExponential(k);
425
425
  return f.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), f.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
@@ -433,21 +433,21 @@ var Ze = { exports: {} };
433
433
  if (a.indexOf("%") !== -1) return se(f, a, c);
434
434
  if (a.indexOf("E") !== -1) return K(a, c);
435
435
  if (a.charCodeAt(0) === 36) return "$" + v(f, a.substr(a.charAt(1) == " " ? 2 : 1), c);
436
- var l, s, O, L, B = Math.abs(c), W = c < 0 ? "-" : "";
437
- if (a.match(/^00+$/)) return W + F(B, a.length);
436
+ var l, s, O, L, j = Math.abs(c), W = c < 0 ? "-" : "";
437
+ if (a.match(/^00+$/)) return W + F(j, a.length);
438
438
  if (a.match(/^[#?]+$/))
439
439
  return l = "" + c, c === 0 && (l = ""), l.length > a.length ? l : A(a.substr(0, a.length - l.length)) + l;
440
- if (s = a.match(o)) return h(s, B, W);
441
- if (a.match(/^#+0+$/)) return W + F(B, a.length - a.indexOf("0"));
442
- if (s = a.match(M))
440
+ if (s = a.match(o)) return h(s, j, W);
441
+ if (a.match(/^#+0+$/)) return W + F(j, a.length - a.indexOf("0"));
442
+ if (s = a.match(x))
443
443
  return l = ("" + c).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])), l = l.replace(/\.(\d*)$/, function(q, pe) {
444
444
  return "." + pe + S("0", A(s[1]).length - pe.length);
445
445
  }), a.indexOf("0.") !== -1 ? l : l.replace(/^0\./, ".");
446
446
  if (a = a.replace(/^#+([0.])/, "$1"), s = a.match(/^(0*)\.(#*)$/))
447
- return W + ("" + B).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
448
- if (s = a.match(/^#{1,3},##0(\.?)$/)) return W + ce("" + B);
447
+ return W + ("" + j).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
448
+ if (s = a.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + j);
449
449
  if (s = a.match(/^#,##0\.([#0]*0)$/))
450
- return c < 0 ? "-" + v(f, a, -c) : ce("" + c) + "." + S("0", s[1].length);
450
+ return c < 0 ? "-" + v(f, a, -c) : oe("" + c) + "." + S("0", s[1].length);
451
451
  if (s = a.match(/^#,#*,#0/)) return v(f, a.replace(/^#,#*,/, ""), c);
452
452
  if (s = a.match(/^([0#]+)(\\?-([0#]+))+$/))
453
453
  return l = C(v(f, a.replace(/[\\-]/g, ""), c)), O = 0, C(C(a.replace(/\\/g, "")).replace(/[0#]/g, function(q) {
@@ -457,9 +457,9 @@ var Ze = { exports: {} };
457
457
  return l = v(f, "##########", c), "(" + l.substr(0, 3) + ") " + l.substr(3, 3) + "-" + l.substr(6);
458
458
  var N = "";
459
459
  if (s = a.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
460
- return O = Math.min(s[4].length, 7), L = fe(B, Math.pow(10, O) - 1, !1), l = "" + W, N = ae("n", s[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), l += N + s[2] + "/" + s[3], N = j(L[2], O), N.length < s[4].length && (N = A(s[4].substr(s[4].length - N.length)) + N), l += N, l;
460
+ return O = Math.min(s[4].length, 7), L = ge(j, Math.pow(10, O) - 1, !1), l = "" + W, N = ae("n", s[1], L[1]), N.charAt(N.length - 1) == " " && (N = N.substr(0, N.length - 1) + "0"), l += N + s[2] + "/" + s[3], N = B(L[2], O), N.length < s[4].length && (N = A(s[4].substr(s[4].length - N.length)) + N), l += N, l;
461
461
  if (s = a.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
462
- return O = Math.min(Math.max(s[1].length, s[4].length), 7), L = fe(B, Math.pow(10, O) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? R(L[1], O) + s[2] + "/" + s[3] + j(L[2], O) : S(" ", 2 * O + 1 + s[2].length + s[3].length));
462
+ return O = Math.min(Math.max(s[1].length, s[4].length), 7), L = ge(j, Math.pow(10, O) - 1, !0), W + (L[0] || (L[1] ? "" : "0")) + " " + (L[1] ? R(L[1], O) + s[2] + "/" + s[3] + B(L[2], O) : S(" ", 2 * O + 1 + s[2].length + s[3].length));
463
463
  if (s = a.match(/^[#0?]+$/))
464
464
  return l = "" + c, a.length <= l.length ? l : A(a.substr(0, a.length - l.length)) + l;
465
465
  if (s = a.match(/^([#0]+)\.([#0]+)$/)) {
@@ -468,14 +468,14 @@ var Ze = { exports: {} };
468
468
  return A(a.substr(0, be) + l + a.substr(a.length - Ce));
469
469
  }
470
470
  if (s = a.match(/^00,000\.([#0]*0)$/))
471
- return c < 0 ? "-" + v(f, a, -c) : ce("" + c).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(q) {
471
+ return c < 0 ? "-" + v(f, a, -c) : oe("" + c).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(q) {
472
472
  return "00," + (q.length < 3 ? F(0, 3 - q.length) : "") + q;
473
473
  }) + "." + F(0, s[1].length);
474
474
  switch (a) {
475
475
  case "###,###":
476
476
  case "##,###":
477
477
  case "#,###":
478
- var me = ce("" + B);
478
+ var me = oe("" + j);
479
479
  return me !== "0" ? W + me : "";
480
480
  default:
481
481
  if (a.match(/\.[0#?]*$/)) return v(f, a.slice(0, a.lastIndexOf(".")), c) + A(a.slice(a.lastIndexOf(".")));
@@ -487,12 +487,12 @@ var Ze = { exports: {} };
487
487
  };
488
488
  }();
489
489
  function Oe(t) {
490
- for (var e = [], r = !1, m = 0, i = 0; m < t.length; ++m) switch (
490
+ for (var e = [], n = !1, m = 0, i = 0; m < t.length; ++m) switch (
491
491
  /*cc=*/
492
492
  t.charCodeAt(m)
493
493
  ) {
494
494
  case 34:
495
- r = !r;
495
+ n = !n;
496
496
  break;
497
497
  case 95:
498
498
  case 42:
@@ -502,14 +502,14 @@ var Ze = { exports: {} };
502
502
  case 59:
503
503
  e[e.length] = t.substr(i, m - i), i = m + 1;
504
504
  }
505
- if (e[e.length] = t.substr(i), r === !0) throw new Error("Format |" + t + "| unterminated string ");
505
+ if (e[e.length] = t.substr(i), n === !0) throw new Error("Format |" + t + "| unterminated string ");
506
506
  return e;
507
507
  }
508
- p._split = Oe;
508
+ w._split = Oe;
509
509
  var we = /\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;
510
510
  function ye(t) {
511
- for (var e = 0, r = "", m = ""; e < t.length; )
512
- switch (r = t.charAt(e)) {
511
+ for (var e = 0, n = "", m = ""; e < t.length; )
512
+ switch (n = t.charAt(e)) {
513
513
  case "G":
514
514
  le(t, e) && (e += 6), e++;
515
515
  break;
@@ -555,17 +555,17 @@ var Ze = { exports: {} };
555
555
  ++e;
556
556
  break;
557
557
  case "[":
558
- for (m = r; t.charAt(e++) !== "]" && e < t.length; ) m += t.charAt(e);
558
+ for (m = n; t.charAt(e++) !== "]" && e < t.length; ) m += t.charAt(e);
559
559
  if (m.match(we)) return !0;
560
560
  break;
561
561
  case ".":
562
562
  case "0":
563
563
  case "#":
564
- for (; e < t.length && ("0#?.,E+-%".indexOf(r = t.charAt(++e)) > -1 || r == "\\" && t.charAt(e + 1) == "-" && "0#".indexOf(t.charAt(e + 2)) > -1); )
564
+ for (; e < t.length && ("0#?.,E+-%".indexOf(n = t.charAt(++e)) > -1 || n == "\\" && t.charAt(e + 1) == "-" && "0#".indexOf(t.charAt(e + 2)) > -1); )
565
565
  ;
566
566
  break;
567
567
  case "?":
568
- for (; t.charAt(++e) === r; )
568
+ for (; t.charAt(++e) === n; )
569
569
  ;
570
570
  break;
571
571
  case "*":
@@ -596,34 +596,34 @@ var Ze = { exports: {} };
596
596
  }
597
597
  return !1;
598
598
  }
599
- p.is_date = ye;
600
- function Me(t, e, r, m) {
601
- for (var i = [], o = "", n = 0, h = "", M = "t", d, _, A, P = "H"; n < t.length; )
602
- switch (h = t.charAt(n)) {
599
+ w.is_date = ye;
600
+ function Me(t, e, n, m) {
601
+ for (var i = [], o = "", r = 0, h = "", x = "t", d, _, A, P = "H"; r < t.length; )
602
+ switch (h = t.charAt(r)) {
603
603
  case "G":
604
- if (!le(t, n)) throw new Error("unrecognized character " + h + " in " + t);
605
- i[i.length] = { t: "G", v: "General" }, n += 7;
604
+ if (!le(t, r)) throw new Error("unrecognized character " + h + " in " + t);
605
+ i[i.length] = { t: "G", v: "General" }, r += 7;
606
606
  break;
607
607
  case '"':
608
- for (o = ""; (A = t.charCodeAt(++n)) !== 34 && n < t.length; ) o += String.fromCharCode(A);
609
- i[i.length] = { t: "t", v: o }, ++n;
608
+ for (o = ""; (A = t.charCodeAt(++r)) !== 34 && r < t.length; ) o += String.fromCharCode(A);
609
+ i[i.length] = { t: "t", v: o }, ++r;
610
610
  break;
611
611
  case "\\":
612
- var I = t.charAt(++n), Y = I === "(" || I === ")" ? I : "t";
613
- i[i.length] = { t: Y, v: I }, ++n;
612
+ var U = t.charAt(++r), Y = U === "(" || U === ")" ? U : "t";
613
+ i[i.length] = { t: Y, v: U }, ++r;
614
614
  break;
615
615
  case "_":
616
- i[i.length] = { t: "t", v: " " }, n += 2;
616
+ i[i.length] = { t: "t", v: " " }, r += 2;
617
617
  break;
618
618
  case "@":
619
- i[i.length] = { t: "T", v: e }, ++n;
619
+ i[i.length] = { t: "T", v: e }, ++r;
620
620
  break;
621
621
  case "B":
622
622
  case "b":
623
- if (t.charAt(n + 1) === "1" || t.charAt(n + 1) === "2") {
624
- if (d == null && (d = ge(e, r, t.charAt(n + 1) === "2"), d == null))
623
+ if (t.charAt(r + 1) === "1" || t.charAt(r + 1) === "2") {
624
+ if (d == null && (d = de(e, n, t.charAt(r + 1) === "2"), d == null))
625
625
  return "";
626
- i[i.length] = { t: "X", v: t.substr(n, 2) }, M = h, n += 2;
626
+ i[i.length] = { t: "X", v: t.substr(r, 2) }, x = h, r += 2;
627
627
  break;
628
628
  }
629
629
  case "M":
@@ -640,48 +640,48 @@ var Ze = { exports: {} };
640
640
  case "s":
641
641
  case "e":
642
642
  case "g":
643
- if (e < 0 || d == null && (d = ge(e, r), d == null))
643
+ if (e < 0 || d == null && (d = de(e, n), d == null))
644
644
  return "";
645
- for (o = h; ++n < t.length && t.charAt(n).toLowerCase() === h; ) o += h;
646
- h === "m" && M.toLowerCase() === "h" && (h = "M"), h === "h" && (h = P), i[i.length] = { t: h, v: o }, M = h;
645
+ for (o = h; ++r < t.length && t.charAt(r).toLowerCase() === h; ) o += h;
646
+ h === "m" && x.toLowerCase() === "h" && (h = "M"), h === "h" && (h = P), i[i.length] = { t: h, v: o }, x = h;
647
647
  break;
648
648
  case "A":
649
649
  case "a":
650
650
  case "上":
651
651
  var E = { t: h, v: h };
652
- if (d == null && (d = ge(e, r)), t.substr(n, 3).toUpperCase() === "A/P" ? (d != null && (E.v = d.H >= 12 ? "P" : "A"), E.t = "T", P = "h", n += 3) : t.substr(n, 5).toUpperCase() === "AM/PM" ? (d != null && (E.v = d.H >= 12 ? "PM" : "AM"), E.t = "T", n += 5, P = "h") : t.substr(n, 5).toUpperCase() === "上午/下午" ? (d != null && (E.v = d.H >= 12 ? "下午" : "上午"), E.t = "T", n += 5, P = "h") : (E.t = "t", ++n), d == null && E.t === "T") return "";
653
- i[i.length] = E, M = h;
652
+ if (d == null && (d = de(e, n)), t.substr(r, 3).toUpperCase() === "A/P" ? (d != null && (E.v = d.H >= 12 ? "P" : "A"), E.t = "T", P = "h", r += 3) : t.substr(r, 5).toUpperCase() === "AM/PM" ? (d != null && (E.v = d.H >= 12 ? "PM" : "AM"), E.t = "T", r += 5, P = "h") : t.substr(r, 5).toUpperCase() === "上午/下午" ? (d != null && (E.v = d.H >= 12 ? "下午" : "上午"), E.t = "T", r += 5, P = "h") : (E.t = "t", ++r), d == null && E.t === "T") return "";
653
+ i[i.length] = E, x = h;
654
654
  break;
655
655
  case "[":
656
- for (o = h; t.charAt(n++) !== "]" && n < t.length; ) o += t.charAt(n);
656
+ for (o = h; t.charAt(r++) !== "]" && r < t.length; ) o += t.charAt(r);
657
657
  if (o.slice(-1) !== "]") throw 'unterminated "[" block: |' + o + "|";
658
658
  if (o.match(we)) {
659
- if (d == null && (d = ge(e, r), d == null))
659
+ if (d == null && (d = de(e, n), d == null))
660
660
  return "";
661
- i[i.length] = { t: "Z", v: o.toLowerCase() }, M = o.charAt(1);
661
+ i[i.length] = { t: "Z", v: o.toLowerCase() }, x = o.charAt(1);
662
662
  } else o.indexOf("$") > -1 && (o = (o.match(/\$([^-\[\]]*)/) || [])[1] || "$", ye(t) || (i[i.length] = { t: "t", v: o }));
663
663
  break;
664
664
  case ".":
665
665
  if (d != null) {
666
- for (o = h; ++n < t.length && (h = t.charAt(n)) === "0"; ) o += h;
666
+ for (o = h; ++r < t.length && (h = t.charAt(r)) === "0"; ) o += h;
667
667
  i[i.length] = { t: "s", v: o };
668
668
  break;
669
669
  }
670
670
  case "0":
671
671
  case "#":
672
- for (o = h; ++n < t.length && "0#?.,E+-%".indexOf(h = t.charAt(n)) > -1; ) o += h;
672
+ for (o = h; ++r < t.length && "0#?.,E+-%".indexOf(h = t.charAt(r)) > -1; ) o += h;
673
673
  i[i.length] = { t: "n", v: o };
674
674
  break;
675
675
  case "?":
676
- for (o = h; t.charAt(++n) === h; ) o += h;
677
- i[i.length] = { t: h, v: o }, M = h;
676
+ for (o = h; t.charAt(++r) === h; ) o += h;
677
+ i[i.length] = { t: h, v: o }, x = h;
678
678
  break;
679
679
  case "*":
680
- ++n, (t.charAt(n) == " " || t.charAt(n) == "*") && ++n;
680
+ ++r, (t.charAt(r) == " " || t.charAt(r) == "*") && ++r;
681
681
  break;
682
682
  case "(":
683
683
  case ")":
684
- i[i.length] = { t: m === 1 ? "t" : h, v: h }, ++n;
684
+ i[i.length] = { t: m === 1 ? "t" : h, v: h }, ++r;
685
685
  break;
686
686
  case "1":
687
687
  case "2":
@@ -692,42 +692,42 @@ var Ze = { exports: {} };
692
692
  case "7":
693
693
  case "8":
694
694
  case "9":
695
- for (o = h; n < t.length && "0123456789".indexOf(t.charAt(++n)) > -1; ) o += t.charAt(n);
695
+ for (o = h; r < t.length && "0123456789".indexOf(t.charAt(++r)) > -1; ) o += t.charAt(r);
696
696
  i[i.length] = { t: "D", v: o };
697
697
  break;
698
698
  case " ":
699
- i[i.length] = { t: h, v: h }, ++n;
699
+ i[i.length] = { t: h, v: h }, ++r;
700
700
  break;
701
701
  case "$":
702
- i[i.length] = { t: "t", v: "$" }, ++n;
702
+ i[i.length] = { t: "t", v: "$" }, ++r;
703
703
  break;
704
704
  default:
705
705
  if (",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(h) === -1) throw new Error("unrecognized character " + h + " in " + t);
706
- i[i.length] = { t: "t", v: h }, ++n;
706
+ i[i.length] = { t: "t", v: h }, ++r;
707
707
  break;
708
708
  }
709
709
  var $ = 0, G = 0, se;
710
- for (n = i.length - 1, M = "t"; n >= 0; --n)
711
- switch (i[n].t) {
710
+ for (r = i.length - 1, x = "t"; r >= 0; --r)
711
+ switch (i[r].t) {
712
712
  case "h":
713
713
  case "H":
714
- i[n].t = P, M = "h", $ < 1 && ($ = 1);
714
+ i[r].t = P, x = "h", $ < 1 && ($ = 1);
715
715
  break;
716
716
  case "s":
717
- (se = i[n].v.match(/\.0+$/)) && (G = Math.max(G, se[0].length - 1)), $ < 3 && ($ = 3);
717
+ (se = i[r].v.match(/\.0+$/)) && (G = Math.max(G, se[0].length - 1)), $ < 3 && ($ = 3);
718
718
  case "d":
719
719
  case "y":
720
720
  case "M":
721
721
  case "e":
722
- M = i[n].t;
722
+ x = i[r].t;
723
723
  break;
724
724
  case "m":
725
- M === "s" && (i[n].t = "M", $ < 2 && ($ = 2));
725
+ x === "s" && (i[r].t = "M", $ < 2 && ($ = 2));
726
726
  break;
727
727
  case "X":
728
728
  break;
729
729
  case "Z":
730
- $ < 1 && i[n].v.match(/[Hh]/) && ($ = 1), $ < 2 && i[n].v.match(/[Mm]/) && ($ = 2), $ < 3 && i[n].v.match(/[Ss]/) && ($ = 3);
730
+ $ < 1 && i[r].v.match(/[Hh]/) && ($ = 1), $ < 2 && i[r].v.match(/[Mm]/) && ($ = 2), $ < 3 && i[r].v.match(/[Ss]/) && ($ = 3);
731
731
  }
732
732
  switch ($) {
733
733
  case 0:
@@ -740,15 +740,15 @@ var Ze = { exports: {} };
740
740
  break;
741
741
  }
742
742
  var K = "", v;
743
- for (n = 0; n < i.length; ++n)
744
- switch (i[n].t) {
743
+ for (r = 0; r < i.length; ++r)
744
+ switch (i[r].t) {
745
745
  case "t":
746
746
  case "T":
747
747
  case " ":
748
748
  case "D":
749
749
  break;
750
750
  case "X":
751
- i[n].v = "", i[n].t = ";";
751
+ i[r].v = "", i[r].t = ";";
752
752
  break;
753
753
  case "d":
754
754
  case "m":
@@ -760,149 +760,149 @@ var Ze = { exports: {} };
760
760
  case "e":
761
761
  case "b":
762
762
  case "Z":
763
- i[n].v = Ve(i[n].t.charCodeAt(0), i[n].v, d, G), i[n].t = "t";
763
+ i[r].v = Ve(i[r].t.charCodeAt(0), i[r].v, d, G), i[r].t = "t";
764
764
  break;
765
765
  case "n":
766
766
  case "?":
767
- for (v = n + 1; i[v] != null && ((h = i[v].t) === "?" || h === "D" || (h === " " || h === "t") && i[v + 1] != null && (i[v + 1].t === "?" || i[v + 1].t === "t" && i[v + 1].v === "/") || i[n].t === "(" && (h === " " || h === "n" || h === ")") || h === "t" && (i[v].v === "/" || i[v].v === " " && i[v + 1] != null && i[v + 1].t == "?")); )
768
- i[n].v += i[v].v, i[v] = { v: "", t: ";" }, ++v;
769
- K += i[n].v, n = v - 1;
767
+ for (v = r + 1; i[v] != null && ((h = i[v].t) === "?" || h === "D" || (h === " " || h === "t") && i[v + 1] != null && (i[v + 1].t === "?" || i[v + 1].t === "t" && i[v + 1].v === "/") || i[r].t === "(" && (h === " " || h === "n" || h === ")") || h === "t" && (i[v].v === "/" || i[v].v === " " && i[v + 1] != null && i[v + 1].t == "?")); )
768
+ i[r].v += i[v].v, i[v] = { v: "", t: ";" }, ++v;
769
+ K += i[r].v, r = v - 1;
770
770
  break;
771
771
  case "G":
772
- i[n].t = "t", i[n].v = Ae(e, r);
772
+ i[r].t = "t", i[r].v = Ae(e, n);
773
773
  break;
774
774
  }
775
775
  var f = "", a, c;
776
776
  if (K.length > 0) {
777
777
  K.charCodeAt(0) == 40 ? (a = e < 0 && K.charCodeAt(0) === 45 ? -e : e, c = ae("n", K, a)) : (a = e < 0 && m > 1 ? -e : e, c = ae("n", K, a), a < 0 && i[0] && i[0].t == "t" && (c = c.substr(1), i[0].v = "-" + i[0].v)), v = c.length - 1;
778
778
  var k = i.length;
779
- for (n = 0; n < i.length; ++n) if (i[n] != null && i[n].t != "t" && i[n].v.indexOf(".") > -1) {
780
- k = n;
779
+ for (r = 0; r < i.length; ++r) if (i[r] != null && i[r].t != "t" && i[r].v.indexOf(".") > -1) {
780
+ k = r;
781
781
  break;
782
782
  }
783
783
  var l = i.length;
784
784
  if (k === i.length && c.indexOf("E") === -1) {
785
- for (n = i.length - 1; n >= 0; --n)
786
- i[n] == null || "n?".indexOf(i[n].t) === -1 || (v >= i[n].v.length - 1 ? (v -= i[n].v.length, i[n].v = c.substr(v + 1, i[n].v.length)) : v < 0 ? i[n].v = "" : (i[n].v = c.substr(0, v + 1), v = -1), i[n].t = "t", l = n);
785
+ for (r = i.length - 1; r >= 0; --r)
786
+ i[r] == null || "n?".indexOf(i[r].t) === -1 || (v >= i[r].v.length - 1 ? (v -= i[r].v.length, i[r].v = c.substr(v + 1, i[r].v.length)) : v < 0 ? i[r].v = "" : (i[r].v = c.substr(0, v + 1), v = -1), i[r].t = "t", l = r);
787
787
  v >= 0 && l < i.length && (i[l].v = c.substr(0, v + 1) + i[l].v);
788
788
  } else if (k !== i.length && c.indexOf("E") === -1) {
789
- for (v = c.indexOf(".") - 1, n = k; n >= 0; --n)
790
- if (!(i[n] == null || "n?".indexOf(i[n].t) === -1)) {
791
- for (_ = i[n].v.indexOf(".") > -1 && n === k ? i[n].v.indexOf(".") - 1 : i[n].v.length - 1, f = i[n].v.substr(_ + 1); _ >= 0; --_)
792
- v >= 0 && (i[n].v.charAt(_) === "0" || i[n].v.charAt(_) === "#") && (f = c.charAt(v--) + f);
793
- i[n].v = f, i[n].t = "t", l = n;
789
+ for (v = c.indexOf(".") - 1, r = k; r >= 0; --r)
790
+ if (!(i[r] == null || "n?".indexOf(i[r].t) === -1)) {
791
+ for (_ = i[r].v.indexOf(".") > -1 && r === k ? i[r].v.indexOf(".") - 1 : i[r].v.length - 1, f = i[r].v.substr(_ + 1); _ >= 0; --_)
792
+ v >= 0 && (i[r].v.charAt(_) === "0" || i[r].v.charAt(_) === "#") && (f = c.charAt(v--) + f);
793
+ i[r].v = f, i[r].t = "t", l = r;
794
794
  }
795
- for (v >= 0 && l < i.length && (i[l].v = c.substr(0, v + 1) + i[l].v), v = c.indexOf(".") + 1, n = k; n < i.length; ++n)
796
- if (!(i[n] == null || "n?(".indexOf(i[n].t) === -1 && n !== k)) {
797
- for (_ = i[n].v.indexOf(".") > -1 && n === k ? i[n].v.indexOf(".") + 1 : 0, f = i[n].v.substr(0, _); _ < i[n].v.length; ++_)
795
+ for (v >= 0 && l < i.length && (i[l].v = c.substr(0, v + 1) + i[l].v), v = c.indexOf(".") + 1, r = k; r < i.length; ++r)
796
+ if (!(i[r] == null || "n?(".indexOf(i[r].t) === -1 && r !== k)) {
797
+ for (_ = i[r].v.indexOf(".") > -1 && r === k ? i[r].v.indexOf(".") + 1 : 0, f = i[r].v.substr(0, _); _ < i[r].v.length; ++_)
798
798
  v < c.length && (f += c.charAt(v++));
799
- i[n].v = f, i[n].t = "t", l = n;
799
+ i[r].v = f, i[r].t = "t", l = r;
800
800
  }
801
801
  }
802
802
  }
803
- for (n = 0; n < i.length; ++n) i[n] != null && "n?".indexOf(i[n].t) > -1 && (a = m > 1 && e < 0 && n > 0 && i[n - 1].v === "-" ? -e : e, i[n].v = ae(i[n].t, i[n].v, a), i[n].t = "t");
803
+ for (r = 0; r < i.length; ++r) i[r] != null && "n?".indexOf(i[r].t) > -1 && (a = m > 1 && e < 0 && r > 0 && i[r - 1].v === "-" ? -e : e, i[r].v = ae(i[r].t, i[r].v, a), i[r].t = "t");
804
804
  var s = "";
805
- for (n = 0; n !== i.length; ++n) i[n] != null && (s += i[n].v);
805
+ for (r = 0; r !== i.length; ++r) i[r] != null && (s += i[r].v);
806
806
  return s;
807
807
  }
808
- p._eval = Me;
808
+ w._eval = Me;
809
809
  var Se = /\[[=<>]/, ve = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
810
810
  function Q(t, e) {
811
811
  if (e == null) return !1;
812
- var r = parseFloat(e[2]);
812
+ var n = parseFloat(e[2]);
813
813
  switch (e[1]) {
814
814
  case "=":
815
- if (t == r) return !0;
815
+ if (t == n) return !0;
816
816
  break;
817
817
  case ">":
818
- if (t > r) return !0;
818
+ if (t > n) return !0;
819
819
  break;
820
820
  case "<":
821
- if (t < r) return !0;
821
+ if (t < n) return !0;
822
822
  break;
823
823
  case "<>":
824
- if (t != r) return !0;
824
+ if (t != n) return !0;
825
825
  break;
826
826
  case ">=":
827
- if (t >= r) return !0;
827
+ if (t >= n) return !0;
828
828
  break;
829
829
  case "<=":
830
- if (t <= r) return !0;
830
+ if (t <= n) return !0;
831
831
  break;
832
832
  }
833
833
  return !1;
834
834
  }
835
- function oe(t, e) {
836
- var r = Oe(t), m = r.length, i = r[m - 1].indexOf("@");
837
- if (m < 4 && i > -1 && --m, r.length > 4) throw new Error("cannot find right format for |" + r.join("|") + "|");
838
- if (typeof e != "number") return [4, r.length === 4 || i > -1 ? r[r.length - 1] : "@"];
839
- switch (r.length) {
835
+ function ie(t, e) {
836
+ var n = Oe(t), m = n.length, i = n[m - 1].indexOf("@");
837
+ if (m < 4 && i > -1 && --m, n.length > 4) throw new Error("cannot find right format for |" + n.join("|") + "|");
838
+ if (typeof e != "number") return [4, n.length === 4 || i > -1 ? n[n.length - 1] : "@"];
839
+ switch (n.length) {
840
840
  case 1:
841
- r = i > -1 ? ["General", "General", "General", r[0]] : [r[0], r[0], r[0], "@"];
841
+ n = i > -1 ? ["General", "General", "General", n[0]] : [n[0], n[0], n[0], "@"];
842
842
  break;
843
843
  case 2:
844
- r = i > -1 ? [r[0], r[0], r[0], r[1]] : [r[0], r[1], r[0], "@"];
844
+ n = i > -1 ? [n[0], n[0], n[0], n[1]] : [n[0], n[1], n[0], "@"];
845
845
  break;
846
846
  case 3:
847
- r = i > -1 ? [r[0], r[1], r[0], r[2]] : [r[0], r[1], r[2], "@"];
847
+ n = i > -1 ? [n[0], n[1], n[0], n[2]] : [n[0], n[1], n[2], "@"];
848
848
  break;
849
849
  }
850
- var o = e > 0 ? r[0] : e < 0 ? r[1] : r[2];
851
- if (r[0].indexOf("[") === -1 && r[1].indexOf("[") === -1) return [m, o];
852
- if (r[0].match(Se) != null || r[1].match(Se) != null) {
853
- var n = r[0].match(ve), h = r[1].match(ve);
854
- return Q(e, n) ? [m, r[0]] : Q(e, h) ? [m, r[1]] : [m, r[n != null && h != null ? 2 : 1]];
850
+ var o = e > 0 ? n[0] : e < 0 ? n[1] : n[2];
851
+ if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m, o];
852
+ if (n[0].match(Se) != null || n[1].match(Se) != null) {
853
+ var r = n[0].match(ve), h = n[1].match(ve);
854
+ return Q(e, r) ? [m, n[0]] : Q(e, h) ? [m, n[1]] : [m, n[r != null && h != null ? 2 : 1]];
855
855
  }
856
856
  return [m, o];
857
857
  }
858
- function te(t, e, r) {
859
- r == null && (r = {});
858
+ function te(t, e, n) {
859
+ n == null && (n = {});
860
860
  var m = "";
861
861
  switch (typeof t) {
862
862
  case "string":
863
- t == "m/d/yy" && r.dateNF ? m = r.dateNF : m = t;
863
+ t == "m/d/yy" && n.dateNF ? m = n.dateNF : m = t;
864
864
  break;
865
865
  case "number":
866
- t == 14 && r.dateNF ? m = r.dateNF : m = (r.table != null ? r.table : ie)[t], m == null && (m = r.table && r.table[J[t]] || ie[J[t]]), m == null && (m = z[t] || "General");
866
+ t == 14 && n.dateNF ? m = n.dateNF : m = (n.table != null ? n.table : ce)[t], m == null && (m = n.table && n.table[J[t]] || ce[J[t]]), m == null && (m = z[t] || "General");
867
867
  break;
868
868
  }
869
- if (le(m, 0)) return Ae(e, r);
870
- e instanceof Date && (e = Te(e, r.date1904));
871
- var i = oe(m, e);
872
- if (le(i[1])) return Ae(e, r);
869
+ if (le(m, 0)) return Ae(e, n);
870
+ e instanceof Date && (e = Te(e, n.date1904));
871
+ var i = ie(m, e);
872
+ if (le(i[1])) return Ae(e, n);
873
873
  if (e === !0) e = "TRUE";
874
874
  else if (e === !1) e = "FALSE";
875
875
  else if (e === "" || e == null) return "";
876
- return Me(i[1], e, r, i[0]);
876
+ return Me(i[1], e, n, i[0]);
877
877
  }
878
- function de(t, e) {
878
+ function he(t, e) {
879
879
  if (typeof e != "number") {
880
880
  e = +e || -1;
881
- for (var r = 0; r < 392; ++r) {
882
- if (ie[r] == null) {
883
- e < 0 && (e = r);
881
+ for (var n = 0; n < 392; ++n) {
882
+ if (ce[n] == null) {
883
+ e < 0 && (e = n);
884
884
  continue;
885
885
  }
886
- if (ie[r] == t) {
887
- e = r;
886
+ if (ce[n] == t) {
887
+ e = n;
888
888
  break;
889
889
  }
890
890
  }
891
891
  e < 0 && (e = 391);
892
892
  }
893
- return ie[e] = t, e;
893
+ return ce[e] = t, e;
894
894
  }
895
- p.load = de, p._table = ie, p.get_table = function() {
896
- return ie;
897
- }, p.load_table = function(e) {
898
- for (var r = 0; r != 392; ++r)
899
- e[r] !== void 0 && de(e[r], r);
900
- }, p.init_table = $e, p.format = te;
895
+ w.load = he, w._table = ce, w.get_table = function() {
896
+ return ce;
897
+ }, w.load_table = function(e) {
898
+ for (var n = 0; n != 392; ++n)
899
+ e[n] !== void 0 && he(e[n], n);
900
+ }, w.init_table = $e, w.format = te;
901
901
  };
902
902
  g(u), typeof DO_NOT_EXPORT_SSF > "u" && (y.exports = u);
903
- })(Ze);
904
- var it = Ze.exports;
905
- const De = /* @__PURE__ */ Ke(it), je = [
903
+ })(Je);
904
+ var it = Je.exports;
905
+ const De = /* @__PURE__ */ et(it), Be = [
906
906
  "228, 232, 237",
907
907
  // Light Gray
908
908
  "219, 233, 236",
@@ -927,71 +927,78 @@ const De = /* @__PURE__ */ Ke(it), je = [
927
927
  // Cyan
928
928
  "244, 239, 234"
929
929
  // Cream
930
- ], ze = je[0], ct = [
930
+ ], qe = Be[0], ct = [
931
931
  ["true", "false"],
932
932
  ["yes", "no"],
933
933
  ["1", "0"]
934
934
  ];
935
935
  function ot(y, u) {
936
- const g = y.toLowerCase(), w = u.toLowerCase();
937
- return ct.some(([p, C]) => g === p && w === C);
936
+ const g = y.toLowerCase(), p = u.toLowerCase();
937
+ return ct.some(([w, C]) => g === w && p === C);
938
938
  }
939
939
  const lt = 200;
940
940
  function st() {
941
941
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `sheet-${Date.now()}-${Math.random().toString(36).slice(2)}`;
942
942
  }
943
- function ut(y) {
943
+ function ut(y, u) {
944
+ if (!u.has(y)) return y;
945
+ let g = 1, p = `${y} (${g})`;
946
+ for (; u.has(p); )
947
+ g += 1, p = `${y} (${g})`;
948
+ return p;
949
+ }
950
+ function ht(y) {
944
951
  if (!Array.isArray(y) || y.length === 0) return null;
945
- const u = y.map((w) => String((w == null ? void 0 : w.v) ?? "")).join("");
952
+ const u = y.map((p) => String((p == null ? void 0 : p.v) ?? "")).join("");
946
953
  return u.trim() ? u : null;
947
954
  }
948
- function ht(y) {
955
+ function ft(y) {
949
956
  return y ? "TRUE" : "FALSE";
950
957
  }
951
- function ft(y) {
958
+ function gt(y) {
952
959
  let u = !1, g = 0;
953
- const w = () => {
960
+ const p = () => {
954
961
  if (u) return !0;
955
962
  const C = y.current;
956
963
  if (!(C != null && C.getWorkbookContext) || !C.recalculateAllFormulas) return !1;
957
964
  const S = C.getWorkbookContext(), F = S == null ? void 0 : S.luckysheetfile;
958
965
  return !(F != null && F.length) || !F.some(
959
- (j) => Array.isArray(j.data) && j.data.length > 0
966
+ (B) => Array.isArray(B.data) && B.data.length > 0
960
967
  ) ? !1 : (C.recalculateAllFormulas(), u = !0, !0);
961
- }, p = () => {
968
+ }, w = () => {
962
969
  var C, S;
963
- w() || (g += 1, g < lt ? requestAnimationFrame(p) : ((S = (C = y.current) == null ? void 0 : C.recalculateAllFormulas) == null || S.call(C), u = !0));
970
+ p() || (g += 1, g < lt ? requestAnimationFrame(w) : ((S = (C = y.current) == null ? void 0 : C.recalculateAllFormulas) == null || S.call(C), u = !0));
964
971
  };
965
- requestAnimationFrame(() => requestAnimationFrame(p));
972
+ requestAnimationFrame(() => requestAnimationFrame(w));
966
973
  for (const C of [120, 400, 1200])
967
974
  window.setTimeout(() => {
968
- u || w();
975
+ u || p();
969
976
  }, C);
970
977
  }
971
- function gt(y) {
972
- return y <= 0 ? ze : y > je.length ? Array(y).fill(ze).join(", ") : je.slice(0, y).join(", ");
978
+ function dt(y) {
979
+ return y <= 0 ? qe : y > Be.length ? Array(y).fill(qe).join(", ") : Be.slice(0, y).join(", ");
973
980
  }
974
- function Be(y) {
981
+ function je(y) {
975
982
  const u = y.match(/^([A-Z]+)(\d+)$/i);
976
983
  if (!u) return null;
977
- const g = u[1].toUpperCase(), w = u[2];
978
- let p = 0;
984
+ const g = u[1].toUpperCase(), p = u[2];
985
+ let w = 0;
979
986
  for (let F = 0; F < g.length; F++)
980
- p = p * 26 + (g.charCodeAt(F) - 64);
981
- const C = parseInt(w, 10) - 1, S = p - 1;
987
+ w = w * 26 + (g.charCodeAt(F) - 64);
988
+ const C = parseInt(p, 10) - 1, S = w - 1;
982
989
  return { row: C, col: S };
983
990
  }
984
- function dt(y, u) {
985
- const g = Be(y);
991
+ function bt(y, u) {
992
+ const g = je(y);
986
993
  if (!g) return null;
987
- const { row: w, col: p } = g, C = `${w}_${p}`, S = Array.isArray(u.formulae) && u.formulae.length > 0 ? String(u.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", F = S.split(",").map((le) => le.trim()).filter(Boolean);
988
- let R = u.type === "list" ? "dropdown" : u.type || "dropdown", j = S, ee = "";
989
- u.type === "list" && F.length === 2 && ot(F[0], F[1]) && (R = "checkbox", j = F[0], ee = F[1]);
990
- const ke = R === "checkbox" ? 1 : j ? j.split(",").length : 0, D = gt(ke || 1), Z = {
994
+ const { row: p, col: w } = g, C = `${p}_${w}`, S = Array.isArray(u.formulae) && u.formulae.length > 0 ? String(u.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", F = S.split(",").map((le) => le.trim()).filter(Boolean);
995
+ let R = u.type === "list" ? "dropdown" : u.type || "dropdown", B = S, ee = "";
996
+ u.type === "list" && F.length === 2 && ot(F[0], F[1]) && (R = "checkbox", B = F[0], ee = F[1]);
997
+ const ke = R === "checkbox" ? 1 : B ? B.split(",").length : 0, D = dt(ke || 1), Z = {
991
998
  type: R,
992
999
  type2: "",
993
1000
  rangeTxt: y,
994
- value1: j,
1001
+ value1: B,
995
1002
  value2: ee,
996
1003
  validity: "",
997
1004
  remote: !1,
@@ -1003,24 +1010,24 @@ function dt(y, u) {
1003
1010
  };
1004
1011
  return { rowColKey: C, entry: Z };
1005
1012
  }
1006
- function bt(y) {
1007
- const u = y.split(":"), g = Be(u[0].trim());
1013
+ function mt(y) {
1014
+ const u = y.split(":"), g = je(u[0].trim());
1008
1015
  if (!g) return null;
1009
- const w = u.length > 1 ? Be(u[1].trim()) : g;
1010
- return w ? {
1011
- row: [Math.min(g.row, w.row), Math.max(g.row, w.row)],
1012
- column: [Math.min(g.col, w.col), Math.max(g.col, w.col)]
1016
+ const p = u.length > 1 ? je(u[1].trim()) : g;
1017
+ return p ? {
1018
+ row: [Math.min(g.row, p.row), Math.max(g.row, p.row)],
1019
+ column: [Math.min(g.col, p.col), Math.max(g.col, p.col)]
1013
1020
  } : null;
1014
1021
  }
1015
- function mt(y) {
1016
- return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) => bt(u)).filter(
1022
+ function pt(y) {
1023
+ return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) => mt(u)).filter(
1017
1024
  (u) => !!u
1018
1025
  );
1019
1026
  }
1020
- function qe(y) {
1021
- const u = mt(y);
1027
+ function Xe(y) {
1028
+ const u = pt(y);
1022
1029
  return u.length ? u.map((g) => {
1023
- const [w, p] = g.row, [C, S] = g.column;
1030
+ const [p, w] = g.row, [C, S] = g.column;
1024
1031
  return {
1025
1032
  left: 0,
1026
1033
  width: 104,
@@ -1030,15 +1037,15 @@ function qe(y) {
1030
1037
  width_move: 104,
1031
1038
  top_move: 0,
1032
1039
  height_move: 11999,
1033
- row: [w, p],
1040
+ row: [p, w],
1034
1041
  column: [C, S],
1035
- row_focus: w,
1042
+ row_focus: p,
1036
1043
  column_focus: C,
1037
1044
  column_select: !0
1038
1045
  };
1039
1046
  }) : null;
1040
1047
  }
1041
- function Xe(y) {
1048
+ function Ze(y) {
1042
1049
  var S, F;
1043
1050
  const u = {
1044
1051
  textColor: "#000000",
@@ -1049,18 +1056,18 @@ function Xe(y) {
1049
1056
  strikethrough: !1
1050
1057
  };
1051
1058
  if (!y) return u;
1052
- const g = y.font, w = y.fill;
1053
- let p = u.textColor, C = u.cellColor;
1059
+ const g = y.font, p = y.fill;
1060
+ let w = u.textColor, C = u.cellColor;
1054
1061
  if ((S = g == null ? void 0 : g.color) != null && S.argb) {
1055
1062
  const R = g.color.argb;
1056
- p = "#" + (R.length >= 6 ? R.slice(-6) : R);
1063
+ w = "#" + (R.length >= 6 ? R.slice(-6) : R);
1057
1064
  }
1058
- if ((w == null ? void 0 : w.type) === "pattern" && w.pattern === "solid" && ((F = w.fgColor) != null && F.argb)) {
1059
- const R = w.fgColor.argb;
1065
+ if ((p == null ? void 0 : p.type) === "pattern" && p.pattern === "solid" && ((F = p.fgColor) != null && F.argb)) {
1066
+ const R = p.fgColor.argb;
1060
1067
  C = "#" + (R.length >= 6 ? R.slice(-6) : R);
1061
1068
  }
1062
1069
  return {
1063
- textColor: p,
1070
+ textColor: w,
1064
1071
  cellColor: C,
1065
1072
  bold: !!(g != null && g.bold),
1066
1073
  italic: !!(g != null && g.italic),
@@ -1068,44 +1075,44 @@ function Xe(y) {
1068
1075
  strikethrough: !1
1069
1076
  };
1070
1077
  }
1071
- function Je(y) {
1078
+ function Qe(y) {
1072
1079
  if (!y || typeof y != "string") return "";
1073
1080
  const u = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&").replace(/^=/, ""), g = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
1074
1081
  if (g) return (g[1] ?? "").replace(/""/g, '"');
1075
- const w = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
1076
- return w ? w[1] ?? "" : "";
1082
+ const p = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
1083
+ return p ? p[1] ?? "" : "";
1077
1084
  }
1078
1085
  function Pe(y) {
1079
1086
  if (!y || typeof y != "string") return "";
1080
1087
  const u = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/^=/, ""), g = u.match(/"((?:[^"]|"")*)"/);
1081
1088
  if (g) return (g[1] ?? "").replace(/""/g, '"');
1082
- const w = u.match(/'([^']*)'/);
1083
- return w ? w[1] ?? "" : "";
1089
+ const p = u.match(/'([^']*)'/);
1090
+ return p ? p[1] ?? "" : "";
1084
1091
  }
1085
- function pt(y) {
1092
+ function wt(y) {
1086
1093
  if (!y || typeof y != "string") return null;
1087
- const u = y.trim().toUpperCase(), g = Je(y) || Pe(y);
1094
+ const u = y.trim().toUpperCase(), g = Qe(y) || Pe(y);
1088
1095
  return g ? u.includes("SEARCH(") ? u.includes("ISERROR(SEARCH(") || u.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : u.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : u.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : u.includes("EXACT(") || u.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
1089
1096
  }
1090
- function wt(y, u, g) {
1091
- const w = (y || "").toLowerCase();
1092
- if (w === "cellis") {
1093
- const p = (u || "").toLowerCase();
1094
- return p === "greaterthan" ? { conditionName: "greaterThan", conditionValue: [] } : p === "greaterthanorequal" ? { conditionName: "greaterThanOrEqual", conditionValue: [] } : p === "lessthan" ? { conditionName: "lessThan", conditionValue: [] } : p === "lessthanorequal" ? { conditionName: "lessThanOrEqual", conditionValue: [] } : p === "equal" ? { conditionName: "equal", conditionValue: [] } : p === "notequal" ? { conditionName: "notEqual", conditionValue: [] } : p === "between" ? { conditionName: "between", conditionValue: [] } : p === "notbetween" ? { conditionName: "notBetween", conditionValue: [] } : null;
1097
+ function yt(y, u, g) {
1098
+ const p = (y || "").toLowerCase();
1099
+ if (p === "cellis") {
1100
+ const w = (u || "").toLowerCase();
1101
+ return w === "greaterthan" ? { conditionName: "greaterThan", conditionValue: [] } : w === "greaterthanorequal" ? { conditionName: "greaterThanOrEqual", conditionValue: [] } : w === "lessthan" ? { conditionName: "lessThan", conditionValue: [] } : w === "lessthanorequal" ? { conditionName: "lessThanOrEqual", conditionValue: [] } : w === "equal" ? { conditionName: "equal", conditionValue: [] } : w === "notequal" ? { conditionName: "notEqual", conditionValue: [] } : w === "between" ? { conditionName: "between", conditionValue: [] } : w === "notbetween" ? { conditionName: "notBetween", conditionValue: [] } : null;
1095
1102
  }
1096
- if (w === "containstext" || w === "notcontainstext" || w === "beginswith" || w === "endswith" || w === "containsblanks" || w === "notcontainsblanks") {
1097
- const p = (u ?? "").toLowerCase();
1098
- if (w === "containsblanks" || p === "containsblanks")
1103
+ if (p === "containstext" || p === "notcontainstext" || p === "beginswith" || p === "endswith" || p === "containsblanks" || p === "notcontainsblanks") {
1104
+ const w = (u ?? "").toLowerCase();
1105
+ if (p === "containsblanks" || w === "containsblanks")
1099
1106
  return { conditionName: "empty", conditionValue: [""] };
1100
- if (w === "notcontainsblanks" || p === "notcontainsblanks")
1107
+ if (p === "notcontainsblanks" || w === "notcontainsblanks")
1101
1108
  return { conditionName: "notEmpty", conditionValue: [""] };
1102
- if (w === "notcontainstext" || p === "notcontainstext" || p === "notcontains")
1109
+ if (p === "notcontainstext" || w === "notcontainstext" || w === "notcontains")
1103
1110
  return { conditionName: "textDoesNotContain", conditionValue: [] };
1104
- if (w === "beginswith" || p === "beginswith")
1111
+ if (p === "beginswith" || w === "beginswith")
1105
1112
  return { conditionName: "textStartsWith", conditionValue: [] };
1106
- if (w === "endswith" || p === "endswith")
1113
+ if (p === "endswith" || w === "endswith")
1107
1114
  return { conditionName: "textEndsWith", conditionValue: [] };
1108
- if (p === "equal")
1115
+ if (w === "equal")
1109
1116
  return { conditionName: "textExactly", conditionValue: [] };
1110
1117
  const C = (g == null ? void 0 : g.text) ?? "";
1111
1118
  return {
@@ -1113,48 +1120,48 @@ function wt(y, u, g) {
1113
1120
  conditionValue: C ? [C] : []
1114
1121
  };
1115
1122
  }
1116
- if (w === "duplicatevalues")
1123
+ if (p === "duplicatevalues")
1117
1124
  return { conditionName: "duplicateValue", conditionValue: ["0"] };
1118
- if (w === "uniquevalues")
1125
+ if (p === "uniquevalues")
1119
1126
  return { conditionName: "duplicateValue", conditionValue: ["1"] };
1120
- if (w === "top10") {
1121
- const p = (g == null ? void 0 : g.rank) ?? 10;
1127
+ if (p === "top10") {
1128
+ const w = (g == null ? void 0 : g.rank) ?? 10;
1122
1129
  return g != null && g.percent && (g != null && g.bottom) ? {
1123
1130
  conditionName: "last10_percent",
1124
- conditionValue: [String(p)]
1125
- } : g != null && g.percent ? { conditionName: "top10_percent", conditionValue: [String(p)] } : g != null && g.bottom ? { conditionName: "last10", conditionValue: [String(p)] } : { conditionName: "top10", conditionValue: [String(p)] };
1131
+ conditionValue: [String(w)]
1132
+ } : g != null && g.percent ? { conditionName: "top10_percent", conditionValue: [String(w)] } : g != null && g.bottom ? { conditionName: "last10", conditionValue: [String(w)] } : { conditionName: "top10", conditionValue: [String(w)] };
1126
1133
  }
1127
- if (w === "aboveaverage")
1134
+ if (p === "aboveaverage")
1128
1135
  return (g == null ? void 0 : g.aboveAverage) === !1 ? { conditionName: "belowAverage", conditionValue: [] } : { conditionName: "aboveAverage", conditionValue: [] };
1129
- if (w === "timeperiod") {
1130
- const p = ((g == null ? void 0 : g.timePeriod) ?? "").toLowerCase();
1131
- return p === "today" || p === "tomorrow" || p === "yesterday" ? {
1136
+ if (p === "timeperiod") {
1137
+ const w = ((g == null ? void 0 : g.timePeriod) ?? "").toLowerCase();
1138
+ return w === "today" || w === "tomorrow" || w === "yesterday" ? {
1132
1139
  conditionName: "dateIs",
1133
- conditionValue: [`preset:${p}`, "", "DD/MM/YYYY"]
1134
- } : p === "last7days" ? {
1140
+ conditionValue: [`preset:${w}`, "", "DD/MM/YYYY"]
1141
+ } : w === "last7days" ? {
1135
1142
  conditionName: "dateIs",
1136
1143
  conditionValue: ["preset:pastWeek", "", "DD/MM/YYYY"]
1137
- } : p === "lastmonth" ? {
1144
+ } : w === "lastmonth" ? {
1138
1145
  conditionName: "dateIs",
1139
1146
  conditionValue: ["preset:pastMonth", "", "DD/MM/YYYY"]
1140
- } : p === "lastyear" ? {
1147
+ } : w === "lastyear" ? {
1141
1148
  conditionName: "dateIs",
1142
1149
  conditionValue: ["preset:pastYear", "", "DD/MM/YYYY"]
1143
1150
  } : null;
1144
1151
  }
1145
1152
  return null;
1146
1153
  }
1147
- function yt(y, u) {
1154
+ function kt(y, u) {
1148
1155
  if (!u.type) return null;
1149
1156
  let g = (u.text ?? "").trim();
1150
- const w = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, p = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") && pt(w);
1151
- if (p) {
1152
- const j = qe(y);
1153
- if (!j) return null;
1154
- const ee = Xe(u.style);
1157
+ const p = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, w = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") && wt(p);
1158
+ if (w) {
1159
+ const B = Xe(y);
1160
+ if (!B) return null;
1161
+ const ee = Ze(u.style);
1155
1162
  return {
1156
1163
  type: "default",
1157
- cellrange: j,
1164
+ cellrange: B,
1158
1165
  format: {
1159
1166
  textColor: ee.textColor,
1160
1167
  cellColor: ee.cellColor,
@@ -1163,13 +1170,13 @@ function yt(y, u) {
1163
1170
  underline: ee.underline,
1164
1171
  strikethrough: ee.strikethrough
1165
1172
  },
1166
- conditionName: p.conditionName,
1173
+ conditionName: w.conditionName,
1167
1174
  conditionRange: [],
1168
- conditionValue: p.conditionValue
1175
+ conditionValue: w.conditionValue
1169
1176
  };
1170
1177
  }
1171
- (u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith") && !g && (g = Je(w), g || (g = Pe(w)));
1172
- const C = wt(u.type, u.operator, {
1178
+ (u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith") && !g && (g = Qe(p), g || (g = Pe(p)));
1179
+ const C = yt(u.type, u.operator, {
1173
1180
  percent: u.percent,
1174
1181
  bottom: u.bottom,
1175
1182
  rank: u.rank,
@@ -1179,12 +1186,12 @@ function yt(y, u) {
1179
1186
  });
1180
1187
  if (!C) return null;
1181
1188
  let S;
1182
- u.type === "cellIs" && Array.isArray(u.formulae) && u.formulae.length > 0 ? S = u.formulae.map((j) => String(j ?? "")) : C.conditionName === "empty" || C.conditionName === "notEmpty" ? S = [""] : u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith" ? S = g ? [g] : Pe(w) ? [Pe(w)] : [] : S = C.conditionValue.map(
1183
- (j) => j == null ? "" : String(j)
1189
+ u.type === "cellIs" && Array.isArray(u.formulae) && u.formulae.length > 0 ? S = u.formulae.map((B) => String(B ?? "")) : C.conditionName === "empty" || C.conditionName === "notEmpty" ? S = [""] : u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith" ? S = g ? [g] : Pe(p) ? [Pe(p)] : [] : S = C.conditionValue.map(
1190
+ (B) => B == null ? "" : String(B)
1184
1191
  );
1185
- const F = qe(y);
1192
+ const F = Xe(y);
1186
1193
  if (!F) return null;
1187
- const R = Xe(u.style);
1194
+ const R = Ze(u.style);
1188
1195
  return {
1189
1196
  type: "default",
1190
1197
  cellrange: F,
@@ -1201,32 +1208,32 @@ function yt(y, u) {
1201
1208
  conditionValue: S
1202
1209
  };
1203
1210
  }
1204
- async function Mt({
1211
+ async function vt({
1205
1212
  sheetEditorRef: y,
1206
1213
  ydocRef: u,
1207
1214
  setForceSheetRender: g,
1208
- dsheetId: w,
1209
- currentDataRef: p,
1215
+ dsheetId: p,
1216
+ currentDataRef: w,
1210
1217
  updateDocumentTitle: C,
1211
1218
  filterToastShown: S,
1212
1219
  setFilterToastShown: F,
1213
1220
  handleContentPortal: R
1214
- }, j, ee, ke, D) {
1215
- var ie, J;
1216
- const Z = j == null ? void 0 : j.target;
1217
- if (!((ie = Z == null ? void 0 : Z.files) != null && ie.length) && !ee)
1221
+ }, B, ee, ke, D) {
1222
+ var ce, J;
1223
+ const Z = B == null ? void 0 : B.target;
1224
+ if (!((ce = Z == null ? void 0 : Z.files) != null && ce.length) && !ee)
1218
1225
  return Promise.resolve();
1219
1226
  const le = ((J = Z == null ? void 0 : Z.files) == null ? void 0 : J[0]) || ee, Ee = {}, _e = {};
1220
1227
  let $e = !1;
1221
- return new Promise((x, z) => {
1222
- const fe = new FileReader();
1223
- fe.onerror = () => z(new Error("Failed to read file")), fe.onload = async (ge) => {
1224
- var Ve, ce, ae, Oe;
1225
- if (!ge.target) {
1228
+ return new Promise((M, z) => {
1229
+ const ge = new FileReader();
1230
+ ge.onerror = () => z(new Error("Failed to read file")), ge.onload = async (de) => {
1231
+ var Ve, oe, ae, Oe;
1232
+ if (!de.target) {
1226
1233
  console.error("FileReader event target is null"), z(new Error("FileReader event target is null"));
1227
1234
  return;
1228
1235
  }
1229
- const Ne = ge.target.result, [{ Workbook: Re }, Le, Te] = await Promise.all([
1236
+ const Ne = de.target.result, [{ Workbook: Re }, Le, Te] = await Promise.all([
1230
1237
  import("exceljs"),
1231
1238
  // @ts-expect-error — luckyexcel ships without TypeScript types
1232
1239
  import("luckyexcel"),
@@ -1234,17 +1241,17 @@ async function Mt({
1234
1241
  ]), He = Le.default.transformExcelToLucky, { extractImagesFromWorksheet: Fe, convertRawImagesToFortuneSheet: Ae } = Te, xe = new Re();
1235
1242
  try {
1236
1243
  await xe.xlsx.load(Ne);
1237
- const we = (Oe = (ae = (ce = (Ve = xe.model) == null ? void 0 : Ve.styles) == null ? void 0 : ce.fonts) == null ? void 0 : ae[0]) == null ? void 0 : Oe.size, ye = {}, Me = {}, Se = {}, ve = {};
1238
- xe.eachSheet((Q, oe) => {
1239
- var h, M, d;
1240
- const te = oe - 1, de = {}, t = Q.views;
1244
+ const we = (Oe = (ae = (oe = (Ve = xe.model) == null ? void 0 : Ve.styles) == null ? void 0 : oe.fonts) == null ? void 0 : ae[0]) == null ? void 0 : Oe.size, ye = {}, Me = {}, Se = {}, ve = {};
1245
+ xe.eachSheet((Q, ie) => {
1246
+ var h, x, d;
1247
+ const te = ie - 1, he = {}, t = Q.views;
1241
1248
  if (t && t.length > 0) {
1242
1249
  const _ = t[0];
1243
1250
  if (_.state === "frozen") {
1244
1251
  const A = _.xSplit || 0, P = _.ySplit || 0;
1245
- let I = null;
1246
- A > 0 && P > 0 ? I = "rangeBoth" : P > 0 ? I = "rangeRow" : A > 0 && (I = "rangeColumn"), I && (Me[te] = {
1247
- type: I,
1252
+ let U = null;
1253
+ A > 0 && P > 0 ? U = "rangeBoth" : P > 0 ? U = "rangeRow" : A > 0 && (U = "rangeColumn"), U && (Me[te] = {
1254
+ type: U,
1248
1255
  range: {
1249
1256
  row_focus: P - 1,
1250
1257
  column_focus: A - 1
@@ -1254,10 +1261,10 @@ async function Mt({
1254
1261
  }
1255
1262
  const e = {};
1256
1263
  Q.eachRow({ includeEmpty: !1 }, (_, A) => {
1257
- _.eachCell({ includeEmpty: !1 }, (P, I) => {
1264
+ _.eachCell({ includeEmpty: !1 }, (P, U) => {
1258
1265
  var se, K, v;
1259
- const Y = `${A - 1}_${I - 1}`;
1260
- P.hyperlink && (de[Y] = [
1266
+ const Y = `${A - 1}_${U - 1}`;
1267
+ P.hyperlink && (he[Y] = [
1261
1268
  {
1262
1269
  linkType: "webpage",
1263
1270
  linkAddress: P.hyperlink
@@ -1278,25 +1285,25 @@ async function Mt({
1278
1285
  }
1279
1286
  Object.keys(G).length > 0 && (e[Y] = G);
1280
1287
  });
1281
- }), Object.keys(de).length > 0 && (ye[te] = de), Object.keys(e).length > 0 && (Se[te] = e);
1282
- const r = Fe(Q, xe);
1283
- r.length > 0 && (ve[te] = r);
1288
+ }), Object.keys(he).length > 0 && (ye[te] = he), Object.keys(e).length > 0 && (Se[te] = e);
1289
+ const n = Fe(Q, xe);
1290
+ n.length > 0 && (ve[te] = n);
1284
1291
  const m = Q.tables;
1285
1292
  m && Object.keys(m).length > 0 && ((h = D == null ? void 0 : D.onWarning) == null || h.call(
1286
1293
  D,
1287
1294
  "Tables are not fully supported. Table styles will not be applied."
1288
- ), D != null && D.suppressUiWarnings || Ge({
1295
+ ), D != null && D.suppressUiWarnings || ze({
1289
1296
  title: "Tables are not fully supported",
1290
1297
  description: "Table styles will not be applied",
1291
1298
  variant: "warning",
1292
1299
  showCloseButton: !0,
1293
1300
  duration: 40 * 1e3
1294
1301
  }));
1295
- const i = (M = Q.dataValidations) == null ? void 0 : M.model;
1302
+ const i = (x = Q.dataValidations) == null ? void 0 : x.model;
1296
1303
  if (i && typeof i == "object") {
1297
1304
  const _ = {};
1298
1305
  for (const [A, P] of Object.entries(i)) {
1299
- const Y = dt(A, P);
1306
+ const Y = bt(A, P);
1300
1307
  Y && (_[Y.rowColKey] = Y.entry);
1301
1308
  }
1302
1309
  Object.keys(_).length > 0 && (Ee[te] = _);
@@ -1305,8 +1312,8 @@ async function Mt({
1305
1312
  if (Array.isArray(o) && o.length > 0) {
1306
1313
  const _ = [];
1307
1314
  for (const A of o) {
1308
- const P = A.ref, I = A.rules || [];
1309
- for (const Y of I) {
1315
+ const P = A.ref, U = A.rules || [];
1316
+ for (const Y of U) {
1310
1317
  const E = Y;
1311
1318
  console.log("[XLSX CF RAW]", {
1312
1319
  ref: P,
@@ -1320,7 +1327,7 @@ async function Mt({
1320
1327
  rank: E.rank,
1321
1328
  aboveAverage: E.aboveAverage
1322
1329
  });
1323
- const $ = E.type ? yt(P, E) : null;
1330
+ const $ = E.type ? kt(P, E) : null;
1324
1331
  $ ? console.log("[XLSX CF MAPPED] accepted", $) : console.log("[XLSX CF MAPPED] skipped", {
1325
1332
  ref: P,
1326
1333
  type: E.type,
@@ -1335,7 +1342,7 @@ async function Mt({
1335
1342
  Q.autoFilter && ($e || ($e = !0, (d = D == null ? void 0 : D.onWarning) == null || d.call(
1336
1343
  D,
1337
1344
  "Filters are not supported in imported files."
1338
- )), S || (F(!0), D != null && D.suppressUiWarnings || Ge({
1345
+ )), S || (F(!0), D != null && D.suppressUiWarnings || ze({
1339
1346
  title: "Filters are not supported in imported files",
1340
1347
  variant: "warning",
1341
1348
  showCloseButton: !0,
@@ -1345,29 +1352,29 @@ async function Mt({
1345
1352
  le,
1346
1353
  function(Q) {
1347
1354
  var i;
1348
- let oe = Q.sheets;
1349
- if (oe.forEach((o, n) => {
1350
- const h = Ee[n];
1355
+ let ie = Q.sheets;
1356
+ if (ie.forEach((o, r) => {
1357
+ const h = Ee[r];
1351
1358
  h && Object.keys(h).length > 0 && (o.dataVerification = h);
1352
- const M = _e[n];
1353
- o.luckysheet_conditionformat_save = Array.isArray(M) && M.length > 0 ? M : [];
1359
+ const x = _e[r];
1360
+ o.luckysheet_conditionformat_save = Array.isArray(x) && x.length > 0 ? x : [];
1354
1361
  }), !u.current) {
1355
1362
  console.error("ydocRef.current is null");
1356
1363
  return;
1357
1364
  }
1358
- const te = u.current.getArray(w), de = Array.from(te), t = /* @__PURE__ */ new Map();
1359
- oe = oe.map((o, n) => {
1360
- var $, G, se, K, v, f, a, c, k, l, s, O, L, B, W, N, be, Ce, me, q, pe, We, Ie, Ue, Ye;
1361
- const h = ($ = o == null ? void 0 : o.celldata) == null ? void 0 : $[o.celldata.length - 1], M = (h == null ? void 0 : h.r) ?? 0, d = (h == null ? void 0 : h.c) ?? 0;
1362
- if (o.row = Math.max(M, 500), o.column = Math.max(d, 36), o.id || (o.id = ((G = D == null ? void 0 : D.generateSheetId) == null ? void 0 : G.call(D)) ?? ((se = y.current) == null ? void 0 : se.getSettings().generateSheetId()) ?? st()), Me[n] && (o.frozen = Me[n]), ye[n] && (o.hyperlink = {
1365
+ const te = u.current.getArray(p), he = Array.from(te), t = /* @__PURE__ */ new Map();
1366
+ ie = ie.map((o, r) => {
1367
+ var $, G, se, K, v, f, a, c, k, l, s, O, L, j, W, N, be, Ce, me, q, pe, We, Ue, Ie, Ye;
1368
+ const h = ($ = o == null ? void 0 : o.celldata) == null ? void 0 : $[o.celldata.length - 1], x = (h == null ? void 0 : h.r) ?? 0, d = (h == null ? void 0 : h.c) ?? 0;
1369
+ if (o.row = Math.max(x, 500), o.column = Math.max(d, 36), o.id || (o.id = ((G = D == null ? void 0 : D.generateSheetId) == null ? void 0 : G.call(D)) ?? ((se = y.current) == null ? void 0 : se.getSettings().generateSheetId()) ?? st()), Me[r] && (o.frozen = Me[r]), ye[r] && (o.hyperlink = {
1363
1370
  ...o.hyperlink || {},
1364
- ...ye[n]
1371
+ ...ye[r]
1365
1372
  }), (K = o.config) != null && K.columnlen) {
1366
1373
  const b = {};
1367
1374
  Object.entries(o.config.columnlen).forEach(
1368
1375
  ([V, T]) => {
1369
- const U = (Number(T) - 5) / 8 + 0.83;
1370
- b[V] = Math.round(U * 7 + 5);
1376
+ const I = (Number(T) - 5) / 8 + 0.83;
1377
+ b[V] = Math.round(I * 7 + 5);
1371
1378
  }
1372
1379
  ), o.config.columnlen = b;
1373
1380
  }
@@ -1384,8 +1391,8 @@ async function Mt({
1384
1391
  const b = Math.round(
1385
1392
  Number(o.defaultRowHeight) || 21
1386
1393
  ), V = {};
1387
- Object.entries(o.config.rowlen).forEach(([T, U]) => {
1388
- Math.abs(Math.round(Number(U)) - b) > 1 && (V[T] = Number(U));
1394
+ Object.entries(o.config.rowlen).forEach(([T, I]) => {
1395
+ Math.abs(Math.round(Number(I)) - b) > 1 && (V[T] = Number(I));
1389
1396
  }), o.config.rowlen = V;
1390
1397
  }
1391
1398
  if ((a = o.config) != null && a.customHeight) {
@@ -1393,30 +1400,30 @@ async function Mt({
1393
1400
  Object.keys(o.config.rowlen || {})
1394
1401
  ), V = {};
1395
1402
  Object.entries(o.config.customHeight).forEach(
1396
- ([T, U]) => {
1397
- b.has(T) && Number(U) === 1 && (V[T] = 1);
1403
+ ([T, I]) => {
1404
+ b.has(T) && Number(I) === 1 && (V[T] = 1);
1398
1405
  }
1399
1406
  ), o.config.customHeight = V;
1400
1407
  }
1401
- if (ve[n]) {
1408
+ if (ve[r]) {
1402
1409
  const b = Number(o.defaultColWidth) || Number(
1403
1410
  (l = (k = (c = y.current) == null ? void 0 : c.getSettings) == null ? void 0 : k.call(c)) == null ? void 0 : l.defaultColWidth
1404
1411
  ) || 99, V = Number(o.defaultRowHeight) || Number(
1405
1412
  (L = (O = (s = y.current) == null ? void 0 : s.getSettings) == null ? void 0 : O.call(s)) == null ? void 0 : L.defaultRowHeight
1406
1413
  ) || 21;
1407
1414
  o.images = Ae(
1408
- ve[n],
1415
+ ve[r],
1409
1416
  o,
1410
1417
  b,
1411
1418
  V
1412
1419
  );
1413
1420
  }
1414
- const A = ye[n], P = Se[n], I = [], Y = (b, V) => {
1421
+ const A = ye[r], P = Se[r], U = [], Y = (b, V) => {
1415
1422
  const T = `${b}_${V}`;
1416
1423
  Y._seen == null && (Y._seen = /* @__PURE__ */ new Set());
1417
- const U = Y._seen;
1418
- U.has(T) || (U.add(T), I.push({ r: b, c: V, id: o.id }));
1419
- }, E = (B = o.config) != null && B.merge ? /* @__PURE__ */ new Map() : null;
1424
+ const I = Y._seen;
1425
+ I.has(T) || (I.add(T), U.push({ r: b, c: V, id: o.id }));
1426
+ }, E = (j = o.config) != null && j.merge ? /* @__PURE__ */ new Map() : null;
1420
1427
  if (o.celldata)
1421
1428
  for (const b of o.celldata) {
1422
1429
  const V = `${b.r}_${b.c}`;
@@ -1431,8 +1438,8 @@ async function Mt({
1431
1438
  if (b.v.f && ((W = b.v.ct) == null ? void 0 : W.t) !== "d" && (b.v.ct = { ...b.v.ct ?? {}, t: "str" }, Y(b.r, b.c)), P != null && P[V]) {
1432
1439
  const H = P[V];
1433
1440
  if (!!(A != null && A[V])) {
1434
- const { fc: he, un: ne, ...Qe } = H;
1435
- Object.assign(b.v, Qe);
1441
+ const { fc: fe, un: ne, ...Ke } = H;
1442
+ Object.assign(b.v, Ke);
1436
1443
  } else
1437
1444
  Object.assign(b.v, H);
1438
1445
  }
@@ -1443,7 +1450,7 @@ async function Mt({
1443
1450
  H
1444
1451
  );
1445
1452
  }
1446
- const T = (N = b.v.ct) == null ? void 0 : N.fa, U = typeof T == "string" ? T.trim().toLowerCase() : "", re = U === "general" || ((be = b.v.ct) == null ? void 0 : be.t) === "g", ue = U === "@" || ((Ce = b.v.ct) == null ? void 0 : Ce.t) === "s";
1453
+ const T = (N = b.v.ct) == null ? void 0 : N.fa, I = typeof T == "string" ? T.trim().toLowerCase() : "", re = I === "general" || ((be = b.v.ct) == null ? void 0 : be.t) === "g", ue = I === "@" || ((Ce = b.v.ct) == null ? void 0 : Ce.t) === "s";
1447
1454
  if (T && !t.has(T) && t.set(T, De.is_date(T)), !b.v.f && T && t.get(T)) {
1448
1455
  const H = typeof b.v.v == "string" ? parseFloat(b.v.v) : b.v.v;
1449
1456
  if (typeof H == "number" && !isNaN(H))
@@ -1456,27 +1463,27 @@ async function Mt({
1456
1463
  if (/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/.test(
1457
1464
  H
1458
1465
  )) {
1459
- const he = Number(H);
1460
- if (!isFinite(he))
1466
+ const fe = Number(H);
1467
+ if (!isFinite(fe))
1461
1468
  continue;
1462
- if (b.v.v = he, b.v.ht == null && (b.v.ht = 2), !T)
1463
- b.v.m = String(he);
1469
+ if (b.v.v = fe, b.v.ht == null && (b.v.ht = 2), !T)
1470
+ b.v.m = String(fe);
1464
1471
  else
1465
1472
  try {
1466
- b.v.m = De.format(T, he);
1473
+ b.v.m = De.format(T, fe);
1467
1474
  } catch {
1468
1475
  }
1469
1476
  }
1470
1477
  } else !b.v.f && typeof b.v.v == "number" && isFinite(b.v.v) && ((me = b.v.ct) == null ? void 0 : me.t) !== "s" && ((q = b.v.ct) == null ? void 0 : q.t) !== "d" && b.v.ht == null && (b.v.ht = 2);
1471
1478
  if (!b.v.f && (b.v.m === void 0 || b.v.m === null) && ((pe = b.v.ct) == null ? void 0 : pe.t) !== "d") {
1472
- const H = ut((We = b.v.ct) == null ? void 0 : We.s), X = b.v.v;
1479
+ const H = ht((We = b.v.ct) == null ? void 0 : We.s), X = b.v.v;
1473
1480
  if (!(X == null || String(X).trim() === ""))
1474
1481
  if (H != null)
1475
1482
  b.v.m = H;
1476
1483
  else if (typeof X == "boolean")
1477
- b.v.m = ht(X);
1484
+ b.v.m = ft(X);
1478
1485
  else if (typeof X == "number" && isFinite(X)) {
1479
- const ne = (Ie = b.v.ct) == null ? void 0 : Ie.fa;
1486
+ const ne = (Ue = b.v.ct) == null ? void 0 : Ue.fa;
1480
1487
  if (typeof ne == "string" && ne && t.get(ne) === !1)
1481
1488
  try {
1482
1489
  b.v.m = De.format(ne, X);
@@ -1494,50 +1501,62 @@ async function Mt({
1494
1501
  for (let V = 0; V < b.length; V++) {
1495
1502
  const T = b[V];
1496
1503
  if (Array.isArray(T))
1497
- for (let U = 0; U < T.length; U++) {
1498
- const re = T[U];
1504
+ for (let I = 0; I < T.length; I++) {
1505
+ const re = T[I];
1499
1506
  if (!re || typeof re != "object" || !re.f) continue;
1500
1507
  const ue = String(re.f);
1501
- ue.startsWith("=") || (re.f = `=${ue}`), ((Ue = re.ct) == null ? void 0 : Ue.t) !== "d" && (re.ct = { ...re.ct ?? {}, t: "str" }, Y(V, U));
1508
+ ue.startsWith("=") || (re.f = `=${ue}`), ((Ie = re.ct) == null ? void 0 : Ie.t) !== "d" && (re.ct = { ...re.ct ?? {}, t: "str" }, Y(V, I));
1502
1509
  }
1503
1510
  }
1504
1511
  }
1505
- if (o.calcChain = I, E && ((Ye = o.config) != null && Ye.merge) && o.celldata)
1512
+ if (o.calcChain = U, E && ((Ye = o.config) != null && Ye.merge) && o.celldata)
1506
1513
  for (const b of Object.values(o.config.merge)) {
1507
- const { r: V, c: T, rs: U, cs: re } = b;
1508
- for (let ue = 0; ue < U; ue++)
1514
+ const { r: V, c: T, rs: I, cs: re } = b;
1515
+ for (let ue = 0; ue < I; ue++)
1509
1516
  for (let H = 0; H < re; H++) {
1510
- const X = `${V + ue}_${T + H}`, he = ue === 0 && H === 0;
1517
+ const X = `${V + ue}_${T + H}`, fe = ue === 0 && H === 0;
1511
1518
  let ne = E.get(X);
1512
- ne ? (ne.v || (ne.v = {}), ne.v.mc = he ? { r: V, c: T, rs: U, cs: re } : { r: V, c: T }) : (ne = {
1519
+ ne ? (ne.v || (ne.v = {}), ne.v.mc = fe ? { r: V, c: T, rs: I, cs: re } : { r: V, c: T }) : (ne = {
1513
1520
  r: V + ue,
1514
1521
  c: T + H,
1515
- v: he ? { mc: { r: V, c: T, rs: U, cs: re } } : { mc: { r: V, c: T } }
1522
+ v: fe ? { mc: { r: V, c: T, rs: I, cs: re } } : { mc: { r: V, c: T } }
1516
1523
  }, o.celldata.push(ne), E.set(X, ne));
1517
1524
  }
1518
1525
  }
1519
1526
  return o;
1520
1527
  }), console.log("[xlsx-import] parsed sheets data", {
1521
1528
  fileName: le.name,
1522
- sheetCount: oe.length,
1523
- sheets: oe
1529
+ sheetCount: ie.length,
1530
+ sheets: ie
1524
1531
  });
1525
1532
  let e;
1526
- if (ke === "merge-current-dsheet" ? e = [...de, ...oe] : e = [...oe], e = e.map((o, n) => (o.order = n, o)), u.current.transact(() => {
1533
+ if (ke === "merge-current-dsheet") {
1534
+ const o = new Set(
1535
+ he.map(
1536
+ (r) => r instanceof Ge.Map ? r.get("name") : r.name
1537
+ ).filter(Boolean)
1538
+ );
1539
+ ie.forEach((r) => {
1540
+ const h = r.name ?? "", x = ut(h, o);
1541
+ x !== h && (r.name = x), o.add(x);
1542
+ }), e = [...he, ...ie];
1543
+ } else
1544
+ e = [...ie];
1545
+ if (e = e.map((o, r) => (o.order = r, o)), u.current.transact(() => {
1527
1546
  ke !== "merge-current-dsheet" && te.delete(0, te.length), e.forEach((o) => {
1528
- if (o instanceof et.Map) return;
1529
- const n = tt(o);
1530
- te.push([n()]);
1547
+ if (o instanceof Ge.Map) return;
1548
+ const r = tt(o);
1549
+ te.push([r()]);
1531
1550
  });
1532
1551
  }), u != null && u.current) {
1533
- const o = u.current.getArray(w), n = rt(o);
1534
- p.current = n, g((h) => h + 1);
1552
+ const o = u.current.getArray(p), r = rt(o);
1553
+ w.current = r, g((h) => h + 1);
1535
1554
  }
1536
1555
  setTimeout(() => {
1537
1556
  R == null || R();
1538
- }, 200), D != null && D.headless || ft(y);
1557
+ }, 200), D != null && D.headless || gt(y);
1539
1558
  const m = nt((i = Q == null ? void 0 : Q.info) == null ? void 0 : i.name);
1540
- C == null || C(m), x();
1559
+ C == null || C(m), M();
1541
1560
  }
1542
1561
  );
1543
1562
  } catch (we) {
@@ -1545,9 +1564,9 @@ async function Mt({
1545
1564
  "Error loading the workbook. Please ensure it is a valid .xlsx file."
1546
1565
  ), z(we);
1547
1566
  }
1548
- }, fe.readAsArrayBuffer(le);
1567
+ }, ge.readAsArrayBuffer(le);
1549
1568
  });
1550
1569
  }
1551
1570
  export {
1552
- Mt as runXlsxFileUpload
1571
+ vt as runXlsxFileUpload
1553
1572
  };