@silurus/ooxml 0.85.2 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +39 -7
  2. package/dist/assets/render-worker-BCGnuBLj.js +10 -0
  3. package/dist/assets/render-worker-CB4DxjXg.js +31 -0
  4. package/dist/assets/render-worker-CHW0F0n6.js +11 -0
  5. package/dist/{bounded-raw-part-cache-C6ro6Ezf.js → bounded-raw-part-cache-DVx3Camo.js} +12 -10
  6. package/dist/{canvas-viewer-mechanics-CDNMJ-Yz.js → canvas-viewer-mechanics-B3A7KLLi.js} +1 -1
  7. package/dist/{comment-ui-runtime-DAKBCpsM.js → comment-ui-runtime-DEtgcmj7.js} +5 -5
  8. package/dist/comment-ui-runtime-TLHustXJ.js +2 -0
  9. package/dist/{comment-ui-runtime-CAbpuWi_.js → comment-ui-runtime-ssI6IE39.js} +4 -4
  10. package/dist/{comments-Brfxa3hQ.js → comments-CAn2A_Xh.js} +1 -1
  11. package/dist/delimited-text-worker-host-DcHj_JZt.js +27 -0
  12. package/dist/{document-pull-client-BssAk95w.js → document-pull-client-xZrA2IjM.js} +3349 -3347
  13. package/dist/{docx-BY7oyoml.js → docx-DzDiGvqe.js} +67 -64
  14. package/dist/docx.mjs +5 -5
  15. package/dist/docx_parser_bg.wasm +0 -0
  16. package/dist/{dom-interaction-boundary-CDGegIB5.js → dom-interaction-boundary-DK1JLkrz.js} +2 -2
  17. package/dist/{line-metrics-BGtFM-ec.js → hyperlink-enyPbflR.js} +847 -877
  18. package/dist/index.mjs +3 -3
  19. package/dist/line-distribute-BFB575d6.js +1023 -0
  20. package/dist/line-metrics-CBbw80Ko.js +60 -0
  21. package/dist/node.mjs +91 -91
  22. package/dist/{pptx-C4z96sAA.js → pptx-D_U62nl-.js} +75 -72
  23. package/dist/pptx.mjs +5 -5
  24. package/dist/pptx_parser_bg.wasm +0 -0
  25. package/dist/{render-Dxvwes39.js → render-DSn0d35X.js} +1 -1
  26. package/dist/{render-worker-host-BAXcBGq3.js → render-worker-host-BHz9vjxB.js} +1 -1
  27. package/dist/{render-worker-host-CXTCU4PO.js → render-worker-host-CO0UYoQh.js} +1 -1
  28. package/dist/{render-worker-host-CNKQ76tu.js → render-worker-host-CbYDBg7U.js} +1 -1
  29. package/dist/{resource-measurement-D41R-0Bl.js → resource-measurement-Do07ZRcR.js} +7 -7
  30. package/dist/{session-BmP4lcEo.js → session-C1GYhr6n.js} +77 -77
  31. package/dist/{slide-pull-client-RTwQbJiy.js → slide-pull-client-DuEaUxPw.js} +1128 -1120
  32. package/dist/types/chart-ex.d.ts +2 -2
  33. package/dist/types/docx.d.ts +10 -10
  34. package/dist/types/index.d.ts +38 -18
  35. package/dist/types/math.d.ts +1 -1
  36. package/dist/types/node.d.ts +6 -5
  37. package/dist/types/pptx.d.ts +10 -10
  38. package/dist/types/region-map.d.ts +2 -2
  39. package/dist/types/three-d.d.ts +2 -2
  40. package/dist/types/tiff.d.ts +1 -1
  41. package/dist/types/xlsx.d.ts +34 -14
  42. package/dist/{worksheet-pull-client-C9sC36Vu.js → worksheet-pull-client-eDiHHEG2.js} +99 -96
  43. package/dist/{xlsx-DSU6pV1O.js → xlsx-CMHmYTHP.js} +1629 -1469
  44. package/dist/xlsx.mjs +5 -5
  45. package/dist/xlsx_parser_bg.wasm +0 -0
  46. package/package.json +1 -1
  47. package/dist/assets/render-worker-CV9Mg4j9.js +0 -10
  48. package/dist/assets/render-worker-DHP0rgcW.js +0 -24
  49. package/dist/assets/render-worker-DdvOGyrn.js +0 -11
  50. package/dist/comment-ui-runtime-DTaaZdXC.js +0 -2
  51. package/dist/line-distribute-BsV4MVZ2.js +0 -1023
  52. /package/dist/{comment-occurrence-tj54AXXB.js → comment-occurrence-Dhdplprg.js} +0 -0
  53. /package/dist/{highlight-rect-DBcYVJDv.js → highlight-rect-FuUSmL3a.js} +0 -0
  54. /package/dist/{read-only-comment-decoration-Mv_SAiHy.js → read-only-comment-decoration-BTnWEeo5.js} +0 -0
  55. /package/dist/{read-only-comment-margin-Cqu-Ir0C.js → read-only-comment-margin-plStyGfE.js} +0 -0
  56. /package/dist/{source-key-BkBB3X82.js → source-key-Ktb1GRE5.js} +0 -0
@@ -1,17 +1,17 @@
1
- import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Et as s, Ft as c, Ht as l, It as u, J as d, Lt as f, M as p, Mt as m, N as h, Nt as g, O as _, Ot as v, Pt as y, Rt as b, S as x, St as S, Tt as C, Vt as w, Wt as T, Xt as E, Yt as D, _ as O, _t as k, at as A, bt as j, c as M, cn as N, ct as P, d as F, dt as I, et as L, f as R, g as z, gt as B, h as V, i as H, it as U, j as ee, jt as W, lt as te, m as G, mt as K, n as q, nt as ne, p as re, r as ie, rt as ae, s as oe, tt as se, u as ce, w as le, wt as ue, xt as de, y as fe, zt as pe } from "./line-metrics-BGtFM-ec.js";
2
- import { a as me, c as he, d as ge, f as _e, i as ve, l as ye, o as be, p as xe, r as Se, s as Ce, t as we, u as Te } from "./line-distribute-BsV4MVZ2.js";
3
- import { A as Ee, D as De, S as Oe, _ as ke, h as Ae, hn as je, in as Me, j as Ne, on as Pe, sn as Fe, v as Ie, w as Le } from "./plot-area-frame-D5hEOgkJ.js";
4
- import { l as Re } from "./pixel-budget-Dgjw269h.js";
5
- import { r as J } from "./units-EJdC96r6.js";
6
- import { A as ze, F as Be, I as Ve, L as He, M as Ue, N as We, P as Ge, j as Ke } from "./three-d-YYghQndN.js";
7
- import { k as qe } from "./renderer-XFSCOT6m.js";
8
- import { s as Je } from "./raster-target-ojDdQizC.js";
9
- import { a as Ye, i as Xe, n as Ze, t as Qe } from "./resource-measurement-D41R-0Bl.js";
1
+ import { $ as e, A as t, At as n, Bt as r, Ct as i, E as a, Et as o, Ft as s, It as c, Jt as l, K as u, Lt as d, Mt as f, Nt as p, O as m, Ot as h, Pt as g, Q as _, Rt as v, S as y, St as b, T as x, Ut as S, Vt as C, Yt as w, Z as T, _ as E, a as D, b as O, bt as k, c as A, d as j, et as M, f as N, ft as P, h as F, ht as I, j as L, jt as R, k as z, kt as B, l as V, lt as H, m as ee, mt as U, n as W, nt as te, o as G, ot as K, p as q, rt as J, sn as ne, st as re, t as ie, tt as ae, u as oe, vt as se, wt as ce, x as le, xt as ue, yt as de, zt as fe } from "./hyperlink-enyPbflR.js";
2
+ import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-BFB575d6.js";
3
+ import { A as Te, D as Ee, S as De, _ as Oe, h as ke, hn as Ae, in as je, j as Me, on as Ne, sn as Pe, v as Fe, w as Ie } from "./plot-area-frame-D5hEOgkJ.js";
4
+ import { l as Le } from "./pixel-budget-Dgjw269h.js";
5
+ import { r as Y } from "./units-EJdC96r6.js";
6
+ import { A as Re, F as ze, I as Be, L as Ve, M as He, N as Ue, P as We, j as Ge } from "./three-d-YYghQndN.js";
7
+ import { k as Ke } from "./renderer-XFSCOT6m.js";
8
+ import { s as qe } from "./raster-target-ojDdQizC.js";
9
+ import { a as Je, i as Ye, n as Xe, t as Ze } from "./resource-measurement-Do07ZRcR.js";
10
10
  //#region packages/pptx/src/types.ts
11
- function $e(e) {
11
+ function Qe(e) {
12
12
  return e;
13
13
  }
14
- var et = {
14
+ var $e = {
15
15
  textarchdown: {
16
16
  adj: [["adj", "val 0"]],
17
17
  gd: [
@@ -2393,22 +2393,22 @@ var et = {
2393
2393
  ]
2394
2394
  }]
2395
2395
  }
2396
- }, tt = Math.PI * 2 / 216e5, nt = et, rt = /* @__PURE__ */ new Map();
2397
- function it(e) {
2398
- return e.toLowerCase() in nt;
2396
+ }, et = Math.PI * 2 / 216e5, tt = $e, nt = /* @__PURE__ */ new Map();
2397
+ function rt(e) {
2398
+ return e.toLowerCase() in tt;
2399
2399
  }
2400
- function at(e) {
2401
- let t = rt.get(e);
2400
+ function it(e) {
2401
+ let t = nt.get(e);
2402
2402
  if (t) return t;
2403
- let n = nt[e];
2403
+ let n = tt[e];
2404
2404
  return n ? (t = {
2405
- adj: n.adj.map(([e, t]) => [e, y(t)]),
2406
- gd: n.gd.map(([e, t]) => [e, y(t)]),
2405
+ adj: n.adj.map(([e, t]) => [e, f(t)]),
2406
+ gd: n.gd.map(([e, t]) => [e, f(t)]),
2407
2407
  paths: n.paths
2408
- }, rt.set(e, t), t) : null;
2408
+ }, nt.set(e, t), t) : null;
2409
2409
  }
