@silurus/ooxml 0.86.1 → 0.88.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 (72) hide show
  1. package/README.md +42 -2
  2. package/dist/assets/render-worker-1uPAxMZr.js +31 -0
  3. package/dist/assets/render-worker-BlvJybji.js +10 -0
  4. package/dist/assets/render-worker-CzmiJfFL.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-DN5SqWGS.js → canvas-viewer-mechanics-DbLz0rYW.js} +75 -66
  6. package/dist/chart-ex.mjs +581 -616
  7. package/dist/cjk-fallback-bLI3z70h.js +46 -0
  8. package/dist/comment-ui-runtime-BsK8pmUT.js +2 -0
  9. package/dist/{comment-ui-runtime-lXwVOgjW.js → comment-ui-runtime-CWGqn5Vr.js} +5 -5
  10. package/dist/{comment-ui-runtime-DEtgcmj7.js → comment-ui-runtime-DcJOYlw-.js} +5 -5
  11. package/dist/{comments-CAn2A_Xh.js → comments-Diid5ujN.js} +1 -1
  12. package/dist/{document-pull-client-uopDjRde.js → document-pull-client-B9PTM-pL.js} +4693 -4621
  13. package/dist/{docx-wPzeF76A.js → docx-BF9WXrYH.js} +503 -388
  14. package/dist/docx.mjs +6 -6
  15. package/dist/docx_parser_bg.wasm +0 -0
  16. package/dist/{dom-interaction-boundary-CswB9Tzi.js → dom-interaction-boundary-Cnm8DSBN.js} +22 -19
  17. package/dist/{hyperlink-BR1NCO7S.js → hyperlink-Cxzhet30.js} +842 -829
  18. package/dist/index.mjs +3 -3
  19. package/dist/{line-distribute-IsUGfHXm.js → line-distribute-D1WNHKz_.js} +2 -2
  20. package/dist/math.mjs +2 -2
  21. package/dist/node.mjs +356 -352
  22. package/dist/plot-area-frame-DLTYKHNP.js +4354 -0
  23. package/dist/{pptx-BxJ_RBSY.js → pptx-DkyYBYoL.js} +444 -435
  24. package/dist/pptx.mjs +7 -7
  25. package/dist/pptx_parser_bg.wasm +0 -0
  26. package/dist/region-map.mjs +5 -5
  27. package/dist/{render-DEiun_AH.js → render-D3iqVKCo.js} +31 -29
  28. package/dist/{render-worker-host-Ba6Fchqr.js → render-worker-host-B5wQfB7U.js} +1 -1
  29. package/dist/{render-worker-host-BEfLZvSL.js → render-worker-host-D4123J27.js} +1 -1
  30. package/dist/{render-worker-host-C3xwtHnv.js → render-worker-host-Di3LxLc0.js} +1 -1
  31. package/dist/renderer-B4GZb5We.js +6492 -0
  32. package/dist/{resource-measurement-CclArDRs.js → resource-measurement-SHQCbkh2.js} +3 -3
  33. package/dist/{session-BuJL_xcp.js → session-BGq81gRQ.js} +98 -98
  34. package/dist/{slide-pull-client-Ck8wfRT_.js → slide-pull-client-DiPnm240.js} +767 -738
  35. package/dist/{three-d-YYghQndN.js → three-d-DJBl8g8M.js} +251 -435
  36. package/dist/three-d.mjs +998 -906
  37. package/dist/tiff.mjs +2 -2
  38. package/dist/types/chart-ex.d.ts +142 -4
  39. package/dist/types/docx.d.ts +155 -13
  40. package/dist/types/index.d.ts +131 -19
  41. package/dist/types/math.d.ts +1 -1
  42. package/dist/types/node.d.ts +120 -8
  43. package/dist/types/pptx.d.ts +123 -13
  44. package/dist/types/region-map.d.ts +142 -4
  45. package/dist/types/three-d.d.ts +142 -4
  46. package/dist/types/tiff.d.ts +1 -1
  47. package/dist/types/xlsx.d.ts +155 -13
  48. package/dist/{worksheet-pull-client-CAvuf22q.js → worksheet-pull-client-BM8ywvbu.js} +51 -51
  49. package/dist/{xlsx-Bblm5r1h.js → xlsx-C9NVjgaV.js} +1592 -1564
  50. package/dist/xlsx.mjs +6 -6
  51. package/dist/xlsx_parser_bg.wasm +0 -0
  52. package/package.json +1 -1
  53. package/dist/assets/render-worker-D21h5TGR.js +0 -10
  54. package/dist/assets/render-worker-Dsfekaht.js +0 -11
  55. package/dist/assets/render-worker-DxU7IrKo.js +0 -31
  56. package/dist/comment-ui-runtime-TLHustXJ.js +0 -2
  57. package/dist/plot-area-frame-D5hEOgkJ.js +0 -2903
  58. package/dist/renderer-XFSCOT6m.js +0 -5857
  59. /package/dist/{bounded-raw-part-cache-BfbSxRIL.js → bounded-raw-part-cache-Cg1BsSZQ.js} +0 -0
  60. /package/dist/{comment-occurrence-CqejEuts.js → comment-occurrence-C8Y2uoVr.js} +0 -0
  61. /package/dist/{delimited-text-worker-host-DcHj_JZt.js → delimited-text-worker-host-BVY-Ecni.js} +0 -0
  62. /package/dist/{highlight-rect-FuUSmL3a.js → highlight-rect-C5hkRqUr.js} +0 -0
  63. /package/dist/{line-metrics-CBbw80Ko.js → line-metrics-B60C86uh.js} +0 -0
  64. /package/dist/{mathjax-DS69BmJd.js → mathjax-DoyWZbSp.js} +0 -0
  65. /package/dist/{pixel-budget-Dgjw269h.js → pixel-budget-9P63Bsk5.js} +0 -0
  66. /package/dist/{read-only-comment-decoration-BTnWEeo5.js → read-only-comment-decoration-Dz7eTQ4d.js} +0 -0
  67. /package/dist/{read-only-comment-margin-plStyGfE.js → read-only-comment-margin-DkgzASAl.js} +0 -0
  68. /package/dist/{renderer-module-contract-Cu-GKuPd.js → renderer-module-contract-D91rkYHH.js} +0 -0
  69. /package/dist/{source-key-Ktb1GRE5.js → source-key-DIJG8BA0.js} +0 -0
  70. /package/dist/{transfer-mIj7E7NB.js → transfer-p6iCC2R7.js} +0 -0
  71. /package/dist/{units-EJdC96r6.js → units-BzZ0gAxs.js} +0 -0
  72. /package/dist/{visible-index-DPoQYSDt.js → visible-index-BgiHEc1z.js} +0 -0
@@ -1,17 +1,13 @@
1
- import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Dt as s, E as c, Ft as l, Ht as u, It as d, Lt as f, M as p, Mt as m, Nt as h, Pt as g, Q as _, Rt as v, S as y, St as b, Tt as x, Vt as S, Wt as C, Xt as w, Yt as T, _ as E, a as D, b as O, bt as k, c as A, cn as j, ct as M, d as N, et as P, f as F, gt as I, h as L, ht as R, it as z, j as B, jt as V, k as H, kt as U, l as W, m as ee, n as G, nt as te, o as K, p as q, pt as J, q as ne, rt as re, st as ie, t as ae, tt as oe, u as se, ut as ce, wt as le, x as ue, xt as de, yt as fe, zt as pe } from "./hyperlink-BR1NCO7S.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-IsUGfHXm.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 Y } 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-CclArDRs.js";
10
- //#region packages/pptx/src/types.ts
11
- function $e(e) {
12
- return e;
13
- }
14
- var et = {
1
+ import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Dt as s, E as c, Ft as l, Gt as u, Ht as d, It as f, Kt as p, Lt as m, M as h, Mt as g, Nt as _, Pt as v, Q as y, Qt as b, Rt as x, S, St as C, Tt as w, Ut as T, Vt as E, Wt as D, Zt as O, _ as k, a as A, b as j, bt as M, c as N, ct as P, d as F, et as I, f as L, gt as R, h as z, ht as B, it as V, j as H, jt as U, k as W, kt as G, l as ee, m as K, n as q, nt as J, o as te, p as ne, pt as re, q as ie, rt as ae, st as oe, t as se, tt as ce, u as le, un as ue, ut as de, wt as fe, x as pe, xt as me, yt as he, zt as ge } from "./hyperlink-Cxzhet30.js";
2
+ import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, o as Ce, p as we, r as Te, s as Ee, t as De, u as Oe } from "./line-distribute-D1WNHKz_.js";
3
+ import { Ct as ke, Et as Ae, Pt as je, Tt as Me, a as Ne, at as Pe, bt as Fe, c as Ie, gt as Le, ht as Re, it as ze, l as Be, lt as Ve, n as He, ot as Ue, pt as We, rt as Ge } from "./plot-area-frame-DLTYKHNP.js";
4
+ import { r as Y } from "./units-BzZ0gAxs.js";
5
+ import { l as Ke } from "./pixel-budget-9P63Bsk5.js";
6
+ import { j as qe } from "./renderer-B4GZb5We.js";
7
+ import { D as Je, E as Ye, O as Xe } from "./three-d-DJBl8g8M.js";
8
+ import { s as Ze } from "./raster-target-ojDdQizC.js";
9
+ import { a as Qe, i as $e, n as et, t as tt } from "./resource-measurement-SHQCbkh2.js";
10
+ var nt = {
15
11
  textarchdown: {
16
12
  adj: [["adj", "val 0"]],
17
13
  gd: [
@@ -2393,22 +2389,22 @@ var et = {
2393
2389
  ]
2394
2390
  }]
2395
2391
  }
2396
- }, tt = Math.PI * 2 / 216e5, nt = et, rt = /* @__PURE__ */ new Map();
2397
- function it(e) {
2398
- return e.toLowerCase() in nt;
2392
+ }, rt = Math.PI * 2 / 216e5, it = nt, at = /* @__PURE__ */ new Map();
2393
+ function ot(e) {
2394
+ return e.toLowerCase() in it;
2399
2395
  }
2400
- function at(e) {
2401
- let t = rt.get(e);
2396
+ function st(e) {
2397
+ let t = at.get(e);
2402
2398
  if (t) return t;
2403
- let n = nt[e];
2399
+ let n = it[e];
2404
2400
  return n ? (t = {
2405
- adj: n.adj.map(([e, t]) => [e, h(t)]),
2406
- gd: n.gd.map(([e, t]) => [e, h(t)]),
2401
+ adj: n.adj.map(([e, t]) => [e, _(t)]),
2402
+ gd: n.gd.map(([e, t]) => [e, _(t)]),
2407
2403
  paths: n.paths
2408
- }, rt.set(e, t), t) : null;
2404
+ }, at.set(e, t), t) : null;
2409
2405
  }
