@silurus/ooxml 0.79.0 → 0.79.1
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.
- package/dist/{canvas-viewer-mechanics-D9tsuHnG.js → canvas-viewer-mechanics-DJ9yfiLN.js} +1 -1
- package/dist/{dash-Cyc-sevN.js → dash-CMzZIDz_.js} +87 -49
- package/dist/{document-pull-client-YiU8M4LO.js → document-pull-client-DYoybVCn.js} +3 -3
- package/dist/{docx-a1UpmRf8.js → docx-CSk_-kj_.js} +5 -5
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-pDqovJpT.js → line-distribute-CU7vu7XS.js} +1 -1
- package/dist/{line-metrics-DjKxiIUD.js → line-metrics-A77J_KRx.js} +2616 -2499
- package/dist/node.mjs +7 -7
- package/dist/{pptx-t5ABdzfd.js → pptx-CO1Ut97p.js} +6 -6
- package/dist/pptx.mjs +4 -4
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-BjIEuFIG.js → render-C5m7Ddwx.js} +1 -1
- package/dist/render-worker-host-BhMT5U73.js +27 -0
- package/dist/render-worker-host-DNMxGh5s.js +27 -0
- package/dist/render-worker-host-DWyg7wio.js +27 -0
- package/dist/{resource-measurement-D8EiTm_E.js → resource-measurement-COxqtfGk.js} +1 -1
- package/dist/{session-Bhe_eY-s.js → session-CJwZaquG.js} +2 -2
- package/dist/{slide-pull-client-BQ8gJPTq.js → slide-pull-client-CFHNk0ek.js} +4 -4
- package/dist/three-d.mjs +838 -570
- package/dist/types/docx.d.ts +72 -6
- package/dist/types/index.d.ts +80 -10
- package/dist/types/node.d.ts +70 -2
- package/dist/types/pptx.d.ts +72 -6
- package/dist/types/region-map.d.ts +68 -2
- package/dist/types/three-d.d.ts +68 -2
- package/dist/types/xlsx.d.ts +76 -6
- package/dist/{worksheet-pull-client-T0EzdEEQ.js → worksheet-pull-client-CziyJf24.js} +2 -2
- package/dist/{xlsx-CsDDMJIK.js → xlsx-DHQmjAfh.js} +944 -799
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-BB320snY.js +0 -27
- package/dist/render-worker-host-BjEPZBwf.js +0 -27
- package/dist/render-worker-host-hZ0o4OD7.js +0 -27
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { $t as t, A as n, B as r, C as i, Ct as a, D as o, Dt as s, Et as c, It as l, J as u, Kt as d, Lt as f, M as p, O as m, Ot as h, Qt as g, R as _, S as v, T as y, Tt as b, Ut as x, V as S, Xt as C, Yt as w, Zt as T, _ as E, _t as D, a as O, an as k, c as A, d as j, en as M, f as ee, g as te, gt as N, h as P, ht as F, in as I, it as L, j as R, kt as z, m as ne, mt as B, n as V, nn as H, on as re, p as ie, pt as U, q as ae, qt as oe, rn as se, s as ce, sn as le, tn as ue, u as de, vt as fe, w as pe, y as me, z as he } from "./line-metrics-
|
|
3
|
-
import { C as W, E as G, S as K, T as ge, _ as _e, a as ve, b as ye, d as q, f as be, h as xe, i as Se, l as Ce, m as we, p as Te, t as Ee, u as De, v as Oe, w as ke, x as Ae, y as je } from "./canvas-viewer-mechanics-
|
|
2
|
+
import { $t as t, A as n, B as r, C as i, Ct as a, D as o, Dt as s, Et as c, It as l, J as u, Kt as d, Lt as f, M as p, O as m, Ot as h, Qt as g, R as _, S as v, T as y, Tt as b, Ut as x, V as S, Xt as C, Yt as w, Zt as T, _ as E, _t as D, a as O, an as k, c as A, d as j, en as M, f as ee, g as te, gt as N, h as P, ht as F, in as I, it as L, j as R, kt as z, m as ne, mt as B, n as V, nn as H, on as re, p as ie, pt as U, q as ae, qt as oe, rn as se, s as ce, sn as le, tn as ue, u as de, vt as fe, w as pe, y as me, z as he } from "./line-metrics-A77J_KRx.js";
|
|
3
|
+
import { C as W, E as G, S as K, T as ge, _ as _e, a as ve, b as ye, d as q, f as be, h as xe, i as Se, l as Ce, m as we, p as Te, t as Ee, u as De, v as Oe, w as ke, x as Ae, y as je } from "./canvas-viewer-mechanics-DJ9yfiLN.js";
|
|
4
4
|
import { a as Me, i as Ne, t as Pe } from "./bounded-raw-part-cache-C6ro6Ezf.js";
|
|
5
5
|
import { a as Fe, i as Ie, o as Le } from "./chart-number-format-tjYUR9eS.js";
|
|
6
|
-
import {
|
|
7
|
-
import { i as Ve } from "./resource-measurement-
|
|
6
|
+
import { S as Re, a as ze, b as Be, x as J } from "./dash-CMzZIDz_.js";
|
|
7
|
+
import { i as Ve } from "./resource-measurement-COxqtfGk.js";
|
|
8
8
|
import { t as He } from "./mathjax-Dqo857oC.js";
|
|
9
9
|
import { n as Ue, r as We, t as Ge } from "./visible-index-CKvgpUrf.js";
|
|
10
|
-
import { a as Ke, c as qe, d as Je, i as Ye, l as Xe, n as Ze, o as Qe, s as $e, t as et, u as tt } from "./worksheet-pull-client-
|
|
10
|
+
import { a as Ke, c as qe, d as Je, i as Ye, l as Xe, n as Ze, o as Qe, s as $e, t as et, u as tt } from "./worksheet-pull-client-CziyJf24.js";
|
|
11
11
|
//#region packages/core/src/sparkline/renderer.ts
|
|
12
12
|
function nt(e, t, n) {
|
|
13
13
|
let { values: r } = n;
|
|
@@ -156,7 +156,7 @@ function mt(e) {
|
|
|
156
156
|
var ht = 8;
|
|
157
157
|
function gt(e, t) {
|
|
158
158
|
try {
|
|
159
|
-
return _t(
|
|
159
|
+
return _t(wt(e, t));
|
|
160
160
|
} catch {
|
|
161
161
|
return !1;
|
|
162
162
|
}
|
|
@@ -173,11 +173,11 @@ function X(e) {
|
|
|
173
173
|
let n = parseFloat(String(t));
|
|
174
174
|
return isNaN(n) ? 0 : n;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function vt(e) {
|
|
177
177
|
let t = mt(e);
|
|
178
178
|
return t == null ? "" : typeof t == "boolean" ? t ? "TRUE" : "FALSE" : String(t);
|
|
179
179
|
}
|
|
180
|
-
var
|
|
180
|
+
var yt = new Set([
|
|
181
181
|
"<",
|
|
182
182
|
">",
|
|
183
183
|
"=",
|
|
@@ -189,7 +189,7 @@ var vt = new Set([
|
|
|
189
189
|
"^",
|
|
190
190
|
"%"
|
|
191
191
|
]);
|
|
192
|
-
function
|
|
192
|
+
function bt(e) {
|
|
193
193
|
let t = [], n = 0, r = e;
|
|
194
194
|
for (; n < r.length;) {
|
|
195
195
|
let e = r[n];
|
|
@@ -250,7 +250,7 @@ function yt(e) {
|
|
|
250
250
|
}), n = e;
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
|
-
if (
|
|
253
|
+
if (yt.has(e)) {
|
|
254
254
|
(e === "<" || e === ">") && (r[n + 1] === "=" || e === "<" && r[n + 1] === ">") ? (t.push({
|
|
255
255
|
kind: "op",
|
|
256
256
|
text: r.slice(n, n + 2)
|
|
@@ -260,12 +260,12 @@ function yt(e) {
|
|
|
260
260
|
}), n++);
|
|
261
261
|
continue;
|
|
262
262
|
}
|
|
263
|
-
if (e === "$" ||
|
|
263
|
+
if (e === "$" || xt(e)) {
|
|
264
264
|
let e = n;
|
|
265
|
-
for (; e < r.length && (r[e] === "$" ||
|
|
265
|
+
for (; e < r.length && (r[e] === "$" || St(r[e]));) e++;
|
|
266
266
|
let i = r.slice(n, e);
|
|
267
267
|
n = e;
|
|
268
|
-
let a =
|
|
268
|
+
let a = Ct(i);
|
|
269
269
|
if (a) t.push({
|
|
270
270
|
kind: "ref",
|
|
271
271
|
text: i,
|
|
@@ -287,13 +287,13 @@ function yt(e) {
|
|
|
287
287
|
}
|
|
288
288
|
return t;
|
|
289
289
|
}
|
|
290
|
-
function bt(e) {
|
|
291
|
-
return e >= "A" && e <= "Z" || e >= "a" && e <= "z" || e === "_";
|
|
292
|
-
}
|
|
293
290
|
function xt(e) {
|
|
294
|
-
return
|
|
291
|
+
return e >= "A" && e <= "Z" || e >= "a" && e <= "z" || e === "_";
|
|
295
292
|
}
|
|
296
293
|
function St(e) {
|
|
294
|
+
return xt(e) || e >= "0" && e <= "9" || e === ".";
|
|
295
|
+
}
|
|
296
|
+
function Ct(e) {
|
|
297
297
|
let t = 0, n = !1, r = !1;
|
|
298
298
|
e[t] === "$" && (n = !0, t++);
|
|
299
299
|
let i = t;
|
|
@@ -313,42 +313,42 @@ function St(e) {
|
|
|
313
313
|
row: s
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
318
|
-
toks:
|
|
316
|
+
function wt(e, t) {
|
|
317
|
+
return Dt({
|
|
318
|
+
toks: bt(e),
|
|
319
319
|
pos: 0
|
|
320
320
|
}, t);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function Tt(e) {
|
|
323
323
|
return e.toks[e.pos];
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Et(e) {
|
|
326
326
|
return e.toks[e.pos++];
|
|
327
327
|
}
|
|
328
|
-
function Et(e, t) {
|
|
329
|
-
return Dt(e, t);
|
|
330
|
-
}
|
|
331
328
|
function Dt(e, t) {
|
|
332
|
-
|
|
329
|
+
return Ot(e, t);
|
|
330
|
+
}
|
|
331
|
+
function Ot(e, t) {
|
|
332
|
+
let n = kt(e, t), r = Tt(e);
|
|
333
333
|
if (r && r.kind === "op" && (r.text === "<" || r.text === ">" || r.text === "<=" || r.text === ">=" || r.text === "=" || r.text === "<>")) {
|
|
334
|
-
|
|
335
|
-
let i =
|
|
336
|
-
return
|
|
334
|
+
Et(e);
|
|
335
|
+
let i = kt(e, t);
|
|
336
|
+
return At(r.text, n, i);
|
|
337
337
|
}
|
|
338
338
|
return n;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
let n =
|
|
340
|
+
function kt(e, t) {
|
|
341
|
+
let n = jt(e, t);
|
|
342
342
|
for (;;) {
|
|
343
|
-
let r =
|
|
343
|
+
let r = Tt(e);
|
|
344
344
|
if (!r || r.kind !== "op" || r.text !== "&") break;
|
|
345
|
-
|
|
346
|
-
let i =
|
|
347
|
-
n =
|
|
345
|
+
Et(e);
|
|
346
|
+
let i = jt(e, t);
|
|
347
|
+
n = vt(n) + vt(i);
|
|
348
348
|
}
|
|
349
349
|
return n;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function At(e, t, n) {
|
|
352
352
|
let r = typeof t == "string" && isNaN(parseFloat(t)) ? null : X(t), i = typeof n == "string" && isNaN(parseFloat(n)) ? null : X(n);
|
|
353
353
|
if (r !== null && i !== null) switch (e) {
|
|
354
354
|
case "<": return r < i;
|
|
@@ -369,24 +369,24 @@ function kt(e, t, n) {
|
|
|
369
369
|
}
|
|
370
370
|
return !1;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
let n =
|
|
372
|
+
function jt(e, t) {
|
|
373
|
+
let n = Mt(e, t);
|
|
374
374
|
for (;;) {
|
|
375
|
-
let r =
|
|
375
|
+
let r = Tt(e);
|
|
376
376
|
if (!r || r.kind !== "op" || r.text !== "+" && r.text !== "-") break;
|
|
377
|
-
|
|
378
|
-
let i =
|
|
377
|
+
Et(e);
|
|
378
|
+
let i = Mt(e, t);
|
|
379
379
|
n = r.text === "+" ? X(n) + X(i) : X(n) - X(i);
|
|
380
380
|
}
|
|
381
381
|
return n;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
let n =
|
|
383
|
+
function Mt(e, t) {
|
|
384
|
+
let n = Nt(e, t);
|
|
385
385
|
for (;;) {
|
|
386
|
-
let r =
|
|
386
|
+
let r = Tt(e);
|
|
387
387
|
if (!r || r.kind !== "op" || r.text !== "*" && r.text !== "/") break;
|
|
388
|
-
|
|
389
|
-
let i =
|
|
388
|
+
Et(e);
|
|
389
|
+
let i = Nt(e, t);
|
|
390
390
|
if (r.text === "*") n = X(n) * X(i);
|
|
391
391
|
else {
|
|
392
392
|
let e = X(i);
|
|
@@ -395,41 +395,41 @@ function jt(e, t) {
|
|
|
395
395
|
}
|
|
396
396
|
return n;
|
|
397
397
|
}
|
|
398
|
-
function Mt(e, t) {
|
|
399
|
-
let n = wt(e);
|
|
400
|
-
return n && n.kind === "op" && n.text === "-" ? (Tt(e), -X(Mt(e, t))) : n && n.kind === "op" && n.text === "+" ? (Tt(e), X(Mt(e, t))) : Nt(e, t);
|
|
401
|
-
}
|
|
402
398
|
function Nt(e, t) {
|
|
403
399
|
let n = Tt(e);
|
|
400
|
+
return n && n.kind === "op" && n.text === "-" ? (Et(e), -X(Nt(e, t))) : n && n.kind === "op" && n.text === "+" ? (Et(e), X(Nt(e, t))) : Pt(e, t);
|
|
401
|
+
}
|
|
402
|
+
function Pt(e, t) {
|
|
403
|
+
let n = Et(e);
|
|
404
404
|
if (!n) return 0;
|
|
405
405
|
if (n.kind === "num") return parseFloat(n.text);
|
|
406
406
|
if (n.kind === "str") return n.text;
|
|
407
407
|
if (n.kind === "bool") return n.text === "TRUE";
|
|
408
408
|
if (n.kind === "lparen") {
|
|
409
|
-
let n =
|
|
409
|
+
let n = Dt(e, t), r = Et(e);
|
|
410
410
|
if (!r || r.kind !== "rparen") throw Error("missing )");
|
|
411
411
|
return n;
|
|
412
412
|
}
|
|
413
413
|
if (n.kind === "ref") {
|
|
414
|
-
if (
|
|
415
|
-
|
|
416
|
-
let r =
|
|
414
|
+
if (Tt(e)?.kind === "colon") {
|
|
415
|
+
Et(e);
|
|
416
|
+
let r = Et(e);
|
|
417
417
|
if (r?.kind !== "ref" || !r.ref) throw Error("range: expected ref after :");
|
|
418
|
-
return
|
|
418
|
+
return Lt(n.ref, r.ref, t);
|
|
419
419
|
}
|
|
420
|
-
return
|
|
420
|
+
return It(n.ref, t);
|
|
421
421
|
}
|
|
422
422
|
if (n.kind === "name") {
|
|
423
|
-
if (
|
|
424
|
-
|
|
423
|
+
if (Tt(e)?.kind === "lparen") {
|
|
424
|
+
Et(e);
|
|
425
425
|
let r = [];
|
|
426
|
-
if (
|
|
427
|
-
let i =
|
|
426
|
+
if (Tt(e)?.kind !== "rparen") for (r.push(Dt(e, t)); Tt(e)?.kind === "comma";) Et(e), r.push(Dt(e, t));
|
|
427
|
+
let i = Et(e);
|
|
428
428
|
if (!i || i.kind !== "rparen") throw Error("missing )");
|
|
429
|
-
return
|
|
429
|
+
return zt(n.text, r, t);
|
|
430
430
|
}
|
|
431
431
|
let r = t.definedNames.get(n.text);
|
|
432
|
-
return r && t.depth < ht ?
|
|
432
|
+
return r && t.depth < ht ? wt(Ft(r.formula), {
|
|
433
433
|
...t,
|
|
434
434
|
anchorRow: 1,
|
|
435
435
|
anchorCol: 1,
|
|
@@ -438,20 +438,20 @@ function Nt(e, t) {
|
|
|
438
438
|
}
|
|
439
439
|
return 0;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Ft(e) {
|
|
442
442
|
let t = e.match(/^(?:'[^']*'|[A-Za-z_][A-Za-z0-9_.]*)!(.*)$/);
|
|
443
443
|
return t ? t[1] : e;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function It(e, t) {
|
|
446
446
|
let n = e.colAbs ? e.col : e.col + (t.col - t.anchorCol), r = e.rowAbs ? e.row : e.row + (t.row - t.anchorRow);
|
|
447
|
-
return
|
|
447
|
+
return Rt(t.cellIndex.get(`${r}:${n}`));
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Lt(e, t, n) {
|
|
450
450
|
let r = e.colAbs ? e.col : e.col + (n.col - n.anchorCol), i = e.rowAbs ? e.row : e.row + (n.row - n.anchorRow), a = t.colAbs ? t.col : t.col + (n.col - n.anchorCol), o = t.rowAbs ? t.row : t.row + (n.row - n.anchorRow), s = Math.min(r, a), c = Math.max(r, a), l = Math.min(i, o), u = Math.max(i, o), d = [], f = 4096;
|
|
451
|
-
for (let e = l; e <= u && d.length < f; e++) for (let t = s; t <= c && d.length < f; t++) d.push(
|
|
451
|
+
for (let e = l; e <= u && d.length < f; e++) for (let t = s; t <= c && d.length < f; t++) d.push(Rt(n.cellIndex.get(`${e}:${t}`)));
|
|
452
452
|
return d;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Rt(e) {
|
|
455
455
|
if (!e) return null;
|
|
456
456
|
switch (e.value.type) {
|
|
457
457
|
case "number": return e.value.number;
|
|
@@ -461,7 +461,7 @@ function Lt(e) {
|
|
|
461
461
|
default: return null;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function zt(e, t, n) {
|
|
465
465
|
switch (e.toUpperCase()) {
|
|
466
466
|
case "AND": return t.flatMap(Y).every((e) => _t(e));
|
|
467
467
|
case "OR": return t.flatMap(Y).some((e) => _t(e));
|
|
@@ -548,32 +548,32 @@ function Rt(e, t, n) {
|
|
|
548
548
|
case "COUNT": return t.flatMap(Y).filter((e) => typeof e == "number").length;
|
|
549
549
|
case "COUNTA": return t.flatMap(Y).filter((e) => e != null && e !== "").length;
|
|
550
550
|
case "COUNTBLANK": return t.flatMap(Y).filter((e) => e == null || e === "").length;
|
|
551
|
-
case "COUNTIF": return
|
|
552
|
-
case "SUMIF": return
|
|
551
|
+
case "COUNTIF": return Bt(Y(t[0]), t[1]);
|
|
552
|
+
case "SUMIF": return Vt(Y(t[0]), t[1], t[2] === void 0 ? null : Y(t[2]));
|
|
553
553
|
case "AVERAGEIF": {
|
|
554
|
-
let e = Y(t[0]), n =
|
|
554
|
+
let e = Y(t[0]), n = Vt(e, t[1], t[2] === void 0 ? null : Y(t[2])), r = Bt(e, t[1]);
|
|
555
555
|
return r === 0 ? null : X(n) / r;
|
|
556
556
|
}
|
|
557
|
-
case "LEN": return
|
|
558
|
-
case "LEFT": return
|
|
557
|
+
case "LEN": return vt(t[0]).length;
|
|
558
|
+
case "LEFT": return vt(t[0]).slice(0, Math.max(0, X(t[1] ?? 1)));
|
|
559
559
|
case "RIGHT": {
|
|
560
|
-
let e =
|
|
560
|
+
let e = vt(t[0]), n = Math.max(0, X(t[1] ?? 1));
|
|
561
561
|
return n >= e.length ? e : e.slice(e.length - n);
|
|
562
562
|
}
|
|
563
563
|
case "MID": {
|
|
564
|
-
let e =
|
|
564
|
+
let e = vt(t[0]), n = Math.max(1, X(t[1])) - 1, r = Math.max(0, X(t[2]));
|
|
565
565
|
return e.slice(n, n + r);
|
|
566
566
|
}
|
|
567
|
-
case "UPPER": return
|
|
568
|
-
case "LOWER": return
|
|
569
|
-
case "TRIM": return
|
|
570
|
-
case "EXACT": return
|
|
567
|
+
case "UPPER": return vt(t[0]).toUpperCase();
|
|
568
|
+
case "LOWER": return vt(t[0]).toLowerCase();
|
|
569
|
+
case "TRIM": return vt(t[0]).replace(/\s+/g, " ").trim();
|
|
570
|
+
case "EXACT": return vt(t[0]) === vt(t[1]);
|
|
571
571
|
case "FIND": {
|
|
572
|
-
let e =
|
|
572
|
+
let e = vt(t[0]), n = vt(t[1]), r = Math.max(1, X(t[2] ?? 1)) - 1, i = n.indexOf(e, r);
|
|
573
573
|
return i < 0 ? null : i + 1;
|
|
574
574
|
}
|
|
575
575
|
case "SEARCH": {
|
|
576
|
-
let e =
|
|
576
|
+
let e = vt(t[0]).toLowerCase(), n = vt(t[1]).toLowerCase(), r = Math.max(1, X(t[2] ?? 1)) - 1, i = n.indexOf(e, r);
|
|
577
577
|
return i < 0 ? null : i + 1;
|
|
578
578
|
}
|
|
579
579
|
case "CONCATENATE":
|
|
@@ -589,33 +589,33 @@ function Rt(e, t, n) {
|
|
|
589
589
|
case "VALUE": return X(t[0]);
|
|
590
590
|
case "ROW": return n.row;
|
|
591
591
|
case "COLUMN": return n.col;
|
|
592
|
-
case "TODAY": return
|
|
593
|
-
case "NOW": return
|
|
594
|
-
case "DATE": return
|
|
595
|
-
case "YEAR": return
|
|
596
|
-
case "MONTH": return
|
|
597
|
-
case "DAY": return
|
|
592
|
+
case "TODAY": return Ut();
|
|
593
|
+
case "NOW": return Wt();
|
|
594
|
+
case "DATE": return Gt(X(t[0]), X(t[1]), X(t[2]));
|
|
595
|
+
case "YEAR": return qt(X(t[0])).y;
|
|
596
|
+
case "MONTH": return qt(X(t[0])).m;
|
|
597
|
+
case "DAY": return qt(X(t[0])).d;
|
|
598
598
|
case "WEEKDAY": {
|
|
599
|
-
let e =
|
|
599
|
+
let e = Kt(X(t[0])).getUTCDay(), n = X(t[1] ?? 1);
|
|
600
600
|
return n === 2 ? e === 0 ? 7 : e : n === 3 ? e === 0 ? 6 : e - 1 : e + 1;
|
|
601
601
|
}
|
|
602
602
|
default: return 0;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
let n =
|
|
605
|
+
function Bt(e, t) {
|
|
606
|
+
let n = Ht(t), r = 0;
|
|
607
607
|
for (let t of e) n(t) && r++;
|
|
608
608
|
return r;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
let r =
|
|
610
|
+
function Vt(e, t, n) {
|
|
611
|
+
let r = Ht(t), i = n ?? e, a = 0;
|
|
612
612
|
for (let t = 0; t < e.length; t++) if (r(e[t])) {
|
|
613
613
|
let e = i[t];
|
|
614
614
|
typeof e == "number" && (a += e);
|
|
615
615
|
}
|
|
616
616
|
return a;
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function Ht(e) {
|
|
619
619
|
let t = mt(e);
|
|
620
620
|
if (typeof t != "string") {
|
|
621
621
|
let e = typeof t == "number" ? t : null;
|
|
@@ -642,21 +642,21 @@ function Vt(e) {
|
|
|
642
642
|
}
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function Ut() {
|
|
646
646
|
let e = /* @__PURE__ */ new Date();
|
|
647
647
|
return Le(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Wt() {
|
|
650
650
|
return Le(new Date(Date.now()), !1);
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Gt(e, t, n) {
|
|
653
653
|
return Math.floor(Le(new Date(Date.UTC(e, t - 1, n)), !1));
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Kt(e) {
|
|
656
656
|
return Fe(Math.floor(e), !1);
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
let t =
|
|
658
|
+
function qt(e) {
|
|
659
|
+
let t = Kt(e);
|
|
660
660
|
return {
|
|
661
661
|
y: t.getUTCFullYear(),
|
|
662
662
|
m: t.getUTCMonth() + 1,
|
|
@@ -665,9 +665,9 @@ function Kt(e) {
|
|
|
665
665
|
}
|
|
666
666
|
//#endregion
|
|
667
667
|
//#region packages/xlsx/src/number-format.ts
|
|
668
|
-
var
|
|
669
|
-
function
|
|
670
|
-
let t = e ?? "", n =
|
|
668
|
+
var Jt = /* @__PURE__ */ new Map();
|
|
669
|
+
function Yt(e) {
|
|
670
|
+
let t = e ?? "", n = Jt.get(t);
|
|
671
671
|
if (n) return n;
|
|
672
672
|
let r = new Intl.DateTimeFormat(e, {
|
|
673
673
|
year: "numeric",
|
|
@@ -675,9 +675,9 @@ function Jt(e) {
|
|
|
675
675
|
day: "numeric",
|
|
676
676
|
timeZone: "UTC"
|
|
677
677
|
});
|
|
678
|
-
return
|
|
678
|
+
return Jt.set(t, r), r;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Xt(e) {
|
|
681
681
|
switch (e.type) {
|
|
682
682
|
case "empty": return "";
|
|
683
683
|
case "text": return e.text;
|
|
@@ -687,20 +687,20 @@ function Yt(e) {
|
|
|
687
687
|
case "shared": return "";
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
function Xt(e, t, n, r = !1) {
|
|
691
|
-
return Zt(e, t, n, r).text;
|
|
692
|
-
}
|
|
693
690
|
function Zt(e, t, n, r = !1) {
|
|
691
|
+
return Qt(e, t, n, r).text;
|
|
692
|
+
}
|
|
693
|
+
function Qt(e, t, n, r = !1) {
|
|
694
694
|
let i = t.cellXfs[e.styleIndex ?? 0]?.numFmtId ?? 0, a = t.numFmts?.find((e) => e.numFmtId === i)?.formatCode ?? null, o = n?.numFmtId ?? i, s = n?.formatCode ?? a;
|
|
695
695
|
if (e.value.type !== "number") {
|
|
696
|
-
let t =
|
|
697
|
-
return { text: s ?
|
|
696
|
+
let t = Xt(e.value);
|
|
697
|
+
return { text: s ? $t(t, s) : t };
|
|
698
698
|
}
|
|
699
|
-
let c =
|
|
700
|
-
return
|
|
699
|
+
let c = en(e.formula);
|
|
700
|
+
return _n(c ?? e.value.number, o, s, c === null ? r : !1);
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
let n =
|
|
702
|
+
function $t(e, t) {
|
|
703
|
+
let n = bn(t), r;
|
|
704
704
|
if (n.length >= 4) r = n[3];
|
|
705
705
|
else {
|
|
706
706
|
let t = n[n.length - 1];
|
|
@@ -722,12 +722,12 @@ function Qt(e, t) {
|
|
|
722
722
|
}
|
|
723
723
|
return i;
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function en(e) {
|
|
726
726
|
if (!e) return null;
|
|
727
727
|
let t = e.trim().replace(/^=/, "").toUpperCase().replace(/\s+/g, "");
|
|
728
|
-
return t === "TODAY()" ?
|
|
728
|
+
return t === "TODAY()" ? Ut() : t === "NOW()" ? Wt() : null;
|
|
729
729
|
}
|
|
730
|
-
var
|
|
730
|
+
var tn = {
|
|
731
731
|
15: "d-mmm-yy",
|
|
732
732
|
16: "d-mmm",
|
|
733
733
|
17: "mmm-yy",
|
|
@@ -750,7 +750,7 @@ var en = {
|
|
|
750
750
|
56: "m\"月\"d\"日\"",
|
|
751
751
|
57: "[$-411]ge.m.d",
|
|
752
752
|
58: "[$-411]ggge\"年\"m\"月\"d\"日\""
|
|
753
|
-
},
|
|
753
|
+
}, nn = [
|
|
754
754
|
"January",
|
|
755
755
|
"February",
|
|
756
756
|
"March",
|
|
@@ -763,7 +763,7 @@ var en = {
|
|
|
763
763
|
"October",
|
|
764
764
|
"November",
|
|
765
765
|
"December"
|
|
766
|
-
],
|
|
766
|
+
], rn = [
|
|
767
767
|
"Sunday",
|
|
768
768
|
"Monday",
|
|
769
769
|
"Tuesday",
|
|
@@ -771,7 +771,7 @@ var en = {
|
|
|
771
771
|
"Thursday",
|
|
772
772
|
"Friday",
|
|
773
773
|
"Saturday"
|
|
774
|
-
],
|
|
774
|
+
], an = [
|
|
775
775
|
"日",
|
|
776
776
|
"月",
|
|
777
777
|
"火",
|
|
@@ -779,7 +779,7 @@ var en = {
|
|
|
779
779
|
"木",
|
|
780
780
|
"金",
|
|
781
781
|
"土"
|
|
782
|
-
],
|
|
782
|
+
], on = [
|
|
783
783
|
"日曜日",
|
|
784
784
|
"月曜日",
|
|
785
785
|
"火曜日",
|
|
@@ -787,7 +787,7 @@ var en = {
|
|
|
787
787
|
"木曜日",
|
|
788
788
|
"金曜日",
|
|
789
789
|
"土曜日"
|
|
790
|
-
],
|
|
790
|
+
], sn = [
|
|
791
791
|
{
|
|
792
792
|
start: new Date(Date.UTC(2019, 4, 1)),
|
|
793
793
|
abbr: "R",
|
|
@@ -819,14 +819,14 @@ var en = {
|
|
|
819
819
|
long: "明治"
|
|
820
820
|
}
|
|
821
821
|
];
|
|
822
|
-
function
|
|
823
|
-
for (let t of
|
|
822
|
+
function cn(e) {
|
|
823
|
+
for (let t of sn) if (e.getTime() >= t.start.getTime()) return {
|
|
824
824
|
abbr: t.abbr,
|
|
825
825
|
short: t.short,
|
|
826
826
|
long: t.long,
|
|
827
827
|
year: e.getUTCFullYear() - t.start.getUTCFullYear() + 1
|
|
828
828
|
};
|
|
829
|
-
let t =
|
|
829
|
+
let t = sn[sn.length - 1];
|
|
830
830
|
return {
|
|
831
831
|
abbr: t.abbr,
|
|
832
832
|
short: t.short,
|
|
@@ -834,8 +834,8 @@ function sn(e) {
|
|
|
834
834
|
year: e.getUTCFullYear()
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
let r = Fe(e, n), i = r.getUTCFullYear(), a = r.getUTCMonth() + 1, o = r.getUTCDate(), s = r.getUTCDay(), c = r.getUTCHours(), l = r.getUTCMinutes(), u = r.getUTCSeconds(), d = t.split(";")[0], f = /am\/pm|a\/p/i.test(d), p = null, m = () => p ??=
|
|
837
|
+
function ln(e, t, n = !1) {
|
|
838
|
+
let r = Fe(e, n), i = r.getUTCFullYear(), a = r.getUTCMonth() + 1, o = r.getUTCDate(), s = r.getUTCDay(), c = r.getUTCHours(), l = r.getUTCMinutes(), u = r.getUTCSeconds(), d = t.split(";")[0], f = /am\/pm|a\/p/i.test(d), p = null, m = () => p ??= cn(r), h = "", g = 0, _ = !1;
|
|
839
839
|
for (; g < d.length;) {
|
|
840
840
|
let t = d[g];
|
|
841
841
|
if (t === "\"") {
|
|
@@ -863,11 +863,11 @@ function cn(e, t, n = !1) {
|
|
|
863
863
|
let e = 0;
|
|
864
864
|
for (; g < d.length && d[g].toLowerCase() === "m";) e++, g++;
|
|
865
865
|
let t = d.slice(g).replace(/\[[^\]]*\]/g, "");
|
|
866
|
-
_ || /^:s/i.test(t) ? h += e >= 2 ? String(l).padStart(2, "0") : String(l) : e === 1 ? h += String(a) : e === 2 ? h += String(a).padStart(2, "0") : e === 3 ? h +=
|
|
866
|
+
_ || /^:s/i.test(t) ? h += e >= 2 ? String(l).padStart(2, "0") : String(l) : e === 1 ? h += String(a) : e === 2 ? h += String(a).padStart(2, "0") : e === 3 ? h += nn[a - 1].slice(0, 3) : e === 4 ? h += nn[a - 1] : h += nn[a - 1][0], _ = !1;
|
|
867
867
|
} else if (t === "d" || t === "D") {
|
|
868
868
|
let e = 0;
|
|
869
869
|
for (; g < d.length && d[g].toLowerCase() === "d";) e++, g++;
|
|
870
|
-
e === 1 ? h += String(o) : e === 2 ? h += String(o).padStart(2, "0") : e === 3 ? h +=
|
|
870
|
+
e === 1 ? h += String(o) : e === 2 ? h += String(o).padStart(2, "0") : e === 3 ? h += rn[s].slice(0, 3) : h += rn[s], _ = !1;
|
|
871
871
|
} else if (t === "h" || t === "H") {
|
|
872
872
|
let e = 0;
|
|
873
873
|
for (; g < d.length && d[g].toLowerCase() === "h";) e++, g++;
|
|
@@ -894,61 +894,61 @@ function cn(e, t, n = !1) {
|
|
|
894
894
|
h += e >= 2 ? String(t).padStart(2, "0") : String(t), _ = !1;
|
|
895
895
|
} else if (t === "A" || t === "a") {
|
|
896
896
|
let e = d.slice(g).toUpperCase();
|
|
897
|
-
e.startsWith("AAAA") ? (h +=
|
|
897
|
+
e.startsWith("AAAA") ? (h += on[s], g += 4) : e.startsWith("AAA") ? (h += an[s], g += 3) : e.startsWith("AM/PM") ? (h += c < 12 ? "AM" : "PM", g += 5) : e.startsWith("A/P") ? (h += c < 12 ? "A" : "P", g += 3) : (h += t, g++), _ = !1;
|
|
898
898
|
} else h += t, g++, t !== ":" && t !== "/" && t !== "-" && t !== "." && t !== " " && (_ = !1);
|
|
899
899
|
}
|
|
900
900
|
return h;
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function un(e) {
|
|
903
903
|
if (/\[[hms]+\]/i.test(e)) return !0;
|
|
904
904
|
let t = e.replace(/"[^"]*"/g, "").replace(/\[[^\]]*\]/g, "");
|
|
905
905
|
return /[yd]/i.test(t) || /a{3,}/i.test(t);
|
|
906
906
|
}
|
|
907
|
-
var
|
|
908
|
-
function fn(e) {
|
|
909
|
-
return e.includes(".") ? e.replace(/0+$/, "").replace(/\.$/, "") : e;
|
|
910
|
-
}
|
|
907
|
+
var dn = 11, fn = 6;
|
|
911
908
|
function pn(e) {
|
|
912
|
-
return
|
|
909
|
+
return e.includes(".") ? e.replace(/0+$/, "").replace(/\.$/, "") : e;
|
|
913
910
|
}
|
|
914
911
|
function mn(e) {
|
|
915
|
-
|
|
916
|
-
return `${fn(t)}E${pn(Number(n))}`;
|
|
912
|
+
return `${e >= 0 ? "+" : "-"}${Math.abs(e).toString().padStart(2, "0")}`;
|
|
917
913
|
}
|
|
918
914
|
function hn(e) {
|
|
915
|
+
let [t, n] = e.toExponential(fn - 1).split("e");
|
|
916
|
+
return `${pn(t)}E${mn(Number(n))}`;
|
|
917
|
+
}
|
|
918
|
+
function gn(e) {
|
|
919
919
|
if (!Number.isFinite(e)) return String(e);
|
|
920
920
|
if (e === 0) return "0";
|
|
921
|
-
let t = e < 0, n = Math.abs(e), r = Number(n.toExponential(
|
|
921
|
+
let t = e < 0, n = Math.abs(e), r = Number(n.toExponential(dn - 1).split("e")[1]), i = r >= dn || r < -5 ? hn(n) : pn(n.toPrecision(dn));
|
|
922
922
|
return t ? `-${i}` : i;
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function _n(e, t, n, r = !1) {
|
|
925
925
|
if (t === 14 && !n) {
|
|
926
926
|
let t = typeof navigator > "u" ? void 0 : navigator.language, n = Fe(e, r);
|
|
927
|
-
return { text:
|
|
927
|
+
return { text: Yt(t).format(n) };
|
|
928
928
|
}
|
|
929
|
-
let i =
|
|
930
|
-
if (i) return { text:
|
|
931
|
-
if (n && n.trim().toLowerCase() === "general") return { text:
|
|
932
|
-
if (n) return
|
|
929
|
+
let i = tn[t];
|
|
930
|
+
if (i) return { text: ln(e, i, r) };
|
|
931
|
+
if (n && n.trim().toLowerCase() === "general") return { text: gn(e) };
|
|
932
|
+
if (n) return un(n) ? { text: ln(e, n, r) } : An(e, n);
|
|
933
933
|
switch (t) {
|
|
934
|
-
case 0: return { text:
|
|
935
|
-
case 1: return
|
|
936
|
-
case 2: return
|
|
937
|
-
case 3: return
|
|
938
|
-
case 4: return
|
|
939
|
-
case 9: return
|
|
940
|
-
case 10: return
|
|
941
|
-
case 11: return
|
|
942
|
-
case 37: return
|
|
943
|
-
case 38: return
|
|
944
|
-
case 39: return
|
|
945
|
-
case 40: return
|
|
946
|
-
case 48: return
|
|
934
|
+
case 0: return { text: gn(e) };
|
|
935
|
+
case 1: return An(e, "0");
|
|
936
|
+
case 2: return An(e, "0.00");
|
|
937
|
+
case 3: return An(e, "#,##0");
|
|
938
|
+
case 4: return An(e, "#,##0.00");
|
|
939
|
+
case 9: return An(e, "0%");
|
|
940
|
+
case 10: return An(e, "0.00%");
|
|
941
|
+
case 11: return An(e, "0.00E+00");
|
|
942
|
+
case 37: return An(e, "#,##0 ;(#,##0)");
|
|
943
|
+
case 38: return An(e, "#,##0 ;[Red](#,##0)");
|
|
944
|
+
case 39: return An(e, "#,##0.00;(#,##0.00)");
|
|
945
|
+
case 40: return An(e, "#,##0.00;[Red](#,##0.00)");
|
|
946
|
+
case 48: return An(e, "##0.0E+0");
|
|
947
947
|
case 49: return { text: String(e) };
|
|
948
|
-
default: return { text:
|
|
948
|
+
default: return { text: gn(e) };
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
|
-
var
|
|
951
|
+
var vn = {
|
|
952
952
|
black: "#000000",
|
|
953
953
|
blue: "#0000FF",
|
|
954
954
|
cyan: "#00FFFF",
|
|
@@ -957,8 +957,8 @@ var _n = {
|
|
|
957
957
|
red: "#FF0000",
|
|
958
958
|
white: "#FFFFFF",
|
|
959
959
|
yellow: "#FFFF00"
|
|
960
|
-
},
|
|
961
|
-
function
|
|
960
|
+
}, yn = /* @__PURE__ */ "#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#800000.#008000.#000080.#808000.#800080.#008080.#C0C0C0.#808080.#9999FF.#993366.#FFFFCC.#CCFFFF.#660066.#FF8080.#0066CC.#CCCCFF.#000080.#FF00FF.#FFFF00.#00FFFF.#800080.#800000.#008080.#0000FF.#00CCFF.#CCFFFF.#CCFFCC.#FFFF99.#99CCFF.#FF99CC.#CC99FF.#FFCC99.#3366FF.#33CCCC.#99CC00.#FFCC00.#FF9900.#FF6600.#666699.#969696.#003366.#339966.#003300.#333300.#993300.#993366.#333399.#333333".split(".");
|
|
961
|
+
function bn(e) {
|
|
962
962
|
let t = [], n = "", r = 0;
|
|
963
963
|
for (; r < e.length;) {
|
|
964
964
|
let i = e[r];
|
|
@@ -973,7 +973,7 @@ function yn(e) {
|
|
|
973
973
|
}
|
|
974
974
|
return t.push(n), t;
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function xn(e) {
|
|
977
977
|
let t = "", n, r, i = 0;
|
|
978
978
|
for (; i < e.length;) {
|
|
979
979
|
let a = e[i];
|
|
@@ -988,10 +988,10 @@ function bn(e) {
|
|
|
988
988
|
continue;
|
|
989
989
|
}
|
|
990
990
|
let s = e.slice(i + 1, o), c = s.toLowerCase(), l = c.match(/^color(\d{1,2})$/), u = s.match(/^(<=|>=|<>|<|>|=)\s*(-?[0-9.]+(?:[eE][-+]?\d+)?)$/);
|
|
991
|
-
if (c in
|
|
991
|
+
if (c in vn) n = vn[c];
|
|
992
992
|
else if (l) {
|
|
993
993
|
let e = parseInt(l[1], 10);
|
|
994
|
-
e >= 1 && e <= 56 && (n =
|
|
994
|
+
e >= 1 && e <= 56 && (n = yn[e + 7] ?? n);
|
|
995
995
|
} else u ? r = {
|
|
996
996
|
op: u[1],
|
|
997
997
|
value: Number(u[2])
|
|
@@ -1005,7 +1005,7 @@ function bn(e) {
|
|
|
1005
1005
|
condition: r
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function Sn(e, t) {
|
|
1009
1009
|
switch (e.op) {
|
|
1010
1010
|
case "<": return t < e.value;
|
|
1011
1011
|
case "<=": return t <= e.value;
|
|
@@ -1015,7 +1015,7 @@ function xn(e, t) {
|
|
|
1015
1015
|
case "<>": return t !== e.value;
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function Cn(e) {
|
|
1019
1019
|
let t = [], n = "", r = "", i = !1, a = !1, o, s = !1, c = 0, l = 0, u = (e) => {
|
|
1020
1020
|
if (!e) return;
|
|
1021
1021
|
!a && !s && (c = n.replace(/,/g, "").length);
|
|
@@ -1089,20 +1089,20 @@ function Sn(e) {
|
|
|
1089
1089
|
fraction: h
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function wn(e) {
|
|
1093
1093
|
return e.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Tn(e, t, n) {
|
|
1096
1096
|
let r = t.split(""), i = e.split(""), a = [], o = i.length - 1, s = [];
|
|
1097
1097
|
for (let e = r.length - 1; e >= 0; e--) o >= 0 ? (a.unshift(i[o]), s.unshift(i[o]), o--) : r[e] === "0" ? (a.unshift("0"), s.unshift("0")) : r[e] === "?" && a.unshift(" ");
|
|
1098
1098
|
for (; o >= 0;) a.unshift(i[o]), s.unshift(i[o]), o--;
|
|
1099
1099
|
if (n) {
|
|
1100
|
-
let e =
|
|
1100
|
+
let e = wn(s.join(""));
|
|
1101
1101
|
return (a.length - s.length > 0 ? a.slice(0, a.length - s.length).join("") : "") + e;
|
|
1102
1102
|
}
|
|
1103
1103
|
return a.join("");
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function En(e, t) {
|
|
1106
1106
|
let n = t.length;
|
|
1107
1107
|
if (n === 0) return "";
|
|
1108
1108
|
let r = e.padEnd(n, "0").slice(0, n).split("");
|
|
@@ -1114,7 +1114,7 @@ function Tn(e, t) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
return r.join("");
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Dn(e, t, n) {
|
|
1118
1118
|
if (n !== null) return [Math.round(e * n), n];
|
|
1119
1119
|
let r = 10 ** Math.max(t, 1) - 1, i = 0, a = 1, o = Math.abs(e), s = [0, 1], c = [1, 1];
|
|
1120
1120
|
for (let t = 0; t < 100; t++) {
|
|
@@ -1127,12 +1127,12 @@ function En(e, t, n) {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
return [i, a];
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1131
|
-
let r =
|
|
1130
|
+
function On(e, t, n) {
|
|
1131
|
+
let r = Cn(t), i = n ? Math.abs(e) : e;
|
|
1132
1132
|
r.hasPercent && (i *= 100), r.commaScale > 0 && (i /= 1e3 ** r.commaScale);
|
|
1133
1133
|
let a = i < 0 ? "-" : "", o = Math.abs(i);
|
|
1134
1134
|
if (r.fraction) {
|
|
1135
|
-
let e = Math.floor(o), t = o - e, { wholeSpec: n, numSpec: i, denSpec: s, fixedDen: c } = r.fraction, l = n.length > 0, [u, d] =
|
|
1135
|
+
let e = Math.floor(o), t = o - e, { wholeSpec: n, numSpec: i, denSpec: s, fixedDen: c } = r.fraction, l = n.length > 0, [u, d] = Dn(t, s.length, c), f = (e, t) => {
|
|
1136
1136
|
let n = String(e), r = t.includes("0") ? "0" : " ";
|
|
1137
1137
|
for (; n.length < t.length;) n = r + n;
|
|
1138
1138
|
return n;
|
|
@@ -1160,12 +1160,12 @@ function Dn(e, t, n) {
|
|
|
1160
1160
|
let e = Math.max(r.intSpec.length, 1), t = r.fracSpec.length, n = 0, i = 0;
|
|
1161
1161
|
o !== 0 && (i = Math.floor(Math.log10(o)), i = Math.floor(i / e) * e, n = o / 10 ** i, parseFloat(Ie(n, t)) >= 10 ** e && (i += e, n = o / 10 ** i));
|
|
1162
1162
|
let [s, c = ""] = Ie(n, t).split(".");
|
|
1163
|
-
return a +
|
|
1163
|
+
return a + kn(r, Tn(s, r.intSpec, !1), En(c, r.fracSpec), "E" + (i < 0 ? "-" : r.exp.plus ? "+" : "") + String(Math.abs(i)).padStart(r.exp.width, "0"));
|
|
1164
1164
|
}
|
|
1165
1165
|
let s = r.fracSpec.length, [c, l = ""] = Ie(o, s).split("."), u = c.replace(/^0+/, ""), d = /[0]/.test(r.intSpec) || r.intSpec === "" && !1;
|
|
1166
|
-
return u === "" && d && (u = "0"), a +
|
|
1166
|
+
return u === "" && d && (u = "0"), a + kn(r, Tn(u, r.intSpec, r.grouping), En(l, r.fracSpec), "");
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function kn(e, t, n, r) {
|
|
1169
1169
|
let i = t.split(""), a = [];
|
|
1170
1170
|
e.parts.forEach((e, t) => {
|
|
1171
1171
|
e.kind === "intph" && a.push(t);
|
|
@@ -1189,12 +1189,12 @@ function On(e, t, n, r) {
|
|
|
1189
1189
|
}
|
|
1190
1190
|
return f;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
let n =
|
|
1192
|
+
function An(e, t) {
|
|
1193
|
+
let n = bn(t).map(xn), r = n.some((e) => e.condition), i, a = !1;
|
|
1194
1194
|
if (r) {
|
|
1195
1195
|
let t = !1;
|
|
1196
1196
|
for (let r of n) if (r.condition) {
|
|
1197
|
-
if (
|
|
1197
|
+
if (Sn(r.condition, e)) {
|
|
1198
1198
|
i = r, t = !0;
|
|
1199
1199
|
break;
|
|
1200
1200
|
}
|
|
@@ -1202,7 +1202,7 @@ function kn(e, t) {
|
|
|
1202
1202
|
if (!i) return { text: "#" };
|
|
1203
1203
|
a = t && e < 0;
|
|
1204
1204
|
} else e > 0 ? i = n[0] : e < 0 ? n.length > 1 ? (i = n[1], a = !0) : i = n[0] : i = n.length > 2 ? n[2] : n[0];
|
|
1205
|
-
let o =
|
|
1205
|
+
let o = On(e, i.body, a);
|
|
1206
1206
|
return i.color ? {
|
|
1207
1207
|
text: o,
|
|
1208
1208
|
color: i.color
|
|
@@ -1210,9 +1210,9 @@ function kn(e, t) {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
//#endregion
|
|
1212
1212
|
//#region packages/xlsx/src/renderer-coordinate-index.ts
|
|
1213
|
-
var
|
|
1214
|
-
function
|
|
1215
|
-
let n =
|
|
1213
|
+
var jn = u;
|
|
1214
|
+
function Mn(e, t) {
|
|
1215
|
+
let n = jn;
|
|
1216
1216
|
return new le(`XLSX renderer ${e.resource} exceeded its hard limit of ${n} entries`, {
|
|
1217
1217
|
stage: "rendering",
|
|
1218
1218
|
violation: {
|
|
@@ -1232,7 +1232,7 @@ function jn(e, t) {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function Nn(e, t, n = 0) {
|
|
1236
1236
|
let { top: r, bottom: i, left: a, right: o } = e;
|
|
1237
1237
|
if (i < r || o < a) return 0;
|
|
1238
1238
|
if (![
|
|
@@ -1240,44 +1240,44 @@ function Mn(e, t, n = 0) {
|
|
|
1240
1240
|
i,
|
|
1241
1241
|
a,
|
|
1242
1242
|
o
|
|
1243
|
-
].every(Number.isSafeInteger) || !Number.isSafeInteger(n) || n < 0) throw
|
|
1244
|
-
let s = i - r + 1, c = o - a + 1, l =
|
|
1245
|
-
if (!Number.isSafeInteger(s) || !Number.isSafeInteger(c) || s > l || c > Math.floor(l / s)) throw
|
|
1243
|
+
].every(Number.isSafeInteger) || !Number.isSafeInteger(n) || n < 0) throw Mn(t, jn + 1);
|
|
1244
|
+
let s = i - r + 1, c = o - a + 1, l = jn + n;
|
|
1245
|
+
if (!Number.isSafeInteger(s) || !Number.isSafeInteger(c) || s > l || c > Math.floor(l / s)) throw Mn(t, jn + 1);
|
|
1246
1246
|
let u = s * c - n;
|
|
1247
|
-
if (u >
|
|
1247
|
+
if (u > jn) throw Mn(t, u);
|
|
1248
1248
|
return u;
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1251
|
-
if (!e.has(t) && e.size >=
|
|
1250
|
+
function Pn(e, t, n, r) {
|
|
1251
|
+
if (!e.has(t) && e.size >= jn) throw Mn(r, e.size + 1);
|
|
1252
1252
|
e.set(t, n);
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Fn(e, t) {
|
|
1255
1255
|
let n = /* @__PURE__ */ new Map();
|
|
1256
|
-
for (let r of e) for (let e of r.cells)
|
|
1256
|
+
for (let r of e) for (let e of r.cells) Pn(n, `${e.row}:${e.col}`, e, t);
|
|
1257
1257
|
return n;
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
if (!e.has(t) && e.size >=
|
|
1259
|
+
function In(e, t, n) {
|
|
1260
|
+
if (!e.has(t) && e.size >= jn) throw Mn(n, e.size + 1);
|
|
1261
1261
|
e.add(t);
|
|
1262
1262
|
}
|
|
1263
1263
|
//#endregion
|
|
1264
1264
|
//#region packages/xlsx/src/conditional-format.ts
|
|
1265
|
-
function
|
|
1265
|
+
function Ln(e, t, n) {
|
|
1266
1266
|
for (let r of e) if (t >= r.top && t <= r.bottom && n >= r.left && n <= r.right) return !0;
|
|
1267
1267
|
return !1;
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1269
|
+
function Rn(e) {
|
|
1270
1270
|
return e && e.value.type === "number" ? e.value.number : null;
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1272
|
+
function zn(e) {
|
|
1273
1273
|
return e && e.value.type === "text" ? e.value.text : null;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function Bn(e, t) {
|
|
1276
1276
|
let n = [];
|
|
1277
|
-
for (let r of e.rows) for (let e of r.cells) e.value.type === "number" &&
|
|
1277
|
+
for (let r of e.rows) for (let e of r.cells) e.value.type === "number" && Ln(t, e.row, e.col) && n.push(e.value.number);
|
|
1278
1278
|
return n;
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function Vn(e, t) {
|
|
1281
1281
|
let n = t.length ? Math.min(...t) : 0, r = t.length ? Math.max(...t) : 0, i = e.value == null ? NaN : parseFloat(e.value);
|
|
1282
1282
|
switch (e.kind) {
|
|
1283
1283
|
case "min": return n;
|
|
@@ -1295,18 +1295,18 @@ function Bn(e, t) {
|
|
|
1295
1295
|
default: return isNaN(i) ? 0 : i;
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
|
-
function
|
|
1298
|
+
function Hn(e, t = Un(e)) {
|
|
1299
1299
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
1300
1300
|
for (let t of e.definedNames ?? []) r.set(t.name, t);
|
|
1301
1301
|
for (let t of e.conditionalFormats ?? []) {
|
|
1302
|
-
let r =
|
|
1302
|
+
let r = Bn(e, t.sqref);
|
|
1303
1303
|
for (let e of t.rules) {
|
|
1304
1304
|
let i = {
|
|
1305
1305
|
rule: e,
|
|
1306
1306
|
sqref: t.sqref
|
|
1307
1307
|
};
|
|
1308
|
-
if (e.type === "colorScale") i.scaleStops = e.stops.map((e) =>
|
|
1309
|
-
else if (e.type === "dataBar") i.barMin =
|
|
1308
|
+
if (e.type === "colorScale") i.scaleStops = e.stops.map((e) => Vn(e, r));
|
|
1309
|
+
else if (e.type === "dataBar") i.barMin = Vn(e.min, r), i.barMax = Vn(e.max, r);
|
|
1310
1310
|
else if (e.type === "top10") {
|
|
1311
1311
|
let t = [...r].sort((e, t) => e - t), n = t.length;
|
|
1312
1312
|
if (n > 0) {
|
|
@@ -1325,7 +1325,7 @@ function Vn(e, t = Hn(e)) {
|
|
|
1325
1325
|
i.avgStdDev = Math.sqrt(e);
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
|
-
} else e.type === "iconSet" && (i.iconThresholds = e.cfvos.map((e) =>
|
|
1328
|
+
} else e.type === "iconSet" && (i.iconThresholds = e.cfvos.map((e) => Vn(e, r)));
|
|
1329
1329
|
n.push(i);
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
@@ -1336,13 +1336,13 @@ function Vn(e, t = Hn(e)) {
|
|
|
1336
1336
|
definedNames: r
|
|
1337
1337
|
};
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1340
|
-
return
|
|
1339
|
+
function Un(e) {
|
|
1340
|
+
return Fn(e.rows, {
|
|
1341
1341
|
resource: "worksheet-cell-index",
|
|
1342
1342
|
operation: "index-worksheet-cells"
|
|
1343
1343
|
});
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function Wn(e, t, n) {
|
|
1346
1346
|
switch (t) {
|
|
1347
1347
|
case "greaterThan": return e > (n[0] ?? 0);
|
|
1348
1348
|
case "greaterThanOrEqual": return e >= (n[0] ?? 0);
|
|
@@ -1355,13 +1355,13 @@ function Un(e, t, n) {
|
|
|
1355
1355
|
default: return !1;
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function Gn(e) {
|
|
1359
1359
|
let t = e.trim();
|
|
1360
1360
|
if (t.length >= 2 && t.startsWith("\"") && t.endsWith("\"")) return { text: t.slice(1, -1).replace(/""/g, "\"") };
|
|
1361
1361
|
let n = parseFloat(t);
|
|
1362
1362
|
return isNaN(n) ? { text: t } : { num: n };
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function Kn(e, t, n) {
|
|
1365
1365
|
let r = n[0] ?? "", i = n[1] ?? "", a = (e) => e.toLowerCase();
|
|
1366
1366
|
switch (t) {
|
|
1367
1367
|
case "equal": return a(e) === a(r);
|
|
@@ -1375,21 +1375,21 @@ function Gn(e, t, n) {
|
|
|
1375
1375
|
default: return !1;
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function qn(e, t, n) {
|
|
1379
1379
|
let r = e.replace("#", ""), i = t.replace("#", ""), a = parseInt(r.slice(0, 2), 16), o = parseInt(r.slice(2, 4), 16), s = parseInt(r.slice(4, 6), 16), c = parseInt(i.slice(0, 2), 16), l = parseInt(i.slice(2, 4), 16), u = parseInt(i.slice(4, 6), 16), d = Math.round(a + (c - a) * n), f = Math.round(o + (l - o) * n), p = Math.round(s + (u - s) * n);
|
|
1380
1380
|
return `#${d.toString(16).padStart(2, "0").toUpperCase()}${f.toString(16).padStart(2, "0").toUpperCase()}${p.toString(16).padStart(2, "0").toUpperCase()}`;
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1382
|
+
function Jn(e, t, n) {
|
|
1383
1383
|
if (!t.length) return "#FFFFFF";
|
|
1384
1384
|
if (e <= n[0]) return t[0].color;
|
|
1385
1385
|
if (e >= n[n.length - 1]) return t[t.length - 1].color;
|
|
1386
1386
|
for (let r = 1; r < n.length; r++) if (e <= n[r]) {
|
|
1387
1387
|
let i = n[r - 1], a = n[r], o = a === i ? 0 : (e - i) / (a - i);
|
|
1388
|
-
return
|
|
1388
|
+
return qn(t[r - 1].color, t[r].color, o);
|
|
1389
1389
|
}
|
|
1390
1390
|
return t[t.length - 1].color;
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function Yn(e, t) {
|
|
1393
1393
|
if (t && (t.fill && !e.fill && (e.fill = t.fill), t.font?.color && e.fontColor == null && (e.fontColor = t.font.color), t.font?.bold && e.fontBold == null && (e.fontBold = !0), t.font?.italic && e.fontItalic == null && (e.fontItalic = !0), t.font?.underline && e.fontUnderline == null && (e.fontUnderline = !0), t.font?.strike && e.fontStrike == null && (e.fontStrike = !0), t.numFmt && e.numFmt == null && (e.numFmt = {
|
|
1394
1394
|
numFmtId: t.numFmt.numFmtId,
|
|
1395
1395
|
formatCode: t.numFmt.formatCode || null
|
|
@@ -1405,12 +1405,12 @@ function Jn(e, t) {
|
|
|
1405
1405
|
};
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function Xn(e, t, n, r, i) {
|
|
1409
1409
|
let a = {};
|
|
1410
1410
|
if (!r.compiled.length) return a;
|
|
1411
1411
|
for (let o of r.compiled) {
|
|
1412
|
-
if (!
|
|
1413
|
-
let s = o.rule, c =
|
|
1412
|
+
if (!Ln(o.sqref, t, n)) continue;
|
|
1413
|
+
let s = o.rule, c = Rn(e);
|
|
1414
1414
|
if (s.type === "expression") {
|
|
1415
1415
|
let e = o.sqref[0];
|
|
1416
1416
|
if (!e) continue;
|
|
@@ -1422,19 +1422,19 @@ function Yn(e, t, n, r, i) {
|
|
|
1422
1422
|
cellIndex: r.cellIndex,
|
|
1423
1423
|
definedNames: r.definedNames,
|
|
1424
1424
|
depth: 0
|
|
1425
|
-
}) && (
|
|
1425
|
+
}) && (Yn(a, s.dxfId == null ? null : i[s.dxfId]), s.stopIfTrue)) break;
|
|
1426
1426
|
continue;
|
|
1427
1427
|
}
|
|
1428
1428
|
if (s.type === "cellIs") {
|
|
1429
|
-
let t = s.formulas.map(
|
|
1430
|
-
c != null && t.every((e) => e.num != null) ? r =
|
|
1429
|
+
let t = s.formulas.map(Gn), n = zn(e), r = !1;
|
|
1430
|
+
c != null && t.every((e) => e.num != null) ? r = Wn(c, s.operator, t.map((e) => e.num)) : n != null && t.every((e) => e.text != null) && (r = Kn(n, s.operator, t.map((e) => e.text))), r && Yn(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1431
1431
|
} else if (s.type === "top10") {
|
|
1432
1432
|
if (c == null || o.top10Threshold == null) continue;
|
|
1433
|
-
(o.top10IsTop ? c >= o.top10Threshold : c <= o.top10Threshold) &&
|
|
1433
|
+
(o.top10IsTop ? c >= o.top10Threshold : c <= o.top10Threshold) && Yn(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1434
1434
|
} else if (s.type === "aboveAverage") {
|
|
1435
1435
|
if (c == null || o.avgValue == null) continue;
|
|
1436
1436
|
let e = o.avgStdDev == null ? 0 : o.avgStdDev * (s.stdDev ?? 1), t = o.avgIsAbove ? o.avgValue + e : o.avgValue - e, n = s.equalAverage === !0;
|
|
1437
|
-
(o.avgIsAbove ? n ? c >= t : c > t : n ? c <= t : c < t) &&
|
|
1437
|
+
(o.avgIsAbove ? n ? c >= t : c > t : n ? c <= t : c < t) && Yn(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1438
1438
|
} else if (s.type === "iconSet") {
|
|
1439
1439
|
if (c == null || !o.iconThresholds?.length) continue;
|
|
1440
1440
|
let e = o.iconThresholds, t = e.length, n = 0;
|
|
@@ -1451,7 +1451,7 @@ function Yn(e, t, n, r, i) {
|
|
|
1451
1451
|
};
|
|
1452
1452
|
} else if (s.type === "colorScale") {
|
|
1453
1453
|
if (c == null || !o.scaleStops || a.fill) continue;
|
|
1454
|
-
let e =
|
|
1454
|
+
let e = Jn(c, s.stops, o.scaleStops);
|
|
1455
1455
|
a.fill = {
|
|
1456
1456
|
patternType: "solid",
|
|
1457
1457
|
fgColor: e,
|
|
@@ -1471,21 +1471,21 @@ function Yn(e, t, n, r, i) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
//#endregion
|
|
1473
1473
|
//#region packages/xlsx/src/bidi-line.ts
|
|
1474
|
-
function
|
|
1474
|
+
function Zn(e, t) {
|
|
1475
1475
|
return e === 2 ? !0 : e === 1 ? !1 : ot(void 0, t) === "rtl";
|
|
1476
1476
|
}
|
|
1477
|
-
var
|
|
1477
|
+
var Qn = (e) => {
|
|
1478
1478
|
let t = e.text;
|
|
1479
1479
|
return typeof t == "string" ? t : void 0;
|
|
1480
1480
|
};
|
|
1481
|
-
function
|
|
1481
|
+
function $n(e, t) {
|
|
1482
1482
|
let n = e === 2 || R(t);
|
|
1483
1483
|
return {
|
|
1484
1484
|
needBidi: n,
|
|
1485
|
-
baseRtl: n &&
|
|
1485
|
+
baseRtl: n && Zn(e, t)
|
|
1486
1486
|
};
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function er(e, t) {
|
|
1489
1489
|
let r = e.length;
|
|
1490
1490
|
if (r === 0) return {
|
|
1491
1491
|
order: [],
|
|
@@ -1494,7 +1494,7 @@ function $n(e, t) {
|
|
|
1494
1494
|
let i = "", a = Array(r);
|
|
1495
1495
|
for (let t = 0; t < r; t++) {
|
|
1496
1496
|
a[t] = i.length;
|
|
1497
|
-
let n =
|
|
1497
|
+
let n = Qn(e[t]) ?? "";
|
|
1498
1498
|
i += n.length > 0 ? n : "";
|
|
1499
1499
|
}
|
|
1500
1500
|
let { levels: o, paragraphLevel: s } = p().computeLevels(i, t ? "rtl" : "ltr"), { order: c, segLevels: l } = n(o, s, a), u = Array(r);
|
|
@@ -1504,21 +1504,21 @@ function $n(e, t) {
|
|
|
1504
1504
|
rtl: u
|
|
1505
1505
|
};
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function tr(e, t = 8) {
|
|
1508
1508
|
return Math.trunc((256 * e + Math.trunc(128 / t)) / 256 * t);
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function nr(e, t = 8) {
|
|
1511
1511
|
return e / t;
|
|
1512
1512
|
}
|
|
1513
|
-
function
|
|
1513
|
+
function rr(e) {
|
|
1514
1514
|
return Math.round(e * Re);
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function ir(e) {
|
|
1517
1517
|
return e / Re;
|
|
1518
1518
|
}
|
|
1519
1519
|
//#endregion
|
|
1520
1520
|
//#region packages/xlsx/src/internal/grid-axis-geometry.ts
|
|
1521
|
-
var
|
|
1521
|
+
var ar = class e {
|
|
1522
1522
|
indices;
|
|
1523
1523
|
cumulativeDelta;
|
|
1524
1524
|
customPx;
|
|
@@ -1592,7 +1592,7 @@ var ir = class e {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
return a;
|
|
1594
1594
|
}
|
|
1595
|
-
},
|
|
1595
|
+
}, or = 1048576, Z = 16384, sr = class e {
|
|
1596
1596
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
1597
1597
|
static forWorksheet(t, n) {
|
|
1598
1598
|
let r = this.cache.get(t);
|
|
@@ -1617,10 +1617,10 @@ var ir = class e {
|
|
|
1617
1617
|
freezeCols;
|
|
1618
1618
|
scaledCache = null;
|
|
1619
1619
|
constructor(e, t) {
|
|
1620
|
-
this.maximumDigitWidth = t, this.freezeRows = Math.min(
|
|
1621
|
-
let n =
|
|
1620
|
+
this.maximumDigitWidth = t, this.freezeRows = Math.min(or, Math.max(0, e.freezeRows ?? 0)), this.freezeCols = Math.min(Z, Math.max(0, e.freezeCols ?? 0));
|
|
1621
|
+
let n = tr(e.defaultColWidth, t), r = new Float64Array(Z + 1);
|
|
1622
1622
|
r.fill(NaN);
|
|
1623
|
-
let i = new Int32Array(
|
|
1623
|
+
let i = new Int32Array(Z + 2);
|
|
1624
1624
|
for (let e = 1; e < i.length; e++) i[e] = e;
|
|
1625
1625
|
let a = (e) => {
|
|
1626
1626
|
let t = e;
|
|
@@ -1633,7 +1633,7 @@ var ir = class e {
|
|
|
1633
1633
|
return t;
|
|
1634
1634
|
}, o = e.colWidthRanges ?? [];
|
|
1635
1635
|
for (let e = o.length - 1; e >= 0; e--) {
|
|
1636
|
-
let t = o[e], n = Math.max(1, Math.min(
|
|
1636
|
+
let t = o[e], n = Math.max(1, Math.min(Z, Math.trunc(t.min))), s = Math.max(1, Math.min(Z, Math.trunc(t.max)));
|
|
1637
1637
|
if (s < n || !Number.isFinite(t.width) || t.width < 0) continue;
|
|
1638
1638
|
let c = a(n);
|
|
1639
1639
|
for (; c <= s;) r[c] = t.width, i[c] = a(c + 1), c = i[c];
|
|
@@ -1643,16 +1643,16 @@ var ir = class e {
|
|
|
1643
1643
|
Number.isInteger(e) && e >= 1 && e <= 16384 && (r[e] = n);
|
|
1644
1644
|
}
|
|
1645
1645
|
let s = [];
|
|
1646
|
-
for (let e = 1; e <=
|
|
1646
|
+
for (let e = 1; e <= Z; e++) {
|
|
1647
1647
|
let i = r[e];
|
|
1648
1648
|
if (!Number.isFinite(i) || i < 0) continue;
|
|
1649
|
-
let a =
|
|
1649
|
+
let a = tr(i, t);
|
|
1650
1650
|
a !== n && s.push({
|
|
1651
1651
|
index: e,
|
|
1652
1652
|
px: a
|
|
1653
1653
|
});
|
|
1654
1654
|
}
|
|
1655
|
-
this.col = new
|
|
1655
|
+
this.col = new ar({}, n, (e) => tr(e, t), Z, s), this.row = new ar(e.rowHeights, rr(e.defaultRowHeight), rr, or);
|
|
1656
1656
|
}
|
|
1657
1657
|
logicalFrozenExtent() {
|
|
1658
1658
|
return {
|
|
@@ -1676,15 +1676,15 @@ var ir = class e {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
logicalContentExtent(e, t, n, r) {
|
|
1678
1678
|
return {
|
|
1679
|
-
width: n + this.col.offsetOf(Math.min(
|
|
1680
|
-
height: r + this.row.offsetOf(Math.min(
|
|
1679
|
+
width: n + this.col.offsetOf(Math.min(Z, t) + 1),
|
|
1680
|
+
height: r + this.row.offsetOf(Math.min(or, e) + 1)
|
|
1681
1681
|
};
|
|
1682
1682
|
}
|
|
1683
1683
|
roundedContentExtent(e, t, n, r, i) {
|
|
1684
1684
|
let a = this.axesAtScale(n);
|
|
1685
1685
|
return {
|
|
1686
|
-
width: Math.round(r * n) + a.col.offsetOf(Math.min(
|
|
1687
|
-
height: Math.round(i * n) + a.row.offsetOf(Math.min(
|
|
1686
|
+
width: Math.round(r * n) + a.col.offsetOf(Math.min(Z, t) + 1),
|
|
1687
|
+
height: Math.round(i * n) + a.row.offsetOf(Math.min(or, e) + 1)
|
|
1688
1688
|
};
|
|
1689
1689
|
}
|
|
1690
1690
|
cellAt(e, t, n) {
|
|
@@ -1773,7 +1773,7 @@ var ir = class e {
|
|
|
1773
1773
|
};
|
|
1774
1774
|
//#endregion
|
|
1775
1775
|
//#region packages/xlsx/src/a1.ts
|
|
1776
|
-
function
|
|
1776
|
+
function cr(e) {
|
|
1777
1777
|
let t = /^\$?([A-Z]+)\$?(\d+)$/.exec(e.trim());
|
|
1778
1778
|
if (!t) return null;
|
|
1779
1779
|
let n = t[1], r = 0;
|
|
@@ -1784,7 +1784,7 @@ function sr(e) {
|
|
|
1784
1784
|
col: r
|
|
1785
1785
|
};
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function lr(e, t) {
|
|
1788
1788
|
let n = "", r = t;
|
|
1789
1789
|
for (; r > 0;) {
|
|
1790
1790
|
let e = (r - 1) % 26;
|
|
@@ -1794,7 +1794,7 @@ function cr(e, t) {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
//#endregion
|
|
1796
1796
|
//#region packages/xlsx/src/vertical-text.ts
|
|
1797
|
-
function
|
|
1797
|
+
function ur(e, t, n, r, i, a = !1) {
|
|
1798
1798
|
let o = t.codePointAt(0) ?? 0, s = ee(o);
|
|
1799
1799
|
if (a && ie(o)) {
|
|
1800
1800
|
e.save(), e.translate(n, r + i / 2), e.textAlign = "center", e.textBaseline = "middle", A(e, () => e.fillText(t, 0, 0)), e.restore();
|
|
@@ -1818,38 +1818,38 @@ function lr(e, t, n, r, i, a = !1) {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
//#endregion
|
|
1820
1820
|
//#region packages/xlsx/src/internal/cell-anchor-geometry.ts
|
|
1821
|
-
function
|
|
1821
|
+
function dr(e) {
|
|
1822
1822
|
return e.editAs === "oneCell" && (e.nativeExtCx ?? 0) > 0 && (e.nativeExtCy ?? 0) > 0;
|
|
1823
1823
|
}
|
|
1824
1824
|
//#endregion
|
|
1825
1825
|
//#region packages/xlsx/src/renderer.ts
|
|
1826
|
-
function
|
|
1826
|
+
function fr(e, t) {
|
|
1827
1827
|
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
1828
1828
|
}
|
|
1829
|
-
var
|
|
1830
|
-
function
|
|
1829
|
+
var pr = g.map((e) => `"${e}"`).join(", "), mr = t.map((e) => `"${e}"`).join(", "), hr = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${pr}, sans-serif`, gr = `"Cambria", "Caladea", "Times New Roman", "Liberation Serif", "Noto Naskh Arabic", "Noto Sans Arabic", ${mr}, serif`, _r = "\"Courier New\", \"Liberation Mono\", monospace";
|
|
1830
|
+
function vr(e) {
|
|
1831
1831
|
let t = e ? H(e) : null, n = se(e);
|
|
1832
|
-
if (!t) return n === "serif" ?
|
|
1832
|
+
if (!t) return n === "serif" ? gr : n === "mono" ? _r : hr;
|
|
1833
1833
|
let r = n === "serif";
|
|
1834
|
-
return `${ue(t, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ?
|
|
1834
|
+
return `${ue(t, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ? mr : pr}, ${r ? "serif" : "sans-serif"}`;
|
|
1835
1835
|
}
|
|
1836
|
-
function
|
|
1837
|
-
return e ? `"${e}", ${
|
|
1836
|
+
function yr(e) {
|
|
1837
|
+
return e ? `"${e}", ${vr(e)}` : hr;
|
|
1838
1838
|
}
|
|
1839
|
-
var
|
|
1840
|
-
function
|
|
1839
|
+
var br = 11;
|
|
1840
|
+
function xr(e, t, n) {
|
|
1841
1841
|
return n - e - t;
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1844
|
-
return r ?
|
|
1843
|
+
function Sr(e, t, n, r) {
|
|
1844
|
+
return r ? xr(e, t, n) : e;
|
|
1845
1845
|
}
|
|
1846
|
-
var
|
|
1847
|
-
function
|
|
1846
|
+
var Cr = "#7a7a7a";
|
|
1847
|
+
function wr(e, t) {
|
|
1848
1848
|
let n = t * Re, r = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
|
|
1849
1849
|
if (!r) return 8;
|
|
1850
1850
|
let i = r.getContext("2d");
|
|
1851
1851
|
if (!i) return 8;
|
|
1852
|
-
i.font = `${n}px ${
|
|
1852
|
+
i.font = `${n}px ${yr(e)}`;
|
|
1853
1853
|
let a = 0;
|
|
1854
1854
|
for (let e of "0123456789") {
|
|
1855
1855
|
let t = i.measureText(e).width;
|
|
@@ -1857,13 +1857,13 @@ function Cr(e, t) {
|
|
|
1857
1857
|
}
|
|
1858
1858
|
return Math.round(a) || 8;
|
|
1859
1859
|
}
|
|
1860
|
-
function
|
|
1861
|
-
return !e.defaultFontFamily || !e.defaultFontSize ? 8 :
|
|
1860
|
+
function Tr(e) {
|
|
1861
|
+
return !e.defaultFontFamily || !e.defaultFontSize ? 8 : wr(e.defaultFontFamily, e.defaultFontSize);
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1864
|
-
return
|
|
1863
|
+
function Q(e) {
|
|
1864
|
+
return sr.forWorksheetMeasured(e, () => Tr(e));
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1866
|
+
function Er(e, t, n, r, i, a, o) {
|
|
1867
1867
|
if (!(i <= 0 || a <= 0)) {
|
|
1868
1868
|
if (o) {
|
|
1869
1869
|
let a = e.createLinearGradient(n, r, n + i, r);
|
|
@@ -1872,7 +1872,7 @@ function Tr(e, t, n, r, i, a, o) {
|
|
|
1872
1872
|
e.fillRect(n, r, i, a);
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1875
|
+
function Dr(e) {
|
|
1876
1876
|
switch (e) {
|
|
1877
1877
|
case "solid": return 1;
|
|
1878
1878
|
case "darkGray": return .75;
|
|
@@ -1895,7 +1895,7 @@ function Er(e) {
|
|
|
1895
1895
|
default: return 1;
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
|
-
var
|
|
1898
|
+
var Or = /* @__PURE__ */ new Map(), kr = {
|
|
1899
1899
|
gray0625: [
|
|
1900
1900
|
128,
|
|
1901
1901
|
0,
|
|
@@ -2057,15 +2057,15 @@ var Dr = /* @__PURE__ */ new Map(), Or = {
|
|
|
2057
2057
|
153
|
|
2058
2058
|
]
|
|
2059
2059
|
};
|
|
2060
|
-
function
|
|
2060
|
+
function Ar(e, t, n, r) {
|
|
2061
2061
|
let i = e.getTransform(), a = Math.max(1, Math.round(Math.hypot(i.a, i.b))), o = Math.max(1, Math.round(Math.hypot(i.c, i.d))), s = `${t}|${n}|${r}|${a}|${o}`;
|
|
2062
|
-
if (
|
|
2063
|
-
let c =
|
|
2064
|
-
if (!c) return
|
|
2062
|
+
if (Or.has(s)) return Or.get(s);
|
|
2063
|
+
let c = kr[t];
|
|
2064
|
+
if (!c) return Or.set(s, null), null;
|
|
2065
2065
|
let l = c.length, u = T(l, l);
|
|
2066
|
-
if (!u) return
|
|
2066
|
+
if (!u) return Or.set(s, null), null;
|
|
2067
2067
|
let d = u.getContext("2d");
|
|
2068
|
-
if (!d) return
|
|
2068
|
+
if (!d) return Or.set(s, null), null;
|
|
2069
2069
|
d.fillStyle = w(r), d.fillRect(0, 0, l, l), d.fillStyle = w(n);
|
|
2070
2070
|
for (let e = 0; e < l; e++) {
|
|
2071
2071
|
let t = c[e];
|
|
@@ -2076,23 +2076,23 @@ function kr(e, t, n, r) {
|
|
|
2076
2076
|
let e = new DOMMatrix();
|
|
2077
2077
|
e.scaleSelf(1 / a, 1 / o), f.setTransform(e);
|
|
2078
2078
|
}
|
|
2079
|
-
return
|
|
2079
|
+
return Or.set(s, f), f;
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2082
|
-
if (t.gradient && t.gradient.stops.length > 0) return e.fillStyle =
|
|
2081
|
+
function jr(e, t, n, r, i, a) {
|
|
2082
|
+
if (t.gradient && t.gradient.stops.length > 0) return e.fillStyle = Mr(e, t.gradient, n, r, i, a), e.fillRect(n, r, i, a), !0;
|
|
2083
2083
|
let o = t.patternType;
|
|
2084
2084
|
if (!o || o === "none") return !1;
|
|
2085
2085
|
let s = t.fgColor ?? "000000", c = t.bgColor ?? "FFFFFF";
|
|
2086
2086
|
if (o === "solid") return e.fillStyle = w(s), e.fillRect(n, r, i, a), !0;
|
|
2087
|
-
let l =
|
|
2087
|
+
let l = Ar(e, o, s, c);
|
|
2088
2088
|
if (l) e.fillStyle = l;
|
|
2089
2089
|
else {
|
|
2090
|
-
let t =
|
|
2091
|
-
e.fillStyle = t >= 1 ? w(s) :
|
|
2090
|
+
let t = Dr(o);
|
|
2091
|
+
e.fillStyle = t >= 1 ? w(s) : Fr(s, c, t);
|
|
2092
2092
|
}
|
|
2093
2093
|
return e.fillRect(n, r, i, a), !0;
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2095
|
+
function Mr(e, t, n, r, i, a) {
|
|
2096
2096
|
let o;
|
|
2097
2097
|
if (t.gradientType === "path") {
|
|
2098
2098
|
let s = n + i * (t.left + (1 - t.right - t.left) / 2), c = r + a * (t.top + (1 - t.bottom - t.top) / 2), l = Math.hypot(Math.max(s - n, n + i - s), Math.max(c - r, r + a - c));
|
|
@@ -2107,21 +2107,21 @@ function jr(e, t, n, r, i, a) {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
return o;
|
|
2109
2109
|
}
|
|
2110
|
-
var
|
|
2111
|
-
function
|
|
2110
|
+
var Nr = cr;
|
|
2111
|
+
function Pr(e, t, n, r, i) {
|
|
2112
2112
|
let a = Math.max(4, Math.min(8, Math.min(r, i) * .18));
|
|
2113
2113
|
e.save(), e.fillStyle = "#D40000", e.beginPath(), e.moveTo(t + r - a, n), e.lineTo(t + r, n), e.lineTo(t + r, n + a), e.closePath(), e.fill(), e.restore();
|
|
2114
2114
|
}
|
|
2115
|
-
function
|
|
2115
|
+
function Fr(e, t, n) {
|
|
2116
2116
|
let r = e.replace("#", ""), i = t.replace("#", ""), a = parseInt(r.slice(0, 2), 16), o = parseInt(r.slice(2, 4), 16), s = parseInt(r.slice(4, 6), 16), c = parseInt(i.slice(0, 2), 16), l = parseInt(i.slice(2, 4), 16), u = parseInt(i.slice(4, 6), 16), d = Math.min(1, Math.max(0, n));
|
|
2117
2117
|
return `rgb(${Math.round(a * d + c * (1 - d))},${Math.round(o * d + l * (1 - d))},${Math.round(s * d + u * (1 - d))})`;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function $(e, t, n = 1, r) {
|
|
2120
2120
|
let i = Math.round(e * Re * n * t);
|
|
2121
2121
|
return r ? Math.max(i, Math.round(V(r, e * Re * t))) : i;
|
|
2122
2122
|
}
|
|
2123
2123
|
function Ir(e, t = 1) {
|
|
2124
|
-
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * Re * t))}px ${
|
|
2124
|
+
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * Re * t))}px ${yr(e.name)}`;
|
|
2125
2125
|
}
|
|
2126
2126
|
function Lr(e, t, n, r, i, a, o, s, c, l) {
|
|
2127
2127
|
if (t.length === 0) return;
|
|
@@ -2198,7 +2198,7 @@ function Vr(e, t) {
|
|
|
2198
2198
|
italic: !1,
|
|
2199
2199
|
underline: !1,
|
|
2200
2200
|
strike: !1,
|
|
2201
|
-
size:
|
|
2201
|
+
size: br,
|
|
2202
2202
|
color: null,
|
|
2203
2203
|
name: null
|
|
2204
2204
|
},
|
|
@@ -2303,7 +2303,7 @@ function qr(e, t, n, r, i) {
|
|
|
2303
2303
|
if (o.length === 0) {
|
|
2304
2304
|
a.push({
|
|
2305
2305
|
segments: [],
|
|
2306
|
-
maxFontSize: u ||
|
|
2306
|
+
maxFontSize: u || br,
|
|
2307
2307
|
maxFontFamily: d,
|
|
2308
2308
|
para: f
|
|
2309
2309
|
});
|
|
@@ -2419,7 +2419,7 @@ function Xr(e) {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
function Zr(e, t, n, r, i, a, o, s) {
|
|
2421
2421
|
e.textAlign = "left", e.textBaseline = i;
|
|
2422
|
-
let c = s.needBidi ?
|
|
2422
|
+
let c = s.needBidi ? er(t, s.baseRtl ?? !1) : null, l = e, u = n;
|
|
2423
2423
|
for (let n = 0; n < t.length; n++) {
|
|
2424
2424
|
let d = c ? c.order[n] : n;
|
|
2425
2425
|
if (c) try {
|
|
@@ -2429,9 +2429,9 @@ function Zr(e, t, n, r, i, a, o, s) {
|
|
|
2429
2429
|
e.font = Ir(p, a);
|
|
2430
2430
|
let m = s.fontColor ?? f.font.color;
|
|
2431
2431
|
e.fillStyle = m ? w(m) : "#000000";
|
|
2432
|
-
let h =
|
|
2432
|
+
let h = $(f.font.size, a), g = 0;
|
|
2433
2433
|
f.font.vertAlign === "superscript" ? g = -Math.round(h * .35) : f.font.vertAlign === "subscript" && (g = Math.round(h * .1)), e.fillText(f.text, u, r + g);
|
|
2434
|
-
let _ =
|
|
2434
|
+
let _ = $(p.size, a);
|
|
2435
2435
|
if (f.font.underline || f.font.strike) {
|
|
2436
2436
|
let t = Jr(i, r, _);
|
|
2437
2437
|
if (f.font.underline) {
|
|
@@ -2452,7 +2452,7 @@ function Zr(e, t, n, r, i, a, o, s) {
|
|
|
2452
2452
|
function Qr(e, t, n, r, i, a, o, s) {
|
|
2453
2453
|
let { alignH: c, cx: l, cellW: u, leftPad: d, paddingX: f } = n, p = t.reduce((e, t) => e + t.width, 0), m;
|
|
2454
2454
|
m = c === "right" ? l + u - f - p : c === "center" ? l + u / 2 - p / 2 : l + d;
|
|
2455
|
-
let { needBidi: h, baseRtl: g } =
|
|
2455
|
+
let { needBidi: h, baseRtl: g } = $n(a.readingOrder, t.map((e) => e.text).join(""));
|
|
2456
2456
|
Zr(e, t, m, o, s, r, i, {
|
|
2457
2457
|
fontColor: a.fontColor,
|
|
2458
2458
|
needBidi: h,
|
|
@@ -2474,34 +2474,9 @@ function ei(e, t, n, r, i, a, o = {}) {
|
|
|
2474
2474
|
$r(e, t, n, r, i, a, o, c, s);
|
|
2475
2475
|
}
|
|
2476
2476
|
function ti(e, t, n, r, i, a, o = {}) {
|
|
2477
|
-
let { alignV: s, cy: c, cellH: l, paddingY: u } = r, d =
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
for (let n = 0; n < t.length; n++) n > 0 && d.push([]), t[n] !== "" && d[d.length - 1].push({
|
|
2481
|
-
...e,
|
|
2482
|
-
text: t[n]
|
|
2483
|
-
});
|
|
2484
|
-
}
|
|
2485
|
-
let f = n.size, p = n.name, m = d.map((e) => {
|
|
2486
|
-
if (e.length === 0) return {
|
|
2487
|
-
pt: f || yr,
|
|
2488
|
-
family: p
|
|
2489
|
-
};
|
|
2490
|
-
let t = 0, r = null;
|
|
2491
|
-
for (let i of e) {
|
|
2492
|
-
let e = Br(n, i);
|
|
2493
|
-
e.size > t && (t = e.size, r = e.name), f = e.size, p = e.name;
|
|
2494
|
-
}
|
|
2495
|
-
return {
|
|
2496
|
-
pt: t,
|
|
2497
|
-
family: r
|
|
2498
|
-
};
|
|
2499
|
-
}).map((e) => Fr(e.pt, i, 1.2, e.family ?? void 0)), h = m.reduce((e, t) => e + t, 0), g;
|
|
2500
|
-
g = s === "top" ? c + u : s === "center" ? c + (l - h) / 2 : c + l - h - u;
|
|
2501
|
-
for (let t = 0; t < d.length; t++) {
|
|
2502
|
-
let s = d[t];
|
|
2503
|
-
s.length > 0 && $r(e, s, n, r, i, a, o, g, "top"), g += m[t];
|
|
2504
|
-
}
|
|
2477
|
+
let { alignV: s, cy: c, cellH: l, paddingY: u } = r, d = xi(t, n, i), f = d.reduce((e, t) => e + t.heightPx, 0), p;
|
|
2478
|
+
p = s === "top" ? c + u : s === "center" ? c + (l - f) / 2 : c + l - f - u;
|
|
2479
|
+
for (let t of d) t.runs.length > 0 && $r(e, t.runs, n, r, i, a, o, p, "top"), p += t.heightPx;
|
|
2505
2480
|
}
|
|
2506
2481
|
function ni(e, t, n, r, i, a, o = {}) {
|
|
2507
2482
|
t.some((e) => e.text.includes("\n")) ? ti(e, t, n, r, i, a, o) : ei(e, t, n, r, i, a, o);
|
|
@@ -2513,7 +2488,7 @@ function ri(e, t, n, r, i, a) {
|
|
|
2513
2488
|
e.textBaseline = t, e.fillText(f[0], n, r);
|
|
2514
2489
|
return;
|
|
2515
2490
|
}
|
|
2516
|
-
let p =
|
|
2491
|
+
let p = $(r.size, a, 1.2, r.name ?? void 0), m = f.length * p, h;
|
|
2517
2492
|
h = o === "top" ? s + d : o === "center" ? s + (c - m) / 2 : s + c - m - d, e.textBaseline = "top";
|
|
2518
2493
|
for (let t = 0; t < f.length; t++) e.fillText(f[t], n, h + t * p);
|
|
2519
2494
|
}
|
|
@@ -2524,9 +2499,9 @@ function ii(e, t, n, r, i, a, o = {}) {
|
|
|
2524
2499
|
Qr(e, g[0].segments, r, i, a, o, n, t);
|
|
2525
2500
|
return;
|
|
2526
2501
|
}
|
|
2527
|
-
let _ = g.reduce((e, t) => e +
|
|
2502
|
+
let _ = g.reduce((e, t) => e + $(t.maxFontSize, i, 1.2, t.maxFontFamily ?? void 0), 0), v;
|
|
2528
2503
|
v = c === "top" ? u + h : c === "center" ? u + (f - _) / 2 : u + f - _ - h;
|
|
2529
|
-
let y = t.map((e) => e.text).join("").split("\n").map((e) =>
|
|
2504
|
+
let y = t.map((e) => e.text).join("").split("\n").map((e) => $n(o.readingOrder, e));
|
|
2530
2505
|
for (let t of g) {
|
|
2531
2506
|
let n = t.segments.reduce((e, t) => e + t.width, 0), r;
|
|
2532
2507
|
r = s === "right" ? l + d - m - n : s === "center" ? l + d / 2 - n / 2 : l + p;
|
|
@@ -2535,7 +2510,7 @@ function ii(e, t, n, r, i, a, o = {}) {
|
|
|
2535
2510
|
fontColor: o.fontColor,
|
|
2536
2511
|
needBidi: c,
|
|
2537
2512
|
baseRtl: u
|
|
2538
|
-
}), v +=
|
|
2513
|
+
}), v += $(t.maxFontSize, i, 1.2, t.maxFontFamily ?? void 0);
|
|
2539
2514
|
}
|
|
2540
2515
|
}
|
|
2541
2516
|
function ai(e) {
|
|
@@ -2582,11 +2557,11 @@ function di(e) {
|
|
|
2582
2557
|
for (let r of e.tables ?? []) {
|
|
2583
2558
|
if (!r.styleName) continue;
|
|
2584
2559
|
let { top: e, bottom: i, left: a, right: o } = r.range;
|
|
2585
|
-
|
|
2560
|
+
Nn(r.range, n);
|
|
2586
2561
|
let s = r.accentColor || "#808080", c = !!r.isCustom, l = Math.max(0, r.headerRowCount ?? 1), u = Math.max(0, r.totalsRowCount ?? 0), d = e + l - 1, f = i - u + 1;
|
|
2587
2562
|
for (let p = e; p <= i; p++) {
|
|
2588
2563
|
let m = l > 0 && p <= d, h = u > 0 && p >= f, g = !m && !h ? p - d - 1 : -1, _ = r.showRowStripes && g >= 0 ? g % 2 == 1 ? r.band1HorizontalDxf : r.band2HorizontalDxf : void 0;
|
|
2589
|
-
for (let l = a; l <= o; l++)
|
|
2564
|
+
for (let l = a; l <= o; l++) Pn(t, `${p}:${l}`, {
|
|
2590
2565
|
accent: s,
|
|
2591
2566
|
isCustom: c,
|
|
2592
2567
|
isHeader: m,
|
|
@@ -2638,7 +2613,7 @@ function pi(e) {
|
|
|
2638
2613
|
}
|
|
2639
2614
|
for (let a of r.sparklines) {
|
|
2640
2615
|
let o = a.values.filter((e) => typeof e == "number"), s = o.length ? Math.min(...o) : 0, c = o.length ? Math.max(...o) : 1, l = r.minAxisType === "custom" && typeof r.manualMin == "number" ? r.manualMin : r.minAxisType === "group" ? e : s, u = r.maxAxisType === "custom" && typeof r.manualMax == "number" ? r.manualMax : r.maxAxisType === "group" ? i : c;
|
|
2641
|
-
|
|
2616
|
+
Pn(t, `${a.row}:${a.col}`, {
|
|
2642
2617
|
kind: r.kind,
|
|
2643
2618
|
values: a.values,
|
|
2644
2619
|
min: l,
|
|
@@ -2673,7 +2648,7 @@ function mi(e) {
|
|
|
2673
2648
|
}
|
|
2674
2649
|
function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
2675
2650
|
if (m <= 0 || h <= 0) return;
|
|
2676
|
-
let { styles: g, cellMap: _, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C = i.length, T = a.length, E = new Set(s), D = new Set(o), O = (e, n) => t.rtl ?
|
|
2651
|
+
let { styles: g, cellMap: _, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C = i.length, T = a.length, E = new Set(s), D = new Set(o), O = (e, n) => t.rtl ? xr(e, n, t.canvasW) : e, k = [], A = -c;
|
|
2677
2652
|
for (let e = 0; e < C; e++) k.push(A), A += i[e];
|
|
2678
2653
|
let j = [], M = -l;
|
|
2679
2654
|
for (let e = 0; e < T; e++) j.push(M), M += a[e];
|
|
@@ -2686,14 +2661,14 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2686
2661
|
if (!p) continue;
|
|
2687
2662
|
let m = u - c + t.colAxis.offsetOf(f) - t.colAxis.offsetOf(r), h = d - l + t.rowAxis.offsetOf(a) - t.rowAxis.offsetOf(n), _ = p.totalW, v = p.totalH;
|
|
2688
2663
|
m = O(m, _);
|
|
2689
|
-
let y = `${a}:${f}`, C = t.cellMap.get(y), { font: T, fill: k, border: A, xf: j } = Vr(g, C?.styleIndex ?? 0), M =
|
|
2690
|
-
if (
|
|
2664
|
+
let y = `${a}:${f}`, C = t.cellMap.get(y), { font: T, fill: k, border: A, xf: j } = Vr(g, C?.styleIndex ?? 0), M = Xn(C, a, f, b, g.dxfs ?? []);
|
|
2665
|
+
if (jr(e, M.fill ?? k, m, h, _, v), M.dataBar && M.dataBar.ratio > 0) {
|
|
2691
2666
|
let t = Math.max(0, (_ - 4) * M.dataBar.ratio);
|
|
2692
|
-
|
|
2667
|
+
Er(e, M.dataBar.color, m + 2, h + 2, t, v - 4, M.dataBar.gradient);
|
|
2693
2668
|
}
|
|
2694
|
-
let ee =
|
|
2695
|
-
if (te.push(() =>
|
|
2696
|
-
let N =
|
|
2669
|
+
let ee = ea($i(A, a, f, p.right, p.bottom, t.cellMap, g), M.border);
|
|
2670
|
+
if (te.push(() => na(e, ee, m, h, _, v, S)), !C) continue;
|
|
2671
|
+
let N = Qt(C, g, M.numFmt, t.worksheet.date1904), P = N.text;
|
|
2697
2672
|
if (!P || P === "0" && t.worksheet.showZeros === !1) continue;
|
|
2698
2673
|
let F = T.bold || !!M.fontBold, I = T.italic || !!M.fontItalic, L = T.underline || !!M.fontUnderline, R = T.strike || !!M.fontStrike, z = F !== T.bold || I !== T.italic || L !== T.underline || R !== T.strike ? {
|
|
2699
2674
|
...T,
|
|
@@ -2794,10 +2769,10 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2794
2769
|
if (y.has(A)) continue;
|
|
2795
2770
|
let j = v.get(A), M = j ? j.totalW : D, P = j ? j.totalH : l, F = d + M <= f || d >= f + m;
|
|
2796
2771
|
if (c + P <= p || c >= p + h || F && !t.overflowTextAnchors.has(A)) continue;
|
|
2797
|
-
let I = O(d, M), L = _.get(A), { font: R, fill: z, border: ne, xf: V } = Vr(g, L?.styleIndex ?? 0), H =
|
|
2798
|
-
if (
|
|
2772
|
+
let I = O(d, M), L = _.get(A), { font: R, fill: z, border: ne, xf: V } = Vr(g, L?.styleIndex ?? 0), H = Xn(L, r, s, b, g.dxfs ?? []), re = H.fill ?? z, U = t.tableStyleMap.get(A), ae = g.dxfs ?? [], oe = (e) => e == null ? void 0 : ae[e], se = oe(U?.wholeTableDxf), le = oe(U?.headerRowDxf), ue = oe(U?.totalRowDxf), de = oe(U?.firstColumnDxf), fe = oe(U?.lastColumnDxf), pe = oe(U?.stripeDxf), me = U?.isHeader && le?.fill?.fgColor ? le : U?.isTotals && ue?.fill?.fgColor ? ue : U?.isLastCol && fe?.fill?.fgColor ? fe : U?.isFirstCol && de?.fill?.fgColor ? de : pe?.fill?.fgColor ? pe : !U?.isHeader && !U?.isTotals && se?.fill?.fgColor ? se : void 0;
|
|
2773
|
+
if (jr(e, re, I, c, M, P) || (U && me?.fill?.fgColor ? (e.fillStyle = w(me.fill.fgColor), e.fillRect(I, c, M, P)) : U && !U.isCustom && U.isBanded && (e.fillStyle = mi(U.accent), e.fillRect(I, c, M, P))), t.commentCells.has(A) && Pr(e, I, c, M, P), H.dataBar && H.dataBar.ratio > 0) {
|
|
2799
2774
|
let t = Math.max(0, (M - 4) * H.dataBar.ratio);
|
|
2800
|
-
|
|
2775
|
+
Er(e, H.dataBar.color, I + 2, c + 2, t, P - 4, H.dataBar.gradient);
|
|
2801
2776
|
}
|
|
2802
2777
|
let he = t.sparklineMap.get(A);
|
|
2803
2778
|
if (he && nt(e, {
|
|
@@ -2821,7 +2796,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2821
2796
|
}
|
|
2822
2797
|
e.stroke();
|
|
2823
2798
|
}
|
|
2824
|
-
let W =
|
|
2799
|
+
let W = ea(j ? $i(ne, r, s, j.right, j.bottom, _, g) : ne, H.border);
|
|
2825
2800
|
(T.has(a) || E.has(a)) && (W = {
|
|
2826
2801
|
...W,
|
|
2827
2802
|
left: E.has(a) ? null : W.left,
|
|
@@ -2830,17 +2805,17 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2830
2805
|
let G = _.get(`${r - 1}:${s}`), K = G ? Vr(g, G.styleIndex ?? 0).border.bottom : null;
|
|
2831
2806
|
if (K?.style && (n === 0 || W.top?.style) && (W = {
|
|
2832
2807
|
...W,
|
|
2833
|
-
top:
|
|
2808
|
+
top: oa(W.top, K)
|
|
2834
2809
|
}), !E.has(a)) {
|
|
2835
2810
|
let e = _.get(`${r}:${s - 1}`), t = e ? Vr(g, e.styleIndex ?? 0).border.right : null;
|
|
2836
2811
|
t?.style && (a === 0 || W.left?.style) && (W = {
|
|
2837
2812
|
...W,
|
|
2838
|
-
left:
|
|
2813
|
+
left: oa(W.left, t)
|
|
2839
2814
|
});
|
|
2840
2815
|
}
|
|
2841
2816
|
let ge = U ? fi(U, se, le, s) : null, _e = t.autoFilterCells.has(A), ve = () => {
|
|
2842
2817
|
if (ge) {
|
|
2843
|
-
if (ge.kind === "dxf")
|
|
2818
|
+
if (ge.kind === "dxf") na(e, ge.border, I, c, M, P, S);
|
|
2844
2819
|
else if (ge.kind === "accent") {
|
|
2845
2820
|
let t = .5 / S;
|
|
2846
2821
|
if (e.strokeStyle = ge.color, e.lineWidth = ge.lineWidth, e.beginPath(), e.moveTo(I, c + P - t), e.lineTo(I + M, c + P - t), ge.topEdge) {
|
|
@@ -2854,15 +2829,15 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2854
2829
|
};
|
|
2855
2830
|
if (j) {
|
|
2856
2831
|
let t = W;
|
|
2857
|
-
te.push(() =>
|
|
2832
|
+
te.push(() => na(e, t, I, c, M, P, S)), ve();
|
|
2858
2833
|
} else {
|
|
2859
2834
|
let t = W;
|
|
2860
2835
|
N.push(() => {
|
|
2861
|
-
|
|
2836
|
+
na(e, t, I, c, M, P, S), ve();
|
|
2862
2837
|
});
|
|
2863
2838
|
}
|
|
2864
2839
|
if (!L) continue;
|
|
2865
|
-
let ye =
|
|
2840
|
+
let ye = Qt(L, g, H.numFmt, t.worksheet.date1904), q = ye.text;
|
|
2866
2841
|
!q || q === "0" && t.worksheet.showZeros === !1 || ee.push(() => {
|
|
2867
2842
|
let n = U?.isHeader ? le : U?.isTotals ? ue : U?.isLastCol && fe ? fe : U?.isFirstCol && de ? de : pe || (U ? se : void 0), l = U ? U.isCustom ? !!n?.font?.bold : U.isHeader || U.isTotals : !1, u = R.bold || !!H.fontBold || l, d = R.italic || !!H.fontItalic, f = R.underline || !!H.fontUnderline, p = R.strike || !!H.fontStrike, m = u !== R.bold || d !== R.italic || f !== R.underline || p !== R.strike ? {
|
|
2868
2843
|
...R,
|
|
@@ -2927,11 +2902,11 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2927
2902
|
D === "right" ? (W = I + M - 3, G = "right") : D === "center" ? (W = I + M / 2, G = "center") : D === "centerContinuous" ? (W = ne + F / 2, G = "center") : D === "distributed" || D === "justify" && !V.wrapText && !oe ? (W = I + 3, G = "left") : (W = I + N, G = "left");
|
|
2928
2903
|
let K = V.textRotation ?? 0, ge = K === 255, _e = K > 0 && K !== 255;
|
|
2929
2904
|
if (H.iconSet && ee > 0 && (e.save(), e.beginPath(), e.rect(I, c, M, P), e.clip(), li(e, H.iconSet.name, H.iconSet.index, I + 2, c + (P - ee) / 2, ee), e.restore()), e.save(), e.beginPath(), e.rect(re, c, ae, P), e.clip(), ge) {
|
|
2930
|
-
let t =
|
|
2905
|
+
let t = $(R.size, x, 1.1), n = [...q].length * t, r = O === "top" ? c + 2 : O === "center" ? c + (P - n) / 2 : c + P - n - 2;
|
|
2931
2906
|
e.textAlign = "center", e.textBaseline = "top";
|
|
2932
2907
|
for (let n of q) {
|
|
2933
2908
|
let i = n.codePointAt(0) ?? 0, a = ie(i) && ce(e, i);
|
|
2934
|
-
|
|
2909
|
+
ur(e, n, I + M / 2, r, t, a), r += t;
|
|
2935
2910
|
}
|
|
2936
2911
|
e.restore();
|
|
2937
2912
|
return;
|
|
@@ -2952,7 +2927,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2952
2927
|
e.letterSpacing = `${he}px`;
|
|
2953
2928
|
} catch {}
|
|
2954
2929
|
try {
|
|
2955
|
-
e.direction =
|
|
2930
|
+
e.direction = Zn(V.readingOrder, q) ? "rtl" : "ltr";
|
|
2956
2931
|
} catch {}
|
|
2957
2932
|
let ve = L.value.type === "text" ? L.value.runs : void 0, be = ve && ve.length > 0;
|
|
2958
2933
|
if (V.wrapText && be) ii(e, ve, m, {
|
|
@@ -2995,7 +2970,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2995
2970
|
readingOrder: V.readingOrder
|
|
2996
2971
|
});
|
|
2997
2972
|
else {
|
|
2998
|
-
let t = m.vertAlign, n =
|
|
2973
|
+
let t = m.vertAlign, n = $(R.size, x), r = 0;
|
|
2999
2974
|
t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
|
|
3000
2975
|
let i = t ? {
|
|
3001
2976
|
...m,
|
|
@@ -3008,7 +2983,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
3008
2983
|
x: D === "right" ? I + M - 3 - e : D === "center" ? I + M / 2 - e / 2 : I + N,
|
|
3009
2984
|
width: e
|
|
3010
2985
|
};
|
|
3011
|
-
}, l =
|
|
2986
|
+
}, l = $(i.size, x);
|
|
3012
2987
|
if (m.underline || h) {
|
|
3013
2988
|
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + l + 1 : O === "center" ? c + P / 2 + Math.round(l * .55) : c + P - 2 + 1) + r, a = h ? "#0563C1" : T ? w(T) : "#000000", o = m.underlineStyle === "double" || m.underlineStyle === "doubleAccounting";
|
|
3014
2989
|
zr(e, t, t + n, i, a, o, S);
|
|
@@ -3018,7 +2993,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
3018
2993
|
e.save(), e.strokeStyle = T ? w(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
|
|
3019
2994
|
}
|
|
3020
2995
|
if (q.includes("\n")) {
|
|
3021
|
-
let t = q.split("\n"), n =
|
|
2996
|
+
let t = q.split("\n"), n = $(R.size, x, 1.2, R.name ?? void 0), i = t.length * n, a;
|
|
3022
2997
|
O === "top" ? (a = c + 2, e.textBaseline = "top") : O === "center" ? (a = c + (P - i) / 2, e.textBaseline = "top") : (a = c + P - i - 2, e.textBaseline = "top");
|
|
3023
2998
|
for (let i = 0; i < t.length; i++) e.fillText(t[i], W, a + i * n + r);
|
|
3024
2999
|
} else {
|
|
@@ -3045,7 +3020,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
3045
3020
|
}
|
|
3046
3021
|
e.restore(), q && t.onTextRun && t.onTextRun({
|
|
3047
3022
|
sheetName: t.worksheet.name,
|
|
3048
|
-
cellRef:
|
|
3023
|
+
cellRef: lr(r, s),
|
|
3049
3024
|
text: q,
|
|
3050
3025
|
x: I,
|
|
3051
3026
|
y: c,
|
|
@@ -3072,48 +3047,172 @@ function _i(e, t) {
|
|
|
3072
3047
|
function vi(e) {
|
|
3073
3048
|
let t = gi.get(e);
|
|
3074
3049
|
if (t) return t;
|
|
3075
|
-
let n = _i("worksheet-cell-index", "index-worksheet-cells"), r =
|
|
3050
|
+
let n = _i("worksheet-cell-index", "index-worksheet-cells"), r = Fn(e.rows, n), i = /* @__PURE__ */ new Map();
|
|
3076
3051
|
for (let t of e.rows) {
|
|
3077
3052
|
let e = t.cells.filter((e) => e.value.type !== "empty").map((e) => e.col).sort((e, t) => e - t);
|
|
3078
3053
|
e.length > 0 && i.set(t.index, e);
|
|
3079
3054
|
}
|
|
3080
|
-
let a = /* @__PURE__ */ new Set(), o = _i("worksheet-merge-skip-index", "expand-merged-cell-coordinates");
|
|
3055
|
+
let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = _i("worksheet-merge-anchor-index", "index-merge-anchor-coordinates"), c = _i("worksheet-merge-skip-index", "expand-merged-cell-coordinates");
|
|
3081
3056
|
for (let t of e.mergeCells ?? []) {
|
|
3082
|
-
|
|
3083
|
-
for (let e = t.top; e <= t.bottom; e++) for (let n = t.left; n <= t.right; n++) e === t.top && n === t.left ||
|
|
3057
|
+
In(o, `${t.top}:${t.left}`, s), Nn(t, c, 1);
|
|
3058
|
+
for (let e = t.top; e <= t.bottom; e++) for (let n = t.left; n <= t.right; n++) e === t.top && n === t.left || In(a, `${e}:${n}`, c);
|
|
3084
3059
|
}
|
|
3085
|
-
let
|
|
3060
|
+
let l = /* @__PURE__ */ new Set();
|
|
3086
3061
|
if (e.autoFilter) {
|
|
3087
3062
|
let t = e.autoFilter, n = _i("worksheet-auto-filter-index", "expand-auto-filter-coordinates");
|
|
3088
|
-
|
|
3063
|
+
Nn({
|
|
3089
3064
|
top: t.top,
|
|
3090
3065
|
bottom: t.top,
|
|
3091
3066
|
left: t.left,
|
|
3092
3067
|
right: t.right
|
|
3093
3068
|
}, n);
|
|
3094
|
-
for (let e = t.left; e <= t.right; e++)
|
|
3069
|
+
for (let e = t.left; e <= t.right; e++) In(l, `${t.top}:${e}`, n);
|
|
3095
3070
|
}
|
|
3096
|
-
let
|
|
3097
|
-
for (let t of e.hyperlinks ?? []) t.url &&
|
|
3098
|
-
let
|
|
3071
|
+
let u = /* @__PURE__ */ new Map(), d = _i("worksheet-hyperlink-index", "index-hyperlink-coordinates");
|
|
3072
|
+
for (let t of e.hyperlinks ?? []) t.url && Pn(u, `${t.row}:${t.col}`, t.url, d);
|
|
3073
|
+
let f = /* @__PURE__ */ new Set(), p = _i("worksheet-comment-index", "index-comment-coordinates");
|
|
3099
3074
|
for (let t of e.commentRefs ?? []) {
|
|
3100
|
-
let e =
|
|
3101
|
-
e &&
|
|
3075
|
+
let e = Nr(t);
|
|
3076
|
+
e && In(f, `${e.row}:${e.col}`, p);
|
|
3102
3077
|
}
|
|
3103
|
-
let
|
|
3078
|
+
let m = {
|
|
3104
3079
|
cellMap: r,
|
|
3105
3080
|
nonEmptyColsByRow: i,
|
|
3106
|
-
cfContext:
|
|
3081
|
+
cfContext: Hn(e, r),
|
|
3082
|
+
mergeAnchorSet: o,
|
|
3107
3083
|
mergeSkipSet: a,
|
|
3108
|
-
autoFilterCells:
|
|
3109
|
-
hyperlinkMap:
|
|
3110
|
-
commentCells:
|
|
3084
|
+
autoFilterCells: l,
|
|
3085
|
+
hyperlinkMap: u,
|
|
3086
|
+
commentCells: f,
|
|
3111
3087
|
tableStyleMap: di(e),
|
|
3112
3088
|
sparklineMap: pi(e)
|
|
3113
3089
|
};
|
|
3114
|
-
return gi.set(e,
|
|
3090
|
+
return gi.set(e, m), m;
|
|
3091
|
+
}
|
|
3092
|
+
var yi = /* @__PURE__ */ new WeakMap();
|
|
3093
|
+
function bi(e, t, n, r) {
|
|
3094
|
+
let i = r.dxfs ?? [], a = n ? n.isHeader ? i[n.headerRowDxf ?? -1] : n.isTotals ? i[n.totalRowDxf ?? -1] : n.isLastCol && n.lastColumnDxf != null ? i[n.lastColumnDxf] : n.isFirstCol && n.firstColumnDxf != null ? i[n.firstColumnDxf] : n.stripeDxf == null ? i[n.wholeTableDxf ?? -1] : i[n.stripeDxf] : void 0, o = n ? n.isCustom ? !!a?.font?.bold : n.isHeader || n.isTotals : !1, s = e.bold || !!t.fontBold || o, c = e.italic || !!t.fontItalic;
|
|
3095
|
+
return s === e.bold && c === e.italic ? e : {
|
|
3096
|
+
...e,
|
|
3097
|
+
bold: s,
|
|
3098
|
+
italic: c
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
function xi(e, t, n) {
|
|
3102
|
+
let r = [[]];
|
|
3103
|
+
for (let t of e) {
|
|
3104
|
+
let e = t.text.split("\n");
|
|
3105
|
+
for (let n = 0; n < e.length; n++) n > 0 && r.push([]), e[n] !== "" && r[r.length - 1].push({
|
|
3106
|
+
...t,
|
|
3107
|
+
text: e[n]
|
|
3108
|
+
});
|
|
3109
|
+
}
|
|
3110
|
+
let i = t.size, a = t.name;
|
|
3111
|
+
return r.map((e) => {
|
|
3112
|
+
if (e.length === 0) return {
|
|
3113
|
+
runs: e,
|
|
3114
|
+
heightPx: $(i || br, n, 1.2, a ?? void 0)
|
|
3115
|
+
};
|
|
3116
|
+
let r = 0, o = null;
|
|
3117
|
+
for (let n of e) {
|
|
3118
|
+
let e = Br(t, n);
|
|
3119
|
+
e.size > r && (r = e.size, o = e.name), i = e.size, a = e.name;
|
|
3120
|
+
}
|
|
3121
|
+
return {
|
|
3122
|
+
runs: e,
|
|
3123
|
+
heightPx: $(r, n, 1.2, o ?? void 0)
|
|
3124
|
+
};
|
|
3125
|
+
});
|
|
3126
|
+
}
|
|
3127
|
+
function Si(e, t, n, r, i, a, o, s, c) {
|
|
3128
|
+
let l = i.alignH ?? (t.value.type === "number" ? "right" : "left"), u = i.indent ? Math.round(i.indent * 3 * o) : 0, d = s ? Math.max(8, Math.round(Math.min(a, c) * .55)) : 0, f = d > 0 ? d + 4 : 0, p = 3 + (l === "left" || !i.alignH ? u : 0) + f, m = Math.max(1, a - p - 3), h = t.value.type === "text" ? t.value.runs : void 0, g = !!h?.length, _ = i.textRotation ?? 0;
|
|
3129
|
+
if (e.font = Ir(r, 1), _ === 255) return [...n].length * $(r.size, 1, 1.1) + 4;
|
|
3130
|
+
if (_ > 0) {
|
|
3131
|
+
let t = _ <= 90 ? _ * Math.PI / 180 : (_ - 90) * Math.PI / 180, i = $(r.size, 1, 1.2, r.name ?? void 0), a = e.measureText(n.replace(/\n/g, " ")).width;
|
|
3132
|
+
return Math.abs(Math.sin(t)) * a + Math.abs(Math.cos(t)) * i + 4;
|
|
3133
|
+
}
|
|
3134
|
+
let v;
|
|
3135
|
+
if (i.wrapText && g) v = qr(e, h, r, 1, m).map((e) => $(e.maxFontSize, 1, 1.2, e.maxFontFamily ?? void 0));
|
|
3136
|
+
else if (i.wrapText) {
|
|
3137
|
+
e.font = Ir(r, 1);
|
|
3138
|
+
let t = $(r.size, 1, 1.2, r.name ?? void 0);
|
|
3139
|
+
v = Hr(e, n, m).map(() => t);
|
|
3140
|
+
} else if (g) v = xi(h, r, 1).map((e) => e.heightPx);
|
|
3141
|
+
else {
|
|
3142
|
+
let e = Math.max(1, n.split("\n").length), t = $(r.size, 1, 1.2, r.name ?? void 0);
|
|
3143
|
+
v = Array.from({ length: e }, () => t);
|
|
3144
|
+
}
|
|
3145
|
+
return v.reduce((e, t) => e + t, 0) + (v.length > 1 ? 4 : 2);
|
|
3146
|
+
}
|
|
3147
|
+
function Ci(e, t, n, r) {
|
|
3148
|
+
if (n.wrapText || (n.textRotation ?? 0) > 0) return !0;
|
|
3149
|
+
if (e.value.type === "text") {
|
|
3150
|
+
if (e.value.text.includes("\n")) return !0;
|
|
3151
|
+
for (let n of e.value.runs ?? []) {
|
|
3152
|
+
let e = Br(t, n);
|
|
3153
|
+
if ($(e.size, 1, 1.2, e.name ?? void 0) > r) return !0;
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
return $(t.size, 1, 1.2, t.name ?? void 0) > r;
|
|
3157
|
+
}
|
|
3158
|
+
function wi(e, t, n) {
|
|
3159
|
+
if (yi.has(t) || t.isChartSheet) return !1;
|
|
3160
|
+
if (t.defaultRowHeightCustom === !0) return yi.set(t, { derived: /* @__PURE__ */ new Map() }), !1;
|
|
3161
|
+
let r = Q(t), i = rr(t.defaultRowHeight), a = $(t.defaultFontSize ?? br, 1, 1.2, t.defaultFontFamily), { cfContext: o, mergeAnchorSet: s, mergeSkipSet: c, tableStyleMap: l } = vi(t), u = /* @__PURE__ */ new Map(), d = !1;
|
|
3162
|
+
e.save();
|
|
3163
|
+
try {
|
|
3164
|
+
for (let f of t.rows) {
|
|
3165
|
+
if (f.hidden || f.customHeight === !0 || f.height !== null || Object.hasOwn(t.rowHeights, f.index)) continue;
|
|
3166
|
+
let p = i, m = [];
|
|
3167
|
+
for (let i of f.cells) {
|
|
3168
|
+
let u = `${f.index}:${i.col}`;
|
|
3169
|
+
if (i.value.type === "empty" || s.has(u) || c.has(u)) continue;
|
|
3170
|
+
let { font: d, xf: h } = Vr(n, i.styleIndex ?? 0);
|
|
3171
|
+
if (!Ci(i, d, h, a)) continue;
|
|
3172
|
+
let g = Xn(i, f.index, i.col, o, n.dxfs ?? []), _ = bi(d, g, l.get(u), n), v = Qt(i, n, g.numFmt, t.date1904).text;
|
|
3173
|
+
if (!v || v === "0" && t.showZeros === !1) continue;
|
|
3174
|
+
let y = r.col.sizeOf(i.col);
|
|
3175
|
+
p = Math.max(p, Si(e, i, v, _, h, y, r.maximumDigitWidth, g.iconSet, Math.ceil(p))), g.iconSet && m.push({
|
|
3176
|
+
cell: i,
|
|
3177
|
+
text: v,
|
|
3178
|
+
font: _,
|
|
3179
|
+
xf: h,
|
|
3180
|
+
cellWidthPx: y,
|
|
3181
|
+
iconSet: g.iconSet
|
|
3182
|
+
});
|
|
3183
|
+
}
|
|
3184
|
+
let h = m.length === 0;
|
|
3185
|
+
for (let t = 0; !h && t < 32; t++) {
|
|
3186
|
+
let t = Math.ceil(p), n = p;
|
|
3187
|
+
for (let i of m) n = Math.max(n, Si(e, i.cell, i.text, i.font, i.xf, i.cellWidthPx, r.maximumDigitWidth, i.iconSet, t));
|
|
3188
|
+
p = n, h = Math.ceil(p) === t;
|
|
3189
|
+
}
|
|
3190
|
+
if (!h) for (let t of m) p = Math.max(p, Si(e, t.cell, t.text, t.font, t.xf, t.cellWidthPx, r.maximumDigitWidth, t.iconSet, t.cellWidthPx));
|
|
3191
|
+
let g = Math.ceil(p);
|
|
3192
|
+
if (g > i) {
|
|
3193
|
+
let e = ir(g);
|
|
3194
|
+
t.rowHeights[f.index] = e, u.set(f.index, e), d = !0;
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
} finally {
|
|
3198
|
+
e.restore();
|
|
3199
|
+
}
|
|
3200
|
+
return yi.set(t, { derived: u }), d && sr.invalidate(t), d;
|
|
3115
3201
|
}
|
|
3116
|
-
function
|
|
3202
|
+
function Ti(e) {
|
|
3203
|
+
return yi.has(e);
|
|
3204
|
+
}
|
|
3205
|
+
function Ei(e) {
|
|
3206
|
+
return yi.get(e)?.derived ?? /* @__PURE__ */ new Map();
|
|
3207
|
+
}
|
|
3208
|
+
function Di(e, t = []) {
|
|
3209
|
+
let n = yi.get(e);
|
|
3210
|
+
if (!n) return;
|
|
3211
|
+
let r = new Set(t), i = !1;
|
|
3212
|
+
for (let [t, a] of n.derived) r.has(t) || e.rowHeights[t] === a && (delete e.rowHeights[t], i = !0);
|
|
3213
|
+
yi.delete(e), i && sr.invalidate(e);
|
|
3214
|
+
}
|
|
3215
|
+
function Oi(e, t) {
|
|
3117
3216
|
let n = 0, r = e.length;
|
|
3118
3217
|
for (; n < r;) {
|
|
3119
3218
|
let i = n + r >> 1;
|
|
@@ -3121,7 +3220,7 @@ function yi(e, t) {
|
|
|
3121
3220
|
}
|
|
3122
3221
|
return n > 0 ? e[n - 1] : void 0;
|
|
3123
3222
|
}
|
|
3124
|
-
function
|
|
3223
|
+
function ki(e, t) {
|
|
3125
3224
|
let n = 0, r = e.length;
|
|
3126
3225
|
for (; n < r;) {
|
|
3127
3226
|
let i = n + r >> 1;
|
|
@@ -3129,14 +3228,14 @@ function bi(e, t) {
|
|
|
3129
3228
|
}
|
|
3130
3229
|
return n < e.length ? e[n] : void 0;
|
|
3131
3230
|
}
|
|
3132
|
-
function
|
|
3231
|
+
function Ai(e, t, n, r) {
|
|
3133
3232
|
return (e.mergeCells ?? []).some((e) => t >= e.top && t <= e.bottom && e.right >= n && e.left <= r);
|
|
3134
3233
|
}
|
|
3135
|
-
function
|
|
3234
|
+
function ji(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
3136
3235
|
let _ = d, v = f, y = /* @__PURE__ */ new Set(), b = (i, u, d, f) => {
|
|
3137
3236
|
let p = `${i}:${u}`, _ = r.get(p);
|
|
3138
3237
|
if (!_ || _.value.type === "empty" || s.has(p)) return !1;
|
|
3139
|
-
let { font: v, xf: y } = Vr(n, _.styleIndex ?? 0), b =
|
|
3238
|
+
let { font: v, xf: y } = Vr(n, _.styleIndex ?? 0), b = Xn(_, i, u, a, n.dxfs ?? []), x = Qt(_, n, b.numFmt, t.date1904).text;
|
|
3140
3239
|
if (!x || x === "0" && t.showZeros === !1 || _.value.type === "number" || y.wrapText || y.textRotation || x.includes("\n")) return !1;
|
|
3141
3240
|
let S = o.get(p), C = S?.isHeader ? S.headerRowDxf : S?.isTotals ? S.totalRowDxf : S?.isLastCol && S.lastColumnDxf != null ? S.lastColumnDxf : S?.isFirstCol && S.firstColumnDxf != null ? S.firstColumnDxf : S?.stripeDxf ?? S?.wholeTableDxf, w = C == null ? void 0 : n.dxfs?.[C], T = !!S && !S.isCustom && (S.isHeader || S.isTotals), E = v.bold || !!b.fontBold || T || !!w?.font?.bold, D = v.italic || !!b.fontItalic;
|
|
3142
3241
|
e.font = Ir(E !== v.bold || D !== v.italic ? {
|
|
@@ -3150,10 +3249,10 @@ function Si(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
3150
3249
|
for (let e of u) {
|
|
3151
3250
|
let n = i.get(e);
|
|
3152
3251
|
if (!n) continue;
|
|
3153
|
-
let a =
|
|
3154
|
-
a != null && a >= p && (!o || o.value.type === "empty") && !
|
|
3155
|
-
let s =
|
|
3156
|
-
s != null && s <= 16384 && (!l || l.value.type === "empty") && !
|
|
3252
|
+
let a = Oi(n, d), o = r.get(`${e}:${d}`);
|
|
3253
|
+
a != null && a >= p && (!o || o.value.type === "empty") && !Ai(t, e, a + 1, d) && b(e, a, "higher", c.offsetOf(d) - c.offsetOf(a + 1)) && (_ = Math.min(_, a), y.add(`${e}:${a}`));
|
|
3254
|
+
let s = ki(n, f), l = r.get(`${e}:${f}`);
|
|
3255
|
+
s != null && s <= 16384 && (!l || l.value.type === "empty") && !Ai(t, e, f, s - 1) && b(e, s, "lower", c.offsetOf(s) - c.offsetOf(f + 1)) && (v = Math.max(v, s), y.add(`${e}:${s}`));
|
|
3157
3256
|
}
|
|
3158
3257
|
return {
|
|
3159
3258
|
startCol: _,
|
|
@@ -3161,23 +3260,23 @@ function Si(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
3161
3260
|
anchorKeys: y
|
|
3162
3261
|
};
|
|
3163
3262
|
}
|
|
3164
|
-
function
|
|
3263
|
+
function Mi(e, t) {
|
|
3165
3264
|
gi.set(t, vi(e));
|
|
3166
3265
|
}
|
|
3167
|
-
function
|
|
3168
|
-
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = t.isChartSheet === !0, c =
|
|
3266
|
+
function Ni(e, t, n, r, i = {}) {
|
|
3267
|
+
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = t.isChartSheet === !0, c = Q(t), l = c.maximumDigitWidth, u = e.canvas.width / a, d = e.canvas.height / a;
|
|
3169
3268
|
e.clearRect(0, 0, u, d), e.fillStyle = "#ffffff", e.fillRect(0, 0, u, d);
|
|
3170
3269
|
let f = (e) => Math.round(e * o), p = s ? 0 : f(50), m = s ? 0 : f(22), { row: h, col: g, rows: _, cols: v } = r, y = (i.scrollOffsetX ?? 0) * o, b = (i.scrollOffsetY ?? 0) * o, { col: x, row: S } = c.axesAtScale(o), C = x.bandsToCover(1, s ? 0 : i.freezeCols ?? 0, Math.max(0, u - p)), w = S.bandsToCover(1, s ? 0 : i.freezeRows ?? 0, Math.max(0, d - m)), T = w.at(-1)?.index ?? 0, E = C.at(-1)?.index ?? 0, D = C.map(({ index: e }) => e), O = w.map(({ index: e }) => e), k = C.map(({ size: e }) => e), A = w.map(({ size: e }) => e), j = k.reduce((e, t) => e + t, 0), M = A.reduce((e, t) => e + t, 0), ee = x.bandsToCover(g, Math.min(16384, g + v - 1)), te = S.bandsToCover(h, Math.min(1048576, h + _ - 1)), N = ee.map(({ index: e }) => e), P = te.map(({ index: e }) => e), F = ee.map(({ size: e }) => e), I = te.map(({ size: e }) => e), { cellMap: L, cfContext: R, mergeSkipSet: z, autoFilterCells: ne, hyperlinkMap: V, commentCells: H, tableStyleMap: re, sparklineMap: ie, nonEmptyColsByRow: U } = vi(t), ae = /* @__PURE__ */ new Map(), oe = _i("worksheet-merge-anchor-index", "index-merge-anchor-coordinates");
|
|
3171
3270
|
for (let e of t.mergeCells ?? []) {
|
|
3172
3271
|
let t = x.offsetOf(e.right + 1) - x.offsetOf(e.left), n = S.offsetOf(e.bottom + 1) - S.offsetOf(e.top);
|
|
3173
|
-
|
|
3272
|
+
Pn(ae, `${e.top}:${e.left}`, {
|
|
3174
3273
|
totalW: t,
|
|
3175
3274
|
totalH: n,
|
|
3176
3275
|
right: e.right,
|
|
3177
3276
|
bottom: e.bottom
|
|
3178
3277
|
}, oe);
|
|
3179
3278
|
}
|
|
3180
|
-
let se = N[0] ?? g, ce = N.at(-1) ?? Math.min(16384, g + v - 1), le =
|
|
3279
|
+
let se = N[0] ?? g, ce = N.at(-1) ?? Math.min(16384, g + v - 1), le = ji(e, t, n, L, U, R, re, ae, x, S, [...new Set([...O, ...P])], se, ce, E + 1, o, l, t.rightToLeft === !0), ue = x.bandsToCover(le.startCol, le.endCol), de = ue.map(({ index: e }) => e), fe = ue.map(({ size: e }) => e), pe = y + x.offsetOf(se) - x.offsetOf(le.startCol), me = {
|
|
3181
3280
|
worksheet: t,
|
|
3182
3281
|
styles: n,
|
|
3183
3282
|
cellMap: L,
|
|
@@ -3208,21 +3307,21 @@ function wi(e, t, n, r, i = {}) {
|
|
|
3208
3307
|
canvasW: u,
|
|
3209
3308
|
threeD: i.threeD
|
|
3210
3309
|
}, he = p, W = m, G = he + j, K = W + M, ge = Math.max(0, u - G), _e = Math.max(0, d - K);
|
|
3211
|
-
T > 0 && E > 0 && hi(e, me, 1, 1, k, A, D, O, 0, 0, he, W, he, W, j, M), T > 0 && hi(e, me, 1, le.startCol, fe, A, de, O, pe, 0, G, W, G, W, ge, M), E > 0 && hi(e, me, h, 1, k, I, D, P, 0, b, he, K, he, K, j, _e), s || hi(e, me, h, le.startCol, fe, I, de, P, pe, b, G, K, G, K, ge, _e),
|
|
3310
|
+
T > 0 && E > 0 && hi(e, me, 1, 1, k, A, D, O, 0, 0, he, W, he, W, j, M), T > 0 && hi(e, me, 1, le.startCol, fe, A, de, O, pe, 0, G, W, G, W, ge, M), E > 0 && hi(e, me, h, 1, k, I, D, P, 0, b, he, K, he, K, j, _e), s || hi(e, me, h, le.startCol, fe, I, de, P, pe, b, G, K, G, K, ge, _e), Fi(e, t, x, S, i.loadedImages, o, h, g, y, b, G, K, ge, _e, t.rightToLeft === !0, u, i.threeD, i.regionMap), !s && t.slicers && t.slicers.length > 0 && ba(e, t, x, S, o, h, g, y, b, G, K, ge, _e, t.rightToLeft === !0, u), s || Pi(e, u, d, h, g, _, v, F, I, N, P, y, b, k, A, D, O, j, M, p, m, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
|
|
3212
3311
|
let ve = t.rightToLeft === !0;
|
|
3213
3312
|
if (T > 0) {
|
|
3214
|
-
e.save(), e.strokeStyle =
|
|
3313
|
+
e.save(), e.strokeStyle = Cr, e.lineWidth = .5, e.beginPath();
|
|
3215
3314
|
let t = K + B(K, .5, a);
|
|
3216
3315
|
e.moveTo(0, t), e.lineTo(u, t), e.stroke(), e.restore();
|
|
3217
3316
|
}
|
|
3218
3317
|
if (E > 0) {
|
|
3219
|
-
e.save(), e.strokeStyle =
|
|
3318
|
+
e.save(), e.strokeStyle = Cr, e.lineWidth = .5, e.beginPath();
|
|
3220
3319
|
let t = ve ? u - G : G, n = t + B(t, .5, a);
|
|
3221
3320
|
e.moveTo(n, m), e.lineTo(n, d), e.stroke(), e.restore();
|
|
3222
3321
|
}
|
|
3223
3322
|
}
|
|
3224
|
-
function
|
|
3225
|
-
let E = "#f8f9fa", D = "#e8eaed", O = "#caddf6", k = "#c8ccd0", A = "#5b9bd5", j = "#444", M = (e) => !w || e < w.start || e > w.end ? E : w.strong ? O : D, ee = (e) => !w || e < w.start || e > w.end ? k : w.strong ? A : k, te = (e) => !C || e < C.start || e > C.end ? E : C.strong ? O : D, N = (e) => !C || e < C.start || e > C.end ? k : C.strong ? A : k, P = `${Math.max(1, Math.round(11 * x))}px ${
|
|
3323
|
+
function Pi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T) {
|
|
3324
|
+
let E = "#f8f9fa", D = "#e8eaed", O = "#caddf6", k = "#c8ccd0", A = "#5b9bd5", j = "#444", M = (e) => !w || e < w.start || e > w.end ? E : w.strong ? O : D, ee = (e) => !w || e < w.start || e > w.end ? k : w.strong ? A : k, te = (e) => !C || e < C.start || e > C.end ? E : C.strong ? O : D, N = (e) => !C || e < C.start || e > C.end ? k : C.strong ? A : k, P = `${Math.max(1, Math.round(11 * x))}px ${hr}`, F = y + _, I = b + v, L = .5 / S, R = (e, n) => T ? xr(e, n, t) : e, z = T ? t - y : 0;
|
|
3226
3325
|
e.fillStyle = E, e.fillRect(z, 0, y, b), e.strokeStyle = k, e.lineWidth = .5, e.beginPath();
|
|
3227
3326
|
let ne = T ? z + B(z, .5, S) : z + y - L;
|
|
3228
3327
|
e.moveTo(ne, 0), e.lineTo(ne, b), e.moveTo(z, b - L), e.lineTo(z + y, b - L), e.stroke(), e.font = P, e.fillStyle = j;
|
|
@@ -3265,7 +3364,7 @@ function Ti(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S,
|
|
|
3265
3364
|
}
|
|
3266
3365
|
e.restore();
|
|
3267
3366
|
}
|
|
3268
|
-
function
|
|
3367
|
+
function Fi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _) {
|
|
3269
3368
|
let v = [], y = 0;
|
|
3270
3369
|
if (i) for (let e of t.images ?? []) v.push({
|
|
3271
3370
|
kind: "image",
|
|
@@ -3287,61 +3386,61 @@ function Ei(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _) {
|
|
|
3287
3386
|
anchor: e
|
|
3288
3387
|
});
|
|
3289
3388
|
v.sort((e, t) => e.zOrder - t.zOrder || e.fallbackOrder - t.fallbackOrder);
|
|
3290
|
-
for (let y of v) y.kind === "image" ?
|
|
3389
|
+
for (let y of v) y.kind === "image" ? Ri(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, [y.anchor]) : y.kind === "shape" ? zi(e, t, n, r, a, o, s, c, l, u, d, f, p, i, m, h, [{
|
|
3291
3390
|
...y.anchor,
|
|
3292
3391
|
shapes: [y.shape]
|
|
3293
|
-
}]) :
|
|
3392
|
+
}]) : sa(e, t, n, r, a, o, s, c, l, u, d, f, p, m, h, [y.anchor], g, _);
|
|
3294
3393
|
}
|
|
3295
|
-
function
|
|
3394
|
+
function Ii(e, t) {
|
|
3296
3395
|
return e.offsetOf(t);
|
|
3297
3396
|
}
|
|
3298
|
-
function
|
|
3397
|
+
function Li(e, t) {
|
|
3299
3398
|
return e.offsetOf(t);
|
|
3300
3399
|
}
|
|
3301
|
-
function
|
|
3400
|
+
function Ri(e, t, n, r, i, o, s, c, l, u, d, f, p, m, h, g, _ = t.images) {
|
|
3302
3401
|
if (p <= 0 || m <= 0) return;
|
|
3303
|
-
let v =
|
|
3402
|
+
let v = Ii(n, c), y = Li(r, s);
|
|
3304
3403
|
e.save(), e.beginPath();
|
|
3305
|
-
let b =
|
|
3404
|
+
let b = Sr(d, p, g, h);
|
|
3306
3405
|
e.rect(b, f, p, m), e.clip();
|
|
3307
3406
|
for (let t of _) {
|
|
3308
|
-
let s = i.get(
|
|
3407
|
+
let s = i.get(fr(t.imagePath, t.duotone));
|
|
3309
3408
|
if (!s) continue;
|
|
3310
|
-
let c = t.fromCol + 1, _ = t.fromRow + 1, x =
|
|
3311
|
-
if (
|
|
3409
|
+
let c = t.fromCol + 1, _ = t.fromRow + 1, x = Ii(n, c) + t.fromColOff * o / J, S = Li(r, _) + t.fromRowOff * o / J, C, w;
|
|
3410
|
+
if (dr(t)) C = t.nativeExtCx * o / J, w = t.nativeExtCy * o / J;
|
|
3312
3411
|
else {
|
|
3313
|
-
let e = t.toCol + 1, i = t.toRow + 1, a =
|
|
3412
|
+
let e = t.toCol + 1, i = t.toRow + 1, a = Ii(n, e) + t.toColOff * o / J, s = Li(r, i) + t.toRowOff * o / J;
|
|
3314
3413
|
C = a - x, w = s - S;
|
|
3315
3414
|
}
|
|
3316
3415
|
if (C <= 0 || w <= 0) continue;
|
|
3317
|
-
let T =
|
|
3416
|
+
let T = Sr(d + (x - v) - l, C, g, h), E = f + (S - y) - u;
|
|
3318
3417
|
T + C < b || T > b + p || E + w < f || E > f + m || (t.alpha != null && t.alpha < 1 ? (e.save(), e.globalAlpha = t.alpha, a(e, s, t.srcRect, T, E, C, w), e.restore()) : a(e, s, t.srcRect, T, E, C, w));
|
|
3319
3418
|
}
|
|
3320
3419
|
e.restore();
|
|
3321
3420
|
}
|
|
3322
|
-
function
|
|
3421
|
+
function zi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.shapeGroups ?? []) {
|
|
3323
3422
|
if (d <= 0 || f <= 0 || g.length === 0) return;
|
|
3324
|
-
let _ =
|
|
3423
|
+
let _ = Ii(n, o), v = Li(r, a);
|
|
3325
3424
|
e.save(), e.beginPath();
|
|
3326
|
-
let y =
|
|
3425
|
+
let y = Sr(l, d, h, m);
|
|
3327
3426
|
e.rect(y, u, d, f), e.clip();
|
|
3328
3427
|
for (let t of g) {
|
|
3329
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, g =
|
|
3330
|
-
if (
|
|
3428
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, g = Ii(n, a) + t.fromColOff * i / J, b = Li(r, o) + t.fromRowOff * i / J, x, S;
|
|
3429
|
+
if (dr(t)) x = t.nativeExtCx * i / J, S = t.nativeExtCy * i / J;
|
|
3331
3430
|
else {
|
|
3332
|
-
let e = t.toCol + 1, a = t.toRow + 1, o =
|
|
3431
|
+
let e = t.toCol + 1, a = t.toRow + 1, o = Ii(n, e) + t.toColOff * i / J, s = Li(r, a) + t.toRowOff * i / J;
|
|
3333
3432
|
x = o - g, S = s - b;
|
|
3334
3433
|
}
|
|
3335
3434
|
if (x <= 0 || S <= 0) continue;
|
|
3336
|
-
let C =
|
|
3435
|
+
let C = Sr(l + (g - _) - s, x, h, m), w = u + (b - v) - c;
|
|
3337
3436
|
if (!(C + x < y || C > y + d) && !(w + S < u || w > u + f)) for (let n of t.shapes) {
|
|
3338
3437
|
let t = C + n.x * x, r = w + n.y * S, a = n.w * x, o = n.h * S;
|
|
3339
|
-
a <= 0 || o <= 0 ||
|
|
3438
|
+
a <= 0 || o <= 0 || Bi(e, n, t, r, a, o, i, p);
|
|
3340
3439
|
}
|
|
3341
3440
|
}
|
|
3342
3441
|
e.restore();
|
|
3343
3442
|
}
|
|
3344
|
-
function
|
|
3443
|
+
function Bi(e, t, n, r, i, o, s, c) {
|
|
3345
3444
|
if (e.save(), t.rot !== 0 || t.flipH || t.flipV ? (e.translate(n + i / 2, r + o / 2), e.rotate(t.rot * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-i / 2, -o / 2)) : e.translate(n, r), t.geom.type === "custom") for (let n of t.geom.paths) {
|
|
3346
3445
|
if (n.w <= 0 || n.h <= 0) continue;
|
|
3347
3446
|
let r = i / n.w, a = o / n.h;
|
|
@@ -3379,25 +3478,25 @@ function ji(e, t, n, r, i, o, s, c) {
|
|
|
3379
3478
|
e.closePath(), s = l, c = u;
|
|
3380
3479
|
break;
|
|
3381
3480
|
}
|
|
3382
|
-
|
|
3481
|
+
Xi(e, t, i, o);
|
|
3383
3482
|
}
|
|
3384
3483
|
else if (t.geom.type === "preset") {
|
|
3385
3484
|
let n = C(t.fill ?? (t.fillColor ? {
|
|
3386
3485
|
fillType: "solid",
|
|
3387
3486
|
color: t.fillColor
|
|
3388
|
-
} : null), e, 0, 0, i, o, t.rot), r = t.strokeColor && t.strokeWidth > 0 ? () =>
|
|
3389
|
-
x(e, t.geom.name, 0, 0, i, o, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, o),
|
|
3487
|
+
} : null), e, 0, 0, i, o, t.rot), r = t.strokeColor && t.strokeWidth > 0 ? () => Qi(e, t, i, o) : null;
|
|
3488
|
+
x(e, t.geom.name, 0, 0, i, o, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, o), Xi(e, t, i, o));
|
|
3390
3489
|
} else if (t.geom.type === "image") {
|
|
3391
|
-
let n = c?.get(
|
|
3490
|
+
let n = c?.get(fr(t.geom.imagePath, t.geom.duotone));
|
|
3392
3491
|
if (n) {
|
|
3393
3492
|
let r = t.geom.alpha;
|
|
3394
3493
|
r != null && r < 1 ? (e.save(), e.globalAlpha = r, a(e, n, t.geom.srcRect, 0, 0, i, o), e.restore()) : a(e, n, t.geom.srcRect, 0, 0, i, o);
|
|
3395
3494
|
}
|
|
3396
3495
|
}
|
|
3397
|
-
t.text &&
|
|
3496
|
+
t.text && Yi(e, t.text, i, o, s), e.restore();
|
|
3398
3497
|
}
|
|
3399
|
-
var
|
|
3400
|
-
function
|
|
3498
|
+
var Vi = /* @__PURE__ */ new WeakMap();
|
|
3499
|
+
function Hi(e, t) {
|
|
3401
3500
|
let n = e.tinted.get(t);
|
|
3402
3501
|
if (n) return n;
|
|
3403
3502
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -3405,18 +3504,18 @@ function Ni(e, t) {
|
|
|
3405
3504
|
let o = a.getContext("2d");
|
|
3406
3505
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
3407
3506
|
}
|
|
3408
|
-
function
|
|
3507
|
+
function Ui(e) {
|
|
3409
3508
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3410
3509
|
return new Promise((e, r) => {
|
|
3411
3510
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3412
3511
|
});
|
|
3413
3512
|
}
|
|
3414
|
-
var
|
|
3415
|
-
function
|
|
3416
|
-
let r = Math.max(1, Math.round(t *
|
|
3513
|
+
var Wi = 256;
|
|
3514
|
+
function Gi(e, t, n) {
|
|
3515
|
+
let r = Math.max(1, Math.round(t * Wi)), i = Math.max(1, Math.round(n * Wi));
|
|
3417
3516
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3418
3517
|
}
|
|
3419
|
-
function
|
|
3518
|
+
function Ki(e) {
|
|
3420
3519
|
let t = [];
|
|
3421
3520
|
for (let n of e.shapeGroups ?? []) for (let e of n.shapes) for (let n of e.text?.paragraphs ?? []) for (let e of n.runs) e.type === "math" && t.push({
|
|
3422
3521
|
nodes: e.nodes,
|
|
@@ -3424,17 +3523,17 @@ function Li(e) {
|
|
|
3424
3523
|
});
|
|
3425
3524
|
return t;
|
|
3426
3525
|
}
|
|
3427
|
-
function
|
|
3428
|
-
for (let t of e.shapeGroups ?? []) for (let e of t.shapes) for (let t of e.text?.paragraphs ?? []) for (let e of t.runs) if (e.type === "math" && !
|
|
3526
|
+
function qi(e) {
|
|
3527
|
+
for (let t of e.shapeGroups ?? []) for (let e of t.shapes) for (let t of e.text?.paragraphs ?? []) for (let e of t.runs) if (e.type === "math" && !Vi.has(e.nodes)) return !0;
|
|
3429
3528
|
return !1;
|
|
3430
3529
|
}
|
|
3431
|
-
async function
|
|
3432
|
-
let n =
|
|
3530
|
+
async function Ji(e, t) {
|
|
3531
|
+
let n = Ki(e).filter((e) => !Vi.has(e.nodes));
|
|
3433
3532
|
if (n.length !== 0) {
|
|
3434
3533
|
await t.loadMathJax();
|
|
3435
|
-
for (let e of n) if (!
|
|
3436
|
-
let n = await t.mathMLToSvg(D(e.nodes, e.display)), r = await
|
|
3437
|
-
|
|
3534
|
+
for (let e of n) if (!Vi.has(e.nodes)) try {
|
|
3535
|
+
let n = await t.mathMLToSvg(D(e.nodes, e.display)), r = await Ui(Gi(He(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3536
|
+
Vi.set(e.nodes, {
|
|
3438
3537
|
img: r,
|
|
3439
3538
|
widthEm: n.widthEm,
|
|
3440
3539
|
ascentEm: n.ascentEm,
|
|
@@ -3444,12 +3543,12 @@ async function zi(e, t) {
|
|
|
3444
3543
|
} catch {}
|
|
3445
3544
|
}
|
|
3446
3545
|
}
|
|
3447
|
-
function
|
|
3546
|
+
function Yi(e, t, n, r, i) {
|
|
3448
3547
|
if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
|
|
3449
3548
|
let a = t.lIns / J * i, o = t.rIns / J * i, s = t.tIns / J * i, c = t.bIns / J * i, l = Math.max(0, n - a - o), u = Math.max(0, r - s - c);
|
|
3450
3549
|
if (l <= 0 || u <= 0) return;
|
|
3451
3550
|
let d = (e) => {
|
|
3452
|
-
let t = (e.size > 0 ? e.size :
|
|
3551
|
+
let t = (e.size > 0 ? e.size : br) * Re * i, n = yr(e.fontFace);
|
|
3453
3552
|
return {
|
|
3454
3553
|
font: `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${t}px ${n}`,
|
|
3455
3554
|
px: t
|
|
@@ -3466,8 +3565,8 @@ function Bi(e, t, n, r, i) {
|
|
|
3466
3565
|
return n.spaceLine && (n.spaceLine.type === "pct" ? r *= n.spaceLine.val / 1e5 : r = n.spaceLine.val * Re * i), t.autoFit === "norm" && t.lnSpcReduction != null && n.spaceLine?.type !== "pts" && (r *= 1 - t.lnSpcReduction), r;
|
|
3467
3566
|
}, T = () => {
|
|
3468
3567
|
if (b === 0) {
|
|
3469
|
-
let e = (E ||
|
|
3470
|
-
b = C ? n : Math.max(n, t), x = f(`${e}px ${
|
|
3568
|
+
let e = (E || br) * Re * i, t = Math.max(V(D, e), V(O, e)), n = e * 1.2;
|
|
3569
|
+
b = C ? n : Math.max(n, t), x = f(`${e}px ${yr(D)}`, e);
|
|
3471
3570
|
}
|
|
3472
3571
|
b = w(b), m.push({
|
|
3473
3572
|
segs: v,
|
|
@@ -3485,9 +3584,9 @@ function Bi(e, t, n, r, i) {
|
|
|
3485
3584
|
continue;
|
|
3486
3585
|
}
|
|
3487
3586
|
if (t.type === "math") {
|
|
3488
|
-
let e =
|
|
3587
|
+
let e = Vi.get(t.nodes);
|
|
3489
3588
|
if (!e) continue;
|
|
3490
|
-
let n = (t.fontSize ?? (E ||
|
|
3589
|
+
let n = (t.fontSize ?? (E || br)) * Re * i, o = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
|
|
3491
3590
|
if (t.display) {
|
|
3492
3591
|
T(), m.push({
|
|
3493
3592
|
segs: [{
|
|
@@ -3517,7 +3616,7 @@ function Bi(e, t, n, r, i) {
|
|
|
3517
3616
|
}), y += o, b = Math.max(b, s + c), x = Math.max(x, s), S = !0;
|
|
3518
3617
|
continue;
|
|
3519
3618
|
}
|
|
3520
|
-
E = t.size > 0 ? t.size :
|
|
3619
|
+
E = t.size > 0 ? t.size : br, D = t.fontFace, O = t.fontFaceEa;
|
|
3521
3620
|
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(V(t.fontFace, o), V(t.fontFaceEa, o)), l = o * 1.2, g = C ? l : Math.max(l, c);
|
|
3522
3621
|
b = Math.max(b, g), x = Math.max(x, f(n, o)), e.font = n;
|
|
3523
3622
|
let k = t.text.split("\n");
|
|
@@ -3578,7 +3677,7 @@ function Bi(e, t, n, r, i) {
|
|
|
3578
3677
|
for (let r of t.segs) {
|
|
3579
3678
|
if (r.kind === "text") e.font = r.font, e.fillStyle = r.color, e.fillText(r.text, i, n);
|
|
3580
3679
|
else {
|
|
3581
|
-
let t =
|
|
3680
|
+
let t = Hi(r.render, r.color);
|
|
3582
3681
|
e.drawImage(t, i, n - r.ascent, r.w, r.ascent + r.descent);
|
|
3583
3682
|
}
|
|
3584
3683
|
i += r.w;
|
|
@@ -3591,14 +3690,14 @@ function Bi(e, t, n, r, i) {
|
|
|
3591
3690
|
_ += t.height;
|
|
3592
3691
|
}
|
|
3593
3692
|
}
|
|
3594
|
-
function
|
|
3693
|
+
function Xi(e, t, n, r) {
|
|
3595
3694
|
let i = C(t.fill ?? (t.fillColor ? {
|
|
3596
3695
|
fillType: "solid",
|
|
3597
3696
|
color: t.fillColor
|
|
3598
3697
|
} : null), e, 0, 0, n, r, t.rot);
|
|
3599
|
-
i && (e.fillStyle = i, e.fill()),
|
|
3698
|
+
i && (e.fillStyle = i, e.fill()), Qi(e, t, n, r);
|
|
3600
3699
|
}
|
|
3601
|
-
function
|
|
3700
|
+
function Zi(e) {
|
|
3602
3701
|
return !e.strokeColor || e.strokeWidth <= 0 ? null : {
|
|
3603
3702
|
color: e.strokeColor,
|
|
3604
3703
|
width: e.strokeWidth,
|
|
@@ -3614,8 +3713,8 @@ function Hi(e) {
|
|
|
3614
3713
|
...e.strokeTailEnd ? { tailEnd: e.strokeTailEnd } : {}
|
|
3615
3714
|
};
|
|
3616
3715
|
}
|
|
3617
|
-
function
|
|
3618
|
-
let i =
|
|
3716
|
+
function Qi(e, t, n, r) {
|
|
3717
|
+
let i = Zi(t);
|
|
3619
3718
|
if (i) {
|
|
3620
3719
|
if (oe(e, i, 1 / J), i.fill) {
|
|
3621
3720
|
let a = C(i.fill, e, 0, 0, n, r, t.rot);
|
|
@@ -3624,7 +3723,7 @@ function Ui(e, t, n, r) {
|
|
|
3624
3723
|
e.stroke();
|
|
3625
3724
|
}
|
|
3626
3725
|
}
|
|
3627
|
-
function
|
|
3726
|
+
function $i(e, t, n, r, i, a, o) {
|
|
3628
3727
|
if (r === n && i === t) return e;
|
|
3629
3728
|
let s = (e, r) => {
|
|
3630
3729
|
if (e === t && r === n) return null;
|
|
@@ -3644,7 +3743,7 @@ function Wi(e, t, n, r, i, a, o) {
|
|
|
3644
3743
|
diagonalDown: e.diagonalDown ?? null
|
|
3645
3744
|
};
|
|
3646
3745
|
}
|
|
3647
|
-
function
|
|
3746
|
+
function ea(e, t) {
|
|
3648
3747
|
if (!t) return e;
|
|
3649
3748
|
let n = (e, t) => t && t.style ? t : e ?? null;
|
|
3650
3749
|
return {
|
|
@@ -3656,7 +3755,7 @@ function Gi(e, t) {
|
|
|
3656
3755
|
diagonalDown: n(e.diagonalDown, t.diagonalDown)
|
|
3657
3756
|
};
|
|
3658
3757
|
}
|
|
3659
|
-
function
|
|
3758
|
+
function ta(e, t, n, r, i = 1) {
|
|
3660
3759
|
return {
|
|
3661
3760
|
outerStart: n ? e - i : e,
|
|
3662
3761
|
outerEnd: r ? t + i : t,
|
|
@@ -3664,7 +3763,7 @@ function Ki(e, t, n, r, i = 1) {
|
|
|
3664
3763
|
innerEnd: r ? t - i : t
|
|
3665
3764
|
};
|
|
3666
3765
|
}
|
|
3667
|
-
function
|
|
3766
|
+
function na(e, t, n, r, i, a, o = 1) {
|
|
3668
3767
|
let s = [
|
|
3669
3768
|
{
|
|
3670
3769
|
edge: t.top,
|
|
@@ -3726,25 +3825,25 @@ function qi(e, t, n, r, i, a, o = 1) {
|
|
|
3726
3825
|
}
|
|
3727
3826
|
if (c.style === "double" && p !== "d") {
|
|
3728
3827
|
if (e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), p === "h") {
|
|
3729
|
-
let o = u === r, s = o ? r - 1 : r + a + 1, c = o ? r + 1 : r + a - 1, l =
|
|
3828
|
+
let o = u === r, s = o ? r - 1 : r + a + 1, c = o ? r + 1 : r + a - 1, l = ta(n, n + i, !!t.left?.style && t.left.style !== "none", !!t.right?.style && t.right.style !== "none", 1);
|
|
3730
3829
|
e.moveTo(l.outerStart, s), e.lineTo(l.outerEnd, s), e.moveTo(l.innerStart, c), e.lineTo(l.innerEnd, c);
|
|
3731
3830
|
} else {
|
|
3732
|
-
let o = l === n, s = o ? n - 1 : n + i + 1, c = o ? n + 1 : n + i - 1, u =
|
|
3831
|
+
let o = l === n, s = o ? n - 1 : n + i + 1, c = o ? n + 1 : n + i - 1, u = ta(r, r + a, !!t.top?.style && t.top.style !== "none", !!t.bottom?.style && t.bottom.style !== "none", 1);
|
|
3733
3832
|
e.moveTo(s, u.outerStart), e.lineTo(s, u.outerEnd), e.moveTo(c, u.innerStart), e.lineTo(c, u.innerEnd);
|
|
3734
3833
|
}
|
|
3735
3834
|
e.stroke();
|
|
3736
3835
|
continue;
|
|
3737
3836
|
}
|
|
3738
3837
|
e.beginPath(), e.strokeStyle = s;
|
|
3739
|
-
let m =
|
|
3838
|
+
let m = ra(c.style);
|
|
3740
3839
|
e.lineWidth = m;
|
|
3741
|
-
let h =
|
|
3840
|
+
let h = ia(c.style);
|
|
3742
3841
|
e.setLineDash(h);
|
|
3743
3842
|
let g = p === "v" ? B(l, m, o) : 0, _ = p === "h" ? B(u, m, o) : 0;
|
|
3744
3843
|
e.moveTo(l + g, u + _), e.lineTo(d + g, f + _), e.stroke(), e.setLineDash([]);
|
|
3745
3844
|
}
|
|
3746
3845
|
}
|
|
3747
|
-
function
|
|
3846
|
+
function ra(e) {
|
|
3748
3847
|
switch (e) {
|
|
3749
3848
|
case "thick": return 3;
|
|
3750
3849
|
case "medium":
|
|
@@ -3756,10 +3855,10 @@ function Ji(e) {
|
|
|
3756
3855
|
default: return 1;
|
|
3757
3856
|
}
|
|
3758
3857
|
}
|
|
3759
|
-
function
|
|
3858
|
+
function ia(e) {
|
|
3760
3859
|
return ze(e);
|
|
3761
3860
|
}
|
|
3762
|
-
function
|
|
3861
|
+
function aa(e) {
|
|
3763
3862
|
switch (e) {
|
|
3764
3863
|
case "double": return 13;
|
|
3765
3864
|
case "thick": return 12;
|
|
@@ -3777,17 +3876,17 @@ function Xi(e) {
|
|
|
3777
3876
|
default: return 0;
|
|
3778
3877
|
}
|
|
3779
3878
|
}
|
|
3780
|
-
function
|
|
3781
|
-
let n =
|
|
3879
|
+
function oa(e, t) {
|
|
3880
|
+
let n = aa(e?.style), r = aa(t?.style);
|
|
3782
3881
|
return n === 0 && r === 0 ? null : n >= r ? e ?? null : t ?? null;
|
|
3783
3882
|
}
|
|
3784
|
-
function
|
|
3883
|
+
function sa(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g = t.charts, _, v) {
|
|
3785
3884
|
if (f <= 0 || p <= 0) return;
|
|
3786
|
-
let y =
|
|
3885
|
+
let y = Ii(n, o), b = Li(r, a), x = Sr(l, f, h, m);
|
|
3787
3886
|
for (let t of g) {
|
|
3788
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, g = t.toCol + 1, S = t.toRow + 1, C =
|
|
3887
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, g = t.toCol + 1, S = t.toRow + 1, C = Ii(n, a) + t.fromColOff * i / J, w = Li(r, o) + t.fromRowOff * i / J, T = Ii(n, g) + t.toColOff * i / J, E = Li(r, S) + t.toRowOff * i / J, D = T - C, O = E - w;
|
|
3789
3888
|
if (D <= 0 || O <= 0) continue;
|
|
3790
|
-
let k =
|
|
3889
|
+
let k = Sr(l + (C - y) - s, D, h, m), A = u + (w - b) - c;
|
|
3791
3890
|
if (k + D < x || k > x + f || A + O < u || A > u + p) continue;
|
|
3792
3891
|
e.save(), e.beginPath(), e.rect(x, u, f, p), e.clip();
|
|
3793
3892
|
let j = Re * i;
|
|
@@ -3799,52 +3898,52 @@ function Qi(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g = t.charts, _, v) {
|
|
|
3799
3898
|
}, j, 0, _, v), e.restore();
|
|
3800
3899
|
}
|
|
3801
3900
|
}
|
|
3802
|
-
var
|
|
3803
|
-
function
|
|
3901
|
+
var ca = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", la = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", ua = "#FFFFFF", da = "#BFBFBF", fa = "#F2F2F2", pa = "#404040", ma = "#FFFFFF", ha = "#000000", ga = "#A5A5A5", _a = "#E7E6E6", va = "#A6A6A6", ya = "#C6C6C6";
|
|
3902
|
+
function ba(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
3804
3903
|
if (d <= 0 || f <= 0) return;
|
|
3805
3904
|
let h = t.slicers;
|
|
3806
3905
|
if (!h) return;
|
|
3807
|
-
let g =
|
|
3906
|
+
let g = Ii(n, o), _ = Li(r, a), v = Sr(l, d, m, p);
|
|
3808
3907
|
for (let t of h) {
|
|
3809
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, h = t.toCol + 1, y = t.toRow + 1, b =
|
|
3908
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, h = t.toCol + 1, y = t.toRow + 1, b = Ii(n, a) + t.fromColOff * i / J, x = Li(r, o) + t.fromRowOff * i / J, S = Ii(n, h) + t.toColOff * i / J, C = Li(r, y) + t.toRowOff * i / J, w = S - b, T = C - x;
|
|
3810
3909
|
if (w <= 0 || T <= 0) continue;
|
|
3811
|
-
let E =
|
|
3812
|
-
E + w < v || E > v + d || D + T < u || D > u + f || (e.save(), e.beginPath(), e.rect(v, u, d, f), e.clip(),
|
|
3910
|
+
let E = Sr(l + (b - g) - s, w, m, p), D = u + (x - _) - c;
|
|
3911
|
+
E + w < v || E > v + d || D + T < u || D > u + f || (e.save(), e.beginPath(), e.rect(v, u, d, f), e.clip(), xa(e, t.caption, t.items, E, D, w, T, i, t.style), e.restore());
|
|
3813
3912
|
}
|
|
3814
3913
|
}
|
|
3815
|
-
function
|
|
3914
|
+
function xa(e, t, n, r, i, a, o, s, c) {
|
|
3816
3915
|
let l = c != null;
|
|
3817
|
-
e.fillStyle = c?.whole?.fillColor ??
|
|
3818
|
-
let u = l ? c.whole?.borderColor :
|
|
3916
|
+
e.fillStyle = c?.whole?.fillColor ?? ua, e.fillRect(r, i, a, o);
|
|
3917
|
+
let u = l ? c.whole?.borderColor : da;
|
|
3819
3918
|
u && (e.strokeStyle = u, e.lineWidth = 1, e.strokeRect(r + .5, i + .5, a - 1, o - 1));
|
|
3820
|
-
let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor :
|
|
3821
|
-
f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ??
|
|
3919
|
+
let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor : fa;
|
|
3920
|
+
f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ?? pa, e.font = Ca(c?.header, ca, s), e.textBaseline = "middle", e.textAlign = "left";
|
|
3822
3921
|
let p = 6 * s;
|
|
3823
|
-
if (
|
|
3922
|
+
if (Ta(e, t, r + p, i + d / 2 + 1, a - 2 * p), n.length === 0) return;
|
|
3824
3923
|
let m = Math.max(1, Math.round(2 * s)), h = 4 * s, g = r + h, _ = i + d + h, v = a - 2 * h, y = o - d - 2 * h;
|
|
3825
3924
|
if (v <= 0 || y <= 0) return;
|
|
3826
3925
|
let b = Math.max(18 * s, 16), x = Math.max(1, Math.floor((y + m) / (b + m))), S = Math.min(n.length, x), C = Math.min(b, (y - m * (S - 1)) / S);
|
|
3827
3926
|
if (C <= 0) return;
|
|
3828
|
-
e.font =
|
|
3927
|
+
e.font = wa(la, s);
|
|
3829
3928
|
let w = 8 * s;
|
|
3830
3929
|
for (let t = 0; t < S; t++) {
|
|
3831
|
-
let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ?
|
|
3832
|
-
e.fillStyle = u, l ? (
|
|
3930
|
+
let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ? ma : _a), d = l ? o?.borderColor : a ? ga : ya;
|
|
3931
|
+
e.fillStyle = u, l ? (Sa(e, g, i, v, C, Math.min(4 * s, C / 4)), e.fill(), d && (e.strokeStyle = d, e.lineWidth = 1, e.stroke())) : (e.fillRect(g, i, v, C), d && (e.strokeStyle = d, e.lineWidth = 1, e.strokeRect(g + .5, i + .5, v - 1, C - 1))), e.font = Ca(o, la, s), e.fillStyle = o?.fontColor ?? (a ? ha : va), Ta(e, r.name, g + w, i + C / 2 + 1, v - 2 * w);
|
|
3833
3932
|
}
|
|
3834
3933
|
}
|
|
3835
|
-
function
|
|
3934
|
+
function Sa(e, t, n, r, i, a) {
|
|
3836
3935
|
let o = Math.max(0, Math.min(a, r / 2, i / 2));
|
|
3837
3936
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
|
|
3838
3937
|
}
|
|
3839
|
-
function
|
|
3840
|
-
if (!e) return
|
|
3938
|
+
function Ca(e, t, n) {
|
|
3939
|
+
if (!e) return wa(t, n);
|
|
3841
3940
|
let r = Math.round((e.fontSize ?? 11) * n);
|
|
3842
3941
|
return `${e.fontBold ? "bold " : ""}${r}px ${e.fontFamily ? `"${e.fontFamily}", "Segoe UI", sans-serif` : "\"Meiryo UI\", \"Segoe UI\", sans-serif"}`;
|
|
3843
3942
|
}
|
|
3844
|
-
function
|
|
3943
|
+
function wa(e, t) {
|
|
3845
3944
|
return e.replace(/(\d+(?:\.\d+)?)px/, (e, n) => `${Math.round(Number(n) * t)}px`);
|
|
3846
3945
|
}
|
|
3847
|
-
function
|
|
3946
|
+
function Ta(e, t, n, r, i) {
|
|
3848
3947
|
if (i <= 0) return;
|
|
3849
3948
|
let a = t;
|
|
3850
3949
|
if (e.measureText(a).width > i) {
|
|
@@ -3855,16 +3954,16 @@ function ga(e, t, n, r, i) {
|
|
|
3855
3954
|
}
|
|
3856
3955
|
//#endregion
|
|
3857
3956
|
//#region packages/xlsx/src/render-orchestrator.ts
|
|
3858
|
-
var
|
|
3859
|
-
function
|
|
3957
|
+
var Ea = Symbol("xlsx-render-commit-guard");
|
|
3958
|
+
function Da(e, t) {
|
|
3860
3959
|
return {
|
|
3861
3960
|
...e,
|
|
3862
|
-
[
|
|
3961
|
+
[Ea]: t
|
|
3863
3962
|
};
|
|
3864
3963
|
}
|
|
3865
|
-
function
|
|
3964
|
+
function Oa(e, t, n, r, i) {
|
|
3866
3965
|
if (!n) return !0;
|
|
3867
|
-
let a = r ??
|
|
3966
|
+
let a = r ?? Q(t), o = i?.scale ?? 1, { col: s, row: c } = a.axesAtScale(o), l = (e, t, n) => e.offsetOf(t + 1) + n * o / J, u = l(s, e.fromCol, e.fromColOff), d = l(c, e.fromRow, e.fromRowOff), f = dr(e), p = f ? u + e.nativeExtCx * o / J : l(s, e.toCol, e.toColOff), m = f ? d + e.nativeExtCy * o / J : l(c, e.toRow, e.toRowOff);
|
|
3868
3967
|
if (p <= u || m <= d) return !1;
|
|
3869
3968
|
let h = i ? a.effectiveFrozenBands({
|
|
3870
3969
|
scale: o,
|
|
@@ -3883,7 +3982,7 @@ function ya(e, t, n, r, i) {
|
|
|
3883
3982
|
};
|
|
3884
3983
|
return g(u, p, s.offsetOf(h.cols + 1), s.offsetOf(n.col), s.offsetOf(n.col + n.cols)) && g(d, m, c.offsetOf(h.rows + 1), c.offsetOf(n.row), c.offsetOf(n.row + n.rows));
|
|
3885
3984
|
}
|
|
3886
|
-
async function
|
|
3985
|
+
async function ka(e, t, n, r, i = 0, a = 0, o = null, c = null, l) {
|
|
3887
3986
|
let u = t === "image/svg+xml", d = b(t, o, i, a), f = () => Ve(e, t, c, r, {
|
|
3888
3987
|
widthPt: d.widthPt,
|
|
3889
3988
|
heightPt: d.heightPt,
|
|
@@ -3899,16 +3998,16 @@ async function ba(e, t, n, r, i = 0, a = 0, o = null, c = null, l) {
|
|
|
3899
3998
|
}
|
|
3900
3999
|
return u ? s(e, r) : f();
|
|
3901
4000
|
}
|
|
3902
|
-
async function
|
|
4001
|
+
async function Aa(e, t, n, r) {
|
|
3903
4002
|
if (t.clear(), !n) return;
|
|
3904
|
-
let i = n, a = /* @__PURE__ */ new Map(), o = r?.viewport ?
|
|
4003
|
+
let i = n, a = /* @__PURE__ */ new Map(), o = r?.viewport ? Q(e) : void 0, s = r?.viewport && r.width !== void 0 && r.height !== void 0 ? {
|
|
3905
4004
|
width: r.width,
|
|
3906
4005
|
height: r.height,
|
|
3907
4006
|
scale: r.cellScale ?? 1,
|
|
3908
4007
|
freezeRows: r.freezeRows ?? e.freezeRows ?? 0,
|
|
3909
4008
|
freezeCols: r.freezeCols ?? e.freezeCols ?? 0
|
|
3910
4009
|
} : void 0;
|
|
3911
|
-
if (e.images) for (let t of e.images)
|
|
4010
|
+
if (e.images) for (let t of e.images) Oa(t, e, r?.viewport, o, s) && a.set(fr(t.imagePath, t.duotone), {
|
|
3912
4011
|
imagePath: t.imagePath,
|
|
3913
4012
|
mimeType: t.mimeType,
|
|
3914
4013
|
svgImagePath: t.svgImagePath,
|
|
@@ -3918,7 +4017,7 @@ async function xa(e, t, n, r) {
|
|
|
3918
4017
|
duotone: t.duotone ?? null
|
|
3919
4018
|
});
|
|
3920
4019
|
if (e.shapeGroups) {
|
|
3921
|
-
for (let t of e.shapeGroups) if (
|
|
4020
|
+
for (let t of e.shapeGroups) if (Oa(t, e, r?.viewport, o, s)) for (let e of t.shapes) e.geom.type === "image" && a.set(fr(e.geom.imagePath, e.geom.duotone), {
|
|
3922
4021
|
imagePath: e.geom.imagePath,
|
|
3923
4022
|
mimeType: e.geom.mimeType,
|
|
3924
4023
|
svgImagePath: e.geom.svgImagePath,
|
|
@@ -3930,7 +4029,7 @@ async function xa(e, t, n, r) {
|
|
|
3930
4029
|
}
|
|
3931
4030
|
a.size !== 0 && await Promise.all([...a.entries()].map(async ([e, n]) => {
|
|
3932
4031
|
try {
|
|
3933
|
-
let a = await
|
|
4032
|
+
let a = await ka(n.imagePath, n.mimeType, n.svgImagePath, i, n.widthPt, n.heightPt, n.srcRect, n.duotone, r?.offscreenFactory);
|
|
3934
4033
|
t.set(e, a);
|
|
3935
4034
|
} catch (n) {
|
|
3936
4035
|
if (f(n)) throw n;
|
|
@@ -3938,43 +4037,58 @@ async function xa(e, t, n, r) {
|
|
|
3938
4037
|
}
|
|
3939
4038
|
}));
|
|
3940
4039
|
}
|
|
3941
|
-
|
|
4040
|
+
var ja = /* @__PURE__ */ new WeakMap();
|
|
4041
|
+
function Ma(e, t, n) {
|
|
4042
|
+
if (Ti(t)) return t;
|
|
4043
|
+
let r = ja.get(t);
|
|
4044
|
+
if (r) return r;
|
|
4045
|
+
let i = {
|
|
4046
|
+
...t,
|
|
4047
|
+
rowHeights: { ...t.rowHeights }
|
|
4048
|
+
};
|
|
4049
|
+
Mi(t, i);
|
|
4050
|
+
let a = Q(t).maximumDigitWidth;
|
|
4051
|
+
return sr.forWorksheet(i, a), wi(e, i, n), sr.forWorksheet(i, a), ja.set(t, i), i;
|
|
4052
|
+
}
|
|
4053
|
+
async function Na(e, t, n, r = {}) {
|
|
3942
4054
|
let i = r.fetchImage ? h(r.fetchImage) : void 0;
|
|
3943
4055
|
try {
|
|
3944
|
-
await
|
|
4056
|
+
await Pa(e, t, n, r);
|
|
3945
4057
|
} finally {
|
|
3946
4058
|
i?.();
|
|
3947
4059
|
}
|
|
3948
4060
|
}
|
|
3949
|
-
async function
|
|
3950
|
-
let
|
|
3951
|
-
if (
|
|
4061
|
+
async function Pa(e, t, n, r = {}) {
|
|
4062
|
+
let i = e.styles, a = t.getContext("2d");
|
|
4063
|
+
if (!a) throw Error("XLSX render target does not provide a 2-D canvas context");
|
|
4064
|
+
let o = Ma(a, e.ws, i), s = N(t) ? t.clientWidth || 800 : t.width, c = N(t) ? t.clientHeight || 600 : t.height, l = r.width ?? s, u = r.height ?? c, d = /* @__PURE__ */ new Map();
|
|
4065
|
+
if (await Aa(o, d, r.fetchImage, {
|
|
3952
4066
|
viewport: n,
|
|
3953
|
-
width:
|
|
3954
|
-
height:
|
|
4067
|
+
width: l,
|
|
4068
|
+
height: u,
|
|
3955
4069
|
cellScale: r.cellScale,
|
|
3956
4070
|
freezeRows: r.freezeRows,
|
|
3957
4071
|
freezeCols: r.freezeCols
|
|
3958
|
-
}), e.math &&
|
|
3959
|
-
let
|
|
3960
|
-
if (t.width !==
|
|
3961
|
-
let e = `${
|
|
4072
|
+
}), e.math && qi(o) && await Ji(o, e.math), r[Ea]?.() === !1) return;
|
|
4073
|
+
let f = r.dpr ?? F(), p = U(l * f, u * f), m = p.clamped ? f * p.scale : f, h = p.width, g = p.height;
|
|
4074
|
+
if (t.width !== h && (t.width = h), t.height !== g && (t.height = g), N(t)) {
|
|
4075
|
+
let e = `${l}px`, n = `${u}px`;
|
|
3962
4076
|
t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
|
|
3963
4077
|
}
|
|
3964
|
-
let
|
|
3965
|
-
if (
|
|
3966
|
-
|
|
4078
|
+
let _ = t.getContext("2d");
|
|
4079
|
+
if (_.setTransform(m, 0, 0, m, 0, 0), o.parseError) {
|
|
4080
|
+
Fa(_, l, u, o.name, o.parseError);
|
|
3967
4081
|
return;
|
|
3968
4082
|
}
|
|
3969
|
-
|
|
4083
|
+
Ni(_, o, i, n, {
|
|
3970
4084
|
...r,
|
|
3971
|
-
dpr:
|
|
3972
|
-
loadedImages:
|
|
4085
|
+
dpr: m,
|
|
4086
|
+
loadedImages: d,
|
|
3973
4087
|
threeD: e.threeD,
|
|
3974
4088
|
regionMap: e.regionMap
|
|
3975
4089
|
});
|
|
3976
4090
|
}
|
|
3977
|
-
function
|
|
4091
|
+
function Fa(e, t, n, r, i) {
|
|
3978
4092
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
3979
4093
|
let a = t / 2, o = Math.min(t, n), s = Math.max(20, o * .1);
|
|
3980
4094
|
e.fillStyle = "#b23b3b", e.textAlign = "center", e.textBaseline = "middle", e.font = `${s}px sans-serif`, e.fillText("⚠", a, n * .32);
|
|
@@ -3994,21 +4108,21 @@ function wa(e, t, n, r, i) {
|
|
|
3994
4108
|
}
|
|
3995
4109
|
//#endregion
|
|
3996
4110
|
//#region packages/xlsx/src/google-fonts.ts
|
|
3997
|
-
var
|
|
4111
|
+
var Ia = {
|
|
3998
4112
|
...k,
|
|
3999
4113
|
...M
|
|
4000
4114
|
};
|
|
4001
|
-
function*
|
|
4115
|
+
function* La(e) {
|
|
4002
4116
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
4003
4117
|
else yield t.text;
|
|
4004
4118
|
}
|
|
4005
|
-
function
|
|
4119
|
+
function Ra(e) {
|
|
4006
4120
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
4007
4121
|
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= H(r.name));
|
|
4008
|
-
for (let r of I(
|
|
4122
|
+
for (let r of I(La(e), n)) t.add(r);
|
|
4009
4123
|
return t;
|
|
4010
4124
|
}
|
|
4011
|
-
function
|
|
4125
|
+
function za(e) {
|
|
4012
4126
|
let t = (e ?? "").trim();
|
|
4013
4127
|
if (!t) return {
|
|
4014
4128
|
kind: "unresolved",
|
|
@@ -4023,9 +4137,9 @@ function Oa(e) {
|
|
|
4023
4137
|
let e = t.slice(0, i);
|
|
4024
4138
|
e.startsWith("'") && e.endsWith("'") && e.length >= 2 && (e = e.slice(1, -1).replace(/''/g, "'")), n = e, r = t.slice(i + 1);
|
|
4025
4139
|
}
|
|
4026
|
-
let [a, o] = r.split(":"), s =
|
|
4140
|
+
let [a, o] = r.split(":"), s = cr(a ?? "");
|
|
4027
4141
|
if (s) {
|
|
4028
|
-
let e = o ?
|
|
4142
|
+
let e = o ? cr(o) : s;
|
|
4029
4143
|
if (e) {
|
|
4030
4144
|
let t = {
|
|
4031
4145
|
row: Math.min(s.row, e.row),
|
|
@@ -4047,7 +4161,7 @@ function Oa(e) {
|
|
|
4047
4161
|
formula: t
|
|
4048
4162
|
};
|
|
4049
4163
|
}
|
|
4050
|
-
function
|
|
4164
|
+
function Ba(e, t) {
|
|
4051
4165
|
if (e.kind === "inline") return {
|
|
4052
4166
|
kind: "values",
|
|
4053
4167
|
values: e.values
|
|
@@ -4066,7 +4180,7 @@ function ka(e, t) {
|
|
|
4066
4180
|
values: n
|
|
4067
4181
|
};
|
|
4068
4182
|
}
|
|
4069
|
-
function
|
|
4183
|
+
function Va(e) {
|
|
4070
4184
|
let { cell: t, panel: n, viewport: r, rtl: i } = e, a = t.y + t.h + 2, o = t.y - 2 - n.h, s;
|
|
4071
4185
|
s = a + n.h <= r.h ? a : o >= 0 ? o : a, s = Math.max(0, Math.min(s, r.h - n.h));
|
|
4072
4186
|
let c = i ? t.x + t.w - n.w : t.x;
|
|
@@ -4077,7 +4191,7 @@ function Aa(e) {
|
|
|
4077
4191
|
}
|
|
4078
4192
|
//#endregion
|
|
4079
4193
|
//#region packages/xlsx/src/worker-protocol.ts
|
|
4080
|
-
function
|
|
4194
|
+
function Ha(e, t) {
|
|
4081
4195
|
if (!t) return;
|
|
4082
4196
|
let n = !1;
|
|
4083
4197
|
if (t.rows) for (let [r, i] of Object.entries(t.rows)) {
|
|
@@ -4088,32 +4202,32 @@ function ja(e, t) {
|
|
|
4088
4202
|
let t = Number(r);
|
|
4089
4203
|
i === null ? Object.hasOwn(e.colWidths, t) && (delete e.colWidths[t], n = !0) : e.colWidths[t] !== i && (e.colWidths[t] = i, n = !0);
|
|
4090
4204
|
}
|
|
4091
|
-
n &&
|
|
4205
|
+
n && sr.invalidate(e);
|
|
4092
4206
|
}
|
|
4093
|
-
function
|
|
4207
|
+
function Ua(e, t) {
|
|
4094
4208
|
if (!t) return e;
|
|
4095
4209
|
let n = {
|
|
4096
4210
|
...e,
|
|
4097
4211
|
rowHeights: { ...e.rowHeights },
|
|
4098
4212
|
colWidths: { ...e.colWidths }
|
|
4099
4213
|
};
|
|
4100
|
-
return
|
|
4214
|
+
return Ha(n, t), n;
|
|
4101
4215
|
}
|
|
4102
|
-
var
|
|
4103
|
-
function
|
|
4216
|
+
var Wa = Symbol("xlsx-viewer-render-context");
|
|
4217
|
+
function Ga(e, t, n) {
|
|
4104
4218
|
if (!Number.isFinite(t) || t <= 0) throw Error("XLSX maximum digit width must be a finite positive number");
|
|
4105
4219
|
return {
|
|
4106
4220
|
...e,
|
|
4107
|
-
[
|
|
4221
|
+
[Wa]: {
|
|
4108
4222
|
maximumDigitWidth: t,
|
|
4109
4223
|
worksheet: n?.worksheet,
|
|
4110
4224
|
projection: n?.projection
|
|
4111
4225
|
}
|
|
4112
4226
|
};
|
|
4113
4227
|
}
|
|
4114
|
-
function
|
|
4115
|
-
let t = e[
|
|
4116
|
-
return delete n[
|
|
4228
|
+
function Ka(e) {
|
|
4229
|
+
let t = e[Wa], n = { ...e };
|
|
4230
|
+
return delete n[Wa], t ? {
|
|
4117
4231
|
opts: n,
|
|
4118
4232
|
layoutMetrics: { maximumDigitWidth: t.maximumDigitWidth },
|
|
4119
4233
|
worksheet: t.worksheet,
|
|
@@ -4122,7 +4236,7 @@ function Fa(e) {
|
|
|
4122
4236
|
}
|
|
4123
4237
|
//#endregion
|
|
4124
4238
|
//#region packages/xlsx/src/workbook.ts
|
|
4125
|
-
var
|
|
4239
|
+
var qa = Symbol("retain-xlsx-viewer-fonts"), Ja = Symbol("prepare-xlsx-viewer-row-heights"), Ya = Symbol("release-xlsx-viewer-projection"), Xa = class e {
|
|
4126
4240
|
metrics = null;
|
|
4127
4241
|
worker;
|
|
4128
4242
|
bridge;
|
|
@@ -4188,7 +4302,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4188
4302
|
s = G(await ge(s, n.password));
|
|
4189
4303
|
let c = s === r;
|
|
4190
4304
|
o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
4191
|
-
let l = a === "worker" ? (await import("./render-worker-host-
|
|
4305
|
+
let l = a === "worker" ? (await import("./render-worker-host-BhMT5U73.js")).createRenderWorker() : new lt(), u;
|
|
4192
4306
|
try {
|
|
4193
4307
|
return u = new e(l, a, n.wasmUrl), u.metrics = o, await u._load(s, n, i.policy, (e) => o.observeUsage(e), c), o.checkpoint("workbook index ready"), o.succeed({ sheets: u.sheetCount }), u;
|
|
4194
4308
|
} catch (e) {
|
|
@@ -4227,14 +4341,14 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4227
4341
|
}
|
|
4228
4342
|
this.ensureWorksheetPullClient();
|
|
4229
4343
|
let s = this.parsedWorkbook?.workbook.parseError;
|
|
4230
|
-
s && console.warn(`[ooxml] xlsx opened with a degraded part: ${s}`), t.useGoogleFonts && (this.googleFontNames = [...
|
|
4344
|
+
s && console.warn(`[ooxml] xlsx opened with a degraded part: ${s}`), t.useGoogleFonts && (this.googleFontNames = [...Ra(this.parsedWorkbook)], typeof document < "u" && document.fonts && await this.retainFontsInSet(document.fonts));
|
|
4231
4345
|
}
|
|
4232
4346
|
async retainFontsInSet(e) {
|
|
4233
4347
|
if (this.googleFontNames.length === 0 || this.fontsDestroyed) return () => void 0;
|
|
4234
4348
|
let t = this.retainedFontSets.get(e);
|
|
4235
4349
|
if (t) t.refs++;
|
|
4236
4350
|
else {
|
|
4237
|
-
let n = Ne(this.googleFontNames,
|
|
4351
|
+
let n = Ne(this.googleFontNames, Ia, e);
|
|
4238
4352
|
t = {
|
|
4239
4353
|
refs: 1,
|
|
4240
4354
|
faces: null,
|
|
@@ -4252,9 +4366,12 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4252
4366
|
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.faces ? Me(r.faces) : r.loading.then(Me)));
|
|
4253
4367
|
};
|
|
4254
4368
|
}
|
|
4255
|
-
async [
|
|
4369
|
+
async [qa](e) {
|
|
4256
4370
|
return await this.retainFontsInSet(e.fonts);
|
|
4257
4371
|
}
|
|
4372
|
+
[Ja](e, t) {
|
|
4373
|
+
this.parsedWorkbook && wi(t, e, this.parsedWorkbook.styles);
|
|
4374
|
+
}
|
|
4258
4375
|
get sheetNames() {
|
|
4259
4376
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
|
|
4260
4377
|
}
|
|
@@ -4393,8 +4510,8 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4393
4510
|
}
|
|
4394
4511
|
async resolveValidationList(e, t) {
|
|
4395
4512
|
if (this.assertResourceHealthy(), !this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
4396
|
-
let n =
|
|
4397
|
-
if (n.kind !== "range") return
|
|
4513
|
+
let n = za(t);
|
|
4514
|
+
if (n.kind !== "range") return Ba(n, () => null);
|
|
4398
4515
|
let r = e;
|
|
4399
4516
|
if (n.sheet) {
|
|
4400
4517
|
let e = this.sheetNames.findIndex((e) => e.toLowerCase() === n.sheet?.toLowerCase());
|
|
@@ -4406,21 +4523,21 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4406
4523
|
}
|
|
4407
4524
|
let i = await this.getWorksheet(r), a = this.parsedWorkbook.styles, o = /* @__PURE__ */ new Map();
|
|
4408
4525
|
for (let e of i.rows) for (let t of e.cells) o.set(`${t.row}:${t.col}`, t);
|
|
4409
|
-
return
|
|
4526
|
+
return Ba(n, (e, t) => {
|
|
4410
4527
|
let n = o.get(`${e}:${t}`);
|
|
4411
|
-
return n ?
|
|
4528
|
+
return n ? Zt(n, a, null, i.date1904) : null;
|
|
4412
4529
|
});
|
|
4413
4530
|
}
|
|
4414
4531
|
cellText(e, t) {
|
|
4415
|
-
return this.parsedWorkbook ?
|
|
4532
|
+
return this.parsedWorkbook ? Zt(t, this.parsedWorkbook.styles, null, e.date1904) : "";
|
|
4416
4533
|
}
|
|
4417
4534
|
async renderViewport(e, t, n, r = {}) {
|
|
4418
4535
|
if (this.assertResourceHealthy(), this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
4419
4536
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
4420
|
-
let i = this.parsedWorkbook.styles, a =
|
|
4537
|
+
let i = this.parsedWorkbook.styles, a = Ka(r), { sizeOverrides: o, ...s } = a.opts;
|
|
4421
4538
|
return this.withWorksheetArchiveOperation(t, (t) => {
|
|
4422
|
-
let r = a.worksheet ??
|
|
4423
|
-
return r !== t &&
|
|
4539
|
+
let r = a.worksheet ?? Ua(t, o);
|
|
4540
|
+
return r !== t && Mi(t, r), a.layoutMetrics && sr.forWorksheet(r, a.layoutMetrics.maximumDigitWidth), Na({
|
|
4424
4541
|
ws: r,
|
|
4425
4542
|
styles: i,
|
|
4426
4543
|
math: this.math,
|
|
@@ -4434,7 +4551,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4434
4551
|
}
|
|
4435
4552
|
async renderViewportToBitmap(e, t, n) {
|
|
4436
4553
|
this.assertResourceHealthy();
|
|
4437
|
-
let r =
|
|
4554
|
+
let r = Ka(n), i = {
|
|
4438
4555
|
...r.opts,
|
|
4439
4556
|
dpr: n.dpr ?? F()
|
|
4440
4557
|
};
|
|
@@ -4453,7 +4570,7 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4453
4570
|
let a = new OffscreenCanvas(1, 1);
|
|
4454
4571
|
return await this.renderViewport(a, e, t, i), a.transferToImageBitmap();
|
|
4455
4572
|
}
|
|
4456
|
-
[
|
|
4573
|
+
[Ya](e) {
|
|
4457
4574
|
this._mode === "worker" && this.bridge.post({
|
|
4458
4575
|
type: "releaseViewProjection",
|
|
4459
4576
|
projectionId: e
|
|
@@ -4492,33 +4609,33 @@ var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-pr
|
|
|
4492
4609
|
};
|
|
4493
4610
|
//#endregion
|
|
4494
4611
|
//#region packages/xlsx/src/data-validation.ts
|
|
4495
|
-
function
|
|
4612
|
+
function Za(e, t, n) {
|
|
4496
4613
|
if (!e) return !1;
|
|
4497
4614
|
for (let r of e.split(/\s+/)) {
|
|
4498
4615
|
if (!r) continue;
|
|
4499
|
-
let [e, i] = r.split(":"), a =
|
|
4616
|
+
let [e, i] = r.split(":"), a = cr(e);
|
|
4500
4617
|
if (!a) continue;
|
|
4501
4618
|
if (!i) {
|
|
4502
4619
|
if (a.row === t && a.col === n) return !0;
|
|
4503
4620
|
continue;
|
|
4504
4621
|
}
|
|
4505
|
-
let o =
|
|
4622
|
+
let o = cr(i);
|
|
4506
4623
|
if (!o) continue;
|
|
4507
4624
|
let s = Math.min(a.row, o.row), c = Math.max(a.row, o.row), l = Math.min(a.col, o.col), u = Math.max(a.col, o.col);
|
|
4508
4625
|
if (t >= s && t <= c && n >= l && n <= u) return !0;
|
|
4509
4626
|
}
|
|
4510
4627
|
return !1;
|
|
4511
4628
|
}
|
|
4512
|
-
function
|
|
4629
|
+
function Qa(e, t, n) {
|
|
4513
4630
|
if (!e) return null;
|
|
4514
|
-
for (let r of e) if (r.validationType === "list" &&
|
|
4631
|
+
for (let r of e) if (r.validationType === "list" && Za(r.sqref, t, n)) return r;
|
|
4515
4632
|
return null;
|
|
4516
4633
|
}
|
|
4517
4634
|
//#endregion
|
|
4518
4635
|
//#region packages/xlsx/src/element-context.ts
|
|
4519
|
-
function
|
|
4636
|
+
function $a(e, t) {
|
|
4520
4637
|
let n = t.colAxis.offsetOf(e.fromCol + 1) + e.fromColOff * t.scale / J, r = t.rowAxis.offsetOf(e.fromRow + 1) + e.fromRowOff * t.scale / J, i, a;
|
|
4521
|
-
if (
|
|
4638
|
+
if (dr(e)) i = e.nativeExtCx * t.scale / J, a = e.nativeExtCy * t.scale / J;
|
|
4522
4639
|
else {
|
|
4523
4640
|
let o = t.colAxis.offsetOf(e.toCol + 1) + e.toColOff * t.scale / J, s = t.rowAxis.offsetOf(e.toRow + 1) + e.toRowOff * t.scale / J;
|
|
4524
4641
|
i = o - n, a = s - r;
|
|
@@ -4526,25 +4643,25 @@ function Va(e, t) {
|
|
|
4526
4643
|
if (i <= 0 || a <= 0) return null;
|
|
4527
4644
|
let o = t.colAxis.offsetOf(t.startCol), s = t.rowAxis.offsetOf(t.startRow);
|
|
4528
4645
|
return {
|
|
4529
|
-
x:
|
|
4646
|
+
x: Sr(t.scrollAreaX + (n - o) - t.scrollOffsetX, i, t.canvasWidth, t.rtl),
|
|
4530
4647
|
y: t.scrollAreaY + (r - s) - t.scrollOffsetY,
|
|
4531
4648
|
width: i,
|
|
4532
4649
|
height: a
|
|
4533
4650
|
};
|
|
4534
4651
|
}
|
|
4535
|
-
function
|
|
4652
|
+
function eo(e, t) {
|
|
4536
4653
|
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
4537
4654
|
}
|
|
4538
|
-
function
|
|
4539
|
-
let n =
|
|
4655
|
+
function to(e, t) {
|
|
4656
|
+
let n = Sr(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
4540
4657
|
return e.x + e.width >= n && e.x <= n + t.scrollAreaW && e.y + e.height >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
4541
4658
|
}
|
|
4542
|
-
function
|
|
4543
|
-
let n =
|
|
4659
|
+
function no(e, t) {
|
|
4660
|
+
let n = Sr(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
4544
4661
|
return e.x >= n && e.x <= n + t.scrollAreaW && e.y >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
4545
4662
|
}
|
|
4546
|
-
function
|
|
4547
|
-
let n =
|
|
4663
|
+
function ro(e, t) {
|
|
4664
|
+
let n = Q(e), r = t.cellScale, { col: i, row: a } = n.axesAtScale(r), o = Math.round(50 * r), s = Math.round(22 * r), c = i.bandsToCover(1, t.freezeCols, Math.max(0, t.width - o)), l = a.bandsToCover(1, t.freezeRows, Math.max(0, t.height - s)), u = c.reduce((e, t) => e + t.size, 0), d = l.reduce((e, t) => e + t.size, 0);
|
|
4548
4665
|
return {
|
|
4549
4666
|
colAxis: i,
|
|
4550
4667
|
rowAxis: a,
|
|
@@ -4561,11 +4678,11 @@ function Ga(e, t) {
|
|
|
4561
4678
|
canvasWidth: t.width
|
|
4562
4679
|
};
|
|
4563
4680
|
}
|
|
4564
|
-
function
|
|
4565
|
-
let r =
|
|
4681
|
+
function io(e, t, n) {
|
|
4682
|
+
let r = ro(e, n), i, a = 0;
|
|
4566
4683
|
if (i = t.elementType === "chart" ? e.charts[t.elementIndex] : t.elementType === "image" ? e.images[t.elementIndex] : (e.shapeGroups ?? [])[t.elementIndex], !i) return null;
|
|
4567
|
-
let o =
|
|
4568
|
-
if (!o || !
|
|
4684
|
+
let o = $a(i, r);
|
|
4685
|
+
if (!o || !to(o, r)) return null;
|
|
4569
4686
|
if (t.elementType === "shape") {
|
|
4570
4687
|
let n = (e.shapeGroups ?? [])[t.elementIndex], r = t.shapeIndex === void 0 ? void 0 : n?.shapes[t.shapeIndex];
|
|
4571
4688
|
r && (o = {
|
|
@@ -4575,7 +4692,7 @@ function Ka(e, t, n) {
|
|
|
4575
4692
|
height: r.h * o.height
|
|
4576
4693
|
}, a = r.rot);
|
|
4577
4694
|
}
|
|
4578
|
-
let s =
|
|
4695
|
+
let s = Sr(r.scrollAreaX, r.scrollAreaW, r.canvasWidth, r.rtl);
|
|
4579
4696
|
return {
|
|
4580
4697
|
rect: o,
|
|
4581
4698
|
clip: {
|
|
@@ -4587,7 +4704,7 @@ function Ka(e, t, n) {
|
|
|
4587
4704
|
rotation: a
|
|
4588
4705
|
};
|
|
4589
4706
|
}
|
|
4590
|
-
function
|
|
4707
|
+
function ao(e) {
|
|
4591
4708
|
return {
|
|
4592
4709
|
from: {
|
|
4593
4710
|
row: e.fromRow + 1,
|
|
@@ -4603,7 +4720,7 @@ function qa(e) {
|
|
|
4603
4720
|
}
|
|
4604
4721
|
};
|
|
4605
4722
|
}
|
|
4606
|
-
function
|
|
4723
|
+
function oo(e, t) {
|
|
4607
4724
|
let n = Math.min(e.length, t);
|
|
4608
4725
|
if (n > 0 && n < e.length) {
|
|
4609
4726
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -4611,7 +4728,7 @@ function Ja(e, t) {
|
|
|
4611
4728
|
}
|
|
4612
4729
|
return e.slice(0, n);
|
|
4613
4730
|
}
|
|
4614
|
-
function
|
|
4731
|
+
function so(e, t) {
|
|
4615
4732
|
if (!e.text) return {
|
|
4616
4733
|
truncated: !1,
|
|
4617
4734
|
textCharacters: 0
|
|
@@ -4626,7 +4743,7 @@ function Ya(e, t) {
|
|
|
4626
4743
|
n.push("\n"), r++;
|
|
4627
4744
|
}
|
|
4628
4745
|
for (let e of o.runs) {
|
|
4629
|
-
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o =
|
|
4746
|
+
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o = oo(a, Math.max(0, t - r));
|
|
4630
4747
|
if (n.push(o), r += o.length, o.length < a.length) {
|
|
4631
4748
|
i = !0;
|
|
4632
4749
|
break;
|
|
@@ -4640,7 +4757,7 @@ function Ya(e, t) {
|
|
|
4640
4757
|
textCharacters: r
|
|
4641
4758
|
};
|
|
4642
4759
|
}
|
|
4643
|
-
function
|
|
4760
|
+
function co(e, t, n, r, i, a, o, s) {
|
|
4644
4761
|
return {
|
|
4645
4762
|
format: "xlsx",
|
|
4646
4763
|
kind: "element",
|
|
@@ -4648,7 +4765,7 @@ function Xa(e, t, n, r, i, a, o, s) {
|
|
|
4648
4765
|
sheetName: e.name,
|
|
4649
4766
|
elementType: n,
|
|
4650
4767
|
elementIndex: r,
|
|
4651
|
-
anchor:
|
|
4768
|
+
anchor: ao(i),
|
|
4652
4769
|
...a === void 0 ? {} : { text: a },
|
|
4653
4770
|
truncated: o,
|
|
4654
4771
|
truncationReasons: o ? ["text"] : [],
|
|
@@ -4656,19 +4773,19 @@ function Xa(e, t, n, r, i, a, o, s) {
|
|
|
4656
4773
|
maxTextCharacters: s
|
|
4657
4774
|
};
|
|
4658
4775
|
}
|
|
4659
|
-
function
|
|
4776
|
+
function lo(e, t, n, r, i) {
|
|
4660
4777
|
for (let a = e.charts.length - 1; a >= 0; a--) {
|
|
4661
|
-
let o = e.charts[a], s =
|
|
4662
|
-
if (!s || !
|
|
4778
|
+
let o = e.charts[a], s = $a(o, r);
|
|
4779
|
+
if (!s || !to(s, r) || !eo(n, s)) continue;
|
|
4663
4780
|
let c = q(o.chart, i);
|
|
4664
4781
|
return {
|
|
4665
|
-
...
|
|
4782
|
+
...co(e, t, "chart", a, o, c.text, c.truncated, c.maxTextCharacters),
|
|
4666
4783
|
seriesCount: o.chart.series.length
|
|
4667
4784
|
};
|
|
4668
4785
|
}
|
|
4669
4786
|
return null;
|
|
4670
4787
|
}
|
|
4671
|
-
function
|
|
4788
|
+
function uo(e, t, n) {
|
|
4672
4789
|
let r = {
|
|
4673
4790
|
x: t.x + n.x * t.width,
|
|
4674
4791
|
y: t.y + n.y * t.height,
|
|
@@ -4680,21 +4797,21 @@ function Qa(e, t, n) {
|
|
|
4680
4797
|
y: u
|
|
4681
4798
|
};
|
|
4682
4799
|
}
|
|
4683
|
-
function
|
|
4800
|
+
function fo(e, t, n, r, i) {
|
|
4684
4801
|
let a = e.shapeGroups ?? [];
|
|
4685
4802
|
for (let o = a.length - 1; o >= 0; o--) {
|
|
4686
|
-
let s = a[o], c =
|
|
4687
|
-
if (!(!c || !
|
|
4803
|
+
let s = a[o], c = $a(s, r);
|
|
4804
|
+
if (!(!c || !to(c, r))) for (let r = s.shapes.length - 1; r >= 0; r--) {
|
|
4688
4805
|
let a = s.shapes[r];
|
|
4689
|
-
if (!
|
|
4806
|
+
if (!eo(uo(n, c, a), {
|
|
4690
4807
|
x: c.x + a.x * c.width,
|
|
4691
4808
|
y: c.y + a.y * c.height,
|
|
4692
4809
|
width: a.w * c.width,
|
|
4693
4810
|
height: a.h * c.height
|
|
4694
4811
|
})) continue;
|
|
4695
|
-
let l =
|
|
4812
|
+
let l = so(a, i);
|
|
4696
4813
|
return {
|
|
4697
|
-
...
|
|
4814
|
+
...co(e, t, "shape", o, s, l.text, l.truncated, i),
|
|
4698
4815
|
shapeIndex: r,
|
|
4699
4816
|
shapeCount: s.shapes.length,
|
|
4700
4817
|
...a.geom.type === "image" ? { mimeType: a.geom.mimeType } : {}
|
|
@@ -4703,26 +4820,26 @@ function $a(e, t, n, r, i) {
|
|
|
4703
4820
|
}
|
|
4704
4821
|
return null;
|
|
4705
4822
|
}
|
|
4706
|
-
function
|
|
4823
|
+
function po(e, t, n, r, i) {
|
|
4707
4824
|
for (let a = e.images.length - 1; a >= 0; a--) {
|
|
4708
|
-
let o = e.images[a], s =
|
|
4709
|
-
if (!(!s || !
|
|
4710
|
-
...
|
|
4825
|
+
let o = e.images[a], s = $a(o, r);
|
|
4826
|
+
if (!(!s || !to(s, r) || !eo(n, s))) return {
|
|
4827
|
+
...co(e, t, "image", a, o, void 0, !1, i),
|
|
4711
4828
|
mimeType: o.svgImagePath ? "image/svg+xml" : o.mimeType
|
|
4712
4829
|
};
|
|
4713
4830
|
}
|
|
4714
4831
|
return null;
|
|
4715
4832
|
}
|
|
4716
|
-
function
|
|
4833
|
+
function mo(e, t, n, r, i = De) {
|
|
4717
4834
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) throw RangeError("XLSX hit-test point must contain finite coordinates.");
|
|
4718
4835
|
if (!Number.isFinite(i) || i < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
4719
|
-
let a = Math.min(De, Math.floor(i)), o =
|
|
4720
|
-
return
|
|
4836
|
+
let a = Math.min(De, Math.floor(i)), o = ro(e, r);
|
|
4837
|
+
return no(n, o) ? lo(e, t, n, o, a) ?? fo(e, t, n, o, a) ?? po(e, t, n, o, a) : null;
|
|
4721
4838
|
}
|
|
4722
|
-
function
|
|
4839
|
+
function ho(e, t) {
|
|
4723
4840
|
let n = t ?? e.maxTextCharacters;
|
|
4724
4841
|
if (!Number.isFinite(n) || n < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
4725
|
-
let r = Math.min(De, Math.floor(n)), i = e.text === void 0 ? void 0 :
|
|
4842
|
+
let r = Math.min(De, Math.floor(n)), i = e.text === void 0 ? void 0 : oo(e.text, r), a = e.truncated || e.text !== void 0 && i.length < e.text.length;
|
|
4726
4843
|
return {
|
|
4727
4844
|
...structuredClone(e),
|
|
4728
4845
|
...i === void 0 ? {} : { text: i },
|
|
@@ -4734,17 +4851,17 @@ function no(e, t) {
|
|
|
4734
4851
|
}
|
|
4735
4852
|
//#endregion
|
|
4736
4853
|
//#region packages/xlsx/src/selection.ts
|
|
4737
|
-
var
|
|
4738
|
-
function
|
|
4739
|
-
return e.areas.reduce((e, t) => e + (t.kind === "cells" ? (t.bottom - t.top + 1) * (t.right - t.left + 1) : t.kind === "rows" ? (t.lastRow - t.firstRow + 1) *
|
|
4854
|
+
var go = 128, _o = 1e4, vo = 8 * 1024 * 1024;
|
|
4855
|
+
function yo(e) {
|
|
4856
|
+
return e.areas.reduce((e, t) => e + (t.kind === "cells" ? (t.bottom - t.top + 1) * (t.right - t.left + 1) : t.kind === "rows" ? (t.lastRow - t.firstRow + 1) * Z : t.kind === "columns" ? (t.lastColumn - t.firstColumn + 1) * or : or * Z), 0);
|
|
4740
4857
|
}
|
|
4741
|
-
function
|
|
4858
|
+
function bo(e, t) {
|
|
4742
4859
|
return Number.isInteger(e) && e >= 1 && e <= t;
|
|
4743
4860
|
}
|
|
4744
|
-
function
|
|
4861
|
+
function xo(e) {
|
|
4745
4862
|
switch (e.kind) {
|
|
4746
4863
|
case "cells":
|
|
4747
|
-
if (!
|
|
4864
|
+
if (!bo(e.top, 1048576) || !bo(e.bottom, 1048576) || !bo(e.left, 16384) || !bo(e.right, 16384)) throw RangeError("Cell selection bounds must be inside the XLSX grid.");
|
|
4748
4865
|
return {
|
|
4749
4866
|
kind: "cells",
|
|
4750
4867
|
top: Math.min(e.top, e.bottom),
|
|
@@ -4753,14 +4870,14 @@ function co(e) {
|
|
|
4753
4870
|
right: Math.max(e.left, e.right)
|
|
4754
4871
|
};
|
|
4755
4872
|
case "rows":
|
|
4756
|
-
if (!
|
|
4873
|
+
if (!bo(e.firstRow, 1048576) || !bo(e.lastRow, 1048576)) throw RangeError("Row selection bounds must be inside the XLSX grid.");
|
|
4757
4874
|
return {
|
|
4758
4875
|
kind: "rows",
|
|
4759
4876
|
firstRow: Math.min(e.firstRow, e.lastRow),
|
|
4760
4877
|
lastRow: Math.max(e.firstRow, e.lastRow)
|
|
4761
4878
|
};
|
|
4762
4879
|
case "columns":
|
|
4763
|
-
if (!
|
|
4880
|
+
if (!bo(e.firstColumn, 16384) || !bo(e.lastColumn, 16384)) throw RangeError("Column selection bounds must be inside the XLSX grid.");
|
|
4764
4881
|
return {
|
|
4765
4882
|
kind: "columns",
|
|
4766
4883
|
firstColumn: Math.min(e.firstColumn, e.lastColumn),
|
|
@@ -4769,7 +4886,7 @@ function co(e) {
|
|
|
4769
4886
|
case "sheet": return { kind: "sheet" };
|
|
4770
4887
|
}
|
|
4771
4888
|
}
|
|
4772
|
-
function
|
|
4889
|
+
function So(e, t) {
|
|
4773
4890
|
switch (e.kind) {
|
|
4774
4891
|
case "cells": return t.row >= e.top && t.row <= e.bottom && t.col >= e.left && t.col <= e.right;
|
|
4775
4892
|
case "rows": return t.row >= e.firstRow && t.row <= e.lastRow;
|
|
@@ -4777,25 +4894,25 @@ function lo(e, t) {
|
|
|
4777
4894
|
case "sheet": return !0;
|
|
4778
4895
|
}
|
|
4779
4896
|
}
|
|
4780
|
-
function
|
|
4781
|
-
if (!
|
|
4897
|
+
function Co(e, t) {
|
|
4898
|
+
if (!bo(e.row, 1048576) || !bo(e.col, 16384)) throw RangeError(`${t} must be inside the XLSX grid.`);
|
|
4782
4899
|
return {
|
|
4783
4900
|
row: e.row,
|
|
4784
4901
|
col: e.col
|
|
4785
4902
|
};
|
|
4786
4903
|
}
|
|
4787
|
-
function
|
|
4904
|
+
function wo(e) {
|
|
4788
4905
|
if (!Array.isArray(e.areas) || e.areas.length === 0) throw TypeError("A selection must contain at least one area.");
|
|
4789
4906
|
if (e.areas.length > 128) throw RangeError("A selection may contain at most 128 areas.");
|
|
4790
4907
|
if (!Number.isInteger(e.activeAreaIndex) || e.activeAreaIndex < 0 || e.activeAreaIndex >= e.areas.length) throw RangeError("activeAreaIndex must identify an area in the selection.");
|
|
4791
|
-
let t = e.areas.map(
|
|
4908
|
+
let t = e.areas.map(xo), n = [], r = /* @__PURE__ */ new Map(), i = 0;
|
|
4792
4909
|
for (let a = 0; a < t.length; a++) {
|
|
4793
4910
|
let o = t[a], s = o.kind === "cells" ? `c:${o.top}:${o.left}:${o.bottom}:${o.right}` : o.kind === "rows" ? `r:${o.firstRow}:${o.lastRow}` : o.kind === "columns" ? `k:${o.firstColumn}:${o.lastColumn}` : "s", c = r.get(s);
|
|
4794
4911
|
c === void 0 && (c = n.length, r.set(s, c), n.push(o)), a === e.activeAreaIndex && (i = c);
|
|
4795
4912
|
}
|
|
4796
|
-
let a =
|
|
4797
|
-
if (!
|
|
4798
|
-
if (!
|
|
4913
|
+
let a = Co(e.activeCell, "activeCell"), o = Co(e.extensionAnchor, "extensionAnchor"), s = n[i];
|
|
4914
|
+
if (!So(s, a)) throw RangeError("activeCell must be inside the active selection area.");
|
|
4915
|
+
if (!So(s, o)) throw RangeError("extensionAnchor must be inside the active selection area.");
|
|
4799
4916
|
return {
|
|
4800
4917
|
areas: n,
|
|
4801
4918
|
activeAreaIndex: i,
|
|
@@ -4803,16 +4920,16 @@ function fo(e) {
|
|
|
4803
4920
|
extensionAnchor: o
|
|
4804
4921
|
};
|
|
4805
4922
|
}
|
|
4806
|
-
function
|
|
4923
|
+
function To(e) {
|
|
4807
4924
|
let t = 0;
|
|
4808
4925
|
for (let n of e) t = t * 26 + n.charCodeAt(0) - 64;
|
|
4809
4926
|
return t >= 1 && t <= 16384 ? t : null;
|
|
4810
4927
|
}
|
|
4811
|
-
function
|
|
4928
|
+
function Eo(e) {
|
|
4812
4929
|
let t = e.trim().toUpperCase(), n = /^\$?(\d+):\$?(\d+)$/.exec(t);
|
|
4813
4930
|
if (n) {
|
|
4814
4931
|
let e = Number(n[1]), t = Number(n[2]);
|
|
4815
|
-
if (!
|
|
4932
|
+
if (!bo(e, 1048576) || !bo(t, 1048576)) return null;
|
|
4816
4933
|
let r = Math.min(e, t);
|
|
4817
4934
|
return {
|
|
4818
4935
|
areas: [{
|
|
@@ -4833,7 +4950,7 @@ function mo(e) {
|
|
|
4833
4950
|
}
|
|
4834
4951
|
let r = /^\$?([A-Z]+):\$?([A-Z]+)$/.exec(t);
|
|
4835
4952
|
if (r) {
|
|
4836
|
-
let e =
|
|
4953
|
+
let e = To(r[1]), t = To(r[2]);
|
|
4837
4954
|
if (e === null || t === null) return null;
|
|
4838
4955
|
let n = Math.min(e, t);
|
|
4839
4956
|
return {
|
|
@@ -4855,7 +4972,7 @@ function mo(e) {
|
|
|
4855
4972
|
}
|
|
4856
4973
|
let i = t.split(":");
|
|
4857
4974
|
if (i.length > 2) return null;
|
|
4858
|
-
let a =
|
|
4975
|
+
let a = cr(i[0]), o = i.length === 2 ? cr(i[1]) : a;
|
|
4859
4976
|
if (!a || !o) return null;
|
|
4860
4977
|
let s = {
|
|
4861
4978
|
kind: "cells",
|
|
@@ -4874,12 +4991,12 @@ function mo(e) {
|
|
|
4874
4991
|
extensionAnchor: c
|
|
4875
4992
|
};
|
|
4876
4993
|
}
|
|
4877
|
-
function
|
|
4994
|
+
function Do(e, t) {
|
|
4878
4995
|
return e === t ? !0 : !e || !t || e.activeAreaIndex !== t.activeAreaIndex || e.areas.length !== t.areas.length || e.activeCell.row !== t.activeCell.row || e.activeCell.col !== t.activeCell.col || e.extensionAnchor.row !== t.extensionAnchor.row || e.extensionAnchor.col !== t.extensionAnchor.col ? !1 : e.areas.every((e, n) => JSON.stringify(e) === JSON.stringify(t.areas[n]));
|
|
4879
4996
|
}
|
|
4880
4997
|
//#endregion
|
|
4881
4998
|
//#region packages/xlsx/src/find.ts
|
|
4882
|
-
var
|
|
4999
|
+
var Oo = class {
|
|
4883
5000
|
_matches = [];
|
|
4884
5001
|
_active = -1;
|
|
4885
5002
|
_generation = 0;
|
|
@@ -4909,7 +5026,7 @@ var go = class {
|
|
|
4909
5026
|
return t ? {
|
|
4910
5027
|
sheet: t.sheet,
|
|
4911
5028
|
sheetName: t.sheetName,
|
|
4912
|
-
ref:
|
|
5029
|
+
ref: lr(t.row, t.col),
|
|
4913
5030
|
row: t.row,
|
|
4914
5031
|
col: t.col
|
|
4915
5032
|
} : null;
|
|
@@ -4969,7 +5086,7 @@ var go = class {
|
|
|
4969
5086
|
} : null;
|
|
4970
5087
|
}
|
|
4971
5088
|
};
|
|
4972
|
-
function
|
|
5089
|
+
function ko(e) {
|
|
4973
5090
|
let { cell: t, popup: n, viewport: r, rtl: i } = e, a = t.x + t.w + 8, o = t.x - 8 - n.w, s = a + n.w <= r.w, c = o >= 0, l;
|
|
4974
5091
|
l = i ? c ? o : s ? a : o : s ? a : c ? o : a, l = Math.max(0, Math.min(l, r.w - n.w));
|
|
4975
5092
|
let u = t.y;
|
|
@@ -4978,13 +5095,13 @@ function _o(e) {
|
|
|
4978
5095
|
top: u
|
|
4979
5096
|
};
|
|
4980
5097
|
}
|
|
4981
|
-
function
|
|
5098
|
+
function Ao(e) {
|
|
4982
5099
|
return 8 + (e - 1) * 14;
|
|
4983
5100
|
}
|
|
4984
|
-
function
|
|
5101
|
+
function jo(e) {
|
|
4985
5102
|
return e > 0 ? (e + 1) * 19 : 0;
|
|
4986
5103
|
}
|
|
4987
|
-
function
|
|
5104
|
+
function Mo(e, t, n, r, i, a, o, s, c = !1) {
|
|
4988
5105
|
if (e === "row") {
|
|
4989
5106
|
let e = Math.min(s, i + a), c = Math.min(s, i), l = s;
|
|
4990
5107
|
return r > 0 && n <= r ? l = e : r > 0 && t > r && (c = e), {
|
|
@@ -5011,7 +5128,7 @@ function bo(e, t, n, r, i, a, o, s, c = !1) {
|
|
|
5011
5128
|
h: s
|
|
5012
5129
|
};
|
|
5013
5130
|
}
|
|
5014
|
-
function
|
|
5131
|
+
function No(e, t, n, r, i) {
|
|
5015
5132
|
let a = Math.min(n, r), o = Math.max(n, r);
|
|
5016
5133
|
return e === "row" ? [{
|
|
5017
5134
|
x1: t,
|
|
@@ -5035,7 +5152,7 @@ function xo(e, t, n, r, i) {
|
|
|
5035
5152
|
y2: t + i / 2
|
|
5036
5153
|
}];
|
|
5037
5154
|
}
|
|
5038
|
-
function
|
|
5155
|
+
function Po(e, t) {
|
|
5039
5156
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
5040
5157
|
for (let t of e) t.level > 0 && n.set(t.index, t.level), t.collapsed && r.set(t.index, !0), t.index > i && (i = t.index), t.level > a && (a = t.level);
|
|
5041
5158
|
let o = i, s = [];
|
|
@@ -5049,15 +5166,15 @@ function So(e, t) {
|
|
|
5049
5166
|
for (let i = 1; i <= o + 1; i++) c(i) >= e ? n ? n.end = i : n = {
|
|
5050
5167
|
start: i,
|
|
5051
5168
|
end: i
|
|
5052
|
-
} : n &&= (s.push(
|
|
5053
|
-
n && s.push(
|
|
5169
|
+
} : n &&= (s.push(Fo(e, n, t, r, c)), null);
|
|
5170
|
+
n && s.push(Fo(e, n, t, r, c));
|
|
5054
5171
|
}
|
|
5055
5172
|
return {
|
|
5056
5173
|
maxLevel: a,
|
|
5057
5174
|
groups: s
|
|
5058
5175
|
};
|
|
5059
5176
|
}
|
|
5060
|
-
function
|
|
5177
|
+
function Fo(e, t, n, r, i) {
|
|
5061
5178
|
let a = null;
|
|
5062
5179
|
if (n) {
|
|
5063
5180
|
let n = t.end + 1;
|
|
@@ -5075,7 +5192,7 @@ function Co(e, t, n, r, i) {
|
|
|
5075
5192
|
collapsed: o
|
|
5076
5193
|
};
|
|
5077
5194
|
}
|
|
5078
|
-
function
|
|
5195
|
+
function Io(e, t) {
|
|
5079
5196
|
let n = !e.collapsed, r = /* @__PURE__ */ new Map();
|
|
5080
5197
|
for (let e of t) r.set(e.index, e);
|
|
5081
5198
|
let i = [], a = [];
|
|
@@ -5083,7 +5200,7 @@ function wo(e, t) {
|
|
|
5083
5200
|
else {
|
|
5084
5201
|
let n = /* @__PURE__ */ new Set();
|
|
5085
5202
|
for (let r of t) r.index >= e.start && r.index <= e.end && r.collapsed && n.add(r.index);
|
|
5086
|
-
for (let t = e.start; t <= e.end; t++)
|
|
5203
|
+
for (let t = e.start; t <= e.end; t++) Lo(t, e, r, n) || a.push(t);
|
|
5087
5204
|
}
|
|
5088
5205
|
return {
|
|
5089
5206
|
hide: i,
|
|
@@ -5091,7 +5208,7 @@ function wo(e, t) {
|
|
|
5091
5208
|
nowCollapsed: n
|
|
5092
5209
|
};
|
|
5093
5210
|
}
|
|
5094
|
-
function
|
|
5211
|
+
function Lo(e, t, n, r) {
|
|
5095
5212
|
let i = n.get(e)?.level ?? 0;
|
|
5096
5213
|
if (i <= t.level) return !1;
|
|
5097
5214
|
for (let e of r) {
|
|
@@ -5100,7 +5217,7 @@ function To(e, t, n, r) {
|
|
|
5100
5217
|
}
|
|
5101
5218
|
return !1;
|
|
5102
5219
|
}
|
|
5103
|
-
function
|
|
5220
|
+
function Ro(e, t) {
|
|
5104
5221
|
let n = [], r = [];
|
|
5105
5222
|
for (let i of e) i.level >= t ? n.push(i.index) : r.push(i.index);
|
|
5106
5223
|
return {
|
|
@@ -5108,7 +5225,7 @@ function Eo(e, t) {
|
|
|
5108
5225
|
show: r
|
|
5109
5226
|
};
|
|
5110
5227
|
}
|
|
5111
|
-
function
|
|
5228
|
+
function zo(e) {
|
|
5112
5229
|
let t = [];
|
|
5113
5230
|
for (let n of e.rows) {
|
|
5114
5231
|
let e = n.outlineLevel ?? 0, r = n.collapsed ?? !1;
|
|
@@ -5121,7 +5238,7 @@ function Do(e) {
|
|
|
5121
5238
|
}
|
|
5122
5239
|
return t;
|
|
5123
5240
|
}
|
|
5124
|
-
function
|
|
5241
|
+
function Bo(e) {
|
|
5125
5242
|
let t = e.colOutlineLevels ?? {}, n = e.colCollapsed ?? {}, r = e.colHidden ?? {}, i = /* @__PURE__ */ new Set();
|
|
5126
5243
|
for (let e of Object.keys(t)) i.add(Number(e));
|
|
5127
5244
|
for (let e of Object.keys(n)) i.add(Number(e));
|
|
@@ -5134,13 +5251,13 @@ function Oo(e) {
|
|
|
5134
5251
|
});
|
|
5135
5252
|
return a;
|
|
5136
5253
|
}
|
|
5137
|
-
function
|
|
5254
|
+
function Vo(e, t) {
|
|
5138
5255
|
let n = e.outlinePr;
|
|
5139
5256
|
return n ? t === "row" ? n.summaryBelow : n.summaryRight : !0;
|
|
5140
5257
|
}
|
|
5141
5258
|
//#endregion
|
|
5142
5259
|
//#region packages/xlsx/src/internal/sheet-viewer-runtime.ts
|
|
5143
|
-
var
|
|
5260
|
+
var Ho = class {
|
|
5144
5261
|
owner = new ve("SheetAcquisition");
|
|
5145
5262
|
get current() {
|
|
5146
5263
|
return this.owner.current;
|
|
@@ -5155,7 +5272,7 @@ var Ao = class {
|
|
|
5155
5272
|
this.owner.close();
|
|
5156
5273
|
}
|
|
5157
5274
|
};
|
|
5158
|
-
function
|
|
5275
|
+
function Uo(e) {
|
|
5159
5276
|
return {
|
|
5160
5277
|
...e,
|
|
5161
5278
|
rows: e.rows.map((e) => ({ ...e })),
|
|
@@ -5164,7 +5281,7 @@ function jo(e) {
|
|
|
5164
5281
|
colCollapsed: e.colCollapsed ? { ...e.colCollapsed } : void 0
|
|
5165
5282
|
};
|
|
5166
5283
|
}
|
|
5167
|
-
var
|
|
5284
|
+
var Wo = class {
|
|
5168
5285
|
offsetX = 0;
|
|
5169
5286
|
offsetY = 0;
|
|
5170
5287
|
contentWidth = 0;
|
|
@@ -5210,7 +5327,7 @@ var Mo = class {
|
|
|
5210
5327
|
reset() {
|
|
5211
5328
|
this.offsetX = 0, this.offsetY = 0;
|
|
5212
5329
|
}
|
|
5213
|
-
},
|
|
5330
|
+
}, Go = class {
|
|
5214
5331
|
animationFrame = null;
|
|
5215
5332
|
activeRender = !1;
|
|
5216
5333
|
pendingRender = null;
|
|
@@ -5275,7 +5392,7 @@ var Mo = class {
|
|
|
5275
5392
|
destroy() {
|
|
5276
5393
|
this.destroyed || (this.destroyed = !0, this.pendingRender = null, this.animationFrame !== null && this.frameScheduler && (this.frameScheduler.cancelAnimationFrame(this.animationFrame), this.animationFrame = null), this.staticDispatcher?.destroy(), this.generation++);
|
|
5277
5394
|
}
|
|
5278
|
-
},
|
|
5395
|
+
}, Ko = class {
|
|
5279
5396
|
state = null;
|
|
5280
5397
|
dragPointerId = null;
|
|
5281
5398
|
get anchor() {
|
|
@@ -5307,10 +5424,10 @@ var Mo = class {
|
|
|
5307
5424
|
this.state = null, this.dragPointerId = null;
|
|
5308
5425
|
}
|
|
5309
5426
|
setState(e) {
|
|
5310
|
-
this.state = e ?
|
|
5427
|
+
this.state = e ? wo(e) : null;
|
|
5311
5428
|
}
|
|
5312
5429
|
select(e, t = "cells") {
|
|
5313
|
-
this.state =
|
|
5430
|
+
this.state = wo({
|
|
5314
5431
|
areas: [t === "rows" ? {
|
|
5315
5432
|
kind: "rows",
|
|
5316
5433
|
firstRow: e.row,
|
|
@@ -5333,8 +5450,8 @@ var Mo = class {
|
|
|
5333
5450
|
}
|
|
5334
5451
|
add(e, t = "cells") {
|
|
5335
5452
|
if (!this.state) return this.select(e, t), !0;
|
|
5336
|
-
let n = this.state.areas.findIndex((n) => (t === "rows" ? n.kind === "rows" : t === "cols" ? n.kind === "columns" : t === "all" ? n.kind === "sheet" : n.kind === "cells") &&
|
|
5337
|
-
if (n >= 0) return this.state =
|
|
5453
|
+
let n = this.state.areas.findIndex((n) => (t === "rows" ? n.kind === "rows" : t === "cols" ? n.kind === "columns" : t === "all" ? n.kind === "sheet" : n.kind === "cells") && So(n, e));
|
|
5454
|
+
if (n >= 0) return this.state = wo({
|
|
5338
5455
|
...this.state,
|
|
5339
5456
|
activeAreaIndex: n,
|
|
5340
5457
|
activeCell: e,
|
|
@@ -5356,7 +5473,7 @@ var Mo = class {
|
|
|
5356
5473
|
bottom: e.row,
|
|
5357
5474
|
right: e.col
|
|
5358
5475
|
}, i = [...this.state.areas, r];
|
|
5359
|
-
return this.state =
|
|
5476
|
+
return this.state = wo({
|
|
5360
5477
|
areas: i,
|
|
5361
5478
|
activeAreaIndex: i.length - 1,
|
|
5362
5479
|
activeCell: e,
|
|
@@ -5385,7 +5502,7 @@ var Mo = class {
|
|
|
5385
5502
|
bottom: Math.max(t.row, e.row),
|
|
5386
5503
|
right: Math.max(t.col, e.col)
|
|
5387
5504
|
}, i = [...this.state.areas];
|
|
5388
|
-
i[this.state.activeAreaIndex] = r, this.state =
|
|
5505
|
+
i[this.state.activeAreaIndex] = r, this.state = wo({
|
|
5389
5506
|
...this.state,
|
|
5390
5507
|
areas: i
|
|
5391
5508
|
});
|
|
@@ -5451,7 +5568,7 @@ var Mo = class {
|
|
|
5451
5568
|
};
|
|
5452
5569
|
}
|
|
5453
5570
|
}
|
|
5454
|
-
},
|
|
5571
|
+
}, qo = class {
|
|
5455
5572
|
cleanups = [];
|
|
5456
5573
|
ownerDocument;
|
|
5457
5574
|
ownerWindow;
|
|
@@ -5486,7 +5603,7 @@ var Mo = class {
|
|
|
5486
5603
|
destroy() {
|
|
5487
5604
|
for (let e of this.cleanups.splice(0)) e();
|
|
5488
5605
|
}
|
|
5489
|
-
},
|
|
5606
|
+
}, Jo = class {
|
|
5490
5607
|
selection;
|
|
5491
5608
|
find;
|
|
5492
5609
|
comment;
|
|
@@ -5520,17 +5637,17 @@ var Mo = class {
|
|
|
5520
5637
|
this.validation.style.left = `${e}px`, this.validation.style.top = `${t}px`, this.validation.style.display = "block";
|
|
5521
5638
|
}
|
|
5522
5639
|
};
|
|
5523
|
-
function
|
|
5640
|
+
function Yo(e, t) {
|
|
5524
5641
|
if (t <= 0) return 0;
|
|
5525
5642
|
let n = Math.min(40, t / 2);
|
|
5526
5643
|
return e < n ? -900 * Math.min(1, Math.max(0, (n - e) / n)) : e > t - n ? 900 * Math.min(1, Math.max(0, (e - (t - n)) / n)) : 0;
|
|
5527
5644
|
}
|
|
5528
|
-
function
|
|
5645
|
+
function Xo(e, t, n, r) {
|
|
5529
5646
|
if (r === "all") return {
|
|
5530
5647
|
x: 0,
|
|
5531
5648
|
y: 0
|
|
5532
5649
|
};
|
|
5533
|
-
let i = r === "rows" ? 0 :
|
|
5650
|
+
let i = r === "rows" ? 0 : Yo(e.x, t.width), a = r === "cols" ? 0 : Yo(e.y, t.height);
|
|
5534
5651
|
return {
|
|
5535
5652
|
x: n ? -i : i,
|
|
5536
5653
|
y: a
|
|
@@ -5538,7 +5655,7 @@ function Ro(e, t, n, r) {
|
|
|
5538
5655
|
}
|
|
5539
5656
|
//#endregion
|
|
5540
5657
|
//#region packages/xlsx/src/internal/worksheet-content-bounds.ts
|
|
5541
|
-
function
|
|
5658
|
+
function Zo(e) {
|
|
5542
5659
|
let t = Math.max(50, e.freezeRows ?? 0), n = Math.max(26, e.freezeCols ?? 0);
|
|
5543
5660
|
for (let r of e.rows) {
|
|
5544
5661
|
r.index > t && (t = r.index);
|
|
@@ -5555,19 +5672,19 @@ function zo(e) {
|
|
|
5555
5672
|
t = Math.max(t, r, i), n = Math.max(n, a, o);
|
|
5556
5673
|
}
|
|
5557
5674
|
return {
|
|
5558
|
-
maxRow: Math.min(
|
|
5559
|
-
maxCol: Math.min(
|
|
5675
|
+
maxRow: Math.min(or, t),
|
|
5676
|
+
maxCol: Math.min(Z, n)
|
|
5560
5677
|
};
|
|
5561
5678
|
}
|
|
5562
5679
|
//#endregion
|
|
5563
5680
|
//#region packages/xlsx/src/viewer.ts
|
|
5564
|
-
var
|
|
5565
|
-
function
|
|
5566
|
-
if (!e.head || e.head.querySelector(`style[${
|
|
5681
|
+
var Qo = Symbol("XlsxViewer.borrowedWorkbook"), $o = 150, es = 280, ts = 200, ns = 240, rs = 200, is = 30, as = 50, os = 1, ss = 1, cs = .45, ls = "data-xlsx-viewer-styles", us = ".xlsx-tab-strip::-webkit-scrollbar{display:none}[data-xlsx-viewport-input]:focus{outline:none}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:rgba(0,0,0,0.08);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:#808080;cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:#5f5f5f;}.xlsx-zoom-slider::-moz-range-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:#808080;cursor:pointer;}";
|
|
5682
|
+
function ds(e) {
|
|
5683
|
+
if (!e.head || e.head.querySelector(`style[${ls}]`)) return;
|
|
5567
5684
|
let t = e.createElement("style");
|
|
5568
|
-
t.setAttribute(
|
|
5685
|
+
t.setAttribute(ls, ""), t.textContent = us, e.head.appendChild(t);
|
|
5569
5686
|
}
|
|
5570
|
-
function
|
|
5687
|
+
function fs(e) {
|
|
5571
5688
|
let t = [...e].sort((e, t) => e.first - t.first || e.last - t.last), n = [];
|
|
5572
5689
|
for (let e of t) {
|
|
5573
5690
|
let t = n.at(-1);
|
|
@@ -5578,7 +5695,7 @@ function es(e) {
|
|
|
5578
5695
|
}
|
|
5579
5696
|
return n;
|
|
5580
5697
|
}
|
|
5581
|
-
function
|
|
5698
|
+
function ps(e, t) {
|
|
5582
5699
|
let n = 0, r = e.length - 1;
|
|
5583
5700
|
for (; n <= r;) {
|
|
5584
5701
|
let i = n + r >>> 1, a = e[i];
|
|
@@ -5588,7 +5705,7 @@ function ts(e, t) {
|
|
|
5588
5705
|
}
|
|
5589
5706
|
return !1;
|
|
5590
5707
|
}
|
|
5591
|
-
function
|
|
5708
|
+
function ms(e, t, n) {
|
|
5592
5709
|
let r = 0, i = e.length;
|
|
5593
5710
|
for (; r < i;) {
|
|
5594
5711
|
let a = r + i >>> 1;
|
|
@@ -5596,12 +5713,12 @@ function ns(e, t, n) {
|
|
|
5596
5713
|
}
|
|
5597
5714
|
return r;
|
|
5598
5715
|
}
|
|
5599
|
-
function
|
|
5716
|
+
function hs(e, t) {
|
|
5600
5717
|
for (let n = 1; n < e.length; n++) if (t(e[n - 1]) > t(e[n])) return [...e].sort((e, n) => t(e) - t(n));
|
|
5601
5718
|
return e;
|
|
5602
5719
|
}
|
|
5603
|
-
var
|
|
5604
|
-
function
|
|
5720
|
+
var gs = "#1a73e8", _s = 4, vs = 5, ys = 25e4, bs = 8 * 1024 * 1024, xs = 1 * 1024 * 1024, Ss = 65536, Cs = 65536, ws = 100;
|
|
5721
|
+
function Ts(e, t) {
|
|
5605
5722
|
let n = Math.min(e.length, Math.max(0, t));
|
|
5606
5723
|
if (n > 0 && n < e.length) {
|
|
5607
5724
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -5609,7 +5726,7 @@ function ps(e, t) {
|
|
|
5609
5726
|
}
|
|
5610
5727
|
return e.slice(0, n);
|
|
5611
5728
|
}
|
|
5612
|
-
function
|
|
5729
|
+
function Es(e, t) {
|
|
5613
5730
|
let n = 0, r = !1;
|
|
5614
5731
|
for (let t = 0; t < e.length; t++) {
|
|
5615
5732
|
let i = e.charCodeAt(t);
|
|
@@ -5617,17 +5734,17 @@ function ms(e, t) {
|
|
|
5617
5734
|
}
|
|
5618
5735
|
return e.length + (r ? n + 2 : 0) > t ? null : r ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
5619
5736
|
}
|
|
5620
|
-
function
|
|
5737
|
+
function Ds(e, t, n, r) {
|
|
5621
5738
|
for (let { index: i, edge: a } of t) if (!(a <= r) && Math.abs(e - a) <= n) return i;
|
|
5622
5739
|
return null;
|
|
5623
5740
|
}
|
|
5624
|
-
function
|
|
5741
|
+
function Os(e) {
|
|
5625
5742
|
return {
|
|
5626
5743
|
border: `2px solid ${e}`,
|
|
5627
5744
|
background: `color-mix(in srgb, ${e} 8%, transparent)`
|
|
5628
5745
|
};
|
|
5629
5746
|
}
|
|
5630
|
-
function
|
|
5747
|
+
function ks(e) {
|
|
5631
5748
|
let t = [];
|
|
5632
5749
|
for (let n of e) {
|
|
5633
5750
|
let e = n.x + n.width, r = n.y + n.height;
|
|
@@ -5673,18 +5790,18 @@ function _s(e) {
|
|
|
5673
5790
|
}
|
|
5674
5791
|
return r.join("");
|
|
5675
5792
|
}
|
|
5676
|
-
var
|
|
5677
|
-
function
|
|
5678
|
-
let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ?
|
|
5793
|
+
var As = 0, js = "color-mix(in srgb, #ffb300 8%, transparent)", Ms = "color-mix(in srgb, #fb8c00 8%, transparent)";
|
|
5794
|
+
function Ns(e, t = {}) {
|
|
5795
|
+
let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ? Ms : js);
|
|
5679
5796
|
return {
|
|
5680
5797
|
border: `2px solid ${r ?? n}`,
|
|
5681
5798
|
background: i
|
|
5682
5799
|
};
|
|
5683
5800
|
}
|
|
5684
|
-
var
|
|
5801
|
+
var Ps = class {
|
|
5685
5802
|
hostDocument;
|
|
5686
5803
|
hostWindow;
|
|
5687
|
-
acquisition = new
|
|
5804
|
+
acquisition = new Ho();
|
|
5688
5805
|
viewport;
|
|
5689
5806
|
renderDispatcher;
|
|
5690
5807
|
wrapper;
|
|
@@ -5704,7 +5821,7 @@ var Ss = class {
|
|
|
5704
5821
|
stashedRowHeights = /* @__PURE__ */ new Map();
|
|
5705
5822
|
stashedColWidths = /* @__PURE__ */ new Map();
|
|
5706
5823
|
sizeOverrideStore = /* @__PURE__ */ new Map();
|
|
5707
|
-
projectionId =
|
|
5824
|
+
projectionId = ss++;
|
|
5708
5825
|
canvasArea;
|
|
5709
5826
|
scrollHost;
|
|
5710
5827
|
spacer;
|
|
@@ -5754,7 +5871,7 @@ var Ss = class {
|
|
|
5754
5871
|
this.pendingTap?.pointerId !== e && (this.pendingTap = null), this.pendingClick?.pointerId !== e && (this.pendingClick = null), this.selectionController.beginDrag(e);
|
|
5755
5872
|
}
|
|
5756
5873
|
_pendingZoomAnchor = null;
|
|
5757
|
-
selectionController = new
|
|
5874
|
+
selectionController = new Ko();
|
|
5758
5875
|
lastNotifiedSelectionState = null;
|
|
5759
5876
|
emittingSelectionChange = !1;
|
|
5760
5877
|
pendingSelectionChange = !1;
|
|
@@ -5791,18 +5908,18 @@ var Ss = class {
|
|
|
5791
5908
|
let r = this.hostDocument.defaultView;
|
|
5792
5909
|
if (!r) throw Error("XlsxViewer requires a document with an active Window");
|
|
5793
5910
|
this.hostWindow = r, this.opts = t, this._mountKind = n.kind, this._nativeScrollbars = t.showScrollbars ?? !0;
|
|
5794
|
-
let i = t[
|
|
5795
|
-
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : Ce("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new
|
|
5911
|
+
let i = t[Qo];
|
|
5912
|
+
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : Ce("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new Wo(t.cellScale ?? 1), this.wrapper = this.hostDocument.createElement("div"), this.wrapper.style.cssText = `position:relative;width:100%;height:100%;background:${n.kind === "composite" ? "#fff" : "transparent"};box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;`, this.gridRegion = this.hostDocument.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;";
|
|
5796
5913
|
let a = "position:absolute;top:0;left:0;z-index:3;display:none;background:#f5f5f5;";
|
|
5797
|
-
if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new
|
|
5798
|
-
commentMaxWidth:
|
|
5799
|
-
commentMaxHeight:
|
|
5800
|
-
validationMaxWidth:
|
|
5801
|
-
validationMaxHeight:
|
|
5802
|
-
}), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation,
|
|
5803
|
-
this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${
|
|
5914
|
+
if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new Go(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.tabIndex = 0, this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${this._nativeScrollbars ? "auto" : "clip"};z-index:2;background:transparent;`, this.spacer = this.hostDocument.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this._nativeScrollbars && this.scrollHost.appendChild(this.spacer), this.surface = new qo(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new Jo(this.canvasArea, this.canvas, this.scrollHost, {
|
|
5915
|
+
commentMaxWidth: es,
|
|
5916
|
+
commentMaxHeight: ts,
|
|
5917
|
+
validationMaxWidth: ns,
|
|
5918
|
+
validationMaxHeight: rs
|
|
5919
|
+
}), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation, ds(this.hostDocument), n.kind === "composite") {
|
|
5920
|
+
this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${is}px;flex-shrink:0;background:#f0f0f0;border-top:1px solid #c8ccd0;`, this.navPrev = this.makeNavButton("◀", "Scroll tabs left", () => this.scrollTabs(-1)), this.navNext = this.makeNavButton("▶", "Scroll tabs right", () => this.scrollTabs(1)), this.navPrev.dataset.xlsxTabNav = "prev", this.navNext.dataset.xlsxTabNav = "next";
|
|
5804
5921
|
let e = this.hostDocument.createElement("div");
|
|
5805
|
-
e.style.cssText = `display:flex;flex-shrink:0;width:${
|
|
5922
|
+
e.style.cssText = `display:flex;flex-shrink:0;width:${as}px;height:100%;`, e.appendChild(this.navPrev), e.appendChild(this.navNext), this.tabStrip = this.hostDocument.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:block;flex:1;min-width:0;height:100%;margin-left:${os}px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabList = this.hostDocument.createElement("div"), this.tabList.style.cssText = `display:flex;align-items:flex-end;height:100%;gap:${os}px;box-sizing:border-box;`, this.tabList.style.width = "max-content", this.tabList.style.minWidth = "100%", this.tabStrip.appendChild(this.tabList), this.tabBar.appendChild(e), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl());
|
|
5806
5923
|
}
|
|
5807
5924
|
this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), n.kind === "composite" && this.wrapper.appendChild(this.tabBar), e.appendChild(this.wrapper), this.rowGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "row")), this.colGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "col")), this._nativeScrollbars && this.surface.on("scroll", () => {
|
|
5808
5925
|
if (this.pendingTap = null, this.pendingElementClick = null, this.hideCommentPopup(), this.hideValidationPanel(), this.scrollHost.clientWidth > 0) {
|
|
@@ -5818,7 +5935,7 @@ var Ss = class {
|
|
|
5818
5935
|
};
|
|
5819
5936
|
this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.setViewportLeft(e.x), this.viewportTop = e.y, this.reanchorHorizontalScroll(), this.layoutGutters(), this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.updateNavButtons();
|
|
5820
5937
|
});
|
|
5821
|
-
o.observe(this.gridRegion), this.resizeObserver = o, this.setupSelectionEvents(), this._find = new
|
|
5938
|
+
o.observe(this.gridRegion), this.resizeObserver = o, this.setupSelectionEvents(), this._find = new Oo(() => this.sheetCount, (e) => this.wb?.sheetNames[e] ?? "", (e) => this._collectSheetCells(e)), i && (this.acquisition.install(i, !1), this._mountKind === "composite" && this.activateWorkbook(i).catch((e) => this._reportRenderError(e)));
|
|
5822
5939
|
}
|
|
5823
5940
|
async _collectSheetCells(e) {
|
|
5824
5941
|
let t = this.wb;
|
|
@@ -5837,7 +5954,7 @@ var Ss = class {
|
|
|
5837
5954
|
async load(e) {
|
|
5838
5955
|
if (this.assertOpen(), this._borrowed) throw Error(`${this._mountKind === "sheet" ? "XlsxSheetViewer" : "XlsxViewer"}.load() is unsupported on a Viewer created by fromWorkbook(); the borrowed workbook is already loaded.`);
|
|
5839
5956
|
try {
|
|
5840
|
-
let t = await this.acquisition.replace(() =>
|
|
5957
|
+
let t = await this.acquisition.replace(() => Xa.load(e, {
|
|
5841
5958
|
password: this.opts.password,
|
|
5842
5959
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
5843
5960
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
@@ -5865,7 +5982,7 @@ var Ss = class {
|
|
|
5865
5982
|
}
|
|
5866
5983
|
async ensureHostFonts(e) {
|
|
5867
5984
|
if (this.fontBinding?.workbook === e) return !0;
|
|
5868
|
-
let t = e[
|
|
5985
|
+
let t = e[qa];
|
|
5869
5986
|
if (typeof t != "function") return !0;
|
|
5870
5987
|
let n = ++this.fontBindingGeneration, r = await t.call(e, this.hostDocument);
|
|
5871
5988
|
return this._destroyed || n !== this.fontBindingGeneration || this.wb !== e ? (r(), !1) : (this.fontBinding?.release(), this.fontBinding = {
|
|
@@ -5895,7 +6012,13 @@ var Ss = class {
|
|
|
5895
6012
|
try {
|
|
5896
6013
|
if (!await this.ensureHostFonts(n)) return;
|
|
5897
6014
|
let t = await n.getWorksheet(e);
|
|
5898
|
-
r = this.sheetViews.get(e) ??
|
|
6015
|
+
r = this.sheetViews.get(e) ?? Uo(t);
|
|
6016
|
+
let i = n[Ja];
|
|
6017
|
+
if (typeof i == "function") {
|
|
6018
|
+
let e = this.hostDocument.createElement("canvas").getContext("2d");
|
|
6019
|
+
e && i.call(n, r, e);
|
|
6020
|
+
}
|
|
6021
|
+
this.syncAutomaticRowOverrides(e, r), this.sheetViews.set(e, r);
|
|
5899
6022
|
} catch (e) {
|
|
5900
6023
|
if (!this.isCurrentSheetRequest(t, n)) return;
|
|
5901
6024
|
throw e;
|
|
@@ -5906,12 +6029,12 @@ var Ss = class {
|
|
|
5906
6029
|
return !this._destroyed && e === this.sheetRequestGeneration && this.wb === t;
|
|
5907
6030
|
}
|
|
5908
6031
|
buildOutline(e) {
|
|
5909
|
-
this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands =
|
|
5910
|
-
let t =
|
|
6032
|
+
this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands = zo(e), this.colOutlineBands = Bo(e);
|
|
6033
|
+
let t = Po(this.rowOutlineBands, Vo(e, "row")), n = Po(this.colOutlineBands, Vo(e, "col"));
|
|
5911
6034
|
this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
|
|
5912
6035
|
}
|
|
5913
6036
|
layoutGutters() {
|
|
5914
|
-
let e = this.viewport.scale, t = this.rowOutline ? Math.round(
|
|
6037
|
+
let e = this.viewport.scale, t = this.rowOutline ? Math.round(jo(this.rowOutline.maxLevel) * e) : 0, n = this.colOutline ? Math.round(jo(this.colOutline.maxLevel) * e) : 0;
|
|
5915
6038
|
this.gutter = {
|
|
5916
6039
|
w: t,
|
|
5917
6040
|
h: n
|
|
@@ -5940,7 +6063,7 @@ var Ss = class {
|
|
|
5940
6063
|
l.setTransform(c, 0, 0, c, 0, 0), l.clearRect(0, 0, o, s), l.fillStyle = "#f5f5f5", l.fillRect(0, 0, o, s);
|
|
5941
6064
|
let u = 19 * n;
|
|
5942
6065
|
l.strokeStyle = "#808080", l.lineWidth = 1, l.fillStyle = "#404040";
|
|
5943
|
-
let d =
|
|
6066
|
+
let d = Q(t), f = d.effectiveFrozenBands({
|
|
5944
6067
|
scale: n,
|
|
5945
6068
|
width: this.canvasArea.clientWidth,
|
|
5946
6069
|
height: this.canvasArea.clientHeight,
|
|
@@ -5948,7 +6071,7 @@ var Ss = class {
|
|
|
5948
6071
|
headerHeight: 22,
|
|
5949
6072
|
rows: t.freezeRows ?? 0,
|
|
5950
6073
|
cols: t.freezeCols ?? 0
|
|
5951
|
-
}), p = d.axesAtScale(n), m = r ? f.rows : f.cols, h = r ? p.row.offsetOf(f.rows + 1) : p.col.offsetOf(f.cols + 1), g = (r ? 22 : 50) * n, _ = (n, i) =>
|
|
6074
|
+
}), p = d.axesAtScale(n), m = r ? f.rows : f.cols, h = r ? p.row.offsetOf(f.rows + 1) : p.col.offsetOf(f.cols + 1), g = (r ? 22 : 50) * n, _ = (n, i) => Mo(e, n, i, m, g, h, o, s, !r && t.rightToLeft === !0), v = (e, t) => {
|
|
5952
6075
|
let n = _(e, t);
|
|
5953
6076
|
return n.w <= 0 || n.h <= 0 ? !1 : (l.save(), l.beginPath(), l.rect(n.x, n.y, n.w, n.h), l.clip(), !0);
|
|
5954
6077
|
};
|
|
@@ -5958,7 +6081,7 @@ var Ss = class {
|
|
|
5958
6081
|
let s = r ? a.y : this.screenX(a.x, a.w), c = r ? o.y + o.h : this.screenX(o.x, o.w) + o.w, d = Math.min(s, c), f = Math.max(s, c);
|
|
5959
6082
|
if (!t.collapsed && f - d > 1 && v(t.start, t.end)) {
|
|
5960
6083
|
l.beginPath();
|
|
5961
|
-
for (let t of
|
|
6084
|
+
for (let t of No(e, i, s, c, u)) l.moveTo(t.x1, t.y1), l.lineTo(t.x2, t.y2);
|
|
5962
6085
|
l.stroke(), l.restore();
|
|
5963
6086
|
}
|
|
5964
6087
|
if (t.summary != null) {
|
|
@@ -5971,7 +6094,7 @@ var Ss = class {
|
|
|
5971
6094
|
}
|
|
5972
6095
|
let y = r ? 22 * n / 2 : 50 * n / 2;
|
|
5973
6096
|
for (let e = 1; e <= a.maxLevel + 1; e++) {
|
|
5974
|
-
let t =
|
|
6097
|
+
let t = Ao(e) * n;
|
|
5975
6098
|
if (t + 12 * n / 2 > (r ? o : s) + .5) break;
|
|
5976
6099
|
this.drawLevelButton(l, r ? t : y, r ? y : t, String(e), n);
|
|
5977
6100
|
}
|
|
@@ -6001,7 +6124,7 @@ var Ss = class {
|
|
|
6001
6124
|
let i = (n ? this.rowGutter : this.colGutter).getBoundingClientRect(), a = e.clientX - i.left, o = e.clientY - i.top, s = this.viewport.scale, c = 19 * s, l = 7 * s, u = n ? 22 * s / 2 : 50 * s / 2;
|
|
6002
6125
|
if ((n ? o : a) <= (n ? 22 : 50) * s) {
|
|
6003
6126
|
for (let i = 1; i <= r.maxLevel + 1; i++) {
|
|
6004
|
-
let r =
|
|
6127
|
+
let r = Ao(i) * s, c = n ? r : u, l = n ? u : r, d = 12 * s / 2;
|
|
6005
6128
|
if (Math.abs(a - c) <= d && Math.abs(o - l) <= d) {
|
|
6006
6129
|
e.preventDefault(), this.applyLevelButton(i, t);
|
|
6007
6130
|
return;
|
|
@@ -6023,7 +6146,7 @@ var Ss = class {
|
|
|
6023
6146
|
applyGroupToggle(e, t) {
|
|
6024
6147
|
let n = this.currentWorksheet;
|
|
6025
6148
|
if (!n) return;
|
|
6026
|
-
let { hide: r, show: i, nowCollapsed: a } =
|
|
6149
|
+
let { hide: r, show: i, nowCollapsed: a } = Io(e, t === "row" ? this.rowOutlineBands : this.colOutlineBands);
|
|
6027
6150
|
for (let e of r) this.setBandHidden(t, e, !0);
|
|
6028
6151
|
for (let e of i) this.setBandHidden(t, e, !1);
|
|
6029
6152
|
e.summary != null && this.setBandCollapsed(t, e.summary, a), this.afterOutlineMutation(n, a && e.summary != null ? {
|
|
@@ -6034,7 +6157,7 @@ var Ss = class {
|
|
|
6034
6157
|
scrollOutlineSummaryToStart(e, t) {
|
|
6035
6158
|
let n = this.currentWorksheet;
|
|
6036
6159
|
if (!n) return;
|
|
6037
|
-
let r = this.viewport.scale, i =
|
|
6160
|
+
let r = this.viewport.scale, i = Q(n).scrollOffsetForCell(e === "row" ? t : 1, e === "col" ? t : 1, {
|
|
6038
6161
|
scale: r,
|
|
6039
6162
|
viewportWidth: this.canvasArea.clientWidth,
|
|
6040
6163
|
viewportHeight: this.canvasArea.clientHeight,
|
|
@@ -6049,7 +6172,7 @@ var Ss = class {
|
|
|
6049
6172
|
applyLevelButton(e, t) {
|
|
6050
6173
|
let n = this.currentWorksheet;
|
|
6051
6174
|
if (!n) return;
|
|
6052
|
-
let { hide: r, show: i } =
|
|
6175
|
+
let { hide: r, show: i } = Ro(t === "row" ? this.rowOutlineBands : this.colOutlineBands, e);
|
|
6053
6176
|
for (let e of r) this.setBandHidden(t, e, !0);
|
|
6054
6177
|
for (let e of i) this.setBandHidden(t, e, !1);
|
|
6055
6178
|
let a = t === "row" ? this.rowOutline : this.colOutline;
|
|
@@ -6078,18 +6201,21 @@ var Ss = class {
|
|
|
6078
6201
|
let r = this.sizeOverrideStore.get(this.currentSheet);
|
|
6079
6202
|
r || (r = {
|
|
6080
6203
|
rows: /* @__PURE__ */ new Map(),
|
|
6204
|
+
automaticRows: /* @__PURE__ */ new Map(),
|
|
6081
6205
|
cols: /* @__PURE__ */ new Map(),
|
|
6082
6206
|
revision: 0
|
|
6083
6207
|
}, this.sizeOverrideStore.set(this.currentSheet, r));
|
|
6084
|
-
let i = e === "row" ? r.rows : r.cols
|
|
6208
|
+
let i = e === "row" ? r.rows : r.cols;
|
|
6209
|
+
e === "row" && r.automaticRows.delete(t);
|
|
6210
|
+
let a = e === "row" ? n.rowHeights[t] ?? null : n.colWidths[t] ?? null;
|
|
6085
6211
|
i.get(t) === a && i.has(t) || (i.set(t, a), r.revision++, r.wire = void 0);
|
|
6086
6212
|
}
|
|
6087
6213
|
wireSizeOverrides() {
|
|
6088
6214
|
let e = this.sizeOverrideStore.get(this.currentSheet);
|
|
6089
|
-
if (!(!e || e.rows.size === 0 && e.cols.size === 0)) {
|
|
6215
|
+
if (!(!e || e.rows.size === 0 && e.automaticRows.size === 0 && e.cols.size === 0)) {
|
|
6090
6216
|
if (!e.wire) {
|
|
6091
6217
|
let t = {};
|
|
6092
|
-
e.rows.size > 0 && (t.rows = Object.fromEntries(e.rows)), e.cols.size > 0 && (t.cols = Object.fromEntries(e.cols)), e.wire = t;
|
|
6218
|
+
(e.rows.size > 0 || e.automaticRows.size > 0) && (t.rows = Object.fromEntries([...e.automaticRows, ...e.rows])), e.cols.size > 0 && (t.cols = Object.fromEntries(e.cols)), e.wire = t;
|
|
6093
6219
|
}
|
|
6094
6220
|
return {
|
|
6095
6221
|
overrides: e.wire,
|
|
@@ -6097,6 +6223,15 @@ var Ss = class {
|
|
|
6097
6223
|
};
|
|
6098
6224
|
}
|
|
6099
6225
|
}
|
|
6226
|
+
syncAutomaticRowOverrides(e, t) {
|
|
6227
|
+
let n = new Map(Ei(t)), r = this.sizeOverrideStore.get(e);
|
|
6228
|
+
!r && n.size === 0 || (r || (r = {
|
|
6229
|
+
rows: /* @__PURE__ */ new Map(),
|
|
6230
|
+
automaticRows: /* @__PURE__ */ new Map(),
|
|
6231
|
+
cols: /* @__PURE__ */ new Map(),
|
|
6232
|
+
revision: 0
|
|
6233
|
+
}, this.sizeOverrideStore.set(e, r)), r.automaticRows = n, r.revision++, r.wire = void 0);
|
|
6234
|
+
}
|
|
6100
6235
|
setBandCollapsed(e, t, n) {
|
|
6101
6236
|
let r = this.currentWorksheet;
|
|
6102
6237
|
if (r) if (e === "row") {
|
|
@@ -6105,18 +6240,18 @@ var Ss = class {
|
|
|
6105
6240
|
} else r.colCollapsed = r.colCollapsed ?? {}, n ? r.colCollapsed[t] = !0 : delete r.colCollapsed[t];
|
|
6106
6241
|
}
|
|
6107
6242
|
afterOutlineMutation(e, t) {
|
|
6108
|
-
|
|
6243
|
+
sr.invalidate(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), t && this.scrollOutlineSummaryToStart(t.axis, t.summary), this.updateSelectionOverlay(), this.updateFindOverlay(), this.scheduleRender(), t && this.emitViewportChange();
|
|
6109
6244
|
}
|
|
6110
6245
|
buildOutlineLayoutOnly(e) {
|
|
6111
|
-
this.rowOutlineBands =
|
|
6112
|
-
let t =
|
|
6246
|
+
this.rowOutlineBands = zo(e), this.colOutlineBands = Bo(e);
|
|
6247
|
+
let t = Po(this.rowOutlineBands, Vo(e, "row")), n = Po(this.colOutlineBands, Vo(e, "col"));
|
|
6113
6248
|
this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
|
|
6114
6249
|
}
|
|
6115
6250
|
get isRtl() {
|
|
6116
6251
|
return this.currentWorksheet?.rightToLeft === !0;
|
|
6117
6252
|
}
|
|
6118
6253
|
updateFooterDirection() {
|
|
6119
|
-
this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${
|
|
6254
|
+
this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${os}px`, this.tabStrip.style.marginRight = this.isRtl ? `${os}px` : "0", this.tabList.style.flexDirection = this.isRtl ? "row-reverse" : "row");
|
|
6120
6255
|
}
|
|
6121
6256
|
get maxScrollLeft() {
|
|
6122
6257
|
return this.syncNativeViewportExtent(), this.viewport.maxX;
|
|
@@ -6145,7 +6280,7 @@ var Ss = class {
|
|
|
6145
6280
|
this.viewport.setOffset(e, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, this.maxScrollLeft - this.viewport.x) : this.viewport.x);
|
|
6146
6281
|
}
|
|
6147
6282
|
screenX(e, t) {
|
|
6148
|
-
return this.isRtl ?
|
|
6283
|
+
return this.isRtl ? xr(e, t, this.canvasArea.clientWidth) : e;
|
|
6149
6284
|
}
|
|
6150
6285
|
resetHorizontalScroll() {
|
|
6151
6286
|
this.viewport.setOffset(0, this.viewport.y), this._nativeScrollbars && (this.scrollHost.scrollLeft = this.isRtl ? this.maxScrollLeft : 0);
|
|
@@ -6193,7 +6328,7 @@ var Ss = class {
|
|
|
6193
6328
|
this.reanchorHorizontalScroll(), this.layoutGutters(), this.currentWorksheet && this.updateSpacerSize(this.currentWorksheet), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay();
|
|
6194
6329
|
}
|
|
6195
6330
|
async scrollToCell(e, t = {}) {
|
|
6196
|
-
let n =
|
|
6331
|
+
let n = cr(e);
|
|
6197
6332
|
!n || !this.currentWorksheet || (this._scrollCellIntoView(n.row, n.col, t.align ?? "nearest"), await this.renderCurrentSheet(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.emitViewportChange());
|
|
6198
6333
|
}
|
|
6199
6334
|
_stepSheet(e) {
|
|
@@ -6209,7 +6344,7 @@ var Ss = class {
|
|
|
6209
6344
|
let r = this.viewport.scale, i = this.canvasArea.getBoundingClientRect(), a = this.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r);
|
|
6210
6345
|
if (a < s || o < c) return null;
|
|
6211
6346
|
let l = a - s, u = o - c;
|
|
6212
|
-
return
|
|
6347
|
+
return Q(n).cellAt(l, u, {
|
|
6213
6348
|
scrollX: this.effectiveScrollLeft,
|
|
6214
6349
|
scrollY: this.viewportTop,
|
|
6215
6350
|
scale: r
|
|
@@ -6220,7 +6355,7 @@ var Ss = class {
|
|
|
6220
6355
|
if (!e) return null;
|
|
6221
6356
|
let t = this.canvasArea.clientWidth, n = this.canvasArea.clientHeight;
|
|
6222
6357
|
if (t <= 0 || n <= 0) return null;
|
|
6223
|
-
let r = this.viewport.scale, i =
|
|
6358
|
+
let r = this.viewport.scale, i = Q(e).visibleRange({
|
|
6224
6359
|
width: t,
|
|
6225
6360
|
height: n,
|
|
6226
6361
|
scale: r,
|
|
@@ -6246,7 +6381,7 @@ var Ss = class {
|
|
|
6246
6381
|
let n = this.currentWorksheet, r = this.elementContextViewport();
|
|
6247
6382
|
if (!n || !r) return null;
|
|
6248
6383
|
let i = this.canvasArea.getBoundingClientRect();
|
|
6249
|
-
return
|
|
6384
|
+
return mo(n, this.currentSheet, {
|
|
6250
6385
|
x: e - i.left,
|
|
6251
6386
|
y: t - i.top
|
|
6252
6387
|
}, r);
|
|
@@ -6255,7 +6390,7 @@ var Ss = class {
|
|
|
6255
6390
|
let n = this.currentWorksheet;
|
|
6256
6391
|
if (!n) return null;
|
|
6257
6392
|
let r = this.viewport.scale;
|
|
6258
|
-
return
|
|
6393
|
+
return Q(n).cellRect(e, t, {
|
|
6259
6394
|
scale: r,
|
|
6260
6395
|
scrollX: this.effectiveScrollLeft,
|
|
6261
6396
|
scrollY: this.viewportTop,
|
|
@@ -6270,32 +6405,32 @@ var Ss = class {
|
|
|
6270
6405
|
if (this._destroyed) throw Error("XlsxViewer has been destroyed");
|
|
6271
6406
|
let t;
|
|
6272
6407
|
if (typeof e == "string") {
|
|
6273
|
-
if (t =
|
|
6274
|
-
} else t = e ?
|
|
6408
|
+
if (t = Eo(e), !t) throw SyntaxError(`Invalid XLSX selection reference: ${e}`);
|
|
6409
|
+
} else t = e ? wo(e) : null;
|
|
6275
6410
|
this.commitSelection(t);
|
|
6276
6411
|
}
|
|
6277
6412
|
getSelectionContext(e = {}) {
|
|
6278
|
-
if (this.assertOpen(), this.elementContext) return
|
|
6413
|
+
if (this.assertOpen(), this.elementContext) return ho(this.elementContext, e.maxTextCharacters);
|
|
6279
6414
|
let t = this.currentWorksheet, n = this.selectionState;
|
|
6280
6415
|
if (!t || !n) return null;
|
|
6281
6416
|
let r = e.maxCells ?? 1e3;
|
|
6282
6417
|
if (!Number.isFinite(r) || r < 0) throw RangeError("maxCells must be a finite non-negative number.");
|
|
6283
|
-
let i = Math.min(
|
|
6418
|
+
let i = Math.min(_o, Math.floor(r)), a = e.maxTextCharacters ?? xs;
|
|
6284
6419
|
if (!Number.isFinite(a) || a < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
6285
|
-
let o = Math.min(
|
|
6420
|
+
let o = Math.min(vo, Math.floor(a)), s = 0, c = !1, l = (e) => {
|
|
6286
6421
|
let t = typeof e == "string" ? [e] : e, n = [], r = 0;
|
|
6287
6422
|
for (let e = 0; e < t.length; e++) {
|
|
6288
|
-
let i = t[e], a = typeof i == "string" ? i : i.text, l = Math.max(0, Math.min(
|
|
6423
|
+
let i = t[e], a = typeof i == "string" ? i : i.text, l = Math.max(0, Math.min(Cs - r, o - s)), u = Ts(a, l);
|
|
6289
6424
|
if (n.push(u), r += u.length, s += u.length, u.length < a.length || e + 1 < t.length && l === 0) {
|
|
6290
6425
|
c = !0;
|
|
6291
6426
|
break;
|
|
6292
6427
|
}
|
|
6293
6428
|
}
|
|
6294
6429
|
return n.join("");
|
|
6295
|
-
}, u = n.areas.some((e) => e.kind === "sheet"), d =
|
|
6430
|
+
}, u = n.areas.some((e) => e.kind === "sheet"), d = fs(n.areas.flatMap((e) => e.kind === "rows" ? [{
|
|
6296
6431
|
first: e.firstRow,
|
|
6297
6432
|
last: e.lastRow
|
|
6298
|
-
}] : [])), f =
|
|
6433
|
+
}] : [])), f = fs(n.areas.flatMap((e) => e.kind === "columns" ? [{
|
|
6299
6434
|
first: e.firstColumn,
|
|
6300
6435
|
last: e.lastColumn
|
|
6301
6436
|
}] : [])), p = n.areas.flatMap((e) => e.kind === "cells" ? [e] : []), m = p.flatMap((e, t) => [{
|
|
@@ -6308,14 +6443,14 @@ var Ss = class {
|
|
|
6308
6443
|
active: !1
|
|
6309
6444
|
}]).sort((e, t) => e.row - t.row || Number(e.active) - Number(t.active)), h = /* @__PURE__ */ new Set(), g = 0, _ = [], v = [], y = !1, b = u || f.length > 0 ? [{
|
|
6310
6445
|
first: 1,
|
|
6311
|
-
last:
|
|
6312
|
-
}] :
|
|
6446
|
+
last: or
|
|
6447
|
+
}] : fs([...d, ...p.map((e) => ({
|
|
6313
6448
|
first: e.top,
|
|
6314
6449
|
last: e.bottom
|
|
6315
6450
|
}))]), x = this.selectionContextRows.get(t);
|
|
6316
|
-
x || (x =
|
|
6451
|
+
x || (x = hs(t.rows, (e) => e.index), this.selectionContextRows.set(t, x));
|
|
6317
6452
|
cellScan: for (let e of b) {
|
|
6318
|
-
let n =
|
|
6453
|
+
let n = ms(x, e.first, (e) => e.index);
|
|
6319
6454
|
for (; n < x.length;) {
|
|
6320
6455
|
let r = x[n++];
|
|
6321
6456
|
if (r.index > e.last) break;
|
|
@@ -6324,18 +6459,18 @@ var Ss = class {
|
|
|
6324
6459
|
let e = m[g++];
|
|
6325
6460
|
e.active ? h.add(e.index) : h.delete(e.index), a = !0;
|
|
6326
6461
|
}
|
|
6327
|
-
a && (_ =
|
|
6462
|
+
a && (_ = fs([...h].map((e) => ({
|
|
6328
6463
|
first: p[e].left,
|
|
6329
6464
|
last: p[e].right
|
|
6330
6465
|
}))));
|
|
6331
|
-
let o = u ||
|
|
6466
|
+
let o = u || ps(d, r.index) ? [{
|
|
6332
6467
|
first: 1,
|
|
6333
|
-
last:
|
|
6334
|
-
}] :
|
|
6468
|
+
last: Z
|
|
6469
|
+
}] : fs([...f, ..._]);
|
|
6335
6470
|
for (let e of o) {
|
|
6336
6471
|
let n = this.selectionContextCells.get(r);
|
|
6337
|
-
n || (n =
|
|
6338
|
-
let a =
|
|
6472
|
+
n || (n = hs(r.cells, (e) => e.col), this.selectionContextCells.set(r, n));
|
|
6473
|
+
let a = ms(n, e.first, (e) => e.col);
|
|
6339
6474
|
for (; a < n.length;) {
|
|
6340
6475
|
let r = n[a++];
|
|
6341
6476
|
if (r.col > e.last) break;
|
|
@@ -6367,7 +6502,7 @@ var Ss = class {
|
|
|
6367
6502
|
sheetIndex: this.currentSheet,
|
|
6368
6503
|
sheetName: t.name,
|
|
6369
6504
|
selection: n,
|
|
6370
|
-
coordinateCountUpperBound:
|
|
6505
|
+
coordinateCountUpperBound: yo(n),
|
|
6371
6506
|
cells: v,
|
|
6372
6507
|
truncated: S.length > 0,
|
|
6373
6508
|
truncationReasons: S,
|
|
@@ -6379,7 +6514,7 @@ var Ss = class {
|
|
|
6379
6514
|
commitSelection(e) {
|
|
6380
6515
|
this.setElementContext(null);
|
|
6381
6516
|
let t = this.selectionState;
|
|
6382
|
-
|
|
6517
|
+
Do(t, e) || (this.hideValidationPanel(), this.selectionController.setState(e), this.updateSelectionOverlay(), this.wb && this.scheduleRender(), this.emitSelectionChange());
|
|
6383
6518
|
}
|
|
6384
6519
|
setElementContext(e) {
|
|
6385
6520
|
return JSON.stringify(this.elementContext) === JSON.stringify(e) ? !1 : (this.elementContext = e ? structuredClone(e) : null, this.updateSelectionOverlay(), this.scheduleSelectionContextNotification(), !0);
|
|
@@ -6388,22 +6523,22 @@ var Ss = class {
|
|
|
6388
6523
|
if (!this.opts.onSelectionContextChange || this._destroyed || this.selectionContextNotificationFrame !== null || this.selectionContextNotificationMicrotask) return;
|
|
6389
6524
|
let e = () => {
|
|
6390
6525
|
if (this.selectionContextNotificationFrame = null, this.selectionContextNotificationMicrotask = !1, this._destroyed) return;
|
|
6391
|
-
let e = this.getSelectionContext({ maxTextCharacters:
|
|
6526
|
+
let e = this.getSelectionContext({ maxTextCharacters: Ss });
|
|
6392
6527
|
this.opts.onSelectionContextChange?.(e ? structuredClone(e) : null);
|
|
6393
6528
|
};
|
|
6394
6529
|
typeof this.hostWindow.requestAnimationFrame == "function" ? this.selectionContextNotificationFrame = this.hostWindow.requestAnimationFrame(e) : (this.selectionContextNotificationMicrotask = !0, queueMicrotask(e));
|
|
6395
6530
|
}
|
|
6396
6531
|
emitSelectionChange() {
|
|
6397
6532
|
let e = this.selectionState;
|
|
6398
|
-
if (
|
|
6533
|
+
if (Do(e, this.lastNotifiedSelectionState) || this.scheduleSelectionContextNotification(), this.emittingSelectionChange) {
|
|
6399
6534
|
this.pendingSelectionChange = !0, this.scheduleSelectionNotification();
|
|
6400
6535
|
return;
|
|
6401
6536
|
}
|
|
6402
|
-
if (this.pendingSelectionChange = !1,
|
|
6537
|
+
if (this.pendingSelectionChange = !1, Do(e, this.lastNotifiedSelectionState)) {
|
|
6403
6538
|
this.finishSelectionNotificationChain();
|
|
6404
6539
|
return;
|
|
6405
6540
|
}
|
|
6406
|
-
if (this.selectionNotificationCount >=
|
|
6541
|
+
if (this.selectionNotificationCount >= ws) {
|
|
6407
6542
|
this.lastNotifiedSelectionState = e ? structuredClone(e) : null, this.finishSelectionNotificationChain();
|
|
6408
6543
|
return;
|
|
6409
6544
|
}
|
|
@@ -6411,7 +6546,7 @@ var Ss = class {
|
|
|
6411
6546
|
try {
|
|
6412
6547
|
this.opts.onSelectionStateChange?.(e ? structuredClone(e) : null);
|
|
6413
6548
|
} finally {
|
|
6414
|
-
this.emittingSelectionChange = !1, this.pendingSelectionChange || !
|
|
6549
|
+
this.emittingSelectionChange = !1, this.pendingSelectionChange || !Do(this.selectionState, this.lastNotifiedSelectionState) ? this.scheduleSelectionNotification() : this.finishSelectionNotificationChain();
|
|
6415
6550
|
}
|
|
6416
6551
|
}
|
|
6417
6552
|
scheduleSelectionNotification() {
|
|
@@ -6428,7 +6563,7 @@ var Ss = class {
|
|
|
6428
6563
|
let r = this.viewport.scale, i = this.canvasArea.getBoundingClientRect(), a = this.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l = a < s, u = o < c;
|
|
6429
6564
|
if (!l && !u) return null;
|
|
6430
6565
|
if (l && u) return { kind: "corner" };
|
|
6431
|
-
let d =
|
|
6566
|
+
let d = Q(n);
|
|
6432
6567
|
if (l) {
|
|
6433
6568
|
let e = o - c;
|
|
6434
6569
|
if (e < 0) return { kind: "corner" };
|
|
@@ -6449,7 +6584,7 @@ var Ss = class {
|
|
|
6449
6584
|
getResizeTarget(e, t) {
|
|
6450
6585
|
let n = this.currentWorksheet;
|
|
6451
6586
|
if (!n) return null;
|
|
6452
|
-
let r = this.viewport.scale, i = this.canvasArea.getBoundingClientRect(), a = this.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l =
|
|
6587
|
+
let r = this.viewport.scale, i = this.canvasArea.getBoundingClientRect(), a = this.screenX(e - i.left, 0), o = t - i.top, s = Math.round(50 * r), c = Math.round(22 * r), l = Q(n).maximumDigitWidth;
|
|
6453
6588
|
if (o <= c && a > s) {
|
|
6454
6589
|
let n = this.getHeaderHit(e, t);
|
|
6455
6590
|
if (n?.kind !== "col") return null;
|
|
@@ -6462,7 +6597,7 @@ var Ss = class {
|
|
|
6462
6597
|
edge: t.x + t.w
|
|
6463
6598
|
}));
|
|
6464
6599
|
}
|
|
6465
|
-
let o =
|
|
6600
|
+
let o = Ds(a, i, _s, s);
|
|
6466
6601
|
return o === null ? null : {
|
|
6467
6602
|
kind: "col",
|
|
6468
6603
|
index: o,
|
|
@@ -6482,7 +6617,7 @@ var Ss = class {
|
|
|
6482
6617
|
edge: t.y + t.h
|
|
6483
6618
|
}));
|
|
6484
6619
|
}
|
|
6485
|
-
let a =
|
|
6620
|
+
let a = Ds(o, i, _s, c);
|
|
6486
6621
|
return a === null ? null : {
|
|
6487
6622
|
kind: "row",
|
|
6488
6623
|
index: a,
|
|
@@ -6497,13 +6632,22 @@ var Ss = class {
|
|
|
6497
6632
|
if (!n || !r) return;
|
|
6498
6633
|
let i = this.viewport.scale, a = this.canvasArea.getBoundingClientRect();
|
|
6499
6634
|
if (n.kind === "col") {
|
|
6500
|
-
let t = this.screenX(e - a.left, 0), o = Math.max(
|
|
6501
|
-
r.colWidths[n.index] =
|
|
6635
|
+
let t = this.screenX(e - a.left, 0), o = Math.max(vs, Math.round((t - n.originScaled) / i));
|
|
6636
|
+
r.colWidths[n.index] = nr(o, n.mdw), this.recordSizeOverride("col", n.index);
|
|
6502
6637
|
} else {
|
|
6503
|
-
let e = t - a.top, o = Math.max(
|
|
6504
|
-
r.rowHeights[n.index] =
|
|
6638
|
+
let e = t - a.top, o = Math.max(vs, Math.round((e - n.originScaled) / i));
|
|
6639
|
+
r.rowHeights[n.index] = ir(o), this.recordSizeOverride("row", n.index);
|
|
6505
6640
|
}
|
|
6506
|
-
|
|
6641
|
+
sr.invalidate(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
|
|
6642
|
+
}
|
|
6643
|
+
refitAutoRowsAfterColumnResize() {
|
|
6644
|
+
let e = this.currentWorksheet, t = this.preparedWorkbook;
|
|
6645
|
+
if (!e || !t) return;
|
|
6646
|
+
Di(e, this.sizeOverrideStore.get(this.currentSheet)?.rows.keys() ?? []);
|
|
6647
|
+
let n = t[Ja];
|
|
6648
|
+
if (typeof n != "function") return;
|
|
6649
|
+
let r = this.hostDocument.createElement("canvas").getContext("2d");
|
|
6650
|
+
r && (n.call(t, e, r), this.syncAutomaticRowOverrides(this.currentSheet, e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender());
|
|
6507
6651
|
}
|
|
6508
6652
|
setSelectionColor(e) {
|
|
6509
6653
|
this.opts.selectionColor = e, this.updateSelectionOverlay();
|
|
@@ -6550,12 +6694,12 @@ var Ss = class {
|
|
|
6550
6694
|
c1: n.left,
|
|
6551
6695
|
c2: n.right
|
|
6552
6696
|
}, l = o - a + 1, u = c - s + 1;
|
|
6553
|
-
if (l > Math.floor(
|
|
6697
|
+
if (l > Math.floor(ys / u)) return {
|
|
6554
6698
|
status: "too-large",
|
|
6555
6699
|
limit: "cells"
|
|
6556
6700
|
};
|
|
6557
6701
|
let d = l * u, f = Math.max(0, l - 1) + l * Math.max(0, u - 1);
|
|
6558
|
-
if (f >
|
|
6702
|
+
if (f > bs) return {
|
|
6559
6703
|
status: "too-large",
|
|
6560
6704
|
limit: "text"
|
|
6561
6705
|
};
|
|
@@ -6564,7 +6708,7 @@ var Ss = class {
|
|
|
6564
6708
|
if (n.col < s || n.col > c) continue;
|
|
6565
6709
|
let r = n.value, i = this.wb?.cellText(e, n) ?? "";
|
|
6566
6710
|
if (this.wb || (r.type === "text" ? i = r.runs ? r.runs.map((e) => e.text).join("") : r.text : r.type === "number" ? i = String(r.number) : r.type === "bool" ? i = r.bool ? "TRUE" : "FALSE" : r.type === "error" && (i = r.error)), i) {
|
|
6567
|
-
let e =
|
|
6711
|
+
let e = Es(i, bs - f);
|
|
6568
6712
|
if (e === null) return {
|
|
6569
6713
|
status: "too-large",
|
|
6570
6714
|
limit: "text"
|
|
@@ -6604,7 +6748,7 @@ var Ss = class {
|
|
|
6604
6748
|
if (!e) return;
|
|
6605
6749
|
let t = this.viewport.scale, n = this.currentWorksheet;
|
|
6606
6750
|
if (!n) return;
|
|
6607
|
-
let r = (e) => Math.round(e * t), i = r(50), a = r(22), o = this.canvasArea.clientWidth, s = this.canvasArea.clientHeight, c =
|
|
6751
|
+
let r = (e) => Math.round(e * t), i = r(50), a = r(22), o = this.canvasArea.clientWidth, s = this.canvasArea.clientHeight, c = Q(n), l = c.effectiveFrozenBands({
|
|
6608
6752
|
scale: t,
|
|
6609
6753
|
width: o,
|
|
6610
6754
|
height: s,
|
|
@@ -6619,12 +6763,12 @@ var Ss = class {
|
|
|
6619
6763
|
end: Math.min(o, i + d)
|
|
6620
6764
|
}, {
|
|
6621
6765
|
first: l.cols + 1,
|
|
6622
|
-
last:
|
|
6766
|
+
last: Z,
|
|
6623
6767
|
start: Math.min(o, i + d),
|
|
6624
6768
|
end: o
|
|
6625
6769
|
}] : [{
|
|
6626
6770
|
first: 1,
|
|
6627
|
-
last:
|
|
6771
|
+
last: Z,
|
|
6628
6772
|
start: i,
|
|
6629
6773
|
end: o
|
|
6630
6774
|
}], m = l.rows > 0 ? [{
|
|
@@ -6634,15 +6778,15 @@ var Ss = class {
|
|
|
6634
6778
|
end: Math.min(s, a + f)
|
|
6635
6779
|
}, {
|
|
6636
6780
|
first: l.rows + 1,
|
|
6637
|
-
last:
|
|
6781
|
+
last: or,
|
|
6638
6782
|
start: Math.min(s, a + f),
|
|
6639
6783
|
end: s
|
|
6640
6784
|
}] : [{
|
|
6641
6785
|
first: 1,
|
|
6642
|
-
last:
|
|
6786
|
+
last: or,
|
|
6643
6787
|
start: a,
|
|
6644
6788
|
end: s
|
|
6645
|
-
}], h = this.opts.selectionColor ??
|
|
6789
|
+
}], h = this.opts.selectionColor ?? gs, { background: g } = Os(h), _ = /* @__PURE__ */ new Set(), v = [], y = [];
|
|
6646
6790
|
for (let t of e.areas) {
|
|
6647
6791
|
let e = t.kind === "cells" ? {
|
|
6648
6792
|
top: t.top,
|
|
@@ -6657,14 +6801,14 @@ var Ss = class {
|
|
|
6657
6801
|
top: t.firstRow,
|
|
6658
6802
|
bottom: t.lastRow,
|
|
6659
6803
|
left: 1,
|
|
6660
|
-
right:
|
|
6804
|
+
right: Z,
|
|
6661
6805
|
topEdge: !0,
|
|
6662
6806
|
bottomEdge: !0,
|
|
6663
6807
|
leftEdge: !1,
|
|
6664
6808
|
rightEdge: !1
|
|
6665
6809
|
} : t.kind === "columns" ? {
|
|
6666
6810
|
top: 1,
|
|
6667
|
-
bottom:
|
|
6811
|
+
bottom: or,
|
|
6668
6812
|
left: t.firstColumn,
|
|
6669
6813
|
right: t.lastColumn,
|
|
6670
6814
|
topEdge: !1,
|
|
@@ -6673,9 +6817,9 @@ var Ss = class {
|
|
|
6673
6817
|
rightEdge: !0
|
|
6674
6818
|
} : {
|
|
6675
6819
|
top: 1,
|
|
6676
|
-
bottom:
|
|
6820
|
+
bottom: or,
|
|
6677
6821
|
left: 1,
|
|
6678
|
-
right:
|
|
6822
|
+
right: Z,
|
|
6679
6823
|
topEdge: !1,
|
|
6680
6824
|
bottomEdge: !1,
|
|
6681
6825
|
leftEdge: !1,
|
|
@@ -6714,7 +6858,7 @@ var Ss = class {
|
|
|
6714
6858
|
if (v.length > 0) {
|
|
6715
6859
|
let t = "http://www.w3.org/2000/svg", n = this.hostDocument.createElementNS(t, "svg");
|
|
6716
6860
|
n.setAttribute("data-xlsx-selection-fill", ""), n.style.cssText = "position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
|
|
6717
|
-
let r = e.areas.length > 1, i = this.getCellRect(e.activeCell.row, e.activeCell.col), a = `xlsx-selection-mask-${++
|
|
6861
|
+
let r = e.areas.length > 1, i = this.getCellRect(e.activeCell.row, e.activeCell.col), a = `xlsx-selection-mask-${++As}`, c = this.hostDocument.createElementNS(t, "defs"), l = this.hostDocument.createElementNS(t, "mask");
|
|
6718
6862
|
l.setAttribute("id", a), l.setAttribute("maskUnits", "userSpaceOnUse"), l.setAttribute("x", "0"), l.setAttribute("y", "0"), l.setAttribute("width", String(o)), l.setAttribute("height", String(s));
|
|
6719
6863
|
let u = this.hostDocument.createElementNS(t, "path");
|
|
6720
6864
|
if (u.setAttribute("d", v.join("")), u.setAttribute("fill", "#fff"), l.appendChild(u), i) for (let e of m) for (let n of p) {
|
|
@@ -6726,7 +6870,7 @@ var Ss = class {
|
|
|
6726
6870
|
c.appendChild(l), n.appendChild(c);
|
|
6727
6871
|
let d = this.hostDocument.createElementNS(t, "rect");
|
|
6728
6872
|
d.setAttribute("x", "0"), d.setAttribute("y", "0"), d.setAttribute("width", String(o)), d.setAttribute("height", String(s)), d.setAttribute("fill", g), d.setAttribute("mask", `url(#${a})`), n.appendChild(d);
|
|
6729
|
-
let f = r ? "" :
|
|
6873
|
+
let f = r ? "" : ks(y);
|
|
6730
6874
|
if (f) {
|
|
6731
6875
|
let e = this.hostDocument.createElementNS(t, "path");
|
|
6732
6876
|
e.setAttribute("data-xlsx-selection-border", ""), e.setAttribute("d", f), e.setAttribute("fill", "none"), e.setAttribute("stroke", h), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "square"), e.setAttribute("stroke-linejoin", "miter"), n.appendChild(e);
|
|
@@ -6744,19 +6888,19 @@ var Ss = class {
|
|
|
6744
6888
|
drawElementContextOverlay() {
|
|
6745
6889
|
let e = this.elementContext, t = this.currentWorksheet, n = this.elementContextViewport();
|
|
6746
6890
|
if (!e || !t || !n || e.sheetIndex !== this.currentSheet) return;
|
|
6747
|
-
let r =
|
|
6891
|
+
let r = io(t, e, n);
|
|
6748
6892
|
if (!r) return;
|
|
6749
6893
|
let i = this.hostDocument.createElement("div");
|
|
6750
6894
|
i.setAttribute("data-xlsx-element-context-clip", ""), i.style.cssText = `position:absolute;left:${r.clip.x}px;top:${r.clip.y}px;width:${r.clip.width}px;height:${r.clip.height}px;overflow:hidden;pointer-events:none;`;
|
|
6751
6895
|
let a = this.hostDocument.createElement("div");
|
|
6752
6896
|
a.setAttribute("data-xlsx-element-context-outline", e.elementType);
|
|
6753
|
-
let o = this.opts.selectionColor ??
|
|
6897
|
+
let o = this.opts.selectionColor ?? gs;
|
|
6754
6898
|
a.style.cssText = `position:absolute;left:${r.rect.x - r.clip.x}px;top:${r.rect.y - r.clip.y}px;width:${r.rect.width}px;height:${r.rect.height}px;box-sizing:border-box;border:2px solid ${o};background:color-mix(in srgb, ${o} 6%, transparent);transform:rotate(${r.rotation}deg);transform-origin:center;pointer-events:none;`, i.appendChild(a), this.overlayHost.appendSelection(i);
|
|
6755
6899
|
}
|
|
6756
6900
|
maybeDrawValidationDropdown() {
|
|
6757
6901
|
if (this.validationArrowRect = null, this.selectionMode !== "cells") return;
|
|
6758
6902
|
let e = this.currentWorksheet, t = this.activeCell;
|
|
6759
|
-
if (!e || !t || !
|
|
6903
|
+
if (!e || !t || !Qa(e.dataValidations, t.row, t.col)) return;
|
|
6760
6904
|
let n = this.getCellRect(t.row, t.col);
|
|
6761
6905
|
if (!n) return;
|
|
6762
6906
|
let r = this.viewport.scale, i = Math.round(50 * r), a = Math.round(22 * r), o = Math.max(14, Math.min(n.h, 22 * r)), s = n.x + n.w, c = n.y;
|
|
@@ -6775,7 +6919,7 @@ var Ss = class {
|
|
|
6775
6919
|
this.overlayHost.clearFind();
|
|
6776
6920
|
let e = this.currentWorksheet;
|
|
6777
6921
|
if (!e) return;
|
|
6778
|
-
let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s =
|
|
6922
|
+
let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = Q(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u = Ns(!1, this.opts.findHighlightColors), d = Ns(!0, this.opts.findHighlightColors);
|
|
6779
6923
|
for (let e of this._find.sheetHighlights(this.currentSheet)) {
|
|
6780
6924
|
let t = this.getCellRect(e.row, e.col);
|
|
6781
6925
|
if (!t) continue;
|
|
@@ -6807,7 +6951,7 @@ var Ss = class {
|
|
|
6807
6951
|
_scrollCellIntoView(e, t, n = "nearest") {
|
|
6808
6952
|
let r = this.currentWorksheet;
|
|
6809
6953
|
if (!r) return;
|
|
6810
|
-
let i = this.viewport.scale, a =
|
|
6954
|
+
let i = this.viewport.scale, a = Q(r).scrollOffsetForCell(e, t, {
|
|
6811
6955
|
scale: i,
|
|
6812
6956
|
viewportWidth: this.canvasArea.clientWidth,
|
|
6813
6957
|
viewportHeight: this.canvasArea.clientHeight,
|
|
@@ -6827,7 +6971,7 @@ var Ss = class {
|
|
|
6827
6971
|
this.hideValidationPanel();
|
|
6828
6972
|
return;
|
|
6829
6973
|
}
|
|
6830
|
-
let r =
|
|
6974
|
+
let r = Qa(e.dataValidations, t.row, t.col);
|
|
6831
6975
|
r && (this.hideValidationPanel(), this.validationPanelKey = n, this.openValidationPanel(t, r.formula1));
|
|
6832
6976
|
}
|
|
6833
6977
|
async openValidationPanel(e, t) {
|
|
@@ -6872,7 +7016,7 @@ var Ss = class {
|
|
|
6872
7016
|
if (!t) return;
|
|
6873
7017
|
let n = this.screenX(t.x, t.w);
|
|
6874
7018
|
this.validationPanel.style.left = "-9999px", this.validationPanel.style.top = "-9999px", this.validationPanel.style.display = "block";
|
|
6875
|
-
let r =
|
|
7019
|
+
let r = Va({
|
|
6876
7020
|
cell: {
|
|
6877
7021
|
x: n,
|
|
6878
7022
|
y: t.y,
|
|
@@ -6905,7 +7049,7 @@ var Ss = class {
|
|
|
6905
7049
|
buildCommentMap(e) {
|
|
6906
7050
|
this.commentMap = /* @__PURE__ */ new Map();
|
|
6907
7051
|
for (let t of e.comments ?? []) {
|
|
6908
|
-
let e =
|
|
7052
|
+
let e = cr(t.cellRef);
|
|
6909
7053
|
e && this.commentMap.set(`${e.row}:${e.col}`, t);
|
|
6910
7054
|
}
|
|
6911
7055
|
}
|
|
@@ -6948,7 +7092,7 @@ var Ss = class {
|
|
|
6948
7092
|
}
|
|
6949
7093
|
this.commentPopupKey !== t && (this.hideCommentPopup(), this.commentPopupKey = t, this.commentPopupTimer = setTimeout(() => {
|
|
6950
7094
|
this.commentPopupTimer = null, this.renderCommentPopup(e, n);
|
|
6951
|
-
},
|
|
7095
|
+
}, $o));
|
|
6952
7096
|
}
|
|
6953
7097
|
renderCommentPopup(e, t) {
|
|
6954
7098
|
let n = this.getCellRect(e.row, e.col);
|
|
@@ -6961,7 +7105,7 @@ var Ss = class {
|
|
|
6961
7105
|
r.textContent = t.text, this.commentPopup.appendChild(r);
|
|
6962
7106
|
let i = this.screenX(n.x, n.w);
|
|
6963
7107
|
this.commentPopup.style.left = "-9999px", this.commentPopup.style.top = "-9999px", this.commentPopup.style.display = "block";
|
|
6964
|
-
let a =
|
|
7108
|
+
let a = ko({
|
|
6965
7109
|
cell: {
|
|
6966
7110
|
x: i,
|
|
6967
7111
|
y: n.y,
|
|
@@ -7065,7 +7209,7 @@ var Ss = class {
|
|
|
7065
7209
|
y: 0
|
|
7066
7210
|
};
|
|
7067
7211
|
let t = this.viewportInputBounds();
|
|
7068
|
-
return
|
|
7212
|
+
return Xo({
|
|
7069
7213
|
x: e.clientX - t.left,
|
|
7070
7214
|
y: e.clientY - t.top
|
|
7071
7215
|
}, {
|
|
@@ -7121,7 +7265,7 @@ var Ss = class {
|
|
|
7121
7265
|
if (r?.kind === "row") return n.areas.some((e) => e.kind === "sheet" || e.kind === "rows" && r.row >= e.firstRow && r.row <= e.lastRow);
|
|
7122
7266
|
if (r?.kind === "col") return n.areas.some((e) => e.kind === "sheet" || e.kind === "columns" && r.col >= e.firstColumn && r.col <= e.lastColumn);
|
|
7123
7267
|
let i = this.getCellAt(e, t);
|
|
7124
|
-
return i !== null && n.areas.some((e) =>
|
|
7268
|
+
return i !== null && n.areas.some((e) => So(e, i));
|
|
7125
7269
|
}
|
|
7126
7270
|
resolveContextMenuContext(e) {
|
|
7127
7271
|
if (this._destroyed) return Promise.resolve(null);
|
|
@@ -7215,7 +7359,7 @@ var Ss = class {
|
|
|
7215
7359
|
!this.isSelecting || e.pointerId !== this.selectionPointerId || (this.trackSelectionAutoScroll(e), this.extendDragSelection(e.clientX, e.clientY, !1) && (this.updateSelectionOverlay(), this.scheduleRender(), this.emitSelectionChange()));
|
|
7216
7360
|
}), this.surface.on("pointerup", (e) => {
|
|
7217
7361
|
if (this.resizeDrag && this.resizeDrag.pointerId === e.pointerId) {
|
|
7218
|
-
this.scrollHost.releasePointerCapture(e.pointerId), this.resizeDrag = null;
|
|
7362
|
+
this.resizeDrag.kind === "col" && this.refitAutoRowsAfterColumnResize(), this.scrollHost.releasePointerCapture(e.pointerId), this.resizeDrag = null;
|
|
7219
7363
|
return;
|
|
7220
7364
|
}
|
|
7221
7365
|
if (this.pendingElementClick?.pointerId === e.pointerId) {
|
|
@@ -7243,7 +7387,7 @@ var Ss = class {
|
|
|
7243
7387
|
}
|
|
7244
7388
|
t && this.selectionController.endDrag(e.pointerId);
|
|
7245
7389
|
}), this.surface.on("pointercancel", (e) => {
|
|
7246
|
-
this.resizeDrag && this.resizeDrag.pointerId === e.pointerId && (this.resizeDrag = null), this.pendingTap && this.pendingTap.pointerId === e.pointerId && (this.pendingTap = null), this.pendingClick && this.pendingClick.pointerId === e.pointerId && (this.pendingClick = null), this.pendingElementClick?.pointerId === e.pointerId && (this.pendingElementClick = null), e.pointerId === this.selectionPointerId && (this.stopSelectionAutoScroll(), this.selectionController.endDrag(e.pointerId));
|
|
7390
|
+
this.resizeDrag && this.resizeDrag.pointerId === e.pointerId && (this.resizeDrag.kind === "col" && this.refitAutoRowsAfterColumnResize(), this.resizeDrag = null), this.pendingTap && this.pendingTap.pointerId === e.pointerId && (this.pendingTap = null), this.pendingClick && this.pendingClick.pointerId === e.pointerId && (this.pendingClick = null), this.pendingElementClick?.pointerId === e.pointerId && (this.pendingElementClick = null), e.pointerId === this.selectionPointerId && (this.stopSelectionAutoScroll(), this.selectionController.endDrag(e.pointerId));
|
|
7247
7391
|
}), this.surface.on("wheel", (e) => {
|
|
7248
7392
|
if (!(e.ctrlKey || e.metaKey)) {
|
|
7249
7393
|
if (!this._nativeScrollbars) {
|
|
@@ -7319,12 +7463,12 @@ var Ss = class {
|
|
|
7319
7463
|
this.updateNavButtons();
|
|
7320
7464
|
}
|
|
7321
7465
|
tabStyle(e, t) {
|
|
7322
|
-
let n =
|
|
7466
|
+
let n = is - 2, r = is - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
|
|
7323
7467
|
return e ? `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${n}px;font-size:13px;background:#fff;color:#000;border-bottom:1px solid #fff;font-weight:600;top:1px;` + i : `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${r}px;font-size:11px;background:#e0e0e0;color:#555;` + i;
|
|
7324
7468
|
}
|
|
7325
7469
|
tabCss(e, t) {
|
|
7326
7470
|
let n = this.tabStyle(t, this.tabColors[e]);
|
|
7327
|
-
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${
|
|
7471
|
+
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${cs};`), n;
|
|
7328
7472
|
}
|
|
7329
7473
|
buildZoomControl() {
|
|
7330
7474
|
let e = this.opts.zoomMin ?? .1, t = this.opts.zoomMax ?? 4, n = this.viewport.scale, r = this.hostDocument.createElement("div");
|
|
@@ -7385,15 +7529,15 @@ var Ss = class {
|
|
|
7385
7529
|
i <= 0 || this.setScale(i);
|
|
7386
7530
|
}
|
|
7387
7531
|
_naturalContentExtent(e) {
|
|
7388
|
-
let { maxRow: t, maxCol: n } =
|
|
7389
|
-
return
|
|
7532
|
+
let { maxRow: t, maxCol: n } = Zo(e);
|
|
7533
|
+
return Q(e).logicalContentExtent(t, n, 50, 22);
|
|
7390
7534
|
}
|
|
7391
7535
|
updateSpacerSize(e) {
|
|
7392
7536
|
let t = this.viewport.scale;
|
|
7393
7537
|
e.freezeRows, e.freezeCols;
|
|
7394
|
-
let { maxRow: n, maxCol: r } =
|
|
7538
|
+
let { maxRow: n, maxCol: r } = Zo(e);
|
|
7395
7539
|
n += 30, r += 10;
|
|
7396
|
-
let i =
|
|
7540
|
+
let i = Q(e).roundedContentExtent(n, r, t, 50, 22), a = i.width, o = i.height;
|
|
7397
7541
|
this.spacer.style.width = `${a}px`, this.spacer.style.height = `${o}px`, this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.viewport.setExtent(a, o), this.setViewportLeft(this.viewport.x), this.viewportTop = this.viewport.y;
|
|
7398
7542
|
}
|
|
7399
7543
|
scheduleRender() {
|
|
@@ -7417,7 +7561,7 @@ var Ss = class {
|
|
|
7417
7561
|
if (!this.currentWorksheet) return;
|
|
7418
7562
|
let t = this.currentWorksheet, n = this.canvasArea.clientWidth, r = this.canvasArea.clientHeight;
|
|
7419
7563
|
if (n <= 0 || r <= 0) return;
|
|
7420
|
-
let i = this.viewport.scale, a = this.surface.dpr, o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c =
|
|
7564
|
+
let i = this.viewport.scale, a = this.surface.dpr, o = t.freezeRows ?? 0, s = t.freezeCols ?? 0, c = Q(t).visibleRange({
|
|
7421
7565
|
width: n,
|
|
7422
7566
|
height: r,
|
|
7423
7567
|
scale: i,
|
|
@@ -7437,20 +7581,21 @@ var Ss = class {
|
|
|
7437
7581
|
freezeCols: s,
|
|
7438
7582
|
selectedRowRange: f,
|
|
7439
7583
|
selectedColRange: p
|
|
7440
|
-
}, h = this.wireSizeOverrides(), g =
|
|
7584
|
+
}, h = this.wireSizeOverrides(), g = Ga(h ? {
|
|
7441
7585
|
...m,
|
|
7442
7586
|
sizeOverrides: h.overrides
|
|
7443
|
-
} : m,
|
|
7587
|
+
} : m, Q(t).maximumDigitWidth, {
|
|
7444
7588
|
worksheet: t,
|
|
7445
7589
|
projection: h ? {
|
|
7446
7590
|
id: this.projectionId,
|
|
7447
|
-
revision: h.revision
|
|
7591
|
+
revision: h.revision,
|
|
7592
|
+
autoRowHeightsPrepared: !0
|
|
7448
7593
|
} : void 0
|
|
7449
7594
|
});
|
|
7450
7595
|
if (this._mode === "worker") {
|
|
7451
7596
|
let t = await this.workbook.renderViewportToBitmap(this.currentSheet, l, g);
|
|
7452
7597
|
if (!this.renderDispatcher.commitBitmap(e, t, n, r)) return;
|
|
7453
|
-
} else if (await this.workbook.renderViewport(this.canvas, this.currentSheet, l,
|
|
7598
|
+
} else if (await this.workbook.renderViewport(this.canvas, this.currentSheet, l, Da(g, () => !this._destroyed && this.renderDispatcher.isCurrent(e))), !this.renderDispatcher.isCurrent(e) || this._destroyed) return;
|
|
7454
7599
|
this.renderGutters();
|
|
7455
7600
|
}
|
|
7456
7601
|
computeHeaderHighlight() {
|
|
@@ -7469,7 +7614,7 @@ var Ss = class {
|
|
|
7469
7614
|
destroy() {
|
|
7470
7615
|
if (this._destroyed) return;
|
|
7471
7616
|
this._destroyed = !0, this.selectionContextNotificationFrame !== null && (this.hostWindow.cancelAnimationFrame(this.selectionContextNotificationFrame), this.selectionContextNotificationFrame = null), this.selectionContextNotificationMicrotask = !1, this.stopSelectionAutoScroll(), this.sheetRequestGeneration++, this.resizeObserver?.disconnect(), this.renderDispatcher.destroy(), this.surface.destroy(), this.hideCommentPopup(), this.hideValidationPanel(), this._find.invalidate(), this.releaseHostFonts();
|
|
7472
|
-
let e = this.wb?.[
|
|
7617
|
+
let e = this.wb?.[Ya];
|
|
7473
7618
|
typeof e == "function" && e.call(this.wb, this.projectionId), this.currentWorksheet = null, this.elementContext = null, this.pendingElementClick = null, this.selectionController.reset(), this.lastNotifiedSelectionState = null, this.finishSelectionNotificationChain(), this.acquisition.destroy(), this.wrapper.remove();
|
|
7474
7619
|
}
|
|
7475
7620
|
assertOpen() {
|
|
@@ -7478,17 +7623,17 @@ var Ss = class {
|
|
|
7478
7623
|
destroyedError() {
|
|
7479
7624
|
return /* @__PURE__ */ Error(this._mountKind === "sheet" ? "XlsxSheetViewer is destroyed" : "XlsxViewer is destroyed");
|
|
7480
7625
|
}
|
|
7481
|
-
},
|
|
7626
|
+
}, Fs = class e extends Ps {
|
|
7482
7627
|
static fromWorkbook(t, n, r = {}) {
|
|
7483
7628
|
return new e(t, {
|
|
7484
7629
|
...r,
|
|
7485
|
-
[
|
|
7630
|
+
[Qo]: n
|
|
7486
7631
|
});
|
|
7487
7632
|
}
|
|
7488
7633
|
constructor(e, t = {}) {
|
|
7489
7634
|
super(e, t, { kind: "composite" });
|
|
7490
7635
|
}
|
|
7491
|
-
},
|
|
7636
|
+
}, Is = class e {
|
|
7492
7637
|
engine;
|
|
7493
7638
|
canvasMount;
|
|
7494
7639
|
destroyed = !1;
|
|
@@ -7497,16 +7642,16 @@ var Ss = class {
|
|
|
7497
7642
|
static fromWorkbook(t, n, r = {}) {
|
|
7498
7643
|
return new e(t, {
|
|
7499
7644
|
...r,
|
|
7500
|
-
[
|
|
7645
|
+
[Qo]: n
|
|
7501
7646
|
});
|
|
7502
7647
|
}
|
|
7503
7648
|
constructor(e, t = {}) {
|
|
7504
7649
|
this.canvasElement = e;
|
|
7505
|
-
let n = t[
|
|
7650
|
+
let n = t[Qo], r = Ce("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
|
|
7506
7651
|
this.canvasMount = new Ee(e, {
|
|
7507
7652
|
wrapperCssText: `position:relative;display:inline-block;vertical-align:top;overflow:hidden;width:${e.style.width || `${i.width || e.width}px`};height:${e.style.height || `${i.height || e.height}px`};`,
|
|
7508
7653
|
restoreMode: "style-and-bitmap"
|
|
7509
|
-
}), this.engine = new
|
|
7654
|
+
}), this.engine = new Ps(this.canvasMount.wrapper, {
|
|
7510
7655
|
...t,
|
|
7511
7656
|
onResourceMetrics: (e) => {
|
|
7512
7657
|
this.lastMetrics = e, t.onResourceMetrics?.(e);
|
|
@@ -7663,20 +7808,20 @@ var Ss = class {
|
|
|
7663
7808
|
destroyedError() {
|
|
7664
7809
|
return /* @__PURE__ */ Error("XlsxSheetViewer is destroyed");
|
|
7665
7810
|
}
|
|
7666
|
-
},
|
|
7811
|
+
}, Ls = /* @__PURE__ */ e({
|
|
7667
7812
|
MAX_SELECTION_AREAS: () => 128,
|
|
7668
|
-
MAX_SELECTION_CONTEXT_CELLS: () =>
|
|
7669
|
-
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () =>
|
|
7813
|
+
MAX_SELECTION_CONTEXT_CELLS: () => _o,
|
|
7814
|
+
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () => vo,
|
|
7670
7815
|
OoxmlDecodedImageLimitError: () => l,
|
|
7671
7816
|
OoxmlError: () => re,
|
|
7672
7817
|
OoxmlResourceLimitError: () => le,
|
|
7673
|
-
XlsxSheetViewer: () =>
|
|
7674
|
-
XlsxViewer: () =>
|
|
7675
|
-
XlsxWorkbook: () =>
|
|
7818
|
+
XlsxSheetViewer: () => Is,
|
|
7819
|
+
XlsxViewer: () => Fs,
|
|
7820
|
+
XlsxWorkbook: () => Xa,
|
|
7676
7821
|
autoResize: () => ke,
|
|
7677
7822
|
isOoxmlDecodedImageLimitError: () => f,
|
|
7678
7823
|
openExternalHyperlink: () => O,
|
|
7679
7824
|
resolveSharedStrings: () => Ye
|
|
7680
7825
|
});
|
|
7681
7826
|
//#endregion
|
|
7682
|
-
export {
|
|
7827
|
+
export { _o as a, go as i, Is as n, vo as o, Fs as r, Xa as s, Ls as t };
|