2410
- var ot = 48;
2411
- function st(e, t, n, r) {
2410
+ var at = 48;
2411
+ function ot(e, t, n, r) {
2412
2412
  let i = e.w == null ? 1 : n / e.w, a = e.h == null ? 1 : r / e.h, o = (e) => e * i, s = (e) => e * a, c = [], l = 0, u = 0;
2413
2413
  for (let n of e.cmds) switch (n[0]) {
2414
2414
  case "m":
@@ -2425,8 +2425,8 @@ function st(e, t, n, r) {
2425
2425
  break;
2426
2426
  case "C": {
2427
2427
  let e = o(t.resolve(n[1])), r = s(t.resolve(n[2])), i = o(t.resolve(n[3])), a = s(t.resolve(n[4])), d = o(t.resolve(n[5])), f = s(t.resolve(n[6]));
2428
- for (let t = 1; t <= ot; t++) {
2429
- let n = t / ot, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
2428
+ for (let t = 1; t <= at; t++) {
2429
+ let n = t / at, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
2430
2430
  c.push({
2431
2431
  x: s,
2432
2432
  y: p
@@ -2437,8 +2437,8 @@ function st(e, t, n, r) {
2437
2437
  }
2438
2438
  case "Q": {
2439
2439
  let e = o(t.resolve(n[1])), r = s(t.resolve(n[2])), i = o(t.resolve(n[3])), a = s(t.resolve(n[4]));
2440
- for (let t = 1; t <= ot; t++) {
2441
- let n = t / ot, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
2440
+ for (let t = 1; t <= at; t++) {
2441
+ let n = t / at, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
2442
2442
  c.push({
2443
2443
  x: s,
2444
2444
  y: d
@@ -2448,9 +2448,9 @@ function st(e, t, n, r) {
2448
2448
  break;
2449
2449
  }
2450
2450
  case "a": {
2451
- let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * tt, f = t.resolve(n[4]) * tt, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
2451
+ let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * et, f = t.resolve(n[4]) * et, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
2452
2452
  _ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
2453
- let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(ot, Math.ceil(Math.abs(y) / m * 96));
2453
+ let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(at, Math.ceil(Math.abs(y) / m * 96));
2454
2454
  for (let e = 1; e <= S; e++) {
2455
2455
  let t = h + y * e / S;
2456
2456
  c.push({
@@ -2465,7 +2465,7 @@ function st(e, t, n, r) {
2465
2465
  }
2466
2466
  return c;
2467
2467
  }
2468
- function ct(e) {
2468
+ function st(e) {
2469
2469
  let t = [0];
2470
2470
  for (let n = 1; n < e.length; n++) {
2471
2471
  let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
@@ -2473,23 +2473,23 @@ function ct(e) {
2473
2473
  }
2474
2474
  return t;
2475
2475
  }
2476
- function lt(e, t, n, r) {
2477
- let i = at(e.toLowerCase());
2476
+ function ct(e, t, n, r) {
2477
+ let i = it(e.toLowerCase());
2478
2478
  if (!i || i.paths.length === 0) return null;
2479
- let a = c({
2479
+ let a = p({
2480
2480
  w: n,
2481
2481
  h: r,
2482
2482
  adj: t
2483
- }, i.adj, i.gd), o = i.paths.length === 1, s = st(i.paths[0], a, n, r), l = o ? s : st(i.paths[i.paths.length - 1], a, n, r);
2483
+ }, i.adj, i.gd), o = i.paths.length === 1, s = ot(i.paths[0], a, n, r), c = o ? s : ot(i.paths[i.paths.length - 1], a, n, r);
2484
2484
  return {
2485
2485
  top: s,
2486
- bottom: l,
2487
- topLen: ct(s),
2488
- bottomLen: ct(l),
2486
+ bottom: c,
2487
+ topLen: st(s),
2488
+ bottomLen: st(c),
2489
2489
  singleEdge: o
2490
2490
  };
2491
2491
  }
2492
- function ut(e, t, n) {
2492
+ function lt(e, t, n) {
2493
2493
  let r = t[t.length - 1];
2494
2494
  if (e.length === 1 || r === 0) return {
2495
2495
  x: e[0].x,
@@ -2510,17 +2510,17 @@ function ut(e, t, n) {
2510
2510
  ty: f / p
2511
2511
  };
2512
2512
  }
2513
- function dt(e) {
2513
+ function ut(e) {
2514
2514
  return e.topLen[e.topLen.length - 1] ?? 0;
2515
2515
  }
2516
- function ft(e, t) {
2516
+ function dt(e, t) {
2517
2517
  if (!e.singleEdge) return 1;
2518
- let n = dt(e);
2518
+ let n = ut(e);
2519
2519
  return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
2520
2520
  }
2521
- function pt(e, t, n, r) {
2521
+ function ft(e, t, n, r) {
2522
2522
  if (e.singleEdge) {
2523
- let i = ut(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
2523
+ let i = lt(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
2524
2524
  return {
2525
2525
  x: i.x - o * c,
2526
2526
  y: i.y - s * c,
@@ -2529,7 +2529,7 @@ function pt(e, t, n, r) {
2529
2529
  shear: 0
2530
2530
  };
2531
2531
  }
2532
- let i = ut(e.top, e.topLen, t), a = ut(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
2532
+ let i = lt(e.top, e.topLen, t), a = lt(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
2533
2533
  return {
2534
2534
  x: c,
2535
2535
  y: l,
@@ -2540,7 +2540,7 @@ function pt(e, t, n, r) {
2540
2540
  }
2541
2541
  //#endregion
2542
2542
  //#region packages/core/src/shape/scene3d-camera.ts
2543
- var mt = 26, ht = {
2543
+ var pt = 26, mt = {
2544
2544
  orthographicFront: {
2545
2545
  kind: "orthographic",
2546
2546
  baseLat: 0,
@@ -2553,52 +2553,52 @@ var mt = 26, ht = {
2553
2553
  baseLat: 0,
2554
2554
  baseLon: 0,
2555
2555
  baseRev: 0,
2556
- fovDeg: mt
2556
+ fovDeg: pt
2557
2557
  },
2558
2558
  perspectiveRelaxed: {
2559
2559
  kind: "perspective",
2560
2560
  baseLat: 0,
2561
2561
  baseLon: 0,
2562
2562
  baseRev: 0,
2563
- fovDeg: mt
2563
+ fovDeg: pt
2564
2564
  },
2565
2565
  perspectiveRelaxedModerately: {
2566
2566
  kind: "perspective",
2567
2567
  baseLat: 0,
2568
2568
  baseLon: 0,
2569
2569
  baseRev: 0,
2570
- fovDeg: mt
2570
+ fovDeg: pt
2571
2571
  },
2572
2572
  perspectiveAbove: {
2573
2573
  kind: "perspective",
2574
2574
  baseLat: -20,
2575
2575
  baseLon: 0,
2576
2576
  baseRev: 0,
2577
- fovDeg: mt
2577
+ fovDeg: pt
2578
2578
  },
2579
2579
  perspectiveBelow: {
2580
2580
  kind: "perspective",
2581
2581
  baseLat: 20,
2582
2582
  baseLon: 0,
2583
2583
  baseRev: 0,
2584
- fovDeg: mt
2584
+ fovDeg: pt
2585
2585
  },
2586
2586
  perspectiveLeft: {
2587
2587
  kind: "perspective",
2588
2588
  baseLat: 0,
2589
2589
  baseLon: -20,
2590
2590
  baseRev: 0,
2591
- fovDeg: mt
2591
+ fovDeg: pt
2592
2592
  },
2593
2593
  perspectiveRight: {
2594
2594
  kind: "perspective",
2595
2595
  baseLat: 0,
2596
2596
  baseLon: 20,
2597
2597
  baseRev: 0,
2598
- fovDeg: mt
2598
+ fovDeg: pt
2599
2599
  }
2600
2600
  };
2601
- function gt(e, t) {
2601
+ function ht(e, t) {
2602
2602
  let n = Array(9).fill(0);
2603
2603
  for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
2604
2604
  let a = 0;
@@ -2607,7 +2607,7 @@ function gt(e, t) {
2607
2607
  }
2608
2608
  return n;
2609
2609
  }
2610
- function _t(e) {
2610
+ function gt(e) {
2611
2611
  let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
2612
2612
  return [
2613
2613
  1,
@@ -2621,7 +2621,7 @@ function _t(e) {
2621
2621
  n
2622
2622
  ];
2623
2623
  }
2624
- function vt(e) {
2624
+ function _t(e) {
2625
2625
  let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
2626
2626
  return [
2627
2627
  n,
@@ -2635,7 +2635,7 @@ function vt(e) {
2635
2635
  n
2636
2636
  ];
2637
2637
  }
2638
- function yt(e) {
2638
+ function vt(e) {
2639
2639
  let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
2640
2640
  return [
2641
2641
  n,
@@ -2649,22 +2649,22 @@ function yt(e) {
2649
2649
  1
2650
2650
  ];
2651
2651
  }
2652
- function bt(e, t, n, r) {
2652
+ function yt(e, t, n, r) {
2653
2653
  return [
2654
2654
  e[0] * t + e[1] * n + e[2] * r,
2655
2655
  e[3] * t + e[4] * n + e[5] * r,
2656
2656
  e[6] * t + e[7] * n + e[8] * r
2657
2657
  ];
2658
2658
  }
2659
- function xt(e, t) {
2659
+ function bt(e, t) {
2660
2660
  let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
2661
- return gt(yt(-(t ? t.rev : e.baseRev)), gt(_t(-n), vt(-r)));
2661
+ return ht(vt(-(t ? t.rev : e.baseRev)), ht(gt(-n), _t(-r)));
2662
2662
  }
2663
- function St(e) {
2664
- return ht[e] || (e.startsWith("perspective") ? ht.perspectiveFront : ht.orthographicFront);
2663
+ function xt(e) {
2664
+ return mt[e] || (e.startsWith("perspective") ? mt.perspectiveFront : mt.orthographicFront);
2665
2665
  }
2666
- function Ct(e, t, n) {
2667
- let r = St(e.prst), i = xt(r, e.rot);
2666
+ function St(e, t, n) {
2667
+ let r = xt(e.prst), i = bt(r, e.rot);
2668
2668
  if (t <= 0 || n <= 0) return {
2669
2669
  corners: [
2670
2670
  {
@@ -2696,11 +2696,11 @@ function Ct(e, t, n) {
2696
2696
  if (r.kind === "perspective") {
2697
2697
  let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
2698
2698
  u = s.map(([e, t]) => {
2699
- let [n, r, o] = bt(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
2699
+ let [n, r, o] = yt(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
2700
2700
  return [n * c, r * c];
2701
2701
  });
2702
2702
  } else u = s.map(([e, t]) => {
2703
- let [n, r] = bt(i, e, t, 0);
2703
+ let [n, r] = yt(i, e, t, 0);
2704
2704
  return [n, r];
2705
2705
  });
2706
2706
  u = u.map(([e, t]) => [e * c, t * c]);
@@ -2723,18 +2723,18 @@ function Ct(e, t, n) {
2723
2723
  isIdentity: _
2724
2724
  };
2725
2725
  }
2726
- function wt(e) {
2727
- let { isIdentity: t } = Ct(e, 1e3, 1e3);
2726
+ function Ct(e) {
2727
+ let { isIdentity: t } = St(e, 1e3, 1e3);
2728
2728
  return !t;
2729
2729
  }
2730
- function Tt(e, t, n, r) {
2731
- let i = St(e.prst), a = xt(i, e.rot);
2730
+ function wt(e, t, n, r) {
2731
+ let i = xt(e.prst), a = bt(i, e.rot);
2732
2732
  if (t <= 0 || n <= 0 || r === 0) return {
2733
2733
  x: 0,
2734
2734
  y: 0
2735
2735
  };
2736
2736
  let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
2737
- let [n, r, o] = bt(a, 0, 0, t);
2737
+ let [n, r, o] = yt(a, 0, 0, t);
2738
2738
  if (i.kind === "perspective") {
2739
2739
  let t = e.fov ?? i.fovDeg, a = Math.max(1, Math.min(179, t)) * Math.PI / 180, s = c / Math.tan(a / 2), u = s - o, d = s / (Math.abs(u) < 1e-6 ? 1e-6 * Math.sign(u || 1) : u);
2740
2740
  return [n * d * l, r * d * l];
@@ -2748,12 +2748,12 @@ function Tt(e, t, n, r) {
2748
2748
  }
2749
2749
  //#endregion
2750
2750
  //#region packages/core/src/shape/bevel-shading.ts
2751
- function Et(e, t) {
2751
+ function Tt(e, t) {
2752
2752
  if (t <= 0) return () => 1;
2753
2753
  let n = (e) => Math.max(0, Math.min(1, e / t));
2754
2754
  switch (e) {
2755
2755
  case "hardEdge": {
2756
- let e = Pt;
2756
+ let e = Nt;
2757
2757
  return (t) => {
2758
2758
  let r = Math.min(1, n(t) / e);
2759
2759
  return r * r * (3 - 2 * r);
@@ -2773,7 +2773,7 @@ function Et(e, t) {
2773
2773
  };
2774
2774
  }
2775
2775
  }
2776
- function Dt(e) {
2776
+ function Et(e) {
2777
2777
  let t = e.length, n = new Float64Array(t);
2778
2778
  if (t === 0) return n;
2779
2779
  let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
@@ -2791,7 +2791,7 @@ function Dt(e) {
2791
2791
  }
2792
2792
  return n;
2793
2793
  }
2794
- function Ot(e, t = 3) {
2794
+ function Dt(e, t = 3) {
2795
2795
  if (e <= 0) return Array(t).fill(1);
2796
2796
  let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
2797
2797
  r % 2 == 0 && r--;
@@ -2799,7 +2799,7 @@ function Ot(e, t = 3) {
2799
2799
  for (let e = 0; e < t; e++) s.push(e < o ? r : i);
2800
2800
  return s;
2801
2801
  }
2802
- function kt(e, t, n, r, i, a) {
2802
+ function Ot(e, t, n, r, i, a) {
2803
2803
  let o = 1 / (2 * i + 1);
2804
2804
  if (a) for (let a = 0; a < r; a++) {
2805
2805
  let r = a * n, s = 0;
@@ -2820,29 +2820,29 @@ function kt(e, t, n, r, i, a) {
2820
2820
  }
2821
2821
  }
2822
2822
  }
2823
- function At(e, t, n, r) {
2823
+ function kt(e, t, n, r) {
2824
2824
  let i = Float64Array.from(e);
2825
2825
  if (r <= 0 || t <= 0 || n <= 0) return i;
2826
2826
  let a = new Float64Array(t * n);
2827
- for (let e of Ot(r, 3)) {
2827
+ for (let e of Dt(r, 3)) {
2828
2828
  let r = Math.max(1, (e - 1) / 2);
2829
- kt(i, a, t, n, r, !0), kt(a, i, t, n, r, !1);
2829
+ Ot(i, a, t, n, r, !0), Ot(a, i, t, n, r, !1);
2830
2830
  }
2831
2831
  return i;
2832
2832
  }
2833
- function jt(e, t, n, r = 128) {
2833
+ function At(e, t, n, r = 128) {
2834
2834
  let i = new Float64Array(t * n);
2835
2835
  for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
2836
2836
  let a = new Float64Array(n);
2837
2837
  for (let e = 0; e < t; e++) {
2838
2838
  for (let r = 0; r < n; r++) a[r] = i[r * t + e];
2839
- let r = Dt(a);
2839
+ let r = Et(a);
2840
2840
  for (let a = 0; a < n; a++) i[a * t + e] = r[a];
2841
2841
  }
2842
2842
  let o = new Float64Array(t);
2843
2843
  for (let e = 0; e < n; e++) {
2844
2844
  for (let n = 0; n < t; n++) o[n] = i[e * t + n];
2845
- let n = Dt(o);
2845
+ let n = Et(o);
2846
2846
  for (let r = 0; r < t; r++) i[e * t + r] = n[r];
2847
2847
  }
2848
2848
  for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
@@ -2854,15 +2854,15 @@ function jt(e, t, n, r = 128) {
2854
2854
  for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
2855
2855
  return i;
2856
2856
  }
2857
- var Mt = .25, Nt = .35, Pt = .5;
2858
- function Ft(e, t, n, r, i, a) {
2857
+ var jt = .25, Mt = .35, Nt = .5;
2858
+ function Pt(e, t, n, r, i, a) {
2859
2859
  let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
2860
2860
  if (t <= 0 || n <= 0) return {
2861
2861
  normals: o,
2862
2862
  bandMask: s,
2863
2863
  bandWeight: c
2864
2864
  };
2865
- let l = jt(e, t, n), u = Et(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = At(l, t, n, Math.max(1, r * Mt)), m = (e) => {
2865
+ let l = At(e, t, n), u = Tt(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = kt(l, t, n, Math.max(1, r * jt)), m = (e) => {
2866
2866
  let t = u(Math.max(0, e - .5));
2867
2867
  return u(e + .5) - t;
2868
2868
  };
@@ -2877,9 +2877,9 @@ function Ft(e, t, n, r, i, a) {
2877
2877
  o[a * 3 + 2] = 1;
2878
2878
  continue;
2879
2879
  }
2880
- let g = u / r, _ = 1 - Nt, v = 1;
2880
+ let g = u / r, _ = 1 - Mt, v = 1;
2881
2881
  if (g > _) {
2882
- let e = Math.min(1, (g - _) / Nt);
2882
+ let e = Math.min(1, (g - _) / Mt);
2883
2883
  v = 1 - e * e * (3 - 2 * e);
2884
2884
  }
2885
2885
  c[a] = v;
@@ -2894,7 +2894,7 @@ function Ft(e, t, n, r, i, a) {
2894
2894
  bandWeight: c
2895
2895
  };
2896
2896
  }
2897
- var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
2897
+ var Ft = 35 * Math.PI / 180, It = 12 * Math.PI / 180, Lt = {
2898
2898
  t: {
2899
2899
  x: 0,
2900
2900
  y: -1
@@ -2928,22 +2928,22 @@ var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
2928
2928
  y: 1
2929
2929
  }
2930
2930
  };
2931
- function zt(e, t, n) {
2931
+ function Rt(e, t, n) {
2932
2932
  let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
2933
2933
  return {
2934
2934
  x: e * i - t * a,
2935
2935
  y: e * a + t * i
2936
2936
  };
2937
2937
  }
2938
- function Bt(e, t, n) {
2939
- let r = Rt[t] ?? Rt.t;
2940
- return n && n.rev && (r = zt(r.x, r.y, n.rev)), Ht(r.x, r.y, It);
2938
+ function zt(e, t, n) {
2939
+ let r = Lt[t] ?? Lt.t;
2940
+ return n && n.rev && (r = Rt(r.x, r.y, n.rev)), Vt(r.x, r.y, Ft);
2941
2941
  }
2942
- function Vt(e) {
2942
+ function Bt(e) {
2943
2943
  let t = Math.hypot(e.x, e.y) || 1;
2944
- return Ht(-e.x / t, -e.y / t, Lt);
2944
+ return Vt(-e.x / t, -e.y / t, It);
2945
2945
  }
2946
- function Ht(e, t, n) {
2946
+ function Vt(e, t, n) {
2947
2947
  let r = Math.hypot(e, t) || 1, i = Math.cos(n), a = Math.sin(n), o = e / r * i, s = t / r * i, c = a, l = Math.hypot(o, s, c) || 1;
2948
2948
  return {
2949
2949
  x: o / l,
@@ -2951,7 +2951,7 @@ function Ht(e, t, n) {
2951
2951
  z: c / l
2952
2952
  };
2953
2953
  }
2954
- var Ut = 2, Wt = {
2954
+ var Ht = 2, Ut = {
2955
2955
  matte: {
2956
2956
  ambient: .62,
2957
2957
  diffuse: .45,
@@ -2964,8 +2964,8 @@ var Ut = 2, Wt = {
2964
2964
  specular: .35,
2965
2965
  shininess: 22
2966
2966
  }
2967
- }, Gt = .8;
2968
- function Kt(e) {
2967
+ }, Wt = .8;
2968
+ function Gt(e) {
2969
2969
  switch (e) {
2970
2970
  case "plastic":
2971
2971
  case "metal":
@@ -2976,8 +2976,8 @@ function Kt(e) {
2976
2976
  default: return "matte";
2977
2977
  }
2978
2978
  }
2979
- function qt(e, t, n = !0) {
2980
- let r = Wt[e], i = {
2979
+ function Kt(e, t, n = !0) {
2980
+ let r = Ut[e], i = {
2981
2981
  light: t,
2982
2982
  material: e,
2983
2983
  ambient: r.ambient,
@@ -2985,9 +2985,9 @@ function qt(e, t, n = !0) {
2985
2985
  specular: r.specular,
2986
2986
  shininess: r.shininess
2987
2987
  };
2988
- return n && (i.fillLight = Vt(t), i.fillDiffuse = i.diffuse * Gt), i;
2988
+ return n && (i.fillLight = Bt(t), i.fillDiffuse = i.diffuse * Wt), i;
2989
2989
  }
2990
- function Jt(e, t) {
2990
+ function qt(e, t) {
2991
2991
  let n = e.x * t.light.x + e.y * t.light.y + e.z * t.light.z, r = t.diffuse * Math.max(0, n), i = 0;
2992
2992
  if (t.fillLight && t.fillDiffuse) {
2993
2993
  let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
@@ -3000,7 +3000,7 @@ function Jt(e, t) {
3000
3000
  }
3001
3001
  return Math.max(0, t.ambient + r + i + a);
3002
3002
  }
3003
- function Yt(e, t, n) {
3003
+ function Jt(e, t, n) {
3004
3004
  if (!e) return {
3005
3005
  x: 0,
3006
3006
  y: 0,
@@ -3015,16 +3015,16 @@ function Yt(e, t, n) {
3015
3015
  h: Math.max(0, o - i)
3016
3016
  };
3017
3017
  }
3018
- function Xt(e, t, n) {
3018
+ function Yt(e, t, n) {
3019
3019
  let r = e.canvas.width, i = e.canvas.height;
3020
3020
  if (r <= 0 || i <= 0) return;
3021
3021
  let a = t.widthPx;
3022
3022
  if (a < .75) return;
3023
- let { x: o, y: s, w: c, h: l } = Yt(n, r, i);
3023
+ let { x: o, y: s, w: c, h: l } = Jt(n, r, i);
3024
3024
  if (c <= 0 || l <= 0) return;
3025
3025
  let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
3026
3026
  for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
3027
- let { bandMask: p, bandWeight: m, normals: h } = Ft(f, c, l, a, t.prst, t.heightPx), g = qt(t.material, t.light), _ = Jt({
3027
+ let { bandMask: p, bandWeight: m, normals: h } = Pt(f, c, l, a, t.prst, t.heightPx), g = Kt(t.material, t.light), _ = qt({
3028
3028
  x: 0,
3029
3029
  y: 0,
3030
3030
  z: 1
@@ -3035,13 +3035,13 @@ function Xt(e, t, n) {
3035
3035
  if (n <= 0) continue;
3036
3036
  let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
3037
3037
  t.bottom && (r = -r, i = -i);
3038
- let o = 1 + (Jt({
3038
+ let o = 1 + (qt({
3039
3039
  x: r,
3040
3040
  y: i,
3041
3041
  z: a
3042
3042
  }, g) / _ - 1) * n, s = e * 4;
3043
3043
  if (o >= 1) {
3044
- let e = Math.min(1, (o - 1) * Ut);
3044
+ let e = Math.min(1, (o - 1) * Ht);
3045
3045
  for (let t = 0; t < 3; t++) {
3046
3046
  let n = Math.min(255, d[s + t] * o);
3047
3047
  d[s + t] = n + (255 - n) * e;
@@ -3050,12 +3050,12 @@ function Xt(e, t, n) {
3050
3050
  }
3051
3051
  e.putImageData(u, o, s);
3052
3052
  }
3053
- function Zt(e, t, n) {
3053
+ function Xt(e, t, n) {
3054
3054
  let r = e.canvas.width, i = e.canvas.height;
3055
3055
  if (r <= 0 || i <= 0) return;
3056
3056
  let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
3057
3057
  if (s < .75) return;
3058
- let { x: c, y: l, w: u, h: d } = Yt(n, r, i);
3058
+ let { x: c, y: l, w: u, h: d } = Jt(n, r, i);
3059
3059
  if (u <= 0 || d <= 0) return;
3060
3060
  let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
3061
3061
  for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
@@ -3079,36 +3079,36 @@ function Zt(e, t, n) {
3079
3079
  }
3080
3080
  //#endregion
3081
3081
  //#region packages/core/src/text/underline.ts
3082
- function Qt(t, n, r, i, a, o, s, c = 1) {
3083
- let l = Math.max(1, a * .05), u = s === "heavy" || (s?.endsWith("Heavy") ?? !1) ? l * 1.8 : l, d = r + Math.max(2, u), f = e(d, u, c);
3084
- if (t.strokeStyle = o, t.lineWidth = u, t.setLineDash([]), s && s.startsWith("wavy")) {
3085
- let e = u, r = u * 6;
3086
- t.beginPath(), t.moveTo(n, d);
3087
- let a = Math.max(1, u * .5);
3088
- for (let o = 0; o <= i; o += a) {
3089
- let i = d + Math.sin(o / r * Math.PI * 2) * e;
3090
- t.lineTo(n + o, i);
3082
+ function Zt(e, t, n, r, i, a, o, s = 1) {
3083
+ let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = T(u, l, s);
3084
+ if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
3085
+ let n = l, i = l * 6;
3086
+ e.beginPath(), e.moveTo(t, u);
3087
+ let a = Math.max(1, l * .5);
3088
+ for (let o = 0; o <= r; o += a) {
3089
+ let r = u + Math.sin(o / i * Math.PI * 2) * n;
3090
+ e.lineTo(t + o, r);
3091
3091
  }
3092
- if (t.stroke(), s === "wavyDbl") {
3093
- t.beginPath(), t.moveTo(n, d + e * 2.5);
3094
- for (let o = 0; o <= i; o += a) {
3095
- let i = d + e * 2.5 + Math.sin(o / r * Math.PI * 2) * e;
3096
- t.lineTo(n + o, i);
3092
+ if (e.stroke(), o === "wavyDbl") {
3093
+ e.beginPath(), e.moveTo(t, u + n * 2.5);
3094
+ for (let o = 0; o <= r; o += a) {
3095
+ let r = u + n * 2.5 + Math.sin(o / i * Math.PI * 2) * n;
3096
+ e.lineTo(t + o, r);
3097
3097
  }
3098
- t.stroke();
3098
+ e.stroke();
3099
3099
  }
3100
3100
  return;
3101
3101
  }
3102
- if (s === "dbl") {
3103
- let r = u * 1.4, a = d - r / 2, o = d + r / 2;
3104
- t.beginPath(), t.moveTo(n, a + e(a, u, c)), t.lineTo(n + i, a + e(a, u, c)), t.moveTo(n, o + e(o, u, c)), t.lineTo(n + i, o + e(o, u, c)), t.stroke();
3102
+ if (o === "dbl") {
3103
+ let n = l * 1.4, i = u - n / 2, a = u + n / 2;
3104
+ e.beginPath(), e.moveTo(t, i + T(i, l, s)), e.lineTo(t + r, i + T(i, l, s)), e.moveTo(t, a + T(a, l, s)), e.lineTo(t + r, a + T(a, l, s)), e.stroke();
3105
3105
  return;
3106
3106
  }
3107
- t.setLineDash(Oe(s ?? "sng", u)), t.beginPath(), t.moveTo(n, d + f), t.lineTo(n + i, d + f), t.stroke(), t.setLineDash([]);
3107
+ e.setLineDash(De(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
3108
3108
  }
3109
3109
  //#endregion
3110
3110
  //#region packages/core/src/text/highlight-box.ts
3111
- function $t(e, t) {
3111
+ function Qt(e, t) {
3112
3112
  return {
3113
3113
  top: e - t * .85,
3114
3114
  height: t * 1.1
@@ -3116,7 +3116,7 @@ function $t(e, t) {
3116
3116
  }
3117
3117
  //#endregion
3118
3118
  //#region packages/core/src/text/justify-positions.ts
3119
- function en(e, t, n, r, i = 0) {
3119
+ function $t(e, t, n, r, i = 0) {
3120
3120
  let a = [], o = 0, s = 0;
3121
3121
  for (let c of t) a.push({
3122
3122
  text: e.slice(o, c).join(""),
@@ -3129,14 +3129,14 @@ function en(e, t, n, r, i = 0) {
3129
3129
  }
3130
3130
  //#endregion
3131
3131
  //#region packages/pptx/src/reflection-blur.ts
3132
- var tn = .5;
3133
- function nn(e, t) {
3132
+ var en = .5;
3133
+ function tn(e, t) {
3134
3134
  if (!(t > 0) || !(e.h > 0)) return [{
3135
3135
  y: e.y,
3136
3136
  h: Math.max(0, e.h),
3137
3137
  radius: 0
3138
3138
  }];
3139
- let n = Math.max(4, Math.min(24, Math.ceil(t / tn) + 1)), r = e.y + e.h, i = [];
3139
+ let n = Math.max(4, Math.min(24, Math.ceil(t / en) + 1)), r = e.y + e.h, i = [];
3140
3140
  for (let a = 0; a < n; a++) {
3141
3141
  let o = Math.sqrt(a / (n - 1)), s = a === 0 ? 0 : Math.sqrt((a - 1) / (n - 1)), c = a === n - 1 ? 1 : Math.sqrt((a + 1) / (n - 1)), l = a === 0 ? 0 : (s + o) / 2, u = a === n - 1 ? 1 : (o + c) / 2, d = r - u * e.h;
3142
3142
  i.push({
@@ -3147,19 +3147,19 @@ function nn(e, t) {
3147
3147
  }
3148
3148
  return i;
3149
3149
  }
3150
- function rn(e, t, n, r, i) {
3151
- for (let a of nn(n, r)) e.save(), e.beginPath(), e.rect(0, a.y, i, a.h), e.clip(), e.filter = a.radius > 0 ? `blur(${a.radius}px)` : "none", e.drawImage(t, 0, 0), e.restore();
3150
+ function nn(e, t, n, r, i) {
3151
+ for (let a of tn(n, r)) e.save(), e.beginPath(), e.rect(0, a.y, i, a.h), e.clip(), e.filter = a.radius > 0 ? `blur(${a.radius}px)` : "none", e.drawImage(t, 0, 0), e.restore();
3152
3152
  }
3153
3153
  //#endregion
3154
3154
  //#region packages/pptx/src/hyperlink.ts
3155
- function an(e, t) {
3155
+ function rn(e, t) {
3156
3156
  let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
3157
3157
  if (n === void 0 && r === void 0) return;
3158
3158
  if (r !== void 0) return {
3159
3159
  kind: "internal",
3160
3160
  ref: n ?? r
3161
3161
  };
3162
- let i = n, a = H(i);
3162
+ let i = n, a = W(i);
3163
3163
  return a !== null && ie.includes(a) ? {
3164
3164
  kind: "external",
3165
3165
  url: i
@@ -3170,7 +3170,7 @@ function an(e, t) {
3170
3170
  }
3171
3171
  //#endregion
3172
3172
  //#region packages/pptx/src/media-chrome.ts
3173
- function on(e, t, n, r, i, a) {
3173
+ function an(e, t, n, r, i, a) {
3174
3174
  let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
3175
3175
  if (e.save(), e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = o * .35, e.fillStyle = "rgba(20, 20, 20, 0.7)", e.beginPath(), e.arc(t, n, o, 0, Math.PI * 2), e.fill(), e.shadowColor = "transparent", e.shadowBlur = 0, e.fillStyle = "#fff", a === "paused") {
3176
3176
  e.beginPath();
@@ -3184,18 +3184,18 @@ function on(e, t, n, r, i, a) {
3184
3184
  }
3185
3185
  //#endregion
3186
3186
  //#region packages/pptx/src/bidi-line.ts
3187
- var sn = (e) => {
3187
+ var on = (e) => {
3188
3188
  let t = e.text;
3189
3189
  return typeof t == "string" ? t : void 0;
3190
- }, cn = (e) => "isTab" in e;
3191
- function ln(e) {
3190
+ }, sn = (e) => "isTab" in e;
3191
+ function cn(e) {
3192
3192
  for (let t of e) {
3193
- let e = sn(t);
3194
- if (e !== void 0 && ee(e)) return !0;
3193
+ let e = on(t);
3194
+ if (e !== void 0 && z(e)) return !0;
3195
3195
  }
3196
3196
  return !1;
3197
3197
  }
3198
- function un(e, n) {
3198
+ function ln(e, n) {
3199
3199
  let r = e.length;
3200
3200
  if (r === 0) return {
3201
3201
  order: [],
@@ -3204,14 +3204,14 @@ function un(e, n) {
3204
3204
  let i = "", a = Array(r), o;
3205
3205
  for (let t = 0; t < r; t++) {
3206
3206
  a[t] = i.length;
3207
- let n = sn(e[t]) ?? "";
3208
- if (i += n.length > 0 ? n : "", cn(e[t])) {
3207
+ let n = on(e[t]) ?? "";
3208
+ if (i += n.length > 0 ? n : "", sn(e[t])) {
3209
3209
  for (o ??= []; o.length < i.length;) o.push(null);
3210
3210
  o[a[t]] = "S";
3211
3211
  }
3212
3212
  }
3213
3213
  if (o) for (; o.length < i.length;) o.push(null);
3214
- let { levels: s, paragraphLevel: c } = p().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = t(s, c, a), d = Array(r);
3214
+ let { levels: s, paragraphLevel: c } = t().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = m(s, c, a), d = Array(r);
3215
3215
  for (let e = 0; e < r; e++) d[e] = (u[e] & 1) == 1;
3216
3216
  return {
3217
3217
  order: l,
@@ -3220,32 +3220,32 @@ function un(e, n) {
3220
3220
  }
3221
3221
  //#endregion
3222
3222
  //#region packages/pptx/src/cjk-wrap.ts
3223
- function dn(e, t, n, r, i = 0, a = !1) {
3223
+ function un(e, t, n, r, i = 0, a = !1) {
3224
3224
  if (e.length === 0) return 0;
3225
- let s = t === 0, c = 0, l = t;
3225
+ let o = t === 0, s = 0, c = t;
3226
3226
  for (let t of e) {
3227
- let e = c > 0 || a ? i : 0;
3228
- if (l + e + t.w > n) {
3229
- if (c > 0 || !s) break;
3230
- l += e + t.w, c++;
3227
+ let e = s > 0 || a ? i : 0;
3228
+ if (c + e + t.w > n) {
3229
+ if (s > 0 || !o) break;
3230
+ c += e + t.w, s++;
3231
3231
  break;
3232
3232
  }
3233
- l += e + t.w, c++;
3233
+ c += e + t.w, s++;
3234
3234
  }
3235
- return c === 0 ? 0 : c >= e.length ? e.length : o(e.map((e) => e.ch), c, r, +!!s);
3235
+ return s === 0 ? 0 : s >= e.length ? e.length : x(e.map((e) => e.ch), s, r, +!!o);
3236
3236
  }
3237
3237
  //#endregion
3238
3238
  //#region packages/pptx/src/text-justify.ts
3239
- var fn = (e) => /\s/.test(String.fromCodePoint(e));
3240
- function pn(e, t, n, r, i) {
3239
+ var dn = (e) => /\s/.test(String.fromCodePoint(e));
3240
+ function fn(e, t, n, r, i) {
3241
3241
  if (r === "just" && i) return null;
3242
3242
  let a = t - n;
3243
3243
  if (a <= .5) return null;
3244
- let o = we(e, a, {
3244
+ let o = Ce(e, a, {
3245
3245
  firstContentSi: 0,
3246
3246
  lastDrawnSi: e.length,
3247
- isGapChar: le,
3248
- isWhitespace: fn,
3247
+ isGapChar: y,
3248
+ isWhitespace: dn,
3249
3249
  seaClusterGaps: r === "thaiDist"
3250
3250
  });
3251
3251
  if (!o) return null;
@@ -3266,7 +3266,7 @@ function pn(e, t, n, r, i) {
3266
3266
  }
3267
3267
  //#endregion
3268
3268
  //#region packages/pptx/src/table-border-conflict.ts
3269
- function mn(e) {
3269
+ function pn(e) {
3270
3270
  if (!e) return {
3271
3271
  r: 0,
3272
3272
  g: 0,
@@ -3283,37 +3283,37 @@ function mn(e) {
3283
3283
  b: parseInt(t.slice(4, 6), 16)
3284
3284
  };
3285
3285
  }
3286
- function hn(e) {
3287
- let t = mn(e);
3286
+ function mn(e) {
3287
+ let t = pn(e);
3288
3288
  return .299 * t.r + .587 * t.g + .114 * t.b;
3289
3289
  }
3290
- function gn(e, t) {
3290
+ function hn(e, t) {
3291
3291
  if (!e && !t) return null;
3292
3292
  if (!e) return t;
3293
3293
  if (!t) return e;
3294
3294
  if (e.width !== t.width) return e.width > t.width ? e : t;
3295
- let n = hn(e.color), r = hn(t.color);
3295
+ let n = mn(e.color), r = mn(t.color);
3296
3296
  return n === r || n < r ? e : t;
3297
3297
  }
3298
3298
  //#endregion
3299
3299
  //#region packages/pptx/src/smartart-fallback-contrast.ts
3300
- function _n(e) {
3301
- let t = P(e.length === 8 ? e.slice(0, 6) : e);
3300
+ function gn(e) {
3301
+ let t = K(e.length === 8 ? e.slice(0, 6) : e);
3302
3302
  if (!t) return null;
3303
- let n = te(t[0], t[1], t[2]);
3303
+ let n = re(t[0], t[1], t[2]);
3304
3304
  if (e.length !== 8) return n;
3305
3305
  let r = Number.parseInt(e.slice(6, 8), 16);
3306
3306
  if (Number.isNaN(r)) return null;
3307
3307
  let i = r / 255;
3308
3308
  return i * n + (1 - i);
3309
3309
  }
3310
- function vn(e) {
3310
+ function _n(e) {
3311
3311
  if (!e) return null;
3312
- if (e.fillType === "solid") return _n(e.color);
3312
+ if (e.fillType === "solid") return gn(e.color);
3313
3313
  if (e.fillType === "gradient") {
3314
3314
  let t = e.stops.map((e) => ({
3315
3315
  p: Math.min(1, Math.max(0, e.position)),
3316
- l: _n(e.color)
3316
+ l: gn(e.color)
3317
3317
  })).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
3318
3318
  if (t.length === 0) return null;
3319
3319
  let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
@@ -3322,18 +3322,18 @@ function vn(e) {
3322
3322
  }
3323
3323
  return null;
3324
3324
  }
3325
- function yn(e) {
3325
+ function vn(e) {
3326
3326
  return e.name === "SmartArt" && e.id === void 0;
3327
3327
  }
3328
- function bn(e, t) {
3329
- let n = vn(e);
3328
+ function yn(e, t) {
3329
+ let n = _n(e);
3330
3330
  if (n === null || n >= .5) return null;
3331
- let r = _n(t.replace(/^#/, ""));
3331
+ let r = gn(t.replace(/^#/, ""));
3332
3332
  return r !== null && r >= .5 ? null : "#FFFFFF";
3333
3333
  }
3334
3334
  //#endregion
3335
3335
  //#region packages/pptx/src/tab-layout.ts
3336
- function xn(e, t, n, r, i, a = 0) {
3336
+ function bn(e, t, n, r, i, a = 0) {
3337
3337
  let o = e.map((e) => e.width), s = (t) => {
3338
3338
  let n = 0;
3339
3339
  for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
@@ -3361,8 +3361,8 @@ function xn(e, t, n, r, i, a = 0) {
3361
3361
  }
3362
3362
  //#endregion
3363
3363
  //#region packages/pptx/src/vertical-text.ts
3364
- var Sn = () => !1;
3365
- function Cn(e, t, n) {
3364
+ var xn = () => !1;
3365
+ function Sn(e, t, n) {
3366
3366
  let r = e.textBaseline;
3367
3367
  e.textBaseline = "alphabetic";
3368
3368
  let i = e.measureText(t);
@@ -3370,7 +3370,7 @@ function Cn(e, t, n) {
3370
3370
  let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
3371
3371
  return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
3372
3372
  }
3373
- function wn(e, t) {
3373
+ function Cn(e, t) {
3374
3374
  let n = e.textAlign, r = e.textBaseline;
3375
3375
  e.textAlign = "center", e.textBaseline = "middle";
3376
3376
  let i = e.measureText(t);
@@ -3378,15 +3378,15 @@ function wn(e, t) {
3378
3378
  let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
3379
3379
  return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
3380
3380
  }
3381
- function Tn(e, t, n, r, i, a, o = "fill", s = Sn) {
3382
- let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Cn(e, t, i), f = 0;
3381
+ function wn(e, t, n, r, i, a, o = "fill", s = xn) {
3382
+ let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Sn(e, t, i), f = 0;
3383
3383
  for (let o of t) {
3384
- let t = o.codePointAt(0) ?? 0, l = R(t), p = e.measureText(o).width + a, m = l === "Tr" ? ce(t) : null, h = l === "Tr" && m === null && G(t), g = l === "U" || l === "Tu" || m !== null || h;
3385
- if (re(t) && s(t)) {
3384
+ let t = o.codePointAt(0) ?? 0, l = oe(t), p = e.measureText(o).width + a, m = l === "Tr" ? A(t) : null, h = l === "Tr" && m === null && N(t), g = l === "U" || l === "Tu" || m !== null || h;
3385
+ if (j(t) && s(t)) {
3386
3386
  let t = n + f + p / 2;
3387
- e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", M(e, () => u(o, 0, 0)), e.restore();
3387
+ e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", G(e, () => u(o, 0, 0)), e.restore();
3388
3388
  } else if (g) {
3389
- let r = m === null && l === "Tu" ? F(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? wn(e, s) / i : 0;
3389
+ let r = m === null && l === "Tu" ? V(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? Cn(e, s) / i : 0;
3390
3390
  e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
3391
3391
  } else if (l === "Tr") {
3392
3392
  let t = n + f + p / 2;
@@ -3396,25 +3396,25 @@ function Tn(e, t, n, r, i, a, o = "fill", s = Sn) {
3396
3396
  }
3397
3397
  e.textAlign = c, e.textBaseline = l;
3398
3398
  }
3399
- function En(e, t, n, r, i, a, o = "fill") {
3400
- Tn(e, t, n, r, i, a, o, (t) => oe(e, t));
3399
+ function Tn(e, t, n, r, i, a, o = "fill") {
3400
+ wn(e, t, n, r, i, a, o, (t) => D(e, t));
3401
3401
  }
3402
3402
  //#endregion
3403
3403
  //#region packages/pptx/src/renderer.ts
3404
- function Y(e, t) {
3404
+ function X(e, t) {
3405
3405
  return e * t;
3406
3406
  }
3407
- function Dn(e, t, n, r) {
3408
- let i = Fe(Math.abs(e * n), Math.abs(t * n), r);
3407
+ function En(e, t, n, r) {
3408
+ let i = Pe(Math.abs(e * n), Math.abs(t * n), r);
3409
3409
  return i ? {
3410
3410
  targetWidthPx: i.width,
3411
3411
  targetHeightPx: i.height
3412
3412
  } : void 0;
3413
3413
  }
3414
- function X(e, t) {
3415
- return Xe(e, t);
3414
+ function Z(e, t) {
3415
+ return Ye(e, t);
3416
3416
  }
3417
- function On(e, t) {
3417
+ function Dn(e, t) {
3418
3418
  let n = e.targets.get(t);
3419
3419
  return n ? {
3420
3420
  targetWidthPx: n.width,
@@ -3422,11 +3422,11 @@ function On(e, t) {
3422
3422
  maxRetainedPixels: n.maxRetainedPixels
3423
3423
  } : void 0;
3424
3424
  }
3425
- function kn(e) {
3426
- return A(e) ? e.svgImagePath : e.imagePath;
3425
+ function On(e) {
3426
+ return J(e) ? e.svgImagePath : e.imagePath;
3427
3427
  }
3428
- function An(e, t, n, r) {
3429
- let i = $e(t.bullet);
3428
+ function kn(e, t, n, r) {
3429
+ let i = Qe(t.bullet);
3430
3430
  if (i.type !== "blip") return;
3431
3431
  let a;
3432
3432
  for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
@@ -3434,86 +3434,86 @@ function An(e, t, n, r) {
3434
3434
  break;
3435
3435
  }
3436
3436
  let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
3437
- return Math.max(1, s * J * n * r);
3437
+ return Math.max(1, s * Y * n * r);
3438
3438
  }
3439
- async function jn(e, t, n, r, i, a, o, c, l, u) {
3440
- let d = de(a), f = [], p = [], m = (e, t, n, r, i, a = 1, o = i) => {
3441
- if (!(!t || !i)) {
3442
- if (C(r) && (d.resolution === "display" || d.strategy === "adaptive")) {
3439
+ async function An(e, t, n, r, a, o, s, c, l, u) {
3440
+ let d = de(o), f = [], p = [], m = (e, t, n, r, a, o = 1, s = a) => {
3441
+ if (!(!t || !a)) {
3442
+ if (i(r) && (d.resolution === "display" || d.strategy === "adaptive")) {
3443
3443
  f.push({
3444
3444
  key: e,
3445
3445
  ...t,
3446
- retainedSurfaceCount: a
3446
+ retainedSurfaceCount: o
3447
3447
  });
3448
3448
  return;
3449
3449
  }
3450
- p.push(B(n, r, i, o).then((n) => n.dimensions && s(n.format, u !== void 0) ? {
3450
+ p.push(U(n, r, a, s).then((n) => n.dimensions && ce(n.format, u !== void 0) ? {
3451
3451
  key: e,
3452
3452
  ...t,
3453
3453
  sourceWidthPx: n.dimensions.width,
3454
3454
  sourceHeightPx: n.dimensions.height,
3455
- retainedSurfaceCount: a
3455
+ retainedSurfaceCount: o
3456
3456
  } : null).catch(() => null));
3457
3457
  }
3458
3458
  }, h = e.background;
3459
3459
  if (h?.fillType === "image" && h.imagePath && !h.tile && !h.duotone) {
3460
- let e = h.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), a = n * (1 - (e.t ?? 0) - (e.b ?? 0));
3461
- m(X(h.imagePath, h.duotone), Dn(r, a, i, h.srcRect), h.imagePath, h.mimeType, o, 1);
3460
+ let e = h.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), i = n * (1 - (e.t ?? 0) - (e.b ?? 0));
3461
+ m(Z(h.imagePath, h.duotone), En(r, i, a, h.srcRect), h.imagePath, h.mimeType, s, 1);
3462
3462
  }
3463
- for (let t of e.elements) if (t.type === "picture") !(A(t) || t.mimeType === "image/svg+xml") && !t.duotone && m(X(t.imagePath, t.duotone), Dn(Y(t.width, r), Y(t.height, r), i, t.srcRect), t.imagePath, t.mimeType, o, 1);
3463
+ for (let t of e.elements) if (t.type === "picture") !(J(t) || t.mimeType === "image/svg+xml") && !t.duotone && m(Z(t.imagePath, t.duotone), En(X(t.width, r), X(t.height, r), a, t.srcRect), t.imagePath, t.mimeType, s, 1);
3464
3464
  else if (t.type === "media" && t.posterPath) {
3465
- let e = c ? Jr(c) : void 0;
3466
- m(X(t.posterPath), Dn(Y(t.width, r), Y(t.height, r), i), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, l ?? e);
3465
+ let e = c ? qr(c) : void 0;
3466
+ m(Z(t.posterPath), En(X(t.width, r), X(t.height, r), a), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, l ?? e);
3467
3467
  } else if (t.type === "chart") {
3468
3468
  let e = {
3469
- widthPt: t.width / J,
3470
- heightPt: t.height / J,
3471
- targetWidthPx: Y(t.width, r) * i,
3472
- targetHeightPx: Y(t.height, r) * i
3469
+ widthPt: t.width / Y,
3470
+ heightPt: t.height / Y,
3471
+ targetWidthPx: X(t.width, r) * a,
3472
+ targetHeightPx: X(t.height, r) * a
3473
3473
  };
3474
- for (let n of Ee(t.chart)) {
3475
- let t = n.fill, r = De(n, e);
3476
- !(t.mimeType === "image/svg+xml" || A({
3474
+ for (let n of Te(t.chart)) {
3475
+ let t = n.fill, r = Ee(n, e);
3476
+ !(t.mimeType === "image/svg+xml" || J({
3477
3477
  svgImagePath: t.svgImagePath,
3478
3478
  srcRect: n.hasSourceCrop ? !0 : null
3479
- })) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(X(t.imagePath, t.duotone), {
3479
+ })) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(Z(t.imagePath, t.duotone), {
3480
3480
  targetWidthPx: r.targetWidthPx,
3481
3481
  targetHeightPx: r.targetHeightPx
3482
- }, t.imagePath, t.mimeType, o, 1);
3482
+ }, t.imagePath, t.mimeType, s, 1);
3483
3483
  }
3484
3484
  } else if (t.type === "shape" && t.textBody) for (let e of t.textBody.paragraphs) {
3485
- let n = $e(e.bullet);
3485
+ let n = Qe(e.bullet);
3486
3486
  if (n.type !== "blip") continue;
3487
- let a = An(t.textBody, e, r, i);
3488
- !a || !o || p.push(B(n.imagePath, n.mimeType, o).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && s(e.format, u !== void 0) ? {
3489
- key: X(n.imagePath),
3490
- targetWidthPx: a * e.dimensions.width / e.dimensions.height,
3491
- targetHeightPx: a,
3487
+ let i = kn(t.textBody, e, r, a);
3488
+ !i || !s || p.push(U(n.imagePath, n.mimeType, s).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && ce(e.format, u !== void 0) ? {
3489
+ key: Z(n.imagePath),
3490
+ targetWidthPx: i * e.dimensions.width / e.dimensions.height,
3491
+ targetHeightPx: i,
3492
3492
  sourceWidthPx: e.dimensions.width,
3493
3493
  sourceHeightPx: e.dimensions.height
3494
3494
  } : null).catch(() => null));
3495
3495
  }
3496
- return f.push(...(await Promise.all(p)).filter((e) => e !== null)), S(f, d);
3496
+ return f.push(...(await Promise.all(p)).filter((e) => e !== null)), k(f, d);
3497
3497
  }
3498
- function Mn(e) {
3499
- return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Ee(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => $e(e.bullet).type === "blip"));
3498
+ function jn(e) {
3499
+ return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Te(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => Qe(e.bullet).type === "blip"));
3500
3500
  }
3501
- var Z = ke;
3502
- function Nn(e, t, n, r, i, a, o) {
3503
- let { top: s, height: c } = $t(n, i);
3501
+ var Q = Oe;
3502
+ function Mn(e, t, n, r, i, a, o) {
3503
+ let { top: s, height: c } = Qt(n, i);
3504
3504
  e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
3505
3505
  }
3506
- function Pn(e, t, n, r, i, a, o = 0) {
3507
- return Ie(e, t, n, r, i, a, o);
3506
+ function Nn(e, t, n, r, i, a, o = 0) {
3507
+ return Fe(e, t, n, r, i, a, o);
3508
3508
  }
3509
- var Fn = /* @__PURE__ */ new WeakMap();
3510
- function In(e, t) {
3509
+ var Pn = /* @__PURE__ */ new WeakMap();
3510
+ function Fn(e, t) {
3511
3511
  let n = e.tinted.get(t);
3512
3512
  if (n) return n;
3513
3513
  let r = ae(e.raster, t);
3514
3514
  return e.tinted.set(t, r), r;
3515
3515
  }
3516
- function Ln(e) {
3516
+ function In(e) {
3517
3517
  let t = [], n = (e) => {
3518
3518
  if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
3519
3519
  nodes: e.nodes,
@@ -3524,13 +3524,13 @@ function Ln(e) {
3524
3524
  else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
3525
3525
  return t;
3526
3526
  }
3527
- async function Rn(e, t) {
3528
- let n = Ln(e);
3527
+ async function Ln(e, t) {
3528
+ let n = In(e);
3529
3529
  if (n.length !== 0) {
3530
3530
  await t.loadMathJax();
3531
- for (let e of n) if (!Fn.has(e.nodes)) try {
3532
- let n = await t.mathMLToSvg(U(e.nodes, e.display)), r = await ne(n, "#000000");
3533
- Fn.set(e.nodes, {
3531
+ for (let e of n) if (!Pn.has(e.nodes)) try {
3532
+ let n = await t.mathMLToSvg(te(e.nodes, e.display)), r = await M(n, "#000000");
3533
+ Pn.set(e.nodes, {
3534
3534
  raster: r,
3535
3535
  widthEm: n.widthEm,
3536
3536
  ascentEm: n.ascentEm,
@@ -3540,14 +3540,14 @@ async function Rn(e, t) {
3540
3540
  } catch {}
3541
3541
  }
3542
3542
  }
3543
- function zn(e, t) {
3543
+ function Rn(e, t) {
3544
3544
  let n = (e) => t.embeddedFontAliases?.get(e.trim().toLowerCase()) ?? e;
3545
3545
  if (!e) return n(t.themeMinorFont ?? "sans-serif");
3546
3546
  if (e.startsWith("+")) return n(e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif");
3547
3547
  let r = e.split(",")[0].trim();
3548
3548
  return r ? n(r) : t.themeMinorFont ?? "sans-serif";
3549
3549
  }
3550
- var Bn = new Set([
3550
+ var zn = new Set([
3551
3551
  "serif",
3552
3552
  "sans-serif",
3553
3553
  "monospace",
@@ -3555,11 +3555,11 @@ var Bn = new Set([
3555
3555
  "fantasy",
3556
3556
  "system-ui"
3557
3557
  ]);
3558
- function Vn(e) {
3559
- let t = l(e);
3558
+ function Bn(e) {
3559
+ let t = r(e);
3560
3560
  return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
3561
3561
  }
3562
- var Hn = {
3562
+ var Vn = {
3563
3563
  calibri: "Carlito",
3564
3564
  "calibri light": "Carlito",
3565
3565
  cambria: "Caladea",
@@ -3571,38 +3571,38 @@ var Hn = {
3571
3571
  "simplified arabic": "Noto Naskh Arabic",
3572
3572
  "arabic typesetting": "Noto Naskh Arabic",
3573
3573
  "univers next arabic": "Noto Sans Arabic"
3574
- }, Un = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
3575
- function Wn(e) {
3576
- if (Hn[e.toLowerCase()]?.includes("Arabic")) return !0;
3574
+ }, Hn = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
3575
+ function Un(e) {
3576
+ if (Vn[e.toLowerCase()]?.includes("Arabic")) return !0;
3577
3577
  let t = e.toLowerCase();
3578
3578
  return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[؀-ۿ]/.test(t);
3579
3579
  }
3580
- function Gn(e) {
3580
+ function Wn(e) {
3581
3581
  return e.map((e) => `"${e}"`).join(", ");
3582
3582
  }
3583
- function Kn(e, t = e) {
3584
- let n = Vn(t), i = Hn[t.toLowerCase()], a = i ? `"${i}", ` : "";
3585
- if (Wn(t)) return `"${e}", ${a}${Un}, ${n}`;
3586
- let o = n === "serif" ? "serif" : "sans", s = w(t);
3587
- return `"${e}", ${a}${s ? `${Gn(r(s, o))}, ` : ""}${`${Gn(o === "serif" ? f : u)}, `}${n}`;
3583
+ function Gn(e, t = e) {
3584
+ let n = Bn(t), r = Vn[t.toLowerCase()], i = r ? `"${r}", ` : "", a = C(t), o = a ? `"${a}", ` : "";
3585
+ if (Un(t)) return `"${e}", ${i}${Hn}, ${n}`;
3586
+ let c = n === "serif" ? "serif" : "sans", l = fe(t), u = l ? v(l, c).filter((e) => e !== a) : [];
3587
+ return `"${e}", ${i}${o}${u.length > 0 ? `${Wn(u)}, ` : ""}${`${Wn(c === "serif" ? s : g)}, `}${n}`;
3588
3588
  }
3589
- function qn(e) {
3589
+ function Kn(e) {
3590
3590
  return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
3591
3591
  }
3592
- function Jn(e) {
3592
+ function qn(e) {
3593
3593
  let t = e.toLowerCase();
3594
3594
  return /\b(thin|hairline)\b/.test(t) ? 100 : /\b(extra[- ]?light|ultra[- ]?light)\b/.test(t) ? 200 : /\blight\b/.test(t) ? 300 : /\b(black|heavy)\b/.test(t) ? 900 : /\b(extra[- ]?bold|ultra[- ]?bold)\b/.test(t) ? 800 : /\b(semi[- ]?bold|demi[- ]?bold)\b/.test(t) ? 600 : /\bbold\b/.test(t) ? 700 : /\bmedium\b/.test(t) ? 600 : null;
3595
3595
  }
3596
- function Yn(e, t, n, r, i, a, o, s) {
3597
- let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = je(m, h), _ = g?.getContext("2d");
3596
+ function Jn(e, t, n, r, i, a, o, s) {
3597
+ let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = Ae(m, h), _ = g?.getContext("2d");
3598
3598
  if (!g || !_) return;
3599
3599
  _.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
3600
3600
  let v = n.y - d, y = v + n.h, b = g, x = _;
3601
3601
  if (c > 0) {
3602
- let e = je(m, h), t = e?.getContext("2d");
3602
+ let e = Ae(m, h), t = e?.getContext("2d");
3603
3603
  e && t && (b = e, x = t);
3604
3604
  }
3605
- b !== g && rn(x, g, {
3605
+ b !== g && nn(x, g, {
3606
3606
  x: n.x - u,
3607
3607
  y: v,
3608
3608
  w: n.w,
@@ -3629,14 +3629,14 @@ function Yn(e, t, n, r, i, a, o, s) {
3629
3629
  let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
3630
3630
  e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.translate(n.x + Math.cos(E) * T, D + Math.sin(E) * T), e.scale(r.sx, r.sy), e.translate(-n.x, -D), e.drawImage(b, u, d), e.restore();
3631
3631
  }
3632
- function Xn(e, t, n, r, i) {
3633
- let a = t ? "italic " : "", o = zn(r, i), s = i.embeddedFontAuthoredFamilies?.get(o) ?? o, c = Jn(s), l = e ? "bold " : c ? `${c} ` : "";
3634
- return Bn.has(o) ? `${a}${l}${n}px ${o}` : `${a}${l}${n}px ${Kn(o, s)}`;
3632
+ function Yn(e, t, n, r, i) {
3633
+ let a = t ? "italic " : "", o = Rn(r, i), s = i.embeddedFontAuthoredFamilies?.get(o) ?? o, c = qn(s), l = e ? "bold " : c ? `${c} ` : "";
3634
+ return zn.has(o) ? `${a}${l}${n}px ${o}` : `${a}${l}${n}px ${Gn(o, s)}`;
3635
3635
  }
3636
- function Zn(e) {
3637
- return e.bullet.type === "char" || e.bullet.type === "autoNum" || $e(e.bullet).type === "blip";
3636
+ function Xn(e) {
3637
+ return e.bullet.type === "char" || e.bullet.type === "autoNum" || Qe(e.bullet).type === "blip";
3638
3638
  }
3639
- function Qn(e, t, n) {
3639
+ function Zn(e, t, n) {
3640
3640
  let r = null;
3641
3641
  for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
3642
3642
  r = e.fontSize;
@@ -3645,41 +3645,41 @@ function Qn(e, t, n) {
3645
3645
  let i = r ?? t.defFontSize ?? e.defaultFontSize ?? 18;
3646
3646
  return n.sizePts == null ? i * ((n.sizePct ?? 100) / 100) : n.sizePts;
3647
3647
  }
3648
- function $n(e, t) {
3648
+ function Qn(e, t) {
3649
3649
  return e ? 0 : Math.max(0, t);
3650
3650
  }
3651
- function er(e, t) {
3651
+ function $n(e, t) {
3652
3652
  return t != null && t !== 0 ? e * .65 : e;
3653
3653
  }
3654
- function tr(e, t, n, r, i, a, o) {
3655
- let s = (t.defaultFontSize ?? 18) * J * a;
3654
+ function er(e, t, n, r, i, a, o) {
3655
+ let s = (t.defaultFontSize ?? 18) * Y * a;
3656
3656
  for (let c of t.paragraphs) {
3657
- let l = Y(c.marL, a), u = Y(c.marR, a), d = Y(c.indent, a), f = $n(Zn(c), d), p = n - r - i - l - u - f, m = 0;
3657
+ let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = Qn(Xn(c), d), p = n - r - i - l - u - f, m = 0;
3658
3658
  for (let n of c.runs) {
3659
3659
  if (n.type !== "text") continue;
3660
- let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * J * a : n.fontSize * J * a, i = zn(n.fontFamily ?? c.defFontFamily ?? null, o);
3661
- e.font = Xn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, er(r, n.baseline ?? void 0), i, o);
3662
- let l = (n.letterSpacing ?? 0) * J * a;
3663
- if (m += Q(e, n.text, l), m > p) return !0;
3660
+ let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = Rn(n.fontFamily ?? c.defFontFamily ?? null, o);
3661
+ e.font = Yn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, $n(r, n.baseline ?? void 0), i, o);
3662
+ let l = (n.letterSpacing ?? 0) * Y * a;
3663
+ if (m += $(e, n.text, l), m > p) return !0;
3664
3664
  }
3665
3665
  }
3666
3666
  return !1;
3667
3667
  }
3668
- function nr(e) {
3669
- for (let t of e) if (le(t.codePointAt(0) ?? 0)) return !0;
3668
+ function tr(e) {
3669
+ for (let t of e) if (y(t.codePointAt(0) ?? 0)) return !0;
3670
3670
  return !1;
3671
3671
  }
3672
- function rr(e) {
3672
+ function nr(e) {
3673
3673
  let t = 0;
3674
3674
  for (let n of e) t++;
3675
3675
  return t;
3676
3676
  }
3677
- var ir = /* @__PURE__ */ new WeakMap();
3678
- function ar(e) {
3679
- let t = ir.get(e);
3677
+ var rr = /* @__PURE__ */ new WeakMap();
3678
+ function ir(e) {
3679
+ let t = rr.get(e);
3680
3680
  if (t != null) return t;
3681
3681
  let n = e, r = n.letterSpacing;
3682
- if (typeof r != "string") return ir.set(e, !1), !1;
3682
+ if (typeof r != "string") return rr.set(e, !1), !1;
3683
3683
  let i = !1;
3684
3684
  try {
3685
3685
  n.letterSpacing = "0px";
@@ -3694,11 +3694,11 @@ function ar(e) {
3694
3694
  n.letterSpacing = r;
3695
3695
  } catch {}
3696
3696
  }
3697
- return ir.set(e, i), i;
3697
+ return rr.set(e, i), i;
3698
3698
  }
3699
- function Q(e, t, n) {
3699
+ function $(e, t, n) {
3700
3700
  let r = e, i = r.letterSpacing;
3701
- if (n !== 0 && ar(e)) try {
3701
+ if (n !== 0 && ir(e)) try {
3702
3702
  r.letterSpacing = `${n}px`;
3703
3703
  let i = e.measureText(t).width;
3704
3704
  if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
@@ -3707,10 +3707,10 @@ function Q(e, t, n) {
3707
3707
  r.letterSpacing = i;
3708
3708
  } catch {}
3709
3709
  }
3710
- let a = Math.max(0, rr(t) - 1);
3710
+ let a = Math.max(0, nr(t) - 1);
3711
3711
  return e.measureText(t).width + n * a;
3712
3712
  }
3713
- function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3713
+ function ar(e, t, n, r, i, o, s, c = !1, l = !1, u = 1, d, f = {
3714
3714
  themeMajorFont: null,
3715
3715
  themeMinorFont: null,
3716
3716
  dpr: 1
@@ -3723,21 +3723,21 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3723
3723
  let r = n.text.replace(/ +$/u, "");
3724
3724
  r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (g = !1);
3725
3725
  }
3726
- let v = () => n - (m.length === 0 ? p : 0), y = { segments: [] }, b = 0, S = !1, C = t.rtl === !0, w = Y(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
3727
- pos: Y(e.pos, o),
3726
+ let _ = () => n - (m.length === 0 ? p : 0), v = { segments: [] }, b = 0, x = !1, S = t.rtl === !0, C = X(t.marR, o), w = (t.tabStops ?? []).map((e) => ({
3727
+ pos: X(e.pos, o),
3728
3728
  algn: e.algn
3729
- })), E = Y(t.defTabSz ?? 914400, o), D = !1, k = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
3730
- let t = xn(e > 0 ? [...k, {
3729
+ })), T = X(t.defTabSz ?? 914400, o), D = !1, k = [], A = 0, j = () => S ? C : s + (m.length === 0 ? p : 0), M = (e = 0) => {
3730
+ let t = bn(e > 0 ? [...k, {
3731
3731
  isTab: !1,
3732
3732
  width: e
3733
- }] : k, T, j(), Infinity, A, E), n = 0;
3733
+ }] : k, w, j(), Infinity, A, T), n = 0;
3734
3734
  for (let e of t) n += e;
3735
3735
  return n;
3736
3736
  }, N = (e) => {
3737
- let t = v();
3737
+ let t = _();
3738
3738
  return Number.isFinite(t) ? D ? M(e) <= t : b + e <= t : !0;
3739
3739
  }, P = () => {
3740
- let e = v();
3740
+ let e = _();
3741
3741
  if (!D) return e - b;
3742
3742
  if (!Number.isFinite(e)) return Infinity;
3743
3743
  if (M(0) >= e) return 0;
@@ -3747,28 +3747,27 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3747
3747
  M(r) <= e ? t = r : n = r;
3748
3748
  }
3749
3749
  return t;
3750
- }, F = (e = !1) => {
3751
- e && (y.endsWithBreak = !0), m.push(y), y = { segments: [] }, b = 0, D = !1, k = [], S = !1;
3752
- }, I = (t, n, r, i) => {
3750
+ }, I = (e = !1) => {
3751
+ e && (v.endsWithBreak = !0), m.push(v), v = { segments: [] }, b = 0, D = !1, k = [], x = !1;
3752
+ }, L = (t, n, r, i) => {
3753
3753
  e.font = n;
3754
- let a = Q(e, t, r), o = y.segments.at(-1);
3755
- return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? Q(e, o.text + t, r) - Q(e, o.text, r) : a + r;
3756
- }, L = (t, n, r, i, a, o, s, c) => {
3754
+ let a = $(e, t, r), o = v.segments.at(-1);
3755
+ return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? $(e, o.text + t, r) - $(e, o.text, r) : a + r;
3756
+ }, R = (t, n, r, i, a, o, s, c) => {
3757
3757
  if (!t) return;
3758
3758
  e.font = n;
3759
- let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, x = c?.hyperlink, S = c?.drawSizePx ?? r, C = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && (e.drawSizePx ?? e.sizePx) === S && qn(e.hyperlink) === qn(x) && (l === 0 || e.sourceRunId === u), w = y.segments.at(-1), T = Q(e, t, l);
3760
- if (w && C(w) ? T = Q(e, w.text + t, l) - Q(e, w.text, l) : w && !w.isTab && !w.math && u != null && w.sourceRunId === u && (T += l), b += T, k.push({
3759
+ let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, y = c?.hyperlink, x = c?.drawSizePx ?? r, S = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.drawSizePx ?? e.sizePx) === x && Kn(e.hyperlink) === Kn(y) && (l === 0 || e.sourceRunId === u), C = v.segments.at(-1), w = $(e, t, l);
3760
+ if (C && S(C) ? w = $(e, C.text + t, l) - $(e, C.text, l) : C && !C.isTab && !C.math && u != null && C.sourceRunId === u && (w += l), b += w, k.push({
3761
3761
  isTab: !1,
3762
- width: T
3763
- }), w && C(w)) w.text += t;
3762
+ width: w
3763
+ }), C && S(C)) C.text += t;
3764
3764
  else {
3765
- let e = w && !w.isTab && !w.math && u != null && w.sourceRunId === u ? l : 0;
3766
- y.segments.push({
3765
+ let e = C && !C.isTab && !C.math && u != null && C.sourceRunId === u ? l : 0;
3766
+ v.segments.push({
3767
3767
  text: t,
3768
3768
  font: n,
3769
- fontFamily: v,
3770
3769
  sizePx: r,
3771
- drawSizePx: S,
3770
+ drawSizePx: x,
3772
3771
  color: i,
3773
3772
  underline: a,
3774
3773
  underlineStyle: f,
@@ -3783,17 +3782,17 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3783
3782
  reflection: h,
3784
3783
  outline: g,
3785
3784
  highlight: _,
3786
- hyperlink: x
3785
+ hyperlink: y
3787
3786
  });
3788
3787
  }
3789
- }, R = () => {
3790
- let e = y.segments.at(-1);
3788
+ }, z = () => {
3789
+ let e = v.segments.at(-1);
3791
3790
  if (!e || e.math) return !1;
3792
3791
  let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
3793
3792
  if (t) e.text = t[1], n = t[2];
3794
- else if (y.segments.length > 1) y.segments.pop(), n = e.text;
3793
+ else if (v.segments.length > 1) v.segments.pop(), n = e.text;
3795
3794
  else return !1;
3796
- return F(), L(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
3795
+ return I(), R(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
3797
3796
  strikeDouble: e.strikeDouble,
3798
3797
  letterSpacingPx: e.letterSpacingPx,
3799
3798
  underlineStyle: e.underlineStyle,
@@ -3802,69 +3801,66 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3802
3801
  reflection: e.reflection,
3803
3802
  outline: e.outline,
3804
3803
  highlight: e.highlight,
3805
- fontFamily: e.fontFamily,
3806
3804
  sourceRunId: e.sourceRunId,
3807
3805
  drawSizePx: e.drawSizePx
3808
3806
  }), !0;
3809
3807
  };
3810
3808
  for (let [n, s] of t.runs.entries()) {
3811
3809
  if (s.type === "break") {
3812
- F(!0);
3810
+ I(!0);
3813
3811
  continue;
3814
3812
  }
3815
3813
  if (s.type === "math") {
3816
- let e = Fn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * J * o * u, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
3817
- (s.display && b > 0 || !N(n) && b > 0) && F(), k.push({
3814
+ let e = Pn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * Y * o * u, n = e ? e.widthEm * t : 0, a = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
3815
+ (s.display && b > 0 || !N(n) && b > 0) && I(), k.push({
3818
3816
  isTab: !1,
3819
3817
  width: n
3820
- }), y.segments.push({
3818
+ }), v.segments.push({
3821
3819
  text: "",
3822
3820
  font: `${t}px sans-serif`,
3823
3821
  sizePx: t,
3824
- color: s.color ? Z(s.color) : a,
3822
+ color: s.color ? Q(s.color) : i,
3825
3823
  underline: !1,
3826
3824
  strikethrough: !1,
3827
3825
  math: {
3828
3826
  nodes: s.nodes,
3829
3827
  display: s.display,
3830
3828
  width: n,
3831
- ascent: i,
3829
+ ascent: a,
3832
3830
  descent: c
3833
3831
  }
3834
- }), b += n, s.display && F();
3832
+ }), b += n, s.display && I();
3835
3833
  continue;
3836
3834
  }
3837
- let p = s.fontSize == null ? r : s.fontSize * J * o * u, m = er(p, s.baseline ?? void 0), g = zn(s.fontFamily ?? t.defFontFamily ?? null, f), C = s.fontFamilyEa ? zn(s.fontFamilyEa, f) : null, w = s.fontFamilySym ? zn(s.fontFamilySym, f) : null, T;
3838
- T = s.color ? Z(s.color) : s.hyperlink && f.themeHlinkColor ? Z(f.themeHlinkColor) : a;
3839
- let E = s.bold ?? t.defBold ?? c, j = s.italic ?? t.defItalic ?? l, M = Xn(E, j, m, g, f), B = C ? Xn(E, j, m, C, f) : M;
3835
+ let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m = $n(p, s.baseline ?? void 0), g = Rn(s.fontFamily ?? t.defFontFamily ?? null, f), S = s.fontFamilyEa ? Rn(s.fontFamilyEa, f) : null, C = s.fontFamilySym ? Rn(s.fontFamilySym, f) : null, w;
3836
+ w = s.color ? Q(s.color) : s.hyperlink && f.themeHlinkColor ? Q(f.themeHlinkColor) : i;
3837
+ let T = s.bold ?? t.defBold ?? c, j = s.italic ?? t.defItalic ?? l, M = Yn(T, j, m, g, f), B = S ? Yn(T, j, m, S, f) : M;
3840
3838
  e.font = M;
3841
- let H = s.caps, U = h.get(s) ?? s.text;
3842
- (H === "all" || H === "small") && (U = U.toUpperCase());
3843
- let ee = s.fieldType === "slidenum" && d !== void 0 ? String(d) : U, W = s.underline || s.hyperlink !== void 0, te = s.strikeDouble === !0, G = s.letterSpacing == null ? 0 : s.letterSpacing * J * o, K = {
3839
+ let V = s.caps, H = h.get(s) ?? s.text;
3840
+ (V === "all" || V === "small") && (H = H.toUpperCase());
3841
+ let U = s.fieldType === "slidenum" && d !== void 0 ? String(d) : H, W = s.underline || s.hyperlink !== void 0, te = s.strikeDouble === !0, G = s.letterSpacing == null ? 0 : s.letterSpacing * Y * o, K = {
3844
3842
  strikeDouble: te,
3845
3843
  letterSpacingPx: G,
3846
3844
  underlineStyle: s.underlineStyle,
3847
- underlineColor: s.underlineColor ? Z(s.underlineColor) : void 0,
3845
+ underlineColor: s.underlineColor ? Q(s.underlineColor) : void 0,
3848
3846
  shadow: s.shadow,
3849
3847
  reflection: s.reflection,
3850
3848
  outline: s.outline,
3851
- fontFamily: g,
3852
- highlight: s.highlight ? Z(s.highlight) : void 0,
3853
- hyperlink: an(s.hyperlink),
3849
+ highlight: s.highlight ? Q(s.highlight) : void 0,
3850
+ hyperlink: rn(s.hyperlink),
3854
3851
  sourceRunId: n,
3855
3852
  drawSizePx: m
3856
- }, q = ee.split(/(\s+)/);
3857
- for (let r of q) {
3853
+ }, J = U.split(/(\s+)/);
3854
+ for (let r of J) {
3858
3855
  if (!r) continue;
3859
3856
  if (/^\t+$/.test(r)) {
3860
3857
  D || (e.font = M, A = e.measureText(" ").width);
3861
- for (let e of r) y.segments.push({
3858
+ for (let e of r) v.segments.push({
3862
3859
  text: "",
3863
3860
  isTab: !0,
3864
3861
  font: M,
3865
- fontFamily: g,
3866
3862
  sizePx: p,
3867
- color: T,
3863
+ color: w,
3868
3864
  underline: !1,
3869
3865
  strikethrough: !1
3870
3866
  }), k.push({
@@ -3875,132 +3871,133 @@ function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3875
3871
  continue;
3876
3872
  }
3877
3873
  e.font = M;
3878
- let a = I(r, M, G, n), o = /^\s+$/.test(r), c = /[-]/;
3879
- if (c.test(r) && (w != null || _e(g))) {
3880
- let t = w ?? g;
3874
+ let i = L(r, M, G, n), o = /^\s+$/.test(r), c = /[-]/;
3875
+ if (c.test(r) && (C != null || ge(g))) {
3876
+ let t = C ?? g;
3881
3877
  for (let i of r) {
3882
3878
  let r = i, a = M;
3883
3879
  if (c.test(i)) {
3884
- let e = xe(i, t);
3885
- e === i ? a = Xn(E, j, m, t, f) : (r = e, a = Xn(E, j, m, "sans-serif", f));
3880
+ let e = be(i, t);
3881
+ e === i ? a = Yn(T, j, m, t, f) : (r = e, a = Yn(T, j, m, "sans-serif", f));
3886
3882
  }
3887
- e.font = a, !N(I(r, a, G, n)) && b > 0 && F(), L(r, a, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
3883
+ e.font = a, !N(L(r, a, G, n)) && b > 0 && I(), R(r, a, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
3888
3884
  }
3889
3885
  continue;
3890
3886
  }
3891
- if (nr(r) && (!V(r) || t.eaLnBrk === !1)) {
3892
- let i = [];
3887
+ if (tr(r) && (!q(r) || t.eaLnBrk === !1)) {
3888
+ let i = [], o = "", c = () => {
3889
+ o !== "" && (e.font = M, i.push({
3890
+ ch: o,
3891
+ w: $(e, o, G),
3892
+ font: M
3893
+ }), o = "");
3894
+ };
3893
3895
  for (let t of r) {
3894
- let n = le(t.codePointAt(0) ?? 0) && C != null, r = n ? B : M, a = n ? C : g;
3895
- e.font = r, i.push({
3896
+ if (!y(t.codePointAt(0) ?? 0)) {
3897
+ o += t;
3898
+ continue;
3899
+ }
3900
+ c();
3901
+ let n = S == null ? M : B;
3902
+ e.font = n, i.push({
3896
3903
  ch: t,
3897
- w: Q(e, t, 0),
3898
- font: r,
3899
- family: a
3904
+ w: $(e, t, 0),
3905
+ font: n
3900
3906
  });
3901
3907
  }
3902
- if (t.eaLnBrk === !1) {
3903
- let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * G + (t && i.length > 0 ? G : 0);
3904
- b > 0 && !N(r) && F();
3905
- for (let e of i) L(e.ch, e.font, p, T, W, s.strikethrough, s.baseline ?? void 0, {
3906
- ...K,
3907
- fontFamily: e.family
3908
- });
3908
+ if (c(), t.eaLnBrk === !1) {
3909
+ let e = v.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * G + (t && i.length > 0 ? G : 0);
3910
+ b > 0 && !N(r) && I();
3911
+ for (let e of i) R(e.ch, e.font, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
3909
3912
  continue;
3910
3913
  }
3911
- let a = i;
3912
- for (; a.length > 0;) {
3913
- let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = dn(a, e, v(), _, G, r);
3914
+ let l = i;
3915
+ for (; l.length > 0;) {
3916
+ let e = Number.isFinite(_()) ? _() - P() : b, t = v.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = un(l, e, _(), a, G, r);
3914
3917
  if (i === 0) {
3915
3918
  if (b > 0) {
3916
- F();
3919
+ I();
3917
3920
  continue;
3918
3921
  }
3919
3922
  i = 1;
3920
3923
  }
3921
3924
  for (let e = 0; e < i; e++) {
3922
- let t = a[e];
3923
- L(t.ch, t.font, p, T, W, s.strikethrough, s.baseline ?? void 0, {
3924
- ...K,
3925
- fontFamily: t.family
3926
- });
3925
+ let t = l[e];
3926
+ R(t.ch, t.font, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
3927
3927
  }
3928
- a = a.slice(i), a.length > 0 && F();
3928
+ l = l.slice(i), l.length > 0 && I();
3929
3929
  }
3930
3930
  continue;
3931
3931
  }
3932
- if (V(r)) {
3933
- let t = x(r, {
3932
+ if (q(r)) {
3933
+ let t = O(r, {
3934
3934
  cjk: !0,
3935
- kinsoku: _
3936
- }), i = C != null && B !== M, a = (e) => i && le(e.codePointAt(0) ?? 0), o = (t) => {
3937
- let r = 0, i = y.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
3938
- s !== "" && (e.font = c ? B : M, r += Q(e, s, G), o && (r += G), o = !0, s = "");
3935
+ kinsoku: a
3936
+ }), i = S != null && B !== M, o = (e) => i && y(e.codePointAt(0) ?? 0), c = (t) => {
3937
+ let r = 0, i = v.segments.at(-1), a = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
3938
+ s !== "" && (e.font = c ? B : M, r += $(e, s, G), a && (r += G), a = !0, s = "");
3939
3939
  };
3940
3940
  for (let e of t) {
3941
- let t = a(e);
3941
+ let t = o(e);
3942
3942
  c === null || t === c ? (s += e, c = t) : (l(), s = e, c = t);
3943
3943
  }
3944
3944
  return l(), r;
3945
- }, c = (e) => {
3945
+ }, l = (e) => {
3946
3946
  let t = "", n = null, r = () => {
3947
- if (t === "") return;
3948
- let e = n ? B : M, r = n ? C : g;
3949
- L(t, e, p, T, W, s.strikethrough, s.baseline ?? void 0, {
3950
- ...K,
3951
- fontFamily: r
3952
- }), t = "";
3947
+ t !== "" && (R(t, n ? B : M, p, w, W, s.strikethrough, s.baseline ?? void 0, K), t = "");
3953
3948
  };
3954
3949
  for (let i of e) {
3955
- let e = a(i);
3950
+ let e = o(i);
3956
3951
  n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
3957
3952
  }
3958
3953
  r();
3959
- }, l = fe(r), u = r.length, d = 0;
3960
- for (; d < u;) {
3961
- let e = P(), n = z(r, t, d, e, o, l);
3962
- if (n <= d) {
3954
+ }, u = E(r), d = r.length, f = 0;
3955
+ for (; f < d;) {
3956
+ let e = P(), n = ee(r, t, f, e, c, u);
3957
+ if (n <= f) {
3963
3958
  if (b > 0) {
3964
- F();
3959
+ I();
3965
3960
  continue;
3966
3961
  }
3967
- let i = t.find((e) => e > d) ?? u, a = r.slice(d, i), s = O(a), c = z(a, s, 0, e, o, l);
3968
- c <= 0 && (c = s.length > 0 ? s[0] : a.length), n = d + c;
3962
+ let i = t.find((e) => e > f) ?? d, a = r.slice(f, i), o = F(a), s = ee(a, o, 0, e, c, u);
3963
+ s <= 0 && (s = o.length > 0 ? o[0] : a.length), n = f + s;
3969
3964
  }
3970
- c(r.slice(d, n)), d = n, d < u && F();
3965
+ l(r.slice(f, n)), f = n, f < d && I();
3971
3966
  }
3972
3967
  continue;
3973
3968
  }
3974
- if (N(a)) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K), o && (S = !0);
3975
- else if (o) b > 0 && F();
3976
- else if (a > v()) {
3977
- b > 0 && F();
3978
- for (let t of r) e.font = M, !N(I(t, M, G, n)) && b > 0 && F(), L(t, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
3979
- } else if (!S) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
3980
- else {
3981
- let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && _.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !V(e) && !V(r) && i(n, t);
3982
- (o || c) && R() || F(), L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
3969
+ if (N(i)) R(r, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K), o && (x = !0);
3970
+ else if (o) b > 0 && I();
3971
+ else if (i > _()) {
3972
+ b > 0 && I();
3973
+ for (let t of r) e.font = M, !N(L(t, M, G, n)) && b > 0 && I(), R(t, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
3974
+ } else if (x) {
3975
+ let e = v.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), i = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && a.lineStartForbidden.has(t) && i, c = n !== void 0 && t !== void 0 && i && !q(e) && !q(r) && le(n, t);
3976
+ (o || c) && z() || I(), R(r, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
3977
+ } else {
3978
+ let e = [...v.segments.at(-1)?.text ?? ""].at(-1)?.codePointAt(0), t = r.codePointAt(0);
3979
+ e !== void 0 && t !== void 0 && y(e) !== y(t) && !le(e, t) && b > 0 && I(), R(r, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
3983
3980
  }
3984
3981
  }
3985
3982
  }
3986
- return m.push(y), m;
3983
+ return m.push(v), m;
3987
3984
  }
3988
- async function sr(e, t, n, r, i, o, s, c, l, u) {
3985
+ async function or(e, t, n, r, i, a, o, s, c, l) {
3989
3986
  if (t && t.fillType === "image") {
3990
- if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !s) return;
3987
+ if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
3991
3988
  try {
3992
- let a = t.fillRect ?? {}, d = a.l ?? 0, f = a.t ?? 0, p = a.r ?? 0, m = a.b ?? 0, h = d * n, g = f * r, _ = n * (1 - d - p), v = r * (1 - f - m), y = u && !t.duotone ? On(u, X(t.imagePath, t.duotone)) : void 0, b = t.tile ? await B(t.imagePath, t.mimeType, s) : void 0, x = await Ye(t.imagePath, t.mimeType, t.duotone, s, {
3993
- widthPt: n / i / J,
3994
- heightPt: r / i / J,
3989
+ let u = t.fillRect ?? {}, d = u.l ?? 0, f = u.t ?? 0, p = u.r ?? 0, m = u.b ?? 0, h = d * n, g = f * r, _ = n * (1 - d - p), v = r * (1 - f - m), y = l && !t.duotone ? Dn(l, Z(t.imagePath, t.duotone)) : void 0, b = t.tile ? await U(t.imagePath, t.mimeType, o) : void 0, x = await Je(t.imagePath, t.mimeType, t.duotone, o, {
3990
+ widthPt: n / i / Y,
3991
+ heightPt: r / i / Y,
3995
3992
  ...y ?? {},
3996
- tiff: c,
3997
- svgDecoder: l
3993
+ tiff: s,
3994
+ svgDecoder: c
3998
3995
  });
3999
- if (o() || !x) return;
4000
- e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? dr(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : Me(e, x, t.srcRect, h, g, _, v), e.restore();
3996
+ if (a() || !x) return;
3997
+ e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? ur(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : je(e, x, t.srcRect, h, g, _, v), e.restore();
4001
3998
  } catch (t) {
4002
- if (a(t, "tiff")) {
4003
- ue(e, "tiff", {
3999
+ if (ue(t, "tiff")) {
4000
+ b(e, "tiff", {
4004
4001
  x: 0,
4005
4002
  y: 0,
4006
4003
  width: n,
@@ -4008,14 +4005,14 @@ async function sr(e, t, n, r, i, o, s, c, l, u) {
4008
4005
  });
4009
4006
  return;
4010
4007
  }
4011
- if (Re(t) || Je(t)) throw t;
4008
+ if (Le(t) || qe(t)) throw t;
4012
4009
  }
4013
4010
  return;
4014
4011
  }
4015
- e.fillStyle = Pn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
4012
+ e.fillStyle = Nn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
4016
4013
  }
4017
- var cr = 9525;
4018
- function lr(e, t, n, r, i) {
4014
+ var sr = 9525;
4015
+ function cr(e, t, n, r, i) {
4019
4016
  let a;
4020
4017
  a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
4021
4018
  let o;
@@ -4024,52 +4021,52 @@ function lr(e, t, n, r, i) {
4024
4021
  ay: o
4025
4022
  };
4026
4023
  }
4027
- function ur(e, t, n) {
4024
+ function lr(e, t, n) {
4028
4025
  return {
4029
4026
  width: e * (n ? 1 - n.l - n.r : 1),
4030
4027
  height: t * (n ? 1 - n.t - n.b : 1)
4031
4028
  };
4032
4029
  }
4033
- function dr(e, t, n, r, i, a, o, s) {
4034
- let c = ur(s?.width ?? t.width, s?.height ?? t.height, o), l = c.width * cr * (n.sx ?? 1) * a, u = c.height * cr * (n.sy ?? 1) * a;
4030
+ function ur(e, t, n, r, i, a, o, s) {
4031
+ let c = lr(s?.width ?? t.width, s?.height ?? t.height, o), l = c.width * sr * (n.sx ?? 1) * a, u = c.height * sr * (n.sy ?? 1) * a;
4035
4032
  if (!(l > 0) || !(u > 0)) return;
4036
- let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p = je(l * (d ? 2 : 1), u * (f ? 2 : 1));
4033
+ let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p = Ae(l * (d ? 2 : 1), u * (f ? 2 : 1));
4037
4034
  if (!p) return;
4038
4035
  let m = p.getContext("2d");
4039
4036
  if (!m) return;
4040
4037
  let h = (e, n, r, i) => {
4041
- m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1), Me(m, t, o, 0, 0, l, u), m.restore();
4038
+ m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1), je(m, t, o, 0, 0, l, u), m.restore();
4042
4039
  };
4043
4040
  h(0, 0, !1, !1), d && h(l, 0, !0, !1), f && h(0, u, !1, !0), d && f && h(l, u, !0, !0);
4044
4041
  let g = e.createPattern(p, "repeat");
4045
4042
  if (!g) return;
4046
- let { ax: _, ay: v } = lr(n.algn ?? "tl", r, i, l, u), y = _ + Y(n.tx ?? 0, a), b = v + Y(n.ty ?? 0, a);
4043
+ let { ax: _, ay: v } = cr(n.algn ?? "tl", r, i, l, u), y = _ + X(n.tx ?? 0, a), b = v + X(n.ty ?? 0, a);
4047
4044
  typeof g.setTransform == "function" && typeof DOMMatrix < "u" ? (g.setTransform(new DOMMatrix().translateSelf(y, b)), e.fillStyle = g, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(y, b), e.fillStyle = g, e.fillRect(-y, -b, r, i), e.restore());
4048
4045
  }
4049
- function fr(e, t, n) {
4046
+ function dr(e, t, n) {
4050
4047
  if (!t) return;
4051
- let r = t.dir * Math.PI / 180, i = Y(t.dist, n);
4052
- e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
4048
+ let r = t.dir * Math.PI / 180, i = X(t.dist, n);
4049
+ e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
4053
4050
  }
4054
- function pr(e, t, n) {
4055
- t && (e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = Y(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
4051
+ function fr(e, t, n) {
4052
+ t && (e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
4056
4053
  }
4057
- function mr(e) {
4054
+ function pr(e) {
4058
4055
  e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
4059
4056
  }
4060
- var hr = 8, gr = 1, _r = 1, vr = 256;
4061
- function yr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4057
+ var mr = 8, hr = 1, gr = 1, _r = 256;
4058
+ function vr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4062
4059
  if (r <= 0) return;
4063
- let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(vr, Math.max(1, Math.round(b / hr))), S = (e) => Sr(e, a, r, o, s, c, u, d), C = S(x), w = wr(C, a, o, s, c, u, d, l, i, -g, _);
4064
- for (; w > _r && x < vr;) {
4065
- let e = Math.min(vr, x * 2), t = S(e), n = wr(t, a, o, s, c, u, d, l, i, -g, _);
4060
+ let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(_r, Math.max(1, Math.round(b / mr))), S = (e) => xr(e, a, r, o, s, c, u, d), C = S(x), w = Cr(C, a, o, s, c, u, d, l, i, -g, _);
4061
+ for (; w > gr && x < _r;) {
4062
+ let e = Math.min(_r, x * 2), t = S(e), n = Cr(t, a, o, s, c, u, d, l, i, -g, _);
4066
4063
  if (n >= w * .75) {
4067
4064
  C = t;
4068
4065
  break;
4069
4066
  }
4070
4067
  x = e, C = t, w = n;
4071
4068
  }
4072
- let T = 1e4, E = gr / (l * i), D = C.length - 1, O = (e, t, n) => e === 0 ? -T : t - n - E, k = (e, t, n) => e === D ? T : t - n + E, A = (e, r) => {
4069
+ let T = 1e4, E = hr / (l * i), D = C.length - 1, O = (e, t, n) => e === 0 ? -T : t - n - E, k = (e, t, n) => e === D ? T : t - n + E, A = (e, r) => {
4073
4070
  e.fillStyle = r;
4074
4071
  for (let r = 0; r <= D; r++) {
4075
4072
  let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
@@ -4077,7 +4074,7 @@ function yr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4077
4074
  let c = O(r, i, s), u = k(r, a, s);
4078
4075
  e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
4079
4076
  }
4080
- }, j = br(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
4077
+ }, j = yr(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
4081
4078
  if (j >= 1 && M >= 1) {
4082
4079
  A(e, m);
4083
4080
  return;
@@ -4097,67 +4094,67 @@ function yr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4097
4094
  [s, _],
4098
4095
  [c, _]
4099
4096
  ]) {
4100
- let n = Cr(i, l, e, t), r = f + n.x, a = p + n.y, o = N.a * r + N.c * a + N.e, s = N.b * r + N.d * a + N.f;
4097
+ let n = Sr(i, l, e, t), r = f + n.x, a = p + n.y, o = N.a * r + N.c * a + N.e, s = N.b * r + N.d * a + N.f;
4101
4098
  o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
4102
4099
  }
4103
4100
  }
4104
4101
  if (!(I > P && L > F)) return;
4105
- let R = Math.floor(P - 2), z = Math.floor(F - 2), B = je(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
4102
+ let R = Math.floor(P - 2), z = Math.floor(F - 2), B = Ae(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
4106
4103
  if (!B || !V) {
4107
4104
  A(e, m);
4108
4105
  return;
4109
4106
  }
4110
- V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V, xr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
4107
+ V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V, br(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
4111
4108
  }
4112
- function br(e) {
4109
+ function yr(e) {
4113
4110
  let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
4114
4111
  if (!t) return 1;
4115
4112
  let n = parseFloat(t[1]);
4116
4113
  return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
4117
4114
  }
4118
- function xr(e) {
4115
+ function br(e) {
4119
4116
  let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
4120
4117
  return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
4121
4118
  }
4122
- function Sr(e, t, n, r, i, a, o, s) {
4119
+ function xr(e, t, n, r, i, a, o, s) {
4123
4120
  let c = Array(e);
4124
4121
  for (let l = 0; l < e; l++) {
4125
4122
  let u = l / e * n, d = (l + 1) / e * n;
4126
4123
  c[l] = {
4127
4124
  s0: u,
4128
4125
  s1: d,
4129
- g: pt(t, (r + (u + d) / 2) / i * a, o, s)
4126
+ g: ft(t, (r + (u + d) / 2) / i * a, o, s)
4130
4127
  };
4131
4128
  }
4132
4129
  return c;
4133
4130
  }
4134
- function Cr(e, t, n, r) {
4131
+ function Sr(e, t, n, r) {
4135
4132
  let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
4136
4133
  return {
4137
4134
  x: e.x + s * o - c * a,
4138
4135
  y: e.y + c * o + s * a
4139
4136
  };
4140
4137
  }
4141
- function wr(e, t, n, r, i, a, o, s, c, l, u) {
4138
+ function Cr(e, t, n, r, i, a, o, s, c, l, u) {
4142
4139
  let d = 0;
4143
4140
  for (let f of e) {
4144
4141
  let e = (f.s0 + f.s1) / 2;
4145
4142
  for (let p of [f.s0, f.s1]) {
4146
- let m = pt(t, (n + p) / r * i, a, o);
4143
+ let m = ft(t, (n + p) / r * i, a, o);
4147
4144
  for (let t of [l, u]) {
4148
- let n = Cr(m, s, 0, t), r = Cr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
4145
+ let n = Sr(m, s, 0, t), r = Sr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
4149
4146
  i > d && (d = i);
4150
4147
  }
4151
4148
  }
4152
4149
  }
4153
4150
  return d;
4154
4151
  }
4155
- function Tr(e, t, n, r, i, a, o, s, c, l, u) {
4156
- let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = lt(n, r, p, m);
4152
+ function wr(e, t, n, r, i, a, o, s, c, l, u) {
4153
+ let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = ct(n, r, p, m);
4157
4154
  if (!h) return;
4158
- let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * J * c, y = [];
4155
+ let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [];
4159
4156
  for (let n of t.paragraphs) {
4160
- let t = or(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * J * c, n.defColor ? Z(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
4157
+ let t = ar(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * Y * c, n.defColor ? Q(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
4161
4158
  for (let e of t) y.push(e);
4162
4159
  }
4163
4160
  if (y.length === 0) return;
@@ -4176,10 +4173,10 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u) {
4176
4173
  }
4177
4174
  e.font = t.font;
4178
4175
  let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
4179
- a += r.width + n * rr(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
4176
+ a += r.width + n * nr(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
4180
4177
  }
4181
4178
  if (a <= 0) continue;
4182
- let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = ft(h, a), b = 0;
4179
+ let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = dt(h, a), b = 0;
4183
4180
  for (let t of n.segments) {
4184
4181
  if (t.math) {
4185
4182
  b += t.math.width;
@@ -4190,17 +4187,17 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u) {
4190
4187
  for (let s of o) {
4191
4188
  let o = e.measureText(s).width + n, c = r + u * (i - r);
4192
4189
  if (!h.singleEdge && o > 0) {
4193
- yr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
4190
+ vr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
4194
4191
  continue;
4195
4192
  }
4196
- let l = pt(h, (b + o / 2) / a * v, _, c);
4193
+ let l = ft(h, (b + o / 2) / a * v, _, c);
4197
4194
  e.save(), e.translate(d + l.x, f + l.y), e.rotate(l.angle), l.shear !== 0 && e.transform(1, 0, l.shear, 1, 0, 0), (g !== 1 || l.vScale !== 1) && e.scale(g, l.vScale), e.fillText(s, -o / 2 + n / 2, 0), e.restore(), b += o;
4198
4195
  }
4199
4196
  }
4200
4197
  }
4201
4198
  e.restore();
4202
4199
  }
4203
- function Er(e, t, n, r, i, a, o) {
4200
+ function Tr(e, t, n, r, i, a, o) {
4204
4201
  let s = Math.min(r, i);
4205
4202
  switch (e) {
4206
4203
  case "rightarrow":
@@ -4230,17 +4227,17 @@ function Er(e, t, n, r, i, a, o) {
4230
4227
  default: return null;
4231
4228
  }
4232
4229
  }
4233
- function Dr(e, t) {
4234
- return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null && yn(e) ? t.smartArtFallbackTextColor : null;
4230
+ function Er(e, t) {
4231
+ return e.defaultTextColor ? Q(e.defaultTextColor) : t.smartArtFallbackTextColor != null && vn(e) ? t.smartArtFallbackTextColor : null;
4235
4232
  }
4236
- function Or(e, t, n) {
4233
+ function Dr(e, t, n) {
4237
4234
  return {
4238
4235
  outerRotation: e,
4239
4236
  localFlipH: t,
4240
4237
  localFlipV: n
4241
4238
  };
4242
4239
  }
4243
- function kr(e, t, n, r, i) {
4240
+ function Or(e, t, n, r, i) {
4244
4241
  let a = [
4245
4242
  {
4246
4243
  x: t,
@@ -4269,7 +4266,7 @@ function kr(e, t, n, r, i) {
4269
4266
  h: l - s
4270
4267
  };
4271
4268
  }
4272
- var Ar = {
4269
+ var kr = {
4273
4270
  tl: [0, 0],
4274
4271
  t: [.5, 0],
4275
4272
  tr: [1, 0],
@@ -4280,15 +4277,15 @@ var Ar = {
4280
4277
  b: [.5, 1],
4281
4278
  br: [1, 1]
4282
4279
  };
4283
- function jr(e, t, n) {
4280
+ function Ar(e, t, n) {
4284
4281
  return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
4285
4282
  }
4286
- function Mr(e, t, n, r, i, a) {
4287
- let [o, s] = Ar[a ?? "b"];
4288
- return jr(e, t + o * r, n + s * i);
4283
+ function jr(e, t, n, r, i, a) {
4284
+ let [o, s] = kr[a ?? "b"];
4285
+ return Ar(e, t + o * r, n + s * i);
4289
4286
  }
4290
- function Nr(e, t, n, r, i, a, o, s) {
4291
- let c = Ct(e, i, a).corners, l = (o > 0 ? Ke(c, o / i, o / a) ?? c : c).map((e) => jr(t, n + e.x, r + e.y)), u = l.map(([e]) => e), d = l.map(([, e]) => e), f = Math.min(...u), p = Math.min(...d), m = Math.max(...u), h = Math.max(...d), [g, _] = Ar[s ?? "b"], v = Ue(c, g, _);
4287
+ function Mr(e, t, n, r, i, a, o, s) {
4288
+ let c = St(e, i, a).corners, l = (o > 0 ? Ge(c, o / i, o / a) ?? c : c).map((e) => Ar(t, n + e.x, r + e.y)), u = l.map(([e]) => e), d = l.map(([, e]) => e), f = Math.min(...u), p = Math.min(...d), m = Math.max(...u), h = Math.max(...d), [g, _] = kr[s ?? "b"], v = He(c, g, _);
4292
4289
  return {
4293
4290
  bbox: {
4294
4291
  x: f,
@@ -4296,15 +4293,15 @@ function Nr(e, t, n, r, i, a, o, s) {
4296
4293
  w: m - f,
4297
4294
  h: h - p
4298
4295
  },
4299
- anchor: v ? jr(t, n + v.x, r + v.y) : Mr(t, n, r, i, a, s)
4296
+ anchor: v ? Ar(t, n + v.x, r + v.y) : jr(t, n, r, i, a, s)
4300
4297
  };
4301
4298
  }
4302
- function Pr(e, t, n, r) {
4299
+ function Nr(e, t, n, r) {
4303
4300
  let i = Math.floor(n.x) - 1, a = Math.floor(n.y) - 1, o = Math.max(1, Math.ceil(n.x + n.w) - i + 1), s = Math.max(1, Math.ceil(n.y + n.h) - a + 1);
4304
- if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || He(o, s).clamped) return e;
4301
+ if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || Ve(o, s).clamped) return e;
4305
4302
  let c = null;
4306
4303
  try {
4307
- c = je(o, s);
4304
+ c = Ae(o, s);
4308
4305
  } catch {
4309
4306
  return e;
4310
4307
  }
@@ -4323,7 +4320,7 @@ function Pr(e, t, n, r) {
4323
4320
  e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
4324
4321
  };
4325
4322
  }
4326
- function Fr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4323
+ function Pr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4327
4324
  let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
4328
4325
  a: 1,
4329
4326
  b: 0,
@@ -4338,32 +4335,32 @@ function Fr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4338
4335
  }, v = (e) => {
4339
4336
  h(e), u(e);
4340
4337
  }, y = !1;
4341
- t.shadow && p ? (e.save(), e.setTransform(m), y = !Ge(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), Be(e, g, i, t.reflection, s, d, f), e.restore()), y ? fr(e, t.shadow ?? null, o) : t.glow && pr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Ve(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && mr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), We(e, v, i, t.innerShadow, s, d, f), e.restore());
4338
+ t.shadow && p ? (e.save(), e.setTransform(m), y = !We(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), ze(e, g, i, t.reflection, s, d, f), e.restore()), y ? dr(e, t.shadow ?? null, o) : t.glow && fr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Be(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && pr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), Ue(e, v, i, t.innerShadow, s, d, f), e.restore());
4342
4339
  }
4343
- function Ir(e, t, r, i = "#000000", a, o = {
4340
+ function Fr(e, t, r, i = "#000000", a, o = {
4344
4341
  themeMajorFont: null,
4345
4342
  themeMinorFont: null,
4346
4343
  dpr: 1
4347
4344
  }, s, c) {
4348
- let l = Y(t.x, r), u = Y(t.y, r), d = Y(t.width, r), f = Y(t.height, r), p = s && t.id !== void 0 ? (e) => s({
4345
+ let l = X(t.x, r), u = X(t.y, r), d = X(t.width, r), f = X(t.height, r), p = s && t.id !== void 0 ? (e) => s({
4349
4346
  ...e,
4350
4347
  shapeId: t.id
4351
4348
  }) : s;
4352
4349
  if (f === 0 && t.textBody?.verticalAnchor === "b") {
4353
- if (t.stroke && (e.save(), ei(e, t.stroke, r, {
4350
+ if (t.stroke && (e.save(), $r(e, t.stroke, r, {
4354
4351
  x: l,
4355
4352
  y: u,
4356
4353
  w: d,
4357
4354
  h: 1
4358
4355
  }, t.rotation), e.beginPath(), e.moveTo(l, u), e.lineTo(l + d, u), e.stroke(), e.restore()), t.textBody) {
4359
- let n = Dr(t, o);
4360
- Hr(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
4356
+ let n = Er(t, o);
4357
+ Vr(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
4361
4358
  }
4362
4359
  return;
4363
4360
  }
4364
- let h = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null;
4365
- if (h && d > 0 && f > 0) {
4366
- let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Ur(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Wr(t.sp3d, h.camera, d, f, r, c), g = Or(t.rotation, t.flipH, t.flipV);
4361
+ let m = t.scene3d && Ct(t.scene3d.camera) ? t.scene3d : null;
4362
+ if (m && d > 0 && f > 0) {
4363
+ let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), h = Ur(t.sp3d, m.camera, d, f, r, c), g = Dr(t.rotation, t.flipH, t.flipV);
4367
4364
  e.save(), g.outerRotation !== 0 && (e.translate(l + d / 2, u + f / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(l + d / 2), -(u + f / 2)));
4368
4365
  let _ = {
4369
4366
  ...t,
@@ -4386,21 +4383,21 @@ function Ir(e, t, r, i = "#000000", a, o = {
4386
4383
  ..._,
4387
4384
  fill: null,
4388
4385
  stroke: null
4389
- }, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2, x = (e, t, n) => Gr(e, h.camera, l, u, d, f, (e) => {
4390
- Ir(e, t, r, i, a, o, void 0);
4386
+ }, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (h ? Math.hypot(h.offsetX, h.offsetY) / c : 0) + 2, x = (e, t, n) => Wr(e, m.camera, l, u, d, f, (e) => {
4387
+ Fr(e, t, r, i, a, o, void 0);
4391
4388
  }, n ? {
4392
4389
  bevels: p,
4393
- extrusion: m ?? void 0,
4390
+ extrusion: h ?? void 0,
4394
4391
  edgePadCss: b
4395
4392
  } : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
4396
4393
  if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
4397
- let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Nr(h.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Pr((e) => {
4394
+ let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Mr(m.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Nr((e) => {
4398
4395
  s = S(e) || s;
4399
4396
  }, n, o.bbox, {
4400
4397
  w: e.canvas.width || 0,
4401
4398
  h: e.canvas.height || 0
4402
4399
  });
4403
- if (Fr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
4400
+ if (Pr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
4404
4401
  C(e), e.restore();
4405
4402
  return;
4406
4403
  }
@@ -4411,9 +4408,9 @@ function Ir(e, t, r, i = "#000000", a, o = {
4411
4408
  e.restore();
4412
4409
  }
4413
4410
  e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(l + d / 2, u + f / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(l + d / 2), -(u + f / 2)));
4414
- let _ = t.geometry.toLowerCase(), v = Pn(t.fill, e, l, u, d, f, t.rotation);
4415
- t.shadow || pr(e, t.glow ?? null, r);
4416
- let y = new Set([
4411
+ let g = t.geometry.toLowerCase(), _ = Nn(t.fill, e, l, u, d, f, t.rotation);
4412
+ t.shadow || fr(e, t.glow ?? null, r);
4413
+ let v = new Set([
4417
4414
  "line",
4418
4415
  "straightconnector1",
4419
4416
  "bentconnector2",
@@ -4424,7 +4421,7 @@ function Ir(e, t, r, i = "#000000", a, o = {
4424
4421
  "curvedconnector3",
4425
4422
  "curvedconnector4",
4426
4423
  "curvedconnector5"
4427
- ]), b = new Set([
4424
+ ]), y = new Set([
4428
4425
  "callout1",
4429
4426
  "callout2",
4430
4427
  "callout3",
@@ -4437,22 +4434,22 @@ function Ir(e, t, r, i = "#000000", a, o = {
4437
4434
  "accentbordercallout1",
4438
4435
  "accentbordercallout2",
4439
4436
  "accentbordercallout3"
4440
- ]), x = (e) => b.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), S = !t.custGeom && m(_), C = (n, i, a = {
4437
+ ]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && n(g), S = (n, i, a = {
4441
4438
  x: l,
4442
4439
  y: u,
4443
4440
  w: d,
4444
4441
  h: f
4445
4442
  }) => {
4446
- let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? v : Pn(t.fill, n, o, s, c, p, t.rotation)), h = i ? null : t.stroke ? () => {
4447
- ei(n, t.stroke, r, {
4443
+ let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? _ : Nn(t.fill, n, o, s, c, p, t.rotation)), h = i ? null : t.stroke ? () => {
4444
+ $r(n, t.stroke, r, {
4448
4445
  x: o,
4449
4446
  y: s,
4450
4447
  w: c,
4451
4448
  h: p
4452
4449
  }, t.rotation), n.stroke();
4453
- } : null, y = () => mr(n);
4454
- if (S && !i) {
4455
- g(n, _, o, s, c, p, [
4450
+ } : null, v = () => pr(n);
4451
+ if (x && !i) {
4452
+ R(n, g, o, s, c, p, [
4456
4453
  t.adj,
4457
4454
  t.adj2,
4458
4455
  t.adj3,
@@ -4461,11 +4458,11 @@ function Ir(e, t, r, i = "#000000", a, o = {
4461
4458
  t.adj6,
4462
4459
  t.adj7,
4463
4460
  t.adj8
4464
- ], m, h, y, x(_) ? { skipTrailingStroke: !0 } : void 0);
4461
+ ], m, h, v, b(g) ? { skipTrailingStroke: !0 } : void 0);
4465
4462
  return;
4466
4463
  }
4467
- n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Lr(n, t.custGeom, o, s, c, p) : he(n, _, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), m && _ !== "arc" && (n.fillStyle = m, _ === "donut" || _ === "smileyface" || _ === "frame" ? n.fill("evenodd") : n.fill(), i || y()), h && h();
4468
- }, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? S ? W(_, l, u, d, f, [
4464
+ n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Ir(n, t.custGeom, o, s, c, p) : me(n, g, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), m && g !== "arc" && (n.fillStyle = m, g === "donut" || g === "smileyface" || g === "frame" ? n.fill("evenodd") : n.fill(), i || v()), h && h();
4465
+ }, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? B(g, l, u, d, f, [
4469
4466
  t.adj,
4470
4467
  t.adj2,
4471
4468
  t.adj3,
@@ -4474,20 +4471,20 @@ function Ir(e, t, r, i = "#000000", a, o = {
4474
4471
  t.adj6,
4475
4472
  t.adj7,
4476
4473
  t.adj8
4477
- ]) : t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, l, u, d, f) : null : null) ?? {
4474
+ ]) : t.custGeom && t.custGeom.length > 0 ? he(t.custGeom, l, u, d, f) : null : null) ?? {
4478
4475
  x: l,
4479
4476
  y: u,
4480
4477
  w: d,
4481
4478
  h: f
4482
- }, O = t.stroke ? t.stroke.width * r / 2 : 0, k = t.stroke ? Math.max(t.stroke.headEnd ? me(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? me(t.stroke.tailEnd, t.stroke, r) : 0) : 0, A = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, j = Math.max(O, k, A), M = j > 0 ? {
4483
- x: D.x - j,
4484
- y: D.y - j,
4485
- w: D.w + j * 2,
4486
- h: D.h + j * 2
4487
- } : D, N = kr(w, M.x, M.y, M.w, M.h), P = r * E, F = h ? [] : Ur(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, E), I = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, L = (e) => {
4488
- let i = t.stroke?.fill ? Pn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
4489
- if (t.stroke && (y.has(_) || b.has(_))) {
4490
- let a = n(_, l, u, d, f, [
4479
+ }, D = t.stroke ? t.stroke.width * r / 2 : 0, O = t.stroke ? Math.max(t.stroke.headEnd ? pe(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? pe(t.stroke.tailEnd, t.stroke, r) : 0) : 0, k = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, A = Math.max(D, O, k), j = A > 0 ? {
4480
+ x: E.x - A,
4481
+ y: E.y - A,
4482
+ w: E.w + A * 2,
4483
+ h: E.h + A * 2
4484
+ } : E, M = Or(C, j.x, j.y, j.w, j.h), N = r * T, P = m ? [] : Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, T), F = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, I = (e) => {
4485
+ let n = t.stroke?.fill ? Nn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
4486
+ if (t.stroke && (v.has(g) || y.has(g))) {
4487
+ let i = h(g, l, u, d, f, [
4491
4488
  t.adj,
4492
4489
  t.adj2,
4493
4490
  t.adj3,
@@ -4497,22 +4494,22 @@ function Ir(e, t, r, i = "#000000", a, o = {
4497
4494
  t.adj7,
4498
4495
  t.adj8
4499
4496
  ]);
4500
- if (!a) return;
4501
- let o = t.stroke.cmpd, s = _ === "line" || _ === "straightconnector1";
4502
- if (x(_) && a.vertices.length >= 2 && !(o && s)) {
4503
- let n = a.vertices.map((e) => ({
4497
+ if (!i) return;
4498
+ let a = t.stroke.cmpd, o = g === "line" || g === "straightconnector1";
4499
+ if (b(g) && i.vertices.length >= 2 && !(a && o)) {
4500
+ let n = i.vertices.map((e) => ({
4504
4501
  x: e.x,
4505
4502
  y: e.y
4506
4503
  }));
4507
4504
  if (t.stroke.tailEnd) {
4508
- let e = be(t.stroke.tailEnd, t.stroke, r);
4509
- n[n.length - 1] = Ce(n[n.length - 1], n[n.length - 2], e);
4505
+ let e = ye(t.stroke.tailEnd, t.stroke, r);
4506
+ n[n.length - 1] = Se(n[n.length - 1], n[n.length - 2], e);
4510
4507
  }
4511
4508
  if (t.stroke.headEnd) {
4512
- let e = be(t.stroke.headEnd, t.stroke, r);
4513
- n[0] = Ce(n[0], n[1], e);
4509
+ let e = ye(t.stroke.headEnd, t.stroke, r);
4510
+ n[0] = Se(n[0], n[1], e);
4514
4511
  }
4515
- ei(e, t.stroke, r, {
4512
+ $r(e, t.stroke, r, {
4516
4513
  x: l,
4517
4514
  y: u,
4518
4515
  w: d,
@@ -4521,46 +4518,46 @@ function Ir(e, t, r, i = "#000000", a, o = {
4521
4518
  for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
4522
4519
  e.stroke();
4523
4520
  }
4524
- o && s && $r(e, a.start, a.end, t.stroke, o, r, t.rotation), t.stroke.tailEnd && ve(e, a.end.x, a.end.y, a.end.angle, t.stroke.tailEnd, t.stroke, r, i), t.stroke.headEnd && ve(e, a.start.x, a.start.y, a.start.angle, t.stroke.headEnd, t.stroke, r, i);
4521
+ a && o && Qr(e, i.start, i.end, t.stroke, a, r, t.rotation), t.stroke.tailEnd && _e(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, r, n), t.stroke.headEnd && _e(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, r, n);
4525
4522
  return;
4526
4523
  }
4527
4524
  if (!t.stroke || !t.custGeom || t.custGeom.length === 0 || (!t.stroke.headEnd || t.stroke.headEnd.type === "none") && (!t.stroke.tailEnd || t.stroke.tailEnd.type === "none")) return;
4528
- let { start: a, end: o } = ye(t.custGeom);
4529
- a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ve(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.headEnd, t.stroke, r, i), o && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ve(e, l + o.x * d, u + o.y * f, Math.atan2(o.dy * f, o.dx * d), t.stroke.tailEnd, t.stroke, r, i);
4530
- }, R = (e) => {
4531
- if (F.length > 0 && Kr(e, l, u, d, f, F, (e, t, n, r, i) => C(e, void 0, {
4525
+ let { start: i, end: a } = ve(t.custGeom);
4526
+ i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && _e(e, l + i.x * d, u + i.y * f, Math.atan2(i.dy * f, i.dx * d), t.stroke.headEnd, t.stroke, r, n), a && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && _e(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.tailEnd, t.stroke, r, n);
4527
+ }, L = (e) => {
4528
+ if (P.length > 0 && Gr(e, l, u, d, f, P, (e, t, n, r, i) => S(e, void 0, {
4532
4529
  x: t,
4533
4530
  y: n,
4534
4531
  w: r,
4535
4532
  h: i
4536
- }), void 0, I)) {
4537
- L(e), mr(e);
4533
+ }), void 0, F)) {
4534
+ I(e), pr(e);
4538
4535
  return;
4539
4536
  }
4540
- C(e), L(e);
4537
+ S(e), I(e);
4541
4538
  };
4542
- if (Fr(e, t, R, R, N, Mr(w, l, u, d, f, t.shadow?.algn), r, P, w, !!v, (e) => C(e, "#000")), t.textBody) {
4543
- let n = Dr(t, o);
4539
+ if (Pr(e, t, L, L, M, jr(C, l, u, d, f, t.shadow?.algn), r, N, C, !!_, (e) => S(e, "#000")), t.textBody) {
4540
+ let n = Er(t, o);
4544
4541
  if (e.save(), t.flipH || t.flipV) {
4545
4542
  let n = l + d / 2, r = u + f / 2;
4546
4543
  e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
4547
4544
  }
4548
- let s = l, m = u, h = d, g = f;
4549
- if (t.textRect) s = Y(t.textRect.x, r), m = Y(t.textRect.y, r), h = Y(t.textRect.width, r), g = Y(t.textRect.height, r);
4550
- else if (_ === "ellipse") {
4545
+ let s = l, m = u, h = d, _ = f;
4546
+ if (t.textRect) s = X(t.textRect.x, r), m = X(t.textRect.y, r), h = X(t.textRect.width, r), _ = X(t.textRect.height, r);
4547
+ else if (g === "ellipse") {
4551
4548
  let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
4552
- s = l + e, m = u + t, h = d / Math.SQRT2, g = f / Math.SQRT2;
4549
+ s = l + e, m = u + t, h = d / Math.SQRT2, _ = f / Math.SQRT2;
4553
4550
  } else {
4554
- let e = Er(_, l, u, d, f, t.adj, t.adj2);
4555
- e && (s = e.tx, m = e.ty, h = e.tw, g = e.th);
4551
+ let e = Tr(g, l, u, d, f, t.adj, t.adj2);
4552
+ e && (s = e.tx, m = e.ty, h = e.tw, _ = e.th);
4556
4553
  }
4557
- Hr(e, t.textBody, s, m, h, g, r, n, t.rotation, !1, !1, i, a, o, p, !1, c), e.restore();
4554
+ Vr(e, t.textBody, s, m, h, _, r, n, t.rotation, !1, !1, i, a, o, p, !1, c), e.restore();
4558
4555
  }
4559
4556
  e.restore();
4560
4557
  }
4561
- var Lr = Te;
4562
- function Rr(e, t) {
4563
- let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = zr(e).toLowerCase(), o = zr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
4558
+ var Ir = we;
4559
+ function Lr(e, t) {
4560
+ let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Rr(e).toLowerCase(), o = Rr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
4564
4561
  switch (t) {
4565
4562
  case "arabicPlain": return n;
4566
4563
  case "arabicPeriod": return `${n}.`;
@@ -4587,7 +4584,7 @@ function Rr(e, t) {
4587
4584
  default: return `${n}.`;
4588
4585
  }
4589
4586
  }
4590
- function zr(e) {
4587
+ function Rr(e) {
4591
4588
  let t = [
4592
4589
  1e3,
4593
4590
  900,
@@ -4620,237 +4617,248 @@ function zr(e) {
4620
4617
  for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
4621
4618
  return r;
4622
4619
  }
4623
- function Br(e) {
4620
+ function zr(e) {
4624
4621
  for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
4625
4622
  return !1;
4626
4623
  }
4627
- function Vr(e, t) {
4628
- let n = Br(e);
4629
- if (e.bullet.type === "char") return t.clear(), n ? xe(e.bullet.char, e.bullet.fontFamily ?? null) : "";
4624
+ function Br(e, t) {
4625
+ let n = zr(e);
4626
+ if (e.bullet.type === "char") return t.clear(), n ? be(e.bullet.char, e.bullet.fontFamily ?? null) : "";
4630
4627
  if (e.bullet.type === "autoNum") {
4631
4628
  if (!n) return "";
4632
4629
  let r = e.lvl;
4633
- return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Rr(t.get(r), e.bullet.numType);
4630
+ return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Lr(t.get(r), e.bullet.numType);
4634
4631
  }
4635
4632
  return t.clear(), "";
4636
4633
  }
4637
- function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
4634
+ function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
4638
4635
  themeMajorFont: null,
4639
4636
  themeMinorFont: null,
4640
4637
  dpr: 1
4641
- }, h, g = !1, _, v = !1, y = g) {
4642
- let b = n.vert === "vert" || n.vert === "eaVert", x = n.vert === "vert270";
4643
- if (b || x) {
4644
- let e = r + a / 2, u = i + o / 2, d = b ? 90 : -90, v = h ? (e) => h({
4638
+ }, m, h = !1, g, _ = !1, v = h) {
4639
+ let y = t.vert === "vert" || t.vert === "eaVert", b = t.vert === "vert270";
4640
+ if (y || b) {
4641
+ let l = n + i / 2, u = r + a / 2, _ = y ? 90 : -90, v = m ? (e) => m({
4645
4642
  ...e,
4646
- inShapeX: e.inShapeX - o / 2 + a / 2,
4647
- inShapeY: e.inShapeY - a / 2 + o / 2,
4648
- shapeX: r,
4649
- shapeY: i,
4650
- shapeW: a,
4651
- shapeH: o,
4652
- rotation: l,
4653
- textBodyRotation: d
4643
+ inShapeX: e.inShapeX - a / 2 + i / 2,
4644
+ inShapeY: e.inShapeY - i / 2 + a / 2,
4645
+ shapeX: n,
4646
+ shapeY: r,
4647
+ shapeW: i,
4648
+ shapeH: a,
4649
+ rotation: c,
4650
+ textBodyRotation: _
4654
4651
  }) : void 0;
4655
- if (g) return a;
4656
- t.save(), t.translate(e, u), t.rotate(x ? -Math.PI / 2 : Math.PI / 2), Hr(t, {
4657
- ...n,
4652
+ if (h) return i;
4653
+ e.save(), e.translate(l, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2), Vr(e, {
4654
+ ...t,
4658
4655
  vert: "horz"
4659
- }, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, f, p, m, v, !1, _, n.vert === "eaVert"), t.restore();
4656
+ }, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, g, t.vert === "eaVert"), e.restore();
4660
4657
  return;
4661
4658
  }
4662
- let S = n.textWarp;
4663
- if (!g && S && it(S.preset)) {
4664
- Tr(t, n, S.preset, S.adj ?? [], r, i, a, o, s, c ?? f, m);
4659
+ let x = t.textWarp;
4660
+ if (!h && x && rt(x.preset)) {
4661
+ wr(e, t, x.preset, x.adj ?? [], n, r, i, a, o, s ?? d, p);
4665
4662
  return;
4666
4663
  }
4667
- let C = Y(n.lIns, s), w = Y(n.rIns, s), T = Y(n.tIns, s), E = Y(n.bIns, s), D = n.wrap !== "none", O = n.autoFit === "sp" ? D && tr(t, n, a, C, w, s, m) : D, A = Math.max(1, n.numCol ?? 1), j = Y(n.spcCol ?? 0, s), M = n.defaultBold ?? !1, N = n.defaultItalic ?? !1, P = c ?? f, F = (e) => {
4668
- let i = (n.defaultFontSize ?? 18) * J * s * e, o = [], c = 0, l = /* @__PURE__ */ new Map();
4669
- for (let u = 0; u < n.paragraphs.length; u++) {
4670
- let d = n.paragraphs[u], f = Y(d.marL, s), h = Y(d.marR, s), _ = Y(d.indent, s), v = d.defFontSize == null ? i : d.defFontSize * J * s * e, b = d.defColor ? Z(d.defColor) : P, x = Zn(d), S = (() => {
4671
- for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
4672
- return d.defFontSize ?? n.defaultFontSize ?? 18;
4673
- })() * J * s * e, T = (() => {
4674
- for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
4664
+ let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), E = X(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D && er(e, t, i, S, C, o, p) : D, A = Math.max(1, t.numCol ?? 1), j = X(t.spcCol ?? 0, o), M = t.defaultBold ?? !1, N = t.defaultItalic ?? !1, P = s ?? d, F = (r) => {
4665
+ let a = (t.defaultFontSize ?? 18) * Y * o * r, s = [], c = 0, l = 0, u = /* @__PURE__ */ new Map();
4666
+ for (let d = 0; d < t.paragraphs.length; d++) {
4667
+ let m = t.paragraphs[d], g = X(m.marL, o), _ = X(m.marR, o), y = X(m.indent, o), b = m.defFontSize == null ? a : m.defFontSize * Y * o * r, x = m.defColor ? Q(m.defColor) : P, w = Xn(m), T = (() => {
4668
+ for (let e of m.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
4669
+ return m.defFontSize ?? t.defaultFontSize ?? 18;
4670
+ })() * Y * o * r, E = (() => {
4671
+ for (let e of m.runs) if (e.type === "text" && e.color) return e.color;
4675
4672
  return null;
4676
- })(), E = T ? Z(T) : b, D = (() => {
4677
- for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
4678
- return d.defFontFamily ?? null;
4679
- })(), k = "", F = Xn(!1, !1, S, "sans-serif", m), I = E, L = null;
4680
- k = Vr(d, l);
4681
- let R = $e(d.bullet);
4682
- if (R.type === "char") {
4683
- let t = R;
4684
- F = Xn(!1, !1, t.sizePts == null ? t.sizePct == null ? S : S * (t.sizePct / 100) : t.sizePts * J * s * e, k === t.char ? zn(t.fontFamily ?? null, m) : "sans-serif", m), I = t.color ? Z(t.color) : E;
4685
- } else if (R.type === "autoNum") {
4686
- let t = R;
4687
- F = Xn(!1, !1, t.sizePts == null ? t.sizePct == null ? S : S * (t.sizePct / 100) : t.sizePts * J * s * e, zn(t.fontFamily ?? D, m), m), I = R.color ? Z(R.color) : E;
4688
- } else if (R.type === "blip") {
4689
- let t = R, r = Qn(n, d, t) * J * s * e;
4690
- L = {
4691
- imagePath: t.imagePath,
4692
- mimeType: t.mimeType,
4693
- sizePx: r
4673
+ })(), D = E ? Q(E) : x, F = (() => {
4674
+ for (let e of m.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
4675
+ return m.defFontFamily ?? null;
4676
+ })(), I = "", L = Yn(!1, !1, T, "sans-serif", p), R = D, z = null;
4677
+ I = Br(m, u);
4678
+ let B = Qe(m.bullet);
4679
+ if (B.type === "char") {
4680
+ let e = B;
4681
+ L = Yn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, I === e.char ? Rn(e.fontFamily ?? null, p) : "sans-serif", p), R = e.color ? Q(e.color) : D;
4682
+ } else if (B.type === "autoNum") {
4683
+ let e = B;
4684
+ L = Yn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, Rn(e.fontFamily ?? F, p), p), R = B.color ? Q(B.color) : D;
4685
+ } else if (B.type === "blip") {
4686
+ let e = B, n = Zn(t, m, e) * Y * o * r;
4687
+ z = {
4688
+ imagePath: e.imagePath,
4689
+ mimeType: e.mimeType,
4690
+ sizePx: n
4694
4691
  };
4695
4692
  }
4696
- let z = A > 1 ? (a - C - w - (A - 1) * j) / A : a - C - w, B = r + C + f, V = r + C + f + _, H = z - f - h, U = or(t, d, O ? H : Infinity, v, b, s, f, M, N, e, p, m, $n(x, _)), ee = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * J * s * e, W = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * J * s * e;
4697
- for (let e = 0; e < U.length; e++) {
4698
- let r = U[e], i = e === 0, a = e === U.length - 1, l = 0, f = 0;
4699
- for (let e of r.segments) {
4700
- let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
4701
- if (t > l && (l = t), !e.math) {
4702
- let t = q(e.fontFamily, e.sizePx);
4703
- t > f && (f = t);
4693
+ let V = A > 1 ? (i - S - C - (A - 1) * j) / A : i - S - C, H = n + S + g, ee = n + S + g + y, U = V - g - _, W = ar(e, m, k ? U : Infinity, b, x, o, g, M, N, r, f, p, Qn(w, y)), te = m.spaceBefore == null ? 0 : m.spaceBefore / 100 * Y * o * r, G = m.spaceAfter == null ? 0 : m.spaceAfter / 100 * Y * o * r;
4694
+ for (let n = 0; n < W.length; n++) {
4695
+ let r = W[n], i = n === 0, a = n === W.length - 1, u = 0, f = 0;
4696
+ for (let t of r.segments) {
4697
+ let n = t.math ? Math.max(t.sizePx, (t.math.ascent + t.math.descent) / 1.2) : t.sizePx;
4698
+ if (n > u && (u = n), !t.math && O) {
4699
+ e.font = t.font;
4700
+ let n = e.measureText(t.text || "M"), r = (n.fontBoundingBoxAscent ?? 0) + (n.fontBoundingBoxDescent ?? 0);
4701
+ r > f && (f = r);
4704
4702
  }
4705
4703
  }
4706
- if (l === 0 && (l = v), i && k) {
4707
- t.font = F;
4708
- let e = t.measureText("M"), n = e.actualBoundingBoxAscent + e.actualBoundingBoxDescent;
4709
- n > l && (l = n);
4704
+ if (u === 0 && (u = b), i && I) {
4705
+ e.font = L;
4706
+ let t = e.measureText("M"), n = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
4707
+ n > u && (u = n);
4710
4708
  }
4711
- i && L && L.sizePx > l && (l = L.sizePx);
4712
- let p = l * 1.2, m = Math.max(p, f), h;
4713
- h = d.spaceLine ? d.spaceLine.type === "pct" ? (g ? l : p) * (d.spaceLine.val / 1e5) : d.spaceLine.val * J * s : g ? y ? p : l : m, n.autoFit === "norm" && n.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - n.lnSpcReduction);
4714
- let b = h + (a ? W : 0), S = i && u > 0 ? ee : 0, C = i ? $n(x, _) : 0, w = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), T = i && w ? L : null;
4715
- o.push({
4709
+ i && z && z.sizePx > u && (u = z.sizePx);
4710
+ let p = u * 1.2, g = O && f > p, _ = p, x;
4711
+ x = m.spaceLine ? m.spaceLine.type === "pct" ? (h ? u : p) * (m.spaceLine.val / 1e5) : m.spaceLine.val * Y * o : h && !O ? v ? p : u : _;
4712
+ let S = m.spaceLine?.type === "pct" ? u * (m.spaceLine.val / 1e5) : x;
4713
+ t.autoFit === "norm" && t.lnSpcReduction != null && m.spaceLine?.type !== "pts" && (x *= 1 - t.lnSpcReduction);
4714
+ let C = x + (a ? G : 0), T = i && d > 0 ? te : 0, E = i ? Qn(w, y) : 0, D = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), k = i && D ? z : null;
4715
+ s.push({
4716
4716
  line: r,
4717
- linePx: b,
4718
- lineHeight: h,
4719
- topGapPx: S,
4720
- textXOffset: C,
4721
- bulletLabel: i ? k : "",
4722
- bulletFont: F,
4723
- bulletColor: I,
4724
- bulletX: V,
4725
- bulletImage: T,
4726
- textX: B,
4727
- textMaxW: H,
4728
- alignment: d.alignment,
4717
+ linePx: C,
4718
+ lineHeight: x,
4719
+ baselineLineHeight: S,
4720
+ topGapPx: T,
4721
+ textXOffset: E,
4722
+ bulletLabel: i ? I : "",
4723
+ bulletFont: L,
4724
+ bulletColor: R,
4725
+ bulletX: ee,
4726
+ bulletImage: k,
4727
+ textX: H,
4728
+ textMaxW: U,
4729
+ alignment: m.alignment,
4729
4730
  isLastLine: a,
4730
- para: d
4731
- }), c += b + S;
4731
+ para: m,
4732
+ useResolvedFontMetrics: g
4733
+ });
4734
+ let A = c + T;
4735
+ c += C + T, l = Math.max(l, c, A + (g ? Math.max(x, f) : x) + (a ? G : 0));
4732
4736
  }
4733
4737
  }
4734
4738
  return {
4735
- allLines: o,
4736
- totalHeight: c
4739
+ allLines: s,
4740
+ totalHeight: c,
4741
+ requiredHeight: l
4737
4742
  };
4738
- }, { allLines: I, totalHeight: L } = F(1);
4739
- if (n.autoFit === "norm") if (n.fontScale != null && n.fontScale > 0) n.fontScale < 1 && ({allLines: I, totalHeight: L} = F(n.fontScale));
4743
+ }, { allLines: L, totalHeight: R, requiredHeight: z } = F(1);
4744
+ if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: L, totalHeight: R, requiredHeight: z} = F(t.fontScale));
4740
4745
  else {
4741
- let e = o - T - E;
4742
- if (L > e && e > 0) {
4746
+ let e = a - w - E;
4747
+ if (z > e && e > 0) {
4743
4748
  let t = .1, n = 1;
4744
4749
  for (let r = 0; r < 6; r++) {
4745
4750
  let r = (t + n) / 2;
4746
- F(r).totalHeight <= e ? t = r : n = r;
4751
+ F(r).requiredHeight <= e ? t = r : n = r;
4747
4752
  }
4748
- ({allLines: I, totalHeight: L} = F(t));
4753
+ ({allLines: L, totalHeight: R, requiredHeight: z} = F(t));
4749
4754
  }
4750
4755
  }
4751
- if (g) return T + L + E;
4752
- let R = n.verticalAnchor ?? "t", z = i, B;
4753
- o === 0 && R === "b" ? (B = T + L + E, z = i - B) : B = n.autoFit === "sp" ? Math.max(o, T + L + E) : o;
4754
- let V, H = Math.max(0, B - T - E);
4755
- V = R === "ctr" ? z + T + (H - L) / 2 : R === "b" ? z + B - E - L : z + T, t.save(), t.textAlign = "left", t.textBaseline = "alphabetic";
4756
- let U = V, ee = A > 1 ? (a - C - w - (A - 1) * j) / A + j : 0, W = Math.max(0, B - T - E), te = I[I.length - 1], G = te ? Math.max(0, te.linePx - te.lineHeight) : 0, K = L - G, ne = o === 0 || K <= W + .5, re = A > 1 && !ne ? Math.ceil(I.length / A) : I.length, ie = 0, ae = 0;
4757
- for (let c of I) {
4758
- let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = c;
4759
- A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, V = U), V += p, ae++;
4760
- let T = (n.rtlCol ? A - 1 - ie : ie) * ee, E = c.textX + T, D = c.bulletX + T, O = c.textMaxW, j = c.para.rtl === !0, M = j || ln(u.segments), N = u.segments.some((e) => e.isTab);
4756
+ if (h) return w + z + E;
4757
+ let B = t.verticalAnchor ?? "t", V = r, H;
4758
+ a === 0 && B === "b" ? (H = w + z + E, V = r - H) : H = t.autoFit === "sp" ? Math.max(a, w + z + E) : a;
4759
+ let ee, U = Math.max(0, H - w - E);
4760
+ ee = B === "ctr" ? V + w + (U - z) / 2 : B === "b" ? V + H - E - z : V + w, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
4761
+ let W = ee, te = A > 1 ? (i - S - C - (A - 1) * j) / A + j : 0, G = Math.max(0, H - w - E), K = L[L.length - 1], q = K ? Math.max(0, K.linePx - K.lineHeight) : 0, J = z - q, ne = a === 0 || J <= G + .5, re = A > 1 && !ne ? Math.ceil(L.length / A) : L.length, ie = 0, ae = 0;
4762
+ for (let s of L) {
4763
+ let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: v, bulletFont: y, bulletColor: b, bulletImage: x, alignment: S, isLastLine: C, useResolvedFontMetrics: w } = s;
4764
+ A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, ee = W), ee += f, ae++;
4765
+ let E = (t.rtlCol ? A - 1 - ie : ie) * te, D = s.textX + E, O = s.bulletX + E, k = s.textMaxW, j = s.para.rtl === !0, M = j || cn(l.segments), N = l.segments.some((e) => e.isTab);
4761
4766
  if (N) {
4762
- let e = Y(c.para.marL, s), n = Y(c.para.marR, s), r = j ? n : e + g, i = O + e + n;
4763
- t.font = u.segments.find((e) => e.isTab).font;
4764
- let a = t.measureText(" ").width, o = xn(u.segments.map((e) => {
4765
- if (e.isTab) return {
4767
+ let t = X(s.para.marL, o), n = X(s.para.marR, o), r = j ? n : t + h, i = k + t + n;
4768
+ e.font = l.segments.find((e) => e.isTab).font;
4769
+ let a = e.measureText(" ").width, c = bn(l.segments.map((t) => {
4770
+ if (t.isTab) return {
4766
4771
  isTab: !0,
4767
4772
  width: 0
4768
4773
  };
4769
- if (e.math) return {
4774
+ if (t.math) return {
4770
4775
  isTab: !1,
4771
- width: e.math.width
4776
+ width: t.math.width
4772
4777
  };
4773
- t.font = e.font;
4774
- let n = e.letterSpacingPx ?? 0;
4778
+ e.font = t.font;
4779
+ let n = t.letterSpacingPx ?? 0;
4775
4780
  return {
4776
4781
  isTab: !1,
4777
- width: e.text ? (e.leadingLetterSpacingPx ?? 0) + Q(t, e.text, n) : 0
4782
+ width: t.text ? (t.leadingLetterSpacingPx ?? 0) + $(e, t.text, n) : 0
4778
4783
  };
4779
- }), (c.para.tabStops ?? []).map((e) => ({
4780
- pos: Y(e.pos, s),
4784
+ }), (s.para.tabStops ?? []).map((e) => ({
4785
+ pos: X(e.pos, o),
4781
4786
  algn: e.algn
4782
- })), r, i, a, Y(c.para.defTabSz ?? 914400, s));
4783
- for (let e = 0; e < u.segments.length; e++) u.segments[e].isTab && (u.segments[e].tabWidthPx = o[e]);
4787
+ })), r, i, a, X(s.para.defTabSz ?? 914400, o));
4788
+ for (let e = 0; e < l.segments.length; e++) l.segments[e].isTab && (l.segments[e].tabWidthPx = c[e]);
4784
4789
  }
4785
- let P = 0, F = f * .8;
4786
- for (let e of u.segments) {
4787
- if (e.isTab) {
4788
- P += e.tabWidthPx ?? 0;
4790
+ let P = 0, F = 0, L = 0, R = 0;
4791
+ for (let t of l.segments) {
4792
+ if (t.isTab) {
4793
+ P += t.tabWidthPx ?? 0;
4789
4794
  continue;
4790
4795
  }
4791
- if (e.math) {
4792
- P += e.math.width, F = Math.max(F, e.math.ascent);
4796
+ if (t.math) {
4797
+ P += t.math.width, F = Math.max(F, t.math.ascent);
4793
4798
  continue;
4794
4799
  }
4795
- t.font = e.font;
4796
- let n = t.measureText(e.text || "M"), r = e.letterSpacingPx ?? 0;
4797
- P += e.leadingLetterSpacingPx ?? 0, P += e.text ? Q(t, e.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent));
4800
+ e.font = t.font;
4801
+ let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
4802
+ if (P += t.leadingLetterSpacingPx ?? 0, P += t.text ? $(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent)), w) {
4803
+ let e = n.fontBoundingBoxAscent ?? 0, t = e + (n.fontBoundingBoxDescent ?? 0);
4804
+ t > R && (R = t, L = e);
4805
+ }
4798
4806
  }
4799
- let I = V + F, L = E + O, R = S && _ ? m.pictureBulletImages?.has(S.imagePath) ? m.pictureBulletImages.get(S.imagePath) : k(S.imagePath, _) : void 0, z = 0;
4807
+ let z = w && R > 0 ? B === "t" && F > 0 ? s.para.spaceLine?.type === "pct" ? Math.max(F, L + (s.baselineLineHeight - R) / 2) : F : Math.max(F, L + Math.max(0, d - R) / 2) : Math.max(d * .8, F), V = ee + z, H = D + k, U = x && g ? p.pictureBulletImages?.has(x.imagePath) ? p.pictureBulletImages.get(x.imagePath) : I(x.imagePath, g) : void 0, G = 0;
4800
4808
  if (M && j) {
4801
- if (y) t.font = b, z = t.measureText(y).width;
4802
- else if (S && R) {
4803
- let e = S.sizePx;
4804
- z = R.height > 0 ? e * (R.width / R.height) : e;
4809
+ if (v) e.font = y, G = e.measureText(v).width;
4810
+ else if (x && U) {
4811
+ let e = x.sizePx;
4812
+ G = U.height > 0 ? e * (U.width / U.height) : e;
4805
4813
  }
4806
4814
  }
4807
- if (y) if (t.font = b, t.fillStyle = x, M && j) {
4808
- let e = t.direction;
4809
- t.direction = "rtl", t.fillText(y, L - z, I), t.direction = e;
4810
- } else t.fillText(y, D, I);
4811
- if (S && _ && R) {
4812
- let e = S.sizePx, n = R.height > 0 ? e * (R.width / R.height) : e, r = I - e;
4813
- M && j ? t.drawImage(R, L - n, r, n, e) : t.drawImage(R, D, r, n, e);
4815
+ if (v) if (e.font = y, e.fillStyle = b, M && j) {
4816
+ let t = e.direction;
4817
+ e.direction = "rtl", e.fillText(v, H - G, V), e.direction = t;
4818
+ } else e.fillText(v, O, V);
4819
+ if (x && g && U) {
4820
+ let t = x.sizePx, n = U.height > 0 ? t * (U.width / U.height) : t, r = V - t;
4821
+ M && j ? e.drawImage(U, H - n, r, n, t) : e.drawImage(U, O, r, n, t);
4814
4822
  }
4815
- let B = E + g, H;
4816
- H = N ? j ? E + O - z - P : B : C === "ctr" ? B + (O - g - P) / 2 : C === "r" ? E + O - z - P : B;
4817
- let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, te = w || (u.endsWithBreak ?? !1), G = (W && !M && !N ? pn(u.segments, O - g, P, W, te) : null) ?? u.segments, K = M ? un(u.segments, j) : null, q = (e, t) => {
4823
+ let K = D + h, q;
4824
+ q = N ? j ? D + k - G - P : K : S === "ctr" ? K + (k - h - P) / 2 : S === "r" ? D + k - G - P : K;
4825
+ let J = S === "just" || S === "justLow" ? "just" : S === "thaiDist" ? "thaiDist" : S === "dist" ? "dist" : null, ne = C || (l.endsWithBreak ?? !1), oe = (J && !M && !N ? fn(l.segments, k - h, P, J, ne) : null) ?? l.segments, se = M ? ln(l.segments, j) : null, ce = (e, t) => {
4818
4826
  if (Math.abs(e - t) !== 1) return 0;
4819
- let n = u.segments[Math.min(e, t)], r = u.segments[Math.max(e, t)];
4827
+ let n = l.segments[Math.min(e, t)], r = l.segments[Math.max(e, t)];
4820
4828
  return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
4821
- }, ne = G.length;
4822
- for (let n = 0; n < ne; n++) {
4823
- let c = K ? K.order[n] : n, u = G[c], d = K ? K.rtl[c] : !1;
4824
- if (M && (t.direction = d ? "rtl" : "ltr"), n > 0) {
4825
- let e = K ? K.order[n - 1] : n - 1;
4826
- H += q(e, c);
4829
+ }, le = oe.length;
4830
+ for (let t = 0; t < le; t++) {
4831
+ let s = se ? se.order[t] : t, l = oe[s], u = se ? se.rtl[s] : !1;
4832
+ if (M && (e.direction = u ? "rtl" : "ltr"), t > 0) {
4833
+ let e = se ? se.order[t - 1] : t - 1;
4834
+ q += ce(e, s);
4827
4835
  }
4828
- if (u.isTab) {
4829
- H += u.tabWidthPx ?? 0;
4836
+ if (l.isTab) {
4837
+ q += l.tabWidthPx ?? 0;
4830
4838
  continue;
4831
4839
  }
4832
- let p = u.jext ?? 0, g = u.splitBefore, _ = u.perGap ?? 0, y = g && g.length > 0 ? g.length * _ : 0;
4833
- if (u.math) {
4834
- let e = Fn.get(u.math.nodes), n = u.math.width, r = u.math.ascent + u.math.descent;
4835
- if (e && n > 0 && r > 0) {
4836
- let i = I - u.math.ascent, a = In(e, u.color);
4837
- t.drawImage(a, H, i, n, r);
4840
+ let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, v = h && h.length > 0 ? h.length * g : 0;
4841
+ if (l.math) {
4842
+ let t = Pn.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
4843
+ if (t && n > 0 && r > 0) {
4844
+ let i = V - l.math.ascent, a = Fn(t, l.color);
4845
+ e.drawImage(a, q, i, n, r);
4838
4846
  }
4839
- H += n, H += p;
4847
+ q += n, q += f;
4840
4848
  continue;
4841
4849
  }
4842
- t.font = u.font, t.fillStyle = u.color;
4843
- let b = u.drawSizePx ?? u.sizePx, x = I + (u.baseline ? -(u.baseline / 1e5) * u.sizePx : 0), S = u.letterSpacingPx ?? 0;
4844
- if (u.highlight && u.text) {
4845
- let e = Q(t, u.text, S) + y + p;
4846
- Nn(t, H, x, e, b, u.highlight, u.color);
4850
+ e.font = l.font, e.fillStyle = l.color;
4851
+ let y = l.drawSizePx ?? l.sizePx, b = V + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), x = l.letterSpacingPx ?? 0;
4852
+ if (l.highlight && l.text) {
4853
+ let t = $(e, l.text, x) + v + f;
4854
+ Mn(e, q, b, t, y, l.highlight, l.color);
4847
4855
  }
4848
- let C = u.shadow, w = (e, t, n, r) => {
4856
+ let S = l.shadow, C = (e, t, n, r) => {
4849
4857
  let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
4850
- if (S !== 0 && rr(t) > 1) {
4858
+ if (x !== 0 && nr(t) > 1) {
4851
4859
  let r = e, a = r.letterSpacing;
4852
- if (ar(e)) {
4853
- r.letterSpacing = `${S}px`, i(t, n, x);
4860
+ if (ir(e)) {
4861
+ r.letterSpacing = `${x}px`, i(t, n, b);
4854
4862
  try {
4855
4863
  r.letterSpacing = a;
4856
4864
  } catch {}
@@ -4858,92 +4866,92 @@ function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
4858
4866
  let r = n, a = [...t];
4859
4867
  for (let t = 0; t < a.length; t++) {
4860
4868
  let n = a[t];
4861
- i(n, r, x), t < a.length - 1 && (r += e.measureText(n).width + S);
4869
+ i(n, r, b), t < a.length - 1 && (r += e.measureText(n).width + x);
4862
4870
  }
4863
4871
  }
4864
- } else i(t, n, x);
4865
- }, T = (e) => Q(t, e, S), E = g && g.length > 0 ? en([...u.text], g, _, T) : null, D = [...u.text], O = !!g && g.length === D.length - 1 && D.length > 1, k = (e, t) => {
4866
- if (v) {
4867
- let n = O ? S + _ : S;
4868
- En(e, u.text, H, x, b, n, t);
4872
+ } else i(t, n, b);
4873
+ }, w = (t) => $(e, t, x), E = h && h.length > 0 ? $t([...l.text], h, g, w) : null, D = [...l.text], O = !!h && h.length === D.length - 1 && D.length > 1, k = (e, t) => {
4874
+ if (_) {
4875
+ let n = O ? x + g : x;
4876
+ Tn(e, l.text, q, b, y, n, t);
4869
4877
  return;
4870
4878
  }
4871
4879
  if (O) {
4872
- let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = S + _;
4873
- if (ar(e)) {
4880
+ let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = x + g;
4881
+ if (ir(e)) {
4874
4882
  let t = e, i = t.letterSpacing;
4875
- t.letterSpacing = `${r}px`, n(u.text, H, x);
4883
+ t.letterSpacing = `${r}px`, n(l.text, q, b);
4876
4884
  try {
4877
4885
  t.letterSpacing = i;
4878
4886
  } catch {}
4879
4887
  } else {
4880
- let t = H;
4888
+ let t = q;
4881
4889
  for (let i = 0; i < D.length; i++) {
4882
4890
  let a = D[i];
4883
- n(a, t, x), i < D.length - 1 && (t += e.measureText(a).width + r);
4891
+ n(a, t, b), i < D.length - 1 && (t += e.measureText(a).width + r);
4884
4892
  }
4885
4893
  }
4886
- } else if (E) for (let { text: n, dx: r } of E) w(e, n, H + r, t);
4887
- else w(e, u.text, H, t);
4888
- }, A = u.reflection;
4889
- if (A && u.text) {
4890
- let e = t.canvas.width || 0, n = t.canvas.height || 0;
4891
- if (e > 0 && n > 0) {
4892
- t.font = u.font;
4893
- let r = t.measureText(u.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : b * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : b * .2, o = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, l = t.getTransform(), d = Math.abs(l.a * l.d - l.b * l.c), f = d > 0 ? Math.sqrt(d) : 1;
4894
- Yn(t, (e) => {
4895
- e.font = u.font, e.fillStyle = u.color, k(e, "fill");
4894
+ } else if (E) for (let { text: n, dx: r } of E) C(e, n, q + r, t);
4895
+ else C(e, l.text, q, t);
4896
+ }, A = l.reflection;
4897
+ if (A && l.text) {
4898
+ let t = e.canvas.width || 0, n = e.canvas.height || 0;
4899
+ if (t > 0 && n > 0) {
4900
+ e.font = l.font;
4901
+ let r = e.measureText(l.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : y * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : y * .2, s = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1;
4902
+ Jn(e, (e) => {
4903
+ e.font = l.font, e.fillStyle = l.color, k(e, "fill");
4896
4904
  }, {
4897
- x: (H - o) * f,
4898
- y: (x - i) * f,
4899
- w: Math.max(1, o + c) * f,
4905
+ x: (q - s) * f,
4906
+ y: (b - i) * f,
4907
+ w: Math.max(1, s + c) * f,
4900
4908
  h: Math.max(1, i + a) * f
4901
- }, A, s * f, l, e, n), t.font = u.font, t.fillStyle = u.color;
4909
+ }, A, o * f, u, t, n), e.font = l.font, e.fillStyle = l.color;
4902
4910
  }
4903
4911
  }
4904
- if (C) {
4905
- let e = C.dir * Math.PI / 180, n = Y(C.dist, s);
4906
- t.save(), t.shadowColor = Z(C.color, C.alpha), t.shadowBlur = Y(C.blur, s), t.shadowOffsetX = Math.cos(e) * n, t.shadowOffsetY = Math.sin(e) * n;
4912
+ if (S) {
4913
+ let t = S.dir * Math.PI / 180, n = X(S.dist, o);
4914
+ e.save(), e.shadowColor = Q(S.color, S.alpha), e.shadowBlur = X(S.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
4907
4915
  }
4908
- k(t, "fill"), C && t.restore();
4909
- let j = u.outline;
4910
- j && j.width > 0 && (t.save(), t.lineWidth = Math.max(.5, Y(j.width, s)), t.strokeStyle = j.color ? `#${j.color}` : u.color, t.lineJoin = "round", k(t, "stroke"), t.restore()), t.font = u.font;
4911
- let N = Q(t, u.text, S) + y;
4912
- if (h && u.text && h({
4913
- text: u.text,
4914
- inShapeX: H - r,
4915
- inShapeY: V - i,
4916
- w: N + p,
4917
- h: f,
4918
- fontSize: b,
4919
- font: u.font,
4920
- shapeX: r,
4921
- shapeY: i,
4922
- shapeW: a,
4923
- shapeH: o,
4924
- rotation: l,
4925
- hyperlink: u.hyperlink
4926
- }), u.underline && Qt(t, H, x, N + p, b, u.underlineColor ?? u.color, u.underlineStyle, m.dpr), u.strikethrough) {
4927
- let n = Math.max(1, b * .05);
4928
- t.strokeStyle = u.color, t.lineWidth = n, t.setLineDash([]);
4929
- let r = x - b * .32;
4930
- if (u.strikeDouble) {
4931
- let i = n * .9, a = r - i, o = r + i;
4932
- t.beginPath(), t.moveTo(H, a + e(a, n, m.dpr)), t.lineTo(H + N + p, a + e(a, n, m.dpr)), t.moveTo(H, o + e(o, n, m.dpr)), t.lineTo(H + N + p, o + e(o, n, m.dpr)), t.stroke();
4916
+ k(e, "fill"), S && e.restore();
4917
+ let j = l.outline;
4918
+ j && j.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(j.width, o)), e.strokeStyle = j.color ? `#${j.color}` : l.color, e.lineJoin = "round", k(e, "stroke"), e.restore()), e.font = l.font;
4919
+ let N = $(e, l.text, x) + v;
4920
+ if (m && l.text && m({
4921
+ text: l.text,
4922
+ inShapeX: q - n,
4923
+ inShapeY: ee - r,
4924
+ w: N + f,
4925
+ h: d,
4926
+ fontSize: y,
4927
+ font: l.font,
4928
+ shapeX: n,
4929
+ shapeY: r,
4930
+ shapeW: i,
4931
+ shapeH: a,
4932
+ rotation: c,
4933
+ hyperlink: l.hyperlink
4934
+ }), l.underline && Zt(e, q, b, N + f, y, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
4935
+ let t = Math.max(1, y * .05);
4936
+ e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash([]);
4937
+ let n = b - y * .32;
4938
+ if (l.strikeDouble) {
4939
+ let r = t * .9, i = n - r, a = n + r;
4940
+ e.beginPath(), e.moveTo(q, i + T(i, t, p.dpr)), e.lineTo(q + N + f, i + T(i, t, p.dpr)), e.moveTo(q, a + T(a, t, p.dpr)), e.lineTo(q + N + f, a + T(a, t, p.dpr)), e.stroke();
4933
4941
  } else {
4934
- let i = r + e(r, n, m.dpr);
4935
- t.beginPath(), t.moveTo(H, i), t.lineTo(H + N + p, i), t.stroke();
4942
+ let r = n + T(n, t, p.dpr);
4943
+ e.beginPath(), e.moveTo(q, r), e.lineTo(q + N + f, r), e.stroke();
4936
4944
  }
4937
4945
  }
4938
- H += N, H += p;
4946
+ q += N, q += f;
4939
4947
  }
4940
- M && (t.direction = "ltr"), V += d;
4948
+ M && (e.direction = "ltr"), ee += u;
4941
4949
  }
4942
- t.restore();
4950
+ e.restore();
4943
4951
  }
4944
- function Ur(e, t, n, r, i) {
4952
+ function Hr(e, t, n, r, i) {
4945
4953
  if (!e) return [];
4946
- let a = Bt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Kt(n), s = r * i, c = [];
4954
+ let a = zt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Gt(n), s = r * i, c = [];
4947
4955
  return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
4948
4956
  widthPx: e.bevelT.w * s,
4949
4957
  heightPx: e.bevelT.h * s,
@@ -4959,9 +4967,9 @@ function Ur(e, t, n, r, i) {
4959
4967
  bottom: !0
4960
4968
  }), c;
4961
4969
  }
4962
- function Wr(e, t, n, r, i, a) {
4970
+ function Ur(e, t, n, r, i, a) {
4963
4971
  if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
4964
- let o = e.extrusionH * i * a, s = Tt(t, n * a, r * a, o);
4972
+ let o = e.extrusionH * i * a, s = wt(t, n * a, r * a, o);
4965
4973
  if (Math.hypot(s.x, s.y) < .75) return null;
4966
4974
  let c = [
4967
4975
  64,
@@ -4982,14 +4990,14 @@ function Wr(e, t, n, r, i, a) {
4982
4990
  rgb: c
4983
4991
  };
4984
4992
  }
4985
- function Gr(e, t, n, r, i, a, o, s = {}) {
4993
+ function Wr(e, t, n, r, i, a, o, s = {}) {
4986
4994
  if (i <= 0 || a <= 0) return !1;
4987
- let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * u)), f = Ct(t, i, a), p = f.corners;
4995
+ let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * u)), f = St(t, i, a), p = f.corners;
4988
4996
  if (d > 0) {
4989
- let e = d / u, t = Ke(f.corners, e / i, e / a);
4997
+ let e = d / u, t = Ge(f.corners, e / i, e / a);
4990
4998
  t ? p = t : d = 0;
4991
4999
  }
4992
- let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = je(h, g);
5000
+ let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = Ae(h, g);
4993
5001
  if (!_) return !1;
4994
5002
  let v = _.getContext("2d");
4995
5003
  if (!v) return !1;
@@ -5002,17 +5010,17 @@ function Gr(e, t, n, r, i, a, o, s = {}) {
5002
5010
  });
5003
5011
  if (s.extrusion) {
5004
5012
  let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
5005
- Zt(v, s.extrusion, x(e));
5013
+ Xt(v, s.extrusion, x(e));
5006
5014
  }
5007
- if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Xt(v, e, x(Math.ceil(e.widthPx) + 2));
5008
- return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), ze(_, e, h, g, p.map((e) => ({
5015
+ if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Yt(v, e, x(Math.ceil(e.widthPx) + 2));
5016
+ return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), Re(_, e, h, g, p.map((e) => ({
5009
5017
  x: n + e.x,
5010
5018
  y: r + e.y
5011
5019
  }))), !0;
5012
5020
  }
5013
- function Kr(e, t, n, r, i, a, o, s, c = 0) {
5021
+ function Gr(e, t, n, r, i, a, o, s, c = 0) {
5014
5022
  if (r <= 0 || i <= 0 || a.length === 0) return !1;
5015
- let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = je(m, h);
5023
+ let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = Ae(m, h);
5016
5024
  if (!g) return !1;
5017
5025
  let _ = g.getContext("2d");
5018
5026
  if (!_) return !1;
@@ -5020,7 +5028,7 @@ function Kr(e, t, n, r, i, a, o, s, c = 0) {
5020
5028
  let v = Math.ceil(r * d), y = Math.ceil(i * d);
5021
5029
  for (let e of a) {
5022
5030
  let t = Math.ceil(e.widthPx) + 2;
5023
- Xt(_, e, {
5031
+ Yt(_, e, {
5024
5032
  x: f - t,
5025
5033
  y: f - t,
5026
5034
  w: v + 2 * t,
@@ -5029,17 +5037,17 @@ function Kr(e, t, n, r, i, a, o, s, c = 0) {
5029
5037
  }
5030
5038
  return s && (_.save(), _.scale(d, d), _.translate(p, p), s(_, 0, 0, r, i), _.restore()), e.drawImage(g, t - p, n - p, m / d, h / d), !0;
5031
5039
  }
5032
- var qr = /* @__PURE__ */ new WeakMap();
5033
- function Jr(e) {
5034
- let t = qr.get(e);
5040
+ var Kr = /* @__PURE__ */ new WeakMap();
5041
+ function qr(e) {
5042
+ let t = Kr.get(e);
5035
5043
  return t || (t = async (t, n) => {
5036
5044
  let r = await e(t);
5037
5045
  return r.type === n ? r : new Blob([r], { type: n });
5038
- }, qr.set(e, t)), t;
5046
+ }, Kr.set(e, t)), t;
5039
5047
  }
5040
- function Yr(e, t, n = Jr(t), r, i, a) {
5041
- let o = Jr(t);
5042
- return K(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
5048
+ function Jr(e, t, n = qr(t), r, i, a) {
5049
+ let o = qr(t);
5050
+ return P(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
5043
5051
  tiff: r,
5044
5052
  svgDecoder: a,
5045
5053
  ...i ?? {}
@@ -5048,11 +5056,11 @@ function Yr(e, t, n = Jr(t), r, i, a) {
5048
5056
  return e;
5049
5057
  });
5050
5058
  }
5051
- function Xr(e, t, n) {
5052
- let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
5059
+ function Yr(e, t, n) {
5060
+ let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
5053
5061
  e.save();
5054
5062
  try {
5055
- t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))), ue(e, "tiff", {
5063
+ t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))), b(e, "tiff", {
5056
5064
  x: r,
5057
5065
  y: i,
5058
5066
  width: a,
@@ -5062,120 +5070,120 @@ function Xr(e, t, n) {
5062
5070
  e.restore();
5063
5071
  }
5064
5072
  }
5065
- async function Zr(e, t, n, r, i, o, s = 1, c, l) {
5066
- if (i) try {
5067
- let a = t.mimeType === "image/svg+xml", u = Pe(t.mimeType, t.srcRect, t.width / J, t.height / J);
5068
- if (!u) return;
5069
- let { widthPt: d, heightPt: f } = u, p = Dn(Y(t.width, n), Y(t.height, n), s, t.srcRect), h = A(t) || a, g = h ? p : l && !t.duotone ? On(l, X(kn(t), h ? void 0 : t.duotone)) : void 0, _ = g && "maxRetainedPixels" in g ? g.maxRetainedPixels : void 0, y = {
5070
- ...g ? {
5071
- targetWidthPx: g.targetWidthPx,
5072
- targetHeightPx: g.targetHeightPx,
5073
- ..._ === void 0 ? {} : { maxRetainedPixels: _ }
5073
+ async function Xr(e, t, r, i, a, s, c = 1, l, u) {
5074
+ if (a) try {
5075
+ let d = t.mimeType === "image/svg+xml", f = Ne(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5076
+ if (!f) return;
5077
+ let { widthPt: p, heightPt: m } = f, h = En(X(t.width, r), X(t.height, r), c, t.srcRect), g = J(t) || d, _ = g ? h : u && !t.duotone ? Dn(u, Z(On(t), g ? void 0 : t.duotone)) : void 0, v = _ && "maxRetainedPixels" in _ ? _.maxRetainedPixels : void 0, y = {
5078
+ ..._ ? {
5079
+ targetWidthPx: _.targetWidthPx,
5080
+ targetHeightPx: _.targetHeightPx,
5081
+ ...v === void 0 ? {} : { maxRetainedPixels: v }
5074
5082
  } : {},
5075
- workerDecoder: c
5083
+ workerDecoder: l
5076
5084
  }, b;
5077
- if (A(t)) try {
5078
- b = await I(t.svgImagePath, i, y);
5085
+ if (J(t)) try {
5086
+ b = await H(t.svgImagePath, a, y);
5079
5087
  } catch {
5080
- b = a ? await I(t.imagePath, i, y) : await Ye(t.imagePath, t.mimeType, t.duotone, i, {
5081
- widthPt: d,
5082
- heightPt: f,
5083
- ...g ?? {},
5084
- tiff: o
5088
+ b = d ? await H(t.imagePath, a, y) : await Je(t.imagePath, t.mimeType, t.duotone, a, {
5089
+ widthPt: p,
5090
+ heightPt: m,
5091
+ ..._ ?? {},
5092
+ tiff: s
5085
5093
  });
5086
5094
  }
5087
- else b = a ? await I(t.imagePath, i, y) : await Ye(t.imagePath, t.mimeType, t.duotone, i, {
5088
- widthPt: d,
5089
- heightPt: f,
5090
- ...g ?? {},
5091
- tiff: o
5095
+ else b = d ? await H(t.imagePath, a, y) : await Je(t.imagePath, t.mimeType, t.duotone, a, {
5096
+ widthPt: p,
5097
+ heightPt: m,
5098
+ ..._ ?? {},
5099
+ tiff: s
5092
5100
  });
5093
- if (!b || r()) return;
5101
+ if (!b || i()) return;
5094
5102
  e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
5095
- let x = Y(t.x, n), S = Y(t.y, n), C = Y(t.width, n), w = Y(t.height, n);
5103
+ let x = X(t.x, r), S = X(t.y, r), C = X(t.width, r), w = X(t.height, r);
5096
5104
  (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(x + C / 2, S + w / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(x + C / 2), -(S + w / 2)));
5097
5105
  let T = (e, n, r, i, a) => {
5098
- t.custGeom && t.custGeom.length > 0 ? Lr(e, t.custGeom, n, r, i, a) : t.prstGeom && v(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
5106
+ t.custGeom && t.custGeom.length > 0 ? Ir(e, t.custGeom, n, r, i, a) : t.prstGeom && o(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
5099
5107
  }, E = (e, t, n, r, i) => {
5100
5108
  e.beginPath(), T(e, t, n, r, i);
5101
5109
  }, D = (e, n, r, i, a) => {
5102
5110
  (t.prstGeom || t.custGeom && t.custGeom.length > 0) && (E(e, n, r, i, a), e.clip());
5103
- }, O = (e, r, i, a, o) => {
5104
- t.stroke && (e.save(), ei(e, t.stroke, n, {
5105
- x: r,
5111
+ }, O = (e, n, i, a, o) => {
5112
+ t.stroke && (e.save(), $r(e, t.stroke, r, {
5113
+ x: n,
5106
5114
  y: i,
5107
5115
  w: a,
5108
5116
  h: o
5109
- }, t.rotation), E(e, r, i, a, o), e.stroke(), e.restore());
5110
- }, k = (e, r, i, a, o) => {
5117
+ }, t.rotation), E(e, n, i, a, o), e.stroke(), e.restore());
5118
+ }, k = (e, n, i, a, o) => {
5111
5119
  let s = t.sp3d;
5112
5120
  if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
5113
- let t = Math.max(.5, s.contourW * n);
5121
+ let t = Math.max(.5, s.contourW * r);
5114
5122
  e.save(), e.beginPath();
5115
5123
  let c = t * 2 + Math.max(a, o);
5116
- e.rect(r - c, i - c, a + 2 * c, o + 2 * c), T(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, r, i, a, o), e.strokeStyle = Z(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
5124
+ e.rect(n - c, i - c, a + 2 * c, o + 2 * c), T(e, n, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, n, i, a, o), e.strokeStyle = Q(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
5117
5125
  }
5118
- }, j = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null, M = (e, n, r, i, a) => {
5119
- e.save(), D(e, n, r, i, a), Me(e, b, t.srcRect, n, r, i, a), e.restore();
5126
+ }, A = t.scene3d && Ct(t.scene3d.camera) ? t.scene3d : null, j = (e, n, r, i, a) => {
5127
+ e.save(), D(e, n, r, i, a), je(e, b, t.srcRect, n, r, i, a), e.restore();
5128
+ }, M = (e, t, n, r, i) => {
5129
+ j(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
5120
5130
  }, N = (e, t, n, r, i) => {
5121
- M(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
5122
- }, P = (e, t, n, r, i) => {
5123
- M(e, t, n, r, i), O(e, t, n, r, i);
5124
- }, F = e.getTransform(), L = Math.abs(F.a * F.d - F.b * F.c), R = L > 0 ? Math.sqrt(L) : 1, z = Ur(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, R), B = j ? Wr(t.sp3d, j.camera, C, w, n, R) : null, V = t.stroke ? t.stroke.width * n / 2 : 0, H = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, U = B ? Math.hypot(B.offsetX, B.offsetY) / R : 0, ee = V + H + U + 2, te = (e) => {
5125
- if (j) {
5126
- if (Gr(e, j.camera, x, S, C, w, P, {
5127
- bevels: z,
5128
- extrusion: B ?? void 0,
5131
+ j(e, t, n, r, i), O(e, t, n, r, i);
5132
+ }, P = e.getTransform(), F = Math.abs(P.a * P.d - P.b * P.c), I = F > 0 ? Math.sqrt(F) : 1, L = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, I), R = A ? Ur(t.sp3d, A.camera, C, w, r, I) : null, z = t.stroke ? t.stroke.width * r / 2 : 0, V = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, ee = R ? Math.hypot(R.offsetX, R.offsetY) / I : 0, U = z + V + ee + 2, W = (e) => {
5133
+ if (A) {
5134
+ if (Wr(e, A.camera, x, S, C, w, N, {
5135
+ bevels: L,
5136
+ extrusion: R ?? void 0,
5129
5137
  paintEdges: k,
5130
- edgePadCss: ee
5138
+ edgePadCss: U
5131
5139
  })) return;
5132
- } else if (z.length > 0 && Kr(e, x, S, C, w, z, P, k, ee)) return;
5133
- N(e, x, S, C, w);
5134
- }, G = (e, t, n, r, i, a) => {
5140
+ } else if (L.length > 0 && Gr(e, x, S, C, w, L, N, k, U)) return;
5141
+ M(e, x, S, C, w);
5142
+ }, te = (e, t, n, r, i, a) => {
5135
5143
  e.save(), D(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
5136
- }, K = (e, t) => {
5137
- j && Gr(e, j.camera, x, S, C, w, (e, n, r, i, a) => G(e, t, n, r, i, a)) || G(e, t, x, S, C, w);
5138
- }, q = e.getTransform(), ne = Math.abs(q.a * q.d - q.b * q.c), re = ne > 0 ? Math.sqrt(ne) : 1, ie = V + H, ae = (t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, x, S, C, w) : t.prstGeom && m(t.prstGeom.toLowerCase()) ? W(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
5144
+ }, G = (e, t) => {
5145
+ A && Wr(e, A.camera, x, S, C, w, (e, n, r, i, a) => te(e, t, n, r, i, a)) || te(e, t, x, S, C, w);
5146
+ }, K = e.getTransform(), q = Math.abs(K.a * K.d - K.b * K.c), ne = q > 0 ? Math.sqrt(q) : 1, re = z + V, ie = (t.custGeom && t.custGeom.length > 0 ? he(t.custGeom, x, S, C, w) : t.prstGeom && n(t.prstGeom.toLowerCase()) ? B(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
5139
5147
  x,
5140
5148
  y: S,
5141
5149
  w: C,
5142
5150
  h: w
5143
- }, oe = j ? Nr(j.camera, q, x, S, C, w, ee, t.shadow?.algn) : {
5144
- bbox: kr(q, ae.x - ie, ae.y - ie, ae.w + ie * 2, ae.h + ie * 2),
5145
- anchor: Mr(q, x, S, C, w, t.shadow?.algn)
5146
- }, se = n * re, ce = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), le = (e) => K(e, "#000");
5147
- Fr(e, t, j && ce ? Pr(te, q, oe.bbox, {
5151
+ }, ae = A ? Mr(A.camera, K, x, S, C, w, U, t.shadow?.algn) : {
5152
+ bbox: Or(K, ie.x - re, ie.y - re, ie.w + re * 2, ie.h + re * 2),
5153
+ anchor: jr(K, x, S, C, w, t.shadow?.algn)
5154
+ }, oe = r * ne, se = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), ce = (e) => G(e, "#000");
5155
+ Pr(e, t, A && se ? Nr(W, K, ae.bbox, {
5148
5156
  w: e.canvas.width || 0,
5149
5157
  h: e.canvas.height || 0
5150
- }) : te, j && ce ? Pr(le, q, oe.bbox, {
5158
+ }) : W, A && se ? Nr(ce, K, ae.bbox, {
5151
5159
  w: e.canvas.width || 0,
5152
5160
  h: e.canvas.height || 0
5153
- }) : le, oe.bbox, oe.anchor, n, se, q), e.restore();
5154
- } catch (i) {
5155
- if (a(i, "tiff")) {
5156
- r() || Xr(e, t, n);
5161
+ }) : ce, ae.bbox, ae.anchor, r, oe, K), e.restore();
5162
+ } catch (n) {
5163
+ if (ue(n, "tiff")) {
5164
+ i() || Yr(e, t, r);
5157
5165
  return;
5158
5166
  }
5159
- if (Re(i) || Je(i)) throw i;
5167
+ if (Le(n) || qe(n)) throw n;
5160
5168
  }
5161
5169
  }
5162
- async function Qr(e, t, n, r, i, o, s, c, l = 1, u, d) {
5163
- let f = Y(t.x, n), p = Y(t.y, n), m = Y(t.width, n), h = Y(t.height, n), g, _ = !1;
5170
+ async function Zr(e, t, n, r, i, a, o, s, c = 1, l, u) {
5171
+ let d = X(t.x, n), f = X(t.y, n), p = X(t.width, n), m = X(t.height, n), h, g = !1;
5164
5172
  if (t.posterPath && i) try {
5165
- g = await Yr(t, i, s, c, t.posterMimeType === "image/svg+xml" ? Dn(m, h, l) : d ? On(d, X(t.posterPath)) : void 0, u);
5173
+ h = await Jr(t, i, o, s, t.posterMimeType === "image/svg+xml" ? En(p, m, c) : u ? Dn(u, Z(t.posterPath)) : void 0, l);
5166
5174
  } catch (e) {
5167
- if (a(e, "tiff")) _ = !0;
5168
- else if (Re(e) || Je(e)) throw e;
5175
+ if (ue(e, "tiff")) g = !0;
5176
+ else if (Le(e) || qe(e)) throw e;
5169
5177
  }
5170
- r() || (e.save(), ti(e, t, n), g ? e.drawImage(g, f, p, m, h) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(f, p, m, h), _ && ue(e, "tiff", {
5171
- x: f,
5172
- y: p,
5173
- width: m,
5174
- height: h
5175
- })), o || on(e, f + m / 2, p + h / 2, m, h, "paused"), e.restore());
5176
- }
5177
- function $r(e, t, n, r, i, a, o) {
5178
- let s = Math.max(.5, Y(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
5178
+ r() || (e.save(), ei(e, t, n), h ? e.drawImage(h, d, f, p, m) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(d, f, p, m), g && b(e, "tiff", {
5179
+ x: d,
5180
+ y: f,
5181
+ width: p,
5182
+ height: m
5183
+ })), a || an(e, d + p / 2, f + m / 2, p, m, "paused"), e.restore());
5184
+ }
5185
+ function Qr(e, t, n, r, i, a, o) {
5186
+ let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
5179
5187
  if (u === 0) return;
5180
5188
  let d = -l / u, f = c / u, p;
5181
5189
  switch (i) {
@@ -5224,199 +5232,199 @@ function $r(e, t, n, r, i, a, o) {
5224
5232
  break;
5225
5233
  default: return;
5226
5234
  }
5227
- e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ? Pn(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o) : null) ?? Z(r.color);
5235
+ e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ? Nn(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o) : null) ?? Q(r.color);
5228
5236
  for (let r of p) {
5229
5237
  let i = d * (s * r.offset), a = f * (s * r.offset);
5230
5238
  e.lineWidth = Math.max(.5, s * r.widthFrac), e.beginPath(), e.moveTo(t.x + i, t.y + a), e.lineTo(n.x + i, n.y + a), e.stroke();
5231
5239
  }
5232
5240
  e.restore();
5233
5241
  }
5234
- function ei(e, t, n, r, i = 0) {
5235
- if (Ae(e, t, n), t?.fill && r) {
5236
- let n = Pn(t.fill, e, r.x, r.y, r.w, r.h, i);
5242
+ function $r(e, t, n, r, i = 0) {
5243
+ if (ke(e, t, n), t?.fill && r) {
5244
+ let n = Nn(t.fill, e, r.x, r.y, r.w, r.h, i);
5237
5245
  n && (e.strokeStyle = n);
5238
5246
  }
5239
5247
  }
5240
- function ti(e, t, n) {
5248
+ function ei(e, t, n) {
5241
5249
  if (t.rotation === 0 && !t.flipH && !t.flipV) return;
5242
- let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
5250
+ let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
5243
5251
  e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(r + a / 2), -(i + o / 2));
5244
5252
  }
5245
- function ni(t, n, r, i, a = {
5253
+ function ti(e, t, n, r, i = {
5246
5254
  themeMajorFont: null,
5247
5255
  themeMinorFont: null,
5248
5256
  dpr: 1
5249
- }, o) {
5250
- t.save(), ti(t, n, r);
5251
- let s = Y(n.x, r), c = Y(n.y, r), l = n.cols.map((e) => Y(e, r)), u = l.length, d = (e, t) => {
5257
+ }, a) {
5258
+ e.save(), ei(e, t, n);
5259
+ let o = X(t.x, n), s = X(t.y, n), c = t.cols.map((e) => X(e, n)), l = c.length, u = (e, t) => {
5252
5260
  let n = 0;
5253
- for (let r = 0; r < t; r++) n += l[e + r] ?? 0;
5261
+ for (let r = 0; r < t; r++) n += c[e + r] ?? 0;
5254
5262
  return n;
5255
- }, f = n.rows.map((e) => Y(e.height, r));
5256
- for (let e = 0; e < n.rows.length; e++) {
5257
- let o = n.rows[e];
5258
- for (let n = 0; n < o.cells.length; n++) {
5259
- let s = o.cells[n];
5263
+ }, d = t.rows.map((e) => X(e.height, n));
5264
+ for (let a = 0; a < t.rows.length; a++) {
5265
+ let o = t.rows[a];
5266
+ for (let t = 0; t < o.cells.length; t++) {
5267
+ let s = o.cells[t];
5260
5268
  if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
5261
- let c = d(n, s.gridSpan || 1), l = Hr(t, s.textBody, 0, 0, c, 0, r, null, 0, !1, !1, "#000000", i, a, void 0, !0, void 0, !1, o.height === 0) || 0;
5262
- l > f[e] && (f[e] = l);
5269
+ let c = u(t, s.gridSpan || 1), l = Vr(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, o.height === 0) || 0;
5270
+ l > d[a] && (d[a] = l);
5263
5271
  }
5264
5272
  }
5265
- for (let e = 0; e < n.rows.length; e++) {
5266
- let o = n.rows[e];
5273
+ for (let a = 0; a < t.rows.length; a++) {
5274
+ let o = t.rows[a];
5267
5275
  for (let s = 0; s < o.cells.length; s++) {
5268
5276
  let c = o.cells[s];
5269
5277
  if (c.hMerge || c.vMerge) continue;
5270
5278
  let l = c.rowSpan || 1;
5271
5279
  if (l <= 1 || !c.textBody) continue;
5272
- let u = d(s, c.gridSpan || 1), p = n.rows.slice(e, Math.min(n.rows.length, e + l)).some((e) => e.height === 0), m = Hr(t, c.textBody, 0, 0, u, 0, r, null, 0, !1, !1, "#000000", i, a, void 0, !0, void 0, !1, p) || 0, h = 0;
5273
- for (let t = 0; t < l && e + t < f.length; t++) h += f[e + t];
5280
+ let f = u(s, c.gridSpan || 1), p = t.rows.slice(a, Math.min(t.rows.length, a + l)).some((e) => e.height === 0), m = Vr(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, p) || 0, h = 0;
5281
+ for (let e = 0; e < l && a + e < d.length; e++) h += d[a + e];
5274
5282
  if (m > h) {
5275
- let t = (m - h) / l;
5276
- for (let n = 0; n < l && e + n < f.length; n++) f[e + n] += t;
5283
+ let e = (m - h) / l;
5284
+ for (let t = 0; t < l && a + t < d.length; t++) d[a + t] += e;
5277
5285
  }
5278
5286
  }
5279
5287
  }
5280
- let p = l.reduce((e, t) => e + t, 0), m = Array(u);
5281
- if (n.rtl) {
5282
- let e = s + p;
5283
- for (let t = 0; t < u; t++) e -= l[t], m[t] = e;
5288
+ let f = c.reduce((e, t) => e + t, 0), p = Array(l);
5289
+ if (t.rtl) {
5290
+ let e = o + f;
5291
+ for (let t = 0; t < l; t++) e -= c[t], p[t] = e;
5284
5292
  } else {
5285
- let e = s;
5286
- for (let t = 0; t < u; t++) m[t] = e, e += l[t];
5293
+ let e = o;
5294
+ for (let t = 0; t < l; t++) p[t] = e, e += c[t];
5287
5295
  }
5288
- let h = (e, t) => n.rtl ? m[e + t - 1] : m[e], g = Array(n.rows.length);
5296
+ let m = (e, n) => t.rtl ? p[e + n - 1] : p[e], h = Array(t.rows.length);
5289
5297
  {
5290
- let e = c;
5291
- for (let t = 0; t < n.rows.length; t++) g[t] = e, e += f[t];
5298
+ let e = s;
5299
+ for (let n = 0; n < t.rows.length; n++) h[n] = e, e += d[n];
5292
5300
  }
5293
- let _, v = {
5301
+ let g, _ = {
5294
5302
  row: 0,
5295
5303
  column: 0
5296
5304
  };
5297
- if (o) {
5298
- let e = Y(n.width, r), t = Y(n.height, r), i = s + e / 2, a = c + t / 2, l = n.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l);
5299
- _ = (e) => {
5300
- let t = e.shapeX + e.shapeW / 2 - i, r = e.shapeY + e.shapeH / 2 - a;
5301
- n.flipH && (t = -t), n.flipV && (r = -r);
5302
- let s = i + u * t - d * r, c = a + d * t + u * r;
5303
- o({
5305
+ if (a) {
5306
+ let e = X(t.width, n), r = X(t.height, n), i = o + e / 2, c = s + r / 2, l = t.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l);
5307
+ g = (e) => {
5308
+ let n = e.shapeX + e.shapeW / 2 - i, r = e.shapeY + e.shapeH / 2 - c;
5309
+ t.flipH && (n = -n), t.flipV && (r = -r);
5310
+ let o = i + u * n - d * r, s = c + d * n + u * r;
5311
+ a({
5304
5312
  ...e,
5305
- ...n.id === void 0 ? {} : { shapeId: n.id },
5306
- shapeX: s - e.shapeW / 2,
5307
- shapeY: c - e.shapeH / 2,
5308
- rotation: n.rotation,
5309
- ...n.flipH ? { shapeFlipH: !0 } : {},
5310
- ...n.flipV ? { shapeFlipV: !0 } : {},
5311
- tableCell: v
5313
+ ...t.id === void 0 ? {} : { shapeId: t.id },
5314
+ shapeX: o - e.shapeW / 2,
5315
+ shapeY: s - e.shapeH / 2,
5316
+ rotation: t.rotation,
5317
+ ...t.flipH ? { shapeFlipH: !0 } : {},
5318
+ ...t.flipV ? { shapeFlipV: !0 } : {},
5319
+ tableCell: _
5312
5320
  });
5313
5321
  };
5314
5322
  }
5315
- let y = [], b = n.rows.map(() => Array(u).fill(-1));
5316
- for (let e = 0; e < n.rows.length; e++) {
5317
- let t = n.rows[e], r = g[e];
5318
- for (let i = 0; i < t.cells.length; i++) {
5319
- let a = t.cells[i];
5323
+ let v = [], y = t.rows.map(() => Array(l).fill(-1));
5324
+ for (let e = 0; e < t.rows.length; e++) {
5325
+ let n = t.rows[e], r = h[e];
5326
+ for (let i = 0; i < n.cells.length; i++) {
5327
+ let a = n.cells[i];
5320
5328
  if (a.hMerge || a.vMerge) continue;
5321
- let o = a.gridSpan || 1, s = a.rowSpan || 1, c = d(i, o), l = 0;
5322
- for (let t = 0; t < s; t++) l += f[e + t] ?? 0;
5323
- let p = h(i, o), m = Math.min(e + s - 1, n.rows.length - 1), g = y.length;
5324
- y.push({
5329
+ let o = a.gridSpan || 1, s = a.rowSpan || 1, c = u(i, o), f = 0;
5330
+ for (let t = 0; t < s; t++) f += d[e + t] ?? 0;
5331
+ let p = m(i, o), h = Math.min(e + s - 1, t.rows.length - 1), g = v.length;
5332
+ v.push({
5325
5333
  cell: a,
5326
5334
  colX: p,
5327
5335
  rowY: r,
5328
5336
  cellW: c,
5329
- cellH: l,
5337
+ cellH: f,
5330
5338
  ci: i,
5331
5339
  ri: e,
5332
5340
  span: o,
5333
- lastRi: m
5341
+ lastRi: h
5334
5342
  });
5335
- for (let t = e; t <= m; t++) for (let e = i; e < i + o && e < u; e++) b[t][e] = g;
5343
+ for (let t = e; t <= h; t++) for (let e = i; e < i + o && e < l; e++) y[t][e] = g;
5336
5344
  }
5337
5345
  }
5338
- for (let { cell: e, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of y) {
5339
- let f = Pn(e.fill, t, o, s, c, l, n.rotation);
5340
- if (f && (t.fillStyle = f, t.fillRect(o, s, c, l)), e.textBody) {
5341
- _ && (v = {
5346
+ for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of v) {
5347
+ let f = Nn(a.fill, e, o, s, c, l, t.rotation);
5348
+ if (f && (e.fillStyle = f, e.fillRect(o, s, c, l)), a.textBody) {
5349
+ g && (_ = {
5342
5350
  row: d,
5343
5351
  column: u
5344
5352
  });
5345
- let n = e.textColor ? Z(e.textColor) : null;
5346
- Hr(t, e.textBody, o, s, c, l, r, n, 0, !1, !1, "#000000", i, a, _);
5353
+ let t = a.textColor ? Q(a.textColor) : null;
5354
+ Vr(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i, g);
5347
5355
  }
5348
5356
  }
5349
- let x = a.dpr, S = (e, t) => {
5350
- if (e < 0 || e >= b.length || t < 0 || t >= u) return null;
5351
- let n = b[e][t];
5352
- return n < 0 ? null : y[n];
5353
- }, C = (i, a, o, s, c) => {
5354
- if (ei(t, i, r, {
5355
- x: Math.min(a, s),
5356
- y: Math.min(o, c),
5357
- w: Math.max(1, Math.abs(s - a)),
5358
- h: Math.max(1, Math.abs(c - o))
5359
- }, n.rotation), i.cmpd === "dbl" && !i.dashStyle && !i.customDash?.length && (a === s || o === c)) {
5360
- t.fillStyle = t.strokeStyle, Se(t, a, o, s, c, Math.max(.5, Y(i.width, r)), x);
5357
+ let b = i.dpr, x = (e, t) => {
5358
+ if (e < 0 || e >= y.length || t < 0 || t >= l) return null;
5359
+ let n = y[e][t];
5360
+ return n < 0 ? null : v[n];
5361
+ }, S = (r, i, a, o, s) => {
5362
+ if ($r(e, r, n, {
5363
+ x: Math.min(i, o),
5364
+ y: Math.min(a, s),
5365
+ w: Math.max(1, Math.abs(o - i)),
5366
+ h: Math.max(1, Math.abs(s - a))
5367
+ }, t.rotation), r.cmpd === "dbl" && !r.dashStyle && !r.customDash?.length && (i === o || a === s)) {
5368
+ e.fillStyle = e.strokeStyle, xe(e, i, a, o, s, Math.max(.5, X(r.width, n)), b);
5361
5369
  return;
5362
5370
  }
5363
- let l = a === s ? e(a, t.lineWidth, x) : 0, u = o === c ? e(o, t.lineWidth, x) : 0;
5364
- t.beginPath(), t.moveTo(a + l, o + u), t.lineTo(s + l, c + u), t.stroke();
5371
+ let c = i === o ? T(i, e.lineWidth, b) : 0, l = a === s ? T(a, e.lineWidth, b) : 0;
5372
+ e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
5365
5373
  };
5366
- for (let e of y) {
5367
- let { cell: i, colX: a, rowY: o, cellW: s, cellH: c } = e;
5368
- t.save();
5369
- let l = n.rtl ? i.borderR : i.borderL, p = n.rtl ? i.borderL : i.borderR, m = n.rtl ? e.ci + e.span === u : e.ci === 0, _ = n.rtl ? e.ci === 0 : e.ci + e.span === u, v = n.rtl ? e.ci - 1 : e.ci + e.span, y = (e) => n.rtl ? e.borderR : e.borderL;
5370
- if (e.ri === 0 && i.borderT && C(i.borderT, a, o, a + s, o), m && l && C(l, a, o, a, o + c), e.lastRi === n.rows.length - 1) {
5374
+ for (let r of v) {
5375
+ let { cell: i, colX: a, rowY: o, cellW: s, cellH: c } = r;
5376
+ e.save();
5377
+ let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR, g = t.rtl ? r.ci + r.span === l : r.ci === 0, _ = t.rtl ? r.ci === 0 : r.ci + r.span === l, v = t.rtl ? r.ci - 1 : r.ci + r.span, b = (e) => t.rtl ? e.borderR : e.borderL;
5378
+ if (r.ri === 0 && i.borderT && S(i.borderT, a, o, a + s, o), g && f && S(f, a, o, a, o + c), r.lastRi === t.rows.length - 1) {
5371
5379
  let e = i.borderB;
5372
- e && C(e, a, o + c, a + s, o + c);
5380
+ e && S(e, a, o + c, a + s, o + c);
5373
5381
  } else {
5374
- let t = e.lastRi + 1, n = o + c, r = Math.min(e.ci + e.span, u), a = e.ci;
5375
- for (; a < r;) {
5376
- let e = b[t][a], o = a + 1;
5377
- for (; o < r && b[t][o] === e;) o++;
5378
- let s = S(t, a), c = gn(i.borderB, s ? s.cell.borderT : null);
5382
+ let e = r.lastRi + 1, t = o + c, n = Math.min(r.ci + r.span, l), a = r.ci;
5383
+ for (; a < n;) {
5384
+ let r = y[e][a], o = a + 1;
5385
+ for (; o < n && y[e][o] === r;) o++;
5386
+ let s = x(e, a), c = hn(i.borderB, s ? s.cell.borderT : null);
5379
5387
  if (c) {
5380
- let e = h(a, o - a);
5381
- C(c, e, n, e + d(a, o - a), n);
5388
+ let e = m(a, o - a);
5389
+ S(c, e, t, e + u(a, o - a), t);
5382
5390
  }
5383
5391
  a = o;
5384
5392
  }
5385
5393
  }
5386
5394
  if (_) {
5387
5395
  let e = p;
5388
- e && C(e, a + s, o, a + s, o + c);
5396
+ e && S(e, a + s, o, a + s, o + c);
5389
5397
  } else {
5390
- let t = a + s, n = e.ri;
5391
- for (; n <= e.lastRi;) {
5392
- let r = b[n][v], i = n;
5393
- for (; i + 1 <= e.lastRi && b[i + 1][v] === r;) i++;
5394
- let a = S(n, v), o = gn(p, a ? y(a.cell) : null);
5395
- o && C(o, t, g[n], t, g[i] + f[i]), n = i + 1;
5398
+ let e = a + s, t = r.ri;
5399
+ for (; t <= r.lastRi;) {
5400
+ let n = y[t][v], i = t;
5401
+ for (; i + 1 <= r.lastRi && y[i + 1][v] === n;) i++;
5402
+ let a = x(t, v), o = hn(p, a ? b(a.cell) : null);
5403
+ o && S(o, e, h[t], e, h[i] + d[i]), t = i + 1;
5396
5404
  }
5397
5405
  }
5398
- i.diagonalTL && (ei(t, i.diagonalTL, r, {
5406
+ i.diagonalTL && ($r(e, i.diagonalTL, n, {
5399
5407
  x: a,
5400
5408
  y: o,
5401
5409
  w: s,
5402
5410
  h: c
5403
- }, n.rotation), t.beginPath(), t.moveTo(a, o), t.lineTo(a + s, o + c), t.stroke()), i.diagonalTR && (ei(t, i.diagonalTR, r, {
5411
+ }, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && ($r(e, i.diagonalTR, n, {
5404
5412
  x: a,
5405
5413
  y: o,
5406
5414
  w: s,
5407
5415
  h: c
5408
- }, n.rotation), t.beginPath(), t.moveTo(a + s, o), t.lineTo(a, o + c), t.stroke()), t.restore();
5416
+ }, t.rotation), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + c), e.stroke()), e.restore();
5409
5417
  }
5410
- t.restore();
5418
+ e.restore();
5411
5419
  }
5412
- function ri(e, t, n, r) {
5420
+ function ni(e, t, n, r) {
5413
5421
  e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
5414
5422
  }
5415
- var ii = /* @__PURE__ */ new WeakMap();
5416
- function ai(e) {
5417
- ii.set(e, (ii.get(e) ?? 0) + 1);
5423
+ var ri = /* @__PURE__ */ new WeakMap();
5424
+ function ii(e) {
5425
+ ri.set(e, (ri.get(e) ?? 0) + 1);
5418
5426
  }
5419
- function oi(e, t, n, r, i) {
5427
+ function ai(e, t, n, r, i) {
5420
5428
  e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
5421
5429
  let a = Math.max(12, Math.min(t, n) * .04);
5422
5430
  e.strokeStyle = "#c8ccd2", e.lineWidth = Math.max(1, Math.min(t, n) * .004), e.setLineDash([e.lineWidth * 6, e.lineWidth * 5]), e.strokeRect(a, a, t - a * 2, n - a * 2), e.setLineDash([]);
@@ -5436,72 +5444,72 @@ function oi(e, t, n, r, i) {
5436
5444
  for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
5437
5445
  e.restore();
5438
5446
  }
5447
+ async function oi(e, t, n, r, i = {}, a) {
5448
+ return si(e, t, n, r, i, a);
5449
+ }
5439
5450
  async function si(e, t, n, r, i = {}, a) {
5440
- return ci(e, t, n, r, i, a);
5441
- }
5442
- async function ci(e, t, n, r, i = {}, a) {
5443
- let o = i.fetchImage ?? (i.fetchMedia ? Jr(i.fetchMedia) : void 0), s = (ii.get(e) ?? 0) + 1;
5444
- ii.set(e, s);
5445
- let c = () => ii.get(e) !== s, l = () => c() ? Promise.resolve(e) : li(e, t, n, r, i, a, o, c);
5446
- return o && Mn(t) ? j(o, i.imageResources, l) : l();
5447
- }
5448
- async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
5449
- let l = i.width ?? ((se(e) ? e.offsetWidth : 0) || 960), u = l / n, d = Math.round(l), f = Math.round(r * u), p = i.dpr ?? L(), m = He(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await jn(t, d, f, u, h, i.imageResources, i.fetchImage, i.fetchMedia, s, i.tiff);
5450
- e.width = m.width, e.height = m.height, se(e) && (e.style.width = `${d}px`, e.style.display || (e.style.display = "block"));
5451
- let _ = e.getContext("2d");
5452
- if (!_) throw Error("Could not get 2D context");
5453
- if (_.scale(h, h), t.parseError) return oi(_, d, f, t.slideNumber, t.parseError), e;
5454
- let v = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", y = /* @__PURE__ */ new Map(), b = {
5455
- themeMajorFont: i.majorFont ?? null,
5456
- themeMinorFont: i.minorFont ?? null,
5457
- themeHlinkColor: i.hlinkColor ?? null,
5458
- embeddedFontAliases: i.embeddedFontAliases,
5459
- embeddedFontAuthoredFamilies: i.embeddedFontAuthoredFamilies,
5451
+ let o = i.fetchImage ?? (i.fetchMedia ? qr(i.fetchMedia) : void 0), s = (ri.get(e) ?? 0) + 1;
5452
+ ri.set(e, s);
5453
+ let c = () => ri.get(e) !== s, l = () => c() ? Promise.resolve(e) : ci(e, t, n, r, i, a, o, c);
5454
+ return o && jn(t) ? se(o, i.imageResources, l) : l();
5455
+ }
5456
+ async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
5457
+ let l = a.width ?? ((e(t) ? t.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? _(), m = Ve(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await An(n, d, f, u, h, a.imageResources, a.fetchImage, a.fetchMedia, s, a.tiff);
5458
+ t.width = m.width, t.height = m.height, e(t) && (t.style.width = `${d}px`, t.style.display || (t.style.display = "block"));
5459
+ let v = t.getContext("2d");
5460
+ if (!v) throw Error("Could not get 2D context");
5461
+ if (v.scale(h, h), n.parseError) return ai(v, d, f, n.slideNumber, n.parseError), t;
5462
+ let y = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", b = /* @__PURE__ */ new Map(), x = {
5463
+ themeMajorFont: a.majorFont ?? null,
5464
+ themeMinorFont: a.minorFont ?? null,
5465
+ themeHlinkColor: a.hlinkColor ?? null,
5466
+ embeddedFontAliases: a.embeddedFontAliases,
5467
+ embeddedFontAuthoredFamilies: a.embeddedFontAuthoredFamilies,
5460
5468
  dpr: h,
5461
- smartArtFallbackTextColor: bn(t.background, v),
5462
- pictureBulletImages: y
5469
+ smartArtFallbackTextColor: yn(n.background, y),
5470
+ pictureBulletImages: b
5463
5471
  };
5464
- if (await sr(_, t.background, d, f, u, c, i.fetchImage, i.tiff, i.svgDecoder, g), c() || (i.math && await Rn(t, i.math), c())) return e;
5465
- let x = t.slideNumber;
5466
- for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
5467
- let t = e, n = t.mimeType === "image/svg+xml", r = A(t) || n, a = !r && !t.duotone ? On(g, X(kn(t), t.duotone)) : void 0, o = Dn(Y(t.width, u), Y(t.height, u), h, t.srcRect), s = r ? o : a, c = s && "maxRetainedPixels" in s ? s.maxRetainedPixels : void 0, l = {
5472
+ if (await or(v, n.background, d, f, u, c, a.fetchImage, a.tiff, a.svgDecoder, g), c() || (a.math && await Ln(n, a.math), c())) return t;
5473
+ let S = n.slideNumber;
5474
+ for (let e of n.elements) if (e.type === "picture" && a.fetchImage) {
5475
+ let t = e, n = t.mimeType === "image/svg+xml", r = J(t) || n, i = !r && !t.duotone ? Dn(g, Z(On(t), t.duotone)) : void 0, o = En(X(t.width, u), X(t.height, u), h, t.srcRect), s = r ? o : i, c = s && "maxRetainedPixels" in s ? s.maxRetainedPixels : void 0, l = {
5468
5476
  ...s ? {
5469
5477
  targetWidthPx: s.targetWidthPx,
5470
5478
  targetHeightPx: s.targetHeightPx,
5471
5479
  ...c === void 0 ? {} : { maxRetainedPixels: c }
5472
5480
  } : {},
5473
- workerDecoder: i.svgDecoder
5481
+ workerDecoder: a.svgDecoder
5474
5482
  };
5475
- if (A(t)) I(t.svgImagePath, i.fetchImage, l).catch(() => void 0);
5476
- else if (n) I(t.imagePath, i.fetchImage, l).catch(() => void 0);
5483
+ if (J(t)) H(t.svgImagePath, a.fetchImage, l).catch(() => void 0);
5484
+ else if (n) H(t.imagePath, a.fetchImage, l).catch(() => void 0);
5477
5485
  else {
5478
- let e = Pe(t.mimeType, t.srcRect, t.width / J, t.height / J);
5486
+ let e = Ne(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5479
5487
  if (!e) continue;
5480
- Ye(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
5488
+ Je(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
5481
5489
  widthPt: e.widthPt,
5482
5490
  heightPt: e.heightPt,
5483
5491
  ...s ?? {},
5484
- tiff: i.tiff,
5485
- svgDecoder: i.svgDecoder
5492
+ tiff: a.tiff,
5493
+ svgDecoder: a.svgDecoder
5486
5494
  }).catch(() => void 0);
5487
5495
  }
5488
5496
  } else if (e.type === "media") {
5489
5497
  let t = e;
5490
- t.posterPath && i.fetchMedia && Yr(t, i.fetchMedia, s, i.tiff, t.posterMimeType === "image/svg+xml" ? Dn(Y(t.width, u), Y(t.height, u), h) : On(g, X(t.posterPath)), i.svgDecoder).catch(() => void 0);
5498
+ t.posterPath && a.fetchMedia && Jr(t, a.fetchMedia, s, a.tiff, t.posterMimeType === "image/svg+xml" ? En(X(t.width, u), X(t.height, u), h) : Dn(g, Z(t.posterPath)), a.svgDecoder).catch(() => void 0);
5491
5499
  }
5492
- let S = /* @__PURE__ */ new Map();
5493
- if (i.fetchImage) {
5494
- let n = i.fetchImage, r = /* @__PURE__ */ new Map(), o = [];
5495
- for (let e of t.elements) {
5500
+ let C = /* @__PURE__ */ new Map();
5501
+ if (a.fetchImage) {
5502
+ let e = a.fetchImage, r = /* @__PURE__ */ new Map(), i = [];
5503
+ for (let e of n.elements) {
5496
5504
  if (e.type !== "chart" || !Number.isFinite(e.width) || e.width <= 0 || !Number.isFinite(e.height) || e.height <= 0) continue;
5497
5505
  let t = {
5498
- widthPt: e.width / J,
5499
- heightPt: e.height / J,
5500
- targetWidthPx: Y(e.width, u) * h,
5501
- targetHeightPx: Y(e.height, u) * h
5506
+ widthPt: e.width / Y,
5507
+ heightPt: e.height / Y,
5508
+ targetWidthPx: X(e.width, u) * h,
5509
+ targetHeightPx: X(e.height, u) * h
5502
5510
  }, n = [], r = !0;
5503
- for (let i of Ee(e.chart)) {
5504
- let e = De(i, t);
5511
+ for (let i of Te(e.chart)) {
5512
+ let e = Ee(i, t);
5505
5513
  if (!e) {
5506
5514
  r = !1;
5507
5515
  break;
@@ -5511,16 +5519,16 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
5511
5519
  size: e
5512
5520
  });
5513
5521
  }
5514
- r && o.push({
5522
+ r && i.push({
5515
5523
  element: e,
5516
5524
  frame: t,
5517
5525
  usages: n
5518
5526
  });
5519
5527
  }
5520
- let s = /* @__PURE__ */ new Map();
5521
- for (let e of Ne(o.map(({ element: e }) => e.chart), (e, t) => De(e, o[t].frame) != null)) {
5522
- let { fill: t } = e, n = Le(t);
5523
- s.has(n) || s.set(n, {
5528
+ let o = /* @__PURE__ */ new Map();
5529
+ for (let e of Me(i.map(({ element: e }) => e.chart), (e, t) => Ee(e, i[t].frame) != null)) {
5530
+ let { fill: t } = e, n = Ie(t);
5531
+ o.has(n) || o.set(n, {
5524
5532
  fill: t,
5525
5533
  widthPt: 0,
5526
5534
  heightPt: 0,
@@ -5528,14 +5536,14 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
5528
5536
  hasSourceCrop: e.hasSourceCrop
5529
5537
  });
5530
5538
  }
5531
- for (let { usages: e } of o) for (let { usage: t, size: n } of e) {
5532
- let { fill: e } = t, r = Le(e), i = s.get(r);
5539
+ for (let { usages: e } of i) for (let { usage: t, size: n } of e) {
5540
+ let { fill: e } = t, r = Ie(e), i = o.get(r);
5533
5541
  if (!i) continue;
5534
- let a = i.preserveNaturalSize || t.preserveNaturalSize, o = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : On(g, X(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || A({
5542
+ let a = i.preserveNaturalSize || t.preserveNaturalSize, s = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : Dn(g, Z(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || J({
5535
5543
  svgImagePath: e.svgImagePath,
5536
- srcRect: o ? !0 : null
5544
+ srcRect: s ? !0 : null
5537
5545
  }));
5538
- s.set(r, {
5546
+ o.set(r, {
5539
5547
  ...i,
5540
5548
  widthPt: Math.max(i.widthPt, n.widthPt),
5541
5549
  heightPt: Math.max(i.heightPt, n.heightPt),
@@ -5543,145 +5551,145 @@ async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
5543
5551
  targetHeightPx: a ? void 0 : c?.targetHeightPx ?? (l && Math.max(i.targetHeightPx ?? 0, n.targetHeightPx ?? 0) || void 0),
5544
5552
  maxRetainedPixels: c?.maxRetainedPixels,
5545
5553
  preserveNaturalSize: a,
5546
- hasSourceCrop: o
5554
+ hasSourceCrop: s
5547
5555
  });
5548
5556
  }
5549
- for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
5550
- let n = $e(t.bullet);
5557
+ for (let e of n.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
5558
+ let n = Qe(t.bullet);
5551
5559
  if (n.type === "blip") {
5552
- let i = Qn(e.textBody, t, n) * J * u * h, a = r.get(n.imagePath);
5560
+ let i = Zn(e.textBody, t, n) * Y * u * h, a = r.get(n.imagePath);
5553
5561
  a ? Number.isFinite(i) && i > 0 && (a.targetHeightPx = Math.max(a.targetHeightPx ?? 0, i)) : r.set(n.imagePath, {
5554
5562
  mimeType: n.mimeType,
5555
5563
  ...Number.isFinite(i) && i > 0 ? { targetHeightPx: i } : {}
5556
5564
  });
5557
5565
  }
5558
5566
  }
5559
- if (r.size > 0 || s.size > 0) {
5560
- let t = [...r].map(async ([e, { mimeType: t, targetHeightPx: r }]) => {
5567
+ if (r.size > 0 || o.size > 0) {
5568
+ let n = [...r].map(async ([t, { mimeType: n, targetHeightPx: r }]) => {
5561
5569
  try {
5562
- let a = t === "image/svg+xml" ? r === void 0 ? {} : {
5570
+ let i = n === "image/svg+xml" ? r === void 0 ? {} : {
5563
5571
  targetWidthPx: 1,
5564
5572
  targetHeightPx: r
5565
- } : On(g, X(e)) ?? {}, o = t === "image/svg+xml" ? await I(e, n, {
5566
- ...a,
5567
- workerDecoder: i.svgDecoder
5568
- }) : await K(e, t, n, {
5569
- tiff: i.tiff,
5570
- ...a
5573
+ } : Dn(g, Z(t)) ?? {}, o = n === "image/svg+xml" ? await H(t, e, {
5574
+ ...i,
5575
+ workerDecoder: a.svgDecoder
5576
+ }) : await P(t, n, e, {
5577
+ tiff: a.tiff,
5578
+ ...i
5571
5579
  });
5572
- y.set(e, o);
5573
- } catch (t) {
5574
- if (a(t, "tiff")) {
5575
- y.set(e, null);
5580
+ b.set(t, o);
5581
+ } catch (e) {
5582
+ if (ue(e, "tiff")) {
5583
+ b.set(t, null);
5576
5584
  return;
5577
5585
  }
5578
- if (Re(t) || Je(t)) throw t;
5579
- y.set(e, null);
5586
+ if (Le(e) || qe(e)) throw e;
5587
+ b.set(t, null);
5580
5588
  }
5581
- }), o = [...s].map(async ([e, t]) => {
5582
- let { fill: r, widthPt: o, heightPt: s, targetWidthPx: c, targetHeightPx: l, maxRetainedPixels: u, hasSourceCrop: d } = t, f = c && l ? {
5583
- targetWidthPx: c,
5584
- targetHeightPx: l,
5585
- ...u === void 0 ? {} : { maxRetainedPixels: u }
5589
+ }), i = [...o].map(async ([t, n]) => {
5590
+ let { fill: r, widthPt: i, heightPt: o, targetWidthPx: s, targetHeightPx: c, maxRetainedPixels: l, hasSourceCrop: u } = n, d = s && c ? {
5591
+ targetWidthPx: s,
5592
+ targetHeightPx: c,
5593
+ ...l === void 0 ? {} : { maxRetainedPixels: l }
5586
5594
  } : void 0;
5587
5595
  try {
5588
- let t = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : I(r.imagePath, n, {
5589
- ...f ?? {},
5590
- workerDecoder: i.svgDecoder
5591
- }) : Ye(r.imagePath, r.mimeType, r.duotone, n, {
5592
- widthPt: o,
5593
- heightPt: s,
5594
- ...f ?? {},
5596
+ let n = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : H(r.imagePath, e, {
5597
+ ...d ?? {},
5598
+ workerDecoder: a.svgDecoder
5599
+ }) : Je(r.imagePath, r.mimeType, r.duotone, e, {
5600
+ widthPt: i,
5601
+ heightPt: o,
5602
+ ...d ?? {},
5595
5603
  failClosedOnDuotoneFailure: !0,
5596
- tiff: i.tiff
5597
- }), a, c = {
5604
+ tiff: a.tiff
5605
+ }), s, c = {
5598
5606
  svgImagePath: r.svgImagePath,
5599
- srcRect: d ? !0 : null
5607
+ srcRect: u ? !0 : null
5600
5608
  };
5601
- if (!r.duotone && A(c)) try {
5602
- a = await I(c.svgImagePath, n, {
5603
- ...f ?? {},
5604
- workerDecoder: i.svgDecoder
5609
+ if (!r.duotone && J(c)) try {
5610
+ s = await H(c.svgImagePath, e, {
5611
+ ...d ?? {},
5612
+ workerDecoder: a.svgDecoder
5605
5613
  });
5606
5614
  } catch {
5607
- a = await t();
5615
+ s = await n();
5608
5616
  }
5609
- else a = await t();
5610
- S.set(e, a);
5611
- } catch (t) {
5612
- if (a(t, "tiff")) {
5613
- S.set(e, null);
5617
+ else s = await n();
5618
+ C.set(t, s);
5619
+ } catch (e) {
5620
+ if (ue(e, "tiff")) {
5621
+ C.set(t, null);
5614
5622
  return;
5615
5623
  }
5616
- if (Re(t) || Je(t)) throw t;
5617
- S.set(e, null);
5624
+ if (Le(e) || qe(e)) throw e;
5625
+ C.set(t, null);
5618
5626
  }
5619
5627
  });
5620
- if (await Promise.all([...t, ...o]), c()) return e;
5628
+ if (await Promise.all([...n, ...i]), c()) return t;
5621
5629
  }
5622
5630
  }
5623
- for (let [n, r] of t.elements.entries()) {
5624
- if (c()) return e;
5625
- if (r.type === "shape") Ir(_, r, u, v, x, b, o ? (e) => o({
5626
- ...e,
5627
- elementIndex: n,
5628
- origin: t.elementSources?.[n]?.origin ?? "slide"
5629
- }) : void 0, i.fetchImage);
5630
- else if (r.type === "picture") await Zr(_, r, u, c, i.fetchImage, i.tiff, h, i.svgDecoder, g);
5631
- else if (r.type === "table") ni(_, r, u, x, b, o ? (e) => o({
5632
- ...e,
5633
- elementIndex: n,
5634
- origin: t.elementSources?.[n]?.origin ?? "slide"
5631
+ for (let [e, r] of n.elements.entries()) {
5632
+ if (c()) return t;
5633
+ if (r.type === "shape") Fr(v, r, u, y, S, x, o ? (t) => o({
5634
+ ...t,
5635
+ elementIndex: e,
5636
+ origin: n.elementSources?.[e]?.origin ?? "slide"
5637
+ }) : void 0, a.fetchImage);
5638
+ else if (r.type === "picture") await Xr(v, r, u, c, a.fetchImage, a.tiff, h, a.svgDecoder, g);
5639
+ else if (r.type === "table") ti(v, r, u, S, x, o ? (t) => o({
5640
+ ...t,
5641
+ elementIndex: e,
5642
+ origin: n.elementSources?.[e]?.origin ?? "slide"
5635
5643
  }) : void 0);
5636
- else if (r.type === "media") await Qr(_, r, u, c, i.fetchMedia, i.skipMediaControls, i.fetchImage, i.tiff, h, i.svgDecoder, g);
5644
+ else if (r.type === "media") await Zr(v, r, u, c, a.fetchMedia, a.skipMediaControls, a.fetchImage, a.tiff, h, a.svgDecoder, g);
5637
5645
  else if (r.type === "chart") {
5638
- let e = J * u;
5639
- _.save(), ti(_, r, u), qe(_, r.chart, {
5640
- x: Y(r.x, u),
5641
- y: Y(r.y, u),
5642
- w: Y(r.width, u),
5643
- h: Y(r.height, u)
5644
- }, e, r.rotation, i.threeD, i.regionMap, (e) => S.get(Le(e)), i.chartEx), _.restore();
5646
+ let e = Y * u;
5647
+ v.save(), ei(v, r, u), Ke(v, r.chart, {
5648
+ x: X(r.x, u),
5649
+ y: X(r.y, u),
5650
+ w: X(r.width, u),
5651
+ h: X(r.height, u)
5652
+ }, e, r.rotation, a.threeD, a.regionMap, (e) => C.get(Ie(e)), a.chartEx), v.restore();
5645
5653
  }
5646
5654
  }
5647
- return c() || i.dim && ri(_, i.dim, d, f), e;
5655
+ return c() || a.dim && ni(v, a.dim, d, f), t;
5648
5656
  }
5649
5657
  //#endregion
5650
5658
  //#region packages/pptx/src/google-fonts.ts
5651
- var ui = {
5652
- ...T,
5653
- ...b
5659
+ var li = {
5660
+ ...S,
5661
+ ...c
5654
5662
  };
5655
- function* di(e) {
5663
+ function* ui(e) {
5656
5664
  for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
5657
5665
  }
5658
- function* fi(e) {
5666
+ function* di(e) {
5659
5667
  for (let t of e?.paragraphs ?? []) {
5660
5668
  t.defFontFamily && (yield t.defFontFamily);
5661
5669
  for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilySym && (yield e.fontFamilySym));
5662
5670
  }
5663
5671
  }
5664
- function* pi(e) {
5665
- for (let t of e.elements) if (t.type === "shape") yield* di(t.textBody);
5666
- else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* di(t.textBody);
5672
+ function* fi(e) {
5673
+ for (let t of e.elements) if (t.type === "shape") yield* ui(t.textBody);
5674
+ else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* ui(t.textBody);
5667
5675
  else if (t.type === "chart") {
5668
5676
  t.chart.title && (yield t.chart.title);
5669
5677
  for (let e of t.chart.categories) yield e;
5670
5678
  for (let e of t.chart.series) e.name && (yield e.name);
5671
5679
  }
5672
5680
  }
5673
- var mi = class e {
5681
+ var pi = class e {
5674
5682
  scripts;
5675
5683
  families;
5676
5684
  constructor(e, t, n, r) {
5677
5685
  this.majorFont = e, this.minorFont = t;
5678
- let i = w(e) ?? w(t) ?? null;
5679
- this.scripts = n ?? new pe(i), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
5686
+ let i = fe(e) ?? fe(t) ?? null;
5687
+ this.scripts = n ?? new d(i), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
5680
5688
  }
5681
5689
  addSlide(e) {
5682
- this.scripts.addText(pi(e));
5683
- for (let t of e.elements) if (t.type === "shape") for (let e of fi(t.textBody)) this.families.add(e);
5684
- else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of fi(t.textBody)) this.families.add(e);
5690
+ this.scripts.addText(fi(e));
5691
+ for (let t of e.elements) if (t.type === "shape") for (let e of di(t.textBody)) this.families.add(e);
5692
+ else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of di(t.textBody)) this.families.add(e);
5685
5693
  }
5686
5694
  names() {
5687
5695
  return [...this.families, ...this.scripts.names()];
@@ -5690,13 +5698,13 @@ var mi = class e {
5690
5698
  let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families));
5691
5699
  return n.addSlide(t), n;
5692
5700
  }
5693
- }, hi = Object.freeze({
5701
+ }, mi = Object.freeze({
5694
5702
  archiveEntryCount: 0,
5695
5703
  declaredInflatedBytes: 0,
5696
5704
  distinctInflatedBytes: 0,
5697
5705
  operationInflatedBytes: 0
5698
- }), gi = D;
5699
- function $(e, t) {
5706
+ }), hi = l;
5707
+ function gi(e, t) {
5700
5708
  if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
5701
5709
  }
5702
5710
  function _i(e, t) {
@@ -5729,7 +5737,7 @@ function yi(e) {
5729
5737
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
5730
5738
  let t = e;
5731
5739
  if (!Number.isSafeInteger(t.slideCount) || (t.slideCount ?? -1) < 0 || !Number.isSafeInteger(t.slideWidth) || (t.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(t.slideHeight) || (t.slideHeight ?? 0) <= 0 || !Array.isArray(t.embeddedFonts) || !Array.isArray(t.slides) || t.slides.length !== t.slideCount) throw Error("invalid PPTX presentation bootstrap dimensions or slide count");
5732
- return $(t.defaultTextColor, "defaultTextColor"), $(t.majorFont, "majorFont"), $(t.minorFont, "minorFont"), $(t.hlinkColor, "hlinkColor"), $(t.folHlinkColor, "folHlinkColor"), Object.freeze({
5740
+ return gi(t.defaultTextColor, "defaultTextColor"), gi(t.majorFont, "majorFont"), gi(t.minorFont, "minorFont"), gi(t.hlinkColor, "hlinkColor"), gi(t.folHlinkColor, "folHlinkColor"), Object.freeze({
5733
5741
  slideCount: t.slideCount,
5734
5742
  slideWidth: t.slideWidth,
5735
5743
  slideHeight: t.slideHeight,
@@ -5881,7 +5889,7 @@ function ki(e, t) {
5881
5889
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
5882
5890
  let n = e;
5883
5891
  if (!Number.isSafeInteger(n.slideCount) || (n.slideCount ?? -1) < 0 || !Number.isSafeInteger(n.slideWidth) || (n.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(n.slideHeight) || (n.slideHeight ?? 0) <= 0 || !Array.isArray(n.embeddedFonts) || !Array.isArray(n.slides) || (t ? n.slides.length > (n.slideCount ?? -1) : n.slides.length !== n.slideCount) || !Array.isArray(n.fontPreloadNames)) throw Error("invalid PPTX presentation preflight dimensions or slide count");
5884
- $(n.defaultTextColor, "defaultTextColor"), $(n.majorFont, "majorFont"), $(n.minorFont, "minorFont"), $(n.hlinkColor, "hlinkColor"), $(n.folHlinkColor, "folHlinkColor");
5892
+ gi(n.defaultTextColor, "defaultTextColor"), gi(n.majorFont, "majorFont"), gi(n.minorFont, "minorFont"), gi(n.hlinkColor, "hlinkColor"), gi(n.folHlinkColor, "folHlinkColor");
5885
5893
  let r = n.slides.map((e, t) => {
5886
5894
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight slide at ${t}`);
5887
5895
  let n = e;
@@ -5937,7 +5945,7 @@ function Ni(e, t) {
5937
5945
  });
5938
5946
  }
5939
5947
  function Pi(e, t, n) {
5940
- if (!(e <= t)) throw new N(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
5948
+ if (!(e <= t)) throw new ne(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
5941
5949
  stage: "parsing",
5942
5950
  violation: {
5943
5951
  format: "pptx",
@@ -5971,9 +5979,9 @@ var Fi = class {
5971
5979
  pending = null;
5972
5980
  finished = null;
5973
5981
  constructor(e, t = {}) {
5974
- let n = yi(e), r = t.hardLimitForTesting ?? gi;
5975
- if (!Number.isSafeInteger(r) || r <= 0 || r > gi) throw Error("invalid PPTX presentation preflight test limit");
5976
- this.limit = r, this.slideCountValue = n.slideCount, this.slideWidthValue = n.slideWidth, this.slideHeightValue = n.slideHeight, this.defaultTextColorValue = n.defaultTextColor, this.majorFontValue = n.majorFont, this.minorFontValue = n.minorFont, this.hlinkColorValue = n.hlinkColor, this.folHlinkColorValue = n.folHlinkColor, this.embeddedFontsValue = n.embeddedFonts, this.descriptors = [...n.slides], this.fonts = new mi(this.majorFontValue, this.minorFontValue), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = Ze(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = Ze({
5982
+ let n = yi(e), r = t.hardLimitForTesting ?? hi;
5983
+ if (!Number.isSafeInteger(r) || r <= 0 || r > hi) throw Error("invalid PPTX presentation preflight test limit");
5984
+ this.limit = r, this.slideCountValue = n.slideCount, this.slideWidthValue = n.slideWidth, this.slideHeightValue = n.slideHeight, this.defaultTextColorValue = n.defaultTextColor, this.majorFontValue = n.majorFont, this.minorFontValue = n.minorFont, this.hlinkColorValue = n.hlinkColor, this.folHlinkColorValue = n.folHlinkColor, this.embeddedFontsValue = n.embeddedFonts, this.descriptors = [...n.slides], this.fonts = new pi(this.majorFontValue, this.minorFontValue), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = Xe(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = Xe({
5977
5985
  slideCount: this.slideCountValue,
5978
5986
  slideWidth: this.slideWidthValue,
5979
5987
  slideHeight: this.slideHeightValue,
@@ -5986,7 +5994,7 @@ var Fi = class {
5986
5994
  remainingSlides: this.descriptors,
5987
5995
  slides: [],
5988
5996
  fontPreloadNames: this.fontPreloadNames
5989
- }, this.limit).jsonBytes, Pi(this.projectionBytesValue, this.limit, hi);
5997
+ }, this.limit).jsonBytes, Pi(this.projectionBytesValue, this.limit, mi);
5990
5998
  }
5991
5999
  get acceptedSlideCount() {
5992
6000
  return this.finished?.slideCount ?? this.slides.length;
@@ -6020,20 +6028,20 @@ var Fi = class {
6020
6028
  fontPreloadNames: this.fontPreloadNames
6021
6029
  });
6022
6030
  }
6023
- addSlide(e, t = hi) {
6031
+ addSlide(e, t = mi) {
6024
6032
  this.prepareSlide(e, t).commit();
6025
6033
  }
6026
- prepareSlide(e, t = hi) {
6034
+ prepareSlide(e, t = mi) {
6027
6035
  if (this.finished) throw Error("PPTX presentation preflight is already finished");
6028
6036
  if (this.pending) throw Error("PPTX presentation preflight already has a prepared slide");
6029
6037
  let n = this.slides.length, r = this.descriptors[n];
6030
6038
  if (!r) throw Error("PPTX presentation preflight received an extra slide");
6031
- let i = Ni(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = Ze(o, this.limit).jsonBytes, c = Ze(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.fontProjectionBytes - Ze(r, this.limit).jsonBytes + 4;
6032
- l = Qe(l, s, this.limit), l = Qe(l, c, this.limit), this.slides.length !== 0 && (l = Qe(l, 1, this.limit));
6033
- let u = Ze({
6039
+ let i = Ni(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = Xe(o, this.limit).jsonBytes, c = Xe(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.fontProjectionBytes - Xe(r, this.limit).jsonBytes + 4;
6040
+ l = Ze(l, s, this.limit), l = Ze(l, c, this.limit), this.slides.length !== 0 && (l = Ze(l, 1, this.limit));
6041
+ let u = Xe({
6034
6042
  slide: i,
6035
6043
  fontPreloadNames: o
6036
- }, this.limit).jsonBytes, d = Qe(this.projectionBytesValue, u, this.limit);
6044
+ }, this.limit).jsonBytes, d = Ze(this.projectionBytesValue, u, this.limit);
6037
6045
  Pi(Math.max(d, l), this.limit, t);
6038
6046
  let f = {
6039
6047
  state: "prepared",
@@ -6077,7 +6085,7 @@ var Fi = class {
6077
6085
  embeddedFonts: this.embeddedFontsValue,
6078
6086
  slides: Object.freeze([...this.slides]),
6079
6087
  fontPreloadNames: this.fontPreloadNames
6080
- }), this.descriptors = [], this.slides = [], this.projectionBytesValue = Ze(this.finished, this.limit).jsonBytes, this.finished;
6088
+ }), this.descriptors = [], this.slides = [], this.projectionBytesValue = Xe(this.finished, this.limit).jsonBytes, this.finished;
6081
6089
  }
6082
6090
  }, Ii = 1024 * 1024, Li = class {
6083
6091
  active = /* @__PURE__ */ new Set();
@@ -6092,9 +6100,9 @@ var Fi = class {
6092
6100
  sessionId: r,
6093
6101
  operationId: r,
6094
6102
  generation: this.options.generation ?? 1
6095
- }, a = new h(this.options.transport, {
6103
+ }, a = new L(this.options.transport, {
6096
6104
  ...i,
6097
- maxByteCredit: E,
6105
+ maxByteCredit: w,
6098
6106
  timeoutMs: n
6099
6107
  });
6100
6108
  this.active.add(a);
@@ -6136,7 +6144,7 @@ async function zi(e) {
6136
6144
  }
6137
6145
  }
6138
6146
  function Bi(e) {
6139
- return d(e, Ii, E);
6147
+ return u(e, Ii, w);
6140
6148
  }
6141
6149
  //#endregion
6142
- export { yi as a, ui as c, ci as d, on as f, Mi as i, ai as l, Ri as n, Ai as o, Fi as r, ji as s, Li as t, si as u };
6150
+ export { yi as a, li as c, si as d, an as f, Mi as i, ii as l, Ri as n, Ai as o, Fi as r, ji as s, Li as t, oi as u };