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