2410
- var ot = 48;
2411
- function st(e, t, n, r) {
2406
+ var ct = 48;
2407
+ function lt(e, t, n, r) {
2412
2408
  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
2409
  for (let n of e.cmds) switch (n[0]) {
2414
2410
  case "m":
@@ -2425,8 +2421,8 @@ function st(e, t, n, r) {
2425
2421
  break;
2426
2422
  case "C": {
2427
2423
  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;
2424
+ for (let t = 1; t <= ct; t++) {
2425
+ let n = t / ct, 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
2426
  c.push({
2431
2427
  x: s,
2432
2428
  y: p
@@ -2437,8 +2433,8 @@ function st(e, t, n, r) {
2437
2433
  }
2438
2434
  case "Q": {
2439
2435
  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;
2436
+ for (let t = 1; t <= ct; t++) {
2437
+ let n = t / ct, 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
2438
  c.push({
2443
2439
  x: s,
2444
2440
  y: d
@@ -2448,9 +2444,9 @@ function st(e, t, n, r) {
2448
2444
  break;
2449
2445
  }
2450
2446
  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;
2447
+ let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * rt, f = t.resolve(n[4]) * rt, 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
2448
  _ > 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));
2449
+ let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(ct, Math.ceil(Math.abs(y) / m * 96));
2454
2450
  for (let e = 1; e <= S; e++) {
2455
2451
  let t = h + y * e / S;
2456
2452
  c.push({
@@ -2465,7 +2461,7 @@ function st(e, t, n, r) {
2465
2461
  }
2466
2462
  return c;
2467
2463
  }
2468
- function ct(e) {
2464
+ function ut(e) {
2469
2465
  let t = [0];
2470
2466
  for (let n = 1; n < e.length; n++) {
2471
2467
  let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
@@ -2473,23 +2469,23 @@ function ct(e) {
2473
2469
  }
2474
2470
  return t;
2475
2471
  }
2476
- function lt(e, t, n, r) {
2477
- let i = at(e.toLowerCase());
2472
+ function dt(e, t, n, r) {
2473
+ let i = st(e.toLowerCase());
2478
2474
  if (!i || i.paths.length === 0) return null;
2479
- let a = g({
2475
+ let a = v({
2480
2476
  w: n,
2481
2477
  h: r,
2482
2478
  adj: t
2483
- }, i.adj, i.gd), o = i.paths.length === 1, s = st(i.paths[0], a, n, r), c = o ? s : st(i.paths[i.paths.length - 1], a, n, r);
2479
+ }, i.adj, i.gd), o = i.paths.length === 1, s = lt(i.paths[0], a, n, r), c = o ? s : lt(i.paths[i.paths.length - 1], a, n, r);
2484
2480
  return {
2485
2481
  top: s,
2486
2482
  bottom: c,
2487
- topLen: ct(s),
2488
- bottomLen: ct(c),
2483
+ topLen: ut(s),
2484
+ bottomLen: ut(c),
2489
2485
  singleEdge: o
2490
2486
  };
2491
2487
  }
2492
- function ut(e, t, n) {
2488
+ function ft(e, t, n) {
2493
2489
  let r = t[t.length - 1];
2494
2490
  if (e.length === 1 || r === 0) return {
2495
2491
  x: e[0].x,
@@ -2510,17 +2506,17 @@ function ut(e, t, n) {
2510
2506
  ty: f / p
2511
2507
  };
2512
2508
  }
2513
- function dt(e) {
2509
+ function pt(e) {
2514
2510
  return e.topLen[e.topLen.length - 1] ?? 0;
2515
2511
  }
2516
- function ft(e, t) {
2512
+ function mt(e, t) {
2517
2513
  if (!e.singleEdge) return 1;
2518
- let n = dt(e);
2514
+ let n = pt(e);
2519
2515
  return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
2520
2516
  }
2521
- function pt(e, t, n, r) {
2517
+ function ht(e, t, n, r) {
2522
2518
  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);
2519
+ let i = ft(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
2524
2520
  return {
2525
2521
  x: i.x - o * c,
2526
2522
  y: i.y - s * c,
@@ -2529,7 +2525,7 @@ function pt(e, t, n, r) {
2529
2525
  shear: 0
2530
2526
  };
2531
2527
  }
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);
2528
+ let i = ft(e.top, e.topLen, t), a = ft(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
2529
  return {
2534
2530
  x: c,
2535
2531
  y: l,
@@ -2540,7 +2536,7 @@ function pt(e, t, n, r) {
2540
2536
  }
2541
2537
  //#endregion
2542
2538
  //#region packages/core/src/shape/scene3d-camera.ts
2543
- var mt = 26, ht = {
2539
+ var gt = 26, _t = {
2544
2540
  orthographicFront: {
2545
2541
  kind: "orthographic",
2546
2542
  baseLat: 0,
@@ -2553,52 +2549,52 @@ var mt = 26, ht = {
2553
2549
  baseLat: 0,
2554
2550
  baseLon: 0,
2555
2551
  baseRev: 0,
2556
- fovDeg: mt
2552
+ fovDeg: gt
2557
2553
  },
2558
2554
  perspectiveRelaxed: {
2559
2555
  kind: "perspective",
2560
2556
  baseLat: 0,
2561
2557
  baseLon: 0,
2562
2558
  baseRev: 0,
2563
- fovDeg: mt
2559
+ fovDeg: gt
2564
2560
  },
2565
2561
  perspectiveRelaxedModerately: {
2566
2562
  kind: "perspective",
2567
2563
  baseLat: 0,
2568
2564
  baseLon: 0,
2569
2565
  baseRev: 0,
2570
- fovDeg: mt
2566
+ fovDeg: gt
2571
2567
  },
2572
2568
  perspectiveAbove: {
2573
2569
  kind: "perspective",
2574
2570
  baseLat: -20,
2575
2571
  baseLon: 0,
2576
2572
  baseRev: 0,
2577
- fovDeg: mt
2573
+ fovDeg: gt
2578
2574
  },
2579
2575
  perspectiveBelow: {
2580
2576
  kind: "perspective",
2581
2577
  baseLat: 20,
2582
2578
  baseLon: 0,
2583
2579
  baseRev: 0,
2584
- fovDeg: mt
2580
+ fovDeg: gt
2585
2581
  },
2586
2582
  perspectiveLeft: {
2587
2583
  kind: "perspective",
2588
2584
  baseLat: 0,
2589
2585
  baseLon: -20,
2590
2586
  baseRev: 0,
2591
- fovDeg: mt
2587
+ fovDeg: gt
2592
2588
  },
2593
2589
  perspectiveRight: {
2594
2590
  kind: "perspective",
2595
2591
  baseLat: 0,
2596
2592
  baseLon: 20,
2597
2593
  baseRev: 0,
2598
- fovDeg: mt
2594
+ fovDeg: gt
2599
2595
  }
2600
2596
  };
2601
- function gt(e, t) {
2597
+ function vt(e, t) {
2602
2598
  let n = Array(9).fill(0);
2603
2599
  for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
2604
2600
  let a = 0;
@@ -2607,7 +2603,7 @@ function gt(e, t) {
2607
2603
  }
2608
2604
  return n;
2609
2605
  }
2610
- function _t(e) {
2606
+ function yt(e) {
2611
2607
  let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
2612
2608
  return [
2613
2609
  1,
@@ -2621,7 +2617,7 @@ function _t(e) {
2621
2617
  n
2622
2618
  ];
2623
2619
  }
2624
- function vt(e) {
2620
+ function bt(e) {
2625
2621
  let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
2626
2622
  return [
2627
2623
  n,
@@ -2635,7 +2631,7 @@ function vt(e) {
2635
2631
  n
2636
2632
  ];
2637
2633
  }
2638
- function yt(e) {
2634
+ function xt(e) {
2639
2635
  let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
2640
2636
  return [
2641
2637
  n,
@@ -2649,22 +2645,22 @@ function yt(e) {
2649
2645
  1
2650
2646
  ];
2651
2647
  }
2652
- function bt(e, t, n, r) {
2648
+ function St(e, t, n, r) {
2653
2649
  return [
2654
2650
  e[0] * t + e[1] * n + e[2] * r,
2655
2651
  e[3] * t + e[4] * n + e[5] * r,
2656
2652
  e[6] * t + e[7] * n + e[8] * r
2657
2653
  ];
2658
2654
  }
2659
- function xt(e, t) {
2655
+ function Ct(e, t) {
2660
2656
  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)));
2657
+ return vt(xt(-(t ? t.rev : e.baseRev)), vt(yt(-n), bt(-r)));
2662
2658
  }
2663
- function St(e) {
2664
- return ht[e] || (e.startsWith("perspective") ? ht.perspectiveFront : ht.orthographicFront);
2659
+ function wt(e) {
2660
+ return _t[e] || (e.startsWith("perspective") ? _t.perspectiveFront : _t.orthographicFront);
2665
2661
  }
2666
- function Ct(e, t, n) {
2667
- let r = St(e.prst), i = xt(r, e.rot);
2662
+ function Tt(e, t, n) {
2663
+ let r = wt(e.prst), i = Ct(r, e.rot);
2668
2664
  if (t <= 0 || n <= 0) return {
2669
2665
  corners: [
2670
2666
  {
@@ -2696,11 +2692,11 @@ function Ct(e, t, n) {
2696
2692
  if (r.kind === "perspective") {
2697
2693
  let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
2698
2694
  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);
2695
+ let [n, r, o] = St(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
2700
2696
  return [n * c, r * c];
2701
2697
  });
2702
2698
  } else u = s.map(([e, t]) => {
2703
- let [n, r] = bt(i, e, t, 0);
2699
+ let [n, r] = St(i, e, t, 0);
2704
2700
  return [n, r];
2705
2701
  });
2706
2702
  u = u.map(([e, t]) => [e * c, t * c]);
@@ -2723,18 +2719,18 @@ function Ct(e, t, n) {
2723
2719
  isIdentity: _
2724
2720
  };
2725
2721
  }
2726
- function wt(e) {
2727
- let { isIdentity: t } = Ct(e, 1e3, 1e3);
2722
+ function Et(e) {
2723
+ let { isIdentity: t } = Tt(e, 1e3, 1e3);
2728
2724
  return !t;
2729
2725
  }
2730
- function Tt(e, t, n, r) {
2731
- let i = St(e.prst), a = xt(i, e.rot);
2726
+ function Dt(e, t, n, r) {
2727
+ let i = wt(e.prst), a = Ct(i, e.rot);
2732
2728
  if (t <= 0 || n <= 0 || r === 0) return {
2733
2729
  x: 0,
2734
2730
  y: 0
2735
2731
  };
2736
2732
  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);
2733
+ let [n, r, o] = St(a, 0, 0, t);
2738
2734
  if (i.kind === "perspective") {
2739
2735
  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
2736
  return [n * d * l, r * d * l];
@@ -2748,12 +2744,12 @@ function Tt(e, t, n, r) {
2748
2744
  }
2749
2745
  //#endregion
2750
2746
  //#region packages/core/src/shape/bevel-shading.ts
2751
- function Et(e, t) {
2747
+ function Ot(e, t) {
2752
2748
  if (t <= 0) return () => 1;
2753
2749
  let n = (e) => Math.max(0, Math.min(1, e / t));
2754
2750
  switch (e) {
2755
2751
  case "hardEdge": {
2756
- let e = Pt;
2752
+ let e = It;
2757
2753
  return (t) => {
2758
2754
  let r = Math.min(1, n(t) / e);
2759
2755
  return r * r * (3 - 2 * r);
@@ -2773,7 +2769,7 @@ function Et(e, t) {
2773
2769
  };
2774
2770
  }
2775
2771
  }
2776
- function Dt(e) {
2772
+ function kt(e) {
2777
2773
  let t = e.length, n = new Float64Array(t);
2778
2774
  if (t === 0) return n;
2779
2775
  let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
@@ -2791,7 +2787,7 @@ function Dt(e) {
2791
2787
  }
2792
2788
  return n;
2793
2789
  }
2794
- function Ot(e, t = 3) {
2790
+ function At(e, t = 3) {
2795
2791
  if (e <= 0) return Array(t).fill(1);
2796
2792
  let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
2797
2793
  r % 2 == 0 && r--;
@@ -2799,7 +2795,7 @@ function Ot(e, t = 3) {
2799
2795
  for (let e = 0; e < t; e++) s.push(e < o ? r : i);
2800
2796
  return s;
2801
2797
  }
2802
- function kt(e, t, n, r, i, a) {
2798
+ function jt(e, t, n, r, i, a) {
2803
2799
  let o = 1 / (2 * i + 1);
2804
2800
  if (a) for (let a = 0; a < r; a++) {
2805
2801
  let r = a * n, s = 0;
@@ -2820,29 +2816,29 @@ function kt(e, t, n, r, i, a) {
2820
2816
  }
2821
2817
  }
2822
2818
  }
2823
- function At(e, t, n, r) {
2819
+ function Mt(e, t, n, r) {
2824
2820
  let i = Float64Array.from(e);
2825
2821
  if (r <= 0 || t <= 0 || n <= 0) return i;
2826
2822
  let a = new Float64Array(t * n);
2827
- for (let e of Ot(r, 3)) {
2823
+ for (let e of At(r, 3)) {
2828
2824
  let r = Math.max(1, (e - 1) / 2);
2829
- kt(i, a, t, n, r, !0), kt(a, i, t, n, r, !1);
2825
+ jt(i, a, t, n, r, !0), jt(a, i, t, n, r, !1);
2830
2826
  }
2831
2827
  return i;
2832
2828
  }
2833
- function jt(e, t, n, r = 128) {
2829
+ function Nt(e, t, n, r = 128) {
2834
2830
  let i = new Float64Array(t * n);
2835
2831
  for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
2836
2832
  let a = new Float64Array(n);
2837
2833
  for (let e = 0; e < t; e++) {
2838
2834
  for (let r = 0; r < n; r++) a[r] = i[r * t + e];
2839
- let r = Dt(a);
2835
+ let r = kt(a);
2840
2836
  for (let a = 0; a < n; a++) i[a * t + e] = r[a];
2841
2837
  }
2842
2838
  let o = new Float64Array(t);
2843
2839
  for (let e = 0; e < n; e++) {
2844
2840
  for (let n = 0; n < t; n++) o[n] = i[e * t + n];
2845
- let n = Dt(o);
2841
+ let n = kt(o);
2846
2842
  for (let r = 0; r < t; r++) i[e * t + r] = n[r];
2847
2843
  }
2848
2844
  for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
@@ -2854,15 +2850,15 @@ function jt(e, t, n, r = 128) {
2854
2850
  for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
2855
2851
  return i;
2856
2852
  }
2857
- var Mt = .25, Nt = .35, Pt = .5;
2858
- function Ft(e, t, n, r, i, a) {
2853
+ var Pt = .25, Ft = .35, It = .5;
2854
+ function Lt(e, t, n, r, i, a) {
2859
2855
  let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
2860
2856
  if (t <= 0 || n <= 0) return {
2861
2857
  normals: o,
2862
2858
  bandMask: s,
2863
2859
  bandWeight: c
2864
2860
  };
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) => {
2861
+ let l = Nt(e, t, n), u = Ot(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = Mt(l, t, n, Math.max(1, r * Pt)), m = (e) => {
2866
2862
  let t = u(Math.max(0, e - .5));
2867
2863
  return u(e + .5) - t;
2868
2864
  };
@@ -2877,9 +2873,9 @@ function Ft(e, t, n, r, i, a) {
2877
2873
  o[a * 3 + 2] = 1;
2878
2874
  continue;
2879
2875
  }
2880
- let g = u / r, _ = 1 - Nt, v = 1;
2876
+ let g = u / r, _ = 1 - Ft, v = 1;
2881
2877
  if (g > _) {
2882
- let e = Math.min(1, (g - _) / Nt);
2878
+ let e = Math.min(1, (g - _) / Ft);
2883
2879
  v = 1 - e * e * (3 - 2 * e);
2884
2880
  }
2885
2881
  c[a] = v;
@@ -2894,7 +2890,7 @@ function Ft(e, t, n, r, i, a) {
2894
2890
  bandWeight: c
2895
2891
  };
2896
2892
  }
2897
- var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
2893
+ var Rt = 35 * Math.PI / 180, zt = 12 * Math.PI / 180, Bt = {
2898
2894
  t: {
2899
2895
  x: 0,
2900
2896
  y: -1
@@ -2928,22 +2924,22 @@ var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
2928
2924
  y: 1
2929
2925
  }
2930
2926
  };
2931
- function zt(e, t, n) {
2927
+ function Vt(e, t, n) {
2932
2928
  let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
2933
2929
  return {
2934
2930
  x: e * i - t * a,
2935
2931
  y: e * a + t * i
2936
2932
  };
2937
2933
  }
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);
2934
+ function Ht(e, t, n) {
2935
+ let r = Bt[t] ?? Bt.t;
2936
+ return n && n.rev && (r = Vt(r.x, r.y, n.rev)), Wt(r.x, r.y, Rt);
2941
2937
  }
2942
- function Vt(e) {
2938
+ function Ut(e) {
2943
2939
  let t = Math.hypot(e.x, e.y) || 1;
2944
- return Ht(-e.x / t, -e.y / t, Lt);
2940
+ return Wt(-e.x / t, -e.y / t, zt);
2945
2941
  }
2946
- function Ht(e, t, n) {
2942
+ function Wt(e, t, n) {
2947
2943
  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
2944
  return {
2949
2945
  x: o / l,
@@ -2951,7 +2947,7 @@ function Ht(e, t, n) {
2951
2947
  z: c / l
2952
2948
  };
2953
2949
  }
2954
- var Ut = 2, Wt = {
2950
+ var Gt = 2, Kt = {
2955
2951
  matte: {
2956
2952
  ambient: .62,
2957
2953
  diffuse: .45,
@@ -2964,8 +2960,8 @@ var Ut = 2, Wt = {
2964
2960
  specular: .35,
2965
2961
  shininess: 22
2966
2962
  }
2967
- }, Gt = .8;
2968
- function Kt(e) {
2963
+ }, qt = .8;
2964
+ function Jt(e) {
2969
2965
  switch (e) {
2970
2966
  case "plastic":
2971
2967
  case "metal":
@@ -2976,8 +2972,8 @@ function Kt(e) {
2976
2972
  default: return "matte";
2977
2973
  }
2978
2974
  }
2979
- function qt(e, t, n = !0) {
2980
- let r = Wt[e], i = {
2975
+ function Yt(e, t, n = !0) {
2976
+ let r = Kt[e], i = {
2981
2977
  light: t,
2982
2978
  material: e,
2983
2979
  ambient: r.ambient,
@@ -2985,9 +2981,9 @@ function qt(e, t, n = !0) {
2985
2981
  specular: r.specular,
2986
2982
  shininess: r.shininess
2987
2983
  };
2988
- return n && (i.fillLight = Vt(t), i.fillDiffuse = i.diffuse * Gt), i;
2984
+ return n && (i.fillLight = Ut(t), i.fillDiffuse = i.diffuse * qt), i;
2989
2985
  }
2990
- function Jt(e, t) {
2986
+ function Xt(e, t) {
2991
2987
  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
2988
  if (t.fillLight && t.fillDiffuse) {
2993
2989
  let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
@@ -3000,7 +2996,7 @@ function Jt(e, t) {
3000
2996
  }
3001
2997
  return Math.max(0, t.ambient + r + i + a);
3002
2998
  }
3003
- function Yt(e, t, n) {
2999
+ function Zt(e, t, n) {
3004
3000
  if (!e) return {
3005
3001
  x: 0,
3006
3002
  y: 0,
@@ -3015,16 +3011,16 @@ function Yt(e, t, n) {
3015
3011
  h: Math.max(0, o - i)
3016
3012
  };
3017
3013
  }
3018
- function Xt(e, t, n) {
3014
+ function Qt(e, t, n) {
3019
3015
  let r = e.canvas.width, i = e.canvas.height;
3020
3016
  if (r <= 0 || i <= 0) return;
3021
3017
  let a = t.widthPx;
3022
3018
  if (a < .75) return;
3023
- let { x: o, y: s, w: c, h: l } = Yt(n, r, i);
3019
+ let { x: o, y: s, w: c, h: l } = Zt(n, r, i);
3024
3020
  if (c <= 0 || l <= 0) return;
3025
3021
  let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
3026
3022
  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({
3023
+ let { bandMask: p, bandWeight: m, normals: h } = Lt(f, c, l, a, t.prst, t.heightPx), g = Yt(t.material, t.light), _ = Xt({
3028
3024
  x: 0,
3029
3025
  y: 0,
3030
3026
  z: 1
@@ -3035,13 +3031,13 @@ function Xt(e, t, n) {
3035
3031
  if (n <= 0) continue;
3036
3032
  let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
3037
3033
  t.bottom && (r = -r, i = -i);
3038
- let o = 1 + (Jt({
3034
+ let o = 1 + (Xt({
3039
3035
  x: r,
3040
3036
  y: i,
3041
3037
  z: a
3042
3038
  }, g) / _ - 1) * n, s = e * 4;
3043
3039
  if (o >= 1) {
3044
- let e = Math.min(1, (o - 1) * Ut);
3040
+ let e = Math.min(1, (o - 1) * Gt);
3045
3041
  for (let t = 0; t < 3; t++) {
3046
3042
  let n = Math.min(255, d[s + t] * o);
3047
3043
  d[s + t] = n + (255 - n) * e;
@@ -3050,12 +3046,12 @@ function Xt(e, t, n) {
3050
3046
  }
3051
3047
  e.putImageData(u, o, s);
3052
3048
  }
3053
- function Zt(e, t, n) {
3049
+ function $t(e, t, n) {
3054
3050
  let r = e.canvas.width, i = e.canvas.height;
3055
3051
  if (r <= 0 || i <= 0) return;
3056
3052
  let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
3057
3053
  if (s < .75) return;
3058
- let { x: c, y: l, w: u, h: d } = Yt(n, r, i);
3054
+ let { x: c, y: l, w: u, h: d } = Zt(n, r, i);
3059
3055
  if (u <= 0 || d <= 0) return;
3060
3056
  let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
3061
3057
  for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
@@ -3079,8 +3075,8 @@ function Zt(e, t, n) {
3079
3075
  }
3080
3076
  //#endregion
3081
3077
  //#region packages/core/src/text/underline.ts
3082
- function Qt(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 = _(u, l, s);
3078
+ function en(e, t, n, r, i, a, o, s = 1) {
3079
+ 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 = y(u, l, s);
3084
3080
  if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
3085
3081
  let n = l, i = l * 6;
3086
3082
  e.beginPath(), e.moveTo(t, u);
@@ -3101,14 +3097,14 @@ function Qt(e, t, n, r, i, a, o, s = 1) {
3101
3097
  }
3102
3098
  if (o === "dbl") {
3103
3099
  let n = l * 1.4, i = u - n / 2, a = u + n / 2;
3104
- e.beginPath(), e.moveTo(t, i + _(i, l, s)), e.lineTo(t + r, i + _(i, l, s)), e.moveTo(t, a + _(a, l, s)), e.lineTo(t + r, a + _(a, l, s)), e.stroke();
3100
+ e.beginPath(), e.moveTo(t, i + y(i, l, s)), e.lineTo(t + r, i + y(i, l, s)), e.moveTo(t, a + y(a, l, s)), e.lineTo(t + r, a + y(a, l, s)), e.stroke();
3105
3101
  return;
3106
3102
  }
3107
- e.setLineDash(Oe(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
3103
+ e.setLineDash(Fe(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
3108
3104
  }
3109
3105
  //#endregion
3110
3106
  //#region packages/core/src/text/highlight-box.ts
3111
- function $t(e, t) {
3107
+ function tn(e, t) {
3112
3108
  return {
3113
3109
  top: e - t * .85,
3114
3110
  height: t * 1.1
@@ -3116,7 +3112,7 @@ function $t(e, t) {
3116
3112
  }
3117
3113
  //#endregion
3118
3114
  //#region packages/core/src/text/justify-positions.ts
3119
- function en(e, t, n, r, i = 0) {
3115
+ function nn(e, t, n, r, i = 0) {
3120
3116
  let a = [], o = 0, s = 0;
3121
3117
  for (let c of t) a.push({
3122
3118
  text: e.slice(o, c).join(""),
@@ -3128,15 +3124,73 @@ function en(e, t, n, r, i = 0) {
3128
3124
  }), a;
3129
3125
  }
3130
3126
  //#endregion
3127
+ //#region packages/pptx/src/google-fonts.ts
3128
+ var rn = {
3129
+ ...p,
3130
+ ...m
3131
+ };
3132
+ function* an(e) {
3133
+ for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
3134
+ }
3135
+ function* on(e) {
3136
+ for (let t of e?.paragraphs ?? []) {
3137
+ t.defFontFamily && (yield t.defFontFamily);
3138
+ for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilySym && (yield e.fontFamilySym));
3139
+ }
3140
+ }
3141
+ function* sn(e) {
3142
+ for (let t of e.elements) if (t.type === "shape") yield* an(t.textBody);
3143
+ else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* an(t.textBody);
3144
+ else if (t.type === "chart") {
3145
+ t.chart.title && (yield t.chart.title);
3146
+ for (let e of t.chart.categories) yield e;
3147
+ for (let e of t.chart.series) e.name && (yield e.name);
3148
+ }
3149
+ }
3150
+ var cn = class e {
3151
+ scripts;
3152
+ families;
3153
+ constructor(e, t, n, r, i, a = /* @__PURE__ */ new Set()) {
3154
+ this.majorFont = e, this.minorFont = t, this.fallback = i, this.scriptNames = a;
3155
+ let o = E(e) ?? E(t) ?? i ?? null;
3156
+ this.scripts = n ?? new x(o), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
3157
+ }
3158
+ addSlide(e) {
3159
+ this.scripts.addText(sn(e));
3160
+ for (let t of u(sn(e), E(this.majorFont) ?? E(this.minorFont) ?? this.fallback ?? null)) this.scriptNames.add(t);
3161
+ for (let t of e.elements) if (t.type === "shape") for (let e of on(t.textBody)) this.families.add(e);
3162
+ else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of on(t.textBody)) this.families.add(e);
3163
+ }
3164
+ names() {
3165
+ return [...new Set([
3166
+ ...this.families,
3167
+ ...this.scripts.names(),
3168
+ ...this.scriptNames
3169
+ ])];
3170
+ }
3171
+ withSlide(t) {
3172
+ let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families), this.fallback, new Set(this.scriptNames));
3173
+ return n.addSlide(t), n;
3174
+ }
3175
+ };
3176
+ function ln(e, t, n, i) {
3177
+ return r(sn(e), E(t) ?? E(n) ?? i);
3178
+ }
3179
+ //#endregion
3180
+ //#region packages/pptx/src/types.ts
3181
+ function un(e) {
3182
+ return e;
3183
+ }
3184
+ //#endregion
3131
3185
  //#region packages/pptx/src/reflection-blur.ts
3132
- var tn = .5;
3133
- function nn(e, t) {
3186
+ var dn = .5;
3187
+ function fn(e, t) {
3134
3188
  if (!(t > 0) || !(e.h > 0)) return [{
3135
3189
  y: e.y,
3136
3190
  h: Math.max(0, e.h),
3137
3191
  radius: 0
3138
3192
  }];
3139
- let n = Math.max(4, Math.min(24, Math.ceil(t / tn) + 1)), r = e.y + e.h, i = [];
3193
+ let n = Math.max(4, Math.min(24, Math.ceil(t / dn) + 1)), r = e.y + e.h, i = [];
3140
3194
  for (let a = 0; a < n; a++) {
3141
3195
  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
3196
  i.push({
@@ -3147,20 +3201,20 @@ function nn(e, t) {
3147
3201
  }
3148
3202
  return i;
3149
3203
  }
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();
3204
+ function pn(e, t, n, r, i) {
3205
+ for (let a of fn(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
3206
  }
3153
3207
  //#endregion
3154
3208
  //#region packages/pptx/src/hyperlink.ts
3155
- function an(e, t) {
3209
+ function mn(e, t) {
3156
3210
  let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
3157
3211
  if (n === void 0 && r === void 0) return;
3158
3212
  if (r !== void 0) return {
3159
3213
  kind: "internal",
3160
3214
  ref: n ?? r
3161
3215
  };
3162
- let i = n, a = G(i);
3163
- return a !== null && ae.includes(a) ? {
3216
+ let i = n, a = q(i);
3217
+ return a !== null && se.includes(a) ? {
3164
3218
  kind: "external",
3165
3219
  url: i
3166
3220
  } : {
@@ -3170,7 +3224,7 @@ function an(e, t) {
3170
3224
  }
3171
3225
  //#endregion
3172
3226
  //#region packages/pptx/src/media-chrome.ts
3173
- function on(e, t, n, r, i, a) {
3227
+ function hn(e, t, n, r, i, a) {
3174
3228
  let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
3175
3229
  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
3230
  e.beginPath();
@@ -3184,18 +3238,18 @@ function on(e, t, n, r, i, a) {
3184
3238
  }
3185
3239
  //#endregion
3186
3240
  //#region packages/pptx/src/bidi-line.ts
3187
- var sn = (e) => {
3241
+ var gn = (e) => {
3188
3242
  let t = e.text;
3189
3243
  return typeof t == "string" ? t : void 0;
3190
- }, cn = (e) => "isTab" in e;
3191
- function ln(e) {
3244
+ }, _n = (e) => "isTab" in e;
3245
+ function vn(e) {
3192
3246
  for (let n of e) {
3193
- let e = sn(n);
3247
+ let e = gn(n);
3194
3248
  if (e !== void 0 && t(e)) return !0;
3195
3249
  }
3196
3250
  return !1;
3197
3251
  }
3198
- function un(e, t) {
3252
+ function yn(e, t) {
3199
3253
  let n = e.length;
3200
3254
  if (n === 0) return {
3201
3255
  order: [],
@@ -3204,14 +3258,14 @@ function un(e, t) {
3204
3258
  let r = "", i = Array(n), a;
3205
3259
  for (let t = 0; t < n; t++) {
3206
3260
  i[t] = r.length;
3207
- let n = sn(e[t]) ?? "";
3208
- if (r += n.length > 0 ? n : "", cn(e[t])) {
3261
+ let n = gn(e[t]) ?? "";
3262
+ if (r += n.length > 0 ? n : "", _n(e[t])) {
3209
3263
  for (a ??= []; a.length < r.length;) a.push(null);
3210
3264
  a[i[t]] = "S";
3211
3265
  }
3212
3266
  }
3213
3267
  if (a) for (; a.length < r.length;) a.push(null);
3214
- let { levels: o, paragraphLevel: s } = B().computeLevels(r, t ? "rtl" : "ltr", a), { order: c, segLevels: l } = H(o, s, i), u = Array(n);
3268
+ let { levels: o, paragraphLevel: s } = H().computeLevels(r, t ? "rtl" : "ltr", a), { order: c, segLevels: l } = W(o, s, i), u = Array(n);
3215
3269
  for (let e = 0; e < n; e++) u[e] = (l[e] & 1) == 1;
3216
3270
  return {
3217
3271
  order: c,
@@ -3220,7 +3274,7 @@ function un(e, t) {
3220
3274
  }
3221
3275
  //#endregion
3222
3276
  //#region packages/pptx/src/cjk-wrap.ts
3223
- function dn(e, t, n, r, i = 0, a = !1) {
3277
+ function bn(e, t, n, r, i = 0, a = !1) {
3224
3278
  if (e.length === 0) return 0;
3225
3279
  let o = t === 0, s = 0, l = t;
3226
3280
  for (let t of e) {
@@ -3236,16 +3290,16 @@ function dn(e, t, n, r, i = 0, a = !1) {
3236
3290
  }
3237
3291
  //#endregion
3238
3292
  //#region packages/pptx/src/text-justify.ts
3239
- var fn = (e) => /\s/.test(String.fromCodePoint(e));
3240
- function pn(e, t, n, r, a) {
3293
+ var xn = (e) => /\s/.test(String.fromCodePoint(e));
3294
+ function Sn(e, t, n, r, a) {
3241
3295
  if (r === "just" && a) return null;
3242
3296
  let o = t - n;
3243
3297
  if (o <= .5) return null;
3244
- let s = we(e, o, {
3298
+ let s = De(e, o, {
3245
3299
  firstContentSi: 0,
3246
3300
  lastDrawnSi: e.length,
3247
3301
  isGapChar: i,
3248
- isWhitespace: fn,
3302
+ isWhitespace: xn,
3249
3303
  seaClusterGaps: r === "thaiDist"
3250
3304
  });
3251
3305
  if (!s) return null;
@@ -3266,7 +3320,7 @@ function pn(e, t, n, r, a) {
3266
3320
  }
3267
3321
  //#endregion
3268
3322
  //#region packages/pptx/src/table-border-conflict.ts
3269
- function mn(e) {
3323
+ function Cn(e) {
3270
3324
  if (!e) return {
3271
3325
  r: 0,
3272
3326
  g: 0,
@@ -3283,37 +3337,37 @@ function mn(e) {
3283
3337
  b: parseInt(t.slice(4, 6), 16)
3284
3338
  };
3285
3339
  }
3286
- function hn(e) {
3287
- let t = mn(e);
3340
+ function wn(e) {
3341
+ let t = Cn(e);
3288
3342
  return .299 * t.r + .587 * t.g + .114 * t.b;
3289
3343
  }
3290
- function gn(e, t) {
3344
+ function Tn(e, t) {
3291
3345
  if (!e && !t) return null;
3292
3346
  if (!e) return t;
3293
3347
  if (!t) return e;
3294
3348
  if (e.width !== t.width) return e.width > t.width ? e : t;
3295
- let n = hn(e.color), r = hn(t.color);
3349
+ let n = wn(e.color), r = wn(t.color);
3296
3350
  return n === r || n < r ? e : t;
3297
3351
  }
3298
3352
  //#endregion
3299
3353
  //#region packages/pptx/src/smartart-fallback-contrast.ts
3300
- function _n(e) {
3301
- let t = ie(e.length === 8 ? e.slice(0, 6) : e);
3354
+ function En(e) {
3355
+ let t = oe(e.length === 8 ? e.slice(0, 6) : e);
3302
3356
  if (!t) return null;
3303
- let n = M(t[0], t[1], t[2]);
3357
+ let n = P(t[0], t[1], t[2]);
3304
3358
  if (e.length !== 8) return n;
3305
3359
  let r = Number.parseInt(e.slice(6, 8), 16);
3306
3360
  if (Number.isNaN(r)) return null;
3307
3361
  let i = r / 255;
3308
3362
  return i * n + (1 - i);
3309
3363
  }
3310
- function vn(e) {
3364
+ function Dn(e) {
3311
3365
  if (!e) return null;
3312
- if (e.fillType === "solid") return _n(e.color);
3366
+ if (e.fillType === "solid") return En(e.color);
3313
3367
  if (e.fillType === "gradient") {
3314
3368
  let t = e.stops.map((e) => ({
3315
3369
  p: Math.min(1, Math.max(0, e.position)),
3316
- l: _n(e.color)
3370
+ l: En(e.color)
3317
3371
  })).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
3318
3372
  if (t.length === 0) return null;
3319
3373
  let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
@@ -3322,18 +3376,18 @@ function vn(e) {
3322
3376
  }
3323
3377
  return null;
3324
3378
  }
3325
- function yn(e) {
3379
+ function On(e) {
3326
3380
  return e.name === "SmartArt" && e.id === void 0;
3327
3381
  }
3328
- function bn(e, t) {
3329
- let n = vn(e);
3382
+ function kn(e, t) {
3383
+ let n = Dn(e);
3330
3384
  if (n === null || n >= .5) return null;
3331
- let r = _n(t.replace(/^#/, ""));
3385
+ let r = En(t.replace(/^#/, ""));
3332
3386
  return r !== null && r >= .5 ? null : "#FFFFFF";
3333
3387
  }
3334
3388
  //#endregion
3335
3389
  //#region packages/pptx/src/tab-layout.ts
3336
- function xn(e, t, n, r, i, a = 0) {
3390
+ function An(e, t, n, r, i, a = 0) {
3337
3391
  let o = e.map((e) => e.width), s = (t) => {
3338
3392
  let n = 0;
3339
3393
  for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
@@ -3361,8 +3415,8 @@ function xn(e, t, n, r, i, a = 0) {
3361
3415
  }
3362
3416
  //#endregion
3363
3417
  //#region packages/pptx/src/vertical-text.ts
3364
- var Sn = () => !1;
3365
- function Cn(e, t, n) {
3418
+ var jn = () => !1;
3419
+ function Mn(e, t, n) {
3366
3420
  let r = e.textBaseline;
3367
3421
  e.textBaseline = "alphabetic";
3368
3422
  let i = e.measureText(t);
@@ -3370,7 +3424,7 @@ function Cn(e, t, n) {
3370
3424
  let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
3371
3425
  return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
3372
3426
  }
3373
- function wn(e, t) {
3427
+ function Nn(e, t) {
3374
3428
  let n = e.textAlign, r = e.textBaseline;
3375
3429
  e.textAlign = "center", e.textBaseline = "middle";
3376
3430
  let i = e.measureText(t);
@@ -3378,15 +3432,15 @@ function wn(e, t) {
3378
3432
  let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
3379
3433
  return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
3380
3434
  }
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;
3435
+ function Pn(e, t, n, r, i, a, o = "fill", s = jn) {
3436
+ let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Mn(e, t, i), f = 0;
3383
3437
  for (let o of t) {
3384
- let t = o.codePointAt(0) ?? 0, l = se(t), p = e.measureText(o).width + a, m = l === "Tr" ? A(t) : null, h = l === "Tr" && m === null && F(t), g = l === "U" || l === "Tu" || m !== null || h;
3385
- if (N(t) && s(t)) {
3438
+ let t = o.codePointAt(0) ?? 0, l = le(t), p = e.measureText(o).width + a, m = l === "Tr" ? N(t) : null, h = l === "Tr" && m === null && L(t), g = l === "U" || l === "Tu" || m !== null || h;
3439
+ if (F(t) && s(t)) {
3386
3440
  let t = n + f + p / 2;
3387
- e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", K(e, () => u(o, 0, 0)), e.restore();
3441
+ e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", te(e, () => u(o, 0, 0)), e.restore();
3388
3442
  } else if (g) {
3389
- let r = m === null && l === "Tu" ? W(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;
3443
+ let r = m === null && l === "Tu" ? ee(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? Nn(e, s) / i : 0;
3390
3444
  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
3445
  } else if (l === "Tr") {
3392
3446
  let t = n + f + p / 2;
@@ -3396,25 +3450,25 @@ function Tn(e, t, n, r, i, a, o = "fill", s = Sn) {
3396
3450
  }
3397
3451
  e.textAlign = c, e.textBaseline = l;
3398
3452
  }
3399
- function En(e, t, n, r, i, a, o = "fill") {
3400
- Tn(e, t, n, r, i, a, o, (t) => D(e, t));
3453
+ function Fn(e, t, n, r, i, a, o = "fill") {
3454
+ Pn(e, t, n, r, i, a, o, (t) => A(e, t));
3401
3455
  }
3402
3456
  //#endregion
3403
3457
  //#region packages/pptx/src/renderer.ts
3404
3458
  function X(e, t) {
3405
3459
  return e * t;
3406
3460
  }
3407
- function Dn(e, t, n, r) {
3408
- let i = Fe(Math.abs(e * n), Math.abs(t * n), r);
3461
+ function In(e, t, n, r) {
3462
+ let i = Ae(Math.abs(e * n), Math.abs(t * n), r);
3409
3463
  return i ? {
3410
3464
  targetWidthPx: i.width,
3411
3465
  targetHeightPx: i.height
3412
3466
  } : void 0;
3413
3467
  }
3414
3468
  function Z(e, t) {
3415
- return Xe(e, t);
3469
+ return $e(e, t);
3416
3470
  }
3417
- function On(e, t) {
3471
+ function Ln(e, t) {
3418
3472
  let n = e.targets.get(t);
3419
3473
  return n ? {
3420
3474
  targetWidthPx: n.width,
@@ -3422,11 +3476,11 @@ function On(e, t) {
3422
3476
  maxRetainedPixels: n.maxRetainedPixels
3423
3477
  } : void 0;
3424
3478
  }
3425
- function kn(e) {
3426
- return z(e) ? e.svgImagePath : e.imagePath;
3479
+ function Rn(e) {
3480
+ return V(e) ? e.svgImagePath : e.imagePath;
3427
3481
  }
3428
- function An(e, t, n, r) {
3429
- let i = $e(t.bullet);
3482
+ function zn(e, t, n, r) {
3483
+ let i = un(t.bullet);
3430
3484
  if (i.type !== "blip") return;
3431
3485
  let a;
3432
3486
  for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
@@ -3436,10 +3490,10 @@ function An(e, t, n, r) {
3436
3490
  let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
3437
3491
  return Math.max(1, s * Y * n * r);
3438
3492
  }
3439
- async function jn(e, t, n, r, i, a, o, s, c, l) {
3440
- let u = k(a), d = [], f = [], p = (e, t, n, r, i, a = 1, o = i) => {
3493
+ async function Bn(e, t, n, r, i, a, o, s, c, l) {
3494
+ let u = M(a), d = [], f = [], p = (e, t, n, r, i, a = 1, o = i) => {
3441
3495
  if (!(!t || !i)) {
3442
- if (le(r) && (u.resolution === "display" || u.strategy === "adaptive")) {
3496
+ if (fe(r) && (u.resolution === "display" || u.strategy === "adaptive")) {
3443
3497
  d.push({
3444
3498
  key: e,
3445
3499
  ...t,
@@ -3447,7 +3501,7 @@ async function jn(e, t, n, r, i, a, o, s, c, l) {
3447
3501
  });
3448
3502
  return;
3449
3503
  }
3450
- f.push(R(n, r, i, o).then((n) => n.dimensions && x(n.format, l !== void 0) ? {
3504
+ f.push(B(n, r, i, o).then((n) => n.dimensions && w(n.format, l !== void 0) ? {
3451
3505
  key: e,
3452
3506
  ...t,
3453
3507
  sourceWidthPx: n.dimensions.width,
@@ -3458,12 +3512,12 @@ async function jn(e, t, n, r, i, a, o, s, c, l) {
3458
3512
  }, m = e.background;
3459
3513
  if (m?.fillType === "image" && m.imagePath && !m.tile && !m.duotone) {
3460
3514
  let e = m.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), a = n * (1 - (e.t ?? 0) - (e.b ?? 0));
3461
- p(Z(m.imagePath, m.duotone), Dn(r, a, i, m.srcRect), m.imagePath, m.mimeType, o, 1);
3515
+ p(Z(m.imagePath, m.duotone), In(r, a, i, m.srcRect), m.imagePath, m.mimeType, o, 1);
3462
3516
  }
3463
- for (let t of e.elements) if (t.type === "picture") !(z(t) || t.mimeType === "image/svg+xml") && !t.duotone && p(Z(t.imagePath, t.duotone), Dn(X(t.width, r), X(t.height, r), i, t.srcRect), t.imagePath, t.mimeType, o, 1);
3517
+ for (let t of e.elements) if (t.type === "picture") !(V(t) || t.mimeType === "image/svg+xml") && !t.duotone && p(Z(t.imagePath, t.duotone), In(X(t.width, r), X(t.height, r), i, t.srcRect), t.imagePath, t.mimeType, o, 1);
3464
3518
  else if (t.type === "media" && t.posterPath) {
3465
- let e = s ? ti(s) : void 0;
3466
- p(Z(t.posterPath), Dn(X(t.width, r), X(t.height, r), i), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, c ?? e);
3519
+ let e = s ? ui(s) : void 0;
3520
+ p(Z(t.posterPath), In(X(t.width, r), X(t.height, r), i), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, c ?? e);
3467
3521
  } else if (t.type === "chart") {
3468
3522
  let e = {
3469
3523
  widthPt: t.width / Y,
@@ -3471,9 +3525,9 @@ async function jn(e, t, n, r, i, a, o, s, c, l) {
3471
3525
  targetWidthPx: X(t.width, r) * i,
3472
3526
  targetHeightPx: X(t.height, r) * i
3473
3527
  };
3474
- for (let n of Ee(t.chart)) {
3475
- let t = n.fill, r = De(n, e);
3476
- !(t.mimeType === "image/svg+xml" || z({
3528
+ for (let n of Ie(t.chart)) {
3529
+ let t = n.fill, r = Ne(n, e);
3530
+ !(t.mimeType === "image/svg+xml" || V({
3477
3531
  svgImagePath: t.svgImagePath,
3478
3532
  srcRect: n.hasSourceCrop ? !0 : null
3479
3533
  })) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && p(Z(t.imagePath, t.duotone), {
@@ -3482,10 +3536,10 @@ async function jn(e, t, n, r, i, a, o, s, c, l) {
3482
3536
  }, t.imagePath, t.mimeType, o, 1);
3483
3537
  }
3484
3538
  } else if (t.type === "shape" && t.textBody) for (let e of t.textBody.paragraphs) {
3485
- let n = $e(e.bullet);
3539
+ let n = un(e.bullet);
3486
3540
  if (n.type !== "blip") continue;
3487
- let a = An(t.textBody, e, r, i);
3488
- !a || !o || f.push(R(n.imagePath, n.mimeType, o).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && x(e.format, l !== void 0) ? {
3541
+ let a = zn(t.textBody, e, r, i);
3542
+ !a || !o || f.push(B(n.imagePath, n.mimeType, o).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && w(e.format, l !== void 0) ? {
3489
3543
  key: Z(n.imagePath),
3490
3544
  targetWidthPx: a * e.dimensions.width / e.dimensions.height,
3491
3545
  targetHeightPx: a,
@@ -3493,27 +3547,27 @@ async function jn(e, t, n, r, i, a, o, s, c, l) {
3493
3547
  sourceHeightPx: e.dimensions.height
3494
3548
  } : null).catch(() => null));
3495
3549
  }
3496
- return d.push(...(await Promise.all(f)).filter((e) => e !== null)), de(d, u);
3550
+ return d.push(...(await Promise.all(f)).filter((e) => e !== null)), me(d, u);
3497
3551
  }
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"));
3552
+ function Vn(e) {
3553
+ return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Ie(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => un(e.bullet).type === "blip"));
3500
3554
  }
3501
- var Q = ke;
3502
- function Nn(e, t, n, r, i, a, o) {
3503
- let { top: s, height: c } = $t(n, i);
3555
+ var Q = Re;
3556
+ function Hn(e, t, n, r, i, a, o) {
3557
+ let { top: s, height: c } = tn(n, i);
3504
3558
  e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
3505
3559
  }
3506
- function Pn(e, t, n, r, i, a, o = 0) {
3507
- return Ie(e, t, n, r, i, a, o);
3560
+ function Un(e, t, n, r, i, a, o = 0) {
3561
+ return Le(e, t, n, r, i, a, o);
3508
3562
  }
3509
- var Fn = /* @__PURE__ */ new WeakMap();
3510
- function In(e, t) {
3563
+ var Wn = /* @__PURE__ */ new WeakMap();
3564
+ function Gn(e, t) {
3511
3565
  let n = e.tinted.get(t);
3512
3566
  if (n) return n;
3513
- let r = te(e.raster, t);
3567
+ let r = J(e.raster, t);
3514
3568
  return e.tinted.set(t, r), r;
3515
3569
  }
3516
- function Ln(e) {
3570
+ function Kn(e) {
3517
3571
  let t = [], n = (e) => {
3518
3572
  if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
3519
3573
  nodes: e.nodes,
@@ -3524,13 +3578,13 @@ function Ln(e) {
3524
3578
  else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
3525
3579
  return t;
3526
3580
  }
3527
- async function Rn(e, t) {
3528
- let n = Ln(e);
3581
+ async function qn(e, t) {
3582
+ let n = Kn(e);
3529
3583
  if (n.length !== 0) {
3530
3584
  await t.loadMathJax();
3531
- for (let e of n) if (!Fn.has(e.nodes)) try {
3532
- let n = await t.mathMLToSvg(re(e.nodes, e.display)), r = await oe(n, "#000000");
3533
- Fn.set(e.nodes, {
3585
+ for (let e of n) if (!Wn.has(e.nodes)) try {
3586
+ let n = await t.mathMLToSvg(ae(e.nodes, e.display)), r = await ce(n, "#000000");
3587
+ Wn.set(e.nodes, {
3534
3588
  raster: r,
3535
3589
  widthEm: n.widthEm,
3536
3590
  ascentEm: n.ascentEm,
@@ -3540,14 +3594,14 @@ async function Rn(e, t) {
3540
3594
  } catch {}
3541
3595
  }
3542
3596
  }
3543
- function zn(e, t) {
3597
+ function Jn(e, t) {
3544
3598
  let n = (e) => t.embeddedFontAliases?.get(e.trim().toLowerCase()) ?? e;
3545
3599
  if (!e) return n(t.themeMinorFont ?? "sans-serif");
3546
3600
  if (e.startsWith("+")) return n(e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif");
3547
3601
  let r = e.split(",")[0].trim();
3548
3602
  return r ? n(r) : t.themeMinorFont ?? "sans-serif";
3549
3603
  }
3550
- var Bn = new Set([
3604
+ var Yn = new Set([
3551
3605
  "serif",
3552
3606
  "sans-serif",
3553
3607
  "monospace",
@@ -3555,11 +3609,11 @@ var Bn = new Set([
3555
3609
  "fantasy",
3556
3610
  "system-ui"
3557
3611
  ]);
3558
- function Vn(e) {
3559
- let t = S(e);
3612
+ function Xn(e) {
3613
+ let t = d(e);
3560
3614
  return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
3561
3615
  }
3562
- var Hn = {
3616
+ var Zn = {
3563
3617
  calibri: "Carlito",
3564
3618
  "calibri light": "Carlito",
3565
3619
  cambria: "Caladea",
@@ -3571,29 +3625,32 @@ var Hn = {
3571
3625
  "simplified arabic": "Noto Naskh Arabic",
3572
3626
  "arabic typesetting": "Noto Naskh Arabic",
3573
3627
  "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;
3628
+ }, Qn = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
3629
+ function $n(e) {
3630
+ if (Zn[e.toLowerCase()]?.includes("Arabic")) return !0;
3577
3631
  let t = e.toLowerCase();
3578
3632
  return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[؀-ۿ]/.test(t);
3579
3633
  }
3580
- function Gn(e) {
3634
+ function er(e) {
3581
3635
  return e.map((e) => `"${e}"`).join(", ");
3582
3636
  }
3583
- function Kn(e, t = e) {
3584
- let n = Vn(t), i = Hn[t.toLowerCase()], a = i ? `"${i}", ` : "", o = u(t), s = o ? `"${o}", ` : "";
3585
- if (Wn(t)) return `"${e}", ${a}${Un}, ${n}`;
3586
- let c = n === "serif" ? "serif" : "sans", f = r(t), p = f ? pe(f, c).filter((e) => e !== o) : [];
3587
- return `"${e}", ${a}${s}${p.length > 0 ? `${Gn(p)}, ` : ""}${`${Gn(c === "serif" ? d : l)}, `}${n}`;
3637
+ function tr(e, t = e, n) {
3638
+ let r = Xn(t), i = Zn[t.toLowerCase()], a = i ? `"${i}", ` : "", o = D(t), s = o ? `"${o}", ` : "";
3639
+ if ($n(t)) {
3640
+ let t = n ? ge(n, "sans") : [];
3641
+ return `"${e}", ${a}${Qn}, ${t.length ? `${er(t)}, ` : ""}${r}`;
3642
+ }
3643
+ let c = r === "serif" ? "serif" : "sans", u = E(t), d = u ?? n, p = d ? ge(d, c).filter((e) => e !== o) : [], m = p.length > 0 ? `${er(p)}, ` : "", h = `${er(c === "serif" ? f : l)}, `;
3644
+ return u ? `"${e}", ${a}${s}${m}${h}${r}` : `"${e}", ${a}${s}${h}${m}${r}`;
3588
3645
  }
3589
- function qn(e) {
3646
+ function nr(e) {
3590
3647
  return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
3591
3648
  }
3592
- function Jn(e) {
3649
+ function rr(e) {
3593
3650
  let t = e.toLowerCase();
3594
3651
  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
3652
  }
3596
- function Yn(e, t, n, r, i, a, o, s) {
3653
+ function ir(e, t, n, r, i, a, o, s) {
3597
3654
  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");
3598
3655
  if (!g || !_) return;
3599
3656
  _.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
@@ -3602,7 +3659,7 @@ function Yn(e, t, n, r, i, a, o, s) {
3602
3659
  let e = je(m, h), t = e?.getContext("2d");
3603
3660
  e && t && (b = e, x = t);
3604
3661
  }
3605
- b !== g && rn(x, g, {
3662
+ b !== g && pn(x, g, {
3606
3663
  x: n.x - u,
3607
3664
  y: v,
3608
3665
  w: n.w,
@@ -3629,14 +3686,27 @@ function Yn(e, t, n, r, i, a, o, s) {
3629
3686
  let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
3630
3687
  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
3688
  }
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)}`;
3689
+ function ar(e, t, n, r, i, a = "") {
3690
+ let o = t ? "italic " : "", s = Jn(r, i), c = i.embeddedFontAuthoredFamilies?.get(s) ?? s, u = rr(c), d = e ? "bold " : u ? `${u} ` : "", p = T(a) ? i.cjkFallback ?? E(i.themeMajorFont) ?? E(i.themeMinorFont) ?? void 0 : void 0;
3691
+ if (Yn.has(s)) {
3692
+ let e = p ? ge(p, s === "serif" ? "serif" : "sans") : [], t = s === "monospace" ? ["Courier New", "Liberation Mono"] : s === "serif" ? [
3693
+ ...f,
3694
+ "Times New Roman",
3695
+ "Liberation Serif"
3696
+ ] : [
3697
+ ...l,
3698
+ "Arial",
3699
+ "Helvetica",
3700
+ "Liberation Sans"
3701
+ ];
3702
+ return `${o}${d}${n}px ${e.length ? `${er([...t, ...e])}, ` : ""}${s}`;
3703
+ }
3704
+ return `${o}${d}${n}px ${tr(s, c, p)}`;
3635
3705
  }
3636
- function Zn(e) {
3637
- return e.bullet.type === "char" || e.bullet.type === "autoNum" || $e(e.bullet).type === "blip";
3706
+ function or(e) {
3707
+ return e.bullet.type === "char" || e.bullet.type === "autoNum" || un(e.bullet).type === "blip";
3638
3708
  }
3639
- function Qn(e, t, n) {
3709
+ function sr(e, t, n) {
3640
3710
  let r = null;
3641
3711
  for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
3642
3712
  r = e.fontSize;
@@ -3645,24 +3715,24 @@ function Qn(e, t, n) {
3645
3715
  let i = r ?? t.defFontSize ?? e.defaultFontSize ?? 18;
3646
3716
  return n.sizePts == null ? i * ((n.sizePct ?? 100) / 100) : n.sizePts;
3647
3717
  }
3648
- function $n(e, t) {
3718
+ function cr(e, t) {
3649
3719
  return e ? 0 : Math.max(0, t);
3650
3720
  }
3651
- var er = /^\p{Script_Extensions=Latin}$/u, tr = /^\p{L}$/u, nr = /^[\u0000-\u007f]*$/u;
3652
- function rr(e, t, n) {
3721
+ var lr = /^\p{Script_Extensions=Latin}$/u, ur = /^\p{L}$/u, dr = /^[\u0000-\u007f]*$/u;
3722
+ function fr(e, t, n) {
3653
3723
  let r = t.codePointAt(0);
3654
- if (r <= 127 && r !== 45 || tr.test(t)) return !1;
3655
- let i = y(r);
3656
- return i !== "HY" && i !== "HH" ? !1 : er.test(e) && er.test(n);
3724
+ if (r <= 127 && r !== 45 || ur.test(t)) return !1;
3725
+ let i = S(r);
3726
+ return i !== "HY" && i !== "HH" ? !1 : lr.test(e) && lr.test(n);
3657
3727
  }
3658
- function ir(e) {
3659
- if (!e.includes("-") && nr.test(e)) return [{
3728
+ function pr(e) {
3729
+ if (!e.includes("-") && dr.test(e)) return [{
3660
3730
  text: e,
3661
3731
  breakBefore: !1
3662
3732
  }];
3663
3733
  let t = [...e], n = [], r = 0;
3664
3734
  for (let e = 1; e + 1 < t.length; e++) {
3665
- if (!rr(t[e - 1], t[e], t[e + 1])) continue;
3735
+ if (!fr(t[e - 1], t[e], t[e + 1])) continue;
3666
3736
  let i = e + 1;
3667
3737
  n.push({
3668
3738
  text: t.slice(r, i).join(""),
@@ -3674,7 +3744,7 @@ function ir(e) {
3674
3744
  breakBefore: n.length > 0
3675
3745
  }), n;
3676
3746
  }
3677
- function ar(e) {
3747
+ function mr(e) {
3678
3748
  let t = [];
3679
3749
  for (let n = e.segments.length - 1; n >= 0 && t.length < 2; n--) {
3680
3750
  let r = e.segments[n];
@@ -3684,38 +3754,38 @@ function ar(e) {
3684
3754
  }
3685
3755
  return t;
3686
3756
  }
3687
- function or(e, t) {
3757
+ function hr(e, t) {
3688
3758
  return t != null && t !== 0 ? e * .65 : e;
3689
3759
  }
3690
- function sr(e, t, n, r, i, a, o) {
3760
+ function gr(e, t, n, r, i, a, o) {
3691
3761
  let s = (t.defaultFontSize ?? 18) * Y * a;
3692
3762
  for (let c of t.paragraphs) {
3693
- let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = $n(Zn(c), d), p = n - r - i - l - u - f, m = 0;
3763
+ let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = cr(or(c), d), p = n - r - i - l - u - f, m = 0;
3694
3764
  for (let n of c.runs) {
3695
3765
  if (n.type !== "text") continue;
3696
- let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = zn(n.fontFamily ?? c.defFontFamily ?? null, o);
3697
- e.font = Xn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, or(r, n.baseline ?? void 0), i, o);
3766
+ let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = Jn(n.fontFamily ?? c.defFontFamily ?? null, o);
3767
+ e.font = ar(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, hr(r, n.baseline ?? void 0), i, o, n.text);
3698
3768
  let l = (n.letterSpacing ?? 0) * Y * a;
3699
3769
  if (m += $(e, n.text, l), m > p) return !0;
3700
3770
  }
3701
3771
  }
3702
3772
  return !1;
3703
3773
  }
3704
- function cr(e) {
3774
+ function _r(e) {
3705
3775
  for (let t of e) if (i(t.codePointAt(0) ?? 0)) return !0;
3706
3776
  return !1;
3707
3777
  }
3708
- function lr(e) {
3778
+ function vr(e) {
3709
3779
  let t = 0;
3710
3780
  for (let n of e) t++;
3711
3781
  return t;
3712
3782
  }
3713
- var ur = /* @__PURE__ */ new WeakMap();
3714
- function dr(e) {
3715
- let t = ur.get(e);
3783
+ var yr = /* @__PURE__ */ new WeakMap();
3784
+ function br(e) {
3785
+ let t = yr.get(e);
3716
3786
  if (t != null) return t;
3717
3787
  let n = e, r = n.letterSpacing;
3718
- if (typeof r != "string") return ur.set(e, !1), !1;
3788
+ if (typeof r != "string") return yr.set(e, !1), !1;
3719
3789
  let i = !1;
3720
3790
  try {
3721
3791
  n.letterSpacing = "0px";
@@ -3730,11 +3800,11 @@ function dr(e) {
3730
3800
  n.letterSpacing = r;
3731
3801
  } catch {}
3732
3802
  }
3733
- return ur.set(e, i), i;
3803
+ return yr.set(e, i), i;
3734
3804
  }
3735
3805
  function $(e, t, n) {
3736
3806
  let r = e, i = r.letterSpacing;
3737
- if (n !== 0 && dr(e)) try {
3807
+ if (n !== 0 && br(e)) try {
3738
3808
  r.letterSpacing = `${n}px`;
3739
3809
  let i = e.measureText(t).width;
3740
3810
  if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
@@ -3743,10 +3813,10 @@ function $(e, t, n) {
3743
3813
  r.letterSpacing = i;
3744
3814
  } catch {}
3745
3815
  }
3746
- let a = Math.max(0, lr(t) - 1);
3816
+ let a = Math.max(0, vr(t) - 1);
3747
3817
  return e.measureText(t).width + n * a;
3748
3818
  }
3749
- function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3819
+ function xr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3750
3820
  themeMajorFont: null,
3751
3821
  themeMinorFont: null,
3752
3822
  dpr: 1
@@ -3762,19 +3832,19 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3762
3832
  let v = () => n - (h.length === 0 ? m : 0), y = { segments: [] }, b = 0, x = !1, S = t.rtl === !0, C = X(t.marR, s), w = (t.tabStops ?? []).map((e) => ({
3763
3833
  pos: X(e.pos, s),
3764
3834
  algn: e.algn
3765
- })), T = X(t.defTabSz ?? 914400, s), D = !1, k = [], A = 0, j = () => S ? C : c + (h.length === 0 ? m : 0), M = (e = 0) => {
3766
- let t = xn(e > 0 ? [...k, {
3835
+ })), T = X(t.defTabSz ?? 914400, s), E = !1, D = [], O = 0, A = () => S ? C : c + (h.length === 0 ? m : 0), M = (e = 0) => {
3836
+ let t = An(e > 0 ? [...D, {
3767
3837
  isTab: !1,
3768
3838
  width: e
3769
- }] : k, w, j(), Infinity, A, T), n = 0;
3839
+ }] : D, w, A(), Infinity, O, T), n = 0;
3770
3840
  for (let e of t) n += e;
3771
3841
  return n;
3772
3842
  }, N = (e) => {
3773
3843
  let t = v();
3774
- return Number.isFinite(t) ? D ? M(e) <= t : b + e <= t : !0;
3844
+ return Number.isFinite(t) ? E ? M(e) <= t : b + e <= t : !0;
3775
3845
  }, P = () => {
3776
3846
  let e = v();
3777
- if (!D) return e - b;
3847
+ if (!E) return e - b;
3778
3848
  if (!Number.isFinite(e)) return Infinity;
3779
3849
  if (M(0) >= e) return 0;
3780
3850
  let t = 0, n = e;
@@ -3784,16 +3854,16 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3784
3854
  }
3785
3855
  return t;
3786
3856
  }, F = (e = !1) => {
3787
- e && (y.endsWithBreak = !0), h.push(y), y = { segments: [] }, b = 0, D = !1, k = [], x = !1;
3857
+ e && (y.endsWithBreak = !0), h.push(y), y = { segments: [] }, b = 0, E = !1, D = [], x = !1;
3788
3858
  }, I = (t, n, r, i) => {
3789
3859
  e.font = n;
3790
3860
  let a = $(e, t, r), o = y.segments.at(-1);
3791
3861
  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;
3792
- }, R = (t, n, r, i, a, o, s, c) => {
3862
+ }, L = (t, n, r, i, a, o, s, c) => {
3793
3863
  if (!t) return;
3794
3864
  e.font = n;
3795
- 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?.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 && qn(e.hyperlink) === qn(v) && (l === 0 || e.sourceRunId === u), C = y.segments.at(-1), w = $(e, t, l);
3796
- 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({
3865
+ 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?.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 && nr(e.hyperlink) === nr(v) && (l === 0 || e.sourceRunId === u), C = y.segments.at(-1), w = $(e, t, l);
3866
+ 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, D.push({
3797
3867
  isTab: !1,
3798
3868
  width: w
3799
3869
  }), C && S(C)) C.text += t;
@@ -3821,14 +3891,14 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3821
3891
  hyperlink: v
3822
3892
  });
3823
3893
  }
3824
- }, z = () => {
3894
+ }, R = () => {
3825
3895
  let e = y.segments.at(-1);
3826
3896
  if (!e || e.math) return !1;
3827
3897
  let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
3828
3898
  if (t) e.text = t[1], n = t[2];
3829
3899
  else if (y.segments.length > 1) y.segments.pop(), n = e.text;
3830
3900
  else return !1;
3831
- return F(), R(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
3901
+ return F(), L(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
3832
3902
  strikeDouble: e.strikeDouble,
3833
3903
  letterSpacingPx: e.letterSpacingPx,
3834
3904
  underlineStyle: e.underlineStyle,
@@ -3847,8 +3917,8 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3847
3917
  continue;
3848
3918
  }
3849
3919
  if (m.type === "math") {
3850
- let e = Fn.get(m.nodes), t = m.fontSize == null ? r : m.fontSize * Y * s * d, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, o = e ? e.descentEm * t : 0;
3851
- (m.display && b > 0 || !N(n) && b > 0) && F(), k.push({
3920
+ let e = Wn.get(m.nodes), t = m.fontSize == null ? r : m.fontSize * Y * s * d, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, o = e ? e.descentEm * t : 0;
3921
+ (m.display && b > 0 || !N(n) && b > 0) && F(), D.push({
3852
3922
  isTab: !1,
3853
3923
  width: n
3854
3924
  }), y.segments.push({
@@ -3868,36 +3938,36 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3868
3938
  }), b += n, m.display && F();
3869
3939
  continue;
3870
3940
  }
3871
- let h = m.fontSize == null ? r : m.fontSize * Y * s * d, _ = or(h, m.baseline ?? void 0), S = zn(m.fontFamily ?? t.defFontFamily ?? null, p), C = m.fontFamilyEa ? zn(m.fontFamilyEa, p) : null, w = m.fontFamilySym ? zn(m.fontFamilySym, p) : null, T;
3941
+ let h = m.fontSize == null ? r : m.fontSize * Y * s * d, _ = hr(h, m.baseline ?? void 0), S = Jn(m.fontFamily ?? t.defFontFamily ?? null, p), C = m.fontFamilyEa ? Jn(m.fontFamilyEa, p) : null, w = m.fontFamilySym ? Jn(m.fontFamilySym, p) : null, T;
3872
3942
  T = m.color ? Q(m.color) : m.hyperlink && p.themeHlinkColor ? Q(p.themeHlinkColor) : a;
3873
- let j = m.bold ?? t.defBold ?? l, M = m.italic ?? t.defItalic ?? u, B = Xn(j, M, _, S, p), V = C ? Xn(j, M, _, C, p) : B;
3943
+ let A = m.bold ?? t.defBold ?? l, M = m.italic ?? t.defItalic ?? u, B = ar(A, M, _, S, p, m.text), V = C ? ar(A, M, _, C, p, m.text) : B;
3874
3944
  e.font = B;
3875
3945
  let H = m.caps, U = g.get(m) ?? m.text;
3876
3946
  (H === "all" || H === "small") && (U = U.toUpperCase());
3877
- let W = m.fieldType === "slidenum" && f !== void 0 ? String(f) : U, G = m.underline || m.hyperlink !== void 0, te = m.strikeDouble === !0, K = m.letterSpacing == null ? 0 : m.letterSpacing * Y * s, J = {
3878
- strikeDouble: te,
3879
- letterSpacingPx: K,
3947
+ let W = m.fieldType === "slidenum" && f !== void 0 ? String(f) : U, G = m.underline || m.hyperlink !== void 0, ee = m.strikeDouble === !0, q = m.letterSpacing == null ? 0 : m.letterSpacing * Y * s, J = {
3948
+ strikeDouble: ee,
3949
+ letterSpacingPx: q,
3880
3950
  underlineStyle: m.underlineStyle,
3881
3951
  underlineColor: m.underlineColor ? Q(m.underlineColor) : void 0,
3882
3952
  shadow: m.shadow,
3883
3953
  reflection: m.reflection,
3884
3954
  outline: m.outline,
3885
3955
  highlight: m.highlight ? Q(m.highlight) : void 0,
3886
- hyperlink: an(m.hyperlink),
3956
+ hyperlink: mn(m.hyperlink),
3887
3957
  sourceRunId: c,
3888
3958
  drawSizePx: _
3889
- }, ne = W.split(/(\s+)/).flatMap((e) => e ? /^\s+$/u.test(e) ? [{
3959
+ }, te = W.split(/(\s+)/).flatMap((e) => e ? /^\s+$/u.test(e) ? [{
3890
3960
  text: e,
3891
3961
  breakBefore: !1
3892
- }] : Number.isFinite(n) ? ir(e) : [{
3962
+ }] : Number.isFinite(n) ? pr(e) : [{
3893
3963
  text: e,
3894
3964
  breakBefore: !1
3895
3965
  }] : []);
3896
- for (let n of ne) {
3966
+ for (let n of te) {
3897
3967
  let r = n.text;
3898
3968
  if (!r) continue;
3899
3969
  if (/^\t+$/.test(r)) {
3900
- D || (e.font = B, A = e.measureText(" ").width);
3970
+ E || (e.font = B, O = e.measureText(" ").width);
3901
3971
  for (let e of r) y.segments.push({
3902
3972
  text: "",
3903
3973
  isTab: !0,
@@ -3906,32 +3976,32 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3906
3976
  color: T,
3907
3977
  underline: !1,
3908
3978
  strikethrough: !1
3909
- }), k.push({
3979
+ }), D.push({
3910
3980
  isTab: !0,
3911
3981
  width: 0
3912
3982
  });
3913
- D = !0;
3983
+ E = !0;
3914
3984
  continue;
3915
3985
  }
3916
3986
  e.font = B;
3917
- let a = I(r, B, K, c), s = /^\s+$/.test(r), l = /[-]/;
3918
- if (l.test(r) && (w != null || _e(S))) {
3987
+ let a = I(r, B, q, c), s = /^\s+$/.test(r), l = /[-]/;
3988
+ if (l.test(r) && (w != null || be(S))) {
3919
3989
  let t = w ?? S;
3920
3990
  for (let n of r) {
3921
3991
  let r = n, i = B;
3922
3992
  if (l.test(n)) {
3923
- let e = xe(n, t);
3924
- e === n ? i = Xn(j, M, _, t, p) : (r = e, i = Xn(j, M, _, "sans-serif", p));
3993
+ let e = we(n, t);
3994
+ e === n ? i = ar(A, M, _, t, p, r) : (r = e, i = ar(A, M, _, "sans-serif", p, r));
3925
3995
  }
3926
- e.font = i, !N(I(r, i, K, c)) && b > 0 && F(), R(r, i, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
3996
+ e.font = i, !N(I(r, i, q, c)) && b > 0 && F(), L(r, i, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
3927
3997
  }
3928
3998
  continue;
3929
3999
  }
3930
- if (cr(r) && (!q(r) || t.eaLnBrk === !1)) {
4000
+ if (_r(r) && (!ne(r) || t.eaLnBrk === !1)) {
3931
4001
  let n = [], a = "", s = () => {
3932
4002
  a !== "" && (e.font = B, n.push({
3933
4003
  ch: a,
3934
- w: $(e, a, K),
4004
+ w: $(e, a, q),
3935
4005
  font: B
3936
4006
  }), a = "");
3937
4007
  };
@@ -3949,14 +4019,14 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3949
4019
  });
3950
4020
  }
3951
4021
  if (s(), t.eaLnBrk === !1) {
3952
- let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === c, r = n.reduce((e, t) => e + t.w, 0) + Math.max(0, n.length - 1) * K + (t && n.length > 0 ? K : 0);
4022
+ let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === c, r = n.reduce((e, t) => e + t.w, 0) + Math.max(0, n.length - 1) * q + (t && n.length > 0 ? q : 0);
3953
4023
  b > 0 && !N(r) && F();
3954
- for (let e of n) R(e.ch, e.font, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4024
+ for (let e of n) L(e.ch, e.font, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
3955
4025
  continue;
3956
4026
  }
3957
4027
  let l = n;
3958
4028
  for (; l.length > 0;) {
3959
- let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), n = !!t && !t.isTab && !t.math && t.sourceRunId === c, r = dn(l, e, v(), o, K, n);
4029
+ let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), n = !!t && !t.isTab && !t.math && t.sourceRunId === c, r = bn(l, e, v(), o, q, n);
3960
4030
  if (r === 0) {
3961
4031
  if (b > 0) {
3962
4032
  F();
@@ -3966,19 +4036,19 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3966
4036
  }
3967
4037
  for (let e = 0; e < r; e++) {
3968
4038
  let t = l[e];
3969
- R(t.ch, t.font, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4039
+ L(t.ch, t.font, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
3970
4040
  }
3971
4041
  l = l.slice(r), l.length > 0 && F();
3972
4042
  }
3973
4043
  continue;
3974
4044
  }
3975
- if (q(r)) {
3976
- let t = O(r, {
4045
+ if (ne(r)) {
4046
+ let t = j(r, {
3977
4047
  cjk: !0,
3978
4048
  kinsoku: o
3979
4049
  }), n = C != null && V !== B, a = (e) => n && i(e.codePointAt(0) ?? 0), s = (t) => {
3980
4050
  let n = 0, r = y.segments.at(-1), i = !!r && !r.isTab && !r.math && r.sourceRunId === c, o = "", s = null, l = () => {
3981
- o !== "" && (e.font = s ? V : B, n += $(e, o, K), i && (n += K), i = !0, o = "");
4051
+ o !== "" && (e.font = s ? V : B, n += $(e, o, q), i && (n += q), i = !0, o = "");
3982
4052
  };
3983
4053
  for (let e of t) {
3984
4054
  let t = a(e);
@@ -3987,57 +4057,57 @@ function fr(e, t, n, r, a, s, c, l = !1, u = !1, d = 1, f, p = {
3987
4057
  return l(), n;
3988
4058
  }, l = (e) => {
3989
4059
  let t = "", n = null, r = () => {
3990
- t !== "" && (R(t, n ? V : B, h, T, G, m.strikethrough, m.baseline ?? void 0, J), t = "");
4060
+ t !== "" && (L(t, n ? V : B, h, T, G, m.strikethrough, m.baseline ?? void 0, J), t = "");
3991
4061
  };
3992
4062
  for (let i of e) {
3993
4063
  let e = a(i);
3994
4064
  n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
3995
4065
  }
3996
4066
  r();
3997
- }, u = E(r), d = r.length, f = 0;
4067
+ }, u = k(r), d = r.length, f = 0;
3998
4068
  for (; f < d;) {
3999
- let e = P(), n = ee(r, t, f, e, s, u);
4069
+ let e = P(), n = K(r, t, f, e, s, u);
4000
4070
  if (n <= f) {
4001
4071
  if (b > 0) {
4002
4072
  F();
4003
4073
  continue;
4004
4074
  }
4005
- let i = t.find((e) => e > f) ?? d, a = r.slice(f, i), o = L(a), c = ee(a, o, 0, e, s, u);
4075
+ let i = t.find((e) => e > f) ?? d, a = r.slice(f, i), o = z(a), c = K(a, o, 0, e, s, u);
4006
4076
  c <= 0 && (c = o.length > 0 ? o[0] : a.length), n = f + c;
4007
4077
  }
4008
4078
  l(r.slice(f, n)), f = n, f < d && F();
4009
4079
  }
4010
4080
  continue;
4011
4081
  }
4012
- if (!N(a) && (b > 0 || D)) {
4082
+ if (!N(a) && (b > 0 || E)) {
4013
4083
  let e = n.breakBefore;
4014
4084
  if (!e) {
4015
- let t = ar(y), n = [...r][0];
4016
- e = t.length === 2 && n !== void 0 && rr(t[0], t[1], n);
4085
+ let t = mr(y), n = [...r][0];
4086
+ e = t.length === 2 && n !== void 0 && fr(t[0], t[1], n);
4017
4087
  }
4018
- e && (F(), a = I(r, B, K, c));
4088
+ e && (F(), a = I(r, B, q, c));
4019
4089
  }
4020
- if (N(a)) R(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J), s && (x = !0);
4090
+ if (N(a)) L(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J), s && (x = !0);
4021
4091
  else if (s) b > 0 && F();
4022
4092
  else if (a > v()) {
4023
4093
  b > 0 && F();
4024
- for (let t of r) e.font = B, !N(I(t, B, K, c)) && b > 0 && F(), R(t, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4094
+ for (let t of r) e.font = B, !N(I(t, B, q, c)) && b > 0 && F(), L(t, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4025
4095
  } else if (x) {
4026
- let e = y.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, a = t !== void 0 && o.lineStartForbidden.has(t) && i, s = n !== void 0 && t !== void 0 && i && !q(e) && !q(r) && ue(n, t);
4027
- (a || s) && z() || F(), R(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4096
+ let e = y.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, a = t !== void 0 && o.lineStartForbidden.has(t) && i, s = n !== void 0 && t !== void 0 && i && !ne(e) && !ne(r) && pe(n, t);
4097
+ (a || s) && R() || F(), L(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4028
4098
  } else {
4029
4099
  let e = [...y.segments.at(-1)?.text ?? ""].at(-1)?.codePointAt(0), t = r.codePointAt(0);
4030
- e !== void 0 && t !== void 0 && i(e) !== i(t) && !ue(e, t) && b > 0 && F(), R(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4100
+ e !== void 0 && t !== void 0 && i(e) !== i(t) && !pe(e, t) && b > 0 && F(), L(r, B, h, T, G, m.strikethrough, m.baseline ?? void 0, J);
4031
4101
  }
4032
4102
  }
4033
4103
  }
4034
4104
  return h.push(y), h;
4035
4105
  }
4036
- async function pr(e, t, n, r, i, o, s, c, l, u) {
4106
+ async function Sr(e, t, n, r, i, o, s, c, l, u) {
4037
4107
  if (t && t.fillType === "image") {
4038
4108
  if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !s) return;
4039
4109
  try {
4040
- 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, Z(t.imagePath, t.duotone)) : void 0, b = t.tile ? await R(t.imagePath, t.mimeType, s) : void 0, x = await Ye(t.imagePath, t.mimeType, t.duotone, s, {
4110
+ 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 ? Ln(u, Z(t.imagePath, t.duotone)) : void 0, b = t.tile ? await B(t.imagePath, t.mimeType, s) : void 0, x = await Qe(t.imagePath, t.mimeType, t.duotone, s, {
4041
4111
  widthPt: n / i / Y,
4042
4112
  heightPt: r / i / Y,
4043
4113
  ...y ?? {},
@@ -4045,9 +4115,9 @@ async function pr(e, t, n, r, i, o, s, c, l, u) {
4045
4115
  svgDecoder: l
4046
4116
  });
4047
4117
  if (o() || !x) return;
4048
- e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? _r(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : Me(e, x, t.srcRect, h, g, _, v), e.restore();
4118
+ e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? Er(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : ke(e, x, t.srcRect, h, g, _, v), e.restore();
4049
4119
  } catch (t) {
4050
- if (b(t, "tiff")) {
4120
+ if (C(t, "tiff")) {
4051
4121
  a(e, "tiff", {
4052
4122
  x: 0,
4053
4123
  y: 0,
@@ -4056,14 +4126,14 @@ async function pr(e, t, n, r, i, o, s, c, l, u) {
4056
4126
  });
4057
4127
  return;
4058
4128
  }
4059
- if (Re(t) || Je(t)) throw t;
4129
+ if (Ke(t) || Ze(t)) throw t;
4060
4130
  }
4061
4131
  return;
4062
4132
  }
4063
- e.fillStyle = Pn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
4133
+ e.fillStyle = Un(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
4064
4134
  }
4065
- var mr = 9525;
4066
- function hr(e, t, n, r, i) {
4135
+ var Cr = 9525;
4136
+ function wr(e, t, n, r, i) {
4067
4137
  let a;
4068
4138
  a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
4069
4139
  let o;
@@ -4072,52 +4142,52 @@ function hr(e, t, n, r, i) {
4072
4142
  ay: o
4073
4143
  };
4074
4144
  }
4075
- function gr(e, t, n) {
4145
+ function Tr(e, t, n) {
4076
4146
  return {
4077
4147
  width: e * (n ? 1 - n.l - n.r : 1),
4078
4148
  height: t * (n ? 1 - n.t - n.b : 1)
4079
4149
  };
4080
4150
  }
4081
- function _r(e, t, n, r, i, a, o, s) {
4082
- let c = gr(s?.width ?? t.width, s?.height ?? t.height, o), l = c.width * mr * (n.sx ?? 1) * a, u = c.height * mr * (n.sy ?? 1) * a;
4151
+ function Er(e, t, n, r, i, a, o, s) {
4152
+ let c = Tr(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;
4083
4153
  if (!(l > 0) || !(u > 0)) return;
4084
4154
  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));
4085
4155
  if (!p) return;
4086
4156
  let m = p.getContext("2d");
4087
4157
  if (!m) return;
4088
4158
  let h = (e, n, r, i) => {
4089
- 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();
4159
+ m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1), ke(m, t, o, 0, 0, l, u), m.restore();
4090
4160
  };
4091
4161
  h(0, 0, !1, !1), d && h(l, 0, !0, !1), f && h(0, u, !1, !0), d && f && h(l, u, !0, !0);
4092
4162
  let g = e.createPattern(p, "repeat");
4093
4163
  if (!g) return;
4094
- let { ax: _, ay: v } = hr(n.algn ?? "tl", r, i, l, u), y = _ + X(n.tx ?? 0, a), b = v + X(n.ty ?? 0, a);
4164
+ let { ax: _, ay: v } = wr(n.algn ?? "tl", r, i, l, u), y = _ + X(n.tx ?? 0, a), b = v + X(n.ty ?? 0, a);
4095
4165
  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());
4096
4166
  }
4097
- function vr(e, t, n) {
4167
+ function Dr(e, t, n) {
4098
4168
  if (!t) return;
4099
4169
  let r = t.dir * Math.PI / 180, i = X(t.dist, n);
4100
4170
  e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
4101
4171
  }
4102
- function yr(e, t, n) {
4172
+ function Or(e, t, n) {
4103
4173
  t && (e.shadowColor = Q(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
4104
4174
  }
4105
- function br(e) {
4175
+ function kr(e) {
4106
4176
  e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
4107
4177
  }
4108
- var xr = 8, Sr = 1, Cr = 1, wr = 256;
4109
- function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4178
+ var Ar = 8, jr = 1, Mr = 1, Nr = 256;
4179
+ function Pr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4110
4180
  if (r <= 0) return;
4111
- 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(wr, Math.max(1, Math.round(b / xr))), S = (e) => Or(e, a, r, o, s, c, u, d), C = S(x), w = Ar(C, a, o, s, c, u, d, l, i, -g, _);
4112
- for (; w > Cr && x < wr;) {
4113
- let e = Math.min(wr, x * 2), t = S(e), n = Ar(t, a, o, s, c, u, d, l, i, -g, _);
4181
+ 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(Nr, Math.max(1, Math.round(b / Ar))), S = (e) => Lr(e, a, r, o, s, c, u, d), C = S(x), w = zr(C, a, o, s, c, u, d, l, i, -g, _);
4182
+ for (; w > Mr && x < Nr;) {
4183
+ let e = Math.min(Nr, x * 2), t = S(e), n = zr(t, a, o, s, c, u, d, l, i, -g, _);
4114
4184
  if (n >= w * .75) {
4115
4185
  C = t;
4116
4186
  break;
4117
4187
  }
4118
4188
  x = e, C = t, w = n;
4119
4189
  }
4120
- let T = 1e4, E = Sr / (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) => {
4190
+ let T = 1e4, E = jr / (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) => {
4121
4191
  e.fillStyle = r;
4122
4192
  for (let r = 0; r <= D; r++) {
4123
4193
  let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
@@ -4125,7 +4195,7 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4125
4195
  let c = O(r, i, s), u = k(r, a, s);
4126
4196
  e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
4127
4197
  }
4128
- }, j = Er(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
4198
+ }, j = Fr(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
4129
4199
  if (j >= 1 && M >= 1) {
4130
4200
  A(e, m);
4131
4201
  return;
@@ -4145,7 +4215,7 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4145
4215
  [s, _],
4146
4216
  [c, _]
4147
4217
  ]) {
4148
- let n = kr(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;
4218
+ let n = Rr(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;
4149
4219
  o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
4150
4220
  }
4151
4221
  }
@@ -4155,57 +4225,57 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4155
4225
  A(e, m);
4156
4226
  return;
4157
4227
  }
4158
- 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, Dr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
4228
+ 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, Ir(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
4159
4229
  }
4160
- function Er(e) {
4230
+ function Fr(e) {
4161
4231
  let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
4162
4232
  if (!t) return 1;
4163
4233
  let n = parseFloat(t[1]);
4164
4234
  return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
4165
4235
  }
4166
- function Dr(e) {
4236
+ function Ir(e) {
4167
4237
  let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
4168
4238
  return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
4169
4239
  }
4170
- function Or(e, t, n, r, i, a, o, s) {
4240
+ function Lr(e, t, n, r, i, a, o, s) {
4171
4241
  let c = Array(e);
4172
4242
  for (let l = 0; l < e; l++) {
4173
4243
  let u = l / e * n, d = (l + 1) / e * n;
4174
4244
  c[l] = {
4175
4245
  s0: u,
4176
4246
  s1: d,
4177
- g: pt(t, (r + (u + d) / 2) / i * a, o, s)
4247
+ g: ht(t, (r + (u + d) / 2) / i * a, o, s)
4178
4248
  };
4179
4249
  }
4180
4250
  return c;
4181
4251
  }
4182
- function kr(e, t, n, r) {
4252
+ function Rr(e, t, n, r) {
4183
4253
  let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
4184
4254
  return {
4185
4255
  x: e.x + s * o - c * a,
4186
4256
  y: e.y + c * o + s * a
4187
4257
  };
4188
4258
  }
4189
- function Ar(e, t, n, r, i, a, o, s, c, l, u) {
4259
+ function zr(e, t, n, r, i, a, o, s, c, l, u) {
4190
4260
  let d = 0;
4191
4261
  for (let f of e) {
4192
4262
  let e = (f.s0 + f.s1) / 2;
4193
4263
  for (let p of [f.s0, f.s1]) {
4194
- let m = pt(t, (n + p) / r * i, a, o);
4264
+ let m = ht(t, (n + p) / r * i, a, o);
4195
4265
  for (let t of [l, u]) {
4196
- let n = kr(m, s, 0, t), r = kr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
4266
+ let n = Rr(m, s, 0, t), r = Rr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
4197
4267
  i > d && (d = i);
4198
4268
  }
4199
4269
  }
4200
4270
  }
4201
4271
  return d;
4202
4272
  }
4203
- function jr(e, t, n, r, i, a, o, s, c, l, u) {
4204
- let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = lt(n, r, p, m);
4273
+ function Br(e, t, n, r, i, a, o, s, c, l, u) {
4274
+ let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = dt(n, r, p, m);
4205
4275
  if (!h) return;
4206
4276
  let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [], b = 0;
4207
4277
  for (let n of t.paragraphs) {
4208
- let t = n.defFontSize == null ? v : n.defFontSize * Y * c, r = fr(e, n, Infinity, t, n.defColor ? Q(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
4278
+ let t = n.defFontSize == null ? v : n.defFontSize * Y * c, r = xr(e, n, Infinity, t, n.defColor ? Q(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
4209
4279
  y.length > 0 && (b += (n.spaceBefore ?? 0) / 100 * Y * c);
4210
4280
  for (let e of r) {
4211
4281
  let r = e.segments.reduce((e, t) => Math.max(e, t.sizePx), 0) || t, i = n.spaceLine?.type === "pts" ? n.spaceLine.val * Y * c : r * 1.2 * (n.spaceLine ? n.spaceLine.val / 1e5 : 1);
@@ -4233,10 +4303,10 @@ function jr(e, t, n, r, i, a, o, s, c, l, u) {
4233
4303
  }
4234
4304
  e.font = t.font;
4235
4305
  let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
4236
- c += r.width + n * lr(t.text), l = Math.max(l, t.sizePx), r.actualBoundingBoxAscent > 0 && (u = Math.max(u, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (g = Math.max(g, r.actualBoundingBoxDescent));
4306
+ c += r.width + n * vr(t.text), l = Math.max(l, t.sizePx), r.actualBoundingBoxAscent > 0 && (u = Math.max(u, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (g = Math.max(g, r.actualBoundingBoxDescent));
4237
4307
  }
4238
4308
  if (c <= 0) continue;
4239
- let _ = h.singleEdge ? Math.max(0, E ? D - y[t].baseline : y[t].baseline - D) : 0, v = _ > 0 ? lt(n, r, p + 2 * _, m + 2 * _) ?? h : h, b = u + g > 0 ? u + g : l, x = h.singleEdge ? .8 : b > 0 ? u / b : .8, w = h.singleEdge ? 1 : p / c, T = h.singleEdge ? b : b / (s - o), O = ft(v, c), k = h.singleEdge ? (1 - O) * (a === "r" ? 1 : a === "ctr" ? .5 : 0) : 0, A = 0;
4309
+ let _ = h.singleEdge ? Math.max(0, E ? D - y[t].baseline : y[t].baseline - D) : 0, v = _ > 0 ? dt(n, r, p + 2 * _, m + 2 * _) ?? h : h, b = u + g > 0 ? u + g : l, x = h.singleEdge ? .8 : b > 0 ? u / b : .8, w = h.singleEdge ? 1 : p / c, T = h.singleEdge ? b : b / (s - o), O = mt(v, c), k = h.singleEdge ? (1 - O) * (a === "r" ? 1 : a === "ctr" ? .5 : 0) : 0, A = 0;
4240
4310
  for (let t of i.segments) {
4241
4311
  if (t.math) {
4242
4312
  A += t.math.width;
@@ -4247,17 +4317,17 @@ function jr(e, t, n, r, i, a, o, s, c, l, u) {
4247
4317
  for (let i of r) {
4248
4318
  let r = e.measureText(i).width + n, a = h.singleEdge ? x : o + x * (s - o);
4249
4319
  if (!h.singleEdge && r > 0) {
4250
- Tr(e, i, n, r, S(), h, A, c, O, w, T, a, d, f, t.color), A += r;
4320
+ Pr(e, i, n, r, S(), h, A, c, O, w, T, a, d, f, t.color), A += r;
4251
4321
  continue;
4252
4322
  }
4253
- let l = pt(v, k + (A + r / 2) / c * O, T, a);
4323
+ let l = ht(v, k + (A + r / 2) / c * O, T, a);
4254
4324
  l.x -= _, l.y -= _, 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), (w !== 1 || l.vScale !== 1) && e.scale(w, l.vScale), e.fillText(i, -r / 2 + n / 2, 0), e.restore(), A += r;
4255
4325
  }
4256
4326
  }
4257
4327
  }
4258
4328
  e.restore();
4259
4329
  }
4260
- function Mr(e, t, n, r, i, a, o) {
4330
+ function Vr(e, t, n, r, i, a, o) {
4261
4331
  let s = Math.min(r, i);
4262
4332
  switch (e) {
4263
4333
  case "rightarrow":
@@ -4287,17 +4357,17 @@ function Mr(e, t, n, r, i, a, o) {
4287
4357
  default: return null;
4288
4358
  }
4289
4359
  }
4290
- function Nr(e, t) {
4291
- return e.defaultTextColor ? Q(e.defaultTextColor) : t.smartArtFallbackTextColor != null && yn(e) ? t.smartArtFallbackTextColor : null;
4360
+ function Hr(e, t) {
4361
+ return e.defaultTextColor ? Q(e.defaultTextColor) : t.smartArtFallbackTextColor != null && On(e) ? t.smartArtFallbackTextColor : null;
4292
4362
  }
4293
- function Pr(e, t, n) {
4363
+ function Ur(e, t, n) {
4294
4364
  return {
4295
4365
  outerRotation: e,
4296
4366
  localFlipH: t,
4297
4367
  localFlipV: n
4298
4368
  };
4299
4369
  }
4300
- function Fr(e, t, n, r, i) {
4370
+ function Wr(e, t, n, r, i) {
4301
4371
  let a = [
4302
4372
  {
4303
4373
  x: t,
@@ -4326,7 +4396,7 @@ function Fr(e, t, n, r, i) {
4326
4396
  h: l - s
4327
4397
  };
4328
4398
  }
4329
- var Ir = {
4399
+ var Gr = {
4330
4400
  tl: [0, 0],
4331
4401
  t: [.5, 0],
4332
4402
  tr: [1, 0],
@@ -4337,15 +4407,15 @@ var Ir = {
4337
4407
  b: [.5, 1],
4338
4408
  br: [1, 1]
4339
4409
  };
4340
- function Lr(e, t, n) {
4410
+ function Kr(e, t, n) {
4341
4411
  return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
4342
4412
  }
4343
- function Rr(e, t, n, r, i, a) {
4344
- let [o, s] = Ir[a ?? "b"];
4345
- return Lr(e, t + o * r, n + s * i);
4413
+ function qr(e, t, n, r, i, a) {
4414
+ let [o, s] = Gr[a ?? "b"];
4415
+ return Kr(e, t + o * r, n + s * i);
4346
4416
  }
4347
- function zr(e, t, n, r, i, a, o, s) {
4348
- let c = Ct(e, i, a).corners, l = (o > 0 ? Ke(c, o / i, o / a) ?? c : c).map((e) => Lr(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, _] = Ir[s ?? "b"], v = Ue(c, g, _);
4417
+ function Jr(e, t, n, r, i, a, o, s) {
4418
+ let c = Tt(e, i, a).corners, l = (o > 0 ? Je(c, o / i, o / a) ?? c : c).map((e) => Kr(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, _] = Gr[s ?? "b"], v = Xe(c, g, _);
4349
4419
  return {
4350
4420
  bbox: {
4351
4421
  x: f,
@@ -4353,12 +4423,12 @@ function zr(e, t, n, r, i, a, o, s) {
4353
4423
  w: m - f,
4354
4424
  h: h - p
4355
4425
  },
4356
- anchor: v ? Lr(t, n + v.x, r + v.y) : Rr(t, n, r, i, a, s)
4426
+ anchor: v ? Kr(t, n + v.x, r + v.y) : qr(t, n, r, i, a, s)
4357
4427
  };
4358
4428
  }
4359
- function Br(e, t, n, r) {
4429
+ function Yr(e, t, n, r) {
4360
4430
  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);
4361
- if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || He(o, s).clamped) return e;
4431
+ if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || Ve(o, s).clamped) return e;
4362
4432
  let c = null;
4363
4433
  try {
4364
4434
  c = je(o, s);
@@ -4380,7 +4450,7 @@ function Br(e, t, n, r) {
4380
4450
  e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
4381
4451
  };
4382
4452
  }
4383
- function Vr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4453
+ function Xr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4384
4454
  let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
4385
4455
  a: 1,
4386
4456
  b: 0,
@@ -4395,14 +4465,14 @@ function Vr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4395
4465
  }, v = (e) => {
4396
4466
  h(e), u(e);
4397
4467
  }, y = !1;
4398
- 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 ? vr(e, t.shadow ?? null, o) : t.glow && yr(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) && br(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), We(e, v, i, t.innerShadow, s, d, f), e.restore());
4468
+ t.shadow && p ? (e.save(), e.setTransform(m), y = !ze(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), Pe(e, g, i, t.reflection, s, d, f), e.restore()), y ? Dr(e, t.shadow ?? null, o) : t.glow && Or(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Ue(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && kr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), Ge(e, v, i, t.innerShadow, s, d, f), e.restore());
4399
4469
  }
4400
- function Hr(e, t, n) {
4470
+ function Zr(e, t, n) {
4401
4471
  if (t === n || !Number.isFinite(e)) return e;
4402
4472
  let r = ((e + 180) % 360 + 360) % 360 - 180;
4403
4473
  return r > 90 ? r -= 180 : r < -90 && (r += 180), Object.is(r, -0) ? 0 : r;
4404
4474
  }
4405
- function Ur(e, t, r, i = "#000000", a, o = {
4475
+ function Qr(e, t, r, i = "#000000", a, o = {
4406
4476
  themeMajorFont: null,
4407
4477
  themeMinorFont: null,
4408
4478
  dpr: 1
@@ -4412,20 +4482,20 @@ function Ur(e, t, r, i = "#000000", a, o = {
4412
4482
  shapeId: t.id
4413
4483
  }) : s;
4414
4484
  if (f === 0 && t.textBody?.verticalAnchor === "b") {
4415
- if (t.stroke && (e.save(), si(e, t.stroke, r, {
4485
+ if (t.stroke && (e.save(), gi(e, t.stroke, r, {
4416
4486
  x: l,
4417
4487
  y: u,
4418
4488
  w: d,
4419
4489
  h: 1
4420
4490
  }, t.rotation), e.beginPath(), e.moveTo(l, u), e.lineTo(l + d, u), e.stroke(), e.restore()), t.textBody) {
4421
- let n = Nr(t, o);
4422
- Yr(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
4491
+ let n = Hr(t, o);
4492
+ ii(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
4423
4493
  }
4424
4494
  return;
4425
4495
  }
4426
- let h = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null;
4427
- if (h && d > 0 && f > 0) {
4428
- let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Xr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Zr(t.sp3d, h.camera, d, f, r, c), g = Pr(t.rotation, t.flipH, t.flipV);
4496
+ let m = t.scene3d && Et(t.scene3d.camera) ? t.scene3d : null;
4497
+ if (m && d > 0 && f > 0) {
4498
+ let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = ai(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), h = oi(t.sp3d, m.camera, d, f, r, c), g = Ur(t.rotation, t.flipH, t.flipV);
4429
4499
  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)));
4430
4500
  let _ = {
4431
4501
  ...t,
@@ -4448,21 +4518,21 @@ function Ur(e, t, r, i = "#000000", a, o = {
4448
4518
  ..._,
4449
4519
  fill: null,
4450
4520
  stroke: null
4451
- }, 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) => Qr(e, h.camera, l, u, d, f, (e) => {
4452
- Ur(e, t, r, i, a, o, void 0);
4521
+ }, 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) => si(e, m.camera, l, u, d, f, (e) => {
4522
+ Qr(e, t, r, i, a, o, void 0);
4453
4523
  }, n ? {
4454
4524
  bevels: p,
4455
- extrusion: m ?? void 0,
4525
+ extrusion: h ?? void 0,
4456
4526
  edgePadCss: b
4457
4527
  } : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
4458
4528
  if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
4459
- let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = zr(h.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Br((e) => {
4529
+ let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Jr(m.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Yr((e) => {
4460
4530
  s = S(e) || s;
4461
4531
  }, n, o.bbox, {
4462
4532
  w: e.canvas.width || 0,
4463
4533
  h: e.canvas.height || 0
4464
4534
  });
4465
- if (Vr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
4535
+ if (Xr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
4466
4536
  C(e), e.restore();
4467
4537
  return;
4468
4538
  }
@@ -4473,8 +4543,8 @@ function Ur(e, t, r, i = "#000000", a, o = {
4473
4543
  e.restore();
4474
4544
  }
4475
4545
  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)));
4476
- let g = t.geometry.toLowerCase(), _ = Pn(t.fill, e, l, u, d, f, t.rotation);
4477
- t.shadow || yr(e, t.glow ?? null, r);
4546
+ let h = t.geometry.toLowerCase(), _ = Un(t.fill, e, l, u, d, f, t.rotation);
4547
+ t.shadow || Or(e, t.glow ?? null, r);
4478
4548
  let v = new Set([
4479
4549
  "line",
4480
4550
  "straightconnector1",
@@ -4499,22 +4569,22 @@ function Ur(e, t, r, i = "#000000", a, o = {
4499
4569
  "accentbordercallout1",
4500
4570
  "accentbordercallout2",
4501
4571
  "accentbordercallout3"
4502
- ]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && V(g), S = (n, i, a = {
4572
+ ]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && U(h), S = (n, i, a = {
4503
4573
  x: l,
4504
4574
  y: u,
4505
4575
  w: d,
4506
4576
  h: f
4507
4577
  }) => {
4508
- let { x: o, y: s, w: c, h: p } = a, h = i ?? (n === e && o === l && s === u && c === d && p === f ? _ : Pn(t.fill, n, o, s, c, p, t.rotation)), v = i ? null : t.stroke ? () => {
4509
- si(n, t.stroke, r, {
4578
+ let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? _ : Un(t.fill, n, o, s, c, p, t.rotation)), v = i ? null : t.stroke ? () => {
4579
+ gi(n, t.stroke, r, {
4510
4580
  x: o,
4511
4581
  y: s,
4512
4582
  w: c,
4513
4583
  h: p
4514
4584
  }, t.rotation), n.stroke();
4515
- } : null, y = () => br(n);
4585
+ } : null, y = () => kr(n);
4516
4586
  if (x && !i) {
4517
- m(n, g, o, s, c, p, [
4587
+ g(n, h, o, s, c, p, [
4518
4588
  t.adj,
4519
4589
  t.adj2,
4520
4590
  t.adj3,
@@ -4523,11 +4593,11 @@ function Ur(e, t, r, i = "#000000", a, o = {
4523
4593
  t.adj6,
4524
4594
  t.adj7,
4525
4595
  t.adj8
4526
- ], h, v, y, b(g) ? { skipTrailingStroke: !0 } : void 0);
4596
+ ], m, v, y, b(h) ? { skipTrailingStroke: !0 } : void 0);
4527
4597
  return;
4528
4598
  }
4529
- n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Wr(n, t.custGeom, o, s, c, p) : he(n, g, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), h && g !== "arc" && (n.fillStyle = h, g === "donut" || g === "smileyface" || g === "frame" ? n.fill("evenodd") : n.fill(), i || y()), v && v();
4530
- }, 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 ? n(g, l, u, d, f, [
4599
+ n.beginPath(), t.custGeom && t.custGeom.length > 0 ? $r(n, t.custGeom, o, s, c, p) : ve(n, h, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), m && h !== "arc" && (n.fillStyle = m, h === "donut" || h === "smileyface" || h === "frame" ? n.fill("evenodd") : n.fill(), i || y()), v && v();
4600
+ }, 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 ? n(h, l, u, d, f, [
4531
4601
  t.adj,
4532
4602
  t.adj2,
4533
4603
  t.adj3,
@@ -4536,20 +4606,20 @@ function Ur(e, t, r, i = "#000000", a, o = {
4536
4606
  t.adj6,
4537
4607
  t.adj7,
4538
4608
  t.adj8
4539
- ]) : t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, l, u, d, f) : null : null) ?? {
4609
+ ]) : t.custGeom && t.custGeom.length > 0 ? ye(t.custGeom, l, u, d, f) : null : null) ?? {
4540
4610
  x: l,
4541
4611
  y: u,
4542
4612
  w: d,
4543
4613
  h: f
4544
- }, D = t.stroke ? t.stroke.width * r / 2 : 0, O = 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, k = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, A = Math.max(D, O, k), j = A > 0 ? {
4614
+ }, D = t.stroke ? t.stroke.width * r / 2 : 0, O = t.stroke ? Math.max(t.stroke.headEnd ? _e(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? _e(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 ? {
4545
4615
  x: E.x - A,
4546
4616
  y: E.y - A,
4547
4617
  w: E.w + A * 2,
4548
4618
  h: E.h + A * 2
4549
- } : E, M = Fr(C, j.x, j.y, j.w, j.h), N = r * T, P = h ? [] : Xr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, T), F = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, I = (e) => {
4550
- let n = t.stroke?.fill ? Pn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
4551
- if (t.stroke && (v.has(g) || y.has(g))) {
4552
- let i = U(g, l, u, d, f, [
4619
+ } : E, M = Wr(C, j.x, j.y, j.w, j.h), N = r * T, P = m ? [] : ai(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, T), F = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, I = (e) => {
4620
+ let n = t.stroke?.fill ? Un(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
4621
+ if (t.stroke && (v.has(h) || y.has(h))) {
4622
+ let i = G(h, l, u, d, f, [
4553
4623
  t.adj,
4554
4624
  t.adj2,
4555
4625
  t.adj3,
@@ -4560,21 +4630,21 @@ function Ur(e, t, r, i = "#000000", a, o = {
4560
4630
  t.adj8
4561
4631
  ]);
4562
4632
  if (!i) return;
4563
- let a = t.stroke.cmpd, o = g === "line" || g === "straightconnector1";
4564
- if (b(g) && i.vertices.length >= 2 && !(a && o)) {
4633
+ let a = t.stroke.cmpd, o = h === "line" || h === "straightconnector1";
4634
+ if (b(h) && i.vertices.length >= 2 && !(a && o)) {
4565
4635
  let n = i.vertices.map((e) => ({
4566
4636
  x: e.x,
4567
4637
  y: e.y
4568
4638
  }));
4569
4639
  if (t.stroke.tailEnd) {
4570
- let e = be(t.stroke.tailEnd, t.stroke, r);
4571
- n[n.length - 1] = Ce(n[n.length - 1], n[n.length - 2], e);
4640
+ let e = Ce(t.stroke.tailEnd, t.stroke, r);
4641
+ n[n.length - 1] = Ee(n[n.length - 1], n[n.length - 2], e);
4572
4642
  }
4573
4643
  if (t.stroke.headEnd) {
4574
- let e = be(t.stroke.headEnd, t.stroke, r);
4575
- n[0] = Ce(n[0], n[1], e);
4644
+ let e = Ce(t.stroke.headEnd, t.stroke, r);
4645
+ n[0] = Ee(n[0], n[1], e);
4576
4646
  }
4577
- si(e, t.stroke, r, {
4647
+ gi(e, t.stroke, r, {
4578
4648
  x: l,
4579
4649
  y: u,
4580
4650
  w: d,
@@ -4583,26 +4653,26 @@ function Ur(e, t, r, i = "#000000", a, o = {
4583
4653
  for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
4584
4654
  e.stroke();
4585
4655
  }
4586
- a && o && oi(e, i.start, i.end, t.stroke, a, r, t.rotation), t.stroke.tailEnd && ve(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, r, n), t.stroke.headEnd && ve(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, r, n);
4656
+ a && o && hi(e, i.start, i.end, t.stroke, a, r, t.rotation), t.stroke.tailEnd && xe(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, r, n), t.stroke.headEnd && xe(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, r, n);
4587
4657
  return;
4588
4658
  }
4589
4659
  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;
4590
- let { start: i, end: a } = ye(t.custGeom);
4591
- i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ve(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" && ve(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.tailEnd, t.stroke, r, n);
4660
+ let { start: i, end: a } = Se(t.custGeom);
4661
+ i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && xe(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" && xe(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.tailEnd, t.stroke, r, n);
4592
4662
  }, L = (e) => {
4593
- if (P.length > 0 && $r(e, l, u, d, f, P, (e, t, n, r, i) => S(e, void 0, {
4663
+ if (P.length > 0 && ci(e, l, u, d, f, P, (e, t, n, r, i) => S(e, void 0, {
4594
4664
  x: t,
4595
4665
  y: n,
4596
4666
  w: r,
4597
4667
  h: i
4598
4668
  }), void 0, F)) {
4599
- I(e), br(e);
4669
+ I(e), kr(e);
4600
4670
  return;
4601
4671
  }
4602
4672
  S(e), I(e);
4603
4673
  };
4604
- if (Vr(e, t, L, L, M, Rr(C, l, u, d, f, t.shadow?.algn), r, N, C, !!_, (e) => S(e, "#000")), t.textBody) {
4605
- let n = Nr(t, o), s = Hr(t.rotation, t.flipH, t.flipV);
4674
+ if (Xr(e, t, L, L, M, qr(C, l, u, d, f, t.shadow?.algn), r, N, C, !!_, (e) => S(e, "#000")), t.textBody) {
4675
+ let n = Hr(t, o), s = Zr(t.rotation, t.flipH, t.flipV);
4606
4676
  if (e.save(), t.flipH || t.flipV) {
4607
4677
  let n = l + d / 2, r = u + f / 2;
4608
4678
  e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
@@ -4612,22 +4682,22 @@ function Ur(e, t, r, i = "#000000", a, o = {
4612
4682
  let t = l + d / 2, n = u + f / 2;
4613
4683
  e.translate(t, n), e.rotate(m * Math.PI / 180), e.translate(-t, -n);
4614
4684
  }
4615
- let h = l, _ = u, v = d, y = f;
4616
- if (t.textRect) h = X(t.textRect.x, r), _ = X(t.textRect.y, r), v = X(t.textRect.width, r), y = X(t.textRect.height, r);
4617
- else if (g === "ellipse") {
4685
+ let g = l, _ = u, v = d, y = f;
4686
+ if (t.textRect) g = X(t.textRect.x, r), _ = X(t.textRect.y, r), v = X(t.textRect.width, r), y = X(t.textRect.height, r);
4687
+ else if (h === "ellipse") {
4618
4688
  let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
4619
- h = l + e, _ = u + t, v = d / Math.SQRT2, y = f / Math.SQRT2;
4689
+ g = l + e, _ = u + t, v = d / Math.SQRT2, y = f / Math.SQRT2;
4620
4690
  } else {
4621
- let e = Mr(g, l, u, d, f, t.adj, t.adj2);
4622
- e && (h = e.tx, _ = e.ty, v = e.tw, y = e.th);
4691
+ let e = Vr(h, l, u, d, f, t.adj, t.adj2);
4692
+ e && (g = e.tx, _ = e.ty, v = e.tw, y = e.th);
4623
4693
  }
4624
- Yr(e, t.textBody, h, _, v, y, r, n, s, !1, !1, i, a, o, p, !1, c), e.restore();
4694
+ ii(e, t.textBody, g, _, v, y, r, n, s, !1, !1, i, a, o, p, !1, c), e.restore();
4625
4695
  }
4626
4696
  e.restore();
4627
4697
  }
4628
- var Wr = Te;
4629
- function Gr(e, t) {
4630
- let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Kr(e).toLowerCase(), o = Kr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
4698
+ var $r = Oe;
4699
+ function ei(e, t) {
4700
+ let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = ti(e).toLowerCase(), o = ti(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
4631
4701
  switch (t) {
4632
4702
  case "arabicPlain": return n;
4633
4703
  case "arabicPeriod": return `${n}.`;
@@ -4654,7 +4724,7 @@ function Gr(e, t) {
4654
4724
  default: return `${n}.`;
4655
4725
  }
4656
4726
  }
4657
- function Kr(e) {
4727
+ function ti(e) {
4658
4728
  let t = [
4659
4729
  1e3,
4660
4730
  900,
@@ -4687,25 +4757,25 @@ function Kr(e) {
4687
4757
  for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
4688
4758
  return r;
4689
4759
  }
4690
- function qr(e) {
4760
+ function ni(e) {
4691
4761
  for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
4692
4762
  return !1;
4693
4763
  }
4694
- function Jr(e, t) {
4695
- let n = qr(e);
4696
- if (e.bullet.type === "char") return t.clear(), n ? xe(e.bullet.char, e.bullet.fontFamily ?? null) : "";
4764
+ function ri(e, t) {
4765
+ let n = ni(e);
4766
+ if (e.bullet.type === "char") return t.clear(), n ? we(e.bullet.char, e.bullet.fontFamily ?? null) : "";
4697
4767
  if (e.bullet.type === "autoNum") {
4698
4768
  if (!n) return "";
4699
4769
  let r = e.lvl;
4700
- return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Gr(t.get(r), e.bullet.numType);
4770
+ return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), ei(t.get(r), e.bullet.numType);
4701
4771
  }
4702
4772
  return t.clear(), "";
4703
4773
  }
4704
- function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
4774
+ function ii(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
4705
4775
  themeMajorFont: null,
4706
4776
  themeMinorFont: null,
4707
4777
  dpr: 1
4708
- }, m, h = !1, g, v = !1, y = h) {
4778
+ }, m, h = !1, g, _ = !1, v = h) {
4709
4779
  let b = t.vert === "vert" || t.vert === "eaVert", x = t.vert === "vert270";
4710
4780
  if (b || x) {
4711
4781
  let l = n + i / 2, u = r + a / 2, _ = b ? 90 : -90, v = m ? (e) => m({
@@ -4720,21 +4790,21 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4720
4790
  textBodyRotation: _
4721
4791
  }) : void 0;
4722
4792
  if (h) return i;
4723
- e.save(), e.translate(l, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), Yr(e, {
4793
+ e.save(), e.translate(l, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), ii(e, {
4724
4794
  ...t,
4725
4795
  vert: "horz"
4726
4796
  }, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, g, t.vert === "eaVert"), e.restore();
4727
4797
  return;
4728
4798
  }
4729
4799
  let S = t.textWarp;
4730
- if (!h && S && it(S.preset)) {
4731
- jr(e, t, S.preset, S.adj ?? [], n, r, i, a, o, s ?? d, p);
4800
+ if (!h && S && ot(S.preset)) {
4801
+ Br(e, t, S.preset, S.adj ?? [], n, r, i, a, o, s ?? d, p);
4732
4802
  return;
4733
4803
  }
4734
- let C = X(t.lIns, o), w = X(t.rIns, o), T = X(t.tIns, o), E = X(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D && sr(e, t, i, C, w, 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) => {
4804
+ let C = X(t.lIns, o), w = X(t.rIns, o), T = X(t.tIns, o), E = X(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D && gr(e, t, i, C, w, 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) => {
4735
4805
  let a = (t.defaultFontSize ?? 18) * Y * o * r, s = [], c = 0, l = 0, u = /* @__PURE__ */ new Map();
4736
4806
  for (let d = 0; d < t.paragraphs.length; d++) {
4737
- let m = t.paragraphs[d], g = X(m.marL, o), _ = X(m.marR, o), v = X(m.indent, o), b = m.defFontSize == null ? a : m.defFontSize * Y * o * r, x = m.defColor ? Q(m.defColor) : P, S = Zn(m), T = (() => {
4807
+ 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, S = or(m), T = (() => {
4738
4808
  for (let e of m.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
4739
4809
  return m.defFontSize ?? t.defaultFontSize ?? 18;
4740
4810
  })() * Y * o * r, E = (() => {
@@ -4743,26 +4813,26 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4743
4813
  })(), D = E ? Q(E) : x, F = (() => {
4744
4814
  for (let e of m.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
4745
4815
  return m.defFontFamily ?? null;
4746
- })(), I = "", L = Xn(!1, !1, T, "sans-serif", p), R = D, z = null;
4747
- I = Jr(m, u);
4748
- let B = $e(m.bullet);
4816
+ })(), I = "", L = ar(!1, !1, T, "sans-serif", p), R = D, z = null;
4817
+ I = ri(m, u);
4818
+ let B = un(m.bullet);
4749
4819
  if (B.type === "char") {
4750
4820
  let e = B;
4751
- L = Xn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, I === e.char ? zn(e.fontFamily ?? null, p) : "sans-serif", p), R = e.color ? Q(e.color) : D;
4821
+ L = ar(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, I === e.char ? Jn(e.fontFamily ?? null, p) : "sans-serif", p, I), R = e.color ? Q(e.color) : D;
4752
4822
  } else if (B.type === "autoNum") {
4753
4823
  let e = B;
4754
- L = Xn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, zn(e.fontFamily ?? F, p), p), R = B.color ? Q(B.color) : D;
4824
+ L = ar(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, Jn(e.fontFamily ?? F, p), p, I), R = B.color ? Q(B.color) : D;
4755
4825
  } else if (B.type === "blip") {
4756
- let e = B, n = Qn(t, m, e) * Y * o * r;
4826
+ let e = B, n = sr(t, m, e) * Y * o * r;
4757
4827
  z = {
4758
4828
  imagePath: e.imagePath,
4759
4829
  mimeType: e.mimeType,
4760
4830
  sizePx: n
4761
4831
  };
4762
4832
  }
4763
- let V = A > 1 ? (i - C - w - (A - 1) * j) / A : i - C - w, H = n + C + g, U = n + C + g + v, W = V - g - _, ee = fr(e, m, k ? W : Infinity, b, x, o, g, M, N, r, f, p, $n(S, v)), G = m.spaceBefore == null ? 0 : m.spaceBefore / 100 * Y * o * r, te = m.spaceAfter == null ? 0 : m.spaceAfter / 100 * Y * o * r;
4764
- for (let n = 0; n < ee.length; n++) {
4765
- let r = ee[n], i = n === 0, a = n === ee.length - 1, u = 0, f = 0;
4833
+ let V = A > 1 ? (i - C - w - (A - 1) * j) / A : i - C - w, H = n + C + g, U = n + C + g + y, W = V - g - _, G = xr(e, m, k ? W : Infinity, b, x, o, g, M, N, r, f, p, cr(S, y)), ee = m.spaceBefore == null ? 0 : m.spaceBefore / 100 * Y * o * r, K = m.spaceAfter == null ? 0 : m.spaceAfter / 100 * Y * o * r;
4834
+ for (let n = 0; n < G.length; n++) {
4835
+ let r = G[n], i = n === 0, a = n === G.length - 1, u = 0, f = 0;
4766
4836
  for (let t of r.segments) {
4767
4837
  let n = t.math ? Math.max(t.sizePx, (t.math.ascent + t.math.descent) / 1.2) : t.sizePx;
4768
4838
  if (n > u && (u = n), !t.math && O) {
@@ -4777,13 +4847,13 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4777
4847
  n > u && (u = n);
4778
4848
  }
4779
4849
  i && z && z.sizePx > u && (u = z.sizePx);
4780
- let p = u * 1.2, g = O && f > p, _ = p, x = d === t.paragraphs.length - 1 && a, C = t.paragraphs.length === 1 && ee.length === 1, w;
4850
+ let p = u * 1.2, g = O && f > p, _ = p, x = d === t.paragraphs.length - 1 && a, C = t.paragraphs.length === 1 && G.length === 1, w;
4781
4851
  w = m.spaceLine ? m.spaceLine.type === "pct" ? p * (m.spaceLine.val / 1e5) : m.spaceLine.val * Y * o : _;
4782
4852
  let T = w;
4783
- h && !O && !y && (m.spaceLine ? m.spaceLine.type === "pct" && x && C && (T = u * (m.spaceLine.val / 1e5)) : T = u);
4853
+ h && !O && !v && (m.spaceLine ? m.spaceLine.type === "pct" && x && C && (T = u * (m.spaceLine.val / 1e5)) : T = u);
4784
4854
  let E = m.spaceLine?.type === "pct" ? u * (m.spaceLine.val / 1e5) : T;
4785
4855
  t.autoFit === "norm" && t.lnSpcReduction != null && m.spaceLine?.type !== "pts" && (T *= 1 - t.lnSpcReduction);
4786
- let D = T + (a ? te : 0), k = i && d > 0 ? G : 0, A = i ? $n(S, v) : 0, j = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), M = i && j ? z : null;
4856
+ let D = T + (a ? K : 0), k = i && d > 0 ? ee : 0, A = i ? cr(S, y) : 0, j = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), M = i && j ? z : null;
4787
4857
  s.push({
4788
4858
  line: r,
4789
4859
  linePx: D,
@@ -4804,7 +4874,7 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4804
4874
  useResolvedFontMetrics: g
4805
4875
  });
4806
4876
  let N = c + k;
4807
- c += D + k, l = Math.max(l, c, N + (g ? Math.max(T, f) : T) + (a ? te : 0));
4877
+ c += D + k, l = Math.max(l, c, N + (g ? Math.max(T, f) : T) + (a ? K : 0));
4808
4878
  }
4809
4879
  }
4810
4880
  return {
@@ -4812,8 +4882,8 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4812
4882
  totalHeight: c,
4813
4883
  requiredHeight: l
4814
4884
  };
4815
- }, { allLines: L, totalHeight: R, requiredHeight: z } = F(1);
4816
- if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: L, totalHeight: R, requiredHeight: z} = F(t.fontScale));
4885
+ }, { allLines: I, totalHeight: L, requiredHeight: z } = F(1);
4886
+ if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: I, totalHeight: L, requiredHeight: z} = F(t.fontScale));
4817
4887
  else {
4818
4888
  let e = a - T - E;
4819
4889
  if (z > e && e > 0) {
@@ -4822,7 +4892,7 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4822
4892
  let r = (t + n) / 2;
4823
4893
  F(r).requiredHeight <= e ? t = r : n = r;
4824
4894
  }
4825
- ({allLines: L, totalHeight: R, requiredHeight: z} = F(t));
4895
+ ({allLines: I, totalHeight: L, requiredHeight: z} = F(t));
4826
4896
  }
4827
4897
  }
4828
4898
  if (h) return T + z + E;
@@ -4830,15 +4900,15 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4830
4900
  a === 0 && B === "b" ? (H = T + z + E, V = r - H) : H = t.autoFit === "sp" ? Math.max(a, T + z + E) : a;
4831
4901
  let U, W = Math.max(0, H - T - E);
4832
4902
  U = B === "ctr" ? V + T + (W - z) / 2 : B === "b" ? V + H - E - z : V + T, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
4833
- let ee = U, G = A > 1 ? (i - C - w - (A - 1) * j) / A + j : 0, te = Math.max(0, H - T - E), K = L[L.length - 1], q = K ? Math.max(0, K.linePx - K.lineHeight) : 0, J = z - q, ne = a === 0 || J <= te + .5, re = A > 1 && !ne ? Math.ceil(L.length / A) : L.length, ie = 0, ae = 0;
4834
- for (let s of L) {
4835
- let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w, useResolvedFontMetrics: T } = s;
4836
- A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, U = ee), U += f, ae++;
4837
- let E = (t.rtlCol ? A - 1 - ie : ie) * G, D = s.textX + E, O = s.bulletX + E, k = s.textMaxW, j = s.para.rtl === !0, M = j || ln(l.segments), N = l.segments.some((e) => e.isTab);
4903
+ let G = U, ee = A > 1 ? (i - C - w - (A - 1) * j) / A + j : 0, K = Math.max(0, H - T - E), q = I[I.length - 1], J = q ? Math.max(0, q.linePx - q.lineHeight) : 0, te = z - J, ne = a === 0 || te <= K + .5, re = A > 1 && !ne ? Math.ceil(I.length / A) : I.length, ie = 0, ae = 0;
4904
+ for (let s of I) {
4905
+ let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: v, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w, useResolvedFontMetrics: T } = s;
4906
+ A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, U = G), U += f, ae++;
4907
+ let E = (t.rtlCol ? A - 1 - ie : ie) * ee, D = s.textX + E, O = s.bulletX + E, k = s.textMaxW, j = s.para.rtl === !0, M = j || vn(l.segments), N = l.segments.some((e) => e.isTab);
4838
4908
  if (N) {
4839
4909
  let t = X(s.para.marL, o), n = X(s.para.marR, o), r = j ? n : t + h, i = k + t + n;
4840
4910
  e.font = l.segments.find((e) => e.isTab).font;
4841
- let a = e.measureText(" ").width, c = xn(l.segments.map((t) => {
4911
+ let a = e.measureText(" ").width, c = An(l.segments.map((t) => {
4842
4912
  if (t.isTab) return {
4843
4913
  isTab: !0,
4844
4914
  width: 0
@@ -4859,7 +4929,7 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4859
4929
  })), r, i, a, X(s.para.defTabSz ?? 914400, o));
4860
4930
  for (let e = 0; e < l.segments.length; e++) l.segments[e].isTab && (l.segments[e].tabWidthPx = c[e]);
4861
4931
  }
4862
- let P = 0, F = 0, L = 0, R = 0;
4932
+ let P = 0, F = 0, I = 0, L = 0;
4863
4933
  for (let t of l.segments) {
4864
4934
  if (t.isTab) {
4865
4935
  P += t.tabWidthPx ?? 0;
@@ -4873,28 +4943,28 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4873
4943
  let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
4874
4944
  if (P += t.leadingLetterSpacingPx ?? 0, P += t.text ? $(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent)), T) {
4875
4945
  let e = n.fontBoundingBoxAscent ?? 0, t = e + (n.fontBoundingBoxDescent ?? 0);
4876
- t > R && (R = t, L = e);
4946
+ t > L && (L = t, I = e);
4877
4947
  }
4878
4948
  }
4879
- let z = T && 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 = U + z, H = D + k, W = S && g ? p.pictureBulletImages?.has(S.imagePath) ? p.pictureBulletImages.get(S.imagePath) : I(S.imagePath, g) : void 0, te = 0;
4949
+ let z = T && L > 0 ? B === "t" && F > 0 ? s.para.spaceLine?.type === "pct" ? Math.max(F, I + (s.baselineLineHeight - L) / 2) : F : Math.max(F, I + Math.max(0, d - L) / 2) : Math.max(d * .8, F), V = U + z, H = D + k, W = S && g ? p.pictureBulletImages?.has(S.imagePath) ? p.pictureBulletImages.get(S.imagePath) : R(S.imagePath, g) : void 0, K = 0;
4880
4950
  if (M && j) {
4881
- if (y) e.font = b, te = e.measureText(y).width;
4951
+ if (v) e.font = b, K = e.measureText(v).width;
4882
4952
  else if (S && W) {
4883
4953
  let e = S.sizePx;
4884
- te = W.height > 0 ? e * (W.width / W.height) : e;
4954
+ K = W.height > 0 ? e * (W.width / W.height) : e;
4885
4955
  }
4886
4956
  }
4887
- if (y) if (e.font = b, e.fillStyle = x, M && j) {
4957
+ if (v) if (e.font = b, e.fillStyle = x, M && j) {
4888
4958
  let t = e.direction;
4889
- e.direction = "rtl", e.fillText(y, H - te, V), e.direction = t;
4890
- } else e.fillText(y, O, V);
4959
+ e.direction = "rtl", e.fillText(v, H - K, V), e.direction = t;
4960
+ } else e.fillText(v, O, V);
4891
4961
  if (S && g && W) {
4892
4962
  let t = S.sizePx, n = W.height > 0 ? t * (W.width / W.height) : t, r = V - t;
4893
4963
  M && j ? e.drawImage(W, H - n, r, n, t) : e.drawImage(W, O, r, n, t);
4894
4964
  }
4895
- let K = D + h, q;
4896
- q = N ? j ? D + k - te - P : K : C === "ctr" ? K + (k - h - P) / 2 : C === "r" ? D + k - te - P : K;
4897
- let J = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, ne = w || (l.endsWithBreak ?? !1), oe = (J && !M && !N ? pn(l.segments, k - h, P, J, ne) : null) ?? l.segments, se = M ? un(l.segments, j) : null, ce = (e, t) => {
4965
+ let q = D + h, J;
4966
+ J = N ? j ? D + k - K - P : q : C === "ctr" ? q + (k - h - P) / 2 : C === "r" ? D + k - K - P : q;
4967
+ let te = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, ne = w || (l.endsWithBreak ?? !1), oe = (te && !M && !N ? Sn(l.segments, k - h, P, te, ne) : null) ?? l.segments, se = M ? yn(l.segments, j) : null, ce = (e, t) => {
4898
4968
  if (Math.abs(e - t) !== 1) return 0;
4899
4969
  let n = l.segments[Math.min(e, t)], r = l.segments[Math.max(e, t)];
4900
4970
  return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
@@ -4903,33 +4973,33 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4903
4973
  let s = se ? se.order[t] : t, l = oe[s], u = se ? se.rtl[s] : !1;
4904
4974
  if (M && (e.direction = u ? "rtl" : "ltr"), t > 0) {
4905
4975
  let e = se ? se.order[t - 1] : t - 1;
4906
- q += ce(e, s);
4976
+ J += ce(e, s);
4907
4977
  }
4908
4978
  if (l.isTab) {
4909
- q += l.tabWidthPx ?? 0;
4979
+ J += l.tabWidthPx ?? 0;
4910
4980
  continue;
4911
4981
  }
4912
- let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, y = h && h.length > 0 ? h.length * g : 0;
4982
+ let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, v = h && h.length > 0 ? h.length * g : 0;
4913
4983
  if (l.math) {
4914
- let t = Fn.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
4984
+ let t = Wn.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
4915
4985
  if (t && n > 0 && r > 0) {
4916
- let i = V - l.math.ascent, a = In(t, l.color);
4917
- e.drawImage(a, q, i, n, r);
4986
+ let i = V - l.math.ascent, a = Gn(t, l.color);
4987
+ e.drawImage(a, J, i, n, r);
4918
4988
  }
4919
- q += n, q += f;
4989
+ J += n, J += f;
4920
4990
  continue;
4921
4991
  }
4922
4992
  e.font = l.font, e.fillStyle = l.color;
4923
4993
  let b = l.drawSizePx ?? l.sizePx, x = V + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), S = l.letterSpacingPx ?? 0;
4924
4994
  if (l.highlight && l.text) {
4925
- let t = $(e, l.text, S) + y + f;
4926
- Nn(e, q, x, t, b, l.highlight, l.color);
4995
+ let t = $(e, l.text, S) + v + f;
4996
+ Hn(e, J, x, t, b, l.highlight, l.color);
4927
4997
  }
4928
4998
  let C = l.shadow, w = (e, t, n, r) => {
4929
4999
  let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
4930
- if (S !== 0 && lr(t) > 1) {
5000
+ if (S !== 0 && vr(t) > 1) {
4931
5001
  let r = e, a = r.letterSpacing;
4932
- if (dr(e)) {
5002
+ if (br(e)) {
4933
5003
  r.letterSpacing = `${S}px`, i(t, n, x);
4934
5004
  try {
4935
5005
  r.letterSpacing = a;
@@ -4942,39 +5012,39 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4942
5012
  }
4943
5013
  }
4944
5014
  } else i(t, n, x);
4945
- }, T = (t) => $(e, t, S), E = h && h.length > 0 ? en([...l.text], h, g, T) : null, D = [...l.text], O = !!h && h.length === D.length - 1 && D.length > 1, k = (e, t) => {
4946
- if (v) {
5015
+ }, T = (t) => $(e, t, S), E = h && h.length > 0 ? nn([...l.text], h, g, T) : null, D = [...l.text], O = !!h && h.length === D.length - 1 && D.length > 1, k = (e, t) => {
5016
+ if (_) {
4947
5017
  let n = O ? S + g : S;
4948
- En(e, l.text, q, x, b, n, t);
5018
+ Fn(e, l.text, J, x, b, n, t);
4949
5019
  return;
4950
5020
  }
4951
5021
  if (O) {
4952
5022
  let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = S + g;
4953
- if (dr(e)) {
5023
+ if (br(e)) {
4954
5024
  let t = e, i = t.letterSpacing;
4955
- t.letterSpacing = `${r}px`, n(l.text, q, x);
5025
+ t.letterSpacing = `${r}px`, n(l.text, J, x);
4956
5026
  try {
4957
5027
  t.letterSpacing = i;
4958
5028
  } catch {}
4959
5029
  } else {
4960
- let t = q;
5030
+ let t = J;
4961
5031
  for (let i = 0; i < D.length; i++) {
4962
5032
  let a = D[i];
4963
5033
  n(a, t, x), i < D.length - 1 && (t += e.measureText(a).width + r);
4964
5034
  }
4965
5035
  }
4966
- } else if (E) for (let { text: n, dx: r } of E) w(e, n, q + r, t);
4967
- else w(e, l.text, q, t);
5036
+ } else if (E) for (let { text: n, dx: r } of E) w(e, n, J + r, t);
5037
+ else w(e, l.text, J, t);
4968
5038
  }, A = l.reflection;
4969
5039
  if (A && l.text) {
4970
5040
  let t = e.canvas.width || 0, n = e.canvas.height || 0;
4971
5041
  if (t > 0 && n > 0) {
4972
5042
  e.font = l.font;
4973
5043
  let r = e.measureText(l.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : b * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : b * .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;
4974
- Yn(e, (e) => {
5044
+ ir(e, (e) => {
4975
5045
  e.font = l.font, e.fillStyle = l.color, k(e, "fill");
4976
5046
  }, {
4977
- x: (q - s) * f,
5047
+ x: (J - s) * f,
4978
5048
  y: (x - i) * f,
4979
5049
  w: Math.max(1, s + c) * f,
4980
5050
  h: Math.max(1, i + a) * f
@@ -4988,10 +5058,10 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4988
5058
  k(e, "fill"), C && e.restore();
4989
5059
  let j = l.outline;
4990
5060
  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;
4991
- let N = $(e, l.text, S) + y;
5061
+ let N = $(e, l.text, S) + v;
4992
5062
  if (m && l.text && m({
4993
5063
  text: l.text,
4994
- inShapeX: q - n,
5064
+ inShapeX: J - n,
4995
5065
  inShapeY: U - r,
4996
5066
  w: N + f,
4997
5067
  h: d,
@@ -5003,27 +5073,27 @@ function Yr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
5003
5073
  shapeH: a,
5004
5074
  rotation: c,
5005
5075
  hyperlink: l.hyperlink
5006
- }), l.underline && Qt(e, q, x, N + f, b, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
5076
+ }), l.underline && en(e, J, x, N + f, b, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
5007
5077
  let t = Math.max(1, b * .05);
5008
5078
  e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash([]);
5009
5079
  let n = x - b * .32;
5010
5080
  if (l.strikeDouble) {
5011
5081
  let r = t * .9, i = n - r, a = n + r;
5012
- e.beginPath(), e.moveTo(q, i + _(i, t, p.dpr)), e.lineTo(q + N + f, i + _(i, t, p.dpr)), e.moveTo(q, a + _(a, t, p.dpr)), e.lineTo(q + N + f, a + _(a, t, p.dpr)), e.stroke();
5082
+ e.beginPath(), e.moveTo(J, i + y(i, t, p.dpr)), e.lineTo(J + N + f, i + y(i, t, p.dpr)), e.moveTo(J, a + y(a, t, p.dpr)), e.lineTo(J + N + f, a + y(a, t, p.dpr)), e.stroke();
5013
5083
  } else {
5014
- let r = n + _(n, t, p.dpr);
5015
- e.beginPath(), e.moveTo(q, r), e.lineTo(q + N + f, r), e.stroke();
5084
+ let r = n + y(n, t, p.dpr);
5085
+ e.beginPath(), e.moveTo(J, r), e.lineTo(J + N + f, r), e.stroke();
5016
5086
  }
5017
5087
  }
5018
- q += N, q += f;
5088
+ J += N, J += f;
5019
5089
  }
5020
5090
  M && (e.direction = "ltr"), U += u;
5021
5091
  }
5022
5092
  e.restore();
5023
5093
  }
5024
- function Xr(e, t, n, r, i) {
5094
+ function ai(e, t, n, r, i) {
5025
5095
  if (!e) return [];
5026
- let a = Bt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Kt(n), s = r * i, c = [];
5096
+ let a = Ht(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Jt(n), s = r * i, c = [];
5027
5097
  return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
5028
5098
  widthPx: e.bevelT.w * s,
5029
5099
  heightPx: e.bevelT.h * s,
@@ -5039,9 +5109,9 @@ function Xr(e, t, n, r, i) {
5039
5109
  bottom: !0
5040
5110
  }), c;
5041
5111
  }
5042
- function Zr(e, t, n, r, i, a) {
5112
+ function oi(e, t, n, r, i, a) {
5043
5113
  if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
5044
- let o = e.extrusionH * i * a, s = Tt(t, n * a, r * a, o);
5114
+ let o = e.extrusionH * i * a, s = Dt(t, n * a, r * a, o);
5045
5115
  if (Math.hypot(s.x, s.y) < .75) return null;
5046
5116
  let c = [
5047
5117
  64,
@@ -5062,11 +5132,11 @@ function Zr(e, t, n, r, i, a) {
5062
5132
  rgb: c
5063
5133
  };
5064
5134
  }
5065
- function Qr(e, t, n, r, i, a, o, s = {}) {
5135
+ function si(e, t, n, r, i, a, o, s = {}) {
5066
5136
  if (i <= 0 || a <= 0) return !1;
5067
- 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;
5137
+ 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 = Tt(t, i, a), p = f.corners;
5068
5138
  if (d > 0) {
5069
- let e = d / u, t = Ke(f.corners, e / i, e / a);
5139
+ let e = d / u, t = Je(f.corners, e / i, e / a);
5070
5140
  t ? p = t : d = 0;
5071
5141
  }
5072
5142
  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);
@@ -5082,15 +5152,15 @@ function Qr(e, t, n, r, i, a, o, s = {}) {
5082
5152
  });
5083
5153
  if (s.extrusion) {
5084
5154
  let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
5085
- Zt(v, s.extrusion, x(e));
5155
+ $t(v, s.extrusion, x(e));
5086
5156
  }
5087
- if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Xt(v, e, x(Math.ceil(e.widthPx) + 2));
5088
- 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) => ({
5157
+ if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Qt(v, e, x(Math.ceil(e.widthPx) + 2));
5158
+ return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), Ye(_, e, h, g, p.map((e) => ({
5089
5159
  x: n + e.x,
5090
5160
  y: r + e.y
5091
5161
  }))), !0;
5092
5162
  }
5093
- function $r(e, t, n, r, i, a, o, s, c = 0) {
5163
+ function ci(e, t, n, r, i, a, o, s, c = 0) {
5094
5164
  if (r <= 0 || i <= 0 || a.length === 0) return !1;
5095
5165
  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);
5096
5166
  if (!g) return !1;
@@ -5100,7 +5170,7 @@ function $r(e, t, n, r, i, a, o, s, c = 0) {
5100
5170
  let v = Math.ceil(r * d), y = Math.ceil(i * d);
5101
5171
  for (let e of a) {
5102
5172
  let t = Math.ceil(e.widthPx) + 2;
5103
- Xt(_, e, {
5173
+ Qt(_, e, {
5104
5174
  x: f - t,
5105
5175
  y: f - t,
5106
5176
  w: v + 2 * t,
@@ -5109,17 +5179,17 @@ function $r(e, t, n, r, i, a, o, s, c = 0) {
5109
5179
  }
5110
5180
  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;
5111
5181
  }
5112
- var ei = /* @__PURE__ */ new WeakMap();
5113
- function ti(e) {
5114
- let t = ei.get(e);
5182
+ var li = /* @__PURE__ */ new WeakMap();
5183
+ function ui(e) {
5184
+ let t = li.get(e);
5115
5185
  return t || (t = async (t, n) => {
5116
5186
  let r = await e(t);
5117
5187
  return r.type === n ? r : new Blob([r], { type: n });
5118
- }, ei.set(e, t)), t;
5188
+ }, li.set(e, t)), t;
5119
5189
  }
5120
- function ni(e, t, n = ti(t), r, i, a) {
5121
- let o = ti(t);
5122
- return J(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
5190
+ function di(e, t, n = ui(t), r, i, a) {
5191
+ let o = ui(t);
5192
+ return re(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
5123
5193
  tiff: r,
5124
5194
  svgDecoder: a,
5125
5195
  ...i ?? {}
@@ -5128,7 +5198,7 @@ function ni(e, t, n = ti(t), r, i, a) {
5128
5198
  return e;
5129
5199
  });
5130
5200
  }
5131
- function ri(e, t, n) {
5201
+ function fi(e, t, n) {
5132
5202
  let r = X(t.x, n), i = X(t.y, n), o = X(t.width, n), s = X(t.height, n);
5133
5203
  e.save();
5134
5204
  try {
@@ -5142,11 +5212,11 @@ function ri(e, t, n) {
5142
5212
  e.restore();
5143
5213
  }
5144
5214
  }
5145
- async function ii(e, t, r, i, a, o, c = 1, l, u) {
5215
+ async function pi(e, t, r, i, a, o, c = 1, l, u) {
5146
5216
  if (a) try {
5147
- let d = t.mimeType === "image/svg+xml", f = Pe(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5217
+ let d = t.mimeType === "image/svg+xml", f = Me(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5148
5218
  if (!f) return;
5149
- let { widthPt: p, heightPt: m } = f, h = Dn(X(t.width, r), X(t.height, r), c, t.srcRect), g = z(t) || d, _ = g ? h : u && !t.duotone ? On(u, Z(kn(t), g ? void 0 : t.duotone)) : void 0, v = _ && "maxRetainedPixels" in _ ? _.maxRetainedPixels : void 0, y = {
5219
+ let { widthPt: p, heightPt: m } = f, h = In(X(t.width, r), X(t.height, r), c, t.srcRect), g = V(t) || d, _ = g ? h : u && !t.duotone ? Ln(u, Z(Rn(t), g ? void 0 : t.duotone)) : void 0, v = _ && "maxRetainedPixels" in _ ? _.maxRetainedPixels : void 0, y = {
5150
5220
  ..._ ? {
5151
5221
  targetWidthPx: _.targetWidthPx,
5152
5222
  targetHeightPx: _.targetHeightPx,
@@ -5154,17 +5224,17 @@ async function ii(e, t, r, i, a, o, c = 1, l, u) {
5154
5224
  } : {},
5155
5225
  workerDecoder: l
5156
5226
  }, b;
5157
- if (z(t)) try {
5158
- b = await ce(t.svgImagePath, a, y);
5227
+ if (V(t)) try {
5228
+ b = await de(t.svgImagePath, a, y);
5159
5229
  } catch {
5160
- b = d ? await ce(t.imagePath, a, y) : await Ye(t.imagePath, t.mimeType, t.duotone, a, {
5230
+ b = d ? await de(t.imagePath, a, y) : await Qe(t.imagePath, t.mimeType, t.duotone, a, {
5161
5231
  widthPt: p,
5162
5232
  heightPt: m,
5163
5233
  ..._ ?? {},
5164
5234
  tiff: o
5165
5235
  });
5166
5236
  }
5167
- else b = d ? await ce(t.imagePath, a, y) : await Ye(t.imagePath, t.mimeType, t.duotone, a, {
5237
+ else b = d ? await de(t.imagePath, a, y) : await Qe(t.imagePath, t.mimeType, t.duotone, a, {
5168
5238
  widthPt: p,
5169
5239
  heightPt: m,
5170
5240
  ..._ ?? {},
@@ -5175,13 +5245,13 @@ async function ii(e, t, r, i, a, o, c = 1, l, u) {
5175
5245
  let x = X(t.x, r), S = X(t.y, r), C = X(t.width, r), w = X(t.height, r);
5176
5246
  (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)));
5177
5247
  let T = (e, n, r, i, a) => {
5178
- t.custGeom && t.custGeom.length > 0 ? Wr(e, t.custGeom, n, r, i, a) : t.prstGeom && s(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
5248
+ t.custGeom && t.custGeom.length > 0 ? $r(e, t.custGeom, n, r, i, a) : t.prstGeom && s(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
5179
5249
  }, E = (e, t, n, r, i) => {
5180
5250
  e.beginPath(), T(e, t, n, r, i);
5181
5251
  }, D = (e, n, r, i, a) => {
5182
5252
  (t.prstGeom || t.custGeom && t.custGeom.length > 0) && (E(e, n, r, i, a), e.clip());
5183
5253
  }, O = (e, n, i, a, o) => {
5184
- t.stroke && (e.save(), si(e, t.stroke, r, {
5254
+ t.stroke && (e.save(), gi(e, t.stroke, r, {
5185
5255
  x: n,
5186
5256
  y: i,
5187
5257
  w: a,
@@ -5195,66 +5265,66 @@ async function ii(e, t, r, i, a, o, c = 1, l, u) {
5195
5265
  let c = t * 2 + Math.max(a, o);
5196
5266
  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();
5197
5267
  }
5198
- }, A = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null, j = (e, n, r, i, a) => {
5199
- e.save(), D(e, n, r, i, a), Me(e, b, t.srcRect, n, r, i, a), e.restore();
5268
+ }, A = t.scene3d && Et(t.scene3d.camera) ? t.scene3d : null, j = (e, n, r, i, a) => {
5269
+ e.save(), D(e, n, r, i, a), ke(e, b, t.srcRect, n, r, i, a), e.restore();
5200
5270
  }, M = (e, t, n, r, i) => {
5201
5271
  j(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
5202
5272
  }, N = (e, t, n, r, i) => {
5203
5273
  j(e, t, n, r, i), O(e, t, n, r, i);
5204
- }, P = e.getTransform(), F = Math.abs(P.a * P.d - P.b * P.c), I = F > 0 ? Math.sqrt(F) : 1, L = Xr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, I), R = A ? Zr(t.sp3d, A.camera, C, w, r, I) : null, B = t.stroke ? t.stroke.width * r / 2 : 0, H = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, U = R ? Math.hypot(R.offsetX, R.offsetY) / I : 0, W = B + H + U + 2, ee = (e) => {
5274
+ }, P = e.getTransform(), F = Math.abs(P.a * P.d - P.b * P.c), I = F > 0 ? Math.sqrt(F) : 1, L = ai(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, I), R = A ? oi(t.sp3d, A.camera, C, w, r, I) : null, z = t.stroke ? t.stroke.width * r / 2 : 0, B = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, H = R ? Math.hypot(R.offsetX, R.offsetY) / I : 0, W = z + B + H + 2, G = (e) => {
5205
5275
  if (A) {
5206
- if (Qr(e, A.camera, x, S, C, w, N, {
5276
+ if (si(e, A.camera, x, S, C, w, N, {
5207
5277
  bevels: L,
5208
5278
  extrusion: R ?? void 0,
5209
5279
  paintEdges: k,
5210
5280
  edgePadCss: W
5211
5281
  })) return;
5212
- } else if (L.length > 0 && $r(e, x, S, C, w, L, N, k, W)) return;
5282
+ } else if (L.length > 0 && ci(e, x, S, C, w, L, N, k, W)) return;
5213
5283
  M(e, x, S, C, w);
5214
- }, G = (e, t, n, r, i, a) => {
5284
+ }, ee = (e, t, n, r, i, a) => {
5215
5285
  e.save(), D(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
5216
- }, te = (e, t) => {
5217
- A && Qr(e, A.camera, x, S, C, w, (e, n, r, i, a) => G(e, t, n, r, i, a)) || G(e, t, x, S, C, w);
5218
- }, K = e.getTransform(), q = Math.abs(K.a * K.d - K.b * K.c), J = q > 0 ? Math.sqrt(q) : 1, ne = B + H, re = (t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, x, S, C, w) : t.prstGeom && V(t.prstGeom.toLowerCase()) ? n(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
5286
+ }, K = (e, t) => {
5287
+ A && si(e, A.camera, x, S, C, w, (e, n, r, i, a) => ee(e, t, n, r, i, a)) || ee(e, t, x, S, C, w);
5288
+ }, q = e.getTransform(), J = Math.abs(q.a * q.d - q.b * q.c), te = J > 0 ? Math.sqrt(J) : 1, ne = z + B, re = (t.custGeom && t.custGeom.length > 0 ? ye(t.custGeom, x, S, C, w) : t.prstGeom && U(t.prstGeom.toLowerCase()) ? n(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
5219
5289
  x,
5220
5290
  y: S,
5221
5291
  w: C,
5222
5292
  h: w
5223
- }, ie = A ? zr(A.camera, K, x, S, C, w, W, t.shadow?.algn) : {
5224
- bbox: Fr(K, re.x - ne, re.y - ne, re.w + ne * 2, re.h + ne * 2),
5225
- anchor: Rr(K, x, S, C, w, t.shadow?.algn)
5226
- }, ae = r * J, oe = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), se = (e) => te(e, "#000");
5227
- Vr(e, t, A && oe ? Br(ee, K, ie.bbox, {
5293
+ }, ie = A ? Jr(A.camera, q, x, S, C, w, W, t.shadow?.algn) : {
5294
+ bbox: Wr(q, re.x - ne, re.y - ne, re.w + ne * 2, re.h + ne * 2),
5295
+ anchor: qr(q, x, S, C, w, t.shadow?.algn)
5296
+ }, ae = r * te, oe = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), se = (e) => K(e, "#000");
5297
+ Xr(e, t, A && oe ? Yr(G, q, ie.bbox, {
5228
5298
  w: e.canvas.width || 0,
5229
5299
  h: e.canvas.height || 0
5230
- }) : ee, A && oe ? Br(se, K, ie.bbox, {
5300
+ }) : G, A && oe ? Yr(se, q, ie.bbox, {
5231
5301
  w: e.canvas.width || 0,
5232
5302
  h: e.canvas.height || 0
5233
- }) : se, ie.bbox, ie.anchor, r, ae, K), e.restore();
5303
+ }) : se, ie.bbox, ie.anchor, r, ae, q), e.restore();
5234
5304
  } catch (n) {
5235
- if (b(n, "tiff")) {
5236
- i() || ri(e, t, r);
5305
+ if (C(n, "tiff")) {
5306
+ i() || fi(e, t, r);
5237
5307
  return;
5238
5308
  }
5239
- if (Re(n) || Je(n)) throw n;
5309
+ if (Ke(n) || Ze(n)) throw n;
5240
5310
  }
5241
5311
  }
5242
- async function ai(e, t, n, r, i, o, s, c, l = 1, u, d) {
5312
+ async function mi(e, t, n, r, i, o, s, c, l = 1, u, d) {
5243
5313
  let f = X(t.x, n), p = X(t.y, n), m = X(t.width, n), h = X(t.height, n), g, _ = !1;
5244
5314
  if (t.posterPath && i) try {
5245
- g = await ni(t, i, s, c, t.posterMimeType === "image/svg+xml" ? Dn(m, h, l) : d ? On(d, Z(t.posterPath)) : void 0, u);
5315
+ g = await di(t, i, s, c, t.posterMimeType === "image/svg+xml" ? In(m, h, l) : d ? Ln(d, Z(t.posterPath)) : void 0, u);
5246
5316
  } catch (e) {
5247
- if (b(e, "tiff")) _ = !0;
5248
- else if (Re(e) || Je(e)) throw e;
5317
+ if (C(e, "tiff")) _ = !0;
5318
+ else if (Ke(e) || Ze(e)) throw e;
5249
5319
  }
5250
- r() || (e.save(), ci(e, t, n), g ? e.drawImage(g, f, p, m, h) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(f, p, m, h), _ && a(e, "tiff", {
5320
+ r() || (e.save(), _i(e, t, n), g ? e.drawImage(g, f, p, m, h) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(f, p, m, h), _ && a(e, "tiff", {
5251
5321
  x: f,
5252
5322
  y: p,
5253
5323
  width: m,
5254
5324
  height: h
5255
- })), o || on(e, f + m / 2, p + h / 2, m, h, "paused"), e.restore());
5325
+ })), o || hn(e, f + m / 2, p + h / 2, m, h, "paused"), e.restore());
5256
5326
  }
5257
- function oi(e, t, n, r, i, a, o) {
5327
+ function hi(e, t, n, r, i, a, o) {
5258
5328
  let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
5259
5329
  if (u === 0) return;
5260
5330
  let d = -l / u, f = c / u, p;
@@ -5304,30 +5374,30 @@ function oi(e, t, n, r, i, a, o) {
5304
5374
  break;
5305
5375
  default: return;
5306
5376
  }
5307
- 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) ?? Q(r.color);
5377
+ 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 ? Un(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);
5308
5378
  for (let r of p) {
5309
5379
  let i = d * (s * r.offset), a = f * (s * r.offset);
5310
5380
  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();
5311
5381
  }
5312
5382
  e.restore();
5313
5383
  }
5314
- function si(e, t, n, r, i = 0) {
5315
- if (Ae(e, t, n), t?.fill && r) {
5316
- let n = Pn(t.fill, e, r.x, r.y, r.w, r.h, i);
5384
+ function gi(e, t, n, r, i = 0) {
5385
+ if (We(e, t, n), t?.fill && r) {
5386
+ let n = Un(t.fill, e, r.x, r.y, r.w, r.h, i);
5317
5387
  n && (e.strokeStyle = n);
5318
5388
  }
5319
5389
  }
5320
- function ci(e, t, n) {
5390
+ function _i(e, t, n) {
5321
5391
  if (t.rotation === 0 && !t.flipH && !t.flipV) return;
5322
5392
  let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
5323
5393
  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));
5324
5394
  }
5325
- function li(e, t, n, r, i = {
5395
+ function vi(e, t, n, r, i = {
5326
5396
  themeMajorFont: null,
5327
5397
  themeMinorFont: null,
5328
5398
  dpr: 1
5329
5399
  }, a) {
5330
- e.save(), ci(e, t, n);
5400
+ e.save(), _i(e, t, n);
5331
5401
  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) => {
5332
5402
  let n = 0;
5333
5403
  for (let r = 0; r < t; r++) n += c[e + r] ?? 0;
@@ -5338,7 +5408,7 @@ function li(e, t, n, r, i = {
5338
5408
  for (let t = 0; t < o.cells.length; t++) {
5339
5409
  let s = o.cells[t];
5340
5410
  if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody || o.height > 0 && !p) continue;
5341
- let c = u(t, s.gridSpan || 1), l = Yr(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;
5411
+ let c = u(t, s.gridSpan || 1), l = ii(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;
5342
5412
  l > d[a] && (d[a] = l);
5343
5413
  }
5344
5414
  }
@@ -5351,7 +5421,7 @@ function li(e, t, n, r, i = {
5351
5421
  if (l <= 1 || !c.textBody) continue;
5352
5422
  let f = u(s, c.gridSpan || 1), m = t.rows.slice(a, Math.min(t.rows.length, a + l)).some((e) => e.height === 0);
5353
5423
  if (!m && !p) continue;
5354
- let h = Yr(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, m) || 0, g = 0;
5424
+ let h = ii(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, m) || 0, g = 0;
5355
5425
  for (let e = 0; e < l && a + e < d.length; e++) g += d[a + e];
5356
5426
  if (h > g) {
5357
5427
  let e = (h - g) / l;
@@ -5367,18 +5437,18 @@ function li(e, t, n, r, i = {
5367
5437
  let e = o;
5368
5438
  for (let t = 0; t < l; t++) h[t] = e, e += c[t];
5369
5439
  }
5370
- let g = (e, n) => t.rtl ? h[e + n - 1] : h[e], v = Array(t.rows.length);
5440
+ let g = (e, n) => t.rtl ? h[e + n - 1] : h[e], _ = Array(t.rows.length);
5371
5441
  {
5372
5442
  let e = s;
5373
- for (let n = 0; n < t.rows.length; n++) v[n] = e, e += d[n];
5443
+ for (let n = 0; n < t.rows.length; n++) _[n] = e, e += d[n];
5374
5444
  }
5375
- let y, b = {
5445
+ let v, b = {
5376
5446
  row: 0,
5377
5447
  column: 0
5378
5448
  };
5379
5449
  if (a) {
5380
5450
  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);
5381
- y = (e) => {
5451
+ v = (e) => {
5382
5452
  let n = e.shapeX + e.shapeW / 2 - i, r = e.shapeY + e.shapeH / 2 - c;
5383
5453
  t.flipH && (n = -n), t.flipV && (r = -r);
5384
5454
  let o = i + u * n - d * r, s = c + d * n + u * r;
@@ -5396,7 +5466,7 @@ function li(e, t, n, r, i = {
5396
5466
  }
5397
5467
  let x = [], S = t.rows.map(() => Array(l).fill(-1));
5398
5468
  for (let e = 0; e < t.rows.length; e++) {
5399
- let n = t.rows[e], r = v[e];
5469
+ let n = t.rows[e], r = _[e];
5400
5470
  for (let i = 0; i < n.cells.length; i++) {
5401
5471
  let a = n.cells[i];
5402
5472
  if (a.hMerge || a.vMerge) continue;
@@ -5418,14 +5488,14 @@ function li(e, t, n, r, i = {
5418
5488
  }
5419
5489
  }
5420
5490
  for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of x) {
5421
- let f = Pn(a.fill, e, o, s, c, l, t.rotation);
5491
+ let f = Un(a.fill, e, o, s, c, l, t.rotation);
5422
5492
  if (f && (e.fillStyle = f, e.fillRect(o, s, c, l)), a.textBody) {
5423
- y && (b = {
5493
+ v && (b = {
5424
5494
  row: d,
5425
5495
  column: u
5426
5496
  });
5427
5497
  let t = a.textColor ? Q(a.textColor) : null;
5428
- Yr(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i, y);
5498
+ ii(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i, v);
5429
5499
  }
5430
5500
  }
5431
5501
  let C = i.dpr, w = (e, t) => {
@@ -5433,22 +5503,22 @@ function li(e, t, n, r, i = {
5433
5503
  let n = S[e][t];
5434
5504
  return n < 0 ? null : x[n];
5435
5505
  }, T = (r, i, a, o, s) => {
5436
- if (si(e, r, n, {
5506
+ if (gi(e, r, n, {
5437
5507
  x: Math.min(i, o),
5438
5508
  y: Math.min(a, s),
5439
5509
  w: Math.max(1, Math.abs(o - i)),
5440
5510
  h: Math.max(1, Math.abs(s - a))
5441
5511
  }, t.rotation), r.cmpd === "dbl" && !r.dashStyle && !r.customDash?.length && (i === o || a === s)) {
5442
- e.fillStyle = e.strokeStyle, Se(e, i, a, o, s, Math.max(.5, X(r.width, n)), C);
5512
+ e.fillStyle = e.strokeStyle, Te(e, i, a, o, s, Math.max(.5, X(r.width, n)), C);
5443
5513
  return;
5444
5514
  }
5445
- let c = i === o ? _(i, e.lineWidth, C) : 0, l = a === s ? _(a, e.lineWidth, C) : 0;
5515
+ let c = i === o ? y(i, e.lineWidth, C) : 0, l = a === s ? y(a, e.lineWidth, C) : 0;
5446
5516
  e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
5447
5517
  };
5448
5518
  for (let r of x) {
5449
5519
  let { cell: i, colX: a, rowY: o, cellW: s, cellH: c } = r;
5450
5520
  e.save();
5451
- let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR, m = t.rtl ? r.ci + r.span === l : r.ci === 0, h = t.rtl ? r.ci === 0 : r.ci + r.span === l, _ = t.rtl ? r.ci - 1 : r.ci + r.span, y = (e) => t.rtl ? e.borderR : e.borderL;
5521
+ let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR, m = t.rtl ? r.ci + r.span === l : r.ci === 0, h = t.rtl ? r.ci === 0 : r.ci + r.span === l, v = t.rtl ? r.ci - 1 : r.ci + r.span, y = (e) => t.rtl ? e.borderR : e.borderL;
5452
5522
  if (r.ri === 0 && i.borderT && T(i.borderT, a, o, a + s, o), m && f && T(f, a, o, a, o + c), r.lastRi === t.rows.length - 1) {
5453
5523
  let e = i.borderB;
5454
5524
  e && T(e, a, o + c, a + s, o + c);
@@ -5457,7 +5527,7 @@ function li(e, t, n, r, i = {
5457
5527
  for (; a < n;) {
5458
5528
  let r = S[e][a], o = a + 1;
5459
5529
  for (; o < n && S[e][o] === r;) o++;
5460
- let s = w(e, a), c = gn(i.borderB, s ? s.cell.borderT : null);
5530
+ let s = w(e, a), c = Tn(i.borderB, s ? s.cell.borderT : null);
5461
5531
  if (c) {
5462
5532
  let e = g(a, o - a);
5463
5533
  T(c, e, t, e + u(a, o - a), t);
@@ -5471,18 +5541,18 @@ function li(e, t, n, r, i = {
5471
5541
  } else {
5472
5542
  let e = a + s, t = r.ri;
5473
5543
  for (; t <= r.lastRi;) {
5474
- let n = S[t][_], i = t;
5475
- for (; i + 1 <= r.lastRi && S[i + 1][_] === n;) i++;
5476
- let a = w(t, _), o = gn(p, a ? y(a.cell) : null);
5477
- o && T(o, e, v[t], e, v[i] + d[i]), t = i + 1;
5544
+ let n = S[t][v], i = t;
5545
+ for (; i + 1 <= r.lastRi && S[i + 1][v] === n;) i++;
5546
+ let a = w(t, v), o = Tn(p, a ? y(a.cell) : null);
5547
+ o && T(o, e, _[t], e, _[i] + d[i]), t = i + 1;
5478
5548
  }
5479
5549
  }
5480
- i.diagonalTL && (si(e, i.diagonalTL, n, {
5550
+ i.diagonalTL && (gi(e, i.diagonalTL, n, {
5481
5551
  x: a,
5482
5552
  y: o,
5483
5553
  w: s,
5484
5554
  h: c
5485
- }, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && (si(e, i.diagonalTR, n, {
5555
+ }, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && (gi(e, i.diagonalTR, n, {
5486
5556
  x: a,
5487
5557
  y: o,
5488
5558
  w: s,
@@ -5491,14 +5561,14 @@ function li(e, t, n, r, i = {
5491
5561
  }
5492
5562
  e.restore();
5493
5563
  }
5494
- function ui(e, t, n, r) {
5564
+ function yi(e, t, n, r) {
5495
5565
  e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
5496
5566
  }
5497
- var di = /* @__PURE__ */ new WeakMap();
5498
- function fi(e) {
5499
- di.set(e, (di.get(e) ?? 0) + 1);
5567
+ var bi = /* @__PURE__ */ new WeakMap();
5568
+ function xi(e) {
5569
+ bi.set(e, (bi.get(e) ?? 0) + 1);
5500
5570
  }
5501
- function pi(e, t, n, r, i) {
5571
+ function Si(e, t, n, r, i) {
5502
5572
  e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
5503
5573
  let a = Math.max(12, Math.min(t, n) * .04);
5504
5574
  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([]);
@@ -5518,35 +5588,36 @@ function pi(e, t, n, r, i) {
5518
5588
  for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
5519
5589
  e.restore();
5520
5590
  }
5521
- async function mi(e, t, n, r, i = {}, a) {
5522
- return hi(e, t, n, r, i, a);
5591
+ async function Ci(e, t, n, r, i = {}, a) {
5592
+ return wi(e, t, n, r, i, a);
5523
5593
  }
5524
- async function hi(e, t, n, r, i = {}, a) {
5525
- let o = i.fetchImage ?? (i.fetchMedia ? ti(i.fetchMedia) : void 0), s = (di.get(e) ?? 0) + 1;
5526
- di.set(e, s);
5527
- let c = () => di.get(e) !== s, l = () => c() ? Promise.resolve(e) : gi(e, t, n, r, i, a, o, c);
5528
- return o && Mn(t) ? fe(o, i.imageResources, l) : l();
5594
+ async function wi(e, t, n, r, i = {}, a) {
5595
+ let o = i.fetchImage ?? (i.fetchMedia ? ui(i.fetchMedia) : void 0), s = (bi.get(e) ?? 0) + 1;
5596
+ bi.set(e, s);
5597
+ let c = () => bi.get(e) !== s, l = () => c() ? Promise.resolve(e) : Ti(e, t, n, r, i, a, o, c);
5598
+ return o && Vn(t) ? he(o, i.imageResources, l) : l();
5529
5599
  }
5530
- async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5531
- let l = a.width ?? ((P(t) ? t.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? e(), m = He(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await jn(n, d, f, u, h, a.imageResources, a.fetchImage, a.fetchMedia, s, a.tiff);
5532
- t.width = m.width, t.height = m.height, P(t) && (t.style.width = `${d}px`, t.style.display || (t.style.display = "block"));
5600
+ async function Ti(t, n, r, i, a = {}, o, s, c = () => !1) {
5601
+ let l = a.width ?? ((I(t) ? t.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? e(), m = Ve(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await Bn(n, d, f, u, h, a.imageResources, a.fetchImage, a.fetchMedia, s, a.tiff);
5602
+ t.width = m.width, t.height = m.height, I(t) && (t.style.width = `${d}px`, t.style.display || (t.style.display = "block"));
5533
5603
  let _ = t.getContext("2d");
5534
5604
  if (!_) throw Error("Could not get 2D context");
5535
- if (_.scale(h, h), n.parseError) return pi(_, d, f, n.slideNumber, n.parseError), t;
5536
- let v = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", y = /* @__PURE__ */ new Map(), x = {
5605
+ if (_.scale(h, h), n.parseError) return Si(_, d, f, n.slideNumber, n.parseError), t;
5606
+ let v = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", y = /* @__PURE__ */ new Map(), b = {
5607
+ cjkFallback: a.cjkFallback ? ln(n, a.majorFont ?? null, a.minorFont ?? null, a.cjkFallback) : void 0,
5537
5608
  themeMajorFont: a.majorFont ?? null,
5538
5609
  themeMinorFont: a.minorFont ?? null,
5539
5610
  themeHlinkColor: a.hlinkColor ?? null,
5540
5611
  embeddedFontAliases: a.embeddedFontAliases,
5541
5612
  embeddedFontAuthoredFamilies: a.embeddedFontAuthoredFamilies,
5542
5613
  dpr: h,
5543
- smartArtFallbackTextColor: bn(n.background, v),
5614
+ smartArtFallbackTextColor: kn(n.background, v),
5544
5615
  pictureBulletImages: y
5545
5616
  };
5546
- if (await pr(_, n.background, d, f, u, c, a.fetchImage, a.tiff, a.svgDecoder, g), c() || (a.math && await Rn(n, a.math), c())) return t;
5547
- let S = n.slideNumber;
5617
+ if (await Sr(_, n.background, d, f, u, c, a.fetchImage, a.tiff, a.svgDecoder, g), c() || (a.math && await qn(n, a.math), c())) return t;
5618
+ let x = n.slideNumber;
5548
5619
  for (let e of n.elements) if (e.type === "picture" && a.fetchImage) {
5549
- let t = e, n = t.mimeType === "image/svg+xml", r = z(t) || n, i = !r && !t.duotone ? On(g, Z(kn(t), t.duotone)) : void 0, o = Dn(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 = {
5620
+ let t = e, n = t.mimeType === "image/svg+xml", r = V(t) || n, i = !r && !t.duotone ? Ln(g, Z(Rn(t), t.duotone)) : void 0, o = In(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 = {
5550
5621
  ...s ? {
5551
5622
  targetWidthPx: s.targetWidthPx,
5552
5623
  targetHeightPx: s.targetHeightPx,
@@ -5554,12 +5625,12 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5554
5625
  } : {},
5555
5626
  workerDecoder: a.svgDecoder
5556
5627
  };
5557
- if (z(t)) ce(t.svgImagePath, a.fetchImage, l).catch(() => void 0);
5558
- else if (n) ce(t.imagePath, a.fetchImage, l).catch(() => void 0);
5628
+ if (V(t)) de(t.svgImagePath, a.fetchImage, l).catch(() => void 0);
5629
+ else if (n) de(t.imagePath, a.fetchImage, l).catch(() => void 0);
5559
5630
  else {
5560
- let e = Pe(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5631
+ let e = Me(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5561
5632
  if (!e) continue;
5562
- Ye(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
5633
+ Qe(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
5563
5634
  widthPt: e.widthPt,
5564
5635
  heightPt: e.heightPt,
5565
5636
  ...s ?? {},
@@ -5569,9 +5640,9 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5569
5640
  }
5570
5641
  } else if (e.type === "media") {
5571
5642
  let t = e;
5572
- t.posterPath && a.fetchMedia && ni(t, a.fetchMedia, s, a.tiff, t.posterMimeType === "image/svg+xml" ? Dn(X(t.width, u), X(t.height, u), h) : On(g, Z(t.posterPath)), a.svgDecoder).catch(() => void 0);
5643
+ t.posterPath && a.fetchMedia && di(t, a.fetchMedia, s, a.tiff, t.posterMimeType === "image/svg+xml" ? In(X(t.width, u), X(t.height, u), h) : Ln(g, Z(t.posterPath)), a.svgDecoder).catch(() => void 0);
5573
5644
  }
5574
- let C = /* @__PURE__ */ new Map();
5645
+ let S = /* @__PURE__ */ new Map();
5575
5646
  if (a.fetchImage) {
5576
5647
  let e = a.fetchImage, r = /* @__PURE__ */ new Map(), i = [];
5577
5648
  for (let e of n.elements) {
@@ -5582,8 +5653,8 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5582
5653
  targetWidthPx: X(e.width, u) * h,
5583
5654
  targetHeightPx: X(e.height, u) * h
5584
5655
  }, n = [], r = !0;
5585
- for (let i of Ee(e.chart)) {
5586
- let e = De(i, t);
5656
+ for (let i of Ie(e.chart)) {
5657
+ let e = Ne(i, t);
5587
5658
  if (!e) {
5588
5659
  r = !1;
5589
5660
  break;
@@ -5600,8 +5671,8 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5600
5671
  });
5601
5672
  }
5602
5673
  let o = /* @__PURE__ */ new Map();
5603
- for (let e of Ne(i.map(({ element: e }) => e.chart), (e, t) => De(e, i[t].frame) != null)) {
5604
- let { fill: t } = e, n = Le(t);
5674
+ for (let e of Be(i.map(({ element: e }) => e.chart), (e, t) => Ne(e, i[t].frame) != null)) {
5675
+ let { fill: t } = e, n = He(t);
5605
5676
  o.has(n) || o.set(n, {
5606
5677
  fill: t,
5607
5678
  widthPt: 0,
@@ -5611,9 +5682,9 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5611
5682
  });
5612
5683
  }
5613
5684
  for (let { usages: e } of i) for (let { usage: t, size: n } of e) {
5614
- let { fill: e } = t, r = Le(e), i = o.get(r);
5685
+ let { fill: e } = t, r = He(e), i = o.get(r);
5615
5686
  if (!i) continue;
5616
- let a = i.preserveNaturalSize || t.preserveNaturalSize, s = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : On(g, Z(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || z({
5687
+ let a = i.preserveNaturalSize || t.preserveNaturalSize, s = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : Ln(g, Z(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || V({
5617
5688
  svgImagePath: e.svgImagePath,
5618
5689
  srcRect: s ? !0 : null
5619
5690
  }));
@@ -5629,9 +5700,9 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5629
5700
  });
5630
5701
  }
5631
5702
  for (let e of n.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
5632
- let n = $e(t.bullet);
5703
+ let n = un(t.bullet);
5633
5704
  if (n.type === "blip") {
5634
- let i = Qn(e.textBody, t, n) * Y * u * h, a = r.get(n.imagePath);
5705
+ let i = sr(e.textBody, t, n) * Y * u * h, a = r.get(n.imagePath);
5635
5706
  a ? Number.isFinite(i) && i > 0 && (a.targetHeightPx = Math.max(a.targetHeightPx ?? 0, i)) : r.set(n.imagePath, {
5636
5707
  mimeType: n.mimeType,
5637
5708
  ...Number.isFinite(i) && i > 0 ? { targetHeightPx: i } : {}
@@ -5644,20 +5715,20 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5644
5715
  let i = n === "image/svg+xml" ? r === void 0 ? {} : {
5645
5716
  targetWidthPx: 1,
5646
5717
  targetHeightPx: r
5647
- } : On(g, Z(t)) ?? {}, o = n === "image/svg+xml" ? await ce(t, e, {
5718
+ } : Ln(g, Z(t)) ?? {}, o = n === "image/svg+xml" ? await de(t, e, {
5648
5719
  ...i,
5649
5720
  workerDecoder: a.svgDecoder
5650
- }) : await J(t, n, e, {
5721
+ }) : await re(t, n, e, {
5651
5722
  tiff: a.tiff,
5652
5723
  ...i
5653
5724
  });
5654
5725
  y.set(t, o);
5655
5726
  } catch (e) {
5656
- if (b(e, "tiff")) {
5727
+ if (C(e, "tiff")) {
5657
5728
  y.set(t, null);
5658
5729
  return;
5659
5730
  }
5660
- if (Re(e) || Je(e)) throw e;
5731
+ if (Ke(e) || Ze(e)) throw e;
5661
5732
  y.set(t, null);
5662
5733
  }
5663
5734
  }), i = [...o].map(async ([t, n]) => {
@@ -5667,10 +5738,10 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5667
5738
  ...l === void 0 ? {} : { maxRetainedPixels: l }
5668
5739
  } : void 0;
5669
5740
  try {
5670
- let n = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : ce(r.imagePath, e, {
5741
+ let n = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : de(r.imagePath, e, {
5671
5742
  ...d ?? {},
5672
5743
  workerDecoder: a.svgDecoder
5673
- }) : Ye(r.imagePath, r.mimeType, r.duotone, e, {
5744
+ }) : Qe(r.imagePath, r.mimeType, r.duotone, e, {
5674
5745
  widthPt: i,
5675
5746
  heightPt: o,
5676
5747
  ...d ?? {},
@@ -5680,8 +5751,8 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5680
5751
  svgImagePath: r.svgImagePath,
5681
5752
  srcRect: u ? !0 : null
5682
5753
  };
5683
- if (!r.duotone && z(c)) try {
5684
- s = await ce(c.svgImagePath, e, {
5754
+ if (!r.duotone && V(c)) try {
5755
+ s = await de(c.svgImagePath, e, {
5685
5756
  ...d ?? {},
5686
5757
  workerDecoder: a.svgDecoder
5687
5758
  });
@@ -5689,14 +5760,14 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5689
5760
  s = await n();
5690
5761
  }
5691
5762
  else s = await n();
5692
- C.set(t, s);
5763
+ S.set(t, s);
5693
5764
  } catch (e) {
5694
- if (b(e, "tiff")) {
5695
- C.set(t, null);
5765
+ if (C(e, "tiff")) {
5766
+ S.set(t, null);
5696
5767
  return;
5697
5768
  }
5698
- if (Re(e) || Je(e)) throw e;
5699
- C.set(t, null);
5769
+ if (Ke(e) || Ze(e)) throw e;
5770
+ S.set(t, null);
5700
5771
  }
5701
5772
  });
5702
5773
  if (await Promise.all([...n, ...i]), c()) return t;
@@ -5704,84 +5775,42 @@ async function gi(t, n, r, i, a = {}, o, s, c = () => !1) {
5704
5775
  }
5705
5776
  for (let [e, r] of n.elements.entries()) {
5706
5777
  if (c()) return t;
5707
- if (r.type === "shape") Ur(_, r, u, v, S, x, o ? (t) => o({
5778
+ if (r.type === "shape") Qr(_, r, u, v, x, b, o ? (t) => o({
5708
5779
  ...t,
5709
5780
  elementIndex: e,
5710
5781
  origin: n.elementSources?.[e]?.origin ?? "slide"
5711
5782
  }) : void 0, a.fetchImage);
5712
- else if (r.type === "picture") await ii(_, r, u, c, a.fetchImage, a.tiff, h, a.svgDecoder, g);
5713
- else if (r.type === "table") li(_, r, u, S, x, o ? (t) => o({
5783
+ else if (r.type === "picture") await pi(_, r, u, c, a.fetchImage, a.tiff, h, a.svgDecoder, g);
5784
+ else if (r.type === "table") vi(_, r, u, x, b, o ? (t) => o({
5714
5785
  ...t,
5715
5786
  elementIndex: e,
5716
5787
  origin: n.elementSources?.[e]?.origin ?? "slide"
5717
5788
  }) : void 0);
5718
- else if (r.type === "media") await ai(_, r, u, c, a.fetchMedia, a.skipMediaControls, a.fetchImage, a.tiff, h, a.svgDecoder, g);
5789
+ else if (r.type === "media") await mi(_, r, u, c, a.fetchMedia, a.skipMediaControls, a.fetchImage, a.tiff, h, a.svgDecoder, g);
5719
5790
  else if (r.type === "chart") {
5720
5791
  let e = Y * u;
5721
- _.save(), ci(_, r, u), qe(_, r.chart, {
5792
+ _.save(), _i(_, r, u), qe(_, r.chart, {
5722
5793
  x: X(r.x, u),
5723
5794
  y: X(r.y, u),
5724
5795
  w: X(r.width, u),
5725
5796
  h: X(r.height, u)
5726
- }, e, r.rotation, a.threeD, a.regionMap, (e) => C.get(Le(e)), a.chartEx), _.restore();
5797
+ }, e, r.rotation, a.threeD, a.regionMap, (e) => S.get(He(e)), a.chartEx), _.restore();
5727
5798
  }
5728
5799
  }
5729
- return c() || a.dim && ui(_, a.dim, d, f), t;
5800
+ return c() || a.dim && yi(_, a.dim, d, f), t;
5730
5801
  }
5731
5802
  //#endregion
5732
- //#region packages/pptx/src/google-fonts.ts
5733
- var _i = {
5734
- ...C,
5735
- ...f
5736
- };
5737
- function* vi(e) {
5738
- for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
5739
- }
5740
- function* yi(e) {
5741
- for (let t of e?.paragraphs ?? []) {
5742
- t.defFontFamily && (yield t.defFontFamily);
5743
- for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilySym && (yield e.fontFamilySym));
5744
- }
5745
- }
5746
- function* bi(e) {
5747
- for (let t of e.elements) if (t.type === "shape") yield* vi(t.textBody);
5748
- else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* vi(t.textBody);
5749
- else if (t.type === "chart") {
5750
- t.chart.title && (yield t.chart.title);
5751
- for (let e of t.chart.categories) yield e;
5752
- for (let e of t.chart.series) e.name && (yield e.name);
5753
- }
5754
- }
5755
- var xi = class e {
5756
- scripts;
5757
- families;
5758
- constructor(e, t, n, i) {
5759
- this.majorFont = e, this.minorFont = t;
5760
- let a = r(e) ?? r(t) ?? null;
5761
- this.scripts = n ?? new v(a), this.families = i ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
5762
- }
5763
- addSlide(e) {
5764
- this.scripts.addText(bi(e));
5765
- for (let t of e.elements) if (t.type === "shape") for (let e of yi(t.textBody)) this.families.add(e);
5766
- else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of yi(t.textBody)) this.families.add(e);
5767
- }
5768
- names() {
5769
- return [...this.families, ...this.scripts.names()];
5770
- }
5771
- withSlide(t) {
5772
- let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families));
5773
- return n.addSlide(t), n;
5774
- }
5775
- }, Si = Object.freeze({
5803
+ //#region packages/pptx/src/presentation-preflight.ts
5804
+ var Ei = Object.freeze({
5776
5805
  archiveEntryCount: 0,
5777
5806
  declaredInflatedBytes: 0,
5778
5807
  distinctInflatedBytes: 0,
5779
5808
  operationInflatedBytes: 0
5780
- }), Ci = T;
5781
- function wi(e, t) {
5809
+ }), Di = O;
5810
+ function Oi(e, t) {
5782
5811
  if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
5783
5812
  }
5784
- function Ti(e, t) {
5813
+ function ki(e, t) {
5785
5814
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
5786
5815
  let n = e;
5787
5816
  if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
@@ -5791,7 +5820,7 @@ function Ti(e, t) {
5791
5820
  ...n.partName === void 0 ? {} : { partName: n.partName }
5792
5821
  });
5793
5822
  }
5794
- function Ei(e, t) {
5823
+ function Ai(e, t) {
5795
5824
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap embedded font at ${t}`);
5796
5825
  let n = e;
5797
5826
  if (typeof n.fontName != "string" || n.fontName.length === 0 || ![
@@ -5807,11 +5836,11 @@ function Ei(e, t) {
5807
5836
  contentType: n.contentType
5808
5837
  });
5809
5838
  }
5810
- function Di(e) {
5839
+ function ji(e) {
5811
5840
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
5812
5841
  let t = e;
5813
5842
  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");
5814
- return wi(t.defaultTextColor, "defaultTextColor"), wi(t.majorFont, "majorFont"), wi(t.minorFont, "minorFont"), wi(t.hlinkColor, "hlinkColor"), wi(t.folHlinkColor, "folHlinkColor"), Object.freeze({
5843
+ return Oi(t.defaultTextColor, "defaultTextColor"), Oi(t.majorFont, "majorFont"), Oi(t.minorFont, "minorFont"), Oi(t.hlinkColor, "hlinkColor"), Oi(t.folHlinkColor, "folHlinkColor"), Object.freeze({
5815
5844
  slideCount: t.slideCount,
5816
5845
  slideWidth: t.slideWidth,
5817
5846
  slideHeight: t.slideHeight,
@@ -5820,11 +5849,11 @@ function Di(e) {
5820
5849
  minorFont: t.minorFont,
5821
5850
  hlinkColor: t.hlinkColor,
5822
5851
  folHlinkColor: t.folHlinkColor,
5823
- embeddedFonts: Object.freeze(t.embeddedFonts.map(Ei)),
5824
- slides: Object.freeze(t.slides.map(Ti))
5852
+ embeddedFonts: Object.freeze(t.embeddedFonts.map(Ai)),
5853
+ slides: Object.freeze(t.slides.map(ki))
5825
5854
  });
5826
5855
  }
5827
- function Oi(e) {
5856
+ function Mi(e) {
5828
5857
  return Object.freeze({
5829
5858
  type: "media",
5830
5859
  x: e.x,
@@ -5841,7 +5870,7 @@ function Oi(e) {
5841
5870
  mimeType: e.mimeType
5842
5871
  });
5843
5872
  }
5844
- function ki(e) {
5873
+ function Ni(e) {
5845
5874
  return Object.freeze({
5846
5875
  ...e.id === void 0 ? {} : { id: e.id },
5847
5876
  ...e.authorId === void 0 ? {} : { authorId: e.authorId },
@@ -5851,10 +5880,10 @@ function ki(e) {
5851
5880
  text: e.text
5852
5881
  });
5853
5882
  }
5854
- function Ai(e) {
5883
+ function Pi(e) {
5855
5884
  return Object.freeze({ ...e });
5856
5885
  }
5857
- function ji(e) {
5886
+ function Fi(e) {
5858
5887
  return Object.freeze({
5859
5888
  ...e.authorId === void 0 ? {} : { authorId: e.authorId },
5860
5889
  ...e.modernAuthorId === void 0 ? {} : { modernAuthorId: e.modernAuthorId },
@@ -5864,16 +5893,16 @@ function ji(e) {
5864
5893
  ...e.date === void 0 ? {} : { date: e.date },
5865
5894
  ...e.x === void 0 ? {} : { x: e.x },
5866
5895
  ...e.y === void 0 ? {} : { y: e.y },
5867
- ...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(Ai)) } : {},
5896
+ ...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(Pi)) } : {},
5868
5897
  ...e.status === void 0 ? {} : { status: e.status },
5869
5898
  text: e.text,
5870
- ...e.replies?.length ? { replies: Object.freeze(e.replies.map(ki)) } : {}
5899
+ ...e.replies?.length ? { replies: Object.freeze(e.replies.map(Ni)) } : {}
5871
5900
  });
5872
5901
  }
5873
- function Mi(e, t, n) {
5902
+ function Ii(e, t, n) {
5874
5903
  if (e !== void 0 && typeof e != "string") throw Error(`invalid PPTX presentation preflight comment ${t} at slide ${n}`);
5875
5904
  }
5876
- function Ni(e, t) {
5905
+ function Li(e, t) {
5877
5906
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment reply at slide ${t}`);
5878
5907
  let n = e;
5879
5908
  for (let e of [
@@ -5882,16 +5911,16 @@ function Ni(e, t) {
5882
5911
  "author",
5883
5912
  "date",
5884
5913
  "status"
5885
- ]) Mi(n[e], e, t);
5914
+ ]) Ii(n[e], e, t);
5886
5915
  if (typeof n.text != "string") throw Error(`invalid PPTX presentation preflight comment reply text at slide ${t}`);
5887
5916
  if (n.status !== void 0 && ![
5888
5917
  "active",
5889
5918
  "resolved",
5890
5919
  "closed"
5891
5920
  ].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment reply status at slide ${t}`);
5892
- return ki(n);
5921
+ return Ni(n);
5893
5922
  }
5894
- function Pi(e, t) {
5923
+ function Ri(e, t) {
5895
5924
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment at slide ${t}`);
5896
5925
  let n = e;
5897
5926
  for (let e of [
@@ -5900,7 +5929,7 @@ function Pi(e, t) {
5900
5929
  "author",
5901
5930
  "date",
5902
5931
  "status"
5903
- ]) Mi(n[e], e, t);
5932
+ ]) Ii(n[e], e, t);
5904
5933
  for (let e of [
5905
5934
  "authorId",
5906
5935
  "index",
@@ -5916,23 +5945,23 @@ function Pi(e, t) {
5916
5945
  "resolved",
5917
5946
  "closed"
5918
5947
  ].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment status at slide ${t}`);
5919
- return ji({
5948
+ return Fi({
5920
5949
  ...n,
5921
- ...n.anchors?.length ? { anchors: n.anchors.map((e) => Fi(e, t)) } : {},
5922
- ...n.replies?.length ? { replies: n.replies.map((e) => Ni(e, t)) } : {}
5950
+ ...n.anchors?.length ? { anchors: n.anchors.map((e) => zi(e, t)) } : {},
5951
+ ...n.replies?.length ? { replies: n.replies.map((e) => Li(e, t)) } : {}
5923
5952
  });
5924
5953
  }
5925
- function Fi(e, t) {
5954
+ function zi(e, t) {
5926
5955
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment anchor at slide ${t}`);
5927
5956
  let n = e;
5928
5957
  if (n.type === "slide" || n.type === "unknown") return Object.freeze({ type: n.type });
5929
- if (n.type === "drawingElement") return Mi(n.elementId, "anchor.elementId", t), Mi(n.creationId, "anchor.creationId", t), Object.freeze({
5958
+ if (n.type === "drawingElement") return Ii(n.elementId, "anchor.elementId", t), Ii(n.creationId, "anchor.creationId", t), Object.freeze({
5930
5959
  type: "drawingElement",
5931
5960
  ...n.elementId === void 0 ? {} : { elementId: n.elementId },
5932
5961
  ...n.creationId === void 0 ? {} : { creationId: n.creationId }
5933
5962
  });
5934
5963
  if (n.type === "textRange") {
5935
- Mi(n.elementId, "anchor.elementId", t);
5964
+ Ii(n.elementId, "anchor.elementId", t);
5936
5965
  for (let e of ["start", "length"]) {
5937
5966
  let r = n[e];
5938
5967
  if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment anchor.${e} at slide ${t}`);
@@ -5946,7 +5975,7 @@ function Fi(e, t) {
5946
5975
  }
5947
5976
  throw Error(`invalid PPTX presentation preflight comment anchor type at slide ${t}`);
5948
5977
  }
5949
- function Ii(e, t) {
5978
+ function Bi(e, t) {
5950
5979
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
5951
5980
  let n = e;
5952
5981
  for (let e of [
@@ -5957,13 +5986,13 @@ function Ii(e, t) {
5957
5986
  "rotation"
5958
5987
  ]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
5959
5988
  if (n.type !== "media" || typeof n.flipH != "boolean" || typeof n.flipV != "boolean" || n.mediaKind !== "audio" && n.mediaKind !== "video" || typeof n.posterPath != "string" || typeof n.posterMimeType != "string" || typeof n.mediaPath != "string" || typeof n.mimeType != "string") throw Error(`invalid PPTX presentation preflight media fields at slide ${t}`);
5960
- return Oi(n);
5989
+ return Mi(n);
5961
5990
  }
5962
- function Li(e, t) {
5991
+ function Vi(e, t) {
5963
5992
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
5964
5993
  let n = e;
5965
5994
  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");
5966
- wi(n.defaultTextColor, "defaultTextColor"), wi(n.majorFont, "majorFont"), wi(n.minorFont, "minorFont"), wi(n.hlinkColor, "hlinkColor"), wi(n.folHlinkColor, "folHlinkColor");
5995
+ Oi(n.defaultTextColor, "defaultTextColor"), Oi(n.majorFont, "majorFont"), Oi(n.minorFont, "minorFont"), Oi(n.hlinkColor, "hlinkColor"), Oi(n.folHlinkColor, "folHlinkColor");
5967
5996
  let r = n.slides.map((e, t) => {
5968
5997
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight slide at ${t}`);
5969
5998
  let n = e;
@@ -5973,8 +6002,8 @@ function Li(e, t) {
5973
6002
  ...n.partName === void 0 ? {} : { partName: n.partName },
5974
6003
  notes: n.notes,
5975
6004
  hidden: n.hidden,
5976
- mediaElements: Object.freeze(n.mediaElements.map((e) => Ii(e, t))),
5977
- ...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => Pi(e, t))) } : {}
6005
+ mediaElements: Object.freeze(n.mediaElements.map((e) => Bi(e, t))),
6006
+ ...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => Ri(e, t))) } : {}
5978
6007
  });
5979
6008
  }), i = n.fontPreloadNames.map((e, t) => {
5980
6009
  if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
@@ -5989,37 +6018,37 @@ function Li(e, t) {
5989
6018
  minorFont: n.minorFont,
5990
6019
  hlinkColor: n.hlinkColor,
5991
6020
  folHlinkColor: n.folHlinkColor,
5992
- embeddedFonts: Object.freeze(n.embeddedFonts.map(Ei)),
6021
+ embeddedFonts: Object.freeze(n.embeddedFonts.map(Ai)),
5993
6022
  slides: Object.freeze(r),
5994
6023
  fontPreloadNames: Object.freeze(i)
5995
6024
  });
5996
6025
  }
5997
- function Ri(e) {
5998
- return Li(e, !1);
6026
+ function Hi(e) {
6027
+ return Vi(e, !1);
5999
6028
  }
6000
- function zi(e) {
6001
- return Li(e, !0);
6029
+ function Ui(e) {
6030
+ return Vi(e, !0);
6002
6031
  }
6003
- function Bi(e, t) {
6032
+ function Wi(e, t) {
6004
6033
  for (let n of e.slides) for (let e of n.mediaElements) {
6005
6034
  if (e.mediaPath === t) return e.mimeType;
6006
6035
  if (e.posterPath === t) return e.posterMimeType;
6007
6036
  }
6008
6037
  return "";
6009
6038
  }
6010
- function Vi(e, t) {
6039
+ function Gi(e, t) {
6011
6040
  if (e.index !== t.index || e.partName !== t.partName) throw Error(`PPTX pulled slide identity does not match bootstrap index ${t.index}`);
6012
6041
  return Object.freeze({
6013
6042
  index: t.index,
6014
6043
  ...t.partName === void 0 ? {} : { partName: t.partName },
6015
6044
  notes: e.notes ?? null,
6016
6045
  hidden: e.hidden ?? !1,
6017
- mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(Oi)),
6018
- ...e.comments?.length ? { comments: Object.freeze(e.comments.map(ji)) } : {}
6046
+ mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(Mi)),
6047
+ ...e.comments?.length ? { comments: Object.freeze(e.comments.map(Fi)) } : {}
6019
6048
  });
6020
6049
  }
6021
- function Hi(e, t, n) {
6022
- if (!(e <= t)) throw new j(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
6050
+ function Ki(e, t, n) {
6051
+ if (!(e <= t)) throw new ue(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
6023
6052
  stage: "parsing",
6024
6053
  violation: {
6025
6054
  format: "pptx",
@@ -6033,7 +6062,7 @@ function Hi(e, t, n) {
6033
6062
  }
6034
6063
  });
6035
6064
  }
6036
- var Ui = class {
6065
+ var qi = class {
6037
6066
  slideCountValue;
6038
6067
  slideWidthValue;
6039
6068
  slideHeightValue;
@@ -6053,9 +6082,9 @@ var Ui = class {
6053
6082
  pending = null;
6054
6083
  finished = null;
6055
6084
  constructor(e, t = {}) {
6056
- let n = Di(e), r = t.hardLimitForTesting ?? Ci;
6057
- if (!Number.isSafeInteger(r) || r <= 0 || r > Ci) throw Error("invalid PPTX presentation preflight test limit");
6058
- 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 xi(this.majorFontValue, this.minorFontValue), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = Ze(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = Ze({
6085
+ let n = ji(e), r = t.hardLimitForTesting ?? Di;
6086
+ if (!Number.isSafeInteger(r) || r <= 0 || r > Di) throw Error("invalid PPTX presentation preflight test limit");
6087
+ 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 cn(this.majorFontValue, this.minorFontValue, void 0, void 0, t.cjkFallback), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = et(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = et({
6059
6088
  slideCount: this.slideCountValue,
6060
6089
  slideWidth: this.slideWidthValue,
6061
6090
  slideHeight: this.slideHeightValue,
@@ -6068,7 +6097,7 @@ var Ui = class {
6068
6097
  remainingSlides: this.descriptors,
6069
6098
  slides: [],
6070
6099
  fontPreloadNames: this.fontPreloadNames
6071
- }, this.limit).jsonBytes, Hi(this.projectionBytesValue, this.limit, Si);
6100
+ }, this.limit).jsonBytes, Ki(this.projectionBytesValue, this.limit, Ei);
6072
6101
  }
6073
6102
  get acceptedSlideCount() {
6074
6103
  return this.finished?.slideCount ?? this.slides.length;
@@ -6102,21 +6131,21 @@ var Ui = class {
6102
6131
  fontPreloadNames: this.fontPreloadNames
6103
6132
  });
6104
6133
  }
6105
- addSlide(e, t = Si) {
6134
+ addSlide(e, t = Ei) {
6106
6135
  this.prepareSlide(e, t).commit();
6107
6136
  }
6108
- prepareSlide(e, t = Si) {
6137
+ prepareSlide(e, t = Ei) {
6109
6138
  if (this.finished) throw Error("PPTX presentation preflight is already finished");
6110
6139
  if (this.pending) throw Error("PPTX presentation preflight already has a prepared slide");
6111
6140
  let n = this.slides.length, r = this.descriptors[n];
6112
6141
  if (!r) throw Error("PPTX presentation preflight received an extra slide");
6113
- let i = Vi(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;
6114
- l = Qe(l, s, this.limit), l = Qe(l, c, this.limit), this.slides.length !== 0 && (l = Qe(l, 1, this.limit));
6115
- let u = Ze({
6142
+ let i = Gi(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = et(o, this.limit).jsonBytes, c = et(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.fontProjectionBytes - et(r, this.limit).jsonBytes + 4;
6143
+ l = tt(l, s, this.limit), l = tt(l, c, this.limit), this.slides.length !== 0 && (l = tt(l, 1, this.limit));
6144
+ let u = et({
6116
6145
  slide: i,
6117
6146
  fontPreloadNames: o
6118
- }, this.limit).jsonBytes, d = Qe(this.projectionBytesValue, u, this.limit);
6119
- Hi(Math.max(d, l), this.limit, t);
6147
+ }, this.limit).jsonBytes, d = tt(this.projectionBytesValue, u, this.limit);
6148
+ Ki(Math.max(d, l), this.limit, t);
6120
6149
  let f = {
6121
6150
  state: "prepared",
6122
6151
  fact: i,
@@ -6159,9 +6188,9 @@ var Ui = class {
6159
6188
  embeddedFonts: this.embeddedFontsValue,
6160
6189
  slides: Object.freeze([...this.slides]),
6161
6190
  fontPreloadNames: this.fontPreloadNames
6162
- }), this.descriptors = [], this.slides = [], this.projectionBytesValue = Ze(this.finished, this.limit).jsonBytes, this.finished;
6191
+ }), this.descriptors = [], this.slides = [], this.projectionBytesValue = et(this.finished, this.limit).jsonBytes, this.finished;
6163
6192
  }
6164
- }, Wi = 1024 * 1024, Gi = class {
6193
+ }, Ji = 1024 * 1024, Yi = class {
6165
6194
  active = /* @__PURE__ */ new Set();
6166
6195
  nextSessionId = 1;
6167
6196
  constructor(e) {
@@ -6174,15 +6203,15 @@ var Ui = class {
6174
6203
  sessionId: r,
6175
6204
  operationId: r,
6176
6205
  generation: this.options.generation ?? 1
6177
- }, a = new p(this.options.transport, {
6206
+ }, a = new h(this.options.transport, {
6178
6207
  ...i,
6179
- maxByteCredit: w,
6208
+ maxByteCredit: b,
6180
6209
  timeoutMs: n
6181
6210
  });
6182
6211
  this.active.add(a);
6183
6212
  try {
6184
6213
  await this.options.open(e, i, n);
6185
- let r = await qi(a);
6214
+ let r = await Zi(a);
6186
6215
  try {
6187
6216
  let e = r.usage ?? a.usageCheckpoint;
6188
6217
  e && this.options.onUsage?.(e);
@@ -6205,20 +6234,20 @@ var Ui = class {
6205
6234
  if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
6206
6235
  }
6207
6236
  };
6208
- function Ki(e) {
6237
+ function Xi(e) {
6209
6238
  return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
6210
6239
  }
6211
- async function qi(e) {
6240
+ async function Zi(e) {
6212
6241
  try {
6213
- return await e.pull(Wi);
6242
+ return await e.pull(Ji);
6214
6243
  } catch (t) {
6215
- let n = Ji(t);
6244
+ let n = Qi(t);
6216
6245
  if (n === void 0) throw t;
6217
6246
  return e.pull(n);
6218
6247
  }
6219
6248
  }
6220
- function Ji(e) {
6221
- return ne(e, Wi, w);
6249
+ function Qi(e) {
6250
+ return ie(e, Ji, b);
6222
6251
  }
6223
6252
  //#endregion
6224
- export { Di as a, _i as c, hi as d, on as f, Bi as i, fi as l, Ki as n, Ri as o, Ui as r, zi as s, Gi as t, mi as u };
6253
+ export { ji as a, xi as c, hn as d, rn as f, Wi as i, Ci as l, Xi as n, Hi as o, qi as r, Ui as s, Yi as t, wi as u };