@silurus/ooxml 0.73.2 → 0.74.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.
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./chunk-DmhlhrBa.js";
2
- import { At as t, B as n, Bt as r, C as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, L as v, Lt as y, M as b, Mt as x, N as S, Nt as C, Ot as w, P as T, Pt as E, R as D, Rt as O, S as ee, T as k, Tt as A, U as j, Ut as te, V as M, W as N, Y as P, Yt as F, _ as I, _t as L, at as R, b as z, d as B, et as V, f as H, h as U, i as ne, jt as W, k as re, kt as ie, l as ae, lt as oe, m as se, mt as ce, n as le, nt as ue, o as G, p as de, q as fe, qt as K, r as pe, rt as me, t as he, ut as q, v as ge, vt as _e, w as ve, x as ye, xt as J, zt as be } from "./find-cursor-CaGrVs7z.js";
3
- import { a as xe, i as Se, n as Ce, r as we, t as Te } from "./visible-index-CyuaF_ZP.js";
2
+ import { At as t, B as n, Bt as r, C as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, L as v, Lt as y, M as b, Mt as x, N as S, Nt as C, Ot as w, P as T, Pt as E, R as D, Rt as O, S as ee, T as k, Tt as A, U as j, Ut as te, V as M, W as N, Y as P, Yt as F, _ as I, _t as L, at as R, b as z, d as B, et as V, f as H, h as U, i as ne, jt as W, k as re, kt as ie, l as ae, lt as oe, m as se, mt as ce, n as le, nt as ue, o as G, p as de, q as fe, qt as K, r as pe, rt as me, t as he, ut as q, v as ge, vt as _e, w as ve, x as ye, xt as J, zt as be } from "./find-cursor-DtgyGs5V.js";
3
+ import { a as xe, i as Se, n as Ce, r as we, t as Te } from "./visible-index-C3_3gBg-.js";
4
4
  import { t as Ee } from "./mathjax-BPjQ2C_j.js";
5
5
  //#region packages/core/src/sparkline/renderer.ts
6
6
  function De(e, t, n) {
@@ -3299,30 +3299,42 @@ function di(e, t, n, r, i, a, o, s, c, l, u, d, f) {
3299
3299
  let i = r.fromCol + 1, p = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n / W, b = jr(t, p, n) + r.fromRowOff * n / W, x = Ar(t, _, n) + r.toColOff * n / W, S = jr(t, v, n) + r.toRowOff * n / W, C = x - y, w = S - b;
3300
3300
  if (C <= 0 || w <= 0) continue;
3301
3301
  let T = jn(s + (y - m) - a, C, f, d), E = c + (b - h) - o;
3302
- T + C < g || T > g + l || E + w < c || E > c + u || (e.save(), e.beginPath(), e.rect(g, c, l, u), e.clip(), fi(e, r.caption, r.items, T, E, C, w, n), e.restore());
3303
- }
3304
- }
3305
- function fi(e, t, n, r, i, a, o, s) {
3306
- e.fillStyle = ti, e.fillRect(r, i, a, o), e.strokeStyle = ni, e.lineWidth = 1, e.strokeRect(r + .5, i + .5, a - 1, o - 1);
3307
- let c = Math.max(20 * s, 14);
3308
- e.fillStyle = ri, e.fillRect(r + 1, i + 1, a - 2, c), e.fillStyle = ii, e.font = pi($r, s), e.textBaseline = "middle", e.textAlign = "left";
3309
- let l = 6 * s;
3310
- if (mi(e, t, r + l, i + c / 2 + 1, a - 2 * l), n.length === 0) return;
3311
- let u = Math.max(1, Math.round(2 * s)), d = 4 * s, f = r + d, p = i + c + d, m = a - 2 * d, h = o - c - 2 * d;
3312
- if (m <= 0 || h <= 0) return;
3313
- let g = Math.max(18 * s, 16), _ = Math.max(1, Math.floor((h + u) / (g + u))), v = Math.min(n.length, _), y = Math.min(g, (h - u * (v - 1)) / v);
3314
- if (y <= 0) return;
3315
- e.font = pi(ei, s);
3316
- let b = 8 * s;
3317
- for (let t = 0; t < v; t++) {
3318
- let r = n[t], i = p + t * (y + u), a = r.selected;
3319
- e.fillStyle = a ? ai : ci, e.fillRect(f, i, m, y), e.strokeStyle = a ? si : ui, e.lineWidth = 1, e.strokeRect(f + .5, i + .5, m - 1, y - 1), e.fillStyle = a ? oi : li, mi(e, r.name, f + b, i + y / 2 + 1, m - 2 * b);
3320
- }
3321
- }
3322
- function pi(e, t) {
3302
+ T + C < g || T > g + l || E + w < c || E > c + u || (e.save(), e.beginPath(), e.rect(g, c, l, u), e.clip(), fi(e, r.caption, r.items, T, E, C, w, n, r.style), e.restore());
3303
+ }
3304
+ }
3305
+ function fi(e, t, n, r, i, a, o, s, c) {
3306
+ let l = c != null;
3307
+ e.fillStyle = c?.whole?.fillColor ?? ti, e.fillRect(r, i, a, o);
3308
+ let u = l ? c.whole?.borderColor : ni;
3309
+ u && (e.strokeStyle = u, e.lineWidth = 1, e.strokeRect(r + .5, i + .5, a - 1, o - 1));
3310
+ let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor : ri;
3311
+ f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ?? ii, e.font = mi(c?.header, $r, s), e.textBaseline = "middle", e.textAlign = "left";
3312
+ let p = 6 * s;
3313
+ if (gi(e, t, r + p, i + d / 2 + 1, a - 2 * p), n.length === 0) return;
3314
+ 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;
3315
+ if (v <= 0 || y <= 0) return;
3316
+ 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);
3317
+ if (C <= 0) return;
3318
+ e.font = hi(ei, s);
3319
+ let w = 8 * s;
3320
+ for (let t = 0; t < S; t++) {
3321
+ let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ? ai : ci), d = l ? o?.borderColor : a ? si : ui;
3322
+ e.fillStyle = u, l ? (pi(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 = mi(o, ei, s), e.fillStyle = o?.fontColor ?? (a ? oi : li), gi(e, r.name, g + w, i + C / 2 + 1, v - 2 * w);
3323
+ }
3324
+ }
3325
+ function pi(e, t, n, r, i, a) {
3326
+ let o = Math.max(0, Math.min(a, r / 2, i / 2));
3327
+ 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();
3328
+ }
3329
+ function mi(e, t, n) {
3330
+ if (!e) return hi(t, n);
3331
+ let r = Math.round((e.fontSize ?? 11) * n);
3332
+ return `${e.fontBold ? "bold " : ""}${r}px ${e.fontFamily ? `"${e.fontFamily}", "Segoe UI", sans-serif` : "\"Meiryo UI\", \"Segoe UI\", sans-serif"}`;
3333
+ }
3334
+ function hi(e, t) {
3323
3335
  return e.replace(/(\d+(?:\.\d+)?)px/, (e, n) => `${Math.round(Number(n) * t)}px`);
3324
3336
  }
