@silurus/ooxml 0.85.1 → 0.85.2
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 +3 -2
- package/dist/assets/render-worker-CV9Mg4j9.js +10 -0
- package/dist/assets/{render-worker-BRKOyWVH.js → render-worker-DHP0rgcW.js} +16 -16
- package/dist/assets/render-worker-DdvOGyrn.js +11 -0
- package/dist/{canvas-viewer-mechanics-CfRzOhz5.js → canvas-viewer-mechanics-CDNMJ-Yz.js} +1 -1
- package/dist/{document-pull-client-BkHHIdR4.js → document-pull-client-BssAk95w.js} +3875 -3865
- package/dist/{docx-_uelcAui.js → docx-BY7oyoml.js} +17 -37
- package/dist/docx.mjs +5 -5
- package/dist/{dom-interaction-boundary-CMDDgICk.js → dom-interaction-boundary-CDGegIB5.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-BsV4MVZ2.js +1023 -0
- package/dist/{line-metrics-u87yCAfV.js → line-metrics-BGtFM-ec.js} +650 -607
- package/dist/node.mjs +30 -30
- package/dist/{pptx-WpBbS0mq.js → pptx-C4z96sAA.js} +23 -23
- package/dist/pptx.mjs +6 -6
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{raster-target-whZhvVMt.js → raster-target-ojDdQizC.js} +11 -7
- package/dist/{render-DrAAZWwH.js → render-Dxvwes39.js} +1 -1
- package/dist/{render-worker-host-CBVe8aeD.js → render-worker-host-BAXcBGq3.js} +1 -1
- package/dist/{render-worker-host-CHlwYJdK.js → render-worker-host-CNKQ76tu.js} +1 -1
- package/dist/{render-worker-host-XDMsyVsv.js → render-worker-host-CXTCU4PO.js} +1 -1
- package/dist/{resource-measurement-6uR3Huao.js → resource-measurement-D41R-0Bl.js} +4 -4
- package/dist/{session-DoPwA4gv.js → session-BmP4lcEo.js} +6 -6
- package/dist/{slide-pull-client-8i8C4VyD.js → slide-pull-client-RTwQbJiy.js} +707 -697
- package/dist/tiff.mjs +1 -1
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +8 -10
- package/dist/types/index.d.ts +12 -14
- package/dist/types/node.d.ts +5 -5
- package/dist/types/pptx.d.ts +8 -7
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/xlsx.d.ts +8 -7
- package/dist/{worksheet-pull-client-Btydoxto.js → worksheet-pull-client-C9sC36Vu.js} +20 -20
- package/dist/{xlsx-Bd16V4Xx.js → xlsx-DSU6pV1O.js} +1214 -1208
- package/dist/xlsx.mjs +6 -6
- package/package.json +1 -1
- package/dist/assets/render-worker-CtLMFj9r.js +0 -10
- package/dist/assets/render-worker-NZPOUOTU.js +0 -11
- package/dist/line-distribute-CiKeWjBF.js +0 -1023
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o,
|
|
2
|
-
import { a as
|
|
3
|
-
import { A as
|
|
4
|
-
import { l as
|
|
1
|
+
import { $ as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Et as s, Ft as c, Ht as l, It as u, J as d, Lt as f, M as p, Mt as m, N as h, Nt as g, O as _, Ot as v, Pt as y, Rt as b, S as x, St as S, Tt as C, Vt as w, Wt as T, Xt as E, Yt as D, _ as O, _t as k, at as A, bt as j, c as M, cn as N, ct as P, d as F, dt as I, et as L, f as R, g as z, gt as B, h as V, i as H, it as U, j as ee, jt as W, lt as te, m as G, mt as K, n as q, nt as ne, p as re, r as ie, rt as ae, s as oe, tt as se, u as ce, w as le, wt as ue, xt as de, y as fe, zt as pe } from "./line-metrics-BGtFM-ec.js";
|
|
2
|
+
import { a as me, c as he, d as ge, f as _e, i as ve, l as ye, o as be, p as xe, r as Se, s as Ce, t as we, u as Te } from "./line-distribute-BsV4MVZ2.js";
|
|
3
|
+
import { A as Ee, D as De, S as Oe, _ as ke, h as Ae, hn as je, in as Me, j as Ne, on as Pe, sn as Fe, v as Ie, w as Le } from "./plot-area-frame-D5hEOgkJ.js";
|
|
4
|
+
import { l as Re } from "./pixel-budget-Dgjw269h.js";
|
|
5
5
|
import { r as J } from "./units-EJdC96r6.js";
|
|
6
|
-
import { A as
|
|
7
|
-
import { k as
|
|
8
|
-
import { s as
|
|
9
|
-
import { a as
|
|
6
|
+
import { A as ze, F as Be, I as Ve, L as He, M as Ue, N as We, P as Ge, j as Ke } from "./three-d-YYghQndN.js";
|
|
7
|
+
import { k as qe } from "./renderer-XFSCOT6m.js";
|
|
8
|
+
import { s as Je } from "./raster-target-ojDdQizC.js";
|
|
9
|
+
import { a as Ye, i as Xe, n as Ze, t as Qe } from "./resource-measurement-D41R-0Bl.js";
|
|
10
10
|
//#region packages/pptx/src/types.ts
|
|
11
|
-
function
|
|
11
|
+
function $e(e) {
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var et = {
|
|
15
15
|
textarchdown: {
|
|
16
16
|
adj: [["adj", "val 0"]],
|
|
17
17
|
gd: [
|
|
@@ -2393,22 +2393,22 @@ var $e = {
|
|
|
2393
2393
|
]
|
|
2394
2394
|
}]
|
|
2395
2395
|
}
|
|
2396
|
-
},
|
|
2397
|
-
function rt(e) {
|
|
2398
|
-
return e.toLowerCase() in tt;
|
|
2399
|
-
}
|
|
2396
|
+
}, tt = Math.PI * 2 / 216e5, nt = et, rt = /* @__PURE__ */ new Map();
|
|
2400
2397
|
function it(e) {
|
|
2401
|
-
|
|
2398
|
+
return e.toLowerCase() in nt;
|
|
2399
|
+
}
|
|
2400
|
+
function at(e) {
|
|
2401
|
+
let t = rt.get(e);
|
|
2402
2402
|
if (t) return t;
|
|
2403
|
-
let n =
|
|
2403
|
+
let n = nt[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, y(t)]),
|
|
2406
|
+
gd: n.gd.map(([e, t]) => [e, y(t)]),
|
|
2407
2407
|
paths: n.paths
|
|
2408
|
-
},
|
|
2408
|
+
}, rt.set(e, t), t) : null;
|
|
2409
2409
|
}
|
|
2410
|
-
var
|
|
2411
|
-
function
|
|
2410
|
+
var ot = 48;
|
|
2411
|
+
function st(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 ot(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 <= ot; t++) {
|
|
2429
|
+
let n = t / ot, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
|
|
2430
2430
|
c.push({
|
|
2431
2431
|
x: s,
|
|
2432
2432
|
y: p
|
|
@@ -2437,8 +2437,8 @@ function ot(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 <= ot; t++) {
|
|
2441
|
+
let n = t / ot, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
|
|
2442
2442
|
c.push({
|
|
2443
2443
|
x: s,
|
|
2444
2444
|
y: d
|
|
@@ -2448,9 +2448,9 @@ function ot(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]) * tt, f = t.resolve(n[4]) * tt, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
|
|
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(ot, 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 ot(e, t, n, r) {
|
|
|
2465
2465
|
}
|
|
2466
2466
|
return c;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2468
|
+
function ct(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 st(e) {
|
|
|
2473
2473
|
}
|
|
2474
2474
|
return t;
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2477
|
-
let i =
|
|
2476
|
+
function lt(e, t, n, r) {
|
|
2477
|
+
let i = at(e.toLowerCase());
|
|
2478
2478
|
if (!i || i.paths.length === 0) return null;
|
|
2479
|
-
let a =
|
|
2479
|
+
let a = c({
|
|
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 = st(i.paths[0], a, n, r), l = o ? s : st(i.paths[i.paths.length - 1], a, n, r);
|
|
2484
2484
|
return {
|
|
2485
2485
|
top: s,
|
|
2486
|
-
bottom:
|
|
2487
|
-
topLen:
|
|
2488
|
-
bottomLen:
|
|
2486
|
+
bottom: l,
|
|
2487
|
+
topLen: ct(s),
|
|
2488
|
+
bottomLen: ct(l),
|
|
2489
2489
|
singleEdge: o
|
|
2490
2490
|
};
|
|
2491
2491
|
}
|
|
2492
|
-
function
|
|
2492
|
+
function ut(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 lt(e, t, n) {
|
|
|
2510
2510
|
ty: f / p
|
|
2511
2511
|
};
|
|
2512
2512
|
}
|
|
2513
|
-
function
|
|
2513
|
+
function dt(e) {
|
|
2514
2514
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function ft(e, t) {
|
|
2517
2517
|
if (!e.singleEdge) return 1;
|
|
2518
|
-
let n =
|
|
2518
|
+
let n = dt(e);
|
|
2519
2519
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2520
2520
|
}
|
|
2521
|
-
function
|
|
2521
|
+
function pt(e, t, n, r) {
|
|
2522
2522
|
if (e.singleEdge) {
|
|
2523
|
-
let i =
|
|
2523
|
+
let i = ut(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2524
2524
|
return {
|
|
2525
2525
|
x: i.x - o * c,
|
|
2526
2526
|
y: i.y - s * c,
|
|
@@ -2529,7 +2529,7 @@ function ft(e, t, n, r) {
|
|
|
2529
2529
|
shear: 0
|
|
2530
2530
|
};
|
|
2531
2531
|
}
|
|
2532
|
-
let i =
|
|
2532
|
+
let i = ut(e.top, e.topLen, t), a = ut(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
|
|
2533
2533
|
return {
|
|
2534
2534
|
x: c,
|
|
2535
2535
|
y: l,
|
|
@@ -2540,7 +2540,7 @@ function ft(e, t, n, r) {
|
|
|
2540
2540
|
}
|
|
2541
2541
|
//#endregion
|
|
2542
2542
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2543
|
-
var
|
|
2543
|
+
var mt = 26, ht = {
|
|
2544
2544
|
orthographicFront: {
|
|
2545
2545
|
kind: "orthographic",
|
|
2546
2546
|
baseLat: 0,
|
|
@@ -2553,52 +2553,52 @@ var pt = 26, mt = {
|
|
|
2553
2553
|
baseLat: 0,
|
|
2554
2554
|
baseLon: 0,
|
|
2555
2555
|
baseRev: 0,
|
|
2556
|
-
fovDeg:
|
|
2556
|
+
fovDeg: mt
|
|
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: mt
|
|
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: mt
|
|
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: mt
|
|
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: mt
|
|
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: mt
|
|
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: mt
|
|
2599
2599
|
}
|
|
2600
2600
|
};
|
|
2601
|
-
function
|
|
2601
|
+
function gt(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 ht(e, t) {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
return n;
|
|
2609
2609
|
}
|
|
2610
|
-
function
|
|
2610
|
+
function _t(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 gt(e) {
|
|
|
2621
2621
|
n
|
|
2622
2622
|
];
|
|
2623
2623
|
}
|
|
2624
|
-
function
|
|
2624
|
+
function vt(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 _t(e) {
|
|
|
2635
2635
|
n
|
|
2636
2636
|
];
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function yt(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 vt(e) {
|
|
|
2649
2649
|
1
|
|
2650
2650
|
];
|
|
2651
2651
|
}
|
|
2652
|
-
function
|
|
2652
|
+
function bt(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 xt(e, t) {
|
|
2660
2660
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2661
|
-
return
|
|
2661
|
+
return gt(yt(-(t ? t.rev : e.baseRev)), gt(_t(-n), vt(-r)));
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2663
|
+
function St(e) {
|
|
2664
|
+
return ht[e] || (e.startsWith("perspective") ? ht.perspectiveFront : ht.orthographicFront);
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2667
|
-
let r =
|
|
2666
|
+
function Ct(e, t, n) {
|
|
2667
|
+
let r = St(e.prst), i = xt(r, e.rot);
|
|
2668
2668
|
if (t <= 0 || n <= 0) return {
|
|
2669
2669
|
corners: [
|
|
2670
2670
|
{
|
|
@@ -2696,11 +2696,11 @@ function St(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] = bt(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] = bt(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 St(e, t, n) {
|
|
|
2723
2723
|
isIdentity: _
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2727
|
-
let { isIdentity: t } =
|
|
2726
|
+
function wt(e) {
|
|
2727
|
+
let { isIdentity: t } = Ct(e, 1e3, 1e3);
|
|
2728
2728
|
return !t;
|
|
2729
2729
|
}
|
|
2730
|
-
function
|
|
2731
|
-
let i =
|
|
2730
|
+
function Tt(e, t, n, r) {
|
|
2731
|
+
let i = St(e.prst), a = xt(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] = bt(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 wt(e, t, n, r) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
//#endregion
|
|
2750
2750
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
2751
|
-
function
|
|
2751
|
+
function Et(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 = Pt;
|
|
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 Tt(e, t) {
|
|
|
2773
2773
|
};
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function Dt(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 Et(e) {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
return n;
|
|
2793
2793
|
}
|
|
2794
|
-
function
|
|
2794
|
+
function Ot(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 Dt(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 kt(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 Ot(e, t, n, r, i, a) {
|
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
2822
|
}
|
|
2823
|
-
function
|
|
2823
|
+
function At(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 Ot(r, 3)) {
|
|
2828
2828
|
let r = Math.max(1, (e - 1) / 2);
|
|
2829
|
-
|
|
2829
|
+
kt(i, a, t, n, r, !0), kt(a, i, t, n, r, !1);
|
|
2830
2830
|
}
|
|
2831
2831
|
return i;
|
|
2832
2832
|
}
|
|
2833
|
-
function
|
|
2833
|
+
function jt(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 = Dt(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 = Dt(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 At(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 Mt = .25, Nt = .35, Pt = .5;
|
|
2858
|
+
function Ft(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 = jt(e, t, n), u = Et(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = At(l, t, n, Math.max(1, r * Mt)), m = (e) => {
|
|
2866
2866
|
let t = u(Math.max(0, e - .5));
|
|
2867
2867
|
return u(e + .5) - t;
|
|
2868
2868
|
};
|
|
@@ -2877,9 +2877,9 @@ function Pt(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 - Nt, v = 1;
|
|
2881
2881
|
if (g > _) {
|
|
2882
|
-
let e = Math.min(1, (g - _) /
|
|
2882
|
+
let e = Math.min(1, (g - _) / Nt);
|
|
2883
2883
|
v = 1 - e * e * (3 - 2 * e);
|
|
2884
2884
|
}
|
|
2885
2885
|
c[a] = v;
|
|
@@ -2894,7 +2894,7 @@ function Pt(e, t, n, r, i, a) {
|
|
|
2894
2894
|
bandWeight: c
|
|
2895
2895
|
};
|
|
2896
2896
|
}
|
|
2897
|
-
var
|
|
2897
|
+
var It = 35 * Math.PI / 180, Lt = 12 * Math.PI / 180, Rt = {
|
|
2898
2898
|
t: {
|
|
2899
2899
|
x: 0,
|
|
2900
2900
|
y: -1
|
|
@@ -2928,22 +2928,22 @@ var Ft = 35 * Math.PI / 180, It = 12 * Math.PI / 180, Lt = {
|
|
|
2928
2928
|
y: 1
|
|
2929
2929
|
}
|
|
2930
2930
|
};
|
|
2931
|
-
function
|
|
2931
|
+
function zt(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 Bt(e, t, n) {
|
|
2939
|
+
let r = Rt[t] ?? Rt.t;
|
|
2940
|
+
return n && n.rev && (r = zt(r.x, r.y, n.rev)), Ht(r.x, r.y, It);
|
|
2941
2941
|
}
|
|
2942
|
-
function
|
|
2942
|
+
function Vt(e) {
|
|
2943
2943
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
2944
|
-
return
|
|
2944
|
+
return Ht(-e.x / t, -e.y / t, Lt);
|
|
2945
2945
|
}
|
|
2946
|
-
function
|
|
2946
|
+
function Ht(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 Vt(e, t, n) {
|
|
|
2951
2951
|
z: c / l
|
|
2952
2952
|
};
|
|
2953
2953
|
}
|
|
2954
|
-
var
|
|
2954
|
+
var Ut = 2, Wt = {
|
|
2955
2955
|
matte: {
|
|
2956
2956
|
ambient: .62,
|
|
2957
2957
|
diffuse: .45,
|
|
@@ -2964,8 +2964,8 @@ var Ht = 2, Ut = {
|
|
|
2964
2964
|
specular: .35,
|
|
2965
2965
|
shininess: 22
|
|
2966
2966
|
}
|
|
2967
|
-
},
|
|
2968
|
-
function
|
|
2967
|
+
}, Gt = .8;
|
|
2968
|
+
function Kt(e) {
|
|
2969
2969
|
switch (e) {
|
|
2970
2970
|
case "plastic":
|
|
2971
2971
|
case "metal":
|
|
@@ -2976,8 +2976,8 @@ function Gt(e) {
|
|
|
2976
2976
|
default: return "matte";
|
|
2977
2977
|
}
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2980
|
-
let r =
|
|
2979
|
+
function qt(e, t, n = !0) {
|
|
2980
|
+
let r = Wt[e], i = {
|
|
2981
2981
|
light: t,
|
|
2982
2982
|
material: e,
|
|
2983
2983
|
ambient: r.ambient,
|
|
@@ -2985,9 +2985,9 @@ function Kt(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 = Vt(t), i.fillDiffuse = i.diffuse * Gt), i;
|
|
2989
2989
|
}
|
|
2990
|
-
function
|
|
2990
|
+
function Jt(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 qt(e, t) {
|
|
|
3000
3000
|
}
|
|
3001
3001
|
return Math.max(0, t.ambient + r + i + a);
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3003
|
+
function Yt(e, t, n) {
|
|
3004
3004
|
if (!e) return {
|
|
3005
3005
|
x: 0,
|
|
3006
3006
|
y: 0,
|
|
@@ -3015,16 +3015,16 @@ function Jt(e, t, n) {
|
|
|
3015
3015
|
h: Math.max(0, o - i)
|
|
3016
3016
|
};
|
|
3017
3017
|
}
|
|
3018
|
-
function
|
|
3018
|
+
function Xt(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 } = Yt(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 } = Ft(f, c, l, a, t.prst, t.heightPx), g = qt(t.material, t.light), _ = Jt({
|
|
3028
3028
|
x: 0,
|
|
3029
3029
|
y: 0,
|
|
3030
3030
|
z: 1
|
|
@@ -3035,13 +3035,13 @@ function Yt(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 + (Jt({
|
|
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) * Ut);
|
|
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 Yt(e, t, n) {
|
|
|
3050
3050
|
}
|
|
3051
3051
|
e.putImageData(u, o, s);
|
|
3052
3052
|
}
|
|
3053
|
-
function
|
|
3053
|
+
function Zt(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 } = Yt(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,7 +3079,7 @@ function Xt(e, t, n) {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
//#endregion
|
|
3081
3081
|
//#region packages/core/src/text/underline.ts
|
|
3082
|
-
function
|
|
3082
|
+
function Qt(t, n, r, i, a, o, s, c = 1) {
|
|
3083
3083
|
let l = Math.max(1, a * .05), u = s === "heavy" || (s?.endsWith("Heavy") ?? !1) ? l * 1.8 : l, d = r + Math.max(2, u), f = e(d, u, c);
|
|
3084
3084
|
if (t.strokeStyle = o, t.lineWidth = u, t.setLineDash([]), s && s.startsWith("wavy")) {
|
|
3085
3085
|
let e = u, r = u * 6;
|
|
@@ -3104,11 +3104,11 @@ function Zt(t, n, r, i, a, o, s, c = 1) {
|
|
|
3104
3104
|
t.beginPath(), t.moveTo(n, a + e(a, u, c)), t.lineTo(n + i, a + e(a, u, c)), t.moveTo(n, o + e(o, u, c)), t.lineTo(n + i, o + e(o, u, c)), t.stroke();
|
|
3105
3105
|
return;
|
|
3106
3106
|
}
|
|
3107
|
-
t.setLineDash(
|
|
3107
|
+
t.setLineDash(Oe(s ?? "sng", u)), t.beginPath(), t.moveTo(n, d + f), t.lineTo(n + i, d + f), t.stroke(), t.setLineDash([]);
|
|
3108
3108
|
}
|
|
3109
3109
|
//#endregion
|
|
3110
3110
|
//#region packages/core/src/text/highlight-box.ts
|
|
3111
|
-
function
|
|
3111
|
+
function $t(e, t) {
|
|
3112
3112
|
return {
|
|
3113
3113
|
top: e - t * .85,
|
|
3114
3114
|
height: t * 1.1
|
|
@@ -3116,7 +3116,7 @@ function Qt(e, t) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
//#endregion
|
|
3118
3118
|
//#region packages/core/src/text/justify-positions.ts
|
|
3119
|
-
function
|
|
3119
|
+
function en(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 $t(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 tn = .5;
|
|
3133
|
+
function nn(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 / tn) + 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,20 +3147,20 @@ function tn(e, t) {
|
|
|
3147
3147
|
}
|
|
3148
3148
|
return i;
|
|
3149
3149
|
}
|
|
3150
|
-
function
|
|
3151
|
-
for (let a of
|
|
3150
|
+
function rn(e, t, n, r, i) {
|
|
3151
|
+
for (let a of nn(n, r)) e.save(), e.beginPath(), e.rect(0, a.y, i, a.h), e.clip(), e.filter = a.radius > 0 ? `blur(${a.radius}px)` : "none", e.drawImage(t, 0, 0), e.restore();
|
|
3152
3152
|
}
|
|
3153
3153
|
//#endregion
|
|
3154
3154
|
//#region packages/pptx/src/hyperlink.ts
|
|
3155
|
-
function
|
|
3155
|
+
function an(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 =
|
|
3163
|
-
return a !== null &&
|
|
3162
|
+
let i = n, a = H(i);
|
|
3163
|
+
return a !== null && ie.includes(a) ? {
|
|
3164
3164
|
kind: "external",
|
|
3165
3165
|
url: i
|
|
3166
3166
|
} : {
|
|
@@ -3170,7 +3170,7 @@ function rn(e, t) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
//#endregion
|
|
3172
3172
|
//#region packages/pptx/src/media-chrome.ts
|
|
3173
|
-
function
|
|
3173
|
+
function on(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 an(e, t, n, r, i, a) {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
//#endregion
|
|
3186
3186
|
//#region packages/pptx/src/bidi-line.ts
|
|
3187
|
-
var
|
|
3187
|
+
var sn = (e) => {
|
|
3188
3188
|
let t = e.text;
|
|
3189
3189
|
return typeof t == "string" ? t : void 0;
|
|
3190
|
-
},
|
|
3191
|
-
function
|
|
3190
|
+
}, cn = (e) => "isTab" in e;
|
|
3191
|
+
function ln(e) {
|
|
3192
3192
|
for (let t of e) {
|
|
3193
|
-
let e =
|
|
3194
|
-
if (e !== void 0 &&
|
|
3193
|
+
let e = sn(t);
|
|
3194
|
+
if (e !== void 0 && ee(e)) return !0;
|
|
3195
3195
|
}
|
|
3196
3196
|
return !1;
|
|
3197
3197
|
}
|
|
3198
|
-
function
|
|
3198
|
+
function un(e, n) {
|
|
3199
3199
|
let r = e.length;
|
|
3200
3200
|
if (r === 0) return {
|
|
3201
3201
|
order: [],
|
|
@@ -3204,8 +3204,8 @@ function ln(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 = sn(e[t]) ?? "";
|
|
3208
|
+
if (i += n.length > 0 ? n : "", cn(e[t])) {
|
|
3209
3209
|
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3210
3210
|
o[a[t]] = "S";
|
|
3211
3211
|
}
|
|
@@ -3220,7 +3220,7 @@ function ln(e, n) {
|
|
|
3220
3220
|
}
|
|
3221
3221
|
//#endregion
|
|
3222
3222
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3223
|
-
function
|
|
3223
|
+
function dn(e, t, n, r, i = 0, a = !1) {
|
|
3224
3224
|
if (e.length === 0) return 0;
|
|
3225
3225
|
let s = t === 0, c = 0, l = t;
|
|
3226
3226
|
for (let t of e) {
|
|
@@ -3236,16 +3236,16 @@ function un(e, t, n, r, i = 0, a = !1) {
|
|
|
3236
3236
|
}
|
|
3237
3237
|
//#endregion
|
|
3238
3238
|
//#region packages/pptx/src/text-justify.ts
|
|
3239
|
-
var
|
|
3240
|
-
function
|
|
3239
|
+
var fn = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3240
|
+
function pn(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 = we(e, a, {
|
|
3245
3245
|
firstContentSi: 0,
|
|
3246
3246
|
lastDrawnSi: e.length,
|
|
3247
|
-
isGapChar:
|
|
3248
|
-
isWhitespace:
|
|
3247
|
+
isGapChar: le,
|
|
3248
|
+
isWhitespace: fn,
|
|
3249
3249
|
seaClusterGaps: r === "thaiDist"
|
|
3250
3250
|
});
|
|
3251
3251
|
if (!o) return null;
|
|
@@ -3266,7 +3266,7 @@ function fn(e, t, n, r, i) {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
//#endregion
|
|
3268
3268
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3269
|
-
function
|
|
3269
|
+
function mn(e) {
|
|
3270
3270
|
if (!e) return {
|
|
3271
3271
|
r: 0,
|
|
3272
3272
|
g: 0,
|
|
@@ -3283,37 +3283,37 @@ function pn(e) {
|
|
|
3283
3283
|
b: parseInt(t.slice(4, 6), 16)
|
|
3284
3284
|
};
|
|
3285
3285
|
}
|
|
3286
|
-
function
|
|
3287
|
-
let t =
|
|
3286
|
+
function hn(e) {
|
|
3287
|
+
let t = mn(e);
|
|
3288
3288
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3289
3289
|
}
|
|
3290
|
-
function
|
|
3290
|
+
function gn(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 = hn(e.color), r = hn(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 _n(e) {
|
|
3301
|
+
let t = P(e.length === 8 ? e.slice(0, 6) : e);
|
|
3302
3302
|
if (!t) return null;
|
|
3303
|
-
let n =
|
|
3303
|
+
let n = te(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 vn(e) {
|
|
3311
3311
|
if (!e) return null;
|
|
3312
|
-
if (e.fillType === "solid") return
|
|
3312
|
+
if (e.fillType === "solid") return _n(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: _n(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 _n(e) {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
return null;
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function yn(e) {
|
|
3326
3326
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3327
3327
|
}
|
|
3328
|
-
function
|
|
3329
|
-
let n =
|
|
3328
|
+
function bn(e, t) {
|
|
3329
|
+
let n = vn(e);
|
|
3330
3330
|
if (n === null || n >= .5) return null;
|
|
3331
|
-
let r =
|
|
3331
|
+
let r = _n(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 xn(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 bn(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 Sn = () => !1;
|
|
3365
|
+
function Cn(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 Sn(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 wn(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 Cn(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 Tn(e, t, n, r, i, a, o = "fill", s = Sn) {
|
|
3382
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Cn(e, t, i), f = 0;
|
|
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 = R(t), p = e.measureText(o).width + a, m = l === "Tr" ? ce(t) : null, h = l === "Tr" && m === null && G(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3385
|
+
if (re(t) && s(t)) {
|
|
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", M(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" ? F(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? wn(e, s) / i : 0;
|
|
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,37 +3396,37 @@ function wn(e, t, n, r, i, a, o = "fill", s = xn) {
|
|
|
3396
3396
|
}
|
|
3397
3397
|
e.textAlign = c, e.textBaseline = l;
|
|
3398
3398
|
}
|
|
3399
|
-
function
|
|
3400
|
-
|
|
3399
|
+
function En(e, t, n, r, i, a, o = "fill") {
|
|
3400
|
+
Tn(e, t, n, r, i, a, o, (t) => oe(e, t));
|
|
3401
3401
|
}
|
|
3402
3402
|
//#endregion
|
|
3403
3403
|
//#region packages/pptx/src/renderer.ts
|
|
3404
3404
|
function Y(e, t) {
|
|
3405
3405
|
return e * t;
|
|
3406
3406
|
}
|
|
3407
|
-
function
|
|
3408
|
-
let i =
|
|
3407
|
+
function Dn(e, t, n, r) {
|
|
3408
|
+
let i = Fe(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
3414
|
function X(e, t) {
|
|
3415
|
-
return
|
|
3415
|
+
return Xe(e, t);
|
|
3416
3416
|
}
|
|
3417
|
-
function
|
|
3417
|
+
function On(e, t) {
|
|
3418
3418
|
let n = e.targets.get(t);
|
|
3419
3419
|
return n ? {
|
|
3420
3420
|
targetWidthPx: n.width,
|
|
3421
3421
|
targetHeightPx: n.height,
|
|
3422
|
-
maxRetainedPixels: n.
|
|
3422
|
+
maxRetainedPixels: n.maxRetainedPixels
|
|
3423
3423
|
} : void 0;
|
|
3424
3424
|
}
|
|
3425
|
-
function
|
|
3426
|
-
return
|
|
3425
|
+
function kn(e) {
|
|
3426
|
+
return A(e) ? e.svgImagePath : e.imagePath;
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3429
|
-
let i =
|
|
3428
|
+
function An(e, t, n, r) {
|
|
3429
|
+
let i = $e(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) {
|
|
@@ -3436,24 +3436,34 @@ function kn(e, t, n, r) {
|
|
|
3436
3436
|
let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
|
|
3437
3437
|
return Math.max(1, s * J * n * r);
|
|
3438
3438
|
}
|
|
3439
|
-
async function
|
|
3440
|
-
let
|
|
3441
|
-
!t || !i
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3439
|
+
async function jn(e, t, n, r, i, a, o, c, l, u) {
|
|
3440
|
+
let d = de(a), f = [], p = [], m = (e, t, n, r, i, a = 1, o = i) => {
|
|
3441
|
+
if (!(!t || !i)) {
|
|
3442
|
+
if (C(r) && (d.resolution === "display" || d.strategy === "adaptive")) {
|
|
3443
|
+
f.push({
|
|
3444
|
+
key: e,
|
|
3445
|
+
...t,
|
|
3446
|
+
retainedSurfaceCount: a
|
|
3447
|
+
});
|
|
3448
|
+
return;
|
|
3449
|
+
}
|
|
3450
|
+
p.push(B(n, r, i, o).then((n) => n.dimensions && s(n.format, u !== void 0) ? {
|
|
3451
|
+
key: e,
|
|
3452
|
+
...t,
|
|
3453
|
+
sourceWidthPx: n.dimensions.width,
|
|
3454
|
+
sourceHeightPx: n.dimensions.height,
|
|
3455
|
+
retainedSurfaceCount: a
|
|
3456
|
+
} : null).catch(() => null));
|
|
3457
|
+
}
|
|
3458
|
+
}, h = e.background;
|
|
3459
|
+
if (h?.fillType === "image" && h.imagePath && !h.tile && !h.duotone) {
|
|
3460
|
+
let e = h.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), a = n * (1 - (e.t ?? 0) - (e.b ?? 0));
|
|
3461
|
+
m(X(h.imagePath, h.duotone), Dn(r, a, i, h.srcRect), h.imagePath, h.mimeType, o, 1);
|
|
3452
3462
|
}
|
|
3453
|
-
for (let t of e.elements) if (t.type === "picture") !(
|
|
3463
|
+
for (let t of e.elements) if (t.type === "picture") !(A(t) || t.mimeType === "image/svg+xml") && !t.duotone && m(X(t.imagePath, t.duotone), Dn(Y(t.width, r), Y(t.height, r), i, t.srcRect), t.imagePath, t.mimeType, o, 1);
|
|
3454
3464
|
else if (t.type === "media" && t.posterPath) {
|
|
3455
|
-
let e =
|
|
3456
|
-
|
|
3465
|
+
let e = c ? Jr(c) : void 0;
|
|
3466
|
+
m(X(t.posterPath), Dn(Y(t.width, r), Y(t.height, r), i), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, l ?? e);
|
|
3457
3467
|
} else if (t.type === "chart") {
|
|
3458
3468
|
let e = {
|
|
3459
3469
|
widthPt: t.width / J,
|
|
@@ -3461,21 +3471,21 @@ async function An(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3461
3471
|
targetWidthPx: Y(t.width, r) * i,
|
|
3462
3472
|
targetHeightPx: Y(t.height, r) * i
|
|
3463
3473
|
};
|
|
3464
|
-
for (let n of
|
|
3465
|
-
let t = n.fill, r =
|
|
3466
|
-
!(t.mimeType === "image/svg+xml" ||
|
|
3474
|
+
for (let n of Ee(t.chart)) {
|
|
3475
|
+
let t = n.fill, r = De(n, e);
|
|
3476
|
+
!(t.mimeType === "image/svg+xml" || A({
|
|
3467
3477
|
svgImagePath: t.svgImagePath,
|
|
3468
3478
|
srcRect: n.hasSourceCrop ? !0 : null
|
|
3469
|
-
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx &&
|
|
3479
|
+
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(X(t.imagePath, t.duotone), {
|
|
3470
3480
|
targetWidthPx: r.targetWidthPx,
|
|
3471
3481
|
targetHeightPx: r.targetHeightPx
|
|
3472
3482
|
}, t.imagePath, t.mimeType, o, 1);
|
|
3473
3483
|
}
|
|
3474
3484
|
} else if (t.type === "shape" && t.textBody) for (let e of t.textBody.paragraphs) {
|
|
3475
|
-
let n =
|
|
3485
|
+
let n = $e(e.bullet);
|
|
3476
3486
|
if (n.type !== "blip") continue;
|
|
3477
|
-
let a =
|
|
3478
|
-
!a || !o ||
|
|
3487
|
+
let a = An(t.textBody, e, r, i);
|
|
3488
|
+
!a || !o || p.push(B(n.imagePath, n.mimeType, o).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && s(e.format, u !== void 0) ? {
|
|
3479
3489
|
key: X(n.imagePath),
|
|
3480
3490
|
targetWidthPx: a * e.dimensions.width / e.dimensions.height,
|
|
3481
3491
|
targetHeightPx: a,
|
|
@@ -3483,27 +3493,27 @@ async function An(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3483
3493
|
sourceHeightPx: e.dimensions.height
|
|
3484
3494
|
} : null).catch(() => null));
|
|
3485
3495
|
}
|
|
3486
|
-
return
|
|
3496
|
+
return f.push(...(await Promise.all(p)).filter((e) => e !== null)), S(f, d);
|
|
3487
3497
|
}
|
|
3488
|
-
function
|
|
3489
|
-
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ?
|
|
3498
|
+
function Mn(e) {
|
|
3499
|
+
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Ee(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => $e(e.bullet).type === "blip"));
|
|
3490
3500
|
}
|
|
3491
|
-
var Z =
|
|
3492
|
-
function
|
|
3493
|
-
let { top: s, height: c } =
|
|
3501
|
+
var Z = ke;
|
|
3502
|
+
function Nn(e, t, n, r, i, a, o) {
|
|
3503
|
+
let { top: s, height: c } = $t(n, i);
|
|
3494
3504
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3495
3505
|
}
|
|
3496
|
-
function
|
|
3497
|
-
return
|
|
3506
|
+
function Pn(e, t, n, r, i, a, o = 0) {
|
|
3507
|
+
return Ie(e, t, n, r, i, a, o);
|
|
3498
3508
|
}
|
|
3499
|
-
var
|
|
3500
|
-
function
|
|
3509
|
+
var Fn = /* @__PURE__ */ new WeakMap();
|
|
3510
|
+
function In(e, t) {
|
|
3501
3511
|
let n = e.tinted.get(t);
|
|
3502
3512
|
if (n) return n;
|
|
3503
|
-
let r =
|
|
3513
|
+
let r = ae(e.raster, t);
|
|
3504
3514
|
return e.tinted.set(t, r), r;
|
|
3505
3515
|
}
|
|
3506
|
-
function
|
|
3516
|
+
function Ln(e) {
|
|
3507
3517
|
let t = [], n = (e) => {
|
|
3508
3518
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3509
3519
|
nodes: e.nodes,
|
|
@@ -3514,13 +3524,13 @@ function In(e) {
|
|
|
3514
3524
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3515
3525
|
return t;
|
|
3516
3526
|
}
|
|
3517
|
-
async function
|
|
3518
|
-
let n =
|
|
3527
|
+
async function Rn(e, t) {
|
|
3528
|
+
let n = Ln(e);
|
|
3519
3529
|
if (n.length !== 0) {
|
|
3520
3530
|
await t.loadMathJax();
|
|
3521
|
-
for (let e of n) if (!
|
|
3522
|
-
let n = await t.mathMLToSvg(
|
|
3523
|
-
|
|
3531
|
+
for (let e of n) if (!Fn.has(e.nodes)) try {
|
|
3532
|
+
let n = await t.mathMLToSvg(U(e.nodes, e.display)), r = await ne(n, "#000000");
|
|
3533
|
+
Fn.set(e.nodes, {
|
|
3524
3534
|
raster: r,
|
|
3525
3535
|
widthEm: n.widthEm,
|
|
3526
3536
|
ascentEm: n.ascentEm,
|
|
@@ -3530,14 +3540,14 @@ async function Ln(e, t) {
|
|
|
3530
3540
|
} catch {}
|
|
3531
3541
|
}
|
|
3532
3542
|
}
|
|
3533
|
-
function
|
|
3543
|
+
function zn(e, t) {
|
|
3534
3544
|
let n = (e) => t.embeddedFontAliases?.get(e.trim().toLowerCase()) ?? e;
|
|
3535
3545
|
if (!e) return n(t.themeMinorFont ?? "sans-serif");
|
|
3536
3546
|
if (e.startsWith("+")) return n(e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif");
|
|
3537
3547
|
let r = e.split(",")[0].trim();
|
|
3538
3548
|
return r ? n(r) : t.themeMinorFont ?? "sans-serif";
|
|
3539
3549
|
}
|
|
3540
|
-
var
|
|
3550
|
+
var Bn = new Set([
|
|
3541
3551
|
"serif",
|
|
3542
3552
|
"sans-serif",
|
|
3543
3553
|
"monospace",
|
|
@@ -3545,11 +3555,11 @@ var zn = new Set([
|
|
|
3545
3555
|
"fantasy",
|
|
3546
3556
|
"system-ui"
|
|
3547
3557
|
]);
|
|
3548
|
-
function
|
|
3549
|
-
let t =
|
|
3558
|
+
function Vn(e) {
|
|
3559
|
+
let t = l(e);
|
|
3550
3560
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3551
3561
|
}
|
|
3552
|
-
var
|
|
3562
|
+
var Hn = {
|
|
3553
3563
|
calibri: "Carlito",
|
|
3554
3564
|
"calibri light": "Carlito",
|
|
3555
3565
|
cambria: "Caladea",
|
|
@@ -3561,38 +3571,38 @@ var Vn = {
|
|
|
3561
3571
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3562
3572
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3563
3573
|
"univers next arabic": "Noto Sans Arabic"
|
|
3564
|
-
},
|
|
3565
|
-
function
|
|
3566
|
-
if (
|
|
3574
|
+
}, Un = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3575
|
+
function Wn(e) {
|
|
3576
|
+
if (Hn[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3567
3577
|
let t = e.toLowerCase();
|
|
3568
3578
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3569
3579
|
}
|
|
3570
|
-
function
|
|
3580
|
+
function Gn(e) {
|
|
3571
3581
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3572
3582
|
}
|
|
3573
|
-
function
|
|
3574
|
-
let n =
|
|
3575
|
-
if (
|
|
3576
|
-
let o = n === "serif" ? "serif" : "sans", s =
|
|
3577
|
-
return `"${e}", ${a}${s ? `${
|
|
3583
|
+
function Kn(e, t = e) {
|
|
3584
|
+
let n = Vn(t), i = Hn[t.toLowerCase()], a = i ? `"${i}", ` : "";
|
|
3585
|
+
if (Wn(t)) return `"${e}", ${a}${Un}, ${n}`;
|
|
3586
|
+
let o = n === "serif" ? "serif" : "sans", s = w(t);
|
|
3587
|
+
return `"${e}", ${a}${s ? `${Gn(r(s, o))}, ` : ""}${`${Gn(o === "serif" ? f : u)}, `}${n}`;
|
|
3578
3588
|
}
|
|
3579
|
-
function
|
|
3589
|
+
function qn(e) {
|
|
3580
3590
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3581
3591
|
}
|
|
3582
|
-
function
|
|
3592
|
+
function Jn(e) {
|
|
3583
3593
|
let t = e.toLowerCase();
|
|
3584
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;
|
|
3585
3595
|
}
|
|
3586
|
-
function
|
|
3587
|
-
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 Yn(e, t, n, r, i, a, o, s) {
|
|
3597
|
+
let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = je(m, h), _ = g?.getContext("2d");
|
|
3588
3598
|
if (!g || !_) return;
|
|
3589
3599
|
_.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
|
|
3590
3600
|
let v = n.y - d, y = v + n.h, b = g, x = _;
|
|
3591
3601
|
if (c > 0) {
|
|
3592
|
-
let e =
|
|
3602
|
+
let e = je(m, h), t = e?.getContext("2d");
|
|
3593
3603
|
e && t && (b = e, x = t);
|
|
3594
3604
|
}
|
|
3595
|
-
b !== g &&
|
|
3605
|
+
b !== g && rn(x, g, {
|
|
3596
3606
|
x: n.x - u,
|
|
3597
3607
|
y: v,
|
|
3598
3608
|
w: n.w,
|
|
@@ -3619,14 +3629,14 @@ function Jn(e, t, n, r, i, a, o, s) {
|
|
|
3619
3629
|
let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
|
|
3620
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();
|
|
3621
3631
|
}
|
|
3622
|
-
function
|
|
3623
|
-
let a = t ? "italic " : "", o =
|
|
3624
|
-
return
|
|
3632
|
+
function Xn(e, t, n, r, i) {
|
|
3633
|
+
let a = t ? "italic " : "", o = zn(r, i), s = i.embeddedFontAuthoredFamilies?.get(o) ?? o, c = Jn(s), l = e ? "bold " : c ? `${c} ` : "";
|
|
3634
|
+
return Bn.has(o) ? `${a}${l}${n}px ${o}` : `${a}${l}${n}px ${Kn(o, s)}`;
|
|
3625
3635
|
}
|
|
3626
|
-
function
|
|
3627
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3636
|
+
function Zn(e) {
|
|
3637
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || $e(e.bullet).type === "blip";
|
|
3628
3638
|
}
|
|
3629
|
-
function
|
|
3639
|
+
function Qn(e, t, n) {
|
|
3630
3640
|
let r = null;
|
|
3631
3641
|
for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
|
|
3632
3642
|
r = e.fontSize;
|
|
@@ -3635,41 +3645,41 @@ function Zn(e, t, n) {
|
|
|
3635
3645
|
let i = r ?? t.defFontSize ?? e.defaultFontSize ?? 18;
|
|
3636
3646
|
return n.sizePts == null ? i * ((n.sizePct ?? 100) / 100) : n.sizePts;
|
|
3637
3647
|
}
|
|
3638
|
-
function
|
|
3648
|
+
function $n(e, t) {
|
|
3639
3649
|
return e ? 0 : Math.max(0, t);
|
|
3640
3650
|
}
|
|
3641
|
-
function
|
|
3651
|
+
function er(e, t) {
|
|
3642
3652
|
return t != null && t !== 0 ? e * .65 : e;
|
|
3643
3653
|
}
|
|
3644
|
-
function
|
|
3654
|
+
function tr(e, t, n, r, i, a, o) {
|
|
3645
3655
|
let s = (t.defaultFontSize ?? 18) * J * a;
|
|
3646
3656
|
for (let c of t.paragraphs) {
|
|
3647
|
-
let l = Y(c.marL, a), u = Y(c.marR, a), d = Y(c.indent, a), f =
|
|
3657
|
+
let l = Y(c.marL, a), u = Y(c.marR, a), d = Y(c.indent, a), f = $n(Zn(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3648
3658
|
for (let n of c.runs) {
|
|
3649
3659
|
if (n.type !== "text") continue;
|
|
3650
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * J * a : n.fontSize * J * a, i =
|
|
3651
|
-
e.font =
|
|
3660
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * J * a : n.fontSize * J * a, i = zn(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3661
|
+
e.font = Xn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, er(r, n.baseline ?? void 0), i, o);
|
|
3652
3662
|
let l = (n.letterSpacing ?? 0) * J * a;
|
|
3653
3663
|
if (m += Q(e, n.text, l), m > p) return !0;
|
|
3654
3664
|
}
|
|
3655
3665
|
}
|
|
3656
3666
|
return !1;
|
|
3657
3667
|
}
|
|
3658
|
-
function
|
|
3659
|
-
for (let t of e) if (
|
|
3668
|
+
function nr(e) {
|
|
3669
|
+
for (let t of e) if (le(t.codePointAt(0) ?? 0)) return !0;
|
|
3660
3670
|
return !1;
|
|
3661
3671
|
}
|
|
3662
|
-
function
|
|
3672
|
+
function rr(e) {
|
|
3663
3673
|
let t = 0;
|
|
3664
3674
|
for (let n of e) t++;
|
|
3665
3675
|
return t;
|
|
3666
3676
|
}
|
|
3667
|
-
var
|
|
3668
|
-
function
|
|
3669
|
-
let t =
|
|
3677
|
+
var ir = /* @__PURE__ */ new WeakMap();
|
|
3678
|
+
function ar(e) {
|
|
3679
|
+
let t = ir.get(e);
|
|
3670
3680
|
if (t != null) return t;
|
|
3671
3681
|
let n = e, r = n.letterSpacing;
|
|
3672
|
-
if (typeof r != "string") return
|
|
3682
|
+
if (typeof r != "string") return ir.set(e, !1), !1;
|
|
3673
3683
|
let i = !1;
|
|
3674
3684
|
try {
|
|
3675
3685
|
n.letterSpacing = "0px";
|
|
@@ -3684,11 +3694,11 @@ function ir(e) {
|
|
|
3684
3694
|
n.letterSpacing = r;
|
|
3685
3695
|
} catch {}
|
|
3686
3696
|
}
|
|
3687
|
-
return
|
|
3697
|
+
return ir.set(e, i), i;
|
|
3688
3698
|
}
|
|
3689
3699
|
function Q(e, t, n) {
|
|
3690
3700
|
let r = e, i = r.letterSpacing;
|
|
3691
|
-
if (n !== 0 &&
|
|
3701
|
+
if (n !== 0 && ar(e)) try {
|
|
3692
3702
|
r.letterSpacing = `${n}px`;
|
|
3693
3703
|
let i = e.measureText(t).width;
|
|
3694
3704
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3697,10 +3707,10 @@ function Q(e, t, n) {
|
|
|
3697
3707
|
r.letterSpacing = i;
|
|
3698
3708
|
} catch {}
|
|
3699
3709
|
}
|
|
3700
|
-
let a = Math.max(0,
|
|
3710
|
+
let a = Math.max(0, rr(t) - 1);
|
|
3701
3711
|
return e.measureText(t).width + n * a;
|
|
3702
3712
|
}
|
|
3703
|
-
function
|
|
3713
|
+
function or(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3704
3714
|
themeMajorFont: null,
|
|
3705
3715
|
themeMinorFont: null,
|
|
3706
3716
|
dpr: 1
|
|
@@ -3713,22 +3723,22 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3713
3723
|
let r = n.text.replace(/ +$/u, "");
|
|
3714
3724
|
r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (g = !1);
|
|
3715
3725
|
}
|
|
3716
|
-
let v = () => n - (m.length === 0 ? p : 0), y = { segments: [] },
|
|
3726
|
+
let v = () => n - (m.length === 0 ? p : 0), y = { segments: [] }, b = 0, S = !1, C = t.rtl === !0, w = Y(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
|
|
3717
3727
|
pos: Y(e.pos, o),
|
|
3718
3728
|
algn: e.algn
|
|
3719
|
-
})),
|
|
3720
|
-
let t =
|
|
3729
|
+
})), E = Y(t.defTabSz ?? 914400, o), D = !1, k = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
|
|
3730
|
+
let t = xn(e > 0 ? [...k, {
|
|
3721
3731
|
isTab: !1,
|
|
3722
3732
|
width: e
|
|
3723
|
-
}] : k, T, j(), Infinity, A,
|
|
3733
|
+
}] : k, T, j(), Infinity, A, E), n = 0;
|
|
3724
3734
|
for (let e of t) n += e;
|
|
3725
3735
|
return n;
|
|
3726
3736
|
}, N = (e) => {
|
|
3727
3737
|
let t = v();
|
|
3728
|
-
return Number.isFinite(t) ?
|
|
3738
|
+
return Number.isFinite(t) ? D ? M(e) <= t : b + e <= t : !0;
|
|
3729
3739
|
}, P = () => {
|
|
3730
3740
|
let e = v();
|
|
3731
|
-
if (!
|
|
3741
|
+
if (!D) return e - b;
|
|
3732
3742
|
if (!Number.isFinite(e)) return Infinity;
|
|
3733
3743
|
if (M(0) >= e) return 0;
|
|
3734
3744
|
let t = 0, n = e;
|
|
@@ -3738,16 +3748,16 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3738
3748
|
}
|
|
3739
3749
|
return t;
|
|
3740
3750
|
}, F = (e = !1) => {
|
|
3741
|
-
e && (y.endsWithBreak = !0), m.push(y), y = { segments: [] },
|
|
3742
|
-
},
|
|
3751
|
+
e && (y.endsWithBreak = !0), m.push(y), y = { segments: [] }, b = 0, D = !1, k = [], S = !1;
|
|
3752
|
+
}, I = (t, n, r, i) => {
|
|
3743
3753
|
e.font = n;
|
|
3744
3754
|
let a = Q(e, t, r), o = y.segments.at(-1);
|
|
3745
3755
|
return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? Q(e, o.text + t, r) - Q(e, o.text, r) : a + r;
|
|
3746
|
-
},
|
|
3756
|
+
}, L = (t, n, r, i, a, o, s, c) => {
|
|
3747
3757
|
if (!t) return;
|
|
3748
3758
|
e.font = n;
|
|
3749
|
-
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily,
|
|
3750
|
-
if (w && C(w) ? T = Q(e, w.text + t, l) - Q(e, w.text, l) : w && !w.isTab && !w.math && u != null && w.sourceRunId === u && (T += l),
|
|
3759
|
+
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, x = c?.hyperlink, S = c?.drawSizePx ?? r, C = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && (e.drawSizePx ?? e.sizePx) === S && qn(e.hyperlink) === qn(x) && (l === 0 || e.sourceRunId === u), w = y.segments.at(-1), T = Q(e, t, l);
|
|
3760
|
+
if (w && C(w) ? T = Q(e, w.text + t, l) - Q(e, w.text, l) : w && !w.isTab && !w.math && u != null && w.sourceRunId === u && (T += l), b += T, k.push({
|
|
3751
3761
|
isTab: !1,
|
|
3752
3762
|
width: T
|
|
3753
3763
|
}), w && C(w)) w.text += t;
|
|
@@ -3773,17 +3783,17 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3773
3783
|
reflection: h,
|
|
3774
3784
|
outline: g,
|
|
3775
3785
|
highlight: _,
|
|
3776
|
-
hyperlink:
|
|
3786
|
+
hyperlink: x
|
|
3777
3787
|
});
|
|
3778
3788
|
}
|
|
3779
|
-
},
|
|
3789
|
+
}, R = () => {
|
|
3780
3790
|
let e = y.segments.at(-1);
|
|
3781
3791
|
if (!e || e.math) return !1;
|
|
3782
3792
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
3783
3793
|
if (t) e.text = t[1], n = t[2];
|
|
3784
3794
|
else if (y.segments.length > 1) y.segments.pop(), n = e.text;
|
|
3785
3795
|
else return !1;
|
|
3786
|
-
return F(),
|
|
3796
|
+
return F(), L(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
3787
3797
|
strikeDouble: e.strikeDouble,
|
|
3788
3798
|
letterSpacingPx: e.letterSpacingPx,
|
|
3789
3799
|
underlineStyle: e.underlineStyle,
|
|
@@ -3803,8 +3813,8 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3803
3813
|
continue;
|
|
3804
3814
|
}
|
|
3805
3815
|
if (s.type === "math") {
|
|
3806
|
-
let e =
|
|
3807
|
-
(s.display &&
|
|
3816
|
+
let e = Fn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * J * o * u, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
3817
|
+
(s.display && b > 0 || !N(n) && b > 0) && F(), k.push({
|
|
3808
3818
|
isTab: !1,
|
|
3809
3819
|
width: n
|
|
3810
3820
|
}), y.segments.push({
|
|
@@ -3821,12 +3831,12 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3821
3831
|
ascent: i,
|
|
3822
3832
|
descent: c
|
|
3823
3833
|
}
|
|
3824
|
-
}),
|
|
3834
|
+
}), b += n, s.display && F();
|
|
3825
3835
|
continue;
|
|
3826
3836
|
}
|
|
3827
|
-
let p = s.fontSize == null ? r : s.fontSize * J * o * u, m =
|
|
3837
|
+
let p = s.fontSize == null ? r : s.fontSize * J * o * u, m = er(p, s.baseline ?? void 0), g = zn(s.fontFamily ?? t.defFontFamily ?? null, f), C = s.fontFamilyEa ? zn(s.fontFamilyEa, f) : null, w = s.fontFamilySym ? zn(s.fontFamilySym, f) : null, T;
|
|
3828
3838
|
T = s.color ? Z(s.color) : s.hyperlink && f.themeHlinkColor ? Z(f.themeHlinkColor) : a;
|
|
3829
|
-
let
|
|
3839
|
+
let E = s.bold ?? t.defBold ?? c, j = s.italic ?? t.defItalic ?? l, M = Xn(E, j, m, g, f), B = C ? Xn(E, j, m, C, f) : M;
|
|
3830
3840
|
e.font = M;
|
|
3831
3841
|
let H = s.caps, U = h.get(s) ?? s.text;
|
|
3832
3842
|
(H === "all" || H === "small") && (U = U.toUpperCase());
|
|
@@ -3840,14 +3850,14 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3840
3850
|
outline: s.outline,
|
|
3841
3851
|
fontFamily: g,
|
|
3842
3852
|
highlight: s.highlight ? Z(s.highlight) : void 0,
|
|
3843
|
-
hyperlink:
|
|
3853
|
+
hyperlink: an(s.hyperlink),
|
|
3844
3854
|
sourceRunId: n,
|
|
3845
3855
|
drawSizePx: m
|
|
3846
3856
|
}, q = ee.split(/(\s+)/);
|
|
3847
3857
|
for (let r of q) {
|
|
3848
3858
|
if (!r) continue;
|
|
3849
3859
|
if (/^\t+$/.test(r)) {
|
|
3850
|
-
|
|
3860
|
+
D || (e.font = M, A = e.measureText(" ").width);
|
|
3851
3861
|
for (let e of r) y.segments.push({
|
|
3852
3862
|
text: "",
|
|
3853
3863
|
isTab: !0,
|
|
@@ -3861,27 +3871,27 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3861
3871
|
isTab: !0,
|
|
3862
3872
|
width: 0
|
|
3863
3873
|
});
|
|
3864
|
-
|
|
3874
|
+
D = !0;
|
|
3865
3875
|
continue;
|
|
3866
3876
|
}
|
|
3867
3877
|
e.font = M;
|
|
3868
|
-
let a =
|
|
3869
|
-
if (c.test(r) && (w != null ||
|
|
3878
|
+
let a = I(r, M, G, n), o = /^\s+$/.test(r), c = /[-]/;
|
|
3879
|
+
if (c.test(r) && (w != null || _e(g))) {
|
|
3870
3880
|
let t = w ?? g;
|
|
3871
3881
|
for (let i of r) {
|
|
3872
3882
|
let r = i, a = M;
|
|
3873
3883
|
if (c.test(i)) {
|
|
3874
|
-
let e =
|
|
3875
|
-
e === i ? a =
|
|
3884
|
+
let e = xe(i, t);
|
|
3885
|
+
e === i ? a = Xn(E, j, m, t, f) : (r = e, a = Xn(E, j, m, "sans-serif", f));
|
|
3876
3886
|
}
|
|
3877
|
-
e.font = a, !N(
|
|
3887
|
+
e.font = a, !N(I(r, a, G, n)) && b > 0 && F(), L(r, a, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3878
3888
|
}
|
|
3879
3889
|
continue;
|
|
3880
3890
|
}
|
|
3881
|
-
if (
|
|
3891
|
+
if (nr(r) && (!V(r) || t.eaLnBrk === !1)) {
|
|
3882
3892
|
let i = [];
|
|
3883
3893
|
for (let t of r) {
|
|
3884
|
-
let n =
|
|
3894
|
+
let n = le(t.codePointAt(0) ?? 0) && C != null, r = n ? B : M, a = n ? C : g;
|
|
3885
3895
|
e.font = r, i.push({
|
|
3886
3896
|
ch: t,
|
|
3887
3897
|
w: Q(e, t, 0),
|
|
@@ -3891,8 +3901,8 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3891
3901
|
}
|
|
3892
3902
|
if (t.eaLnBrk === !1) {
|
|
3893
3903
|
let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * G + (t && i.length > 0 ? G : 0);
|
|
3894
|
-
|
|
3895
|
-
for (let e of i)
|
|
3904
|
+
b > 0 && !N(r) && F();
|
|
3905
|
+
for (let e of i) L(e.ch, e.font, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3896
3906
|
...K,
|
|
3897
3907
|
fontFamily: e.family
|
|
3898
3908
|
});
|
|
@@ -3900,9 +3910,9 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3900
3910
|
}
|
|
3901
3911
|
let a = i;
|
|
3902
3912
|
for (; a.length > 0;) {
|
|
3903
|
-
let e = Number.isFinite(v()) ? v() - P() :
|
|
3913
|
+
let e = Number.isFinite(v()) ? v() - P() : b, t = y.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = dn(a, e, v(), _, G, r);
|
|
3904
3914
|
if (i === 0) {
|
|
3905
|
-
if (
|
|
3915
|
+
if (b > 0) {
|
|
3906
3916
|
F();
|
|
3907
3917
|
continue;
|
|
3908
3918
|
}
|
|
@@ -3910,7 +3920,7 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3910
3920
|
}
|
|
3911
3921
|
for (let e = 0; e < i; e++) {
|
|
3912
3922
|
let t = a[e];
|
|
3913
|
-
|
|
3923
|
+
L(t.ch, t.font, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3914
3924
|
...K,
|
|
3915
3925
|
fontFamily: t.family
|
|
3916
3926
|
});
|
|
@@ -3919,13 +3929,13 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3919
3929
|
}
|
|
3920
3930
|
continue;
|
|
3921
3931
|
}
|
|
3922
|
-
if (
|
|
3923
|
-
let t =
|
|
3932
|
+
if (V(r)) {
|
|
3933
|
+
let t = x(r, {
|
|
3924
3934
|
cjk: !0,
|
|
3925
3935
|
kinsoku: _
|
|
3926
|
-
}), i = C != null &&
|
|
3936
|
+
}), i = C != null && B !== M, a = (e) => i && le(e.codePointAt(0) ?? 0), o = (t) => {
|
|
3927
3937
|
let r = 0, i = y.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
|
|
3928
|
-
s !== "" && (e.font = c ?
|
|
3938
|
+
s !== "" && (e.font = c ? B : M, r += Q(e, s, G), o && (r += G), o = !0, s = "");
|
|
3929
3939
|
};
|
|
3930
3940
|
for (let e of t) {
|
|
3931
3941
|
let t = a(e);
|
|
@@ -3935,8 +3945,8 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3935
3945
|
}, c = (e) => {
|
|
3936
3946
|
let t = "", n = null, r = () => {
|
|
3937
3947
|
if (t === "") return;
|
|
3938
|
-
let e = n ?
|
|
3939
|
-
|
|
3948
|
+
let e = n ? B : M, r = n ? C : g;
|
|
3949
|
+
L(t, e, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3940
3950
|
...K,
|
|
3941
3951
|
fontFamily: r
|
|
3942
3952
|
}), t = "";
|
|
@@ -3946,40 +3956,40 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3946
3956
|
n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
|
|
3947
3957
|
}
|
|
3948
3958
|
r();
|
|
3949
|
-
}, l =
|
|
3959
|
+
}, l = fe(r), u = r.length, d = 0;
|
|
3950
3960
|
for (; d < u;) {
|
|
3951
|
-
let e = P(), n =
|
|
3961
|
+
let e = P(), n = z(r, t, d, e, o, l);
|
|
3952
3962
|
if (n <= d) {
|
|
3953
|
-
if (
|
|
3963
|
+
if (b > 0) {
|
|
3954
3964
|
F();
|
|
3955
3965
|
continue;
|
|
3956
3966
|
}
|
|
3957
|
-
let i = t.find((e) => e > d) ?? u, a = r.slice(d, i), s =
|
|
3967
|
+
let i = t.find((e) => e > d) ?? u, a = r.slice(d, i), s = O(a), c = z(a, s, 0, e, o, l);
|
|
3958
3968
|
c <= 0 && (c = s.length > 0 ? s[0] : a.length), n = d + c;
|
|
3959
3969
|
}
|
|
3960
3970
|
c(r.slice(d, n)), d = n, d < u && F();
|
|
3961
3971
|
}
|
|
3962
3972
|
continue;
|
|
3963
3973
|
}
|
|
3964
|
-
if (N(a))
|
|
3965
|
-
else if (o)
|
|
3974
|
+
if (N(a)) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K), o && (S = !0);
|
|
3975
|
+
else if (o) b > 0 && F();
|
|
3966
3976
|
else if (a > v()) {
|
|
3967
|
-
|
|
3968
|
-
for (let t of r) e.font = M, !N(
|
|
3969
|
-
} else if (!S)
|
|
3977
|
+
b > 0 && F();
|
|
3978
|
+
for (let t of r) e.font = M, !N(I(t, M, G, n)) && b > 0 && F(), L(t, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3979
|
+
} else if (!S) L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3970
3980
|
else {
|
|
3971
|
-
let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && _.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !
|
|
3972
|
-
(o || c) &&
|
|
3981
|
+
let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && _.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !V(e) && !V(r) && i(n, t);
|
|
3982
|
+
(o || c) && R() || F(), L(r, M, p, T, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3973
3983
|
}
|
|
3974
3984
|
}
|
|
3975
3985
|
}
|
|
3976
3986
|
return m.push(y), m;
|
|
3977
3987
|
}
|
|
3978
|
-
async function
|
|
3988
|
+
async function sr(e, t, n, r, i, o, s, c, l, u) {
|
|
3979
3989
|
if (t && t.fillType === "image") {
|
|
3980
3990
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !s) return;
|
|
3981
3991
|
try {
|
|
3982
|
-
let a = t.fillRect ?? {}, d = a.l ?? 0, f = a.t ?? 0, p = a.r ?? 0, m = a.b ?? 0, h = d * n, g = f * r, _ = n * (1 - d - p), v = r * (1 - f - m), y = u && !t.duotone ?
|
|
3992
|
+
let a = t.fillRect ?? {}, d = a.l ?? 0, f = a.t ?? 0, p = a.r ?? 0, m = a.b ?? 0, h = d * n, g = f * r, _ = n * (1 - d - p), v = r * (1 - f - m), y = u && !t.duotone ? On(u, X(t.imagePath, t.duotone)) : void 0, b = t.tile ? await B(t.imagePath, t.mimeType, s) : void 0, x = await Ye(t.imagePath, t.mimeType, t.duotone, s, {
|
|
3983
3993
|
widthPt: n / i / J,
|
|
3984
3994
|
heightPt: r / i / J,
|
|
3985
3995
|
...y ?? {},
|
|
@@ -3987,10 +3997,10 @@ async function or(e, t, n, r, i, o, s, c, l, u) {
|
|
|
3987
3997
|
svgDecoder: l
|
|
3988
3998
|
});
|
|
3989
3999
|
if (o() || !x) return;
|
|
3990
|
-
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ?
|
|
4000
|
+
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? dr(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : Me(e, x, t.srcRect, h, g, _, v), e.restore();
|
|
3991
4001
|
} catch (t) {
|
|
3992
4002
|
if (a(t, "tiff")) {
|
|
3993
|
-
|
|
4003
|
+
ue(e, "tiff", {
|
|
3994
4004
|
x: 0,
|
|
3995
4005
|
y: 0,
|
|
3996
4006
|
width: n,
|
|
@@ -3998,14 +4008,14 @@ async function or(e, t, n, r, i, o, s, c, l, u) {
|
|
|
3998
4008
|
});
|
|
3999
4009
|
return;
|
|
4000
4010
|
}
|
|
4001
|
-
if (
|
|
4011
|
+
if (Re(t) || Je(t)) throw t;
|
|
4002
4012
|
}
|
|
4003
4013
|
return;
|
|
4004
4014
|
}
|
|
4005
|
-
e.fillStyle =
|
|
4015
|
+
e.fillStyle = Pn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
4006
4016
|
}
|
|
4007
|
-
var
|
|
4008
|
-
function
|
|
4017
|
+
var cr = 9525;
|
|
4018
|
+
function lr(e, t, n, r, i) {
|
|
4009
4019
|
let a;
|
|
4010
4020
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4011
4021
|
let o;
|
|
@@ -4014,52 +4024,52 @@ function cr(e, t, n, r, i) {
|
|
|
4014
4024
|
ay: o
|
|
4015
4025
|
};
|
|
4016
4026
|
}
|
|
4017
|
-
function
|
|
4027
|
+
function ur(e, t, n) {
|
|
4018
4028
|
return {
|
|
4019
4029
|
width: e * (n ? 1 - n.l - n.r : 1),
|
|
4020
4030
|
height: t * (n ? 1 - n.t - n.b : 1)
|
|
4021
4031
|
};
|
|
4022
4032
|
}
|
|
4023
|
-
function
|
|
4024
|
-
let c =
|
|
4033
|
+
function dr(e, t, n, r, i, a, o, s) {
|
|
4034
|
+
let c = ur(s?.width ?? t.width, s?.height ?? t.height, o), l = c.width * cr * (n.sx ?? 1) * a, u = c.height * cr * (n.sy ?? 1) * a;
|
|
4025
4035
|
if (!(l > 0) || !(u > 0)) return;
|
|
4026
|
-
let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p =
|
|
4036
|
+
let d = n.flip === "x" || n.flip === "xy", f = n.flip === "y" || n.flip === "xy", p = je(l * (d ? 2 : 1), u * (f ? 2 : 1));
|
|
4027
4037
|
if (!p) return;
|
|
4028
4038
|
let m = p.getContext("2d");
|
|
4029
4039
|
if (!m) return;
|
|
4030
4040
|
let h = (e, n, r, i) => {
|
|
4031
|
-
m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1),
|
|
4041
|
+
m.save(), m.translate(e + (r ? l : 0), n + (i ? u : 0)), m.scale(r ? -1 : 1, i ? -1 : 1), Me(m, t, o, 0, 0, l, u), m.restore();
|
|
4032
4042
|
};
|
|
4033
4043
|
h(0, 0, !1, !1), d && h(l, 0, !0, !1), f && h(0, u, !1, !0), d && f && h(l, u, !0, !0);
|
|
4034
4044
|
let g = e.createPattern(p, "repeat");
|
|
4035
4045
|
if (!g) return;
|
|
4036
|
-
let { ax: _, ay: v } =
|
|
4046
|
+
let { ax: _, ay: v } = lr(n.algn ?? "tl", r, i, l, u), y = _ + Y(n.tx ?? 0, a), b = v + Y(n.ty ?? 0, a);
|
|
4037
4047
|
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());
|
|
4038
4048
|
}
|
|
4039
|
-
function
|
|
4049
|
+
function fr(e, t, n) {
|
|
4040
4050
|
if (!t) return;
|
|
4041
4051
|
let r = t.dir * Math.PI / 180, i = Y(t.dist, n);
|
|
4042
4052
|
e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4043
4053
|
}
|
|
4044
|
-
function
|
|
4054
|
+
function pr(e, t, n) {
|
|
4045
4055
|
t && (e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = Y(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4046
4056
|
}
|
|
4047
|
-
function
|
|
4057
|
+
function mr(e) {
|
|
4048
4058
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4049
4059
|
}
|
|
4050
|
-
var
|
|
4051
|
-
function
|
|
4060
|
+
var hr = 8, gr = 1, _r = 1, vr = 256;
|
|
4061
|
+
function yr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
4052
4062
|
if (r <= 0) return;
|
|
4053
|
-
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(
|
|
4054
|
-
for (; w >
|
|
4055
|
-
let e = Math.min(
|
|
4063
|
+
let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(vr, Math.max(1, Math.round(b / hr))), S = (e) => Sr(e, a, r, o, s, c, u, d), C = S(x), w = wr(C, a, o, s, c, u, d, l, i, -g, _);
|
|
4064
|
+
for (; w > _r && x < vr;) {
|
|
4065
|
+
let e = Math.min(vr, x * 2), t = S(e), n = wr(t, a, o, s, c, u, d, l, i, -g, _);
|
|
4056
4066
|
if (n >= w * .75) {
|
|
4057
4067
|
C = t;
|
|
4058
4068
|
break;
|
|
4059
4069
|
}
|
|
4060
4070
|
x = e, C = t, w = n;
|
|
4061
4071
|
}
|
|
4062
|
-
let T = 1e4, E =
|
|
4072
|
+
let T = 1e4, E = gr / (l * i), D = C.length - 1, O = (e, t, n) => e === 0 ? -T : t - n - E, k = (e, t, n) => e === D ? T : t - n + E, A = (e, r) => {
|
|
4063
4073
|
e.fillStyle = r;
|
|
4064
4074
|
for (let r = 0; r <= D; r++) {
|
|
4065
4075
|
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
@@ -4067,7 +4077,7 @@ function vr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
4067
4077
|
let c = O(r, i, s), u = k(r, a, s);
|
|
4068
4078
|
e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4069
4079
|
}
|
|
4070
|
-
}, j =
|
|
4080
|
+
}, j = br(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4071
4081
|
if (j >= 1 && M >= 1) {
|
|
4072
4082
|
A(e, m);
|
|
4073
4083
|
return;
|
|
@@ -4087,67 +4097,67 @@ function vr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
4087
4097
|
[s, _],
|
|
4088
4098
|
[c, _]
|
|
4089
4099
|
]) {
|
|
4090
|
-
let n =
|
|
4100
|
+
let n = Cr(i, l, e, t), r = f + n.x, a = p + n.y, o = N.a * r + N.c * a + N.e, s = N.b * r + N.d * a + N.f;
|
|
4091
4101
|
o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
|
|
4092
4102
|
}
|
|
4093
4103
|
}
|
|
4094
4104
|
if (!(I > P && L > F)) return;
|
|
4095
|
-
let R = Math.floor(P - 2), z = Math.floor(F - 2), B =
|
|
4105
|
+
let R = Math.floor(P - 2), z = Math.floor(F - 2), B = je(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
|
|
4096
4106
|
if (!B || !V) {
|
|
4097
4107
|
A(e, m);
|
|
4098
4108
|
return;
|
|
4099
4109
|
}
|
|
4100
|
-
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,
|
|
4110
|
+
V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V, xr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
|
|
4101
4111
|
}
|
|
4102
|
-
function
|
|
4112
|
+
function br(e) {
|
|
4103
4113
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4104
4114
|
if (!t) return 1;
|
|
4105
4115
|
let n = parseFloat(t[1]);
|
|
4106
4116
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4107
4117
|
}
|
|
4108
|
-
function
|
|
4118
|
+
function xr(e) {
|
|
4109
4119
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4110
4120
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4111
4121
|
}
|
|
4112
|
-
function
|
|
4122
|
+
function Sr(e, t, n, r, i, a, o, s) {
|
|
4113
4123
|
let c = Array(e);
|
|
4114
4124
|
for (let l = 0; l < e; l++) {
|
|
4115
4125
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4116
4126
|
c[l] = {
|
|
4117
4127
|
s0: u,
|
|
4118
4128
|
s1: d,
|
|
4119
|
-
g:
|
|
4129
|
+
g: pt(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4120
4130
|
};
|
|
4121
4131
|
}
|
|
4122
4132
|
return c;
|
|
4123
4133
|
}
|
|
4124
|
-
function
|
|
4134
|
+
function Cr(e, t, n, r) {
|
|
4125
4135
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4126
4136
|
return {
|
|
4127
4137
|
x: e.x + s * o - c * a,
|
|
4128
4138
|
y: e.y + c * o + s * a
|
|
4129
4139
|
};
|
|
4130
4140
|
}
|
|
4131
|
-
function
|
|
4141
|
+
function wr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4132
4142
|
let d = 0;
|
|
4133
4143
|
for (let f of e) {
|
|
4134
4144
|
let e = (f.s0 + f.s1) / 2;
|
|
4135
4145
|
for (let p of [f.s0, f.s1]) {
|
|
4136
|
-
let m =
|
|
4146
|
+
let m = pt(t, (n + p) / r * i, a, o);
|
|
4137
4147
|
for (let t of [l, u]) {
|
|
4138
|
-
let n =
|
|
4148
|
+
let n = Cr(m, s, 0, t), r = Cr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4139
4149
|
i > d && (d = i);
|
|
4140
4150
|
}
|
|
4141
4151
|
}
|
|
4142
4152
|
}
|
|
4143
4153
|
return d;
|
|
4144
4154
|
}
|
|
4145
|
-
function
|
|
4146
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4155
|
+
function Tr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4156
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = lt(n, r, p, m);
|
|
4147
4157
|
if (!h) return;
|
|
4148
4158
|
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * J * c, y = [];
|
|
4149
4159
|
for (let n of t.paragraphs) {
|
|
4150
|
-
let t =
|
|
4160
|
+
let t = or(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * J * c, n.defColor ? Z(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4151
4161
|
for (let e of t) y.push(e);
|
|
4152
4162
|
}
|
|
4153
4163
|
if (y.length === 0) return;
|
|
@@ -4166,10 +4176,10 @@ function wr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4166
4176
|
}
|
|
4167
4177
|
e.font = t.font;
|
|
4168
4178
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4169
|
-
a += r.width + n *
|
|
4179
|
+
a += r.width + n * rr(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
|
|
4170
4180
|
}
|
|
4171
4181
|
if (a <= 0) continue;
|
|
4172
|
-
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 =
|
|
4182
|
+
let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = ft(h, a), b = 0;
|
|
4173
4183
|
for (let t of n.segments) {
|
|
4174
4184
|
if (t.math) {
|
|
4175
4185
|
b += t.math.width;
|
|
@@ -4180,17 +4190,17 @@ function wr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4180
4190
|
for (let s of o) {
|
|
4181
4191
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4182
4192
|
if (!h.singleEdge && o > 0) {
|
|
4183
|
-
|
|
4193
|
+
yr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4184
4194
|
continue;
|
|
4185
4195
|
}
|
|
4186
|
-
let l =
|
|
4196
|
+
let l = pt(h, (b + o / 2) / a * v, _, c);
|
|
4187
4197
|
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;
|
|
4188
4198
|
}
|
|
4189
4199
|
}
|
|
4190
4200
|
}
|
|
4191
4201
|
e.restore();
|
|
4192
4202
|
}
|
|
4193
|
-
function
|
|
4203
|
+
function Er(e, t, n, r, i, a, o) {
|
|
4194
4204
|
let s = Math.min(r, i);
|
|
4195
4205
|
switch (e) {
|
|
4196
4206
|
case "rightarrow":
|
|
@@ -4220,17 +4230,17 @@ function Tr(e, t, n, r, i, a, o) {
|
|
|
4220
4230
|
default: return null;
|
|
4221
4231
|
}
|
|
4222
4232
|
}
|
|
4223
|
-
function
|
|
4224
|
-
return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null &&
|
|
4233
|
+
function Dr(e, t) {
|
|
4234
|
+
return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null && yn(e) ? t.smartArtFallbackTextColor : null;
|
|
4225
4235
|
}
|
|
4226
|
-
function
|
|
4236
|
+
function Or(e, t, n) {
|
|
4227
4237
|
return {
|
|
4228
4238
|
outerRotation: e,
|
|
4229
4239
|
localFlipH: t,
|
|
4230
4240
|
localFlipV: n
|
|
4231
4241
|
};
|
|
4232
4242
|
}
|
|
4233
|
-
function
|
|
4243
|
+
function kr(e, t, n, r, i) {
|
|
4234
4244
|
let a = [
|
|
4235
4245
|
{
|
|
4236
4246
|
x: t,
|
|
@@ -4259,7 +4269,7 @@ function Or(e, t, n, r, i) {
|
|
|
4259
4269
|
h: l - s
|
|
4260
4270
|
};
|
|
4261
4271
|
}
|
|
4262
|
-
var
|
|
4272
|
+
var Ar = {
|
|
4263
4273
|
tl: [0, 0],
|
|
4264
4274
|
t: [.5, 0],
|
|
4265
4275
|
tr: [1, 0],
|
|
@@ -4270,15 +4280,15 @@ var kr = {
|
|
|
4270
4280
|
b: [.5, 1],
|
|
4271
4281
|
br: [1, 1]
|
|
4272
4282
|
};
|
|
4273
|
-
function
|
|
4283
|
+
function jr(e, t, n) {
|
|
4274
4284
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4275
4285
|
}
|
|
4276
|
-
function
|
|
4277
|
-
let [o, s] =
|
|
4278
|
-
return
|
|
4286
|
+
function Mr(e, t, n, r, i, a) {
|
|
4287
|
+
let [o, s] = Ar[a ?? "b"];
|
|
4288
|
+
return jr(e, t + o * r, n + s * i);
|
|
4279
4289
|
}
|
|
4280
|
-
function
|
|
4281
|
-
let c =
|
|
4290
|
+
function Nr(e, t, n, r, i, a, o, s) {
|
|
4291
|
+
let c = Ct(e, i, a).corners, l = (o > 0 ? Ke(c, o / i, o / a) ?? c : c).map((e) => jr(t, n + e.x, r + e.y)), u = l.map(([e]) => e), d = l.map(([, e]) => e), f = Math.min(...u), p = Math.min(...d), m = Math.max(...u), h = Math.max(...d), [g, _] = Ar[s ?? "b"], v = Ue(c, g, _);
|
|
4282
4292
|
return {
|
|
4283
4293
|
bbox: {
|
|
4284
4294
|
x: f,
|
|
@@ -4286,15 +4296,15 @@ function Mr(e, t, n, r, i, a, o, s) {
|
|
|
4286
4296
|
w: m - f,
|
|
4287
4297
|
h: h - p
|
|
4288
4298
|
},
|
|
4289
|
-
anchor: v ?
|
|
4299
|
+
anchor: v ? jr(t, n + v.x, r + v.y) : Mr(t, n, r, i, a, s)
|
|
4290
4300
|
};
|
|
4291
4301
|
}
|
|
4292
|
-
function
|
|
4302
|
+
function Pr(e, t, n, r) {
|
|
4293
4303
|
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);
|
|
4294
|
-
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) ||
|
|
4304
|
+
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || He(o, s).clamped) return e;
|
|
4295
4305
|
let c = null;
|
|
4296
4306
|
try {
|
|
4297
|
-
c =
|
|
4307
|
+
c = je(o, s);
|
|
4298
4308
|
} catch {
|
|
4299
4309
|
return e;
|
|
4300
4310
|
}
|
|
@@ -4313,7 +4323,7 @@ function Nr(e, t, n, r) {
|
|
|
4313
4323
|
e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
|
|
4314
4324
|
};
|
|
4315
4325
|
}
|
|
4316
|
-
function
|
|
4326
|
+
function Fr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4317
4327
|
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4318
4328
|
a: 1,
|
|
4319
4329
|
b: 0,
|
|
@@ -4328,9 +4338,9 @@ function Pr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
|
4328
4338
|
}, v = (e) => {
|
|
4329
4339
|
h(e), u(e);
|
|
4330
4340
|
}, y = !1;
|
|
4331
|
-
t.shadow && p ? (e.save(), e.setTransform(m), y = !
|
|
4341
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !Ge(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), Be(e, g, i, t.reflection, s, d, f), e.restore()), y ? fr(e, t.shadow ?? null, o) : t.glow && pr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Ve(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && mr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), We(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4332
4342
|
}
|
|
4333
|
-
function
|
|
4343
|
+
function Ir(e, t, r, i = "#000000", a, o = {
|
|
4334
4344
|
themeMajorFont: null,
|
|
4335
4345
|
themeMinorFont: null,
|
|
4336
4346
|
dpr: 1
|
|
@@ -4340,20 +4350,20 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4340
4350
|
shapeId: t.id
|
|
4341
4351
|
}) : s;
|
|
4342
4352
|
if (f === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4343
|
-
if (t.stroke && (e.save(),
|
|
4353
|
+
if (t.stroke && (e.save(), ei(e, t.stroke, r, {
|
|
4344
4354
|
x: l,
|
|
4345
4355
|
y: u,
|
|
4346
4356
|
w: d,
|
|
4347
4357
|
h: 1
|
|
4348
4358
|
}, t.rotation), e.beginPath(), e.moveTo(l, u), e.lineTo(l + d, u), e.stroke(), e.restore()), t.textBody) {
|
|
4349
|
-
let n =
|
|
4350
|
-
|
|
4359
|
+
let n = Dr(t, o);
|
|
4360
|
+
Hr(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, i, a, o, p, !1, c);
|
|
4351
4361
|
}
|
|
4352
4362
|
return;
|
|
4353
4363
|
}
|
|
4354
|
-
let h = t.scene3d &&
|
|
4364
|
+
let h = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null;
|
|
4355
4365
|
if (h && d > 0 && f > 0) {
|
|
4356
|
-
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p =
|
|
4366
|
+
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Ur(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Wr(t.sp3d, h.camera, d, f, r, c), g = Or(t.rotation, t.flipH, t.flipV);
|
|
4357
4367
|
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)));
|
|
4358
4368
|
let _ = {
|
|
4359
4369
|
...t,
|
|
@@ -4376,21 +4386,21 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4376
4386
|
..._,
|
|
4377
4387
|
fill: null,
|
|
4378
4388
|
stroke: null
|
|
4379
|
-
}, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2, x = (e, t, n) =>
|
|
4380
|
-
|
|
4389
|
+
}, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2, x = (e, t, n) => Gr(e, h.camera, l, u, d, f, (e) => {
|
|
4390
|
+
Ir(e, t, r, i, a, o, void 0);
|
|
4381
4391
|
}, n ? {
|
|
4382
4392
|
bevels: p,
|
|
4383
4393
|
extrusion: m ?? void 0,
|
|
4384
4394
|
edgePadCss: b
|
|
4385
4395
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4386
4396
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4387
|
-
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4397
|
+
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Nr(h.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Pr((e) => {
|
|
4388
4398
|
s = S(e) || s;
|
|
4389
4399
|
}, n, o.bbox, {
|
|
4390
4400
|
w: e.canvas.width || 0,
|
|
4391
4401
|
h: e.canvas.height || 0
|
|
4392
4402
|
});
|
|
4393
|
-
if (
|
|
4403
|
+
if (Fr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
|
|
4394
4404
|
C(e), e.restore();
|
|
4395
4405
|
return;
|
|
4396
4406
|
}
|
|
@@ -4401,9 +4411,9 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4401
4411
|
e.restore();
|
|
4402
4412
|
}
|
|
4403
4413
|
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)));
|
|
4404
|
-
let
|
|
4405
|
-
t.shadow ||
|
|
4406
|
-
let
|
|
4414
|
+
let _ = t.geometry.toLowerCase(), v = Pn(t.fill, e, l, u, d, f, t.rotation);
|
|
4415
|
+
t.shadow || pr(e, t.glow ?? null, r);
|
|
4416
|
+
let y = new Set([
|
|
4407
4417
|
"line",
|
|
4408
4418
|
"straightconnector1",
|
|
4409
4419
|
"bentconnector2",
|
|
@@ -4414,7 +4424,7 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4414
4424
|
"curvedconnector3",
|
|
4415
4425
|
"curvedconnector4",
|
|
4416
4426
|
"curvedconnector5"
|
|
4417
|
-
]),
|
|
4427
|
+
]), b = new Set([
|
|
4418
4428
|
"callout1",
|
|
4419
4429
|
"callout2",
|
|
4420
4430
|
"callout3",
|
|
@@ -4427,22 +4437,22 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4427
4437
|
"accentbordercallout1",
|
|
4428
4438
|
"accentbordercallout2",
|
|
4429
4439
|
"accentbordercallout3"
|
|
4430
|
-
]),
|
|
4440
|
+
]), x = (e) => b.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), S = !t.custGeom && m(_), C = (n, i, a = {
|
|
4431
4441
|
x: l,
|
|
4432
4442
|
y: u,
|
|
4433
4443
|
w: d,
|
|
4434
4444
|
h: f
|
|
4435
4445
|
}) => {
|
|
4436
|
-
let { x: o, y: s, w: c, h: p } = a,
|
|
4437
|
-
|
|
4446
|
+
let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? v : Pn(t.fill, n, o, s, c, p, t.rotation)), h = i ? null : t.stroke ? () => {
|
|
4447
|
+
ei(n, t.stroke, r, {
|
|
4438
4448
|
x: o,
|
|
4439
4449
|
y: s,
|
|
4440
4450
|
w: c,
|
|
4441
4451
|
h: p
|
|
4442
4452
|
}, t.rotation), n.stroke();
|
|
4443
|
-
} : null, y = () =>
|
|
4444
|
-
if (
|
|
4445
|
-
|
|
4453
|
+
} : null, y = () => mr(n);
|
|
4454
|
+
if (S && !i) {
|
|
4455
|
+
g(n, _, o, s, c, p, [
|
|
4446
4456
|
t.adj,
|
|
4447
4457
|
t.adj2,
|
|
4448
4458
|
t.adj3,
|
|
@@ -4451,11 +4461,11 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4451
4461
|
t.adj6,
|
|
4452
4462
|
t.adj7,
|
|
4453
4463
|
t.adj8
|
|
4454
|
-
],
|
|
4464
|
+
], m, h, y, x(_) ? { skipTrailingStroke: !0 } : void 0);
|
|
4455
4465
|
return;
|
|
4456
4466
|
}
|
|
4457
|
-
n.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4458
|
-
},
|
|
4467
|
+
n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Lr(n, t.custGeom, o, s, c, p) : he(n, _, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), m && _ !== "arc" && (n.fillStyle = m, _ === "donut" || _ === "smileyface" || _ === "frame" ? n.fill("evenodd") : n.fill(), i || y()), h && h();
|
|
4468
|
+
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? S ? W(_, l, u, d, f, [
|
|
4459
4469
|
t.adj,
|
|
4460
4470
|
t.adj2,
|
|
4461
4471
|
t.adj3,
|
|
@@ -4464,20 +4474,20 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4464
4474
|
t.adj6,
|
|
4465
4475
|
t.adj7,
|
|
4466
4476
|
t.adj8
|
|
4467
|
-
]) : t.custGeom && t.custGeom.length > 0 ?
|
|
4477
|
+
]) : t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, l, u, d, f) : null : null) ?? {
|
|
4468
4478
|
x: l,
|
|
4469
4479
|
y: u,
|
|
4470
4480
|
w: d,
|
|
4471
4481
|
h: f
|
|
4472
|
-
},
|
|
4473
|
-
x:
|
|
4474
|
-
y:
|
|
4475
|
-
w:
|
|
4476
|
-
h:
|
|
4477
|
-
} :
|
|
4478
|
-
let
|
|
4479
|
-
if (t.stroke && (
|
|
4480
|
-
let
|
|
4482
|
+
}, O = t.stroke ? t.stroke.width * r / 2 : 0, k = t.stroke ? Math.max(t.stroke.headEnd ? me(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? me(t.stroke.tailEnd, t.stroke, r) : 0) : 0, A = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, j = Math.max(O, k, A), M = j > 0 ? {
|
|
4483
|
+
x: D.x - j,
|
|
4484
|
+
y: D.y - j,
|
|
4485
|
+
w: D.w + j * 2,
|
|
4486
|
+
h: D.h + j * 2
|
|
4487
|
+
} : D, N = kr(w, M.x, M.y, M.w, M.h), P = r * E, F = h ? [] : Ur(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, E), I = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, L = (e) => {
|
|
4488
|
+
let i = t.stroke?.fill ? Pn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
|
|
4489
|
+
if (t.stroke && (y.has(_) || b.has(_))) {
|
|
4490
|
+
let a = n(_, l, u, d, f, [
|
|
4481
4491
|
t.adj,
|
|
4482
4492
|
t.adj2,
|
|
4483
4493
|
t.adj3,
|
|
@@ -4487,22 +4497,22 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4487
4497
|
t.adj7,
|
|
4488
4498
|
t.adj8
|
|
4489
4499
|
]);
|
|
4490
|
-
if (!
|
|
4491
|
-
let
|
|
4492
|
-
if (
|
|
4493
|
-
let n =
|
|
4500
|
+
if (!a) return;
|
|
4501
|
+
let o = t.stroke.cmpd, s = _ === "line" || _ === "straightconnector1";
|
|
4502
|
+
if (x(_) && a.vertices.length >= 2 && !(o && s)) {
|
|
4503
|
+
let n = a.vertices.map((e) => ({
|
|
4494
4504
|
x: e.x,
|
|
4495
4505
|
y: e.y
|
|
4496
4506
|
}));
|
|
4497
4507
|
if (t.stroke.tailEnd) {
|
|
4498
|
-
let e =
|
|
4499
|
-
n[n.length - 1] =
|
|
4508
|
+
let e = be(t.stroke.tailEnd, t.stroke, r);
|
|
4509
|
+
n[n.length - 1] = Ce(n[n.length - 1], n[n.length - 2], e);
|
|
4500
4510
|
}
|
|
4501
4511
|
if (t.stroke.headEnd) {
|
|
4502
|
-
let e =
|
|
4503
|
-
n[0] =
|
|
4512
|
+
let e = be(t.stroke.headEnd, t.stroke, r);
|
|
4513
|
+
n[0] = Ce(n[0], n[1], e);
|
|
4504
4514
|
}
|
|
4505
|
-
|
|
4515
|
+
ei(e, t.stroke, r, {
|
|
4506
4516
|
x: l,
|
|
4507
4517
|
y: u,
|
|
4508
4518
|
w: d,
|
|
@@ -4511,46 +4521,46 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4511
4521
|
for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
|
|
4512
4522
|
e.stroke();
|
|
4513
4523
|
}
|
|
4514
|
-
|
|
4524
|
+
o && s && $r(e, a.start, a.end, t.stroke, o, r, t.rotation), t.stroke.tailEnd && ve(e, a.end.x, a.end.y, a.end.angle, t.stroke.tailEnd, t.stroke, r, i), t.stroke.headEnd && ve(e, a.start.x, a.start.y, a.start.angle, t.stroke.headEnd, t.stroke, r, i);
|
|
4515
4525
|
return;
|
|
4516
4526
|
}
|
|
4517
4527
|
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;
|
|
4518
|
-
let { start:
|
|
4519
|
-
|
|
4520
|
-
},
|
|
4521
|
-
if (
|
|
4528
|
+
let { start: a, end: o } = ye(t.custGeom);
|
|
4529
|
+
a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ve(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.headEnd, t.stroke, r, i), o && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ve(e, l + o.x * d, u + o.y * f, Math.atan2(o.dy * f, o.dx * d), t.stroke.tailEnd, t.stroke, r, i);
|
|
4530
|
+
}, R = (e) => {
|
|
4531
|
+
if (F.length > 0 && Kr(e, l, u, d, f, F, (e, t, n, r, i) => C(e, void 0, {
|
|
4522
4532
|
x: t,
|
|
4523
4533
|
y: n,
|
|
4524
4534
|
w: r,
|
|
4525
4535
|
h: i
|
|
4526
|
-
}), void 0,
|
|
4527
|
-
|
|
4536
|
+
}), void 0, I)) {
|
|
4537
|
+
L(e), mr(e);
|
|
4528
4538
|
return;
|
|
4529
4539
|
}
|
|
4530
|
-
|
|
4540
|
+
C(e), L(e);
|
|
4531
4541
|
};
|
|
4532
|
-
if (
|
|
4533
|
-
let n =
|
|
4542
|
+
if (Fr(e, t, R, R, N, Mr(w, l, u, d, f, t.shadow?.algn), r, P, w, !!v, (e) => C(e, "#000")), t.textBody) {
|
|
4543
|
+
let n = Dr(t, o);
|
|
4534
4544
|
if (e.save(), t.flipH || t.flipV) {
|
|
4535
4545
|
let n = l + d / 2, r = u + f / 2;
|
|
4536
4546
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4537
4547
|
}
|
|
4538
|
-
let s = l, m = u, h = d,
|
|
4539
|
-
if (t.textRect) s = Y(t.textRect.x, r), m = Y(t.textRect.y, r), h = Y(t.textRect.width, r),
|
|
4540
|
-
else if (
|
|
4548
|
+
let s = l, m = u, h = d, g = f;
|
|
4549
|
+
if (t.textRect) s = Y(t.textRect.x, r), m = Y(t.textRect.y, r), h = Y(t.textRect.width, r), g = Y(t.textRect.height, r);
|
|
4550
|
+
else if (_ === "ellipse") {
|
|
4541
4551
|
let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
|
|
4542
|
-
s = l + e, m = u + t, h = d / Math.SQRT2,
|
|
4552
|
+
s = l + e, m = u + t, h = d / Math.SQRT2, g = f / Math.SQRT2;
|
|
4543
4553
|
} else {
|
|
4544
|
-
let e =
|
|
4545
|
-
e && (s = e.tx, m = e.ty, h = e.tw,
|
|
4554
|
+
let e = Er(_, l, u, d, f, t.adj, t.adj2);
|
|
4555
|
+
e && (s = e.tx, m = e.ty, h = e.tw, g = e.th);
|
|
4546
4556
|
}
|
|
4547
|
-
|
|
4557
|
+
Hr(e, t.textBody, s, m, h, g, r, n, t.rotation, !1, !1, i, a, o, p, !1, c), e.restore();
|
|
4548
4558
|
}
|
|
4549
4559
|
e.restore();
|
|
4550
4560
|
}
|
|
4551
|
-
var
|
|
4552
|
-
function
|
|
4553
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4561
|
+
var Lr = Te;
|
|
4562
|
+
function Rr(e, t) {
|
|
4563
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = zr(e).toLowerCase(), o = zr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4554
4564
|
switch (t) {
|
|
4555
4565
|
case "arabicPlain": return n;
|
|
4556
4566
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4577,7 +4587,7 @@ function Lr(e, t) {
|
|
|
4577
4587
|
default: return `${n}.`;
|
|
4578
4588
|
}
|
|
4579
4589
|
}
|
|
4580
|
-
function
|
|
4590
|
+
function zr(e) {
|
|
4581
4591
|
let t = [
|
|
4582
4592
|
1e3,
|
|
4583
4593
|
900,
|
|
@@ -4610,21 +4620,21 @@ function Rr(e) {
|
|
|
4610
4620
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4611
4621
|
return r;
|
|
4612
4622
|
}
|
|
4613
|
-
function
|
|
4623
|
+
function Br(e) {
|
|
4614
4624
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4615
4625
|
return !1;
|
|
4616
4626
|
}
|
|
4617
|
-
function
|
|
4618
|
-
let n =
|
|
4619
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4627
|
+
function Vr(e, t) {
|
|
4628
|
+
let n = Br(e);
|
|
4629
|
+
if (e.bullet.type === "char") return t.clear(), n ? xe(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4620
4630
|
if (e.bullet.type === "autoNum") {
|
|
4621
4631
|
if (!n) return "";
|
|
4622
4632
|
let r = e.lvl;
|
|
4623
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4633
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Rr(t.get(r), e.bullet.numType);
|
|
4624
4634
|
}
|
|
4625
4635
|
return t.clear(), "";
|
|
4626
4636
|
}
|
|
4627
|
-
function
|
|
4637
|
+
function Hr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
|
|
4628
4638
|
themeMajorFont: null,
|
|
4629
4639
|
themeMinorFont: null,
|
|
4630
4640
|
dpr: 1
|
|
@@ -4643,21 +4653,21 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4643
4653
|
textBodyRotation: d
|
|
4644
4654
|
}) : void 0;
|
|
4645
4655
|
if (g) return a;
|
|
4646
|
-
t.save(), t.translate(e, u), t.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4656
|
+
t.save(), t.translate(e, u), t.rotate(x ? -Math.PI / 2 : Math.PI / 2), Hr(t, {
|
|
4647
4657
|
...n,
|
|
4648
4658
|
vert: "horz"
|
|
4649
4659
|
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, f, p, m, v, !1, _, n.vert === "eaVert"), t.restore();
|
|
4650
4660
|
return;
|
|
4651
4661
|
}
|
|
4652
4662
|
let S = n.textWarp;
|
|
4653
|
-
if (!g && S &&
|
|
4654
|
-
|
|
4663
|
+
if (!g && S && it(S.preset)) {
|
|
4664
|
+
Tr(t, n, S.preset, S.adj ?? [], r, i, a, o, s, c ?? f, m);
|
|
4655
4665
|
return;
|
|
4656
4666
|
}
|
|
4657
|
-
let C = Y(n.lIns, s), w = Y(n.rIns, s), T = Y(n.tIns, s), E = Y(n.bIns, s),
|
|
4667
|
+
let C = Y(n.lIns, s), w = Y(n.rIns, s), T = Y(n.tIns, s), E = Y(n.bIns, s), D = n.wrap !== "none", O = n.autoFit === "sp" ? D && tr(t, n, a, C, w, s, m) : D, A = Math.max(1, n.numCol ?? 1), j = Y(n.spcCol ?? 0, s), M = n.defaultBold ?? !1, N = n.defaultItalic ?? !1, P = c ?? f, F = (e) => {
|
|
4658
4668
|
let i = (n.defaultFontSize ?? 18) * J * s * e, o = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4659
4669
|
for (let u = 0; u < n.paragraphs.length; u++) {
|
|
4660
|
-
let d = n.paragraphs[u], f = Y(d.marL, s), h = Y(d.marR, s), _ = Y(d.indent, s), v = d.defFontSize == null ? i : d.defFontSize * J * s * e, b = d.defColor ? Z(d.defColor) : P, x =
|
|
4670
|
+
let d = n.paragraphs[u], f = Y(d.marL, s), h = Y(d.marR, s), _ = Y(d.indent, s), v = d.defFontSize == null ? i : d.defFontSize * J * s * e, b = d.defColor ? Z(d.defColor) : P, x = Zn(d), S = (() => {
|
|
4661
4671
|
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4662
4672
|
return d.defFontSize ?? n.defaultFontSize ?? 18;
|
|
4663
4673
|
})() * J * s * e, T = (() => {
|
|
@@ -4666,34 +4676,34 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4666
4676
|
})(), E = T ? Z(T) : b, D = (() => {
|
|
4667
4677
|
for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4668
4678
|
return d.defFontFamily ?? null;
|
|
4669
|
-
})(),
|
|
4670
|
-
|
|
4671
|
-
let R =
|
|
4679
|
+
})(), k = "", F = Xn(!1, !1, S, "sans-serif", m), I = E, L = null;
|
|
4680
|
+
k = Vr(d, l);
|
|
4681
|
+
let R = $e(d.bullet);
|
|
4672
4682
|
if (R.type === "char") {
|
|
4673
4683
|
let t = R;
|
|
4674
|
-
F =
|
|
4684
|
+
F = Xn(!1, !1, t.sizePts == null ? t.sizePct == null ? S : S * (t.sizePct / 100) : t.sizePts * J * s * e, k === t.char ? zn(t.fontFamily ?? null, m) : "sans-serif", m), I = t.color ? Z(t.color) : E;
|
|
4675
4685
|
} else if (R.type === "autoNum") {
|
|
4676
4686
|
let t = R;
|
|
4677
|
-
F =
|
|
4687
|
+
F = Xn(!1, !1, t.sizePts == null ? t.sizePct == null ? S : S * (t.sizePct / 100) : t.sizePts * J * s * e, zn(t.fontFamily ?? D, m), m), I = R.color ? Z(R.color) : E;
|
|
4678
4688
|
} else if (R.type === "blip") {
|
|
4679
|
-
let t = R, r =
|
|
4689
|
+
let t = R, r = Qn(n, d, t) * J * s * e;
|
|
4680
4690
|
L = {
|
|
4681
4691
|
imagePath: t.imagePath,
|
|
4682
4692
|
mimeType: t.mimeType,
|
|
4683
4693
|
sizePx: r
|
|
4684
4694
|
};
|
|
4685
4695
|
}
|
|
4686
|
-
let z = A > 1 ? (a - C - w - (A - 1) * j) / A : a - C - w, B = r + C + f, V = r + C + f + _, H = z - f - h, U =
|
|
4696
|
+
let z = A > 1 ? (a - C - w - (A - 1) * j) / A : a - C - w, B = r + C + f, V = r + C + f + _, H = z - f - h, U = or(t, d, O ? H : Infinity, v, b, s, f, M, N, e, p, m, $n(x, _)), ee = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * J * s * e, W = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * J * s * e;
|
|
4687
4697
|
for (let e = 0; e < U.length; e++) {
|
|
4688
4698
|
let r = U[e], i = e === 0, a = e === U.length - 1, l = 0, f = 0;
|
|
4689
4699
|
for (let e of r.segments) {
|
|
4690
4700
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4691
4701
|
if (t > l && (l = t), !e.math) {
|
|
4692
|
-
let t =
|
|
4702
|
+
let t = q(e.fontFamily, e.sizePx);
|
|
4693
4703
|
t > f && (f = t);
|
|
4694
4704
|
}
|
|
4695
4705
|
}
|
|
4696
|
-
if (l === 0 && (l = v), i &&
|
|
4706
|
+
if (l === 0 && (l = v), i && k) {
|
|
4697
4707
|
t.font = F;
|
|
4698
4708
|
let e = t.measureText("M"), n = e.actualBoundingBoxAscent + e.actualBoundingBoxDescent;
|
|
4699
4709
|
n > l && (l = n);
|
|
@@ -4701,14 +4711,14 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4701
4711
|
i && L && L.sizePx > l && (l = L.sizePx);
|
|
4702
4712
|
let p = l * 1.2, m = Math.max(p, f), h;
|
|
4703
4713
|
h = d.spaceLine ? d.spaceLine.type === "pct" ? (g ? l : p) * (d.spaceLine.val / 1e5) : d.spaceLine.val * J * s : g ? y ? p : l : m, n.autoFit === "norm" && n.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - n.lnSpcReduction);
|
|
4704
|
-
let b = h + (a ? W : 0), S = i && u > 0 ? ee : 0, C = i ?
|
|
4714
|
+
let b = h + (a ? W : 0), S = i && u > 0 ? ee : 0, C = i ? $n(x, _) : 0, w = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), T = i && w ? L : null;
|
|
4705
4715
|
o.push({
|
|
4706
4716
|
line: r,
|
|
4707
4717
|
linePx: b,
|
|
4708
4718
|
lineHeight: h,
|
|
4709
4719
|
topGapPx: S,
|
|
4710
4720
|
textXOffset: C,
|
|
4711
|
-
bulletLabel: i ?
|
|
4721
|
+
bulletLabel: i ? k : "",
|
|
4712
4722
|
bulletFont: F,
|
|
4713
4723
|
bulletColor: I,
|
|
4714
4724
|
bulletX: V,
|
|
@@ -4743,15 +4753,15 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4743
4753
|
o === 0 && R === "b" ? (B = T + L + E, z = i - B) : B = n.autoFit === "sp" ? Math.max(o, T + L + E) : o;
|
|
4744
4754
|
let V, H = Math.max(0, B - T - E);
|
|
4745
4755
|
V = R === "ctr" ? z + T + (H - L) / 2 : R === "b" ? z + B - E - L : z + T, t.save(), t.textAlign = "left", t.textBaseline = "alphabetic";
|
|
4746
|
-
let U = V, ee = A > 1 ? (a - C - w - (A - 1) * j) / A + j : 0, W = Math.max(0, B - T - E), te = I[I.length - 1],
|
|
4756
|
+
let U = V, ee = A > 1 ? (a - C - w - (A - 1) * j) / A + j : 0, W = Math.max(0, B - T - E), te = I[I.length - 1], G = te ? Math.max(0, te.linePx - te.lineHeight) : 0, K = L - G, ne = o === 0 || K <= W + .5, re = A > 1 && !ne ? Math.ceil(I.length / A) : I.length, ie = 0, ae = 0;
|
|
4747
4757
|
for (let c of I) {
|
|
4748
4758
|
let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = c;
|
|
4749
4759
|
A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, V = U), V += p, ae++;
|
|
4750
|
-
let T = (n.rtlCol ? A - 1 - ie : ie) * ee, E = c.textX + T,
|
|
4760
|
+
let T = (n.rtlCol ? A - 1 - ie : ie) * ee, E = c.textX + T, D = c.bulletX + T, O = c.textMaxW, j = c.para.rtl === !0, M = j || ln(u.segments), N = u.segments.some((e) => e.isTab);
|
|
4751
4761
|
if (N) {
|
|
4752
|
-
let e = Y(c.para.marL, s), n = Y(c.para.marR, s), r = j ? n : e + g, i =
|
|
4762
|
+
let e = Y(c.para.marL, s), n = Y(c.para.marR, s), r = j ? n : e + g, i = O + e + n;
|
|
4753
4763
|
t.font = u.segments.find((e) => e.isTab).font;
|
|
4754
|
-
let a = t.measureText(" ").width, o =
|
|
4764
|
+
let a = t.measureText(" ").width, o = xn(u.segments.map((e) => {
|
|
4755
4765
|
if (e.isTab) return {
|
|
4756
4766
|
isTab: !0,
|
|
4757
4767
|
width: 0
|
|
@@ -4786,7 +4796,7 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4786
4796
|
let n = t.measureText(e.text || "M"), r = e.letterSpacingPx ?? 0;
|
|
4787
4797
|
P += e.leadingLetterSpacingPx ?? 0, P += e.text ? Q(t, e.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent));
|
|
4788
4798
|
}
|
|
4789
|
-
let I = V + F, L = E +
|
|
4799
|
+
let I = V + F, L = E + O, R = S && _ ? m.pictureBulletImages?.has(S.imagePath) ? m.pictureBulletImages.get(S.imagePath) : k(S.imagePath, _) : void 0, z = 0;
|
|
4790
4800
|
if (M && j) {
|
|
4791
4801
|
if (y) t.font = b, z = t.measureText(y).width;
|
|
4792
4802
|
else if (S && R) {
|
|
@@ -4797,14 +4807,14 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4797
4807
|
if (y) if (t.font = b, t.fillStyle = x, M && j) {
|
|
4798
4808
|
let e = t.direction;
|
|
4799
4809
|
t.direction = "rtl", t.fillText(y, L - z, I), t.direction = e;
|
|
4800
|
-
} else t.fillText(y,
|
|
4810
|
+
} else t.fillText(y, D, I);
|
|
4801
4811
|
if (S && _ && R) {
|
|
4802
4812
|
let e = S.sizePx, n = R.height > 0 ? e * (R.width / R.height) : e, r = I - e;
|
|
4803
|
-
M && j ? t.drawImage(R, L - n, r, n, e) : t.drawImage(R,
|
|
4813
|
+
M && j ? t.drawImage(R, L - n, r, n, e) : t.drawImage(R, D, r, n, e);
|
|
4804
4814
|
}
|
|
4805
4815
|
let B = E + g, H;
|
|
4806
|
-
H = N ? j ? E +
|
|
4807
|
-
let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, te = w || (u.endsWithBreak ?? !1), G = (W && !M && !N ?
|
|
4816
|
+
H = N ? j ? E + O - z - P : B : C === "ctr" ? B + (O - g - P) / 2 : C === "r" ? E + O - z - P : B;
|
|
4817
|
+
let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, te = w || (u.endsWithBreak ?? !1), G = (W && !M && !N ? pn(u.segments, O - g, P, W, te) : null) ?? u.segments, K = M ? un(u.segments, j) : null, q = (e, t) => {
|
|
4808
4818
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4809
4819
|
let n = u.segments[Math.min(e, t)], r = u.segments[Math.max(e, t)];
|
|
4810
4820
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
@@ -4821,9 +4831,9 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4821
4831
|
}
|
|
4822
4832
|
let p = u.jext ?? 0, g = u.splitBefore, _ = u.perGap ?? 0, y = g && g.length > 0 ? g.length * _ : 0;
|
|
4823
4833
|
if (u.math) {
|
|
4824
|
-
let e =
|
|
4834
|
+
let e = Fn.get(u.math.nodes), n = u.math.width, r = u.math.ascent + u.math.descent;
|
|
4825
4835
|
if (e && n > 0 && r > 0) {
|
|
4826
|
-
let i = I - u.math.ascent, a =
|
|
4836
|
+
let i = I - u.math.ascent, a = In(e, u.color);
|
|
4827
4837
|
t.drawImage(a, H, i, n, r);
|
|
4828
4838
|
}
|
|
4829
4839
|
H += n, H += p;
|
|
@@ -4833,13 +4843,13 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4833
4843
|
let b = u.drawSizePx ?? u.sizePx, x = I + (u.baseline ? -(u.baseline / 1e5) * u.sizePx : 0), S = u.letterSpacingPx ?? 0;
|
|
4834
4844
|
if (u.highlight && u.text) {
|
|
4835
4845
|
let e = Q(t, u.text, S) + y + p;
|
|
4836
|
-
|
|
4846
|
+
Nn(t, H, x, e, b, u.highlight, u.color);
|
|
4837
4847
|
}
|
|
4838
4848
|
let C = u.shadow, w = (e, t, n, r) => {
|
|
4839
4849
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4840
|
-
if (S !== 0 &&
|
|
4850
|
+
if (S !== 0 && rr(t) > 1) {
|
|
4841
4851
|
let r = e, a = r.letterSpacing;
|
|
4842
|
-
if (
|
|
4852
|
+
if (ar(e)) {
|
|
4843
4853
|
r.letterSpacing = `${S}px`, i(t, n, x);
|
|
4844
4854
|
try {
|
|
4845
4855
|
r.letterSpacing = a;
|
|
@@ -4852,15 +4862,15 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4852
4862
|
}
|
|
4853
4863
|
}
|
|
4854
4864
|
} else i(t, n, x);
|
|
4855
|
-
}, T = (e) => Q(t, e, S), E = g && g.length > 0 ?
|
|
4865
|
+
}, T = (e) => Q(t, e, S), E = g && g.length > 0 ? en([...u.text], g, _, T) : null, D = [...u.text], O = !!g && g.length === D.length - 1 && D.length > 1, k = (e, t) => {
|
|
4856
4866
|
if (v) {
|
|
4857
4867
|
let n = O ? S + _ : S;
|
|
4858
|
-
|
|
4868
|
+
En(e, u.text, H, x, b, n, t);
|
|
4859
4869
|
return;
|
|
4860
4870
|
}
|
|
4861
4871
|
if (O) {
|
|
4862
4872
|
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = S + _;
|
|
4863
|
-
if (
|
|
4873
|
+
if (ar(e)) {
|
|
4864
4874
|
let t = e, i = t.letterSpacing;
|
|
4865
4875
|
t.letterSpacing = `${r}px`, n(u.text, H, x);
|
|
4866
4876
|
try {
|
|
@@ -4881,7 +4891,7 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4881
4891
|
if (e > 0 && n > 0) {
|
|
4882
4892
|
t.font = u.font;
|
|
4883
4893
|
let r = t.measureText(u.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : b * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : b * .2, o = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, l = t.getTransform(), d = Math.abs(l.a * l.d - l.b * l.c), f = d > 0 ? Math.sqrt(d) : 1;
|
|
4884
|
-
|
|
4894
|
+
Yn(t, (e) => {
|
|
4885
4895
|
e.font = u.font, e.fillStyle = u.color, k(e, "fill");
|
|
4886
4896
|
}, {
|
|
4887
4897
|
x: (H - o) * f,
|
|
@@ -4913,7 +4923,7 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4913
4923
|
shapeH: o,
|
|
4914
4924
|
rotation: l,
|
|
4915
4925
|
hyperlink: u.hyperlink
|
|
4916
|
-
}), u.underline &&
|
|
4926
|
+
}), u.underline && Qt(t, H, x, N + p, b, u.underlineColor ?? u.color, u.underlineStyle, m.dpr), u.strikethrough) {
|
|
4917
4927
|
let n = Math.max(1, b * .05);
|
|
4918
4928
|
t.strokeStyle = u.color, t.lineWidth = n, t.setLineDash([]);
|
|
4919
4929
|
let r = x - b * .32;
|
|
@@ -4931,9 +4941,9 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4931
4941
|
}
|
|
4932
4942
|
t.restore();
|
|
4933
4943
|
}
|
|
4934
|
-
function
|
|
4944
|
+
function Ur(e, t, n, r, i) {
|
|
4935
4945
|
if (!e) return [];
|
|
4936
|
-
let a =
|
|
4946
|
+
let a = Bt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Kt(n), s = r * i, c = [];
|
|
4937
4947
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4938
4948
|
widthPx: e.bevelT.w * s,
|
|
4939
4949
|
heightPx: e.bevelT.h * s,
|
|
@@ -4949,9 +4959,9 @@ function Hr(e, t, n, r, i) {
|
|
|
4949
4959
|
bottom: !0
|
|
4950
4960
|
}), c;
|
|
4951
4961
|
}
|
|
4952
|
-
function
|
|
4962
|
+
function Wr(e, t, n, r, i, a) {
|
|
4953
4963
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4954
|
-
let o = e.extrusionH * i * a, s =
|
|
4964
|
+
let o = e.extrusionH * i * a, s = Tt(t, n * a, r * a, o);
|
|
4955
4965
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4956
4966
|
let c = [
|
|
4957
4967
|
64,
|
|
@@ -4972,14 +4982,14 @@ function Ur(e, t, n, r, i, a) {
|
|
|
4972
4982
|
rgb: c
|
|
4973
4983
|
};
|
|
4974
4984
|
}
|
|
4975
|
-
function
|
|
4985
|
+
function Gr(e, t, n, r, i, a, o, s = {}) {
|
|
4976
4986
|
if (i <= 0 || a <= 0) return !1;
|
|
4977
|
-
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 =
|
|
4987
|
+
let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * u)), f = Ct(t, i, a), p = f.corners;
|
|
4978
4988
|
if (d > 0) {
|
|
4979
|
-
let e = d / u, t =
|
|
4989
|
+
let e = d / u, t = Ke(f.corners, e / i, e / a);
|
|
4980
4990
|
t ? p = t : d = 0;
|
|
4981
4991
|
}
|
|
4982
|
-
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ =
|
|
4992
|
+
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = je(h, g);
|
|
4983
4993
|
if (!_) return !1;
|
|
4984
4994
|
let v = _.getContext("2d");
|
|
4985
4995
|
if (!v) return !1;
|
|
@@ -4992,17 +5002,17 @@ function Wr(e, t, n, r, i, a, o, s = {}) {
|
|
|
4992
5002
|
});
|
|
4993
5003
|
if (s.extrusion) {
|
|
4994
5004
|
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
4995
|
-
|
|
5005
|
+
Zt(v, s.extrusion, x(e));
|
|
4996
5006
|
}
|
|
4997
|
-
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels)
|
|
4998
|
-
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()),
|
|
5007
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Xt(v, e, x(Math.ceil(e.widthPx) + 2));
|
|
5008
|
+
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), ze(_, e, h, g, p.map((e) => ({
|
|
4999
5009
|
x: n + e.x,
|
|
5000
5010
|
y: r + e.y
|
|
5001
5011
|
}))), !0;
|
|
5002
5012
|
}
|
|
5003
|
-
function
|
|
5013
|
+
function Kr(e, t, n, r, i, a, o, s, c = 0) {
|
|
5004
5014
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
5005
|
-
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 =
|
|
5015
|
+
let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = je(m, h);
|
|
5006
5016
|
if (!g) return !1;
|
|
5007
5017
|
let _ = g.getContext("2d");
|
|
5008
5018
|
if (!_) return !1;
|
|
@@ -5010,7 +5020,7 @@ function Gr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5010
5020
|
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
5011
5021
|
for (let e of a) {
|
|
5012
5022
|
let t = Math.ceil(e.widthPx) + 2;
|
|
5013
|
-
|
|
5023
|
+
Xt(_, e, {
|
|
5014
5024
|
x: f - t,
|
|
5015
5025
|
y: f - t,
|
|
5016
5026
|
w: v + 2 * t,
|
|
@@ -5019,17 +5029,17 @@ function Gr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5019
5029
|
}
|
|
5020
5030
|
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;
|
|
5021
5031
|
}
|
|
5022
|
-
var
|
|
5023
|
-
function
|
|
5024
|
-
let t =
|
|
5032
|
+
var qr = /* @__PURE__ */ new WeakMap();
|
|
5033
|
+
function Jr(e) {
|
|
5034
|
+
let t = qr.get(e);
|
|
5025
5035
|
return t || (t = async (t, n) => {
|
|
5026
5036
|
let r = await e(t);
|
|
5027
5037
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
5028
|
-
},
|
|
5038
|
+
}, qr.set(e, t)), t;
|
|
5029
5039
|
}
|
|
5030
|
-
function
|
|
5031
|
-
let o =
|
|
5032
|
-
return
|
|
5040
|
+
function Yr(e, t, n = Jr(t), r, i, a) {
|
|
5041
|
+
let o = Jr(t);
|
|
5042
|
+
return K(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
|
|
5033
5043
|
tiff: r,
|
|
5034
5044
|
svgDecoder: a,
|
|
5035
5045
|
...i ?? {}
|
|
@@ -5038,11 +5048,11 @@ function Jr(e, t, n = qr(t), r, i, a) {
|
|
|
5038
5048
|
return e;
|
|
5039
5049
|
});
|
|
5040
5050
|
}
|
|
5041
|
-
function
|
|
5051
|
+
function Xr(e, t, n) {
|
|
5042
5052
|
let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
|
|
5043
5053
|
e.save();
|
|
5044
5054
|
try {
|
|
5045
|
-
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))),
|
|
5055
|
+
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))), ue(e, "tiff", {
|
|
5046
5056
|
x: r,
|
|
5047
5057
|
y: i,
|
|
5048
5058
|
width: a,
|
|
@@ -5052,119 +5062,119 @@ function Yr(e, t, n) {
|
|
|
5052
5062
|
e.restore();
|
|
5053
5063
|
}
|
|
5054
5064
|
}
|
|
5055
|
-
async function
|
|
5056
|
-
if (
|
|
5057
|
-
let a = t.mimeType === "image/svg+xml",
|
|
5058
|
-
if (!
|
|
5059
|
-
let { widthPt:
|
|
5060
|
-
...
|
|
5061
|
-
targetWidthPx:
|
|
5062
|
-
targetHeightPx:
|
|
5063
|
-
...
|
|
5065
|
+
async function Zr(e, t, n, r, i, o, s = 1, c, l) {
|
|
5066
|
+
if (i) try {
|
|
5067
|
+
let a = t.mimeType === "image/svg+xml", u = Pe(t.mimeType, t.srcRect, t.width / J, t.height / J);
|
|
5068
|
+
if (!u) return;
|
|
5069
|
+
let { widthPt: d, heightPt: f } = u, p = Dn(Y(t.width, n), Y(t.height, n), s, t.srcRect), h = A(t) || a, g = h ? p : l && !t.duotone ? On(l, X(kn(t), h ? void 0 : t.duotone)) : void 0, _ = g && "maxRetainedPixels" in g ? g.maxRetainedPixels : void 0, y = {
|
|
5070
|
+
...g ? {
|
|
5071
|
+
targetWidthPx: g.targetWidthPx,
|
|
5072
|
+
targetHeightPx: g.targetHeightPx,
|
|
5073
|
+
..._ === void 0 ? {} : { maxRetainedPixels: _ }
|
|
5064
5074
|
} : {},
|
|
5065
|
-
workerDecoder:
|
|
5075
|
+
workerDecoder: c
|
|
5066
5076
|
}, b;
|
|
5067
|
-
if (
|
|
5068
|
-
b = await
|
|
5077
|
+
if (A(t)) try {
|
|
5078
|
+
b = await I(t.svgImagePath, i, y);
|
|
5069
5079
|
} catch {
|
|
5070
|
-
b = a ? await
|
|
5071
|
-
widthPt:
|
|
5072
|
-
heightPt:
|
|
5073
|
-
...
|
|
5074
|
-
tiff:
|
|
5080
|
+
b = a ? await I(t.imagePath, i, y) : await Ye(t.imagePath, t.mimeType, t.duotone, i, {
|
|
5081
|
+
widthPt: d,
|
|
5082
|
+
heightPt: f,
|
|
5083
|
+
...g ?? {},
|
|
5084
|
+
tiff: o
|
|
5075
5085
|
});
|
|
5076
5086
|
}
|
|
5077
|
-
else b = a ? await
|
|
5078
|
-
widthPt:
|
|
5079
|
-
heightPt:
|
|
5080
|
-
...
|
|
5081
|
-
tiff:
|
|
5087
|
+
else b = a ? await I(t.imagePath, i, y) : await Ye(t.imagePath, t.mimeType, t.duotone, i, {
|
|
5088
|
+
widthPt: d,
|
|
5089
|
+
heightPt: f,
|
|
5090
|
+
...g ?? {},
|
|
5091
|
+
tiff: o
|
|
5082
5092
|
});
|
|
5083
|
-
if (!b ||
|
|
5093
|
+
if (!b || r()) return;
|
|
5084
5094
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5085
|
-
let x = Y(t.x,
|
|
5095
|
+
let x = Y(t.x, n), S = Y(t.y, n), C = Y(t.width, n), w = Y(t.height, n);
|
|
5086
5096
|
(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)));
|
|
5087
5097
|
let T = (e, n, r, i, a) => {
|
|
5088
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
5098
|
+
t.custGeom && t.custGeom.length > 0 ? Lr(e, t.custGeom, n, r, i, a) : t.prstGeom && v(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
5089
5099
|
}, E = (e, t, n, r, i) => {
|
|
5090
5100
|
e.beginPath(), T(e, t, n, r, i);
|
|
5091
5101
|
}, D = (e, n, r, i, a) => {
|
|
5092
5102
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (E(e, n, r, i, a), e.clip());
|
|
5093
|
-
},
|
|
5094
|
-
t.stroke && (e.save(),
|
|
5095
|
-
x:
|
|
5103
|
+
}, O = (e, r, i, a, o) => {
|
|
5104
|
+
t.stroke && (e.save(), ei(e, t.stroke, n, {
|
|
5105
|
+
x: r,
|
|
5096
5106
|
y: i,
|
|
5097
5107
|
w: a,
|
|
5098
5108
|
h: o
|
|
5099
|
-
}, t.rotation), E(e,
|
|
5100
|
-
},
|
|
5109
|
+
}, t.rotation), E(e, r, i, a, o), e.stroke(), e.restore());
|
|
5110
|
+
}, k = (e, r, i, a, o) => {
|
|
5101
5111
|
let s = t.sp3d;
|
|
5102
5112
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
5103
|
-
let t = Math.max(.5, s.contourW *
|
|
5113
|
+
let t = Math.max(.5, s.contourW * n);
|
|
5104
5114
|
e.save(), e.beginPath();
|
|
5105
5115
|
let c = t * 2 + Math.max(a, o);
|
|
5106
|
-
e.rect(
|
|
5116
|
+
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), T(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, r, i, a, o), e.strokeStyle = Z(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5107
5117
|
}
|
|
5108
|
-
}, j = t.scene3d &&
|
|
5109
|
-
e.save(), D(e, n, r, i, a),
|
|
5118
|
+
}, j = t.scene3d && wt(t.scene3d.camera) ? t.scene3d : null, M = (e, n, r, i, a) => {
|
|
5119
|
+
e.save(), D(e, n, r, i, a), Me(e, b, t.srcRect, n, r, i, a), e.restore();
|
|
5120
|
+
}, N = (e, t, n, r, i) => {
|
|
5121
|
+
M(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
|
|
5110
5122
|
}, P = (e, t, n, r, i) => {
|
|
5111
|
-
M(e, t, n, r, i),
|
|
5112
|
-
}, F = (
|
|
5113
|
-
M(e, t, n, r, i), k(e, t, n, r, i);
|
|
5114
|
-
}, I = e.getTransform(), L = Math.abs(I.a * I.d - I.b * I.c), R = L > 0 ? Math.sqrt(L) : 1, z = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, R), B = j ? Ur(t.sp3d, j.camera, C, w, r, R) : null, V = t.stroke ? t.stroke.width * r / 2 : 0, U = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, ee = B ? Math.hypot(B.offsetX, B.offsetY) / R : 0, W = V + U + ee + 2, te = (e) => {
|
|
5123
|
+
M(e, t, n, r, i), O(e, t, n, r, i);
|
|
5124
|
+
}, F = e.getTransform(), L = Math.abs(F.a * F.d - F.b * F.c), R = L > 0 ? Math.sqrt(L) : 1, z = Ur(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, R), B = j ? Wr(t.sp3d, j.camera, C, w, n, R) : null, V = t.stroke ? t.stroke.width * n / 2 : 0, H = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, U = B ? Math.hypot(B.offsetX, B.offsetY) / R : 0, ee = V + H + U + 2, te = (e) => {
|
|
5115
5125
|
if (j) {
|
|
5116
|
-
if (
|
|
5126
|
+
if (Gr(e, j.camera, x, S, C, w, P, {
|
|
5117
5127
|
bevels: z,
|
|
5118
5128
|
extrusion: B ?? void 0,
|
|
5119
|
-
paintEdges:
|
|
5120
|
-
edgePadCss:
|
|
5129
|
+
paintEdges: k,
|
|
5130
|
+
edgePadCss: ee
|
|
5121
5131
|
})) return;
|
|
5122
|
-
} else if (z.length > 0 &&
|
|
5123
|
-
|
|
5132
|
+
} else if (z.length > 0 && Kr(e, x, S, C, w, z, P, k, ee)) return;
|
|
5133
|
+
N(e, x, S, C, w);
|
|
5124
5134
|
}, G = (e, t, n, r, i, a) => {
|
|
5125
5135
|
e.save(), D(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5126
5136
|
}, K = (e, t) => {
|
|
5127
|
-
j &&
|
|
5128
|
-
}, q = e.getTransform(), ne = Math.abs(q.a * q.d - q.b * q.c), re = ne > 0 ? Math.sqrt(ne) : 1, ie = V +
|
|
5137
|
+
j && Gr(e, j.camera, x, S, C, w, (e, n, r, i, a) => G(e, t, n, r, i, a)) || G(e, t, x, S, C, w);
|
|
5138
|
+
}, q = e.getTransform(), ne = Math.abs(q.a * q.d - q.b * q.c), re = ne > 0 ? Math.sqrt(ne) : 1, ie = V + H, ae = (t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, x, S, C, w) : t.prstGeom && m(t.prstGeom.toLowerCase()) ? W(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
|
|
5129
5139
|
x,
|
|
5130
5140
|
y: S,
|
|
5131
5141
|
w: C,
|
|
5132
5142
|
h: w
|
|
5133
|
-
}, oe = j ?
|
|
5134
|
-
bbox:
|
|
5135
|
-
anchor:
|
|
5136
|
-
}, se =
|
|
5137
|
-
|
|
5143
|
+
}, oe = j ? Nr(j.camera, q, x, S, C, w, ee, t.shadow?.algn) : {
|
|
5144
|
+
bbox: kr(q, ae.x - ie, ae.y - ie, ae.w + ie * 2, ae.h + ie * 2),
|
|
5145
|
+
anchor: Mr(q, x, S, C, w, t.shadow?.algn)
|
|
5146
|
+
}, se = n * re, ce = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), le = (e) => K(e, "#000");
|
|
5147
|
+
Fr(e, t, j && ce ? Pr(te, q, oe.bbox, {
|
|
5138
5148
|
w: e.canvas.width || 0,
|
|
5139
5149
|
h: e.canvas.height || 0
|
|
5140
|
-
}) : te, j && ce ?
|
|
5150
|
+
}) : te, j && ce ? Pr(le, q, oe.bbox, {
|
|
5141
5151
|
w: e.canvas.width || 0,
|
|
5142
5152
|
h: e.canvas.height || 0
|
|
5143
|
-
}) : le, oe.bbox, oe.anchor,
|
|
5144
|
-
} catch (
|
|
5145
|
-
if (a(
|
|
5146
|
-
|
|
5153
|
+
}) : le, oe.bbox, oe.anchor, n, se, q), e.restore();
|
|
5154
|
+
} catch (i) {
|
|
5155
|
+
if (a(i, "tiff")) {
|
|
5156
|
+
r() || Xr(e, t, n);
|
|
5147
5157
|
return;
|
|
5148
5158
|
}
|
|
5149
|
-
if (
|
|
5159
|
+
if (Re(i) || Je(i)) throw i;
|
|
5150
5160
|
}
|
|
5151
5161
|
}
|
|
5152
|
-
async function
|
|
5162
|
+
async function Qr(e, t, n, r, i, o, s, c, l = 1, u, d) {
|
|
5153
5163
|
let f = Y(t.x, n), p = Y(t.y, n), m = Y(t.width, n), h = Y(t.height, n), g, _ = !1;
|
|
5154
5164
|
if (t.posterPath && i) try {
|
|
5155
|
-
g = await
|
|
5165
|
+
g = await Yr(t, i, s, c, t.posterMimeType === "image/svg+xml" ? Dn(m, h, l) : d ? On(d, X(t.posterPath)) : void 0, u);
|
|
5156
5166
|
} catch (e) {
|
|
5157
5167
|
if (a(e, "tiff")) _ = !0;
|
|
5158
|
-
else if (
|
|
5168
|
+
else if (Re(e) || Je(e)) throw e;
|
|
5159
5169
|
}
|
|
5160
|
-
r() || (e.save(),
|
|
5170
|
+
r() || (e.save(), ti(e, t, n), g ? e.drawImage(g, f, p, m, h) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(f, p, m, h), _ && ue(e, "tiff", {
|
|
5161
5171
|
x: f,
|
|
5162
5172
|
y: p,
|
|
5163
5173
|
width: m,
|
|
5164
5174
|
height: h
|
|
5165
|
-
})), o ||
|
|
5175
|
+
})), o || on(e, f + m / 2, p + h / 2, m, h, "paused"), e.restore());
|
|
5166
5176
|
}
|
|
5167
|
-
function
|
|
5177
|
+
function $r(e, t, n, r, i, a, o) {
|
|
5168
5178
|
let s = Math.max(.5, Y(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5169
5179
|
if (u === 0) return;
|
|
5170
5180
|
let d = -l / u, f = c / u, p;
|
|
@@ -5214,30 +5224,30 @@ function Qr(e, t, n, r, i, a, o) {
|
|
|
5214
5224
|
break;
|
|
5215
5225
|
default: return;
|
|
5216
5226
|
}
|
|
5217
|
-
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 ?
|
|
5227
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ? Pn(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o) : null) ?? Z(r.color);
|
|
5218
5228
|
for (let r of p) {
|
|
5219
5229
|
let i = d * (s * r.offset), a = f * (s * r.offset);
|
|
5220
5230
|
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();
|
|
5221
5231
|
}
|
|
5222
5232
|
e.restore();
|
|
5223
5233
|
}
|
|
5224
|
-
function
|
|
5225
|
-
if (
|
|
5226
|
-
let n =
|
|
5234
|
+
function ei(e, t, n, r, i = 0) {
|
|
5235
|
+
if (Ae(e, t, n), t?.fill && r) {
|
|
5236
|
+
let n = Pn(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5227
5237
|
n && (e.strokeStyle = n);
|
|
5228
5238
|
}
|
|
5229
5239
|
}
|
|
5230
|
-
function
|
|
5240
|
+
function ti(e, t, n) {
|
|
5231
5241
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5232
5242
|
let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
|
|
5233
5243
|
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));
|
|
5234
5244
|
}
|
|
5235
|
-
function
|
|
5245
|
+
function ni(t, n, r, i, a = {
|
|
5236
5246
|
themeMajorFont: null,
|
|
5237
5247
|
themeMinorFont: null,
|
|
5238
5248
|
dpr: 1
|
|
5239
5249
|
}, o) {
|
|
5240
|
-
t.save(),
|
|
5250
|
+
t.save(), ti(t, n, r);
|
|
5241
5251
|
let s = Y(n.x, r), c = Y(n.y, r), l = n.cols.map((e) => Y(e, r)), u = l.length, d = (e, t) => {
|
|
5242
5252
|
let n = 0;
|
|
5243
5253
|
for (let r = 0; r < t; r++) n += l[e + r] ?? 0;
|
|
@@ -5248,7 +5258,7 @@ function ti(t, n, r, i, a = {
|
|
|
5248
5258
|
for (let n = 0; n < o.cells.length; n++) {
|
|
5249
5259
|
let s = o.cells[n];
|
|
5250
5260
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5251
|
-
let c = d(n, s.gridSpan || 1), l =
|
|
5261
|
+
let c = d(n, s.gridSpan || 1), l = Hr(t, s.textBody, 0, 0, c, 0, r, null, 0, !1, !1, "#000000", i, a, void 0, !0, void 0, !1, o.height === 0) || 0;
|
|
5252
5262
|
l > f[e] && (f[e] = l);
|
|
5253
5263
|
}
|
|
5254
5264
|
}
|
|
@@ -5259,7 +5269,7 @@ function ti(t, n, r, i, a = {
|
|
|
5259
5269
|
if (c.hMerge || c.vMerge) continue;
|
|
5260
5270
|
let l = c.rowSpan || 1;
|
|
5261
5271
|
if (l <= 1 || !c.textBody) continue;
|
|
5262
|
-
let u = d(s, c.gridSpan || 1), p = n.rows.slice(e, Math.min(n.rows.length, e + l)).some((e) => e.height === 0), m =
|
|
5272
|
+
let u = d(s, c.gridSpan || 1), p = n.rows.slice(e, Math.min(n.rows.length, e + l)).some((e) => e.height === 0), m = Hr(t, c.textBody, 0, 0, u, 0, r, null, 0, !1, !1, "#000000", i, a, void 0, !0, void 0, !1, p) || 0, h = 0;
|
|
5263
5273
|
for (let t = 0; t < l && e + t < f.length; t++) h += f[e + t];
|
|
5264
5274
|
if (m > h) {
|
|
5265
5275
|
let t = (m - h) / l;
|
|
@@ -5326,14 +5336,14 @@ function ti(t, n, r, i, a = {
|
|
|
5326
5336
|
}
|
|
5327
5337
|
}
|
|
5328
5338
|
for (let { cell: e, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of y) {
|
|
5329
|
-
let f =
|
|
5339
|
+
let f = Pn(e.fill, t, o, s, c, l, n.rotation);
|
|
5330
5340
|
if (f && (t.fillStyle = f, t.fillRect(o, s, c, l)), e.textBody) {
|
|
5331
5341
|
_ && (v = {
|
|
5332
5342
|
row: d,
|
|
5333
5343
|
column: u
|
|
5334
5344
|
});
|
|
5335
5345
|
let n = e.textColor ? Z(e.textColor) : null;
|
|
5336
|
-
|
|
5346
|
+
Hr(t, e.textBody, o, s, c, l, r, n, 0, !1, !1, "#000000", i, a, _);
|
|
5337
5347
|
}
|
|
5338
5348
|
}
|
|
5339
5349
|
let x = a.dpr, S = (e, t) => {
|
|
@@ -5341,13 +5351,13 @@ function ti(t, n, r, i, a = {
|
|
|
5341
5351
|
let n = b[e][t];
|
|
5342
5352
|
return n < 0 ? null : y[n];
|
|
5343
5353
|
}, C = (i, a, o, s, c) => {
|
|
5344
|
-
if (
|
|
5354
|
+
if (ei(t, i, r, {
|
|
5345
5355
|
x: Math.min(a, s),
|
|
5346
5356
|
y: Math.min(o, c),
|
|
5347
5357
|
w: Math.max(1, Math.abs(s - a)),
|
|
5348
5358
|
h: Math.max(1, Math.abs(c - o))
|
|
5349
5359
|
}, n.rotation), i.cmpd === "dbl" && !i.dashStyle && !i.customDash?.length && (a === s || o === c)) {
|
|
5350
|
-
t.fillStyle = t.strokeStyle,
|
|
5360
|
+
t.fillStyle = t.strokeStyle, Se(t, a, o, s, c, Math.max(.5, Y(i.width, r)), x);
|
|
5351
5361
|
return;
|
|
5352
5362
|
}
|
|
5353
5363
|
let l = a === s ? e(a, t.lineWidth, x) : 0, u = o === c ? e(o, t.lineWidth, x) : 0;
|
|
@@ -5365,7 +5375,7 @@ function ti(t, n, r, i, a = {
|
|
|
5365
5375
|
for (; a < r;) {
|
|
5366
5376
|
let e = b[t][a], o = a + 1;
|
|
5367
5377
|
for (; o < r && b[t][o] === e;) o++;
|
|
5368
|
-
let s = S(t, a), c =
|
|
5378
|
+
let s = S(t, a), c = gn(i.borderB, s ? s.cell.borderT : null);
|
|
5369
5379
|
if (c) {
|
|
5370
5380
|
let e = h(a, o - a);
|
|
5371
5381
|
C(c, e, n, e + d(a, o - a), n);
|
|
@@ -5381,16 +5391,16 @@ function ti(t, n, r, i, a = {
|
|
|
5381
5391
|
for (; n <= e.lastRi;) {
|
|
5382
5392
|
let r = b[n][v], i = n;
|
|
5383
5393
|
for (; i + 1 <= e.lastRi && b[i + 1][v] === r;) i++;
|
|
5384
|
-
let a = S(n, v), o =
|
|
5394
|
+
let a = S(n, v), o = gn(p, a ? y(a.cell) : null);
|
|
5385
5395
|
o && C(o, t, g[n], t, g[i] + f[i]), n = i + 1;
|
|
5386
5396
|
}
|
|
5387
5397
|
}
|
|
5388
|
-
i.diagonalTL && (
|
|
5398
|
+
i.diagonalTL && (ei(t, i.diagonalTL, r, {
|
|
5389
5399
|
x: a,
|
|
5390
5400
|
y: o,
|
|
5391
5401
|
w: s,
|
|
5392
5402
|
h: c
|
|
5393
|
-
}, n.rotation), t.beginPath(), t.moveTo(a, o), t.lineTo(a + s, o + c), t.stroke()), i.diagonalTR && (
|
|
5403
|
+
}, n.rotation), t.beginPath(), t.moveTo(a, o), t.lineTo(a + s, o + c), t.stroke()), i.diagonalTR && (ei(t, i.diagonalTR, r, {
|
|
5394
5404
|
x: a,
|
|
5395
5405
|
y: o,
|
|
5396
5406
|
w: s,
|
|
@@ -5399,14 +5409,14 @@ function ti(t, n, r, i, a = {
|
|
|
5399
5409
|
}
|
|
5400
5410
|
t.restore();
|
|
5401
5411
|
}
|
|
5402
|
-
function
|
|
5412
|
+
function ri(e, t, n, r) {
|
|
5403
5413
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5404
5414
|
}
|
|
5405
|
-
var
|
|
5406
|
-
function
|
|
5407
|
-
|
|
5415
|
+
var ii = /* @__PURE__ */ new WeakMap();
|
|
5416
|
+
function ai(e) {
|
|
5417
|
+
ii.set(e, (ii.get(e) ?? 0) + 1);
|
|
5408
5418
|
}
|
|
5409
|
-
function
|
|
5419
|
+
function oi(e, t, n, r, i) {
|
|
5410
5420
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5411
5421
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5412
5422
|
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([]);
|
|
@@ -5426,21 +5436,21 @@ function ai(e, t, n, r, i) {
|
|
|
5426
5436
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5427
5437
|
e.restore();
|
|
5428
5438
|
}
|
|
5429
|
-
async function oi(e, t, n, r, i = {}, a) {
|
|
5430
|
-
return si(e, t, n, r, i, a);
|
|
5431
|
-
}
|
|
5432
5439
|
async function si(e, t, n, r, i = {}, a) {
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5440
|
+
return ci(e, t, n, r, i, a);
|
|
5441
|
+
}
|
|
5442
|
+
async function ci(e, t, n, r, i = {}, a) {
|
|
5443
|
+
let o = i.fetchImage ?? (i.fetchMedia ? Jr(i.fetchMedia) : void 0), s = (ii.get(e) ?? 0) + 1;
|
|
5444
|
+
ii.set(e, s);
|
|
5445
|
+
let c = () => ii.get(e) !== s, l = () => c() ? Promise.resolve(e) : li(e, t, n, r, i, a, o, c);
|
|
5446
|
+
return o && Mn(t) ? j(o, i.imageResources, l) : l();
|
|
5447
|
+
}
|
|
5448
|
+
async function li(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
5449
|
+
let l = i.width ?? ((se(e) ? e.offsetWidth : 0) || 960), u = l / n, d = Math.round(l), f = Math.round(r * u), p = i.dpr ?? L(), m = He(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await jn(t, d, f, u, h, i.imageResources, i.fetchImage, i.fetchMedia, s, i.tiff);
|
|
5450
|
+
e.width = m.width, e.height = m.height, se(e) && (e.style.width = `${d}px`, e.style.display || (e.style.display = "block"));
|
|
5441
5451
|
let _ = e.getContext("2d");
|
|
5442
5452
|
if (!_) throw Error("Could not get 2D context");
|
|
5443
|
-
if (_.scale(h, h), t.parseError) return
|
|
5453
|
+
if (_.scale(h, h), t.parseError) return oi(_, d, f, t.slideNumber, t.parseError), e;
|
|
5444
5454
|
let v = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", y = /* @__PURE__ */ new Map(), b = {
|
|
5445
5455
|
themeMajorFont: i.majorFont ?? null,
|
|
5446
5456
|
themeMinorFont: i.minorFont ?? null,
|
|
@@ -5448,13 +5458,13 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5448
5458
|
embeddedFontAliases: i.embeddedFontAliases,
|
|
5449
5459
|
embeddedFontAuthoredFamilies: i.embeddedFontAuthoredFamilies,
|
|
5450
5460
|
dpr: h,
|
|
5451
|
-
smartArtFallbackTextColor:
|
|
5461
|
+
smartArtFallbackTextColor: bn(t.background, v),
|
|
5452
5462
|
pictureBulletImages: y
|
|
5453
5463
|
};
|
|
5454
|
-
if (await
|
|
5464
|
+
if (await sr(_, t.background, d, f, u, c, i.fetchImage, i.tiff, i.svgDecoder, g), c() || (i.math && await Rn(t, i.math), c())) return e;
|
|
5455
5465
|
let x = t.slideNumber;
|
|
5456
5466
|
for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
|
|
5457
|
-
let t = e, n = t.mimeType === "image/svg+xml", r =
|
|
5467
|
+
let t = e, n = t.mimeType === "image/svg+xml", r = A(t) || n, a = !r && !t.duotone ? On(g, X(kn(t), t.duotone)) : void 0, o = Dn(Y(t.width, u), Y(t.height, u), h, t.srcRect), s = r ? o : a, c = s && "maxRetainedPixels" in s ? s.maxRetainedPixels : void 0, l = {
|
|
5458
5468
|
...s ? {
|
|
5459
5469
|
targetWidthPx: s.targetWidthPx,
|
|
5460
5470
|
targetHeightPx: s.targetHeightPx,
|
|
@@ -5462,12 +5472,12 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5462
5472
|
} : {},
|
|
5463
5473
|
workerDecoder: i.svgDecoder
|
|
5464
5474
|
};
|
|
5465
|
-
if (
|
|
5466
|
-
else if (n)
|
|
5475
|
+
if (A(t)) I(t.svgImagePath, i.fetchImage, l).catch(() => void 0);
|
|
5476
|
+
else if (n) I(t.imagePath, i.fetchImage, l).catch(() => void 0);
|
|
5467
5477
|
else {
|
|
5468
|
-
let e =
|
|
5478
|
+
let e = Pe(t.mimeType, t.srcRect, t.width / J, t.height / J);
|
|
5469
5479
|
if (!e) continue;
|
|
5470
|
-
|
|
5480
|
+
Ye(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
|
|
5471
5481
|
widthPt: e.widthPt,
|
|
5472
5482
|
heightPt: e.heightPt,
|
|
5473
5483
|
...s ?? {},
|
|
@@ -5477,7 +5487,7 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5477
5487
|
}
|
|
5478
5488
|
} else if (e.type === "media") {
|
|
5479
5489
|
let t = e;
|
|
5480
|
-
t.posterPath && i.fetchMedia &&
|
|
5490
|
+
t.posterPath && i.fetchMedia && Yr(t, i.fetchMedia, s, i.tiff, t.posterMimeType === "image/svg+xml" ? Dn(Y(t.width, u), Y(t.height, u), h) : On(g, X(t.posterPath)), i.svgDecoder).catch(() => void 0);
|
|
5481
5491
|
}
|
|
5482
5492
|
let S = /* @__PURE__ */ new Map();
|
|
5483
5493
|
if (i.fetchImage) {
|
|
@@ -5490,8 +5500,8 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5490
5500
|
targetWidthPx: Y(e.width, u) * h,
|
|
5491
5501
|
targetHeightPx: Y(e.height, u) * h
|
|
5492
5502
|
}, n = [], r = !0;
|
|
5493
|
-
for (let i of
|
|
5494
|
-
let e =
|
|
5503
|
+
for (let i of Ee(e.chart)) {
|
|
5504
|
+
let e = De(i, t);
|
|
5495
5505
|
if (!e) {
|
|
5496
5506
|
r = !1;
|
|
5497
5507
|
break;
|
|
@@ -5508,8 +5518,8 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5508
5518
|
});
|
|
5509
5519
|
}
|
|
5510
5520
|
let s = /* @__PURE__ */ new Map();
|
|
5511
|
-
for (let e of
|
|
5512
|
-
let { fill: t } = e, n =
|
|
5521
|
+
for (let e of Ne(o.map(({ element: e }) => e.chart), (e, t) => De(e, o[t].frame) != null)) {
|
|
5522
|
+
let { fill: t } = e, n = Le(t);
|
|
5513
5523
|
s.has(n) || s.set(n, {
|
|
5514
5524
|
fill: t,
|
|
5515
5525
|
widthPt: 0,
|
|
@@ -5519,9 +5529,9 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5519
5529
|
});
|
|
5520
5530
|
}
|
|
5521
5531
|
for (let { usages: e } of o) for (let { usage: t, size: n } of e) {
|
|
5522
|
-
let { fill: e } = t, r =
|
|
5532
|
+
let { fill: e } = t, r = Le(e), i = s.get(r);
|
|
5523
5533
|
if (!i) continue;
|
|
5524
|
-
let a = i.preserveNaturalSize || t.preserveNaturalSize, o = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 :
|
|
5534
|
+
let a = i.preserveNaturalSize || t.preserveNaturalSize, o = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : On(g, X(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || A({
|
|
5525
5535
|
svgImagePath: e.svgImagePath,
|
|
5526
5536
|
srcRect: o ? !0 : null
|
|
5527
5537
|
}));
|
|
@@ -5537,9 +5547,9 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5537
5547
|
});
|
|
5538
5548
|
}
|
|
5539
5549
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5540
|
-
let n =
|
|
5550
|
+
let n = $e(t.bullet);
|
|
5541
5551
|
if (n.type === "blip") {
|
|
5542
|
-
let i =
|
|
5552
|
+
let i = Qn(e.textBody, t, n) * J * u * h, a = r.get(n.imagePath);
|
|
5543
5553
|
a ? Number.isFinite(i) && i > 0 && (a.targetHeightPx = Math.max(a.targetHeightPx ?? 0, i)) : r.set(n.imagePath, {
|
|
5544
5554
|
mimeType: n.mimeType,
|
|
5545
5555
|
...Number.isFinite(i) && i > 0 ? { targetHeightPx: i } : {}
|
|
@@ -5552,10 +5562,10 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5552
5562
|
let a = t === "image/svg+xml" ? r === void 0 ? {} : {
|
|
5553
5563
|
targetWidthPx: 1,
|
|
5554
5564
|
targetHeightPx: r
|
|
5555
|
-
} :
|
|
5565
|
+
} : On(g, X(e)) ?? {}, o = t === "image/svg+xml" ? await I(e, n, {
|
|
5556
5566
|
...a,
|
|
5557
5567
|
workerDecoder: i.svgDecoder
|
|
5558
|
-
}) : await
|
|
5568
|
+
}) : await K(e, t, n, {
|
|
5559
5569
|
tiff: i.tiff,
|
|
5560
5570
|
...a
|
|
5561
5571
|
});
|
|
@@ -5565,7 +5575,7 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5565
5575
|
y.set(e, null);
|
|
5566
5576
|
return;
|
|
5567
5577
|
}
|
|
5568
|
-
if (
|
|
5578
|
+
if (Re(t) || Je(t)) throw t;
|
|
5569
5579
|
y.set(e, null);
|
|
5570
5580
|
}
|
|
5571
5581
|
}), o = [...s].map(async ([e, t]) => {
|
|
@@ -5575,10 +5585,10 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5575
5585
|
...u === void 0 ? {} : { maxRetainedPixels: u }
|
|
5576
5586
|
} : void 0;
|
|
5577
5587
|
try {
|
|
5578
|
-
let t = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) :
|
|
5588
|
+
let t = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : I(r.imagePath, n, {
|
|
5579
5589
|
...f ?? {},
|
|
5580
5590
|
workerDecoder: i.svgDecoder
|
|
5581
|
-
}) :
|
|
5591
|
+
}) : Ye(r.imagePath, r.mimeType, r.duotone, n, {
|
|
5582
5592
|
widthPt: o,
|
|
5583
5593
|
heightPt: s,
|
|
5584
5594
|
...f ?? {},
|
|
@@ -5588,8 +5598,8 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5588
5598
|
svgImagePath: r.svgImagePath,
|
|
5589
5599
|
srcRect: d ? !0 : null
|
|
5590
5600
|
};
|
|
5591
|
-
if (!r.duotone &&
|
|
5592
|
-
a = await
|
|
5601
|
+
if (!r.duotone && A(c)) try {
|
|
5602
|
+
a = await I(c.svgImagePath, n, {
|
|
5593
5603
|
...f ?? {},
|
|
5594
5604
|
workerDecoder: i.svgDecoder
|
|
5595
5605
|
});
|
|
@@ -5603,7 +5613,7 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5603
5613
|
S.set(e, null);
|
|
5604
5614
|
return;
|
|
5605
5615
|
}
|
|
5606
|
-
if (
|
|
5616
|
+
if (Re(t) || Je(t)) throw t;
|
|
5607
5617
|
S.set(e, null);
|
|
5608
5618
|
}
|
|
5609
5619
|
});
|
|
@@ -5612,66 +5622,66 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5612
5622
|
}
|
|
5613
5623
|
for (let [n, r] of t.elements.entries()) {
|
|
5614
5624
|
if (c()) return e;
|
|
5615
|
-
if (r.type === "shape")
|
|
5625
|
+
if (r.type === "shape") Ir(_, r, u, v, x, b, o ? (e) => o({
|
|
5616
5626
|
...e,
|
|
5617
5627
|
elementIndex: n,
|
|
5618
5628
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5619
5629
|
}) : void 0, i.fetchImage);
|
|
5620
|
-
else if (r.type === "picture") await
|
|
5621
|
-
else if (r.type === "table")
|
|
5630
|
+
else if (r.type === "picture") await Zr(_, r, u, c, i.fetchImage, i.tiff, h, i.svgDecoder, g);
|
|
5631
|
+
else if (r.type === "table") ni(_, r, u, x, b, o ? (e) => o({
|
|
5622
5632
|
...e,
|
|
5623
5633
|
elementIndex: n,
|
|
5624
5634
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5625
5635
|
}) : void 0);
|
|
5626
|
-
else if (r.type === "media") await
|
|
5636
|
+
else if (r.type === "media") await Qr(_, r, u, c, i.fetchMedia, i.skipMediaControls, i.fetchImage, i.tiff, h, i.svgDecoder, g);
|
|
5627
5637
|
else if (r.type === "chart") {
|
|
5628
5638
|
let e = J * u;
|
|
5629
|
-
_.save(),
|
|
5639
|
+
_.save(), ti(_, r, u), qe(_, r.chart, {
|
|
5630
5640
|
x: Y(r.x, u),
|
|
5631
5641
|
y: Y(r.y, u),
|
|
5632
5642
|
w: Y(r.width, u),
|
|
5633
5643
|
h: Y(r.height, u)
|
|
5634
|
-
}, e, r.rotation, i.threeD, i.regionMap, (e) => S.get(
|
|
5644
|
+
}, e, r.rotation, i.threeD, i.regionMap, (e) => S.get(Le(e)), i.chartEx), _.restore();
|
|
5635
5645
|
}
|
|
5636
5646
|
}
|
|
5637
|
-
return c() || i.dim &&
|
|
5647
|
+
return c() || i.dim && ri(_, i.dim, d, f), e;
|
|
5638
5648
|
}
|
|
5639
5649
|
//#endregion
|
|
5640
5650
|
//#region packages/pptx/src/google-fonts.ts
|
|
5641
|
-
var
|
|
5642
|
-
...
|
|
5643
|
-
...
|
|
5651
|
+
var ui = {
|
|
5652
|
+
...T,
|
|
5653
|
+
...b
|
|
5644
5654
|
};
|
|
5645
|
-
function*
|
|
5655
|
+
function* di(e) {
|
|
5646
5656
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5647
5657
|
}
|
|
5648
|
-
function*
|
|
5658
|
+
function* fi(e) {
|
|
5649
5659
|
for (let t of e?.paragraphs ?? []) {
|
|
5650
5660
|
t.defFontFamily && (yield t.defFontFamily);
|
|
5651
5661
|
for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilySym && (yield e.fontFamilySym));
|
|
5652
5662
|
}
|
|
5653
5663
|
}
|
|
5654
|
-
function*
|
|
5655
|
-
for (let t of e.elements) if (t.type === "shape") yield*
|
|
5656
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield*
|
|
5664
|
+
function* pi(e) {
|
|
5665
|
+
for (let t of e.elements) if (t.type === "shape") yield* di(t.textBody);
|
|
5666
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* di(t.textBody);
|
|
5657
5667
|
else if (t.type === "chart") {
|
|
5658
5668
|
t.chart.title && (yield t.chart.title);
|
|
5659
5669
|
for (let e of t.chart.categories) yield e;
|
|
5660
5670
|
for (let e of t.chart.series) e.name && (yield e.name);
|
|
5661
5671
|
}
|
|
5662
5672
|
}
|
|
5663
|
-
var
|
|
5673
|
+
var mi = class e {
|
|
5664
5674
|
scripts;
|
|
5665
5675
|
families;
|
|
5666
|
-
constructor(e, t, n,
|
|
5676
|
+
constructor(e, t, n, r) {
|
|
5667
5677
|
this.majorFont = e, this.minorFont = t;
|
|
5668
|
-
let
|
|
5669
|
-
this.scripts = n ?? new
|
|
5678
|
+
let i = w(e) ?? w(t) ?? null;
|
|
5679
|
+
this.scripts = n ?? new pe(i), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
|
|
5670
5680
|
}
|
|
5671
5681
|
addSlide(e) {
|
|
5672
|
-
this.scripts.addText(
|
|
5673
|
-
for (let t of e.elements) if (t.type === "shape") for (let e of
|
|
5674
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of
|
|
5682
|
+
this.scripts.addText(pi(e));
|
|
5683
|
+
for (let t of e.elements) if (t.type === "shape") for (let e of fi(t.textBody)) this.families.add(e);
|
|
5684
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of fi(t.textBody)) this.families.add(e);
|
|
5675
5685
|
}
|
|
5676
5686
|
names() {
|
|
5677
5687
|
return [...this.families, ...this.scripts.names()];
|
|
@@ -5680,16 +5690,16 @@ var pi = class e {
|
|
|
5680
5690
|
let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families));
|
|
5681
5691
|
return n.addSlide(t), n;
|
|
5682
5692
|
}
|
|
5683
|
-
},
|
|
5693
|
+
}, hi = Object.freeze({
|
|
5684
5694
|
archiveEntryCount: 0,
|
|
5685
5695
|
declaredInflatedBytes: 0,
|
|
5686
5696
|
distinctInflatedBytes: 0,
|
|
5687
5697
|
operationInflatedBytes: 0
|
|
5688
|
-
}),
|
|
5698
|
+
}), gi = D;
|
|
5689
5699
|
function $(e, t) {
|
|
5690
5700
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5691
5701
|
}
|
|
5692
|
-
function
|
|
5702
|
+
function _i(e, t) {
|
|
5693
5703
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5694
5704
|
let n = e;
|
|
5695
5705
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5699,7 +5709,7 @@ function gi(e, t) {
|
|
|
5699
5709
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5700
5710
|
});
|
|
5701
5711
|
}
|
|
5702
|
-
function
|
|
5712
|
+
function vi(e, t) {
|
|
5703
5713
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap embedded font at ${t}`);
|
|
5704
5714
|
let n = e;
|
|
5705
5715
|
if (typeof n.fontName != "string" || n.fontName.length === 0 || ![
|
|
@@ -5715,7 +5725,7 @@ function _i(e, t) {
|
|
|
5715
5725
|
contentType: n.contentType
|
|
5716
5726
|
});
|
|
5717
5727
|
}
|
|
5718
|
-
function
|
|
5728
|
+
function yi(e) {
|
|
5719
5729
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5720
5730
|
let t = e;
|
|
5721
5731
|
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");
|
|
@@ -5728,11 +5738,11 @@ function vi(e) {
|
|
|
5728
5738
|
minorFont: t.minorFont,
|
|
5729
5739
|
hlinkColor: t.hlinkColor,
|
|
5730
5740
|
folHlinkColor: t.folHlinkColor,
|
|
5731
|
-
embeddedFonts: Object.freeze(t.embeddedFonts.map(
|
|
5732
|
-
slides: Object.freeze(t.slides.map(
|
|
5741
|
+
embeddedFonts: Object.freeze(t.embeddedFonts.map(vi)),
|
|
5742
|
+
slides: Object.freeze(t.slides.map(_i))
|
|
5733
5743
|
});
|
|
5734
5744
|
}
|
|
5735
|
-
function
|
|
5745
|
+
function bi(e) {
|
|
5736
5746
|
return Object.freeze({
|
|
5737
5747
|
type: "media",
|
|
5738
5748
|
x: e.x,
|
|
@@ -5749,7 +5759,7 @@ function yi(e) {
|
|
|
5749
5759
|
mimeType: e.mimeType
|
|
5750
5760
|
});
|
|
5751
5761
|
}
|
|
5752
|
-
function
|
|
5762
|
+
function xi(e) {
|
|
5753
5763
|
return Object.freeze({
|
|
5754
5764
|
...e.id === void 0 ? {} : { id: e.id },
|
|
5755
5765
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
@@ -5759,10 +5769,10 @@ function bi(e) {
|
|
|
5759
5769
|
text: e.text
|
|
5760
5770
|
});
|
|
5761
5771
|
}
|
|
5762
|
-
function
|
|
5772
|
+
function Si(e) {
|
|
5763
5773
|
return Object.freeze({ ...e });
|
|
5764
5774
|
}
|
|
5765
|
-
function
|
|
5775
|
+
function Ci(e) {
|
|
5766
5776
|
return Object.freeze({
|
|
5767
5777
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
5768
5778
|
...e.modernAuthorId === void 0 ? {} : { modernAuthorId: e.modernAuthorId },
|
|
@@ -5772,16 +5782,16 @@ function Si(e) {
|
|
|
5772
5782
|
...e.date === void 0 ? {} : { date: e.date },
|
|
5773
5783
|
...e.x === void 0 ? {} : { x: e.x },
|
|
5774
5784
|
...e.y === void 0 ? {} : { y: e.y },
|
|
5775
|
-
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(
|
|
5785
|
+
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(Si)) } : {},
|
|
5776
5786
|
...e.status === void 0 ? {} : { status: e.status },
|
|
5777
5787
|
text: e.text,
|
|
5778
|
-
...e.replies?.length ? { replies: Object.freeze(e.replies.map(
|
|
5788
|
+
...e.replies?.length ? { replies: Object.freeze(e.replies.map(xi)) } : {}
|
|
5779
5789
|
});
|
|
5780
5790
|
}
|
|
5781
|
-
function
|
|
5791
|
+
function wi(e, t, n) {
|
|
5782
5792
|
if (e !== void 0 && typeof e != "string") throw Error(`invalid PPTX presentation preflight comment ${t} at slide ${n}`);
|
|
5783
5793
|
}
|
|
5784
|
-
function
|
|
5794
|
+
function Ti(e, t) {
|
|
5785
5795
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment reply at slide ${t}`);
|
|
5786
5796
|
let n = e;
|
|
5787
5797
|
for (let e of [
|
|
@@ -5790,16 +5800,16 @@ function wi(e, t) {
|
|
|
5790
5800
|
"author",
|
|
5791
5801
|
"date",
|
|
5792
5802
|
"status"
|
|
5793
|
-
])
|
|
5803
|
+
]) wi(n[e], e, t);
|
|
5794
5804
|
if (typeof n.text != "string") throw Error(`invalid PPTX presentation preflight comment reply text at slide ${t}`);
|
|
5795
5805
|
if (n.status !== void 0 && ![
|
|
5796
5806
|
"active",
|
|
5797
5807
|
"resolved",
|
|
5798
5808
|
"closed"
|
|
5799
5809
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment reply status at slide ${t}`);
|
|
5800
|
-
return
|
|
5810
|
+
return xi(n);
|
|
5801
5811
|
}
|
|
5802
|
-
function
|
|
5812
|
+
function Ei(e, t) {
|
|
5803
5813
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment at slide ${t}`);
|
|
5804
5814
|
let n = e;
|
|
5805
5815
|
for (let e of [
|
|
@@ -5808,7 +5818,7 @@ function Ti(e, t) {
|
|
|
5808
5818
|
"author",
|
|
5809
5819
|
"date",
|
|
5810
5820
|
"status"
|
|
5811
|
-
])
|
|
5821
|
+
]) wi(n[e], e, t);
|
|
5812
5822
|
for (let e of [
|
|
5813
5823
|
"authorId",
|
|
5814
5824
|
"index",
|
|
@@ -5824,23 +5834,23 @@ function Ti(e, t) {
|
|
|
5824
5834
|
"resolved",
|
|
5825
5835
|
"closed"
|
|
5826
5836
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment status at slide ${t}`);
|
|
5827
|
-
return
|
|
5837
|
+
return Ci({
|
|
5828
5838
|
...n,
|
|
5829
|
-
...n.anchors?.length ? { anchors: n.anchors.map((e) =>
|
|
5830
|
-
...n.replies?.length ? { replies: n.replies.map((e) =>
|
|
5839
|
+
...n.anchors?.length ? { anchors: n.anchors.map((e) => Di(e, t)) } : {},
|
|
5840
|
+
...n.replies?.length ? { replies: n.replies.map((e) => Ti(e, t)) } : {}
|
|
5831
5841
|
});
|
|
5832
5842
|
}
|
|
5833
|
-
function
|
|
5843
|
+
function Di(e, t) {
|
|
5834
5844
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment anchor at slide ${t}`);
|
|
5835
5845
|
let n = e;
|
|
5836
5846
|
if (n.type === "slide" || n.type === "unknown") return Object.freeze({ type: n.type });
|
|
5837
|
-
if (n.type === "drawingElement") return
|
|
5847
|
+
if (n.type === "drawingElement") return wi(n.elementId, "anchor.elementId", t), wi(n.creationId, "anchor.creationId", t), Object.freeze({
|
|
5838
5848
|
type: "drawingElement",
|
|
5839
5849
|
...n.elementId === void 0 ? {} : { elementId: n.elementId },
|
|
5840
5850
|
...n.creationId === void 0 ? {} : { creationId: n.creationId }
|
|
5841
5851
|
});
|
|
5842
5852
|
if (n.type === "textRange") {
|
|
5843
|
-
|
|
5853
|
+
wi(n.elementId, "anchor.elementId", t);
|
|
5844
5854
|
for (let e of ["start", "length"]) {
|
|
5845
5855
|
let r = n[e];
|
|
5846
5856
|
if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment anchor.${e} at slide ${t}`);
|
|
@@ -5854,7 +5864,7 @@ function Ei(e, t) {
|
|
|
5854
5864
|
}
|
|
5855
5865
|
throw Error(`invalid PPTX presentation preflight comment anchor type at slide ${t}`);
|
|
5856
5866
|
}
|
|
5857
|
-
function
|
|
5867
|
+
function Oi(e, t) {
|
|
5858
5868
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
5859
5869
|
let n = e;
|
|
5860
5870
|
for (let e of [
|
|
@@ -5865,9 +5875,9 @@ function Di(e, t) {
|
|
|
5865
5875
|
"rotation"
|
|
5866
5876
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
5867
5877
|
if (n.type !== "media" || typeof n.flipH != "boolean" || typeof n.flipV != "boolean" || n.mediaKind !== "audio" && n.mediaKind !== "video" || typeof n.posterPath != "string" || typeof n.posterMimeType != "string" || typeof n.mediaPath != "string" || typeof n.mimeType != "string") throw Error(`invalid PPTX presentation preflight media fields at slide ${t}`);
|
|
5868
|
-
return
|
|
5878
|
+
return bi(n);
|
|
5869
5879
|
}
|
|
5870
|
-
function
|
|
5880
|
+
function ki(e, t) {
|
|
5871
5881
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5872
5882
|
let n = e;
|
|
5873
5883
|
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");
|
|
@@ -5881,8 +5891,8 @@ function Oi(e, t) {
|
|
|
5881
5891
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
5882
5892
|
notes: n.notes,
|
|
5883
5893
|
hidden: n.hidden,
|
|
5884
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
5885
|
-
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) =>
|
|
5894
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => Oi(e, t))),
|
|
5895
|
+
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => Ei(e, t))) } : {}
|
|
5886
5896
|
});
|
|
5887
5897
|
}), i = n.fontPreloadNames.map((e, t) => {
|
|
5888
5898
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
|
|
@@ -5897,37 +5907,37 @@ function Oi(e, t) {
|
|
|
5897
5907
|
minorFont: n.minorFont,
|
|
5898
5908
|
hlinkColor: n.hlinkColor,
|
|
5899
5909
|
folHlinkColor: n.folHlinkColor,
|
|
5900
|
-
embeddedFonts: Object.freeze(n.embeddedFonts.map(
|
|
5910
|
+
embeddedFonts: Object.freeze(n.embeddedFonts.map(vi)),
|
|
5901
5911
|
slides: Object.freeze(r),
|
|
5902
5912
|
fontPreloadNames: Object.freeze(i)
|
|
5903
5913
|
});
|
|
5904
5914
|
}
|
|
5905
|
-
function ki(e) {
|
|
5906
|
-
return Oi(e, !1);
|
|
5907
|
-
}
|
|
5908
5915
|
function Ai(e) {
|
|
5909
|
-
return
|
|
5916
|
+
return ki(e, !1);
|
|
5917
|
+
}
|
|
5918
|
+
function ji(e) {
|
|
5919
|
+
return ki(e, !0);
|
|
5910
5920
|
}
|
|
5911
|
-
function
|
|
5921
|
+
function Mi(e, t) {
|
|
5912
5922
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
5913
5923
|
if (e.mediaPath === t) return e.mimeType;
|
|
5914
5924
|
if (e.posterPath === t) return e.posterMimeType;
|
|
5915
5925
|
}
|
|
5916
5926
|
return "";
|
|
5917
5927
|
}
|
|
5918
|
-
function
|
|
5928
|
+
function Ni(e, t) {
|
|
5919
5929
|
if (e.index !== t.index || e.partName !== t.partName) throw Error(`PPTX pulled slide identity does not match bootstrap index ${t.index}`);
|
|
5920
5930
|
return Object.freeze({
|
|
5921
5931
|
index: t.index,
|
|
5922
5932
|
...t.partName === void 0 ? {} : { partName: t.partName },
|
|
5923
5933
|
notes: e.notes ?? null,
|
|
5924
5934
|
hidden: e.hidden ?? !1,
|
|
5925
|
-
mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(
|
|
5926
|
-
...e.comments?.length ? { comments: Object.freeze(e.comments.map(
|
|
5935
|
+
mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(bi)),
|
|
5936
|
+
...e.comments?.length ? { comments: Object.freeze(e.comments.map(Ci)) } : {}
|
|
5927
5937
|
});
|
|
5928
5938
|
}
|
|
5929
|
-
function
|
|
5930
|
-
if (!(e <= t)) throw new
|
|
5939
|
+
function Pi(e, t, n) {
|
|
5940
|
+
if (!(e <= t)) throw new N(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
|
|
5931
5941
|
stage: "parsing",
|
|
5932
5942
|
violation: {
|
|
5933
5943
|
format: "pptx",
|
|
@@ -5941,7 +5951,7 @@ function Ni(e, t, n) {
|
|
|
5941
5951
|
}
|
|
5942
5952
|
});
|
|
5943
5953
|
}
|
|
5944
|
-
var
|
|
5954
|
+
var Fi = class {
|
|
5945
5955
|
slideCountValue;
|
|
5946
5956
|
slideWidthValue;
|
|
5947
5957
|
slideHeightValue;
|
|
@@ -5961,9 +5971,9 @@ var Pi = class {
|
|
|
5961
5971
|
pending = null;
|
|
5962
5972
|
finished = null;
|
|
5963
5973
|
constructor(e, t = {}) {
|
|
5964
|
-
let n =
|
|
5965
|
-
if (!Number.isSafeInteger(r) || r <= 0 || r >
|
|
5966
|
-
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
|
|
5974
|
+
let n = yi(e), r = t.hardLimitForTesting ?? gi;
|
|
5975
|
+
if (!Number.isSafeInteger(r) || r <= 0 || r > gi) throw Error("invalid PPTX presentation preflight test limit");
|
|
5976
|
+
this.limit = r, this.slideCountValue = n.slideCount, this.slideWidthValue = n.slideWidth, this.slideHeightValue = n.slideHeight, this.defaultTextColorValue = n.defaultTextColor, this.majorFontValue = n.majorFont, this.minorFontValue = n.minorFont, this.hlinkColorValue = n.hlinkColor, this.folHlinkColorValue = n.folHlinkColor, this.embeddedFontsValue = n.embeddedFonts, this.descriptors = [...n.slides], this.fonts = new mi(this.majorFontValue, this.minorFontValue), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = Ze(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = Ze({
|
|
5967
5977
|
slideCount: this.slideCountValue,
|
|
5968
5978
|
slideWidth: this.slideWidthValue,
|
|
5969
5979
|
slideHeight: this.slideHeightValue,
|
|
@@ -5976,7 +5986,7 @@ var Pi = class {
|
|
|
5976
5986
|
remainingSlides: this.descriptors,
|
|
5977
5987
|
slides: [],
|
|
5978
5988
|
fontPreloadNames: this.fontPreloadNames
|
|
5979
|
-
}, this.limit).jsonBytes,
|
|
5989
|
+
}, this.limit).jsonBytes, Pi(this.projectionBytesValue, this.limit, hi);
|
|
5980
5990
|
}
|
|
5981
5991
|
get acceptedSlideCount() {
|
|
5982
5992
|
return this.finished?.slideCount ?? this.slides.length;
|
|
@@ -6010,21 +6020,21 @@ var Pi = class {
|
|
|
6010
6020
|
fontPreloadNames: this.fontPreloadNames
|
|
6011
6021
|
});
|
|
6012
6022
|
}
|
|
6013
|
-
addSlide(e, t =
|
|
6023
|
+
addSlide(e, t = hi) {
|
|
6014
6024
|
this.prepareSlide(e, t).commit();
|
|
6015
6025
|
}
|
|
6016
|
-
prepareSlide(e, t =
|
|
6026
|
+
prepareSlide(e, t = hi) {
|
|
6017
6027
|
if (this.finished) throw Error("PPTX presentation preflight is already finished");
|
|
6018
6028
|
if (this.pending) throw Error("PPTX presentation preflight already has a prepared slide");
|
|
6019
6029
|
let n = this.slides.length, r = this.descriptors[n];
|
|
6020
6030
|
if (!r) throw Error("PPTX presentation preflight received an extra slide");
|
|
6021
|
-
let i =
|
|
6022
|
-
l =
|
|
6023
|
-
let u =
|
|
6031
|
+
let i = Ni(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = Ze(o, this.limit).jsonBytes, c = Ze(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.fontProjectionBytes - Ze(r, this.limit).jsonBytes + 4;
|
|
6032
|
+
l = Qe(l, s, this.limit), l = Qe(l, c, this.limit), this.slides.length !== 0 && (l = Qe(l, 1, this.limit));
|
|
6033
|
+
let u = Ze({
|
|
6024
6034
|
slide: i,
|
|
6025
6035
|
fontPreloadNames: o
|
|
6026
|
-
}, this.limit).jsonBytes, d =
|
|
6027
|
-
|
|
6036
|
+
}, this.limit).jsonBytes, d = Qe(this.projectionBytesValue, u, this.limit);
|
|
6037
|
+
Pi(Math.max(d, l), this.limit, t);
|
|
6028
6038
|
let f = {
|
|
6029
6039
|
state: "prepared",
|
|
6030
6040
|
fact: i,
|
|
@@ -6067,9 +6077,9 @@ var Pi = class {
|
|
|
6067
6077
|
embeddedFonts: this.embeddedFontsValue,
|
|
6068
6078
|
slides: Object.freeze([...this.slides]),
|
|
6069
6079
|
fontPreloadNames: this.fontPreloadNames
|
|
6070
|
-
}), this.descriptors = [], this.slides = [], this.projectionBytesValue =
|
|
6080
|
+
}), this.descriptors = [], this.slides = [], this.projectionBytesValue = Ze(this.finished, this.limit).jsonBytes, this.finished;
|
|
6071
6081
|
}
|
|
6072
|
-
},
|
|
6082
|
+
}, Ii = 1024 * 1024, Li = class {
|
|
6073
6083
|
active = /* @__PURE__ */ new Set();
|
|
6074
6084
|
nextSessionId = 1;
|
|
6075
6085
|
constructor(e) {
|
|
@@ -6084,13 +6094,13 @@ var Pi = class {
|
|
|
6084
6094
|
generation: this.options.generation ?? 1
|
|
6085
6095
|
}, a = new h(this.options.transport, {
|
|
6086
6096
|
...i,
|
|
6087
|
-
maxByteCredit:
|
|
6097
|
+
maxByteCredit: E,
|
|
6088
6098
|
timeoutMs: n
|
|
6089
6099
|
});
|
|
6090
6100
|
this.active.add(a);
|
|
6091
6101
|
try {
|
|
6092
6102
|
await this.options.open(e, i, n);
|
|
6093
|
-
let r = await
|
|
6103
|
+
let r = await zi(a);
|
|
6094
6104
|
try {
|
|
6095
6105
|
let e = r.usage ?? a.usageCheckpoint;
|
|
6096
6106
|
e && this.options.onUsage?.(e);
|
|
@@ -6113,20 +6123,20 @@ var Pi = class {
|
|
|
6113
6123
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
6114
6124
|
}
|
|
6115
6125
|
};
|
|
6116
|
-
function
|
|
6126
|
+
function Ri(e) {
|
|
6117
6127
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
6118
6128
|
}
|
|
6119
|
-
async function
|
|
6129
|
+
async function zi(e) {
|
|
6120
6130
|
try {
|
|
6121
|
-
return await e.pull(
|
|
6131
|
+
return await e.pull(Ii);
|
|
6122
6132
|
} catch (t) {
|
|
6123
|
-
let n =
|
|
6133
|
+
let n = Bi(t);
|
|
6124
6134
|
if (n === void 0) throw t;
|
|
6125
6135
|
return e.pull(n);
|
|
6126
6136
|
}
|
|
6127
6137
|
}
|
|
6128
|
-
function
|
|
6129
|
-
return
|
|
6138
|
+
function Bi(e) {
|
|
6139
|
+
return d(e, Ii, E);
|
|
6130
6140
|
}
|
|
6131
6141
|
//#endregion
|
|
6132
|
-
export {
|
|
6142
|
+
export { yi as a, ui as c, ci as d, on as f, Mi as i, ai as l, Ri as n, Ai as o, Fi as r, ji as s, Li as t, si as u };
|