3325
- function mi(e, t, n, r, i) {
3337
+ function gi(e, t, n, r, i) {
3326
3338
  if (i <= 0) return;
3327
3339
  let a = t;
3328
3340
  if (e.measureText(a).width > i) {
@@ -3333,7 +3345,7 @@ function mi(e, t, n, r, i) {
3333
3345
  }
3334
3346
  //#endregion
3335
3347
  //#region packages/xlsx/src/render-orchestrator.ts
3336
- async function hi(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
3348
+ async function _i(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
3337
3349
  let l = t === "image/svg+xml", u = ue(t, o, i, a), d = () => xe(e, t, s, r, {
3338
3350
  widthPt: u.widthPt,
3339
3351
  heightPt: u.heightPt,
@@ -3349,7 +3361,7 @@ async function hi(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
3349
3361
  }
3350
3362
  return l ? q(e, r) : d();
3351
3363
  }
3352
- async function gi(e, n, r, i) {
3364
+ async function vi(e, n, r, i) {
3353
3365
  if (!r) return;
3354
3366
  let a = r, o = /* @__PURE__ */ new Map();
3355
3367
  if (e.images) for (let n of e.images) o.set(bn(n.imagePath, n.duotone), {
@@ -3372,24 +3384,24 @@ async function gi(e, n, r, i) {
3372
3384
  });
3373
3385
  o.size !== 0 && await Promise.all([...o.entries()].map(async ([e, t]) => {
3374
3386
  try {
3375
- let r = await hi(t.imagePath, t.mimeType, t.svgImagePath, a, t.widthPt, t.heightPt, t.srcRect, t.duotone, i?.offscreenFactory);
3387
+ let r = await _i(t.imagePath, t.mimeType, t.svgImagePath, a, t.widthPt, t.heightPt, t.srcRect, t.duotone, i?.offscreenFactory);
3376
3388
  n.set(e, r);
3377
3389
  } catch {
3378
3390
  n.delete(e);
3379
3391
  }
3380
3392
  }));
3381
3393
  }
3382
- async function _i(e, t, n, r = {}) {
3394
+ async function yi(e, t, n, r = {}) {
3383
3395
  let i = r.fetchImage ? me(r.fetchImage) : void 0;
3384
3396
  try {
3385
- await vi(e, t, n, r);
3397
+ await bi(e, t, n, r);
3386
3398
  } finally {
3387
3399
  i?.();
3388
3400
  }
3389
3401
  }
3390
- async function vi(e, t, n, r = {}) {
3402
+ async function bi(e, t, n, r = {}) {
3391
3403
  let { ws: i, styles: a, imageCache: o } = e;
3392
- await gi(i, o, r.fetchImage), e.math && Vr(i) && await Hr(i, e.math);
3404
+ await vi(i, o, r.fetchImage), e.math && Vr(i) && await Hr(i, e.math);
3393
3405
  let s = r.dpr ?? _(), c = fe(t) ? t.clientWidth || 800 : t.width, l = fe(t) ? t.clientHeight || 600 : t.height, u = r.width ?? c, d = r.height ?? l, f = N(u * s, d * s), p = f.clamped ? s * f.scale : s, m = f.width, h = f.height;
3394
3406
  if (t.width !== m && (t.width = m), t.height !== h && (t.height = h), fe(t)) {
3395
3407
  let e = `${u}px`, n = `${d}px`;
@@ -3397,7 +3409,7 @@ async function vi(e, t, n, r = {}) {
3397
3409
  }
3398
3410
  let g = t.getContext("2d");
3399
3411
  if (g.setTransform(p, 0, 0, p, 0, 0), i.parseError) {
3400
- yi(g, u, d, i.name, i.parseError);
3412
+ xi(g, u, d, i.name, i.parseError);
3401
3413
  return;
3402
3414
  }
3403
3415
  Or(g, i, a, n, {
@@ -3406,7 +3418,7 @@ async function vi(e, t, n, r = {}) {
3406
3418
  loadedImages: o
3407
3419
  });
3408
3420
  }
3409
- function yi(e, t, n, r, i) {
3421
+ function xi(e, t, n, r, i) {
3410
3422
  e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
3411
3423
  let a = t / 2, o = Math.min(t, n), s = Math.max(20, o * .1);
3412
3424
  e.fillStyle = "#b23b3b", e.textAlign = "center", e.textBaseline = "middle", e.font = `${s}px sans-serif`, e.fillText("⚠", a, n * .32);
@@ -3426,23 +3438,23 @@ function yi(e, t, n, r, i) {
3426
3438
  }
3427
3439
  //#endregion
3428
3440
  //#region packages/xlsx/src/google-fonts.ts
3429
- var bi = {
3441
+ var Si = {
3430
3442
  ...r,
3431
3443
  ...u
3432
3444
  };
3433
- function* xi(e) {
3445
+ function* Ci(e) {
3434
3446
  for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
3435
3447
  else yield t.text;
3436
3448
  }
3437
- function Si(e) {
3449
+ function wi(e) {
3438
3450
  let t = /* @__PURE__ */ new Set(), n = null;
3439
3451
  for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= y(r.name));
3440
- for (let r of be(xi(e), n)) t.add(r);
3452
+ for (let r of be(Ci(e), n)) t.add(r);
3441
3453
  return t;
3442
3454
  }
3443
3455
  //#endregion
3444
3456
  //#region packages/xlsx/src/shared-strings.ts
3445
- function Ci(e, t) {
3457
+ function Ti(e, t) {
3446
3458
  for (let n of e.rows) for (let e of n.cells) {
3447
3459
  let n = e.value;
3448
3460
  if (n.type === "shared") {
@@ -3461,7 +3473,7 @@ function Ci(e, t) {
3461
3473
  }
3462
3474
  return e;
3463
3475
  }
3464
- function wi(e) {
3476
+ function Ei(e) {
3465
3477
  let t = (e ?? "").trim();
3466
3478
  if (!t) return {
3467
3479
  kind: "unresolved",
@@ -3500,7 +3512,7 @@ function wi(e) {
3500
3512
  formula: t
3501
3513
  };
3502
3514
  }
3503
- function Ti(e, t) {
3515
+ function Di(e, t) {
3504
3516
  if (e.kind === "inline") return {
3505
3517
  kind: "values",
3506
3518
  values: e.values
@@ -3519,7 +3531,7 @@ function Ti(e, t) {
3519
3531
  values: n
3520
3532
  };
3521
3533
  }
3522
- function Ei(e) {
3534
+ function Oi(e) {
3523
3535
  let { cell: t, panel: n, viewport: r, rtl: i } = e, a = t.y + t.h + 2, o = t.y - 2 - n.h, s;
3524
3536
  s = a + n.h <= r.h ? a : o >= 0 ? o : a, s = Math.max(0, Math.min(s, r.h - n.h));
3525
3537
  let c = i ? t.x + t.w - n.w : t.x;
@@ -3530,7 +3542,7 @@ function Ei(e) {
3530
3542
  }
3531
3543
  //#endregion
3532
3544
  //#region packages/xlsx/src/workbook.ts
3533
- var Di = class e {
3545
+ var ki = class e {
3534
3546
  worker;
3535
3547
  bridge;
3536
3548
  parsedWorkbook = null;
@@ -3564,7 +3576,7 @@ var Di = class e {
3564
3576
  i = await e.arrayBuffer();
3565
3577
  } else i = t;
3566
3578
  i = g(await K(i, n.password));
3567
- let a = new e(r === "worker" ? (await import("./render-worker-host-Custze53.js")).createRenderWorker() : new Pe(), r, n.wasmUrl);
3579
+ let a = new e(r === "worker" ? (await import("./render-worker-host-B-Y1DmN9.js")).createRenderWorker() : new Pe(), r, n.wasmUrl);
3568
3580
  return await a._load(i, n), a;
3569
3581
  }
3570
3582
  async _load(e, t = {}) {
@@ -3587,7 +3599,7 @@ var Di = class e {
3587
3599
  this.parsedWorkbook = JSON.parse(new TextDecoder().decode(new Uint8Array(e)));
3588
3600
  }
3589
3601
  let r = this.parsedWorkbook?.workbook.parseError;
3590
- r && console.warn(`[ooxml] xlsx opened with a degraded part: ${r}`), this._mode === "main" && t.useGoogleFonts && (this.googleFontFaces = await p(Si(this.parsedWorkbook), bi));
3602
+ r && console.warn(`[ooxml] xlsx opened with a degraded part: ${r}`), this._mode === "main" && t.useGoogleFonts && (this.googleFontFaces = await p(wi(this.parsedWorkbook), Si));
3591
3603
  }
3592
3604
  get sheetNames() {
3593
3605
  return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
@@ -3622,7 +3634,7 @@ var Di = class e {
3622
3634
  let { worksheetJson: e } = r;
3623
3635
  i = JSON.parse(new TextDecoder().decode(new Uint8Array(e)));
3624
3636
  }
3625
- return Ci(i, this.parsedWorkbook.sharedStrings), this.sheetCache.set(e, i), i;
3637
+ return Ti(i, this.parsedWorkbook.sharedStrings), this.sheetCache.set(e, i), i;
3626
3638
  }
3627
3639
  async getImage(e, t) {
3628
3640
  let n = this.imageBlobCache.get(e);
@@ -3645,8 +3657,8 @@ var Di = class e {
3645
3657
  }
3646
3658
  async resolveValidationList(e, t) {
3647
3659
  if (!this.parsedWorkbook) throw Error("Workbook not loaded");
3648
- let n = wi(t);
3649
- if (n.kind !== "range") return Ti(n, () => null);
3660
+ let n = Ei(t);
3661
+ if (n.kind !== "range") return Di(n, () => null);
3650
3662
  let r = e;
3651
3663
  if (n.sheet) {
3652
3664
  let e = this.sheetNames.findIndex((e) => e.toLowerCase() === n.sheet?.toLowerCase());
@@ -3658,7 +3670,7 @@ var Di = class e {
3658
3670
  }
3659
3671
  let i = await this.getWorksheet(r), a = this.parsedWorkbook.styles, o = /* @__PURE__ */ new Map();
3660
3672
  for (let e of i.rows) for (let t of e.cells) o.set(`${t.row}:${t.col}`, t);
3661
- return Ti(n, (e, t) => {
3673
+ return Di(n, (e, t) => {
3662
3674
  let n = o.get(`${e}:${t}`);
3663
3675
  return n ? bt(n, a, null, i.date1904) : null;
3664
3676
  });
@@ -3669,7 +3681,7 @@ var Di = class e {
3669
3681
  async renderViewport(e, t, n, r = {}) {
3670
3682
  if (this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
3671
3683
  if (!this.parsedWorkbook) throw Error("Workbook not loaded");
3672
- return _i({
3684
+ return yi({
3673
3685
  ws: this.sheetCache.get(t) ?? await this.getWorksheet(t),
3674
3686
  styles: this.parsedWorkbook.styles,
3675
3687
  imageCache: this.imageCache,
@@ -3703,7 +3715,7 @@ var Di = class e {
3703
3715
  };
3704
3716
  //#endregion
3705
3717
  //#region packages/xlsx/src/data-validation.ts
3706
- function Oi(e, t, n) {
3718
+ function Ai(e, t, n) {
3707
3719
  if (!e) return !1;
3708
3720
  for (let r of e.split(/\s+/)) {
3709
3721
  if (!r) continue;
@@ -3720,14 +3732,14 @@ function Oi(e, t, n) {
3720
3732
  }
3721
3733
  return !1;
3722
3734
  }
3723
- function ki(e, t, n) {
3735
+ function ji(e, t, n) {
3724
3736
  if (!e) return null;
3725
- for (let r of e) if (r.validationType === "list" && Oi(r.sqref, t, n)) return r;
3737
+ for (let r of e) if (r.validationType === "list" && Ai(r.sqref, t, n)) return r;
3726
3738
  return null;
3727
3739
  }
3728
3740
  //#endregion
3729
3741
  //#region packages/xlsx/src/find.ts
3730
- var Ai = class {
3742
+ var Mi = class {
3731
3743
  _matches = [];
3732
3744
  _active = -1;
3733
3745
  constructor(e, t, n) {
@@ -3807,7 +3819,7 @@ var Ai = class {
3807
3819
  } : null;
3808
3820
  }
3809
3821
  };
3810
- function ji(e) {
3822
+ function Ni(e) {
3811
3823
  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;
3812
3824
  l = i ? c ? o : s ? a : o : s ? a : c ? o : a, l = Math.max(0, Math.min(l, r.w - n.w));
3813
3825
  let u = t.y;
@@ -3816,10 +3828,10 @@ function ji(e) {
3816
3828
  top: u
3817
3829
  };
3818
3830
  }
3819
- function Mi(e) {
3831
+ function Pi(e) {
3820
3832
  return e > 0 ? (e + 1) * 19 : 0;
3821
3833
  }
3822
- function Ni(e, t) {
3834
+ function Fi(e, t) {
3823
3835
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
3824
3836
  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);
3825
3837
  let o = i, s = [];
@@ -3833,15 +3845,15 @@ function Ni(e, t) {
3833
3845
  for (let i = 1; i <= o + 1; i++) c(i) >= e ? n ? n.end = i : n = {
3834
3846
  start: i,
3835
3847
  end: i
3836
- } : n &&= (s.push(Pi(e, n, t, r, c)), null);
3837
- n && s.push(Pi(e, n, t, r, c));
3848
+ } : n &&= (s.push(Ii(e, n, t, r, c)), null);
3849
+ n && s.push(Ii(e, n, t, r, c));
3838
3850
  }
3839
3851
  return {
3840
3852
  maxLevel: a,
3841
3853
  groups: s
3842
3854
  };
3843
3855
  }
3844
- function Pi(e, t, n, r, i) {
3856
+ function Ii(e, t, n, r, i) {
3845
3857
  let a = null;
3846
3858
  if (n) {
3847
3859
  let n = t.end + 1;
@@ -3859,7 +3871,7 @@ function Pi(e, t, n, r, i) {
3859
3871
  collapsed: o
3860
3872
  };
3861
3873
  }
3862
- function Fi(e, t) {
3874
+ function Li(e, t) {
3863
3875
  let n = !e.collapsed, r = /* @__PURE__ */ new Map();
3864
3876
  for (let e of t) r.set(e.index, e);
3865
3877
  let i = [], a = [];
@@ -3867,7 +3879,7 @@ function Fi(e, t) {
3867
3879
  else {
3868
3880
  let n = /* @__PURE__ */ new Set();
3869
3881
  for (let r of t) r.index >= e.start && r.index <= e.end && r.collapsed && n.add(r.index);
3870
- for (let t = e.start; t <= e.end; t++) Ii(t, e, r, n) || a.push(t);
3882
+ for (let t = e.start; t <= e.end; t++) Ri(t, e, r, n) || a.push(t);
3871
3883
  }
3872
3884
  return {
3873
3885
  hide: i,
@@ -3875,7 +3887,7 @@ function Fi(e, t) {
3875
3887
  nowCollapsed: n
3876
3888
  };
3877
3889
  }
3878
- function Ii(e, t, n, r) {
3890
+ function Ri(e, t, n, r) {
3879
3891
  let i = n.get(e)?.level ?? 0;
3880
3892
  if (i <= t.level) return !1;
3881
3893
  for (let e of r) {
@@ -3884,7 +3896,7 @@ function Ii(e, t, n, r) {
3884
3896
  }
3885
3897
  return !1;
3886
3898
  }
3887
- function Li(e, t) {
3899
+ function zi(e, t) {
3888
3900
  let n = [], r = [];
3889
3901
  for (let i of e) i.level >= t ? n.push(i.index) : r.push(i.index);
3890
3902
  return {
@@ -3892,7 +3904,7 @@ function Li(e, t) {
3892
3904
  show: r
3893
3905
  };
3894
3906
  }
3895
- function Ri(e) {
3907
+ function Bi(e) {
3896
3908
  let t = [];
3897
3909
  for (let n of e.rows) {
3898
3910
  let e = n.outlineLevel ?? 0, r = n.collapsed ?? !1;
@@ -3905,7 +3917,7 @@ function Ri(e) {
3905
3917
  }
3906
3918
  return t;
3907
3919
  }
3908
- function zi(e) {
3920
+ function Vi(e) {
3909
3921
  let t = e.colOutlineLevels ?? {}, n = e.colCollapsed ?? {}, r = e.colHidden ?? {}, i = /* @__PURE__ */ new Set();
3910
3922
  for (let e of Object.keys(t)) i.add(Number(e));
3911
3923
  for (let e of Object.keys(n)) i.add(Number(e));
@@ -3918,19 +3930,19 @@ function zi(e) {
3918
3930
  });
3919
3931
  return a;
3920
3932
  }
3921
- function Bi(e, t) {
3933
+ function Hi(e, t) {
3922
3934
  let n = e.outlinePr;
3923
3935
  return n ? t === "row" ? n.summaryBelow : n.summaryRight : !0;
3924
3936
  }
3925
3937
  //#endregion
3926
3938
  //#region packages/xlsx/src/viewer.ts
3927
- var Vi = 150, Hi = 280, Ui = 200, Wi = 240, Gi = 200, Ki = 30, qi = 1, Ji = .45, Yi = "data-xlsx-viewer-styles", Xi = ".xlsx-tab-strip::-webkit-scrollbar{display: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;}";
3928
- function Zi() {
3929
- if (typeof document > "u" || !document.head || document.head.querySelector(`style[${Yi}]`)) return;
3939
+ var Ui = 150, Wi = 280, Gi = 200, Ki = 240, qi = 200, Ji = 30, Yi = 1, Xi = .45, Zi = "data-xlsx-viewer-styles", Qi = ".xlsx-tab-strip::-webkit-scrollbar{display: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;}";
3940
+ function $i() {
3941
+ if (typeof document > "u" || !document.head || document.head.querySelector(`style[${Zi}]`)) return;
3930
3942
  let e = document.createElement("style");
3931
- e.setAttribute(Yi, ""), e.textContent = Xi, document.head.appendChild(e);
3943
+ e.setAttribute(Zi, ""), e.textContent = Qi, document.head.appendChild(e);
3932
3944
  }
3933
- var Qi = class {
3945
+ var ea = class {
3934
3946
  idxs;
3935
3947
  cumDelta;
3936
3948
  constructor(e, t, n, r) {
@@ -3971,28 +3983,28 @@ var Qi = class {
3971
3983
  sizeOf(e) {
3972
3984
  return this.offsetOf(e + 1) - this.offsetOf(e);
3973
3985
  }
3974
- }, $i = "#1a73e8", ea = 4, ta = 5;
3975
- function na(e, t, n, r) {
3986
+ }, ta = "#1a73e8", na = 4, ra = 5;
3987
+ function ia(e, t, n, r) {
3976
3988
  for (let { index: i, edge: a } of t) if (!(a <= r) && Math.abs(e - a) <= n) return i;
3977
3989
  return null;
3978
3990
  }
3979
- function ra(e) {
3991
+ function aa(e) {
3980
3992
  return {
3981
3993
  border: `2px solid ${e}`,
3982
3994
  background: `color-mix(in srgb, ${e} 8%, transparent)`
3983
3995
  };
3984
3996
  }
3985
- var ia = /* @__PURE__ */ new WeakMap();
3986
- function aa(e, t) {
3987
- let n = ia.get(e);
3997
+ var oa = /* @__PURE__ */ new WeakMap();
3998
+ function sa(e, t) {
3999
+ let n = oa.get(e);
3988
4000
  if (n) return n;
3989
4001
  let r = {
3990
- col: new Qi(e.colWidths, Q(e.defaultColWidth, t), (e) => Q(e, t), 16384),
3991
- row: new Qi(e.rowHeights, $(e.defaultRowHeight), (e) => $(e), 1048576)
4002
+ col: new ea(e.colWidths, Q(e.defaultColWidth, t), (e) => Q(e, t), 16384),
4003
+ row: new ea(e.rowHeights, $(e.defaultRowHeight), (e) => $(e), 1048576)
3992
4004
  };
3993
- return ia.set(e, r), r;
4005
+ return oa.set(e, r), r;
3994
4006
  }
3995
- var oa = class {
4007
+ var ca = class {
3996
4008
  wb = null;
3997
4009
  wrapper;
3998
4010
  canvas;
@@ -4059,15 +4071,15 @@ var oa = class {
4059
4071
  constructor(e, t = {}) {
4060
4072
  this.opts = t, this._mode = t.mode ?? "main", this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;width:100%;height:100%;border:1px solid #c8ccd0;background:#fff;box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;", this.gridRegion = document.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;";
4061
4073
  let n = "position:absolute;top:0;left:0;z-index:3;display:none;background:#f5f5f5;";
4062
- this.cornerGutter = document.createElement("canvas"), this.cornerGutter.style.cssText = n, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = document.createElement("canvas"), this.colGutter.style.cssText = n, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = document.createElement("canvas"), this.rowGutter.style.cssText = n, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = document.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = document.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this._mode === "worker" && (this._bitmapCtx = this.canvas.getContext("bitmaprenderer")), this.selectionOverlay = document.createElement("div"), this.selectionOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.findOverlay = document.createElement("div"), this.findOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.scrollHost = document.createElement("div"), this.scrollHost.style.cssText = "position:absolute;inset:0;overflow:auto;z-index:2;background:transparent;", this.spacer = document.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this.scrollHost.appendChild(this.spacer), this.commentPopup = document.createElement("div"), this.commentPopup.style.cssText = `position:absolute;z-index:3;pointer-events:none;display:none;max-width:${Hi}px;max-height:${Ui}px;overflow:hidden;box-sizing:border-box;padding:6px 8px;background:#fffbcc;border:1px solid #b8b8a0;box-shadow:1px 2px 5px rgba(0,0,0,0.25);font:12px/1.4 sans-serif;color:#222;white-space:pre-wrap;word-break:break-word;`, this.validationPanel = document.createElement("div"), this.validationPanel.setAttribute("data-xlsx-validation-panel", ""), this.validationPanel.style.cssText = `position:absolute;z-index:4;pointer-events:auto;display:none;min-width:80px;max-width:${Wi}px;max-height:${Gi}px;overflow-y:auto;box-sizing:border-box;background:#fff;border:1px solid #7f7f7f;box-shadow:1px 2px 5px rgba(0,0,0,0.25);font:12px/1.4 sans-serif;color:#222;`, this.validationPanel.addEventListener("wheel", (e) => e.stopPropagation()), this.canvasArea.appendChild(this.canvas), this.canvasArea.appendChild(this.selectionOverlay), this.canvasArea.appendChild(this.findOverlay), this.canvasArea.appendChild(this.scrollHost), this.canvasArea.appendChild(this.commentPopup), this.canvasArea.appendChild(this.validationPanel);
4074
+ this.cornerGutter = document.createElement("canvas"), this.cornerGutter.style.cssText = n, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = document.createElement("canvas"), this.colGutter.style.cssText = n, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = document.createElement("canvas"), this.rowGutter.style.cssText = n, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = document.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = document.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this._mode === "worker" && (this._bitmapCtx = this.canvas.getContext("bitmaprenderer")), this.selectionOverlay = document.createElement("div"), this.selectionOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.findOverlay = document.createElement("div"), this.findOverlay.style.cssText = "position:absolute;top:0;left:0;z-index:1;pointer-events:none;overflow:hidden;width:100%;height:100%;", this.scrollHost = document.createElement("div"), this.scrollHost.style.cssText = "position:absolute;inset:0;overflow:auto;z-index:2;background:transparent;", this.spacer = document.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this.scrollHost.appendChild(this.spacer), this.commentPopup = document.createElement("div"), this.commentPopup.style.cssText = `position:absolute;z-index:3;pointer-events:none;display:none;max-width:${Wi}px;max-height:${Gi}px;overflow:hidden;box-sizing:border-box;padding:6px 8px;background:#fffbcc;border:1px solid #b8b8a0;box-shadow:1px 2px 5px rgba(0,0,0,0.25);font:12px/1.4 sans-serif;color:#222;white-space:pre-wrap;word-break:break-word;`, this.validationPanel = document.createElement("div"), this.validationPanel.setAttribute("data-xlsx-validation-panel", ""), this.validationPanel.style.cssText = `position:absolute;z-index:4;pointer-events:auto;display:none;min-width:80px;max-width:${Ki}px;max-height:${qi}px;overflow-y:auto;box-sizing:border-box;background:#fff;border:1px solid #7f7f7f;box-shadow:1px 2px 5px rgba(0,0,0,0.25);font:12px/1.4 sans-serif;color:#222;`, this.validationPanel.addEventListener("wheel", (e) => e.stopPropagation()), this.canvasArea.appendChild(this.canvas), this.canvasArea.appendChild(this.selectionOverlay), this.canvasArea.appendChild(this.findOverlay), this.canvasArea.appendChild(this.scrollHost), this.canvasArea.appendChild(this.commentPopup), this.canvasArea.appendChild(this.validationPanel);
4063
4075
  let r = Math.round(50 * (this.opts.cellScale ?? 1));
4064
- this.tabBar = document.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${Ki}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";
4076
+ this.tabBar = document.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${Ji}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";
4065
4077
  let i = document.createElement("div");
4066
- i.style.cssText = `display:flex;flex-shrink:0;width:${r}px;height:100%;`, i.appendChild(this.navPrev), i.appendChild(this.navNext), this.navGroup = i, this.tabStrip = document.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:flex;align-items:flex-end;flex:1;min-width:0;height:100%;margin-left:${qi}px;overflow-x:auto;overflow-y:hidden;gap:${qi}px;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), Zi(), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabBar.appendChild(i), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl()), this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), 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.scrollHost.addEventListener("scroll", () => {
4078
+ i.style.cssText = `display:flex;flex-shrink:0;width:${r}px;height:100%;`, i.appendChild(this.navPrev), i.appendChild(this.navNext), this.navGroup = i, this.tabStrip = document.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:flex;align-items:flex-end;flex:1;min-width:0;height:100%;margin-left:${Yi}px;overflow-x:auto;overflow-y:hidden;gap:${Yi}px;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), $i(), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabBar.appendChild(i), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl()), this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), 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.scrollHost.addEventListener("scroll", () => {
4067
4079
  this.pendingTap = null, this.hideCommentPopup(), this.hideValidationPanel(), this.scrollHost.clientWidth > 0 && (this.effectiveH = this.effectiveScrollLeft), this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay();
4068
4080
  }), this.resizeObserver = new ResizeObserver(() => {
4069
4081
  this.reanchorHorizontalScroll(), this.layoutGutters(), this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.updateNavButtons();
4070
- }), this.resizeObserver.observe(this.gridRegion), this.setupSelectionEvents(), this._find = new Ai(() => this.sheetCount, (e) => this.wb?.sheetNames[e] ?? "", (e) => this._collectSheetCells(e));
4082
+ }), this.resizeObserver.observe(this.gridRegion), this.setupSelectionEvents(), this._find = new Mi(() => this.sheetCount, (e) => this.wb?.sheetNames[e] ?? "", (e) => this._collectSheetCells(e));
4071
4083
  }
4072
4084
  async _collectSheetCells(e) {
4073
4085
  let t = this.wb;
@@ -4086,7 +4098,7 @@ var oa = class {
4086
4098
  async load(e) {
4087
4099
  let t = ++this._loadGen, n = this.wb;
4088
4100
  try {
4089
- let r = await Di.load(e, {
4101
+ let r = await ki.load(e, {
4090
4102
  useGoogleFonts: this.opts.useGoogleFonts,
4091
4103
  maxZipEntryBytes: this.opts.maxZipEntryBytes,
4092
4104
  workerTimeoutMs: this.opts.workerTimeoutMs,
@@ -4117,12 +4129,12 @@ var oa = class {
4117
4129
  this.currentSheet = e, this.scrollHost.scrollTop = 0, this.anchorCell = null, this.activeCell = null, this.selectionMode = "cells", this.hideCommentPopup(), this.hideValidationPanel(), this.updateSelectionOverlay(), this.updateTabActive(e), this.currentWorksheet = await this.workbook.getWorksheet(e), this.buildCommentMap(this.currentWorksheet), this.buildHyperlinkMap(this.currentWorksheet), this.buildOutline(this.currentWorksheet), this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), this.resetHorizontalScroll(), await this.renderCurrentSheet(), this.updateFindOverlay(), this.opts.onSheetChange?.(e, this.workbook.sheetNames.length);
4118
4130
  }
4119
4131
  buildOutline(e) {
4120
- this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands = Ri(e), this.colOutlineBands = zi(e);
4121
- let t = Ni(this.rowOutlineBands, Bi(e, "row")), n = Ni(this.colOutlineBands, Bi(e, "col"));
4132
+ this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands = Bi(e), this.colOutlineBands = Vi(e);
4133
+ let t = Fi(this.rowOutlineBands, Hi(e, "row")), n = Fi(this.colOutlineBands, Hi(e, "col"));
4122
4134
  this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
4123
4135
  }
4124
4136
  layoutGutters() {
4125
- let e = this.opts.cellScale ?? 1, t = this.rowOutline ? Math.round(Mi(this.rowOutline.maxLevel) * e) : 0, n = this.colOutline ? Math.round(Mi(this.colOutline.maxLevel) * e) : 0;
4137
+ let e = this.opts.cellScale ?? 1, t = this.rowOutline ? Math.round(Pi(this.rowOutline.maxLevel) * e) : 0, n = this.colOutline ? Math.round(Pi(this.colOutline.maxLevel) * e) : 0;
4126
4138
  this.gutter = {
4127
4139
  w: t,
4128
4140
  h: n
@@ -4226,7 +4238,7 @@ var oa = class {
4226
4238
  applyGroupToggle(e, t) {
4227
4239
  let n = this.currentWorksheet;
4228
4240
  if (!n) return;
4229
- let { hide: r, show: i, nowCollapsed: a } = Fi(e, t === "row" ? this.rowOutlineBands : this.colOutlineBands);
4241
+ let { hide: r, show: i, nowCollapsed: a } = Li(e, t === "row" ? this.rowOutlineBands : this.colOutlineBands);
4230
4242
  for (let e of r) this.setBandHidden(t, e, !0);
4231
4243
  for (let e of i) this.setBandHidden(t, e, !1);
4232
4244
  e.summary != null && this.setBandCollapsed(t, e.summary, a), this.afterOutlineMutation(n);
@@ -4234,7 +4246,7 @@ var oa = class {
4234
4246
  applyLevelButton(e, t) {
4235
4247
  let n = this.currentWorksheet;
4236
4248
  if (!n) return;
4237
- let { hide: r, show: i } = Li(t === "row" ? this.rowOutlineBands : this.colOutlineBands, e);
4249
+ let { hide: r, show: i } = zi(t === "row" ? this.rowOutlineBands : this.colOutlineBands, e);
4238
4250
  for (let e of r) this.setBandHidden(t, e, !0);
4239
4251
  for (let e of i) this.setBandHidden(t, e, !1);
4240
4252
  let a = t === "row" ? this.rowOutline : this.colOutline;
@@ -4280,11 +4292,11 @@ var oa = class {
4280
4292
  } else r.colCollapsed = r.colCollapsed ?? {}, n ? r.colCollapsed[t] = !0 : delete r.colCollapsed[t];
4281
4293
  }
4282
4294
  afterOutlineMutation(e) {
4283
- ia.delete(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender();
4295
+ oa.delete(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender();
4284
4296
  }
4285
4297
  buildOutlineLayoutOnly(e) {
4286
- this.rowOutlineBands = Ri(e), this.colOutlineBands = zi(e);
4287
- let t = Ni(this.rowOutlineBands, Bi(e, "row")), n = Ni(this.colOutlineBands, Bi(e, "col"));
4298
+ this.rowOutlineBands = Bi(e), this.colOutlineBands = Vi(e);
4299
+ let t = Fi(this.rowOutlineBands, Hi(e, "row")), n = Fi(this.colOutlineBands, Hi(e, "col"));
4288
4300
  this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
4289
4301
  }
4290
4302
  get isRtl() {
@@ -4354,7 +4366,7 @@ var oa = class {
4354
4366
  }
4355
4367
  if (h === -1) return null;
4356
4368
  } else {
4357
- let e = c - d + this.scrollHost.scrollTop / r, t = aa(n, Z(n)).row.scrollableIndexAt(e, l + 1);
4369
+ let e = c - d + this.scrollHost.scrollTop / r, t = sa(n, Z(n)).row.scrollableIndexAt(e, l + 1);
4358
4370
  if (t === null) return null;
4359
4371
  h = t;
4360
4372
  }
@@ -4368,7 +4380,7 @@ var oa = class {
4368
4380
  }
4369
4381
  if (g === -1) return null;
4370
4382
  } else {
4371
- let e = s - p + this.effectiveScrollLeft / r, t = aa(n, Z(n)).col.scrollableIndexAt(e, u + 1);
4383
+ let e = s - p + this.effectiveScrollLeft / r, t = sa(n, Z(n)).col.scrollableIndexAt(e, u + 1);
4372
4384
  if (t === null) return null;
4373
4385
  g = t;
4374
4386
  }
@@ -4388,7 +4400,7 @@ var oa = class {
4388
4400
  } else {
4389
4401
  let e = 0;
4390
4402
  for (let t = 1; t <= l; t++) e += o(t);
4391
- let s = a(50) + e, c = this.effectiveScrollLeft / r, d = aa(n, i).col, { index: f, partial: p } = d.indexAt(c + d.offsetOf(l + 1)), m = s - p * r;
4403
+ let s = a(50) + e, c = this.effectiveScrollLeft / r, d = sa(n, i).col, { index: f, partial: p } = d.indexAt(c + d.offsetOf(l + 1)), m = s - p * r;
4392
4404
  if (t >= f) for (let e = f; e < t; e++) m += o(e);
4393
4405
  else for (let e = t; e < f; e++) m -= o(e);
4394
4406
  u = m;
@@ -4401,7 +4413,7 @@ var oa = class {
4401
4413
  } else {
4402
4414
  let t = 0;
4403
4415
  for (let e = 1; e <= c; e++) t += s(e);
4404
- let o = a(22) + t, l = this.scrollHost.scrollTop / r, u = aa(n, i).row, { index: f, partial: p } = u.indexAt(l + u.offsetOf(c + 1)), m = o - p * r;
4416
+ let o = a(22) + t, l = this.scrollHost.scrollTop / r, u = sa(n, i).row, { index: f, partial: p } = u.indexAt(l + u.offsetOf(c + 1)), m = o - p * r;
4405
4417
  if (e >= f) for (let t = f; t < e; t++) m += s(t);
4406
4418
  else for (let t = e; t < f; t++) m -= s(t);
4407
4419
  d = m;
@@ -4453,7 +4465,7 @@ var oa = class {
4453
4465
  };
4454
4466
  return null;
4455
4467
  }
4456
- let a = e - t + this.scrollHost.scrollTop / r, s = aa(n, Z(n)).row.scrollableIndexAt(a, l + 1);
4468
+ let a = e - t + this.scrollHost.scrollTop / r, s = sa(n, Z(n)).row.scrollableIndexAt(a, l + 1);
4457
4469
  return s === null ? null : {
4458
4470
  kind: "row",
4459
4471
  row: s
@@ -4474,7 +4486,7 @@ var oa = class {
4474
4486
  };
4475
4487
  return null;
4476
4488
  }
4477
- let m = d - f + this.effectiveScrollLeft / r, h = aa(n, Z(n)).col.scrollableIndexAt(m, u + 1);
4489
+ let m = d - f + this.effectiveScrollLeft / r, h = sa(n, Z(n)).col.scrollableIndexAt(m, u + 1);
4478
4490
  return h === null ? null : {
4479
4491
  kind: "col",
4480
4492
  col: h
@@ -4496,7 +4508,7 @@ var oa = class {
4496
4508
  edge: t.x + t.w
4497
4509
  }));
4498
4510
  }
4499
- let o = na(a, i, ea, s);
4511
+ let o = ia(a, i, na, s);
4500
4512
  return o === null ? null : {
4501
4513
  kind: "col",
4502
4514
  index: o,
@@ -4516,7 +4528,7 @@ var oa = class {
4516
4528
  edge: t.y + t.h
4517
4529
  }));
4518
4530
  }
4519
- let a = na(o, i, ea, c);
4531
+ let a = ia(o, i, na, c);
4520
4532
  return a === null ? null : {
4521
4533
  kind: "row",
4522
4534
  index: a,
@@ -4531,13 +4543,13 @@ var oa = class {
4531
4543
  if (!n || !r) return;
4532
4544
  let i = this.opts.cellScale ?? 1, a = this.canvasArea.getBoundingClientRect();
4533
4545
  if (n.kind === "col") {
4534
- let t = this.screenX(e - a.left, 0), o = Math.max(ta, Math.round((t - n.originScaled) / i));
4546
+ let t = this.screenX(e - a.left, 0), o = Math.max(ra, Math.round((t - n.originScaled) / i));
4535
4547
  r.colWidths[n.index] = In(o, n.mdw), this.recordSizeOverride("col", n.index);
4536
4548
  } else {
4537
- let e = t - a.top, o = Math.max(ta, Math.round((e - n.originScaled) / i));
4549
+ let e = t - a.top, o = Math.max(ra, Math.round((e - n.originScaled) / i));
4538
4550
  r.rowHeights[n.index] = Ln(o), this.recordSizeOverride("row", n.index);
4539
4551
  }
4540
- ia.delete(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
4552
+ oa.delete(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
4541
4553
  }
4542
4554
  setSelectionColor(e) {
4543
4555
  this.opts.selectionColor = e, this.updateSelectionOverlay();
@@ -4606,13 +4618,13 @@ var oa = class {
4606
4618
  l < a && (d -= a - l, l = a), u < o && (f -= o - u, u = o);
4607
4619
  let h = a + c, g = o + s;
4608
4620
  if (m > r && l < h && (d -= h - l, l = h), p > n && u < g && (f -= g - u, u = g), d <= 0 || f <= 0) return;
4609
- let _ = this.screenX(l, d), { border: v, background: y } = ra(this.opts.selectionColor ?? $i), b = document.createElement("div");
4621
+ let _ = this.screenX(l, d), { border: v, background: y } = aa(this.opts.selectionColor ?? ta), b = document.createElement("div");
4610
4622
  b.style.cssText = `position:absolute;left:${_}px;top:${u}px;width:${d}px;height:${f}px;box-sizing:border-box;border:${v};background:${y};pointer-events:none;`, this.selectionOverlay.appendChild(b), this.maybeDrawValidationDropdown();
4611
4623
  }
4612
4624
  maybeDrawValidationDropdown() {
4613
4625
  if (this.validationArrowRect = null, this.selectionMode !== "cells") return;
4614
4626
  let e = this.currentWorksheet, t = this.activeCell;
4615
- if (!e || !t || !ki(e.dataValidations, t.row, t.col)) return;
4627
+ if (!e || !t || !ji(e.dataValidations, t.row, t.col)) return;
4616
4628
  let n = this.getCellRect(t.row, t.col);
4617
4629
  if (!n) return;
4618
4630
  let r = this.opts.cellScale ?? 1, 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;
@@ -4635,7 +4647,7 @@ var oa = class {
4635
4647
  for (let t = 1; t <= o; t++) s += n(Q(e.colWidths[t] ?? e.defaultColWidth, Z(e)));
4636
4648
  let c = 0;
4637
4649
  for (let t = 1; t <= a; t++) c += n($(e.rowHeights[t] ?? e.defaultRowHeight));
4638
- let l = r + s, u = i + c, d = ra("#ffb300"), f = ra("#fb8c00");
4650
+ let l = r + s, u = i + c, d = aa("#ffb300"), f = aa("#fb8c00");
4639
4651
  for (let e of this._find.sheetHighlights(this.currentSheet)) {
4640
4652
  let t = this.getCellRect(e.row, e.col);
4641
4653
  if (!t) continue;
@@ -4667,7 +4679,7 @@ var oa = class {
4667
4679
  _scrollCellIntoView(e, t) {
4668
4680
  let n = this.currentWorksheet;
4669
4681
  if (!n) return;
4670
- let r = this.opts.cellScale ?? 1, i = Z(n), a = aa(n, i), o = n.freezeRows ?? 0, s = n.freezeCols ?? 0;
4682
+ let r = this.opts.cellScale ?? 1, i = Z(n), a = sa(n, i), o = n.freezeRows ?? 0, s = n.freezeCols ?? 0;
4671
4683
  if (e > o) {
4672
4684
  let t = Math.round(22 * r), i = 0;
4673
4685
  for (let e = 1; e <= o; e++) i += Math.round($(n.rowHeights[e] ?? n.defaultRowHeight) * r);
@@ -4689,7 +4701,7 @@ var oa = class {
4689
4701
  this.hideValidationPanel();
4690
4702
  return;
4691
4703
  }
4692
- let r = ki(e.dataValidations, t.row, t.col);
4704
+ let r = ji(e.dataValidations, t.row, t.col);
4693
4705
  r && this.openValidationPanel(t, r.formula1);
4694
4706
  }
4695
4707
  async openValidationPanel(e, t) {
@@ -4728,7 +4740,7 @@ var oa = class {
4728
4740
  if (!t) return;
4729
4741
  let n = this.screenX(t.x, t.w);
4730
4742
  this.validationPanel.style.left = "-9999px", this.validationPanel.style.top = "-9999px", this.validationPanel.style.display = "block";
4731
- let r = Ei({
4743
+ let r = Oi({
4732
4744
  cell: {
4733
4745
  x: n,
4734
4746
  y: t.y,
@@ -4804,7 +4816,7 @@ var oa = class {
4804
4816
  }
4805
4817
  this.commentPopupKey !== t && (this.hideCommentPopup(), this.commentPopupKey = t, this.commentPopupTimer = setTimeout(() => {
4806
4818
  this.commentPopupTimer = null, this.renderCommentPopup(e, n);
4807
- }, Vi));
4819
+ }, Ui));
4808
4820
  }
4809
4821
  renderCommentPopup(e, t) {
4810
4822
  let n = this.getCellRect(e.row, e.col);
@@ -4817,7 +4829,7 @@ var oa = class {
4817
4829
  r.textContent = t.text, this.commentPopup.appendChild(r);
4818
4830
  let i = this.screenX(n.x, n.w);
4819
4831
  this.commentPopup.style.left = "-9999px", this.commentPopup.style.top = "-9999px", this.commentPopup.style.display = "block";
4820
- let a = ji({
4832
+ let a = Ni({
4821
4833
  cell: {
4822
4834
  x: i,
4823
4835
  y: n.y,
@@ -5036,12 +5048,12 @@ var oa = class {
5036
5048
  }
5037
5049
  }
5038
5050
  tabStyle(e, t) {
5039
- let n = Ki - 2, r = Ki - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
5051
+ let n = Ji - 2, r = Ji - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
5040
5052
  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;
5041
5053
  }
5042
5054
  tabCss(e, t) {
5043
5055
  let n = this.tabStyle(t, this.tabColors[e]);
5044
- return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${Ji};`), n;
5056
+ return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${Xi};`), n;
5045
5057
  }
5046
5058
  buildZoomControl() {
5047
5059
  let e = this.opts.zoomMin ?? .1, t = this.opts.zoomMax ?? 4, n = this.opts.cellScale ?? 1, r = document.createElement("div");
@@ -5161,7 +5173,7 @@ var oa = class {
5161
5173
  for (let t = 1; t <= s; t++) c += Q(e.colWidths[t] ?? e.defaultColWidth, Z(e));
5162
5174
  let l = 0;
5163
5175
  for (let t = 1; t <= o; t++) l += $(e.rowHeights[t] ?? e.defaultRowHeight);
5164
- let u = this.effectiveScrollLeft / i, d = this.scrollHost.scrollTop / i, f = aa(e, Z(e)), { index: p, partial: m } = f.col.indexAt(u + f.col.offsetOf(s + 1)), { index: h, partial: g } = f.row.indexAt(d + f.row.offsetOf(o + 1)), _ = t / i - 50 - c, v = n / i - 22 - l, y = 0;
5176
+ let u = this.effectiveScrollLeft / i, d = this.scrollHost.scrollTop / i, f = sa(e, Z(e)), { index: p, partial: m } = f.col.indexAt(u + f.col.offsetOf(s + 1)), { index: h, partial: g } = f.row.indexAt(d + f.row.offsetOf(o + 1)), _ = t / i - 50 - c, v = n / i - 22 - l, y = 0;
5165
5177
  {
5166
5178
  let t = -m, n = p;
5167
5179
  for (; t < _ + m && n <= 16384;) t += Q(e.colWidths[n] ?? e.defaultColWidth, Z(e)), y++, n++;
@@ -5271,13 +5283,13 @@ var oa = class {
5271
5283
  destroy() {
5272
5284
  this._destroyed = !0, this._loadGen++, this.resizeObserver?.disconnect(), this._rafId !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this._rafId), this._rafId = null), this._renderSeq++, this.hideCommentPopup(), this.hideValidationPanel(), this.keydownHandler && document.removeEventListener("keydown", this.keydownHandler), this._find.invalidate(), this.wb?.destroy(), this.wrapper.remove();
5273
5285
  }
5274
- }, sa = /* @__PURE__ */ e({
5286
+ }, la = /* @__PURE__ */ e({
5275
5287
  OoxmlError: () => F,
5276
- XlsxViewer: () => oa,
5277
- XlsxWorkbook: () => Di,
5288
+ XlsxViewer: () => ca,
5289
+ XlsxWorkbook: () => ki,
5278
5290
  autoResize: () => L,
5279
5291
  openExternalHyperlink: () => ae,
5280
- resolveSharedStrings: () => Ci
5292
+ resolveSharedStrings: () => Ti
5281
5293
  });
5282
5294
  //#endregion
5283
- export { Ci as i, oa as n, Di as r, sa as t };
5295
+ export { Ti as i, ca as n, ki as r, la as t };