@silurus/ooxml 0.77.0 → 0.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{canvas-viewer-mechanics-DTkBvITv.js → canvas-viewer-mechanics-D5zXbOrS.js} +1 -1
- package/dist/{document-pull-client-iWr8-S7P.js → document-pull-client-CC8pPuzi.js} +1799 -1769
- package/dist/{docx-B1gYS6eU.js → docx-Dg9N9OX4.js} +14 -14
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-C1r2zvji.js → line-distribute-BtfPlM2A.js} +133 -72
- package/dist/{line-metrics-BdCACYlq.js → line-metrics-B66x33iy.js} +1446 -1340
- package/dist/node.mjs +7 -7
- package/dist/{pptx-CQjtK_o7.js → pptx-BFP7Isgf.js} +38 -38
- package/dist/pptx.mjs +4 -4
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-Ca80nlG5.js → render-D-cOpMLV.js} +1 -1
- package/dist/render-worker-host-BzpMoFRr.js +27 -0
- package/dist/render-worker-host-CdZ5hW2X.js +27 -0
- package/dist/render-worker-host-quqYq02i.js +27 -0
- package/dist/{resource-measurement-E_S_iau4.js → resource-measurement-CVfVTQrt.js} +1 -1
- package/dist/{session-KvKxQAeL.js → session-DxAVpIP-.js} +2 -2
- package/dist/{slide-pull-client-BXb67StB.js → slide-pull-client-Lag44QA8.js} +1171 -878
- package/dist/types/docx.d.ts +46 -3
- package/dist/types/index.d.ts +104 -8
- package/dist/types/node.d.ts +99 -3
- package/dist/types/pptx.d.ts +32 -2
- package/dist/types/xlsx.d.ts +88 -3
- package/dist/{worksheet-pull-client-YzjJMOns.js → worksheet-pull-client-D74b_23i.js} +2 -2
- package/dist/{xlsx-RLCmd1Bm.js → xlsx-Bik59Raj.js} +1106 -1075
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-BozYMmxO.js +0 -27
- package/dist/render-worker-host-C96AiK8e.js +0 -27
- package/dist/render-worker-host-EHG5j8FK.js +0 -27
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { i as
|
|
4
|
-
import { t as
|
|
1
|
+
import { A as e, At as t, Bt as n, C as r, D as i, Dt as a, Ft as o, Gt as s, Ht as c, K as l, Kt as u, Lt as d, M as f, N as p, Nt as m, O as h, Ot as g, Qt as _, Rt as v, S as y, St as b, Tt as x, Ut as S, Vt as C, Wt as w, Xt as T, Yt as E, _ as D, _t as O, bt as k, c as A, cn as j, ct as M, d as N, dn as P, en as F, f as I, fn as L, g as R, gt as z, h as B, ht as V, i as H, in as U, j as W, jt as G, ln as K, m as q, mn as ee, mt as J, n as te, p as ne, pt as re, qt as ie, r as ae, s as oe, sn as se, u as ce, un as le, vt as ue, w as de, xt as fe, y as pe } from "./line-metrics-B66x33iy.js";
|
|
2
|
+
import { a as me, c as he, d as ge, i as _e, l as ve, n as ye, o as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-BtfPlM2A.js";
|
|
3
|
+
import { i as Te } from "./resource-measurement-CVfVTQrt.js";
|
|
4
|
+
import { t as Ee } from "./mathjax-CMjda8Ip.js";
|
|
5
5
|
//#region packages/pptx/src/types.ts
|
|
6
|
-
function
|
|
6
|
+
function De(e) {
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var Oe = {
|
|
10
10
|
textarchdown: {
|
|
11
11
|
adj: [["adj", "val 0"]],
|
|
12
12
|
gd: [
|
|
@@ -2388,22 +2388,22 @@ var De = {
|
|
|
2388
2388
|
]
|
|
2389
2389
|
}]
|
|
2390
2390
|
}
|
|
2391
|
-
},
|
|
2392
|
-
function je(e) {
|
|
2393
|
-
return e.toLowerCase() in ke;
|
|
2394
|
-
}
|
|
2391
|
+
}, ke = Math.PI * 2 / 216e5, Ae = Oe, je = /* @__PURE__ */ new Map();
|
|
2395
2392
|
function Me(e) {
|
|
2396
|
-
|
|
2393
|
+
return e.toLowerCase() in Ae;
|
|
2394
|
+
}
|
|
2395
|
+
function Ne(e) {
|
|
2396
|
+
let t = je.get(e);
|
|
2397
2397
|
if (t) return t;
|
|
2398
|
-
let n =
|
|
2398
|
+
let n = Ae[e];
|
|
2399
2399
|
return n ? (t = {
|
|
2400
|
-
adj: n.adj.map(([e, t]) => [e,
|
|
2401
|
-
gd: n.gd.map(([e, t]) => [e,
|
|
2400
|
+
adj: n.adj.map(([e, t]) => [e, w(t)]),
|
|
2401
|
+
gd: n.gd.map(([e, t]) => [e, w(t)]),
|
|
2402
2402
|
paths: n.paths
|
|
2403
|
-
},
|
|
2403
|
+
}, je.set(e, t), t) : null;
|
|
2404
2404
|
}
|
|
2405
|
-
var
|
|
2406
|
-
function
|
|
2405
|
+
var Pe = 48;
|
|
2406
|
+
function Fe(e, t, n, r) {
|
|
2407
2407
|
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;
|
|
2408
2408
|
for (let n of e.cmds) switch (n[0]) {
|
|
2409
2409
|
case "m":
|
|
@@ -2420,8 +2420,8 @@ function Pe(e, t, n, r) {
|
|
|
2420
2420
|
break;
|
|
2421
2421
|
case "C": {
|
|
2422
2422
|
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]));
|
|
2423
|
-
for (let t = 1; t <=
|
|
2424
|
-
let n = t /
|
|
2423
|
+
for (let t = 1; t <= Pe; t++) {
|
|
2424
|
+
let n = t / Pe, 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;
|
|
2425
2425
|
c.push({
|
|
2426
2426
|
x: s,
|
|
2427
2427
|
y: p
|
|
@@ -2432,8 +2432,8 @@ function Pe(e, t, n, r) {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
case "Q": {
|
|
2434
2434
|
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]));
|
|
2435
|
-
for (let t = 1; t <=
|
|
2436
|
-
let n = t /
|
|
2435
|
+
for (let t = 1; t <= Pe; t++) {
|
|
2436
|
+
let n = t / Pe, 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;
|
|
2437
2437
|
c.push({
|
|
2438
2438
|
x: s,
|
|
2439
2439
|
y: d
|
|
@@ -2443,9 +2443,9 @@ function Pe(e, t, n, r) {
|
|
|
2443
2443
|
break;
|
|
2444
2444
|
}
|
|
2445
2445
|
case "a": {
|
|
2446
|
-
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) *
|
|
2446
|
+
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * ke, f = t.resolve(n[4]) * ke, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
|
|
2447
2447
|
_ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
|
|
2448
|
-
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(
|
|
2448
|
+
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(Pe, Math.ceil(Math.abs(y) / m * 96));
|
|
2449
2449
|
for (let e = 1; e <= S; e++) {
|
|
2450
2450
|
let t = h + y * e / S;
|
|
2451
2451
|
c.push({
|
|
@@ -2460,7 +2460,7 @@ function Pe(e, t, n, r) {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
return c;
|
|
2462
2462
|
}
|
|
2463
|
-
function
|
|
2463
|
+
function Ie(e) {
|
|
2464
2464
|
let t = [0];
|
|
2465
2465
|
for (let n = 1; n < e.length; n++) {
|
|
2466
2466
|
let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
|
|
@@ -2468,23 +2468,23 @@ function Fe(e) {
|
|
|
2468
2468
|
}
|
|
2469
2469
|
return t;
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2472
|
-
let i =
|
|
2471
|
+
function Le(e, t, n, r) {
|
|
2472
|
+
let i = Ne(e.toLowerCase());
|
|
2473
2473
|
if (!i || i.paths.length === 0) return null;
|
|
2474
|
-
let a =
|
|
2474
|
+
let a = s({
|
|
2475
2475
|
w: n,
|
|
2476
2476
|
h: r,
|
|
2477
2477
|
adj: t
|
|
2478
|
-
}, i.adj, i.gd), o = i.paths.length === 1,
|
|
2478
|
+
}, i.adj, i.gd), o = i.paths.length === 1, c = Fe(i.paths[0], a, n, r), l = o ? c : Fe(i.paths[i.paths.length - 1], a, n, r);
|
|
2479
2479
|
return {
|
|
2480
|
-
top:
|
|
2481
|
-
bottom:
|
|
2482
|
-
topLen:
|
|
2483
|
-
bottomLen:
|
|
2480
|
+
top: c,
|
|
2481
|
+
bottom: l,
|
|
2482
|
+
topLen: Ie(c),
|
|
2483
|
+
bottomLen: Ie(l),
|
|
2484
2484
|
singleEdge: o
|
|
2485
2485
|
};
|
|
2486
2486
|
}
|
|
2487
|
-
function
|
|
2487
|
+
function Re(e, t, n) {
|
|
2488
2488
|
let r = t[t.length - 1];
|
|
2489
2489
|
if (e.length === 1 || r === 0) return {
|
|
2490
2490
|
x: e[0].x,
|
|
@@ -2505,17 +2505,17 @@ function Le(e, t, n) {
|
|
|
2505
2505
|
ty: f / p
|
|
2506
2506
|
};
|
|
2507
2507
|
}
|
|
2508
|
-
function
|
|
2508
|
+
function ze(e) {
|
|
2509
2509
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2511
|
+
function Be(e, t) {
|
|
2512
2512
|
if (!e.singleEdge) return 1;
|
|
2513
|
-
let n =
|
|
2513
|
+
let n = ze(e);
|
|
2514
2514
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function Ve(e, t, n, r) {
|
|
2517
2517
|
if (e.singleEdge) {
|
|
2518
|
-
let i =
|
|
2518
|
+
let i = Re(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2519
2519
|
return {
|
|
2520
2520
|
x: i.x - o * c,
|
|
2521
2521
|
y: i.y - s * c,
|
|
@@ -2524,7 +2524,7 @@ function Be(e, t, n, r) {
|
|
|
2524
2524
|
shear: 0
|
|
2525
2525
|
};
|
|
2526
2526
|
}
|
|
2527
|
-
let i =
|
|
2527
|
+
let i = Re(e.top, e.topLen, t), a = Re(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
|
|
2528
2528
|
return {
|
|
2529
2529
|
x: c,
|
|
2530
2530
|
y: l,
|
|
@@ -2535,13 +2535,16 @@ function Be(e, t, n, r) {
|
|
|
2535
2535
|
}
|
|
2536
2536
|
//#endregion
|
|
2537
2537
|
//#region packages/core/src/shape/effects.ts
|
|
2538
|
-
function
|
|
2538
|
+
function He(e, t) {
|
|
2539
|
+
return [t === "tl" || t === "l" || t === "bl" ? e.x : t === "tr" || t === "r" || t === "br" ? e.x + e.w : e.x + e.w / 2, t === "tl" || t === "t" || t === "tr" ? e.y : t === "l" || t === "ctr" || t === "r" ? e.y + e.h / 2 : e.y + e.h];
|
|
2540
|
+
}
|
|
2541
|
+
function Y(e, t) {
|
|
2539
2542
|
return e * t;
|
|
2540
2543
|
}
|
|
2541
|
-
function
|
|
2544
|
+
function Ue(e) {
|
|
2542
2545
|
return e.getContext("2d") ?? null;
|
|
2543
2546
|
}
|
|
2544
|
-
function
|
|
2547
|
+
function We(e, t, n, r) {
|
|
2545
2548
|
let i = Math.max(0, Math.floor(e.x - t)), a = Math.max(0, Math.floor(e.y - t)), o = Math.min(n, Math.ceil(e.x + e.w + t)), s = Math.min(r, Math.ceil(e.y + e.h + t));
|
|
2546
2549
|
return {
|
|
2547
2550
|
x: i,
|
|
@@ -2550,7 +2553,7 @@ function Ue(e, t, n, r) {
|
|
|
2550
2553
|
h: Math.max(1, s - a)
|
|
2551
2554
|
};
|
|
2552
2555
|
}
|
|
2553
|
-
function
|
|
2556
|
+
function Ge(e, t) {
|
|
2554
2557
|
if (t.x === 0 && t.y === 0) return e;
|
|
2555
2558
|
let n = t.x, r = t.y;
|
|
2556
2559
|
return new Proxy(e, {
|
|
@@ -2566,58 +2569,67 @@ function We(e, t) {
|
|
|
2566
2569
|
}
|
|
2567
2570
|
});
|
|
2568
2571
|
}
|
|
2569
|
-
function
|
|
2570
|
-
let
|
|
2571
|
-
if (!
|
|
2572
|
-
let
|
|
2573
|
-
if (!
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2572
|
+
function Ke(e, t, n, r, i, a, o, s = 0, c) {
|
|
2573
|
+
let l = Math.max(0, Y(r.blur, i)), u = Y(r.dist, i), d = r.rotWithShape === !1 ? 0 : s, f = (r.dir + d) * Math.PI / 180, p = Math.cos(f) * u, m = Math.sin(f) * u, h = We(n, Math.ceil(l * 3 + Math.max(Math.abs(p), Math.abs(m))) + 2, a, o), g = F(h.w, h.h);
|
|
2574
|
+
if (!g) return !1;
|
|
2575
|
+
let _ = Ue(g);
|
|
2576
|
+
if (!_) return !1;
|
|
2577
|
+
t(Ge(_, h)), _.save(), _.setTransform(1, 0, 0, 1, 0, 0), _.globalCompositeOperation = "source-in", _.fillStyle = E(r.color, r.alpha), _.fillRect(0, 0, h.w, h.h), _.restore(), e.save(), l > 0 && (e.filter = `blur(${l}px)`);
|
|
2578
|
+
let [v, y] = c ?? He(n, r.algn ?? "b"), b = r.sx ?? 1, x = r.sy ?? 1, S = Math.tan((r.kx ?? 0) * Math.PI / 180), C = Math.tan((r.ky ?? 0) * Math.PI / 180);
|
|
2579
|
+
return e.translate(p, m), e.translate(v, y), d !== 0 && e.rotate(d * Math.PI / 180), e.transform(b, C, S, x, 0, 0), d !== 0 && e.rotate(-d * Math.PI / 180), e.translate(-v, -y), e.drawImage(g, h.x, h.y), e.restore(), !0;
|
|
2580
|
+
}
|
|
2581
|
+
function qe(e, t, n, r, i, a, o) {
|
|
2582
|
+
let s = Y(r.blur, i), c = Y(r.dist, i), l = r.dir * Math.PI / 180, u = Math.cos(l) * c, d = Math.sin(l) * c, f = We(n, Math.ceil(3 * s + Math.abs(c)) + 2, a, o), p = F(f.w, f.h);
|
|
2583
|
+
if (!p) return;
|
|
2584
|
+
let m = Ue(p);
|
|
2585
|
+
if (!m) return;
|
|
2586
|
+
let h = Ge(m, f);
|
|
2587
|
+
h.save(), h.fillStyle = E(r.color, r.alpha), t(h), h.restore(), h.save(), h.globalCompositeOperation = "destination-out", h.filter = s > 0 ? `blur(${s}px)` : "none", h.translate(u, d), h.fillStyle = "#000", t(h), h.restore(), h.save(), h.globalCompositeOperation = "destination-in", h.filter = "none", h.fillStyle = "#000", t(h), h.restore(), e.save(), e.drawImage(p, f.x, f.y), e.restore();
|
|
2588
|
+
}
|
|
2589
|
+
function Je(e, t, n, r, i, a, o, s) {
|
|
2590
|
+
let c = Y(r.radius, i);
|
|
2591
|
+
if (c <= 0) {
|
|
2592
|
+
t(e);
|
|
2581
2593
|
return;
|
|
2582
2594
|
}
|
|
2583
|
-
let
|
|
2584
|
-
if (!
|
|
2585
|
-
|
|
2595
|
+
let l = We(n, Math.ceil(c) + 2, a, o), u = n.x - l.x, d = n.y - l.y, f = F(l.w, l.h);
|
|
2596
|
+
if (!f) {
|
|
2597
|
+
t(e);
|
|
2586
2598
|
return;
|
|
2587
2599
|
}
|
|
2588
|
-
let
|
|
2589
|
-
if (!
|
|
2590
|
-
|
|
2600
|
+
let p = Ue(f);
|
|
2601
|
+
if (!p) {
|
|
2602
|
+
t(e);
|
|
2591
2603
|
return;
|
|
2592
2604
|
}
|
|
2593
|
-
let
|
|
2594
|
-
|
|
2595
|
-
let
|
|
2596
|
-
if (
|
|
2597
|
-
let
|
|
2598
|
-
|
|
2605
|
+
let m = Ge(p, l), h = s ?? t;
|
|
2606
|
+
t(m);
|
|
2607
|
+
let g = F(l.w, l.h), _ = F(l.w, l.h), v = g ? Ue(g) : null, y = _ ? Ue(_) : null;
|
|
2608
|
+
if (g && v && _ && y) {
|
|
2609
|
+
let t = Ge(v, l);
|
|
2610
|
+
t.fillStyle = "#000", h(t), y.drawImage(f, u, d, n.w, n.h, u - c, d - c, n.w + c * 2, n.h + c * 2), y.drawImage(f, 0, 0), y.globalCompositeOperation = "destination-in", y.filter = `blur(${c / 3}px)`, y.drawImage(g, 0, 0), y.filter = "none", y.globalCompositeOperation = "source-over", e.save(), e.drawImage(_, l.x, l.y), e.restore();
|
|
2599
2611
|
return;
|
|
2600
2612
|
}
|
|
2601
|
-
|
|
2613
|
+
e.save(), e.drawImage(f, 0, 0), e.restore();
|
|
2602
2614
|
}
|
|
2603
|
-
function
|
|
2604
|
-
let
|
|
2615
|
+
function Ye(e, t, n, r, i, a, o) {
|
|
2616
|
+
let s = F(a, o);
|
|
2617
|
+
if (!s) return;
|
|
2618
|
+
let c = Ue(s);
|
|
2605
2619
|
if (!c) return;
|
|
2606
|
-
let l =
|
|
2607
|
-
|
|
2608
|
-
let u =
|
|
2609
|
-
|
|
2610
|
-
let
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
}
|
|
2615
|
-
function Je(e) {
|
|
2620
|
+
let l = Y(r.blur, i);
|
|
2621
|
+
c.save(), l > 0 && (c.filter = `blur(${l}px)`), t(c), c.restore(), c.save(), c.globalCompositeOperation = "destination-in";
|
|
2622
|
+
let u = n.y, d = n.y + n.h, f = c.createLinearGradient(0, d, 0, u), p = Xe(r.stPos), m = Xe(r.endPos);
|
|
2623
|
+
f.addColorStop(0, `rgba(0,0,0,${r.stA})`), p > 0 && f.addColorStop(p, `rgba(0,0,0,${r.stA})`), m < 1 && m > p && f.addColorStop(m, `rgba(0,0,0,${r.endA})`), f.addColorStop(1, `rgba(0,0,0,${r.endA})`), c.fillStyle = f, c.fillRect(0, 0, a, o), c.restore();
|
|
2624
|
+
let h = Y(r.dist, i), g = r.dir * Math.PI / 180, _ = Math.cos(g) * h, v = Math.sin(g) * h;
|
|
2625
|
+
e.save(), e.translate(n.x + _, d + v), e.scale(r.sx, r.sy), e.translate(-n.x, -d), e.drawImage(s, 0, 0), e.restore();
|
|
2626
|
+
}
|
|
2627
|
+
function Xe(e) {
|
|
2616
2628
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2617
2629
|
}
|
|
2618
2630
|
//#endregion
|
|
2619
2631
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2620
|
-
var
|
|
2632
|
+
var Ze = 26, Qe = {
|
|
2621
2633
|
orthographicFront: {
|
|
2622
2634
|
kind: "orthographic",
|
|
2623
2635
|
baseLat: 0,
|
|
@@ -2630,52 +2642,52 @@ var q = 26, Ye = {
|
|
|
2630
2642
|
baseLat: 0,
|
|
2631
2643
|
baseLon: 0,
|
|
2632
2644
|
baseRev: 0,
|
|
2633
|
-
fovDeg:
|
|
2645
|
+
fovDeg: Ze
|
|
2634
2646
|
},
|
|
2635
2647
|
perspectiveRelaxed: {
|
|
2636
2648
|
kind: "perspective",
|
|
2637
2649
|
baseLat: 0,
|
|
2638
2650
|
baseLon: 0,
|
|
2639
2651
|
baseRev: 0,
|
|
2640
|
-
fovDeg:
|
|
2652
|
+
fovDeg: Ze
|
|
2641
2653
|
},
|
|
2642
2654
|
perspectiveRelaxedModerately: {
|
|
2643
2655
|
kind: "perspective",
|
|
2644
2656
|
baseLat: 0,
|
|
2645
2657
|
baseLon: 0,
|
|
2646
2658
|
baseRev: 0,
|
|
2647
|
-
fovDeg:
|
|
2659
|
+
fovDeg: Ze
|
|
2648
2660
|
},
|
|
2649
2661
|
perspectiveAbove: {
|
|
2650
2662
|
kind: "perspective",
|
|
2651
2663
|
baseLat: -20,
|
|
2652
2664
|
baseLon: 0,
|
|
2653
2665
|
baseRev: 0,
|
|
2654
|
-
fovDeg:
|
|
2666
|
+
fovDeg: Ze
|
|
2655
2667
|
},
|
|
2656
2668
|
perspectiveBelow: {
|
|
2657
2669
|
kind: "perspective",
|
|
2658
2670
|
baseLat: 20,
|
|
2659
2671
|
baseLon: 0,
|
|
2660
2672
|
baseRev: 0,
|
|
2661
|
-
fovDeg:
|
|
2673
|
+
fovDeg: Ze
|
|
2662
2674
|
},
|
|
2663
2675
|
perspectiveLeft: {
|
|
2664
2676
|
kind: "perspective",
|
|
2665
2677
|
baseLat: 0,
|
|
2666
2678
|
baseLon: -20,
|
|
2667
2679
|
baseRev: 0,
|
|
2668
|
-
fovDeg:
|
|
2680
|
+
fovDeg: Ze
|
|
2669
2681
|
},
|
|
2670
2682
|
perspectiveRight: {
|
|
2671
2683
|
kind: "perspective",
|
|
2672
2684
|
baseLat: 0,
|
|
2673
2685
|
baseLon: 20,
|
|
2674
2686
|
baseRev: 0,
|
|
2675
|
-
fovDeg:
|
|
2687
|
+
fovDeg: Ze
|
|
2676
2688
|
}
|
|
2677
2689
|
};
|
|
2678
|
-
function
|
|
2690
|
+
function $e(e, t) {
|
|
2679
2691
|
let n = Array(9).fill(0);
|
|
2680
2692
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
2681
2693
|
let a = 0;
|
|
@@ -2684,7 +2696,7 @@ function Xe(e, t) {
|
|
|
2684
2696
|
}
|
|
2685
2697
|
return n;
|
|
2686
2698
|
}
|
|
2687
|
-
function
|
|
2699
|
+
function et(e) {
|
|
2688
2700
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2689
2701
|
return [
|
|
2690
2702
|
1,
|
|
@@ -2698,7 +2710,7 @@ function Ze(e) {
|
|
|
2698
2710
|
n
|
|
2699
2711
|
];
|
|
2700
2712
|
}
|
|
2701
|
-
function
|
|
2713
|
+
function tt(e) {
|
|
2702
2714
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2703
2715
|
return [
|
|
2704
2716
|
n,
|
|
@@ -2712,7 +2724,7 @@ function Qe(e) {
|
|
|
2712
2724
|
n
|
|
2713
2725
|
];
|
|
2714
2726
|
}
|
|
2715
|
-
function
|
|
2727
|
+
function nt(e) {
|
|
2716
2728
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2717
2729
|
return [
|
|
2718
2730
|
n,
|
|
@@ -2726,22 +2738,22 @@ function $e(e) {
|
|
|
2726
2738
|
1
|
|
2727
2739
|
];
|
|
2728
2740
|
}
|
|
2729
|
-
function
|
|
2741
|
+
function rt(e, t, n, r) {
|
|
2730
2742
|
return [
|
|
2731
2743
|
e[0] * t + e[1] * n + e[2] * r,
|
|
2732
2744
|
e[3] * t + e[4] * n + e[5] * r,
|
|
2733
2745
|
e[6] * t + e[7] * n + e[8] * r
|
|
2734
2746
|
];
|
|
2735
2747
|
}
|
|
2736
|
-
function
|
|
2748
|
+
function it(e, t) {
|
|
2737
2749
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2738
|
-
return
|
|
2750
|
+
return $e(nt(-(t ? t.rev : e.baseRev)), $e(et(-n), tt(-r)));
|
|
2739
2751
|
}
|
|
2740
|
-
function
|
|
2741
|
-
return
|
|
2752
|
+
function at(e) {
|
|
2753
|
+
return Qe[e] || (e.startsWith("perspective") ? Qe.perspectiveFront : Qe.orthographicFront);
|
|
2742
2754
|
}
|
|
2743
|
-
function
|
|
2744
|
-
let r =
|
|
2755
|
+
function ot(e, t, n) {
|
|
2756
|
+
let r = at(e.prst), i = it(r, e.rot);
|
|
2745
2757
|
if (t <= 0 || n <= 0) return {
|
|
2746
2758
|
corners: [
|
|
2747
2759
|
{
|
|
@@ -2773,11 +2785,11 @@ function rt(e, t, n) {
|
|
|
2773
2785
|
if (r.kind === "perspective") {
|
|
2774
2786
|
let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
|
|
2775
2787
|
u = s.map(([e, t]) => {
|
|
2776
|
-
let [n, r, o] =
|
|
2788
|
+
let [n, r, o] = rt(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
|
|
2777
2789
|
return [n * c, r * c];
|
|
2778
2790
|
});
|
|
2779
2791
|
} else u = s.map(([e, t]) => {
|
|
2780
|
-
let [n, r] =
|
|
2792
|
+
let [n, r] = rt(i, e, t, 0);
|
|
2781
2793
|
return [n, r];
|
|
2782
2794
|
});
|
|
2783
2795
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
@@ -2800,18 +2812,18 @@ function rt(e, t, n) {
|
|
|
2800
2812
|
isIdentity: _
|
|
2801
2813
|
};
|
|
2802
2814
|
}
|
|
2803
|
-
function
|
|
2804
|
-
let { isIdentity: t } =
|
|
2815
|
+
function st(e) {
|
|
2816
|
+
let { isIdentity: t } = ot(e, 1e3, 1e3);
|
|
2805
2817
|
return !t;
|
|
2806
2818
|
}
|
|
2807
|
-
function
|
|
2808
|
-
let i =
|
|
2819
|
+
function ct(e, t, n, r) {
|
|
2820
|
+
let i = at(e.prst), a = it(i, e.rot);
|
|
2809
2821
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
2810
2822
|
x: 0,
|
|
2811
2823
|
y: 0
|
|
2812
2824
|
};
|
|
2813
2825
|
let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
|
|
2814
|
-
let [n, r, o] =
|
|
2826
|
+
let [n, r, o] = rt(a, 0, 0, t);
|
|
2815
2827
|
if (i.kind === "perspective") {
|
|
2816
2828
|
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);
|
|
2817
2829
|
return [n * d * l, r * d * l];
|
|
@@ -2825,7 +2837,7 @@ function at(e, t, n, r) {
|
|
|
2825
2837
|
}
|
|
2826
2838
|
//#endregion
|
|
2827
2839
|
//#region packages/core/src/shape/scene3d-draw.ts
|
|
2828
|
-
function
|
|
2840
|
+
function lt(e, t, n, r) {
|
|
2829
2841
|
let i = e.x, a = e.y, o = t.x, s = t.y, c = n.x, l = n.y, u = r.x, d = r.y, f = o - c, p = u - c, m = i - o + c - u, h = s - l, g = d - l, _ = a - s + l - d, v, y;
|
|
2830
2842
|
if (Math.abs(m) < 1e-12 && Math.abs(_) < 1e-12) v = 0, y = 0;
|
|
2831
2843
|
else {
|
|
@@ -2845,15 +2857,15 @@ function ot(e, t, n, r) {
|
|
|
2845
2857
|
1
|
|
2846
2858
|
];
|
|
2847
2859
|
}
|
|
2848
|
-
function
|
|
2860
|
+
function ut(e, t, n) {
|
|
2849
2861
|
let r = e[6] * t + e[7] * n + e[8];
|
|
2850
2862
|
return {
|
|
2851
2863
|
x: (e[0] * t + e[1] * n + e[2]) / r,
|
|
2852
2864
|
y: (e[3] * t + e[4] * n + e[5]) / r
|
|
2853
2865
|
};
|
|
2854
2866
|
}
|
|
2855
|
-
var
|
|
2856
|
-
function
|
|
2867
|
+
var dt = 1;
|
|
2868
|
+
function ft(e, t) {
|
|
2857
2869
|
let [n, r, i, a, o, s] = e, [c, l, u, d, f, p] = t;
|
|
2858
2870
|
return [
|
|
2859
2871
|
n * c + i * l,
|
|
@@ -2864,13 +2876,13 @@ function lt(e, t) {
|
|
|
2864
2876
|
r * f + a * p + s
|
|
2865
2877
|
];
|
|
2866
2878
|
}
|
|
2867
|
-
function
|
|
2879
|
+
function pt(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2868
2880
|
let p = c - o, m = l - s;
|
|
2869
2881
|
if (p <= 0 || m <= 0) return;
|
|
2870
|
-
let h = (d.x - u.x) / p, g = (d.y - u.y) / p, _ = (f.x - u.x) / m, v = (f.y - u.y) / m, y = (Math.hypot(d.x - u.x, d.y - u.y) || 1) * a, b = (Math.hypot(f.x - u.x, f.y - u.y) || 1) * a, x =
|
|
2882
|
+
let h = (d.x - u.x) / p, g = (d.y - u.y) / p, _ = (f.x - u.x) / m, v = (f.y - u.y) / m, y = (Math.hypot(d.x - u.x, d.y - u.y) || 1) * a, b = (Math.hypot(f.x - u.x, f.y - u.y) || 1) * a, x = dt * p / y, S = dt * m / b, C = Math.max(0, o - x), w = Math.max(0, s - S), T = Math.min(n, c + x), E = Math.min(r, l + S), D = T - C, O = E - w;
|
|
2871
2883
|
if (D <= 0 || O <= 0) return;
|
|
2872
2884
|
e.save();
|
|
2873
|
-
let [k, A, j, M, N, P] =
|
|
2885
|
+
let [k, A, j, M, N, P] = ft(i, [
|
|
2874
2886
|
h,
|
|
2875
2887
|
g,
|
|
2876
2888
|
_,
|
|
@@ -2880,22 +2892,22 @@ function ut(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
2880
2892
|
]);
|
|
2881
2893
|
e.setTransform(k, A, j, M, N, P), e.drawImage(t, C, w, D, O, C, w, D, O), e.restore();
|
|
2882
2894
|
}
|
|
2883
|
-
function
|
|
2884
|
-
let p =
|
|
2895
|
+
function mt(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2896
|
+
let p = ut(o, s, c), m = ut(o, l, c), h = ut(o, s, u), g = ut(o, l, u), _ = (s + l) / 2, v = (c + u) / 2, y = ut(o, _, v), b = {
|
|
2885
2897
|
x: (p.x + m.x + h.x + g.x) / 4,
|
|
2886
2898
|
y: (p.y + m.y + h.y + g.y) / 4
|
|
2887
|
-
}, x =
|
|
2899
|
+
}, x = gt(i), S = Math.hypot(y.x - b.x, y.y - b.y) * x;
|
|
2888
2900
|
if (f <= 0 || S <= d) {
|
|
2889
|
-
|
|
2901
|
+
pt(e, t, n, r, i, a, s * n, c * r, l * n, u * r, p, m, h);
|
|
2890
2902
|
return;
|
|
2891
2903
|
}
|
|
2892
|
-
l - s >= u - c ? (
|
|
2904
|
+
l - s >= u - c ? (mt(e, t, n, r, i, a, o, s, c, _, u, d, f - 1), mt(e, t, n, r, i, a, o, _, c, l, u, d, f - 1)) : (mt(e, t, n, r, i, a, o, s, c, l, v, d, f - 1), mt(e, t, n, r, i, a, o, s, v, l, u, d, f - 1));
|
|
2893
2905
|
}
|
|
2894
|
-
function
|
|
2906
|
+
function ht(e, t, n, r, i, a = .5) {
|
|
2895
2907
|
if (n <= 0 || r <= 0) return;
|
|
2896
2908
|
let [o, s, c, l] = i;
|
|
2897
2909
|
if (Math.abs(o.x * s.y - s.x * o.y + s.x * c.y - c.x * s.y + c.x * l.y - l.x * c.y + l.x * o.y - o.x * l.y) / 2 < 1e-6) return;
|
|
2898
|
-
let u =
|
|
2910
|
+
let u = lt(i[0], i[1], i[2], i[3]);
|
|
2899
2911
|
if (!u) return;
|
|
2900
2912
|
let d = t.getTransform(), f = [
|
|
2901
2913
|
d.a,
|
|
@@ -2904,14 +2916,14 @@ function ft(e, t, n, r, i, a = .5) {
|
|
|
2904
2916
|
d.d,
|
|
2905
2917
|
d.e,
|
|
2906
2918
|
d.f
|
|
2907
|
-
], p =
|
|
2908
|
-
|
|
2919
|
+
], p = gt(f);
|
|
2920
|
+
St(e, t, n, r, i, f, p, u, a, 14) || (bt(), t.save(), t.beginPath(), t.moveTo(i[0].x, i[0].y), t.lineTo(i[1].x, i[1].y), t.lineTo(i[2].x, i[2].y), t.lineTo(i[3].x, i[3].y), t.closePath(), t.clip(), mt(t, e, n, r, f, p, u, 0, 0, 1, 1, a, 14), t.restore());
|
|
2909
2921
|
}
|
|
2910
|
-
function
|
|
2922
|
+
function gt(e) {
|
|
2911
2923
|
return Math.sqrt(Math.abs(e[0] * e[3] - e[1] * e[2])) || 1;
|
|
2912
2924
|
}
|
|
2913
|
-
function
|
|
2914
|
-
let r =
|
|
2925
|
+
function _t(e, t, n) {
|
|
2926
|
+
let r = lt(e[0], e[1], e[2], e[3]);
|
|
2915
2927
|
if (!r) return null;
|
|
2916
2928
|
let i = [
|
|
2917
2929
|
[-t, -n],
|
|
@@ -2921,48 +2933,52 @@ function mt(e, t, n) {
|
|
|
2921
2933
|
], a = [];
|
|
2922
2934
|
for (let [e, t] of i) {
|
|
2923
2935
|
if (!(r[6] * e + r[7] * t + r[8] > 1e-9)) return null;
|
|
2924
|
-
a.push(
|
|
2936
|
+
a.push(ut(r, e, t));
|
|
2925
2937
|
}
|
|
2926
2938
|
return a;
|
|
2927
2939
|
}
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
}
|
|
2932
|
-
var
|
|
2933
|
-
function
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
let
|
|
2943
|
-
|
|
2944
|
-
let
|
|
2945
|
-
if (
|
|
2946
|
-
let
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2940
|
+
function vt(e, t, n) {
|
|
2941
|
+
let r = lt(e[0], e[1], e[2], e[3]);
|
|
2942
|
+
return r && r[6] * t + r[7] * n + r[8] > 1e-9 ? ut(r, t, n) : null;
|
|
2943
|
+
}
|
|
2944
|
+
var yt = !1;
|
|
2945
|
+
function bt() {
|
|
2946
|
+
yt || (yt = !0, typeof console < "u" && typeof console.warn == "function" && console.warn("[ooxml] scene3d: no offscreen canvas available — using the direct warp fallback (per-cell bleed only, no supersample). Textured-source seams may be faintly visible; the silhouette and geometry are unaffected."));
|
|
2947
|
+
}
|
|
2948
|
+
var xt = 2;
|
|
2949
|
+
function St(e, t, n, r, i, a, o, s, c, l) {
|
|
2950
|
+
let u = i.map((e) => ({
|
|
2951
|
+
x: a[0] * e.x + a[2] * e.y + a[4],
|
|
2952
|
+
y: a[1] * e.x + a[3] * e.y + a[5]
|
|
2953
|
+
})), d = Infinity, f = Infinity, p = -Infinity, m = -Infinity;
|
|
2954
|
+
for (let e of u) e.x < d && (d = e.x), e.y < f && (f = e.y), e.x > p && (p = e.x), e.y > m && (m = e.y);
|
|
2955
|
+
d = Math.floor(d) - 1, f = Math.floor(f) - 1, p = Math.ceil(p) + 1, m = Math.ceil(m) + 1;
|
|
2956
|
+
let h = p - d, g = m - f;
|
|
2957
|
+
if (h <= 0 || g <= 0) return !1;
|
|
2958
|
+
let _ = Math.max(1, Math.ceil(h * xt)), v = Math.max(1, Math.ceil(g * xt)), y = F(_, v);
|
|
2959
|
+
if (!y || y.width !== _ || y.height !== v) return !1;
|
|
2960
|
+
let b = y.getContext("2d") ?? null;
|
|
2961
|
+
if (!b) return !1;
|
|
2962
|
+
let x = xt, S = [
|
|
2963
|
+
a[0] * x,
|
|
2964
|
+
a[1] * x,
|
|
2965
|
+
a[2] * x,
|
|
2966
|
+
a[3] * x,
|
|
2967
|
+
(a[4] - d) * x,
|
|
2968
|
+
(a[5] - f) * x
|
|
2953
2969
|
];
|
|
2954
|
-
|
|
2955
|
-
let
|
|
2956
|
-
return
|
|
2970
|
+
b.save(), b.setTransform(S[0], S[1], S[2], S[3], S[4], S[5]), b.beginPath(), b.moveTo(i[0].x, i[0].y), b.lineTo(i[1].x, i[1].y), b.lineTo(i[2].x, i[2].y), b.lineTo(i[3].x, i[3].y), b.closePath(), b.clip(), mt(b, e, n, r, S, o, s, 0, 0, 1, 1, c * x, l), b.restore(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0);
|
|
2971
|
+
let C = t.imageSmoothingEnabled, w = t.imageSmoothingQuality;
|
|
2972
|
+
return t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = "high", t.drawImage(y, 0, 0, h * x, g * x, d, f, h, g), t.imageSmoothingEnabled = C, t.imageSmoothingQuality = w, t.restore(), !0;
|
|
2957
2973
|
}
|
|
2958
2974
|
//#endregion
|
|
2959
2975
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
2960
|
-
function
|
|
2976
|
+
function Ct(e, t) {
|
|
2961
2977
|
if (t <= 0) return () => 1;
|
|
2962
2978
|
let n = (e) => Math.max(0, Math.min(1, e / t));
|
|
2963
2979
|
switch (e) {
|
|
2964
2980
|
case "hardEdge": {
|
|
2965
|
-
let e =
|
|
2981
|
+
let e = jt;
|
|
2966
2982
|
return (t) => {
|
|
2967
2983
|
let r = Math.min(1, n(t) / e);
|
|
2968
2984
|
return r * r * (3 - 2 * r);
|
|
@@ -2982,7 +2998,7 @@ function yt(e, t) {
|
|
|
2982
2998
|
};
|
|
2983
2999
|
}
|
|
2984
3000
|
}
|
|
2985
|
-
function
|
|
3001
|
+
function wt(e) {
|
|
2986
3002
|
let t = e.length, n = new Float64Array(t);
|
|
2987
3003
|
if (t === 0) return n;
|
|
2988
3004
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -3000,7 +3016,7 @@ function bt(e) {
|
|
|
3000
3016
|
}
|
|
3001
3017
|
return n;
|
|
3002
3018
|
}
|
|
3003
|
-
function
|
|
3019
|
+
function Tt(e, t = 3) {
|
|
3004
3020
|
if (e <= 0) return Array(t).fill(1);
|
|
3005
3021
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
3006
3022
|
r % 2 == 0 && r--;
|
|
@@ -3008,7 +3024,7 @@ function xt(e, t = 3) {
|
|
|
3008
3024
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
3009
3025
|
return s;
|
|
3010
3026
|
}
|
|
3011
|
-
function
|
|
3027
|
+
function Et(e, t, n, r, i, a) {
|
|
3012
3028
|
let o = 1 / (2 * i + 1);
|
|
3013
3029
|
if (a) for (let a = 0; a < r; a++) {
|
|
3014
3030
|
let r = a * n, s = 0;
|
|
@@ -3029,29 +3045,29 @@ function St(e, t, n, r, i, a) {
|
|
|
3029
3045
|
}
|
|
3030
3046
|
}
|
|
3031
3047
|
}
|
|
3032
|
-
function
|
|
3048
|
+
function Dt(e, t, n, r) {
|
|
3033
3049
|
let i = Float64Array.from(e);
|
|
3034
3050
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
3035
3051
|
let a = new Float64Array(t * n);
|
|
3036
|
-
for (let e of
|
|
3052
|
+
for (let e of Tt(r, 3)) {
|
|
3037
3053
|
let r = Math.max(1, (e - 1) / 2);
|
|
3038
|
-
|
|
3054
|
+
Et(i, a, t, n, r, !0), Et(a, i, t, n, r, !1);
|
|
3039
3055
|
}
|
|
3040
3056
|
return i;
|
|
3041
3057
|
}
|
|
3042
|
-
function
|
|
3058
|
+
function Ot(e, t, n, r = 128) {
|
|
3043
3059
|
let i = new Float64Array(t * n);
|
|
3044
3060
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
3045
3061
|
let a = new Float64Array(n);
|
|
3046
3062
|
for (let e = 0; e < t; e++) {
|
|
3047
3063
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
3048
|
-
let r =
|
|
3064
|
+
let r = wt(a);
|
|
3049
3065
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
3050
3066
|
}
|
|
3051
3067
|
let o = new Float64Array(t);
|
|
3052
3068
|
for (let e = 0; e < n; e++) {
|
|
3053
3069
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
3054
|
-
let n =
|
|
3070
|
+
let n = wt(o);
|
|
3055
3071
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
3056
3072
|
}
|
|
3057
3073
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -3063,15 +3079,15 @@ function wt(e, t, n, r = 128) {
|
|
|
3063
3079
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
3064
3080
|
return i;
|
|
3065
3081
|
}
|
|
3066
|
-
var
|
|
3067
|
-
function
|
|
3082
|
+
var kt = .25, At = .35, jt = .5;
|
|
3083
|
+
function Mt(e, t, n, r, i, a) {
|
|
3068
3084
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
3069
3085
|
if (t <= 0 || n <= 0) return {
|
|
3070
3086
|
normals: o,
|
|
3071
3087
|
bandMask: s,
|
|
3072
3088
|
bandWeight: c
|
|
3073
3089
|
};
|
|
3074
|
-
let l =
|
|
3090
|
+
let l = Ot(e, t, n), u = Ct(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = Dt(l, t, n, Math.max(1, r * kt)), m = (e) => {
|
|
3075
3091
|
let t = u(Math.max(0, e - .5));
|
|
3076
3092
|
return u(e + .5) - t;
|
|
3077
3093
|
};
|
|
@@ -3086,9 +3102,9 @@ function Ot(e, t, n, r, i, a) {
|
|
|
3086
3102
|
o[a * 3 + 2] = 1;
|
|
3087
3103
|
continue;
|
|
3088
3104
|
}
|
|
3089
|
-
let g = u / r, _ = 1 -
|
|
3105
|
+
let g = u / r, _ = 1 - At, v = 1;
|
|
3090
3106
|
if (g > _) {
|
|
3091
|
-
let e = Math.min(1, (g - _) /
|
|
3107
|
+
let e = Math.min(1, (g - _) / At);
|
|
3092
3108
|
v = 1 - e * e * (3 - 2 * e);
|
|
3093
3109
|
}
|
|
3094
3110
|
c[a] = v;
|
|
@@ -3103,7 +3119,7 @@ function Ot(e, t, n, r, i, a) {
|
|
|
3103
3119
|
bandWeight: c
|
|
3104
3120
|
};
|
|
3105
3121
|
}
|
|
3106
|
-
var
|
|
3122
|
+
var Nt = 35 * Math.PI / 180, Pt = 12 * Math.PI / 180, Ft = {
|
|
3107
3123
|
t: {
|
|
3108
3124
|
x: 0,
|
|
3109
3125
|
y: -1
|
|
@@ -3137,22 +3153,22 @@ var kt = 35 * Math.PI / 180, At = 12 * Math.PI / 180, jt = {
|
|
|
3137
3153
|
y: 1
|
|
3138
3154
|
}
|
|
3139
3155
|
};
|
|
3140
|
-
function
|
|
3156
|
+
function It(e, t, n) {
|
|
3141
3157
|
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
3142
3158
|
return {
|
|
3143
3159
|
x: e * i - t * a,
|
|
3144
3160
|
y: e * a + t * i
|
|
3145
3161
|
};
|
|
3146
3162
|
}
|
|
3147
|
-
function
|
|
3148
|
-
let r =
|
|
3149
|
-
return n && n.rev && (r =
|
|
3163
|
+
function Lt(e, t, n) {
|
|
3164
|
+
let r = Ft[t] ?? Ft.t;
|
|
3165
|
+
return n && n.rev && (r = It(r.x, r.y, n.rev)), zt(r.x, r.y, Nt);
|
|
3150
3166
|
}
|
|
3151
|
-
function
|
|
3167
|
+
function Rt(e) {
|
|
3152
3168
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
3153
|
-
return
|
|
3169
|
+
return zt(-e.x / t, -e.y / t, Pt);
|
|
3154
3170
|
}
|
|
3155
|
-
function
|
|
3171
|
+
function zt(e, t, n) {
|
|
3156
3172
|
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;
|
|
3157
3173
|
return {
|
|
3158
3174
|
x: o / l,
|
|
@@ -3160,7 +3176,7 @@ function Ft(e, t, n) {
|
|
|
3160
3176
|
z: c / l
|
|
3161
3177
|
};
|
|
3162
3178
|
}
|
|
3163
|
-
var
|
|
3179
|
+
var Bt = 2, Vt = {
|
|
3164
3180
|
matte: {
|
|
3165
3181
|
ambient: .62,
|
|
3166
3182
|
diffuse: .45,
|
|
@@ -3173,8 +3189,8 @@ var It = 2, Lt = {
|
|
|
3173
3189
|
specular: .35,
|
|
3174
3190
|
shininess: 22
|
|
3175
3191
|
}
|
|
3176
|
-
},
|
|
3177
|
-
function
|
|
3192
|
+
}, Ht = .8;
|
|
3193
|
+
function Ut(e) {
|
|
3178
3194
|
switch (e) {
|
|
3179
3195
|
case "plastic":
|
|
3180
3196
|
case "metal":
|
|
@@ -3185,8 +3201,8 @@ function zt(e) {
|
|
|
3185
3201
|
default: return "matte";
|
|
3186
3202
|
}
|
|
3187
3203
|
}
|
|
3188
|
-
function
|
|
3189
|
-
let r =
|
|
3204
|
+
function Wt(e, t, n = !0) {
|
|
3205
|
+
let r = Vt[e], i = {
|
|
3190
3206
|
light: t,
|
|
3191
3207
|
material: e,
|
|
3192
3208
|
ambient: r.ambient,
|
|
@@ -3194,9 +3210,9 @@ function Bt(e, t, n = !0) {
|
|
|
3194
3210
|
specular: r.specular,
|
|
3195
3211
|
shininess: r.shininess
|
|
3196
3212
|
};
|
|
3197
|
-
return n && (i.fillLight =
|
|
3213
|
+
return n && (i.fillLight = Rt(t), i.fillDiffuse = i.diffuse * Ht), i;
|
|
3198
3214
|
}
|
|
3199
|
-
function
|
|
3215
|
+
function Gt(e, t) {
|
|
3200
3216
|
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;
|
|
3201
3217
|
if (t.fillLight && t.fillDiffuse) {
|
|
3202
3218
|
let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
|
|
@@ -3209,7 +3225,7 @@ function Vt(e, t) {
|
|
|
3209
3225
|
}
|
|
3210
3226
|
return Math.max(0, t.ambient + r + i + a);
|
|
3211
3227
|
}
|
|
3212
|
-
function
|
|
3228
|
+
function Kt(e, t, n) {
|
|
3213
3229
|
if (!e) return {
|
|
3214
3230
|
x: 0,
|
|
3215
3231
|
y: 0,
|
|
@@ -3224,16 +3240,16 @@ function Ht(e, t, n) {
|
|
|
3224
3240
|
h: Math.max(0, o - i)
|
|
3225
3241
|
};
|
|
3226
3242
|
}
|
|
3227
|
-
function
|
|
3243
|
+
function qt(e, t, n) {
|
|
3228
3244
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3229
3245
|
if (r <= 0 || i <= 0) return;
|
|
3230
3246
|
let a = t.widthPx;
|
|
3231
3247
|
if (a < .75) return;
|
|
3232
|
-
let { x: o, y: s, w: c, h: l } =
|
|
3248
|
+
let { x: o, y: s, w: c, h: l } = Kt(n, r, i);
|
|
3233
3249
|
if (c <= 0 || l <= 0) return;
|
|
3234
3250
|
let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
|
|
3235
3251
|
for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
|
|
3236
|
-
let { bandMask: p, bandWeight: m, normals: h } =
|
|
3252
|
+
let { bandMask: p, bandWeight: m, normals: h } = Mt(f, c, l, a, t.prst, t.heightPx), g = Wt(t.material, t.light), _ = Gt({
|
|
3237
3253
|
x: 0,
|
|
3238
3254
|
y: 0,
|
|
3239
3255
|
z: 1
|
|
@@ -3244,13 +3260,13 @@ function Ut(e, t, n) {
|
|
|
3244
3260
|
if (n <= 0) continue;
|
|
3245
3261
|
let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
|
|
3246
3262
|
t.bottom && (r = -r, i = -i);
|
|
3247
|
-
let o = 1 + (
|
|
3263
|
+
let o = 1 + (Gt({
|
|
3248
3264
|
x: r,
|
|
3249
3265
|
y: i,
|
|
3250
3266
|
z: a
|
|
3251
3267
|
}, g) / _ - 1) * n, s = e * 4;
|
|
3252
3268
|
if (o >= 1) {
|
|
3253
|
-
let e = Math.min(1, (o - 1) *
|
|
3269
|
+
let e = Math.min(1, (o - 1) * Bt);
|
|
3254
3270
|
for (let t = 0; t < 3; t++) {
|
|
3255
3271
|
let n = Math.min(255, d[s + t] * o);
|
|
3256
3272
|
d[s + t] = n + (255 - n) * e;
|
|
@@ -3259,12 +3275,12 @@ function Ut(e, t, n) {
|
|
|
3259
3275
|
}
|
|
3260
3276
|
e.putImageData(u, o, s);
|
|
3261
3277
|
}
|
|
3262
|
-
function
|
|
3278
|
+
function Jt(e, t, n) {
|
|
3263
3279
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3264
3280
|
if (r <= 0 || i <= 0) return;
|
|
3265
3281
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
3266
3282
|
if (s < .75) return;
|
|
3267
|
-
let { x: c, y: l, w: u, h: d } =
|
|
3283
|
+
let { x: c, y: l, w: u, h: d } = Kt(n, r, i);
|
|
3268
3284
|
if (u <= 0 || d <= 0) return;
|
|
3269
3285
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
3270
3286
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -3288,8 +3304,8 @@ function Wt(e, t, n) {
|
|
|
3288
3304
|
}
|
|
3289
3305
|
//#endregion
|
|
3290
3306
|
//#region packages/core/src/text/underline.ts
|
|
3291
|
-
function
|
|
3292
|
-
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d =
|
|
3307
|
+
function Yt(e, t, n, r, i, a, o, s = 1) {
|
|
3308
|
+
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = J(u, l, s);
|
|
3293
3309
|
if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
|
|
3294
3310
|
let n = l, i = l * 6;
|
|
3295
3311
|
e.beginPath(), e.moveTo(t, u);
|
|
@@ -3310,14 +3326,14 @@ function Gt(e, t, n, r, i, a, o, s = 1) {
|
|
|
3310
3326
|
}
|
|
3311
3327
|
if (o === "dbl") {
|
|
3312
3328
|
let n = l * 1.4, i = u - n / 2, a = u + n / 2;
|
|
3313
|
-
e.beginPath(), e.moveTo(t, i +
|
|
3329
|
+
e.beginPath(), e.moveTo(t, i + J(i, l, s)), e.lineTo(t + r, i + J(i, l, s)), e.moveTo(t, a + J(a, l, s)), e.lineTo(t + r, a + J(a, l, s)), e.stroke();
|
|
3314
3330
|
return;
|
|
3315
3331
|
}
|
|
3316
|
-
e.setLineDash(
|
|
3332
|
+
e.setLineDash(_(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
|
|
3317
3333
|
}
|
|
3318
3334
|
//#endregion
|
|
3319
3335
|
//#region packages/core/src/text/highlight-box.ts
|
|
3320
|
-
function
|
|
3336
|
+
function Xt(e, t) {
|
|
3321
3337
|
return {
|
|
3322
3338
|
top: e - t * .85,
|
|
3323
3339
|
height: t * 1.1
|
|
@@ -3325,7 +3341,7 @@ function Kt(e, t) {
|
|
|
3325
3341
|
}
|
|
3326
3342
|
//#endregion
|
|
3327
3343
|
//#region packages/core/src/text/justify-positions.ts
|
|
3328
|
-
function
|
|
3344
|
+
function Zt(e, t, n, r, i = 0) {
|
|
3329
3345
|
let a = [], o = 0, s = 0;
|
|
3330
3346
|
for (let c of t) a.push({
|
|
3331
3347
|
text: e.slice(o, c).join(""),
|
|
@@ -3337,16 +3353,39 @@ function qt(e, t, n, r, i = 0) {
|
|
|
3337
3353
|
}), a;
|
|
3338
3354
|
}
|
|
3339
3355
|
//#endregion
|
|
3356
|
+
//#region packages/pptx/src/reflection-blur.ts
|
|
3357
|
+
var Qt = .5;
|
|
3358
|
+
function $t(e, t) {
|
|
3359
|
+
if (!(t > 0) || !(e.h > 0)) return [{
|
|
3360
|
+
y: e.y,
|
|
3361
|
+
h: Math.max(0, e.h),
|
|
3362
|
+
radius: 0
|
|
3363
|
+
}];
|
|
3364
|
+
let n = Math.max(4, Math.min(24, Math.ceil(t / Qt) + 1)), r = e.y + e.h, i = [];
|
|
3365
|
+
for (let a = 0; a < n; a++) {
|
|
3366
|
+
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;
|
|
3367
|
+
i.push({
|
|
3368
|
+
y: d,
|
|
3369
|
+
h: (u - l) * e.h,
|
|
3370
|
+
radius: t * a / (n - 1)
|
|
3371
|
+
});
|
|
3372
|
+
}
|
|
3373
|
+
return i;
|
|
3374
|
+
}
|
|
3375
|
+
function en(e, t, n, r, i) {
|
|
3376
|
+
for (let a of $t(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();
|
|
3377
|
+
}
|
|
3378
|
+
//#endregion
|
|
3340
3379
|
//#region packages/pptx/src/hyperlink.ts
|
|
3341
|
-
function
|
|
3380
|
+
function tn(e, t) {
|
|
3342
3381
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3343
3382
|
if (n === void 0 && r === void 0) return;
|
|
3344
3383
|
if (r !== void 0) return {
|
|
3345
3384
|
kind: "internal",
|
|
3346
3385
|
ref: n ?? r
|
|
3347
3386
|
};
|
|
3348
|
-
let i = n, a =
|
|
3349
|
-
return a !== null &&
|
|
3387
|
+
let i = n, a = H(i);
|
|
3388
|
+
return a !== null && ae.includes(a) ? {
|
|
3350
3389
|
kind: "external",
|
|
3351
3390
|
url: i
|
|
3352
3391
|
} : {
|
|
@@ -3356,7 +3395,7 @@ function Jt(e, t) {
|
|
|
3356
3395
|
}
|
|
3357
3396
|
//#endregion
|
|
3358
3397
|
//#region packages/pptx/src/media-chrome.ts
|
|
3359
|
-
function
|
|
3398
|
+
function nn(e, t, n, r, i, a) {
|
|
3360
3399
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3361
3400
|
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") {
|
|
3362
3401
|
e.beginPath();
|
|
@@ -3370,34 +3409,34 @@ function Yt(e, t, n, r, i, a) {
|
|
|
3370
3409
|
}
|
|
3371
3410
|
//#endregion
|
|
3372
3411
|
//#region packages/pptx/src/bidi-line.ts
|
|
3373
|
-
var
|
|
3412
|
+
var rn = (e) => {
|
|
3374
3413
|
let t = e.text;
|
|
3375
3414
|
return typeof t == "string" ? t : void 0;
|
|
3376
|
-
},
|
|
3377
|
-
function
|
|
3415
|
+
}, an = (e) => "isTab" in e;
|
|
3416
|
+
function on(e) {
|
|
3378
3417
|
for (let t of e) {
|
|
3379
|
-
let e =
|
|
3380
|
-
if (e !== void 0 &&
|
|
3418
|
+
let e = rn(t);
|
|
3419
|
+
if (e !== void 0 && W(e)) return !0;
|
|
3381
3420
|
}
|
|
3382
3421
|
return !1;
|
|
3383
3422
|
}
|
|
3384
|
-
function
|
|
3385
|
-
let r =
|
|
3423
|
+
function sn(t, n) {
|
|
3424
|
+
let r = t.length;
|
|
3386
3425
|
if (r === 0) return {
|
|
3387
3426
|
order: [],
|
|
3388
3427
|
rtl: []
|
|
3389
3428
|
};
|
|
3390
3429
|
let i = "", a = Array(r), o;
|
|
3391
|
-
for (let
|
|
3392
|
-
a[
|
|
3393
|
-
let n =
|
|
3394
|
-
if (i += n.length > 0 ? n : "",
|
|
3430
|
+
for (let e = 0; e < r; e++) {
|
|
3431
|
+
a[e] = i.length;
|
|
3432
|
+
let n = rn(t[e]) ?? "";
|
|
3433
|
+
if (i += n.length > 0 ? n : "", an(t[e])) {
|
|
3395
3434
|
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3396
|
-
o[a[
|
|
3435
|
+
o[a[e]] = "S";
|
|
3397
3436
|
}
|
|
3398
3437
|
}
|
|
3399
3438
|
if (o) for (; o.length < i.length;) o.push(null);
|
|
3400
|
-
let { levels: s, paragraphLevel: c } =
|
|
3439
|
+
let { levels: s, paragraphLevel: c } = f().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = e(s, c, a), d = Array(r);
|
|
3401
3440
|
for (let e = 0; e < r; e++) d[e] = (u[e] & 1) == 1;
|
|
3402
3441
|
return {
|
|
3403
3442
|
order: l,
|
|
@@ -3406,31 +3445,31 @@ function $t(e, n) {
|
|
|
3406
3445
|
}
|
|
3407
3446
|
//#endregion
|
|
3408
3447
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3409
|
-
function
|
|
3448
|
+
function cn(e, t, n, r) {
|
|
3410
3449
|
if (e.length === 0) return 0;
|
|
3411
|
-
let
|
|
3450
|
+
let a = t === 0, o = 0, s = t;
|
|
3412
3451
|
for (let t of e) {
|
|
3413
3452
|
if (s + t.w > n) {
|
|
3414
|
-
if (o > 0 || !
|
|
3453
|
+
if (o > 0 || !a) break;
|
|
3415
3454
|
s += t.w, o++;
|
|
3416
3455
|
break;
|
|
3417
3456
|
}
|
|
3418
3457
|
s += t.w, o++;
|
|
3419
3458
|
}
|
|
3420
|
-
return o === 0 ? 0 : o >= e.length ? e.length :
|
|
3459
|
+
return o === 0 ? 0 : o >= e.length ? e.length : i(e.map((e) => e.ch), o, r, +!!a);
|
|
3421
3460
|
}
|
|
3422
3461
|
//#endregion
|
|
3423
3462
|
//#region packages/pptx/src/text-justify.ts
|
|
3424
|
-
var
|
|
3425
|
-
function
|
|
3463
|
+
var ln = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3464
|
+
function un(e, t, n, r, i) {
|
|
3426
3465
|
if (r === "just" && i) return null;
|
|
3427
3466
|
let a = t - n;
|
|
3428
3467
|
if (a <= .5) return null;
|
|
3429
3468
|
let o = Ce(e, a, {
|
|
3430
3469
|
firstContentSi: 0,
|
|
3431
3470
|
lastDrawnSi: e.length,
|
|
3432
|
-
isGapChar:
|
|
3433
|
-
isWhitespace:
|
|
3471
|
+
isGapChar: de,
|
|
3472
|
+
isWhitespace: ln,
|
|
3434
3473
|
seaClusterGaps: r === "thaiDist"
|
|
3435
3474
|
});
|
|
3436
3475
|
if (!o) return null;
|
|
@@ -3451,7 +3490,7 @@ function nn(e, t, n, r, i) {
|
|
|
3451
3490
|
}
|
|
3452
3491
|
//#endregion
|
|
3453
3492
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3454
|
-
function
|
|
3493
|
+
function dn(e) {
|
|
3455
3494
|
if (!e) return {
|
|
3456
3495
|
r: 0,
|
|
3457
3496
|
g: 0,
|
|
@@ -3468,37 +3507,37 @@ function rn(e) {
|
|
|
3468
3507
|
b: parseInt(t.slice(4, 6), 16)
|
|
3469
3508
|
};
|
|
3470
3509
|
}
|
|
3471
|
-
function
|
|
3472
|
-
let t =
|
|
3510
|
+
function fn(e) {
|
|
3511
|
+
let t = dn(e);
|
|
3473
3512
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3474
3513
|
}
|
|
3475
|
-
function
|
|
3514
|
+
function pn(e, t) {
|
|
3476
3515
|
if (!e && !t) return null;
|
|
3477
3516
|
if (!e) return t;
|
|
3478
3517
|
if (!t) return e;
|
|
3479
3518
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3480
|
-
let n =
|
|
3519
|
+
let n = fn(e.color), r = fn(t.color);
|
|
3481
3520
|
return n === r || n < r ? e : t;
|
|
3482
3521
|
}
|
|
3483
3522
|
//#endregion
|
|
3484
3523
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3485
|
-
function
|
|
3486
|
-
let t =
|
|
3524
|
+
function mn(e) {
|
|
3525
|
+
let t = k(e.length === 8 ? e.slice(0, 6) : e);
|
|
3487
3526
|
if (!t) return null;
|
|
3488
|
-
let n =
|
|
3527
|
+
let n = fe(t[0], t[1], t[2]);
|
|
3489
3528
|
if (e.length !== 8) return n;
|
|
3490
3529
|
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
3491
3530
|
if (Number.isNaN(r)) return null;
|
|
3492
3531
|
let i = r / 255;
|
|
3493
3532
|
return i * n + (1 - i);
|
|
3494
3533
|
}
|
|
3495
|
-
function
|
|
3534
|
+
function hn(e) {
|
|
3496
3535
|
if (!e) return null;
|
|
3497
|
-
if (e.fillType === "solid") return
|
|
3536
|
+
if (e.fillType === "solid") return mn(e.color);
|
|
3498
3537
|
if (e.fillType === "gradient") {
|
|
3499
3538
|
let t = e.stops.map((e) => ({
|
|
3500
3539
|
p: Math.min(1, Math.max(0, e.position)),
|
|
3501
|
-
l:
|
|
3540
|
+
l: mn(e.color)
|
|
3502
3541
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3503
3542
|
if (t.length === 0) return null;
|
|
3504
3543
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -3507,18 +3546,18 @@ function cn(e) {
|
|
|
3507
3546
|
}
|
|
3508
3547
|
return null;
|
|
3509
3548
|
}
|
|
3510
|
-
function
|
|
3549
|
+
function gn(e) {
|
|
3511
3550
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3512
3551
|
}
|
|
3513
|
-
function
|
|
3514
|
-
let n =
|
|
3552
|
+
function _n(e, t) {
|
|
3553
|
+
let n = hn(e);
|
|
3515
3554
|
if (n === null || n >= .5) return null;
|
|
3516
|
-
let r =
|
|
3555
|
+
let r = mn(t.replace(/^#/, ""));
|
|
3517
3556
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3518
3557
|
}
|
|
3519
3558
|
//#endregion
|
|
3520
3559
|
//#region packages/pptx/src/tab-layout.ts
|
|
3521
|
-
function
|
|
3560
|
+
function vn(e, t, n, r, i, a = 0) {
|
|
3522
3561
|
let o = e.map((e) => e.width), s = (t) => {
|
|
3523
3562
|
let n = 0;
|
|
3524
3563
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -3546,8 +3585,8 @@ function dn(e, t, n, r, i, a = 0) {
|
|
|
3546
3585
|
}
|
|
3547
3586
|
//#endregion
|
|
3548
3587
|
//#region packages/pptx/src/vertical-text.ts
|
|
3549
|
-
var
|
|
3550
|
-
function
|
|
3588
|
+
var yn = () => !1;
|
|
3589
|
+
function bn(e, t, n) {
|
|
3551
3590
|
let r = e.textBaseline;
|
|
3552
3591
|
e.textBaseline = "alphabetic";
|
|
3553
3592
|
let i = e.measureText(t);
|
|
@@ -3555,7 +3594,7 @@ function pn(e, t, n) {
|
|
|
3555
3594
|
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3556
3595
|
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3557
3596
|
}
|
|
3558
|
-
function
|
|
3597
|
+
function xn(e, t) {
|
|
3559
3598
|
let n = e.textAlign, r = e.textBaseline;
|
|
3560
3599
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
3561
3600
|
let i = e.measureText(t);
|
|
@@ -3563,15 +3602,15 @@ function mn(e, t) {
|
|
|
3563
3602
|
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3564
3603
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3565
3604
|
}
|
|
3566
|
-
function
|
|
3567
|
-
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r -
|
|
3605
|
+
function Sn(e, t, n, r, i, a, o = "fill", s = yn) {
|
|
3606
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - bn(e, t, i), f = 0;
|
|
3568
3607
|
for (let o of t) {
|
|
3569
|
-
let t = o.codePointAt(0) ?? 0, l = I(t), p = e.measureText(o).width + a, m = l === "Tr" ?
|
|
3570
|
-
if (
|
|
3608
|
+
let t = o.codePointAt(0) ?? 0, l = I(t), p = e.measureText(o).width + a, m = l === "Tr" ? ce(t) : null, h = l === "Tr" && m === null && q(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3609
|
+
if (ne(t) && s(t)) {
|
|
3571
3610
|
let t = n + f + p / 2;
|
|
3572
|
-
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
3611
|
+
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", A(e, () => u(o, 0, 0)), e.restore();
|
|
3573
3612
|
} else if (g) {
|
|
3574
|
-
let r = m === null && l === "Tu" ?
|
|
3613
|
+
let r = m === null && l === "Tu" ? N(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? xn(e, s) / i : 0;
|
|
3575
3614
|
e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
|
|
3576
3615
|
} else if (l === "Tr") {
|
|
3577
3616
|
let t = n + f + p / 2;
|
|
@@ -3581,27 +3620,24 @@ function hn(e, t, n, r, i, a, o = "fill", s = fn) {
|
|
|
3581
3620
|
}
|
|
3582
3621
|
e.textAlign = c, e.textBaseline = l;
|
|
3583
3622
|
}
|
|
3584
|
-
function
|
|
3585
|
-
|
|
3623
|
+
function Cn(e, t, n, r, i, a, o = "fill") {
|
|
3624
|
+
Sn(e, t, n, r, i, a, o, (t) => oe(e, t));
|
|
3586
3625
|
}
|
|
3587
3626
|
//#endregion
|
|
3588
3627
|
//#region packages/pptx/src/renderer.ts
|
|
3589
|
-
function
|
|
3628
|
+
function X(e, t) {
|
|
3590
3629
|
return e * t;
|
|
3591
3630
|
}
|
|
3592
|
-
var
|
|
3593
|
-
function
|
|
3594
|
-
let { top: s, height: c } =
|
|
3631
|
+
var Z = E;
|
|
3632
|
+
function wn(e, t, n, r, i, a, o) {
|
|
3633
|
+
let { top: s, height: c } = Xt(n, i);
|
|
3595
3634
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3596
3635
|
}
|
|
3597
|
-
function
|
|
3598
|
-
return
|
|
3599
|
-
}
|
|
3600
|
-
function yn(e, t, n, r, i, a) {
|
|
3601
|
-
return E(e, t, n, r, i, a);
|
|
3636
|
+
function Tn(e, t, n, r, i, a, o = 0) {
|
|
3637
|
+
return T(e, t, n, r, i, a, o);
|
|
3602
3638
|
}
|
|
3603
|
-
var
|
|
3604
|
-
function
|
|
3639
|
+
var En = /* @__PURE__ */ new WeakMap();
|
|
3640
|
+
function Dn(e, t) {
|
|
3605
3641
|
let n = e.tinted.get(t);
|
|
3606
3642
|
if (n) return n;
|
|
3607
3643
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -3609,18 +3645,18 @@ function xn(e, t) {
|
|
|
3609
3645
|
let o = a.getContext("2d");
|
|
3610
3646
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
3611
3647
|
}
|
|
3612
|
-
function
|
|
3648
|
+
function On(e) {
|
|
3613
3649
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3614
3650
|
return new Promise((e, r) => {
|
|
3615
3651
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3616
3652
|
});
|
|
3617
3653
|
}
|
|
3618
|
-
var
|
|
3619
|
-
function
|
|
3620
|
-
let r = Math.max(1, Math.round(t *
|
|
3654
|
+
var kn = 256;
|
|
3655
|
+
function An(e, t, n) {
|
|
3656
|
+
let r = Math.max(1, Math.round(t * kn)), i = Math.max(1, Math.round(n * kn));
|
|
3621
3657
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3622
3658
|
}
|
|
3623
|
-
function
|
|
3659
|
+
function jn(e) {
|
|
3624
3660
|
let t = [], n = (e) => {
|
|
3625
3661
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3626
3662
|
nodes: e.nodes,
|
|
@@ -3631,13 +3667,13 @@ function Tn(e) {
|
|
|
3631
3667
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3632
3668
|
return t;
|
|
3633
3669
|
}
|
|
3634
|
-
async function
|
|
3635
|
-
let n =
|
|
3670
|
+
async function Mn(e, t) {
|
|
3671
|
+
let n = jn(e);
|
|
3636
3672
|
if (n.length !== 0) {
|
|
3637
3673
|
await t.loadMathJax();
|
|
3638
|
-
for (let e of n) if (!
|
|
3639
|
-
let n = await t.mathMLToSvg(
|
|
3640
|
-
|
|
3674
|
+
for (let e of n) if (!En.has(e.nodes)) try {
|
|
3675
|
+
let n = await t.mathMLToSvg(O(e.nodes, e.display)), r = await On(An(Ee(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3676
|
+
En.set(e.nodes, {
|
|
3641
3677
|
img: r,
|
|
3642
3678
|
widthEm: n.widthEm,
|
|
3643
3679
|
ascentEm: n.ascentEm,
|
|
@@ -3647,10 +3683,10 @@ async function En(e, t) {
|
|
|
3647
3683
|
} catch {}
|
|
3648
3684
|
}
|
|
3649
3685
|
}
|
|
3650
|
-
function
|
|
3686
|
+
function Nn(e, t) {
|
|
3651
3687
|
return e ? e.startsWith("+") ? e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif" : e.split(",")[0].trim() || (t.themeMinorFont ?? "sans-serif") : t.themeMinorFont ?? "sans-serif";
|
|
3652
3688
|
}
|
|
3653
|
-
var
|
|
3689
|
+
var Pn = new Set([
|
|
3654
3690
|
"serif",
|
|
3655
3691
|
"sans-serif",
|
|
3656
3692
|
"monospace",
|
|
@@ -3658,113 +3694,163 @@ var On = new Set([
|
|
|
3658
3694
|
"fantasy",
|
|
3659
3695
|
"system-ui"
|
|
3660
3696
|
]);
|
|
3661
|
-
function
|
|
3662
|
-
let t =
|
|
3697
|
+
function Fn(e) {
|
|
3698
|
+
let t = L(e);
|
|
3663
3699
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3664
3700
|
}
|
|
3665
|
-
var
|
|
3701
|
+
var In = {
|
|
3666
3702
|
calibri: "Carlito",
|
|
3667
3703
|
"calibri light": "Carlito",
|
|
3668
3704
|
cambria: "Caladea",
|
|
3669
3705
|
"cambria math": "Caladea",
|
|
3706
|
+
"franklin gothic book": "Libre Franklin",
|
|
3707
|
+
"franklin gothic medium": "Libre Franklin",
|
|
3670
3708
|
"sakkal majalla": "Noto Naskh Arabic",
|
|
3671
3709
|
"traditional arabic": "Noto Naskh Arabic",
|
|
3672
3710
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3673
3711
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3674
3712
|
"univers next arabic": "Noto Sans Arabic"
|
|
3675
|
-
},
|
|
3676
|
-
function
|
|
3677
|
-
if (
|
|
3713
|
+
}, Ln = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3714
|
+
function Rn(e) {
|
|
3715
|
+
if (In[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3678
3716
|
let t = e.toLowerCase();
|
|
3679
3717
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3680
3718
|
}
|
|
3681
|
-
function
|
|
3719
|
+
function zn(e) {
|
|
3682
3720
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3683
3721
|
}
|
|
3684
|
-
function
|
|
3685
|
-
let t =
|
|
3686
|
-
if (
|
|
3687
|
-
let i = t === "serif" ? "serif" : "sans", a =
|
|
3688
|
-
return `"${e}", ${r}${a ? `${
|
|
3722
|
+
function Bn(e) {
|
|
3723
|
+
let t = Fn(e), n = In[e.toLowerCase()], r = n ? `"${n}", ` : "";
|
|
3724
|
+
if (Rn(e)) return `"${e}", ${r}${Ln}, ${t}`;
|
|
3725
|
+
let i = t === "serif" ? "serif" : "sans", a = P(e);
|
|
3726
|
+
return `"${e}", ${r}${a ? `${zn(le(a, i))}, ` : ""}${`${zn(i === "serif" ? j : se)}, `}${t}`;
|
|
3689
3727
|
}
|
|
3690
|
-
function
|
|
3728
|
+
function Vn(e) {
|
|
3691
3729
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3692
3730
|
}
|
|
3693
|
-
function
|
|
3694
|
-
let
|
|
3695
|
-
return
|
|
3731
|
+
function Hn(e) {
|
|
3732
|
+
let t = e.toLowerCase();
|
|
3733
|
+
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;
|
|
3734
|
+
}
|
|
3735
|
+
function Un(e, t, n, r, i, a, o, s) {
|
|
3736
|
+
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 = F(m, h), _ = g?.getContext("2d");
|
|
3737
|
+
if (!g || !_) return;
|
|
3738
|
+
_.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
|
|
3739
|
+
let v = n.y - d, y = v + n.h, b = g, x = _;
|
|
3740
|
+
if (c > 0) {
|
|
3741
|
+
let e = F(m, h), t = e?.getContext("2d");
|
|
3742
|
+
e && t && (b = e, x = t);
|
|
3743
|
+
}
|
|
3744
|
+
b !== g && en(x, g, {
|
|
3745
|
+
x: n.x - u,
|
|
3746
|
+
y: v,
|
|
3747
|
+
w: n.w,
|
|
3748
|
+
h: n.h
|
|
3749
|
+
}, c, m);
|
|
3750
|
+
let S = Math.max(0, Math.min(1, r.stPos)), C = Math.max(0, Math.min(1, r.endPos)), w = Math.max(1, y - v);
|
|
3751
|
+
try {
|
|
3752
|
+
let e = x.getImageData(0, 0, m, h);
|
|
3753
|
+
for (let t = 0; t < h; t++) {
|
|
3754
|
+
let n = Math.max(0, Math.min(1, (y - (t + .5)) / w)), i;
|
|
3755
|
+
if (n <= S) i = r.stA;
|
|
3756
|
+
else if (n >= C || C <= S) i = r.endA;
|
|
3757
|
+
else {
|
|
3758
|
+
let e = (n - S) / (C - S);
|
|
3759
|
+
i = r.stA + (r.endA - r.stA) * e;
|
|
3760
|
+
}
|
|
3761
|
+
let a = Math.max(0, Math.min(1, i));
|
|
3762
|
+
for (let n = t * m * 4 + 3; n < (t + 1) * m * 4; n += 4) e.data[n] = Math.round(e.data[n] * a);
|
|
3763
|
+
}
|
|
3764
|
+
x.putImageData(e, 0, 0);
|
|
3765
|
+
} catch {
|
|
3766
|
+
x.save(), x.globalCompositeOperation = "destination-in", x.fillStyle = `rgba(0,0,0,${Math.max(0, Math.min(1, r.stA))})`, x.fillRect(0, 0, m, h), x.restore();
|
|
3767
|
+
}
|
|
3768
|
+
let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
|
|
3769
|
+
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();
|
|
3770
|
+
}
|
|
3771
|
+
function Q(e, t, n, r, i) {
|
|
3772
|
+
let a = t ? "italic " : "", o = Nn(r, i), s = Hn(o), c = e ? "bold " : s ? `${s} ` : "";
|
|
3773
|
+
return Pn.has(o) ? `${a}${c}${n}px ${o}` : `${a}${c}${n}px ${Bn(o)}`;
|
|
3696
3774
|
}
|
|
3697
|
-
function
|
|
3698
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3775
|
+
function Wn(e) {
|
|
3776
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || De(e.bullet).type === "blip";
|
|
3699
3777
|
}
|
|
3700
|
-
function
|
|
3778
|
+
function Gn(e, t) {
|
|
3701
3779
|
return e ? 0 : Math.max(0, t);
|
|
3702
3780
|
}
|
|
3703
|
-
function
|
|
3704
|
-
let s = (t.defaultFontSize ?? 18) *
|
|
3781
|
+
function Kn(e, t, n, r, i, a, o) {
|
|
3782
|
+
let s = (t.defaultFontSize ?? 18) * U * a;
|
|
3705
3783
|
for (let c of t.paragraphs) {
|
|
3706
|
-
let l =
|
|
3784
|
+
let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = Gn(Wn(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3707
3785
|
for (let n of c.runs) {
|
|
3708
3786
|
if (n.type !== "text") continue;
|
|
3709
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize *
|
|
3710
|
-
if (e.font =
|
|
3787
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * U * a : n.fontSize * U * a, i = Nn(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3788
|
+
if (e.font = Q(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, r, i, o), m += e.measureText(n.text).width, m > p) return !0;
|
|
3711
3789
|
}
|
|
3712
3790
|
}
|
|
3713
3791
|
return !1;
|
|
3714
3792
|
}
|
|
3715
|
-
function
|
|
3716
|
-
for (let t of e) if (
|
|
3793
|
+
function qn(e) {
|
|
3794
|
+
for (let t of e) if (de(t.codePointAt(0) ?? 0)) return !0;
|
|
3717
3795
|
return !1;
|
|
3718
3796
|
}
|
|
3719
|
-
function
|
|
3797
|
+
function Jn(e) {
|
|
3720
3798
|
let t = 0;
|
|
3721
3799
|
for (let n of e) t++;
|
|
3722
3800
|
return t;
|
|
3723
3801
|
}
|
|
3724
|
-
function
|
|
3802
|
+
function Yn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3725
3803
|
themeMajorFont: null,
|
|
3726
3804
|
themeMinorFont: null,
|
|
3727
3805
|
dpr: 1
|
|
3728
3806
|
}, p = 0) {
|
|
3729
|
-
let m = [],
|
|
3730
|
-
|
|
3807
|
+
let m = [], g = /* @__PURE__ */ new Map(), _ = !0;
|
|
3808
|
+
for (let e = t.runs.length - 1; e >= 0 && _; e--) {
|
|
3809
|
+
let n = t.runs[e];
|
|
3810
|
+
if (n.type === "break") continue;
|
|
3811
|
+
if (n.type === "math") break;
|
|
3812
|
+
let r = n.text.replace(/ +$/u, "");
|
|
3813
|
+
r !== n.text && g.set(n, r), (r.length > 0 || n.fieldType != null) && (_ = !1);
|
|
3814
|
+
}
|
|
3815
|
+
let v = () => n - (m.length === 0 ? p : 0), b = { segments: [] }, x = 0, S = !1, C = t.rtl === !0, w = X(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
|
|
3816
|
+
pos: X(e.pos, o),
|
|
3731
3817
|
algn: e.algn
|
|
3732
|
-
})),
|
|
3733
|
-
let t =
|
|
3818
|
+
})), E = X(t.defTabSz ?? 914400, o), O = !1, k = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
|
|
3819
|
+
let t = vn(e > 0 ? [...k, {
|
|
3734
3820
|
isTab: !1,
|
|
3735
3821
|
width: e
|
|
3736
|
-
}] :
|
|
3822
|
+
}] : k, T, j(), Infinity, A, E), n = 0;
|
|
3737
3823
|
for (let e of t) n += e;
|
|
3738
3824
|
return n;
|
|
3739
|
-
},
|
|
3740
|
-
let t =
|
|
3741
|
-
return Number.isFinite(t) ?
|
|
3742
|
-
},
|
|
3743
|
-
let e =
|
|
3744
|
-
if (!
|
|
3825
|
+
}, N = (e) => {
|
|
3826
|
+
let t = v();
|
|
3827
|
+
return Number.isFinite(t) ? O ? M(e) <= t : x + e <= t : !0;
|
|
3828
|
+
}, P = () => {
|
|
3829
|
+
let e = v();
|
|
3830
|
+
if (!O) return e - x;
|
|
3745
3831
|
if (!Number.isFinite(e)) return Infinity;
|
|
3746
|
-
if (
|
|
3832
|
+
if (M(0) >= e) return 0;
|
|
3747
3833
|
let t = 0, n = e;
|
|
3748
3834
|
for (let r = 0; r < 40; r++) {
|
|
3749
3835
|
let r = (t + n) / 2;
|
|
3750
|
-
|
|
3836
|
+
M(r) <= e ? t = r : n = r;
|
|
3751
3837
|
}
|
|
3752
3838
|
return t;
|
|
3753
|
-
},
|
|
3754
|
-
e && (
|
|
3755
|
-
},
|
|
3839
|
+
}, F = (e = !1) => {
|
|
3840
|
+
e && (b.endsWithBreak = !0), m.push(b), b = { segments: [] }, x = 0, O = !1, k = [], S = !1;
|
|
3841
|
+
}, I = (t, n, r, i, a, o, s, c) => {
|
|
3756
3842
|
if (!t) return;
|
|
3757
3843
|
e.font = n;
|
|
3758
|
-
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l *
|
|
3759
|
-
|
|
3844
|
+
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l * Jn(t), d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, y = c?.hyperlink, S = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && Vn(e.hyperlink) === Vn(y);
|
|
3845
|
+
x += u, k.push({
|
|
3760
3846
|
isTab: !1,
|
|
3761
3847
|
width: u
|
|
3762
3848
|
});
|
|
3763
|
-
let
|
|
3764
|
-
|
|
3849
|
+
let C = b.segments.at(-1);
|
|
3850
|
+
C && S(C) ? C.text += t : b.segments.push({
|
|
3765
3851
|
text: t,
|
|
3766
3852
|
font: n,
|
|
3767
|
-
fontFamily:
|
|
3853
|
+
fontFamily: v,
|
|
3768
3854
|
sizePx: r,
|
|
3769
3855
|
color: i,
|
|
3770
3856
|
underline: a,
|
|
@@ -3775,23 +3861,25 @@ function Bn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3775
3861
|
letterSpacingPx: l || void 0,
|
|
3776
3862
|
baseline: s,
|
|
3777
3863
|
shadow: m,
|
|
3778
|
-
|
|
3864
|
+
reflection: h,
|
|
3865
|
+
outline: g,
|
|
3779
3866
|
highlight: _,
|
|
3780
|
-
hyperlink:
|
|
3867
|
+
hyperlink: y
|
|
3781
3868
|
});
|
|
3782
|
-
},
|
|
3783
|
-
let e =
|
|
3869
|
+
}, L = () => {
|
|
3870
|
+
let e = b.segments.at(-1);
|
|
3784
3871
|
if (!e || e.math) return !1;
|
|
3785
3872
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
3786
3873
|
if (t) e.text = t[1], n = t[2];
|
|
3787
|
-
else if (
|
|
3874
|
+
else if (b.segments.length > 1) b.segments.pop(), n = e.text;
|
|
3788
3875
|
else return !1;
|
|
3789
|
-
return
|
|
3876
|
+
return F(), I(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
3790
3877
|
strikeDouble: e.strikeDouble,
|
|
3791
3878
|
letterSpacingPx: e.letterSpacingPx,
|
|
3792
3879
|
underlineStyle: e.underlineStyle,
|
|
3793
3880
|
underlineColor: e.underlineColor,
|
|
3794
3881
|
shadow: e.shadow,
|
|
3882
|
+
reflection: e.reflection,
|
|
3795
3883
|
outline: e.outline,
|
|
3796
3884
|
highlight: e.highlight,
|
|
3797
3885
|
fontFamily: e.fontFamily
|
|
@@ -3799,132 +3887,133 @@ function Bn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3799
3887
|
};
|
|
3800
3888
|
for (let n of t.runs) {
|
|
3801
3889
|
if (n.type === "break") {
|
|
3802
|
-
|
|
3890
|
+
F(!0);
|
|
3803
3891
|
continue;
|
|
3804
3892
|
}
|
|
3805
3893
|
if (n.type === "math") {
|
|
3806
|
-
let e =
|
|
3807
|
-
(n.display &&
|
|
3894
|
+
let e = En.get(n.nodes), t = n.fontSize == null ? i : n.fontSize * U * o * u, r = e ? e.widthEm * t : 0, s = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
3895
|
+
(n.display && x > 0 || !N(r) && x > 0) && F(), k.push({
|
|
3808
3896
|
isTab: !1,
|
|
3809
|
-
width:
|
|
3810
|
-
}),
|
|
3897
|
+
width: r
|
|
3898
|
+
}), b.segments.push({
|
|
3811
3899
|
text: "",
|
|
3812
3900
|
font: `${t}px sans-serif`,
|
|
3813
3901
|
sizePx: t,
|
|
3814
|
-
color: n.color ?
|
|
3902
|
+
color: n.color ? Z(n.color) : a,
|
|
3815
3903
|
underline: !1,
|
|
3816
3904
|
strikethrough: !1,
|
|
3817
3905
|
math: {
|
|
3818
3906
|
nodes: n.nodes,
|
|
3819
3907
|
display: n.display,
|
|
3820
|
-
width:
|
|
3908
|
+
width: r,
|
|
3821
3909
|
ascent: s,
|
|
3822
3910
|
descent: c
|
|
3823
3911
|
}
|
|
3824
|
-
}),
|
|
3912
|
+
}), x += r, n.display && F();
|
|
3825
3913
|
continue;
|
|
3826
3914
|
}
|
|
3827
|
-
let s = n.fontSize == null ?
|
|
3828
|
-
|
|
3829
|
-
let
|
|
3830
|
-
e.font =
|
|
3831
|
-
let
|
|
3832
|
-
(
|
|
3833
|
-
let
|
|
3834
|
-
strikeDouble:
|
|
3835
|
-
letterSpacingPx:
|
|
3915
|
+
let s = n.fontSize == null ? i : n.fontSize * U * o * u, p = Nn(n.fontFamily ?? t.defFontFamily ?? null, f), m = n.fontFamilyEa ? Nn(n.fontFamilyEa, f) : null, _ = n.fontFamilySym ? Nn(n.fontFamilySym, f) : null, C;
|
|
3916
|
+
C = n.color ? Z(n.color) : n.hyperlink && f.themeHlinkColor ? Z(f.themeHlinkColor) : a;
|
|
3917
|
+
let w = n.bold ?? t.defBold ?? c, T = n.italic ?? t.defItalic ?? l, E = Q(w, T, s, p, f), j = m ? Q(w, T, s, m, f) : E;
|
|
3918
|
+
e.font = E;
|
|
3919
|
+
let M = n.caps, z = g.get(n) ?? n.text;
|
|
3920
|
+
(M === "all" || M === "small") && (z = z.toUpperCase());
|
|
3921
|
+
let V = n.fieldType === "slidenum" && d !== void 0 ? String(d) : z, H = n.underline || n.hyperlink !== void 0, W = n.strikeDouble === !0, G = n.letterSpacing == null ? 0 : n.letterSpacing * U * o, K = {
|
|
3922
|
+
strikeDouble: W,
|
|
3923
|
+
letterSpacingPx: G,
|
|
3836
3924
|
underlineStyle: n.underlineStyle,
|
|
3837
|
-
underlineColor: n.underlineColor ?
|
|
3925
|
+
underlineColor: n.underlineColor ? Z(n.underlineColor) : void 0,
|
|
3838
3926
|
shadow: n.shadow,
|
|
3927
|
+
reflection: n.reflection,
|
|
3839
3928
|
outline: n.outline,
|
|
3840
3929
|
fontFamily: p,
|
|
3841
|
-
highlight: n.highlight ?
|
|
3842
|
-
hyperlink:
|
|
3843
|
-
},
|
|
3844
|
-
for (let
|
|
3845
|
-
if (!
|
|
3846
|
-
if (/^\t+$/.test(
|
|
3847
|
-
|
|
3848
|
-
for (let e of
|
|
3930
|
+
highlight: n.highlight ? Z(n.highlight) : void 0,
|
|
3931
|
+
hyperlink: tn(n.hyperlink)
|
|
3932
|
+
}, q = V.split(/(\s+)/);
|
|
3933
|
+
for (let i of q) {
|
|
3934
|
+
if (!i) continue;
|
|
3935
|
+
if (/^\t+$/.test(i)) {
|
|
3936
|
+
O || (e.font = E, A = e.measureText(" ").width);
|
|
3937
|
+
for (let e of i) b.segments.push({
|
|
3849
3938
|
text: "",
|
|
3850
3939
|
isTab: !0,
|
|
3851
|
-
font:
|
|
3940
|
+
font: E,
|
|
3852
3941
|
fontFamily: p,
|
|
3853
3942
|
sizePx: s,
|
|
3854
|
-
color:
|
|
3943
|
+
color: C,
|
|
3855
3944
|
underline: !1,
|
|
3856
3945
|
strikethrough: !1
|
|
3857
|
-
}),
|
|
3946
|
+
}), k.push({
|
|
3858
3947
|
isTab: !0,
|
|
3859
3948
|
width: 0
|
|
3860
3949
|
});
|
|
3861
|
-
|
|
3950
|
+
O = !0;
|
|
3862
3951
|
continue;
|
|
3863
3952
|
}
|
|
3864
|
-
e.font =
|
|
3865
|
-
let a = e.measureText(
|
|
3866
|
-
if (c.test(
|
|
3867
|
-
let t =
|
|
3868
|
-
for (let
|
|
3869
|
-
let
|
|
3870
|
-
if (c.test(
|
|
3871
|
-
let e =
|
|
3872
|
-
e ===
|
|
3953
|
+
e.font = E;
|
|
3954
|
+
let a = e.measureText(i).width, o = /^\s+$/.test(i), c = /[-]/;
|
|
3955
|
+
if (c.test(i) && (_ != null || we(p))) {
|
|
3956
|
+
let t = _ ?? p;
|
|
3957
|
+
for (let r of i) {
|
|
3958
|
+
let i = r, a = E;
|
|
3959
|
+
if (c.test(r)) {
|
|
3960
|
+
let e = ge(r, t);
|
|
3961
|
+
e === r ? a = Q(w, T, s, t, f) : (i = e, a = Q(w, T, s, "sans-serif", f));
|
|
3873
3962
|
}
|
|
3874
3963
|
e.font = a;
|
|
3875
|
-
let o = e.measureText(
|
|
3876
|
-
!
|
|
3964
|
+
let o = e.measureText(i).width;
|
|
3965
|
+
!N(o) && x > 0 && F(), I(i, a, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
|
|
3877
3966
|
}
|
|
3878
3967
|
continue;
|
|
3879
3968
|
}
|
|
3880
|
-
if (
|
|
3881
|
-
let
|
|
3882
|
-
for (let t of
|
|
3883
|
-
let n =
|
|
3884
|
-
e.font =
|
|
3969
|
+
if (qn(i) && (!B(i) || t.eaLnBrk === !1)) {
|
|
3970
|
+
let r = [];
|
|
3971
|
+
for (let t of i) {
|
|
3972
|
+
let n = de(t.codePointAt(0) ?? 0) && m != null, i = n ? j : E, a = n ? m : p;
|
|
3973
|
+
e.font = i, r.push({
|
|
3885
3974
|
ch: t,
|
|
3886
3975
|
w: e.measureText(t).width,
|
|
3887
|
-
font:
|
|
3976
|
+
font: i,
|
|
3888
3977
|
family: a
|
|
3889
3978
|
});
|
|
3890
3979
|
}
|
|
3891
3980
|
if (t.eaLnBrk === !1) {
|
|
3892
|
-
let e =
|
|
3893
|
-
|
|
3894
|
-
for (let e of
|
|
3895
|
-
...
|
|
3981
|
+
let e = r.reduce((e, t) => e + t.w, 0);
|
|
3982
|
+
x > 0 && !N(e) && F();
|
|
3983
|
+
for (let e of r) I(e.ch, e.font, s, C, H, n.strikethrough, n.baseline ?? void 0, {
|
|
3984
|
+
...K,
|
|
3896
3985
|
fontFamily: e.family
|
|
3897
3986
|
});
|
|
3898
3987
|
continue;
|
|
3899
3988
|
}
|
|
3900
|
-
let a =
|
|
3989
|
+
let a = r;
|
|
3901
3990
|
for (; a.length > 0;) {
|
|
3902
|
-
let e = Number.isFinite(
|
|
3991
|
+
let e = Number.isFinite(v()) ? v() - P() : x, t = cn(a, e, v(), h);
|
|
3903
3992
|
if (t === 0) {
|
|
3904
|
-
if (
|
|
3905
|
-
|
|
3993
|
+
if (x > 0) {
|
|
3994
|
+
F();
|
|
3906
3995
|
continue;
|
|
3907
3996
|
}
|
|
3908
3997
|
t = 1;
|
|
3909
3998
|
}
|
|
3910
3999
|
for (let e = 0; e < t; e++) {
|
|
3911
4000
|
let t = a[e];
|
|
3912
|
-
|
|
3913
|
-
...
|
|
4001
|
+
I(t.ch, t.font, s, C, H, n.strikethrough, n.baseline ?? void 0, {
|
|
4002
|
+
...K,
|
|
3914
4003
|
fontFamily: t.family
|
|
3915
4004
|
});
|
|
3916
4005
|
}
|
|
3917
|
-
a = a.slice(t), a.length > 0 &&
|
|
4006
|
+
a = a.slice(t), a.length > 0 && F();
|
|
3918
4007
|
}
|
|
3919
4008
|
continue;
|
|
3920
4009
|
}
|
|
3921
|
-
if (
|
|
3922
|
-
let t =
|
|
4010
|
+
if (B(i)) {
|
|
4011
|
+
let t = y(i, {
|
|
3923
4012
|
cjk: !0,
|
|
3924
|
-
kinsoku:
|
|
3925
|
-
}),
|
|
3926
|
-
let n =
|
|
3927
|
-
r !== "" && (e.font = i ?
|
|
4013
|
+
kinsoku: h
|
|
4014
|
+
}), r = m != null && j !== E, a = (e) => r && de(e.codePointAt(0) ?? 0), o = (t) => {
|
|
4015
|
+
let n = G * Jn(t), r = "", i = null, o = () => {
|
|
4016
|
+
r !== "" && (e.font = i ? j : E, n += e.measureText(r).width, r = "");
|
|
3928
4017
|
};
|
|
3929
4018
|
for (let e of t) {
|
|
3930
4019
|
let t = a(e);
|
|
@@ -3934,9 +4023,9 @@ function Bn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3934
4023
|
}, c = (e) => {
|
|
3935
4024
|
let t = "", r = null, i = () => {
|
|
3936
4025
|
if (t === "") return;
|
|
3937
|
-
let e = r ?
|
|
3938
|
-
|
|
3939
|
-
...
|
|
4026
|
+
let e = r ? j : E, i = r ? m : p;
|
|
4027
|
+
I(t, e, s, C, H, n.strikethrough, n.baseline ?? void 0, {
|
|
4028
|
+
...K,
|
|
3940
4029
|
fontFamily: i
|
|
3941
4030
|
}), t = "";
|
|
3942
4031
|
};
|
|
@@ -3945,63 +4034,63 @@ function Bn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3945
4034
|
r === null || e === r ? (t += n, r = e) : (i(), t = n, r = e);
|
|
3946
4035
|
}
|
|
3947
4036
|
i();
|
|
3948
|
-
}, l =
|
|
4037
|
+
}, l = pe(i), u = i.length, d = 0;
|
|
3949
4038
|
for (; d < u;) {
|
|
3950
|
-
let e =
|
|
4039
|
+
let e = P(), n = R(i, t, d, e, o, l);
|
|
3951
4040
|
if (n <= d) {
|
|
3952
|
-
if (
|
|
3953
|
-
|
|
4041
|
+
if (x > 0) {
|
|
4042
|
+
F();
|
|
3954
4043
|
continue;
|
|
3955
4044
|
}
|
|
3956
|
-
let
|
|
4045
|
+
let r = t.find((e) => e > d) ?? u, a = i.slice(d, r), s = D(a), c = R(a, s, 0, e, o, l);
|
|
3957
4046
|
c <= 0 && (c = s.length > 0 ? s[0] : a.length), n = d + c;
|
|
3958
4047
|
}
|
|
3959
|
-
c(
|
|
4048
|
+
c(i.slice(d, n)), d = n, d < u && F();
|
|
3960
4049
|
}
|
|
3961
4050
|
continue;
|
|
3962
4051
|
}
|
|
3963
|
-
if (
|
|
3964
|
-
else if (o)
|
|
3965
|
-
else if (a >
|
|
3966
|
-
|
|
3967
|
-
for (let t of
|
|
3968
|
-
e.font =
|
|
4052
|
+
if (N(a)) I(i, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K), o && (S = !0);
|
|
4053
|
+
else if (o) x > 0 && F();
|
|
4054
|
+
else if (a > v()) {
|
|
4055
|
+
x > 0 && F();
|
|
4056
|
+
for (let t of i) {
|
|
4057
|
+
e.font = E;
|
|
3969
4058
|
let r = e.measureText(t).width;
|
|
3970
|
-
!
|
|
4059
|
+
!N(r) && x > 0 && F(), I(t, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
|
|
3971
4060
|
}
|
|
3972
|
-
} else if (!
|
|
4061
|
+
} else if (!S) I(i, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
|
|
3973
4062
|
else {
|
|
3974
|
-
let e =
|
|
3975
|
-
(c || l) &&
|
|
4063
|
+
let e = b.segments.at(-1)?.text ?? "", t = i.codePointAt(0), a = [...e].at(-1)?.codePointAt(0), o = /\S$/u.test(e) && /^\S/u.test(i) && a !== 8203 && t !== 8203, c = t !== void 0 && h.lineStartForbidden.has(t) && o, l = a !== void 0 && t !== void 0 && o && !B(e) && !B(i) && r(a, t);
|
|
4064
|
+
(c || l) && L() || F(), I(i, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
|
|
3976
4065
|
}
|
|
3977
4066
|
}
|
|
3978
4067
|
}
|
|
3979
|
-
return m.push(
|
|
4068
|
+
return m.push(b), m;
|
|
3980
4069
|
}
|
|
3981
|
-
async function
|
|
4070
|
+
async function Xn(e, t, n, r, i, a, o) {
|
|
3982
4071
|
if (t && t.fillType === "image") {
|
|
3983
4072
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
|
|
3984
4073
|
try {
|
|
3985
|
-
let s = await
|
|
3986
|
-
widthPt: n / i /
|
|
3987
|
-
heightPt: r / i /
|
|
4074
|
+
let s = await Te(t.imagePath, t.mimeType, t.duotone, o, {
|
|
4075
|
+
widthPt: n / i / U,
|
|
4076
|
+
heightPt: r / i / U
|
|
3988
4077
|
});
|
|
3989
4078
|
if (a() || !s) return;
|
|
3990
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
4079
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) $n(e, s, t.tile, n, r, i);
|
|
3991
4080
|
else {
|
|
3992
4081
|
let i = t.fillRect ?? {}, a = i.l ?? 0, o = i.t ?? 0, c = i.r ?? 0, l = i.b ?? 0, u = a * n, d = o * r, f = n * (1 - a - c), p = r * (1 - o - l);
|
|
3993
4082
|
e.drawImage(s, u, d, f, p);
|
|
3994
4083
|
}
|
|
3995
4084
|
e.restore();
|
|
3996
4085
|
} catch (e) {
|
|
3997
|
-
if (
|
|
4086
|
+
if (d(e)) throw e;
|
|
3998
4087
|
}
|
|
3999
4088
|
return;
|
|
4000
4089
|
}
|
|
4001
|
-
e.fillStyle =
|
|
4090
|
+
e.fillStyle = Tn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
4002
4091
|
}
|
|
4003
|
-
var
|
|
4004
|
-
function
|
|
4092
|
+
var Zn = 9525;
|
|
4093
|
+
function Qn(e, t, n, r, i) {
|
|
4005
4094
|
let a;
|
|
4006
4095
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4007
4096
|
let o;
|
|
@@ -4010,134 +4099,134 @@ function Un(e, t, n, r, i) {
|
|
|
4010
4099
|
ay: o
|
|
4011
4100
|
};
|
|
4012
4101
|
}
|
|
4013
|
-
function
|
|
4014
|
-
let
|
|
4015
|
-
if (!(
|
|
4016
|
-
let
|
|
4102
|
+
function $n(e, t, n, r, i, a) {
|
|
4103
|
+
let o = t.width * Zn * n.sx * a, s = t.height * Zn * n.sy * a;
|
|
4104
|
+
if (!(o > 0) || !(s > 0)) return;
|
|
4105
|
+
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = F(o * (c ? 2 : 1), s * (l ? 2 : 1));
|
|
4106
|
+
if (!u) return;
|
|
4107
|
+
let d = u.getContext("2d");
|
|
4017
4108
|
if (!d) return;
|
|
4018
|
-
let f =
|
|
4019
|
-
|
|
4020
|
-
let p = (e, t, r, i) => {
|
|
4021
|
-
f.save(), f.translate(e + (r ? s : 0), t + (i ? c : 0)), f.scale(r ? -1 : 1, i ? -1 : 1), f.drawImage(n, 0, 0, s, c), f.restore();
|
|
4109
|
+
let f = (e, n, r, i) => {
|
|
4110
|
+
d.save(), d.translate(e + (r ? o : 0), n + (i ? s : 0)), d.scale(r ? -1 : 1, i ? -1 : 1), d.drawImage(t, 0, 0, o, s), d.restore();
|
|
4022
4111
|
};
|
|
4023
|
-
|
|
4024
|
-
let
|
|
4025
|
-
if (!
|
|
4026
|
-
let { ax:
|
|
4027
|
-
typeof
|
|
4112
|
+
f(0, 0, !1, !1), c && f(o, 0, !0, !1), l && f(0, s, !1, !0), c && l && f(o, s, !0, !0);
|
|
4113
|
+
let p = e.createPattern(u, "repeat");
|
|
4114
|
+
if (!p) return;
|
|
4115
|
+
let { ax: m, ay: h } = Qn(n.algn ?? "tl", r, i, o, s), g = m + X(n.tx, a), _ = h + X(n.ty, a);
|
|
4116
|
+
typeof p.setTransform == "function" && typeof DOMMatrix < "u" ? (p.setTransform(new DOMMatrix().translateSelf(g, _)), e.fillStyle = p, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(g, _), e.fillStyle = p, e.fillRect(-g, -_, r, i), e.restore());
|
|
4028
4117
|
}
|
|
4029
|
-
function
|
|
4118
|
+
function er(e, t, n) {
|
|
4030
4119
|
if (!t) return;
|
|
4031
|
-
let r = t.dir * Math.PI / 180, i =
|
|
4032
|
-
e.shadowColor =
|
|
4120
|
+
let r = t.dir * Math.PI / 180, i = X(t.dist, n);
|
|
4121
|
+
e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4033
4122
|
}
|
|
4034
|
-
function
|
|
4035
|
-
t && (e.shadowColor =
|
|
4123
|
+
function tr(e, t, n) {
|
|
4124
|
+
t && (e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4036
4125
|
}
|
|
4037
|
-
function
|
|
4126
|
+
function nr(e) {
|
|
4038
4127
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4039
4128
|
}
|
|
4040
|
-
var
|
|
4041
|
-
function
|
|
4042
|
-
if (
|
|
4043
|
-
let
|
|
4044
|
-
for (;
|
|
4045
|
-
let e = Math.min(
|
|
4046
|
-
if (n >=
|
|
4047
|
-
|
|
4129
|
+
var rr = 8, ir = 1, ar = 1, or = 256;
|
|
4130
|
+
function sr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
4131
|
+
if (r <= 0) return;
|
|
4132
|
+
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(or, Math.max(1, Math.round(b / rr))), S = (e) => ur(e, a, r, o, s, c, u, d), C = S(x), w = fr(C, a, o, s, c, u, d, l, i, -g, _);
|
|
4133
|
+
for (; w > ar && x < or;) {
|
|
4134
|
+
let e = Math.min(or, x * 2), t = S(e), n = fr(t, a, o, s, c, u, d, l, i, -g, _);
|
|
4135
|
+
if (n >= w * .75) {
|
|
4136
|
+
C = t;
|
|
4048
4137
|
break;
|
|
4049
4138
|
}
|
|
4050
|
-
|
|
4139
|
+
x = e, C = t, w = n;
|
|
4051
4140
|
}
|
|
4052
|
-
let
|
|
4053
|
-
e.fillStyle =
|
|
4054
|
-
for (let
|
|
4055
|
-
let { s0: i, s1: a, g: o } =
|
|
4056
|
-
e.save(), e.translate(
|
|
4057
|
-
let c =
|
|
4058
|
-
e.rect(c, -
|
|
4141
|
+
let T = 1e4, E = ir / (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) => {
|
|
4142
|
+
e.fillStyle = r;
|
|
4143
|
+
for (let r = 0; r <= D; r++) {
|
|
4144
|
+
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
4145
|
+
e.save(), e.translate(f + o.x, p + o.y), e.rotate(o.angle), o.shear !== 0 && e.transform(1, 0, o.shear, 1, 0, 0), (l !== 1 || o.vScale !== 1) && e.scale(l, o.vScale), e.beginPath();
|
|
4146
|
+
let c = O(r, i, s), u = k(r, a, s);
|
|
4147
|
+
e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4059
4148
|
}
|
|
4060
|
-
},
|
|
4061
|
-
if (
|
|
4062
|
-
|
|
4149
|
+
}, j = cr(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4150
|
+
if (j >= 1 && M >= 1) {
|
|
4151
|
+
A(e, m);
|
|
4063
4152
|
return;
|
|
4064
4153
|
}
|
|
4065
|
-
if (
|
|
4066
|
-
let
|
|
4067
|
-
if (!
|
|
4068
|
-
|
|
4154
|
+
if (j <= 0 || M <= 0) return;
|
|
4155
|
+
let N = typeof e.getTransform == "function" ? e.getTransform() : null;
|
|
4156
|
+
if (!N) {
|
|
4157
|
+
A(e, m);
|
|
4069
4158
|
return;
|
|
4070
4159
|
}
|
|
4071
|
-
let
|
|
4072
|
-
for (let e = 0; e <=
|
|
4073
|
-
let { s0: t, s1:
|
|
4160
|
+
let P = Infinity, I = Infinity, L = -Infinity, R = -Infinity;
|
|
4161
|
+
for (let e = 0; e <= D; e++) {
|
|
4162
|
+
let { s0: t, s1: r, g: i } = C[e], a = (t + r) / 2, o = -a + n / 2, s = Math.max(O(e, t, a), o - v), c = Math.min(k(e, r, a), o + y);
|
|
4074
4163
|
if (!(c <= s)) for (let [e, t] of [
|
|
4075
|
-
[s, -
|
|
4076
|
-
[c, -
|
|
4077
|
-
[s,
|
|
4078
|
-
[c,
|
|
4164
|
+
[s, -g],
|
|
4165
|
+
[c, -g],
|
|
4166
|
+
[s, _],
|
|
4167
|
+
[c, _]
|
|
4079
4168
|
]) {
|
|
4080
|
-
let n =
|
|
4081
|
-
o <
|
|
4169
|
+
let n = dr(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;
|
|
4170
|
+
o < P && (P = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
|
|
4082
4171
|
}
|
|
4083
4172
|
}
|
|
4084
|
-
if (!(L >
|
|
4085
|
-
let z = Math.floor(
|
|
4173
|
+
if (!(L > P && R > I)) return;
|
|
4174
|
+
let z = Math.floor(P - 2), B = Math.floor(I - 2), V = F(Math.ceil(L + 2) - z, Math.ceil(R + 2) - B), H = V ? V.getContext("2d") : null;
|
|
4086
4175
|
if (!V || !H) {
|
|
4087
|
-
|
|
4176
|
+
A(e, m);
|
|
4088
4177
|
return;
|
|
4089
4178
|
}
|
|
4090
|
-
H.font =
|
|
4179
|
+
H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(N.a, N.b, N.c, N.d, N.e - z, N.f - B), A(H, lr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(V, z, B), e.restore();
|
|
4091
4180
|
}
|
|
4092
|
-
function
|
|
4181
|
+
function cr(e) {
|
|
4093
4182
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4094
4183
|
if (!t) return 1;
|
|
4095
4184
|
let n = parseFloat(t[1]);
|
|
4096
4185
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4097
4186
|
}
|
|
4098
|
-
function
|
|
4187
|
+
function lr(e) {
|
|
4099
4188
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4100
4189
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4101
4190
|
}
|
|
4102
|
-
function
|
|
4191
|
+
function ur(e, t, n, r, i, a, o, s) {
|
|
4103
4192
|
let c = Array(e);
|
|
4104
4193
|
for (let l = 0; l < e; l++) {
|
|
4105
4194
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4106
4195
|
c[l] = {
|
|
4107
4196
|
s0: u,
|
|
4108
4197
|
s1: d,
|
|
4109
|
-
g:
|
|
4198
|
+
g: Ve(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4110
4199
|
};
|
|
4111
4200
|
}
|
|
4112
4201
|
return c;
|
|
4113
4202
|
}
|
|
4114
|
-
function
|
|
4203
|
+
function dr(e, t, n, r) {
|
|
4115
4204
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4116
4205
|
return {
|
|
4117
4206
|
x: e.x + s * o - c * a,
|
|
4118
4207
|
y: e.y + c * o + s * a
|
|
4119
4208
|
};
|
|
4120
4209
|
}
|
|
4121
|
-
function
|
|
4210
|
+
function fr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4122
4211
|
let d = 0;
|
|
4123
4212
|
for (let f of e) {
|
|
4124
4213
|
let e = (f.s0 + f.s1) / 2;
|
|
4125
4214
|
for (let p of [f.s0, f.s1]) {
|
|
4126
|
-
let m =
|
|
4215
|
+
let m = Ve(t, (n + p) / r * i, a, o);
|
|
4127
4216
|
for (let t of [l, u]) {
|
|
4128
|
-
let n =
|
|
4217
|
+
let n = dr(m, s, 0, t), r = dr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4129
4218
|
i > d && (d = i);
|
|
4130
4219
|
}
|
|
4131
4220
|
}
|
|
4132
4221
|
}
|
|
4133
4222
|
return d;
|
|
4134
4223
|
}
|
|
4135
|
-
function
|
|
4136
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4224
|
+
function pr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4225
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = Le(n, r, p, m);
|
|
4137
4226
|
if (!h) return;
|
|
4138
|
-
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) *
|
|
4227
|
+
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * U * c, y = [];
|
|
4139
4228
|
for (let n of t.paragraphs) {
|
|
4140
|
-
let t =
|
|
4229
|
+
let t = Yn(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * U * c, n.defColor ? Z(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4141
4230
|
for (let e of t) y.push(e);
|
|
4142
4231
|
}
|
|
4143
4232
|
if (y.length === 0) return;
|
|
@@ -4156,10 +4245,10 @@ function ir(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4156
4245
|
}
|
|
4157
4246
|
e.font = t.font;
|
|
4158
4247
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4159
|
-
a += r.width + n *
|
|
4248
|
+
a += r.width + n * Jn(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));
|
|
4160
4249
|
}
|
|
4161
4250
|
if (a <= 0) continue;
|
|
4162
|
-
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 =
|
|
4251
|
+
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 = Be(h, a), b = 0;
|
|
4163
4252
|
for (let t of n.segments) {
|
|
4164
4253
|
if (t.math) {
|
|
4165
4254
|
b += t.math.width;
|
|
@@ -4170,17 +4259,17 @@ function ir(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4170
4259
|
for (let s of o) {
|
|
4171
4260
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4172
4261
|
if (!h.singleEdge && o > 0) {
|
|
4173
|
-
|
|
4262
|
+
sr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4174
4263
|
continue;
|
|
4175
4264
|
}
|
|
4176
|
-
let l =
|
|
4265
|
+
let l = Ve(h, (b + o / 2) / a * v, _, c);
|
|
4177
4266
|
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;
|
|
4178
4267
|
}
|
|
4179
4268
|
}
|
|
4180
4269
|
}
|
|
4181
4270
|
e.restore();
|
|
4182
4271
|
}
|
|
4183
|
-
function
|
|
4272
|
+
function mr(e, t, n, r, i, a, o) {
|
|
4184
4273
|
let s = Math.min(r, i);
|
|
4185
4274
|
switch (e) {
|
|
4186
4275
|
case "rightarrow":
|
|
@@ -4210,35 +4299,140 @@ function ar(e, t, n, r, i, a, o) {
|
|
|
4210
4299
|
default: return null;
|
|
4211
4300
|
}
|
|
4212
4301
|
}
|
|
4213
|
-
function
|
|
4214
|
-
return e.defaultTextColor ?
|
|
4302
|
+
function hr(e, t) {
|
|
4303
|
+
return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null && gn(e) ? t.smartArtFallbackTextColor : null;
|
|
4215
4304
|
}
|
|
4216
|
-
function
|
|
4305
|
+
function gr(e, t, n) {
|
|
4217
4306
|
return {
|
|
4218
4307
|
outerRotation: e,
|
|
4219
4308
|
localFlipH: t,
|
|
4220
4309
|
localFlipV: n
|
|
4221
4310
|
};
|
|
4222
4311
|
}
|
|
4223
|
-
function
|
|
4312
|
+
function _r(e, t, n, r, i) {
|
|
4313
|
+
let a = [
|
|
4314
|
+
{
|
|
4315
|
+
x: t,
|
|
4316
|
+
y: n
|
|
4317
|
+
},
|
|
4318
|
+
{
|
|
4319
|
+
x: t + r,
|
|
4320
|
+
y: n
|
|
4321
|
+
},
|
|
4322
|
+
{
|
|
4323
|
+
x: t,
|
|
4324
|
+
y: n + i
|
|
4325
|
+
},
|
|
4326
|
+
{
|
|
4327
|
+
x: t + r,
|
|
4328
|
+
y: n + i
|
|
4329
|
+
}
|
|
4330
|
+
].map((t) => ({
|
|
4331
|
+
x: e.a * t.x + e.c * t.y + e.e,
|
|
4332
|
+
y: e.b * t.x + e.d * t.y + e.f
|
|
4333
|
+
})), o = Math.min(...a.map((e) => e.x)), s = Math.min(...a.map((e) => e.y)), c = Math.max(...a.map((e) => e.x)), l = Math.max(...a.map((e) => e.y));
|
|
4334
|
+
return {
|
|
4335
|
+
x: o,
|
|
4336
|
+
y: s,
|
|
4337
|
+
w: c - o,
|
|
4338
|
+
h: l - s
|
|
4339
|
+
};
|
|
4340
|
+
}
|
|
4341
|
+
var vr = {
|
|
4342
|
+
tl: [0, 0],
|
|
4343
|
+
t: [.5, 0],
|
|
4344
|
+
tr: [1, 0],
|
|
4345
|
+
l: [0, .5],
|
|
4346
|
+
ctr: [.5, .5],
|
|
4347
|
+
r: [1, .5],
|
|
4348
|
+
bl: [0, 1],
|
|
4349
|
+
b: [.5, 1],
|
|
4350
|
+
br: [1, 1]
|
|
4351
|
+
};
|
|
4352
|
+
function yr(e, t, n) {
|
|
4353
|
+
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4354
|
+
}
|
|
4355
|
+
function br(e, t, n, r, i, a) {
|
|
4356
|
+
let [o, s] = vr[a ?? "b"];
|
|
4357
|
+
return yr(e, t + o * r, n + s * i);
|
|
4358
|
+
}
|
|
4359
|
+
function xr(e, t, n, r, i, a, o, s) {
|
|
4360
|
+
let c = ot(e, i, a).corners, l = (o > 0 ? _t(c, o / i, o / a) ?? c : c).map((e) => yr(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, _] = vr[s ?? "b"], v = vt(c, g, _);
|
|
4361
|
+
return {
|
|
4362
|
+
bbox: {
|
|
4363
|
+
x: f,
|
|
4364
|
+
y: p,
|
|
4365
|
+
w: m - f,
|
|
4366
|
+
h: h - p
|
|
4367
|
+
},
|
|
4368
|
+
anchor: v ? yr(t, n + v.x, r + v.y) : br(t, n, r, i, a, s)
|
|
4369
|
+
};
|
|
4370
|
+
}
|
|
4371
|
+
function Sr(e, t, n, r) {
|
|
4372
|
+
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);
|
|
4373
|
+
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || re(o, s).clamped) return e;
|
|
4374
|
+
let c = null;
|
|
4375
|
+
try {
|
|
4376
|
+
c = F(o, s);
|
|
4377
|
+
} catch {
|
|
4378
|
+
return e;
|
|
4379
|
+
}
|
|
4380
|
+
let l = c?.getContext("2d");
|
|
4381
|
+
if (!c || !l) return e;
|
|
4382
|
+
l.setTransform(t.a, t.b, t.c, t.d, t.e - i, t.f - a), e(l);
|
|
4383
|
+
let u = {
|
|
4384
|
+
a: 1,
|
|
4385
|
+
b: 0,
|
|
4386
|
+
c: 0,
|
|
4387
|
+
d: 1,
|
|
4388
|
+
e: 0,
|
|
4389
|
+
f: 0
|
|
4390
|
+
};
|
|
4391
|
+
return (e) => {
|
|
4392
|
+
e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
|
|
4393
|
+
};
|
|
4394
|
+
}
|
|
4395
|
+
function Cr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4396
|
+
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4397
|
+
a: 1,
|
|
4398
|
+
b: 0,
|
|
4399
|
+
c: 0,
|
|
4400
|
+
d: 1,
|
|
4401
|
+
e: 0,
|
|
4402
|
+
f: 0
|
|
4403
|
+
}, h = (e) => e.setTransform(c), g = (e) => {
|
|
4404
|
+
h(e), n(e);
|
|
4405
|
+
}, _ = (e) => {
|
|
4406
|
+
h(e), r(e);
|
|
4407
|
+
}, v = (e) => {
|
|
4408
|
+
h(e), u(e);
|
|
4409
|
+
}, y = !1;
|
|
4410
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !Ke(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), Ye(e, g, i, t.reflection, s, d, f), e.restore()), y ? er(e, t.shadow ?? null, o) : t.glow && tr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Je(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && nr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), qe(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4411
|
+
}
|
|
4412
|
+
function wr(e, t, r, i = "#000000", a, o = {
|
|
4224
4413
|
themeMajorFont: null,
|
|
4225
4414
|
themeMinorFont: null,
|
|
4226
4415
|
dpr: 1
|
|
4227
|
-
}, s,
|
|
4228
|
-
let u =
|
|
4416
|
+
}, s, l) {
|
|
4417
|
+
let u = X(t.x, r), d = X(t.y, r), f = X(t.width, r), p = X(t.height, r), m = s && t.id !== void 0 ? (e) => s({
|
|
4229
4418
|
...e,
|
|
4230
4419
|
shapeId: t.id
|
|
4231
4420
|
}) : s;
|
|
4232
4421
|
if (p === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4233
|
-
if (t.stroke && (e.save(),
|
|
4234
|
-
|
|
4235
|
-
|
|
4422
|
+
if (t.stroke && (e.save(), Vr(e, t.stroke, r, {
|
|
4423
|
+
x: u,
|
|
4424
|
+
y: d,
|
|
4425
|
+
w: f,
|
|
4426
|
+
h: 1
|
|
4427
|
+
}, t.rotation), e.beginPath(), e.moveTo(u, d), e.lineTo(u + f, d), e.stroke(), e.restore()), t.textBody) {
|
|
4428
|
+
let n = hr(t, o);
|
|
4429
|
+
Ar(e, t.textBody, u, d, f, p, r, n, t.rotation, t.flipH, t.flipV, i, a, o, m, !1, l);
|
|
4236
4430
|
}
|
|
4237
4431
|
return;
|
|
4238
4432
|
}
|
|
4239
|
-
let h = t.scene3d &&
|
|
4433
|
+
let h = t.scene3d && st(t.scene3d.camera) ? t.scene3d : null;
|
|
4240
4434
|
if (h && f > 0 && p > 0) {
|
|
4241
|
-
let
|
|
4435
|
+
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, l = jr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Mr(t.sp3d, h.camera, f, p, r, c), g = gr(t.rotation, t.flipH, t.flipV);
|
|
4242
4436
|
e.save(), g.outerRotation !== 0 && (e.translate(u + f / 2, d + p / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(u + f / 2), -(d + p / 2)));
|
|
4243
4437
|
let _ = {
|
|
4244
4438
|
...t,
|
|
@@ -4247,23 +4441,47 @@ function cr(e, t, n, i = "#000000", a, o = {
|
|
|
4247
4441
|
rotation: 0,
|
|
4248
4442
|
flipH: g.localFlipH,
|
|
4249
4443
|
flipV: g.localFlipV,
|
|
4250
|
-
scene3d: void 0
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4444
|
+
scene3d: void 0,
|
|
4445
|
+
sp3d: void 0,
|
|
4446
|
+
shadow: null,
|
|
4447
|
+
innerShadow: void 0,
|
|
4448
|
+
glow: void 0,
|
|
4449
|
+
softEdge: void 0,
|
|
4450
|
+
reflection: void 0
|
|
4451
|
+
}, v = {
|
|
4452
|
+
..._,
|
|
4453
|
+
textBody: null
|
|
4454
|
+
}, y = {
|
|
4455
|
+
..._,
|
|
4456
|
+
fill: null,
|
|
4457
|
+
stroke: null
|
|
4458
|
+
}, 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) => Nr(e, h.camera, u, d, f, p, (e) => {
|
|
4459
|
+
wr(e, t, r, i, a, o, void 0);
|
|
4460
|
+
}, n ? {
|
|
4255
4461
|
bevels: l,
|
|
4256
4462
|
extrusion: m ?? void 0,
|
|
4257
|
-
edgePadCss:
|
|
4258
|
-
}))
|
|
4463
|
+
edgePadCss: b
|
|
4464
|
+
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4465
|
+
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4466
|
+
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = xr(h.camera, n, u, d, f, p, b, t.shadow?.algn), s = !1, c = Sr((e) => {
|
|
4467
|
+
s = S(e) || s;
|
|
4468
|
+
}, n, o.bbox, {
|
|
4469
|
+
w: e.canvas.width || 0,
|
|
4470
|
+
h: e.canvas.height || 0
|
|
4471
|
+
});
|
|
4472
|
+
if (Cr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
|
|
4473
|
+
C(e), e.restore();
|
|
4474
|
+
return;
|
|
4475
|
+
}
|
|
4476
|
+
} else if (x(e, _, !0)) {
|
|
4259
4477
|
e.restore();
|
|
4260
4478
|
return;
|
|
4261
4479
|
}
|
|
4262
4480
|
e.restore();
|
|
4263
4481
|
}
|
|
4264
4482
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(u + f / 2, d + p / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(u + f / 2), -(d + p / 2)));
|
|
4265
|
-
let g = t.geometry.toLowerCase(), _ =
|
|
4266
|
-
|
|
4483
|
+
let g = t.geometry.toLowerCase(), _ = Tn(t.fill, e, u, d, f, p, t.rotation);
|
|
4484
|
+
t.shadow || tr(e, t.glow ?? null, r);
|
|
4267
4485
|
let v = new Set([
|
|
4268
4486
|
"line",
|
|
4269
4487
|
"straightconnector1",
|
|
@@ -4288,12 +4506,22 @@ function cr(e, t, n, i = "#000000", a, o = {
|
|
|
4288
4506
|
"accentbordercallout1",
|
|
4289
4507
|
"accentbordercallout2",
|
|
4290
4508
|
"accentbordercallout3"
|
|
4291
|
-
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom &&
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4509
|
+
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && c(g), w = (n, i, a = {
|
|
4510
|
+
x: u,
|
|
4511
|
+
y: d,
|
|
4512
|
+
w: f,
|
|
4513
|
+
h: p
|
|
4514
|
+
}) => {
|
|
4515
|
+
let { x: o, y: s, w: c, h: l } = a, m = i ?? (n === e && o === u && s === d && c === f && l === p ? _ : Tn(t.fill, n, o, s, c, l, t.rotation)), h = i ? null : t.stroke ? () => {
|
|
4516
|
+
Vr(n, t.stroke, r, {
|
|
4517
|
+
x: o,
|
|
4518
|
+
y: s,
|
|
4519
|
+
w: c,
|
|
4520
|
+
h: l
|
|
4521
|
+
}, t.rotation), n.stroke();
|
|
4522
|
+
} : null, v = () => nr(n);
|
|
4523
|
+
if (x && !i) {
|
|
4524
|
+
S(n, g, o, s, c, l, [
|
|
4297
4525
|
t.adj,
|
|
4298
4526
|
t.adj2,
|
|
4299
4527
|
t.adj3,
|
|
@@ -4302,84 +4530,106 @@ function cr(e, t, n, i = "#000000", a, o = {
|
|
|
4302
4530
|
t.adj6,
|
|
4303
4531
|
t.adj7,
|
|
4304
4532
|
t.adj8
|
|
4305
|
-
],
|
|
4533
|
+
], m, h, v, b(g) ? { skipTrailingStroke: !0 } : void 0);
|
|
4306
4534
|
return;
|
|
4307
4535
|
}
|
|
4308
|
-
|
|
4309
|
-
},
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
}
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4536
|
+
n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Tr(n, t.custGeom, o, s, c, l) : be(n, g, o, s, c, l, t.adj, t.adj2, t.adj3, t.adj4), m && g !== "arc" && (n.fillStyle = m, g === "donut" || g === "smileyface" || g === "frame" ? n.fill("evenodd") : n.fill(), i || v()), h && h();
|
|
4537
|
+
}, T = e.getTransform(), E = Math.abs(T.a * T.d - T.b * T.c), D = E > 0 ? Math.sqrt(E) : 1, O = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? C(g, u, d, f, p, [
|
|
4538
|
+
t.adj,
|
|
4539
|
+
t.adj2,
|
|
4540
|
+
t.adj3,
|
|
4541
|
+
t.adj4,
|
|
4542
|
+
t.adj5,
|
|
4543
|
+
t.adj6,
|
|
4544
|
+
t.adj7,
|
|
4545
|
+
t.adj8
|
|
4546
|
+
]) : t.custGeom && t.custGeom.length > 0 ? ve(t.custGeom, u, d, f, p) : null : null) ?? {
|
|
4547
|
+
x: u,
|
|
4548
|
+
y: d,
|
|
4549
|
+
w: f,
|
|
4550
|
+
h: p
|
|
4551
|
+
}, k = t.stroke ? t.stroke.width * r / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ? xe(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? xe(t.stroke.tailEnd, t.stroke, r) : 0) : 0, j = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, M = Math.max(k, A, j), N = M > 0 ? {
|
|
4552
|
+
x: O.x - M,
|
|
4553
|
+
y: O.y - M,
|
|
4554
|
+
w: O.w + M * 2,
|
|
4555
|
+
h: O.h + M * 2
|
|
4556
|
+
} : O, P = _r(T, N.x, N.y, N.w, N.h), F = r * D, I = h ? [] : jr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, D), L = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, R = (e) => {
|
|
4557
|
+
let i = t.stroke?.fill ? Tn(t.stroke.fill, e, u, d, f, p, t.rotation) ?? void 0 : void 0;
|
|
4558
|
+
if (t.stroke && (v.has(g) || y.has(g))) {
|
|
4559
|
+
let a = n(g, u, d, f, p, [
|
|
4560
|
+
t.adj,
|
|
4561
|
+
t.adj2,
|
|
4562
|
+
t.adj3,
|
|
4563
|
+
t.adj4,
|
|
4564
|
+
t.adj5,
|
|
4565
|
+
t.adj6,
|
|
4566
|
+
t.adj7,
|
|
4567
|
+
t.adj8
|
|
4568
|
+
]);
|
|
4569
|
+
if (!a) return;
|
|
4570
|
+
let o = t.stroke.cmpd, s = g === "line" || g === "straightconnector1";
|
|
4571
|
+
if (b(g) && a.vertices.length >= 2 && !(o && s)) {
|
|
4572
|
+
let n = a.vertices.map((e) => ({
|
|
4340
4573
|
x: e.x,
|
|
4341
4574
|
y: e.y
|
|
4342
4575
|
}));
|
|
4343
4576
|
if (t.stroke.tailEnd) {
|
|
4344
|
-
let e =
|
|
4345
|
-
|
|
4577
|
+
let e = _e(t.stroke.tailEnd, t.stroke, r);
|
|
4578
|
+
n[n.length - 1] = me(n[n.length - 1], n[n.length - 2], e);
|
|
4346
4579
|
}
|
|
4347
4580
|
if (t.stroke.headEnd) {
|
|
4348
|
-
let e =
|
|
4349
|
-
|
|
4581
|
+
let e = _e(t.stroke.headEnd, t.stroke, r);
|
|
4582
|
+
n[0] = me(n[0], n[1], e);
|
|
4350
4583
|
}
|
|
4351
|
-
|
|
4352
|
-
|
|
4584
|
+
Vr(e, t.stroke, r, {
|
|
4585
|
+
x: u,
|
|
4586
|
+
y: d,
|
|
4587
|
+
w: f,
|
|
4588
|
+
h: p
|
|
4589
|
+
}, t.rotation), e.beginPath(), e.moveTo(n[0].x, n[0].y);
|
|
4590
|
+
for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
|
|
4353
4591
|
e.stroke();
|
|
4354
4592
|
}
|
|
4355
|
-
|
|
4593
|
+
o && s && Br(e, a.start, a.end, t.stroke, o, r, t.rotation), t.stroke.tailEnd && ye(e, a.end.x, a.end.y, a.end.angle, t.stroke.tailEnd, t.stroke, r, i), t.stroke.headEnd && ye(e, a.start.x, a.start.y, a.start.angle, t.stroke.headEnd, t.stroke, r, i);
|
|
4594
|
+
return;
|
|
4356
4595
|
}
|
|
4357
|
-
|
|
4358
|
-
let { start:
|
|
4359
|
-
|
|
4360
|
-
}
|
|
4361
|
-
|
|
4362
|
-
|
|
4596
|
+
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;
|
|
4597
|
+
let { start: a, end: o } = Se(t.custGeom);
|
|
4598
|
+
a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ye(e, u + a.x * f, d + a.y * p, Math.atan2(a.dy * p, a.dx * f), t.stroke.headEnd, t.stroke, r, i), o && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ye(e, u + o.x * f, d + o.y * p, Math.atan2(o.dy * p, o.dx * f), t.stroke.tailEnd, t.stroke, r, i);
|
|
4599
|
+
}, z = (e) => {
|
|
4600
|
+
if (I.length > 0 && Pr(e, u, d, f, p, I, (e, t, n, r, i) => w(e, void 0, {
|
|
4601
|
+
x: t,
|
|
4602
|
+
y: n,
|
|
4603
|
+
w: r,
|
|
4604
|
+
h: i
|
|
4605
|
+
}), void 0, L)) {
|
|
4606
|
+
R(e), nr(e);
|
|
4607
|
+
return;
|
|
4608
|
+
}
|
|
4609
|
+
w(e), R(e);
|
|
4610
|
+
};
|
|
4611
|
+
if (Cr(e, t, z, z, P, br(T, u, d, f, p, t.shadow?.algn), r, F, T, !!_, (e) => w(e, "#000")), t.textBody) {
|
|
4612
|
+
let n = hr(t, o);
|
|
4363
4613
|
if (e.save(), t.flipH || t.flipV) {
|
|
4364
4614
|
let n = u + f / 2, r = d + p / 2;
|
|
4365
4615
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4366
4616
|
}
|
|
4367
|
-
let s = u,
|
|
4368
|
-
if (t.textRect) s =
|
|
4617
|
+
let s = u, c = d, h = f, _ = p;
|
|
4618
|
+
if (t.textRect) s = X(t.textRect.x, r), c = X(t.textRect.y, r), h = X(t.textRect.width, r), _ = X(t.textRect.height, r);
|
|
4369
4619
|
else if (g === "ellipse") {
|
|
4370
4620
|
let e = f * (1 - 1 / Math.SQRT2) / 2, t = p * (1 - 1 / Math.SQRT2) / 2;
|
|
4371
|
-
s = u + e,
|
|
4621
|
+
s = u + e, c = d + t, h = f / Math.SQRT2, _ = p / Math.SQRT2;
|
|
4372
4622
|
} else {
|
|
4373
|
-
let e =
|
|
4374
|
-
e && (s = e.tx,
|
|
4623
|
+
let e = mr(g, u, d, f, p, t.adj, t.adj2);
|
|
4624
|
+
e && (s = e.tx, c = e.ty, h = e.tw, _ = e.th);
|
|
4375
4625
|
}
|
|
4376
|
-
|
|
4626
|
+
Ar(e, t.textBody, s, c, h, _, r, n, t.rotation, !1, !1, i, a, o, m, !1, l), e.restore();
|
|
4377
4627
|
}
|
|
4378
4628
|
e.restore();
|
|
4379
4629
|
}
|
|
4380
|
-
var
|
|
4381
|
-
function
|
|
4382
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4630
|
+
var Tr = he;
|
|
4631
|
+
function Er(e, t) {
|
|
4632
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Dr(e).toLowerCase(), o = Dr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4383
4633
|
switch (t) {
|
|
4384
4634
|
case "arabicPlain": return n;
|
|
4385
4635
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4406,7 +4656,7 @@ function ur(e, t) {
|
|
|
4406
4656
|
default: return `${n}.`;
|
|
4407
4657
|
}
|
|
4408
4658
|
}
|
|
4409
|
-
function
|
|
4659
|
+
function Dr(e) {
|
|
4410
4660
|
let t = [
|
|
4411
4661
|
1e3,
|
|
4412
4662
|
900,
|
|
@@ -4439,28 +4689,28 @@ function dr(e) {
|
|
|
4439
4689
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4440
4690
|
return r;
|
|
4441
4691
|
}
|
|
4442
|
-
function
|
|
4692
|
+
function Or(e) {
|
|
4443
4693
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4444
4694
|
return !1;
|
|
4445
4695
|
}
|
|
4446
|
-
function
|
|
4447
|
-
let n =
|
|
4448
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4696
|
+
function kr(e, t) {
|
|
4697
|
+
let n = Or(e);
|
|
4698
|
+
if (e.bullet.type === "char") return t.clear(), n ? ge(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4449
4699
|
if (e.bullet.type === "autoNum") {
|
|
4450
4700
|
if (!n) return "";
|
|
4451
4701
|
let r = e.lvl;
|
|
4452
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4702
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Er(t.get(r), e.bullet.numType);
|
|
4453
4703
|
}
|
|
4454
4704
|
return t.clear(), "";
|
|
4455
4705
|
}
|
|
4456
|
-
function
|
|
4706
|
+
function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
|
|
4457
4707
|
themeMajorFont: null,
|
|
4458
4708
|
themeMinorFont: null,
|
|
4459
4709
|
dpr: 1
|
|
4460
|
-
},
|
|
4710
|
+
}, h, g = !1, _, v = !1) {
|
|
4461
4711
|
let y = t.vert === "vert" || t.vert === "eaVert", b = t.vert === "vert270";
|
|
4462
4712
|
if (y || b) {
|
|
4463
|
-
let l = n + i / 2, u = r + a / 2,
|
|
4713
|
+
let l = n + i / 2, u = r + a / 2, m = y ? 90 : -90, v = h ? (e) => h({
|
|
4464
4714
|
...e,
|
|
4465
4715
|
inShapeX: e.inShapeX - a / 2 + i / 2,
|
|
4466
4716
|
inShapeY: e.inShapeY - i / 2 + a / 2,
|
|
@@ -4469,47 +4719,52 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4469
4719
|
shapeW: i,
|
|
4470
4720
|
shapeH: a,
|
|
4471
4721
|
rotation: c,
|
|
4472
|
-
textBodyRotation:
|
|
4722
|
+
textBodyRotation: m
|
|
4473
4723
|
}) : void 0;
|
|
4474
|
-
if (
|
|
4475
|
-
e.save(), e.translate(l, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2),
|
|
4724
|
+
if (g) return i;
|
|
4725
|
+
e.save(), e.translate(l, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2), Ar(e, {
|
|
4476
4726
|
...t,
|
|
4477
4727
|
vert: "horz"
|
|
4478
4728
|
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, _, t.vert === "eaVert"), e.restore();
|
|
4479
4729
|
return;
|
|
4480
4730
|
}
|
|
4481
4731
|
let x = t.textWarp;
|
|
4482
|
-
if (!
|
|
4483
|
-
|
|
4732
|
+
if (!g && x && Me(x.preset)) {
|
|
4733
|
+
pr(e, t, x.preset, x.adj ?? [], n, r, i, a, o, s ?? d, p);
|
|
4484
4734
|
return;
|
|
4485
4735
|
}
|
|
4486
|
-
let S =
|
|
4487
|
-
let a = (t.defaultFontSize ?? 18) *
|
|
4736
|
+
let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), T = X(t.bIns, o), E = t.wrap !== "none", D = t.autoFit === "sp" ? E && Kn(e, t, i, S, C, o, p) : E, O = Math.max(1, t.numCol ?? 1), k = X(t.spcCol ?? 0, o), A = t.defaultBold ?? !1, j = t.defaultItalic ?? !1, M = s ?? d, N = (r) => {
|
|
4737
|
+
let a = (t.defaultFontSize ?? 18) * U * o * r, s = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4488
4738
|
for (let u = 0; u < t.paragraphs.length; u++) {
|
|
4489
|
-
let d = t.paragraphs[u], m =
|
|
4739
|
+
let d = t.paragraphs[u], m = X(d.marL, o), h = X(d.marR, o), g = X(d.indent, o), _ = d.defFontSize == null ? a : d.defFontSize * U * o * r, v = d.defColor ? Z(d.defColor) : M, y = Wn(d), b = (() => {
|
|
4490
4740
|
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4491
4741
|
return null;
|
|
4492
|
-
})(), x = b == null ? _ : b *
|
|
4742
|
+
})(), x = b == null ? _ : b * U * o * r, w = (() => {
|
|
4493
4743
|
for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
|
|
4494
4744
|
return null;
|
|
4495
|
-
})(), T = w ?
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4745
|
+
})(), T = w ? Z(w) : v, E = (() => {
|
|
4746
|
+
for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4747
|
+
return d.defFontFamily ?? null;
|
|
4748
|
+
})(), N = "", P = Q(!1, !1, x, "sans-serif", p), F = T, I = null;
|
|
4749
|
+
N = kr(d, l);
|
|
4750
|
+
let L = De(d.bullet);
|
|
4751
|
+
if (L.type === "char") {
|
|
4752
|
+
let e = L;
|
|
4753
|
+
P = Q(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * U * o * r, N === e.char ? Nn(e.fontFamily ?? null, p) : "sans-serif", p), F = e.color ? Z(e.color) : T;
|
|
4754
|
+
} else if (L.type === "autoNum") {
|
|
4755
|
+
let e = L;
|
|
4756
|
+
P = Q(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * U * o * r, Nn(e.fontFamily ?? E, p), p), F = L.color ? Z(L.color) : T;
|
|
4757
|
+
} else if (L.type === "blip") {
|
|
4758
|
+
let e = L, t = e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * U * o * r;
|
|
4759
|
+
I = {
|
|
4505
4760
|
imagePath: e.imagePath,
|
|
4506
4761
|
mimeType: e.mimeType,
|
|
4507
4762
|
sizePx: t
|
|
4508
4763
|
};
|
|
4509
4764
|
}
|
|
4510
|
-
let
|
|
4511
|
-
for (let n = 0; n <
|
|
4512
|
-
let r =
|
|
4765
|
+
let R = O > 1 ? (i - S - C - (O - 1) * k) / O : i - S - C, z = n + S + m, B = n + S + m + g, V = R - m - h, H = Yn(e, d, D ? V : Infinity, _, v, o, m, A, j, r, f, p, Gn(y, g)), W = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * U * o * r, G = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * U * o * r;
|
|
4766
|
+
for (let n = 0; n < H.length; n++) {
|
|
4767
|
+
let r = H[n], i = n === 0, a = n === H.length - 1, l = 0, f = 0;
|
|
4513
4768
|
for (let e of r.segments) {
|
|
4514
4769
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4515
4770
|
if (t > l && (l = t), !e.math) {
|
|
@@ -4517,28 +4772,28 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4517
4772
|
t > f && (f = t);
|
|
4518
4773
|
}
|
|
4519
4774
|
}
|
|
4520
|
-
if (l === 0 && (l = _), i &&
|
|
4521
|
-
e.font =
|
|
4775
|
+
if (l === 0 && (l = _), i && N) {
|
|
4776
|
+
e.font = P;
|
|
4522
4777
|
let t = e.measureText("M"), n = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
|
|
4523
4778
|
n > l && (l = n);
|
|
4524
4779
|
}
|
|
4525
|
-
i &&
|
|
4780
|
+
i && I && I.sizePx > l && (l = I.sizePx);
|
|
4526
4781
|
let p = l * 1.2, m = Math.max(p, f), h;
|
|
4527
|
-
h = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val *
|
|
4528
|
-
let v = h + (a ?
|
|
4782
|
+
h = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val * U * o : m, t.autoFit === "norm" && t.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - t.lnSpcReduction);
|
|
4783
|
+
let v = h + (a ? G : 0), b = i && u > 0 ? W : 0, x = i ? Gn(y, g) : 0, S = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), C = i && S ? I : null;
|
|
4529
4784
|
s.push({
|
|
4530
4785
|
line: r,
|
|
4531
4786
|
linePx: v,
|
|
4532
4787
|
lineHeight: h,
|
|
4533
4788
|
topGapPx: b,
|
|
4534
4789
|
textXOffset: x,
|
|
4535
|
-
bulletLabel: i ?
|
|
4536
|
-
bulletFont:
|
|
4537
|
-
bulletColor:
|
|
4538
|
-
bulletX:
|
|
4790
|
+
bulletLabel: i ? N : "",
|
|
4791
|
+
bulletFont: P,
|
|
4792
|
+
bulletColor: F,
|
|
4793
|
+
bulletX: B,
|
|
4539
4794
|
bulletImage: C,
|
|
4540
|
-
textX:
|
|
4541
|
-
textMaxW:
|
|
4795
|
+
textX: z,
|
|
4796
|
+
textMaxW: V,
|
|
4542
4797
|
alignment: d.alignment,
|
|
4543
4798
|
isLastLine: a,
|
|
4544
4799
|
para: d
|
|
@@ -4562,20 +4817,20 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4562
4817
|
({allLines: P, totalHeight: F} = N(t));
|
|
4563
4818
|
}
|
|
4564
4819
|
}
|
|
4565
|
-
if (
|
|
4820
|
+
if (g) return w + F + T;
|
|
4566
4821
|
let I = t.verticalAnchor ?? "t", L = r, R;
|
|
4567
4822
|
a === 0 && I === "b" ? (R = w + F + T, L = r - R) : R = t.autoFit === "sp" ? Math.max(a, w + F + T) : a;
|
|
4568
4823
|
let z, B = Math.max(0, R - w - T);
|
|
4569
4824
|
z = I === "ctr" ? L + w + (B - F) / 2 : I === "b" ? L + R - T - F : L + w, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4570
|
-
let V = z, H = O > 1 ? (i - S - C - (O - 1) * k) / O + k : 0,
|
|
4825
|
+
let V = z, H = O > 1 ? (i - S - C - (O - 1) * k) / O + k : 0, W = Math.max(0, R - w - T), G = P[P.length - 1], K = G ? Math.max(0, G.linePx - G.lineHeight) : 0, q = F - K, ee = a === 0 || q <= W + .5, ne = O > 1 && !ee ? Math.ceil(P.length / O) : P.length, re = 0, ie = 0;
|
|
4571
4826
|
for (let s of P) {
|
|
4572
|
-
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset:
|
|
4573
|
-
O > 1 &&
|
|
4574
|
-
let T = (t.rtlCol ? O - 1 -
|
|
4827
|
+
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = s;
|
|
4828
|
+
O > 1 && re < O - 1 && ie >= ne && (re++, ie = 0, z = V), z += f, ie++;
|
|
4829
|
+
let T = (t.rtlCol ? O - 1 - re : re) * H, E = s.textX + T, D = s.bulletX + T, k = s.textMaxW, A = s.para.rtl === !0, j = A || on(l.segments), M = l.segments.some((e) => e.isTab);
|
|
4575
4830
|
if (M) {
|
|
4576
|
-
let t =
|
|
4831
|
+
let t = X(s.para.marL, o), n = X(s.para.marR, o), r = A ? n : t + g, i = k + t + n;
|
|
4577
4832
|
e.font = l.segments.find((e) => e.isTab).font;
|
|
4578
|
-
let a = e.measureText(" ").width, c =
|
|
4833
|
+
let a = e.measureText(" ").width, c = vn(l.segments.map((t) => {
|
|
4579
4834
|
if (t.isTab) return {
|
|
4580
4835
|
isTab: !0,
|
|
4581
4836
|
width: 0
|
|
@@ -4588,12 +4843,12 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4588
4843
|
let n = t.letterSpacingPx ?? 0;
|
|
4589
4844
|
return {
|
|
4590
4845
|
isTab: !1,
|
|
4591
|
-
width: t.text ? e.measureText(t.text).width + n *
|
|
4846
|
+
width: t.text ? e.measureText(t.text).width + n * Jn(t.text) : 0
|
|
4592
4847
|
};
|
|
4593
4848
|
}), (s.para.tabStops ?? []).map((e) => ({
|
|
4594
|
-
pos:
|
|
4849
|
+
pos: X(e.pos, o),
|
|
4595
4850
|
algn: e.algn
|
|
4596
|
-
})), r, i, a,
|
|
4851
|
+
})), r, i, a, X(s.para.defTabSz ?? 914400, o));
|
|
4597
4852
|
for (let e = 0; e < l.segments.length; e++) l.segments[e].isTab && (l.segments[e].tabWidthPx = c[e]);
|
|
4598
4853
|
}
|
|
4599
4854
|
let N = 0, P = d * .8;
|
|
@@ -4608,12 +4863,12 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4608
4863
|
}
|
|
4609
4864
|
e.font = t.font;
|
|
4610
4865
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4611
|
-
N += t.text ? n.width + r *
|
|
4866
|
+
N += t.text ? n.width + r * Jn(t.text) : 0, n.actualBoundingBoxAscent > 0 && (P = Math.max(P, n.actualBoundingBoxAscent));
|
|
4612
4867
|
}
|
|
4613
4868
|
let F = z + P, I = E + k, L = 0, R = null;
|
|
4614
4869
|
if (j && A) {
|
|
4615
4870
|
if (y) e.font = b, L = e.measureText(y).width;
|
|
4616
|
-
else if (S && _ && (R =
|
|
4871
|
+
else if (S && _ && (R = m(S.imagePath, _), R)) {
|
|
4617
4872
|
let e = S.sizePx;
|
|
4618
4873
|
L = R.height > 0 ? e * (R.width / R.height) : e;
|
|
4619
4874
|
}
|
|
@@ -4623,26 +4878,26 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4623
4878
|
e.direction = "rtl", e.fillText(y, I - L, F), e.direction = t;
|
|
4624
4879
|
} else e.fillText(y, D, F);
|
|
4625
4880
|
if (S && _) {
|
|
4626
|
-
let t =
|
|
4881
|
+
let t = m(S.imagePath, _);
|
|
4627
4882
|
if (t) {
|
|
4628
4883
|
let n = S.sizePx, r = t.height > 0 ? n * (t.width / t.height) : n, i = F - n;
|
|
4629
4884
|
j && A ? e.drawImage(t, I - r, i, r, n) : e.drawImage(t, D, i, r, n);
|
|
4630
4885
|
}
|
|
4631
4886
|
}
|
|
4632
|
-
let B = E +
|
|
4633
|
-
U = M ? A ? E + k - L - N : B : C === "ctr" ? B + (k -
|
|
4634
|
-
let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null,
|
|
4635
|
-
for (let t = 0; t <
|
|
4636
|
-
let s =
|
|
4887
|
+
let B = E + g, U;
|
|
4888
|
+
U = M ? A ? E + k - L - N : B : C === "ctr" ? B + (k - g - N) / 2 : C === "r" ? E + k - L - N : B;
|
|
4889
|
+
let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, G = w || (l.endsWithBreak ?? !1), K = (W && !j && !M ? un(l.segments, k - g, N, W, G) : null) ?? l.segments, q = j ? sn(l.segments, A) : null, ee = K.length;
|
|
4890
|
+
for (let t = 0; t < ee; t++) {
|
|
4891
|
+
let s = q ? q.order[t] : t, l = K[s], u = q ? q.rtl[s] : !1;
|
|
4637
4892
|
if (j && (e.direction = u ? "rtl" : "ltr"), l.isTab) {
|
|
4638
4893
|
U += l.tabWidthPx ?? 0;
|
|
4639
4894
|
continue;
|
|
4640
4895
|
}
|
|
4641
|
-
let f = l.jext ?? 0,
|
|
4896
|
+
let f = l.jext ?? 0, m = l.splitBefore, g = l.perGap ?? 0, _ = m && m.length > 0 ? m.length * g : 0;
|
|
4642
4897
|
if (l.math) {
|
|
4643
|
-
let t =
|
|
4898
|
+
let t = En.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
|
|
4644
4899
|
if (t && n > 0 && r > 0) {
|
|
4645
|
-
let i = F - l.math.ascent, a =
|
|
4900
|
+
let i = F - l.math.ascent, a = Dn(t, l.color);
|
|
4646
4901
|
e.drawImage(a, U, i, n, r);
|
|
4647
4902
|
}
|
|
4648
4903
|
U += n, U += f;
|
|
@@ -4651,15 +4906,10 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4651
4906
|
e.font = l.font, e.fillStyle = l.color;
|
|
4652
4907
|
let y = F + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), b = l.letterSpacingPx ?? 0;
|
|
4653
4908
|
if (l.highlight && l.text) {
|
|
4654
|
-
let t = e.measureText(l.text).width + (b > 0 ? b *
|
|
4655
|
-
|
|
4909
|
+
let t = e.measureText(l.text).width + (b > 0 ? b * Jn(l.text) : 0) + _ + f;
|
|
4910
|
+
wn(e, U, y, t, l.sizePx, l.highlight, l.color);
|
|
4656
4911
|
}
|
|
4657
|
-
let x = l.shadow
|
|
4658
|
-
if (x) {
|
|
4659
|
-
let t = x.dir * Math.PI / 180, n = J(x.dist, o);
|
|
4660
|
-
e.save(), e.shadowColor = Y(x.color, x.alpha), e.shadowBlur = J(x.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4661
|
-
}
|
|
4662
|
-
let S = (t, n, r) => {
|
|
4912
|
+
let x = l.shadow, S = (e, t, n, r) => {
|
|
4663
4913
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4664
4914
|
if (b > 0 && t.length > 1) {
|
|
4665
4915
|
let r = e, a = r.letterSpacing;
|
|
@@ -4671,10 +4921,10 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4671
4921
|
r.letterSpacing = a;
|
|
4672
4922
|
} catch {}
|
|
4673
4923
|
} else i(t, n, y);
|
|
4674
|
-
}, C = (t) => e.measureText(t).width, w =
|
|
4924
|
+
}, C = (t) => e.measureText(t).width, w = m && m.length > 0 ? Zt([...l.text], m, g, C, b) : null, T = [...l.text], E = !!m && m.length === T.length - 1 && T.length > 1, D = (e, t) => {
|
|
4675
4925
|
if (v) {
|
|
4676
4926
|
let n = E ? b + g : b;
|
|
4677
|
-
|
|
4927
|
+
Cn(e, l.text, U, y, l.sizePx, n, t);
|
|
4678
4928
|
return;
|
|
4679
4929
|
}
|
|
4680
4930
|
if (E) {
|
|
@@ -4686,18 +4936,37 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4686
4936
|
try {
|
|
4687
4937
|
n.letterSpacing = r;
|
|
4688
4938
|
} catch {}
|
|
4689
|
-
} else if (w) for (let { text:
|
|
4690
|
-
else S(l.text, U, t);
|
|
4691
|
-
};
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4939
|
+
} else if (w) for (let { text: n, dx: r } of w) S(e, n, U + r, t);
|
|
4940
|
+
else S(e, l.text, U, t);
|
|
4941
|
+
}, O = l.reflection;
|
|
4942
|
+
if (O && l.text) {
|
|
4943
|
+
let t = e.canvas.width || 0, n = e.canvas.height || 0;
|
|
4944
|
+
if (t > 0 && n > 0) {
|
|
4945
|
+
e.font = l.font;
|
|
4946
|
+
let r = e.measureText(l.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : l.sizePx * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : l.sizePx * .2, s = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1;
|
|
4947
|
+
Un(e, (e) => {
|
|
4948
|
+
e.font = l.font, e.fillStyle = l.color, D(e, "fill");
|
|
4949
|
+
}, {
|
|
4950
|
+
x: (U - s) * f,
|
|
4951
|
+
y: (y - i) * f,
|
|
4952
|
+
w: Math.max(1, s + c) * f,
|
|
4953
|
+
h: Math.max(1, i + a) * f
|
|
4954
|
+
}, O, o * f, u, t, n), e.font = l.font, e.fillStyle = l.color;
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4957
|
+
if (x) {
|
|
4958
|
+
let t = x.dir * Math.PI / 180, n = X(x.dist, o);
|
|
4959
|
+
e.save(), e.shadowColor = Z(x.color, x.alpha), e.shadowBlur = X(x.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4960
|
+
}
|
|
4961
|
+
D(e, "fill"), x && e.restore();
|
|
4962
|
+
let k = l.outline;
|
|
4963
|
+
k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(k.width, o)), e.strokeStyle = k.color ? `#${k.color}` : l.color, e.lineJoin = "round", D(e, "stroke"), e.restore()), e.font = l.font;
|
|
4964
|
+
let A = e.measureText(l.text).width + (b > 0 ? b * Jn(l.text) : 0) + _;
|
|
4965
|
+
if (h && l.text && h({
|
|
4697
4966
|
text: l.text,
|
|
4698
4967
|
inShapeX: U - n,
|
|
4699
4968
|
inShapeY: z - r,
|
|
4700
|
-
w:
|
|
4969
|
+
w: A + f,
|
|
4701
4970
|
h: d,
|
|
4702
4971
|
fontSize: l.sizePx,
|
|
4703
4972
|
font: l.font,
|
|
@@ -4707,27 +4976,27 @@ function mr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4707
4976
|
shapeH: a,
|
|
4708
4977
|
rotation: c,
|
|
4709
4978
|
hyperlink: l.hyperlink
|
|
4710
|
-
}), l.underline &&
|
|
4979
|
+
}), l.underline && Yt(e, U, y, A + f, l.sizePx, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
|
|
4711
4980
|
let t = Math.max(1, l.sizePx * .05);
|
|
4712
4981
|
e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash([]);
|
|
4713
4982
|
let n = y - l.sizePx * .32;
|
|
4714
4983
|
if (l.strikeDouble) {
|
|
4715
4984
|
let r = t * .9, i = n - r, a = n + r;
|
|
4716
|
-
e.beginPath(), e.moveTo(U, i +
|
|
4985
|
+
e.beginPath(), e.moveTo(U, i + J(i, t, p.dpr)), e.lineTo(U + A + f, i + J(i, t, p.dpr)), e.moveTo(U, a + J(a, t, p.dpr)), e.lineTo(U + A + f, a + J(a, t, p.dpr)), e.stroke();
|
|
4717
4986
|
} else {
|
|
4718
|
-
let r = n +
|
|
4719
|
-
e.beginPath(), e.moveTo(U, r), e.lineTo(U +
|
|
4987
|
+
let r = n + J(n, t, p.dpr);
|
|
4988
|
+
e.beginPath(), e.moveTo(U, r), e.lineTo(U + A + f, r), e.stroke();
|
|
4720
4989
|
}
|
|
4721
4990
|
}
|
|
4722
|
-
U +=
|
|
4991
|
+
U += A, U += f;
|
|
4723
4992
|
}
|
|
4724
4993
|
j && (e.direction = "ltr"), z += u;
|
|
4725
4994
|
}
|
|
4726
4995
|
e.restore();
|
|
4727
4996
|
}
|
|
4728
|
-
function
|
|
4997
|
+
function jr(e, t, n, r, i) {
|
|
4729
4998
|
if (!e) return [];
|
|
4730
|
-
let a =
|
|
4999
|
+
let a = Lt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Ut(n), s = r * i, c = [];
|
|
4731
5000
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4732
5001
|
widthPx: e.bevelT.w * s,
|
|
4733
5002
|
heightPx: e.bevelT.h * s,
|
|
@@ -4743,9 +5012,9 @@ function hr(e, t, n, r, i) {
|
|
|
4743
5012
|
bottom: !0
|
|
4744
5013
|
}), c;
|
|
4745
5014
|
}
|
|
4746
|
-
function
|
|
5015
|
+
function Mr(e, t, n, r, i, a) {
|
|
4747
5016
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4748
|
-
let o = e.extrusionH * i * a, s =
|
|
5017
|
+
let o = e.extrusionH * i * a, s = ct(t, n * a, r * a, o);
|
|
4749
5018
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4750
5019
|
let c = [
|
|
4751
5020
|
64,
|
|
@@ -4766,66 +5035,66 @@ function gr(e, t, n, r, i, a) {
|
|
|
4766
5035
|
rgb: c
|
|
4767
5036
|
};
|
|
4768
5037
|
}
|
|
4769
|
-
function
|
|
4770
|
-
if (
|
|
4771
|
-
let
|
|
4772
|
-
if (
|
|
4773
|
-
let e =
|
|
4774
|
-
t ?
|
|
5038
|
+
function Nr(e, t, n, r, i, a, o, s = {}) {
|
|
5039
|
+
if (i <= 0 || a <= 0) return !1;
|
|
5040
|
+
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 = ot(t, i, a), p = f.corners;
|
|
5041
|
+
if (d > 0) {
|
|
5042
|
+
let e = d / u, t = _t(f.corners, e / i, e / a);
|
|
5043
|
+
t ? p = t : d = 0;
|
|
4775
5044
|
}
|
|
4776
|
-
let
|
|
5045
|
+
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = F(h, g);
|
|
5046
|
+
if (!_) return !1;
|
|
5047
|
+
let v = _.getContext("2d");
|
|
4777
5048
|
if (!v) return !1;
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
w: b + 2 * e,
|
|
4785
|
-
h: x + 2 * e
|
|
5049
|
+
v.save(), v.scale(u, u), v.translate(m, m), o(v, 0, 0, i, a), v.restore();
|
|
5050
|
+
let y = Math.ceil(i * u), b = Math.ceil(a * u), x = (e) => ({
|
|
5051
|
+
x: d - e,
|
|
5052
|
+
y: d - e,
|
|
5053
|
+
w: y + 2 * e,
|
|
5054
|
+
h: b + 2 * e
|
|
4786
5055
|
});
|
|
4787
|
-
if (
|
|
4788
|
-
let e = Math.ceil(Math.hypot(
|
|
4789
|
-
|
|
5056
|
+
if (s.extrusion) {
|
|
5057
|
+
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
5058
|
+
Jt(v, s.extrusion, x(e));
|
|
4790
5059
|
}
|
|
4791
|
-
if (
|
|
4792
|
-
return
|
|
4793
|
-
x:
|
|
4794
|
-
y:
|
|
5060
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) qt(v, e, x(Math.ceil(e.widthPx) + 2));
|
|
5061
|
+
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), ht(_, e, h, g, p.map((e) => ({
|
|
5062
|
+
x: n + e.x,
|
|
5063
|
+
y: r + e.y
|
|
4795
5064
|
}))), !0;
|
|
4796
5065
|
}
|
|
4797
|
-
function
|
|
4798
|
-
if (
|
|
4799
|
-
let
|
|
5066
|
+
function Pr(e, t, n, r, i, a, o, s, c = 0) {
|
|
5067
|
+
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
5068
|
+
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 = F(m, h);
|
|
5069
|
+
if (!g) return !1;
|
|
5070
|
+
let _ = g.getContext("2d");
|
|
4800
5071
|
if (!_) return !1;
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
let y = Math.ceil(i * f), b = Math.ceil(a * f);
|
|
4805
|
-
for (let e of o) {
|
|
5072
|
+
_.save(), _.scale(d, d), _.translate(p, p), o(_, 0, 0, r, i), _.restore();
|
|
5073
|
+
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
5074
|
+
for (let e of a) {
|
|
4806
5075
|
let t = Math.ceil(e.widthPx) + 2;
|
|
4807
|
-
|
|
4808
|
-
x:
|
|
4809
|
-
y:
|
|
4810
|
-
w:
|
|
4811
|
-
h:
|
|
5076
|
+
qt(_, e, {
|
|
5077
|
+
x: f - t,
|
|
5078
|
+
y: f - t,
|
|
5079
|
+
w: v + 2 * t,
|
|
5080
|
+
h: y + 2 * t
|
|
4812
5081
|
});
|
|
4813
5082
|
}
|
|
4814
|
-
return
|
|
5083
|
+
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;
|
|
4815
5084
|
}
|
|
4816
|
-
var
|
|
4817
|
-
function
|
|
4818
|
-
let t =
|
|
5085
|
+
var Fr = /* @__PURE__ */ new WeakMap();
|
|
5086
|
+
function Ir(e) {
|
|
5087
|
+
let t = Fr.get(e);
|
|
4819
5088
|
return t || (t = async (t, n) => {
|
|
4820
5089
|
let r = await e(t);
|
|
4821
5090
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
4822
|
-
},
|
|
5091
|
+
}, Fr.set(e, t)), t;
|
|
4823
5092
|
}
|
|
4824
|
-
function
|
|
4825
|
-
return
|
|
5093
|
+
function Lr(e, t, n = Ir(t)) {
|
|
5094
|
+
return G("base", e.posterPath, n, async () => {
|
|
4826
5095
|
let n = await t(e.posterPath), r = e.posterMimeType || n.type || "application/octet-stream";
|
|
4827
5096
|
return {
|
|
4828
|
-
bitmap: await
|
|
5097
|
+
bitmap: await o(n.type === r ? n : new Blob([n], { type: r })),
|
|
4829
5098
|
owned: !0
|
|
4830
5099
|
};
|
|
4831
5100
|
}).then((e) => {
|
|
@@ -4833,96 +5102,102 @@ function xr(e, t, n = br(t)) {
|
|
|
4833
5102
|
return e;
|
|
4834
5103
|
});
|
|
4835
5104
|
}
|
|
4836
|
-
async function
|
|
5105
|
+
async function Rr(e, t, n, r, i) {
|
|
4837
5106
|
if (i) try {
|
|
4838
|
-
let
|
|
4839
|
-
if (
|
|
4840
|
-
|
|
5107
|
+
let o = t.mimeType === "image/svg+xml", { widthPt: s, heightPt: l } = x(t.mimeType, t.srcRect, t.width / U, t.height / U), u;
|
|
5108
|
+
if (ue(t)) try {
|
|
5109
|
+
u = await a(t.svgImagePath, i);
|
|
4841
5110
|
} catch {
|
|
4842
|
-
|
|
5111
|
+
u = o ? await a(t.imagePath, i) : await Te(t.imagePath, t.mimeType, t.duotone, i, {
|
|
4843
5112
|
widthPt: s,
|
|
4844
|
-
heightPt:
|
|
5113
|
+
heightPt: l
|
|
4845
5114
|
});
|
|
4846
5115
|
}
|
|
4847
|
-
else
|
|
5116
|
+
else u = o ? await a(t.imagePath, i) : await Te(t.imagePath, t.mimeType, t.duotone, i, {
|
|
4848
5117
|
widthPt: s,
|
|
4849
|
-
heightPt:
|
|
5118
|
+
heightPt: l
|
|
4850
5119
|
});
|
|
4851
|
-
if (!
|
|
5120
|
+
if (!u || r()) return;
|
|
4852
5121
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
4853
|
-
let
|
|
4854
|
-
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(
|
|
4855
|
-
let
|
|
4856
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
4857
|
-
},
|
|
4858
|
-
e.beginPath(),
|
|
4859
|
-
},
|
|
4860
|
-
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (
|
|
4861
|
-
},
|
|
4862
|
-
t.stroke && (e.save(),
|
|
4863
|
-
|
|
5122
|
+
let d = X(t.x, n), f = X(t.y, n), p = X(t.width, n), m = X(t.height, n);
|
|
5123
|
+
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(d + p / 2, f + m / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(d + p / 2), -(f + m / 2)));
|
|
5124
|
+
let h = b(u, t.srcRect), g = (e, n, r, i, a) => {
|
|
5125
|
+
t.custGeom && t.custGeom.length > 0 ? Tr(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);
|
|
5126
|
+
}, _ = (e, t, n, r, i) => {
|
|
5127
|
+
e.beginPath(), g(e, t, n, r, i);
|
|
5128
|
+
}, y = (e, n, r, i, a) => {
|
|
5129
|
+
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (_(e, n, r, i, a), e.clip());
|
|
5130
|
+
}, S = (e, r, i, a, o) => {
|
|
5131
|
+
t.stroke && (e.save(), Vr(e, t.stroke, n, {
|
|
5132
|
+
x: r,
|
|
5133
|
+
y: i,
|
|
5134
|
+
w: a,
|
|
5135
|
+
h: o
|
|
5136
|
+
}, t.rotation), _(e, r, i, a, o), e.stroke(), e.restore());
|
|
5137
|
+
}, w = (e, r, i, a, o) => {
|
|
4864
5138
|
let s = t.sp3d;
|
|
4865
5139
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
4866
5140
|
let t = Math.max(.5, s.contourW * n);
|
|
4867
5141
|
e.save(), e.beginPath();
|
|
4868
5142
|
let c = t * 2 + Math.max(a, o);
|
|
4869
|
-
e.rect(r - c, i - c, a + 2 * c, o + 2 * c),
|
|
5143
|
+
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), g(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), _(e, r, i, a, o), e.strokeStyle = Z(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
4870
5144
|
}
|
|
4871
|
-
},
|
|
4872
|
-
e.save(),
|
|
4873
|
-
},
|
|
4874
|
-
|
|
4875
|
-
},
|
|
4876
|
-
|
|
4877
|
-
},
|
|
4878
|
-
if (
|
|
4879
|
-
if (
|
|
4880
|
-
bevels:
|
|
4881
|
-
extrusion:
|
|
4882
|
-
paintEdges:
|
|
4883
|
-
edgePadCss:
|
|
5145
|
+
}, T = t.scene3d && st(t.scene3d.camera) ? t.scene3d : null, E = (e, t, n, r, i) => {
|
|
5146
|
+
e.save(), y(e, t, n, r, i), h ? e.drawImage(u, h.sx, h.sy, h.sw, h.sh, t, n, r, i) : e.drawImage(u, t, n, r, i), e.restore();
|
|
5147
|
+
}, D = (e, t, n, r, i) => {
|
|
5148
|
+
E(e, t, n, r, i), S(e, t, n, r, i), w(e, t, n, r, i);
|
|
5149
|
+
}, O = (e, t, n, r, i) => {
|
|
5150
|
+
E(e, t, n, r, i), S(e, t, n, r, i);
|
|
5151
|
+
}, k = e.getTransform(), A = Math.abs(k.a * k.d - k.b * k.c), j = A > 0 ? Math.sqrt(A) : 1, M = jr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, j), N = T ? Mr(t.sp3d, T.camera, p, m, n, j) : null, P = t.stroke ? t.stroke.width * n / 2 : 0, F = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, I = N ? Math.hypot(N.offsetX, N.offsetY) / j : 0, L = P + F + I + 2, R = (e) => {
|
|
5152
|
+
if (T) {
|
|
5153
|
+
if (Nr(e, T.camera, d, f, p, m, O, {
|
|
5154
|
+
bevels: M,
|
|
5155
|
+
extrusion: N ?? void 0,
|
|
5156
|
+
paintEdges: w,
|
|
5157
|
+
edgePadCss: L
|
|
4884
5158
|
})) return;
|
|
4885
|
-
} else if (
|
|
4886
|
-
|
|
4887
|
-
},
|
|
4888
|
-
e.save(),
|
|
4889
|
-
},
|
|
4890
|
-
|
|
4891
|
-
},
|
|
4892
|
-
x:
|
|
4893
|
-
y:
|
|
4894
|
-
w:
|
|
4895
|
-
h:
|
|
4896
|
-
},
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
},
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
})
|
|
4904
|
-
|
|
4905
|
-
|
|
5159
|
+
} else if (M.length > 0 && Pr(e, d, f, p, m, M, O, w, L)) return;
|
|
5160
|
+
D(e, d, f, p, m);
|
|
5161
|
+
}, z = (e, t, n, r, i, a) => {
|
|
5162
|
+
e.save(), y(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5163
|
+
}, B = (e, t) => {
|
|
5164
|
+
T && Nr(e, T.camera, d, f, p, m, (e, n, r, i, a) => z(e, t, n, r, i, a)) || z(e, t, d, f, p, m);
|
|
5165
|
+
}, V = e.getTransform(), H = Math.abs(V.a * V.d - V.b * V.c), W = H > 0 ? Math.sqrt(H) : 1, G = P + F, K = (t.custGeom && t.custGeom.length > 0 ? ve(t.custGeom, d, f, p, m) : t.prstGeom && c(t.prstGeom.toLowerCase()) ? C(t.prstGeom.toLowerCase(), d, f, p, m, t.prstAdjust ?? []) : null) ?? {
|
|
5166
|
+
x: d,
|
|
5167
|
+
y: f,
|
|
5168
|
+
w: p,
|
|
5169
|
+
h: m
|
|
5170
|
+
}, q = T ? xr(T.camera, V, d, f, p, m, L, t.shadow?.algn) : {
|
|
5171
|
+
bbox: _r(V, K.x - G, K.y - G, K.w + G * 2, K.h + G * 2),
|
|
5172
|
+
anchor: br(V, d, f, p, m, t.shadow?.algn)
|
|
5173
|
+
}, ee = n * W, J = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), te = (e) => B(e, "#000");
|
|
5174
|
+
Cr(e, t, T && J ? Sr(R, V, q.bbox, {
|
|
5175
|
+
w: e.canvas.width || 0,
|
|
5176
|
+
h: e.canvas.height || 0
|
|
5177
|
+
}) : R, T && J ? Sr(te, V, q.bbox, {
|
|
5178
|
+
w: e.canvas.width || 0,
|
|
5179
|
+
h: e.canvas.height || 0
|
|
5180
|
+
}) : te, q.bbox, q.anchor, n, ee, V), e.restore();
|
|
4906
5181
|
} catch (e) {
|
|
4907
|
-
if (
|
|
5182
|
+
if (d(e)) throw e;
|
|
4908
5183
|
}
|
|
4909
5184
|
}
|
|
4910
|
-
async function
|
|
4911
|
-
let s =
|
|
5185
|
+
async function zr(e, t, n, r, i, a, o) {
|
|
5186
|
+
let s = X(t.x, n), c = X(t.y, n), l = X(t.width, n), u = X(t.height, n), f;
|
|
4912
5187
|
if (t.posterPath && i) try {
|
|
4913
|
-
|
|
5188
|
+
f = await Lr(t, i, o);
|
|
4914
5189
|
} catch (e) {
|
|
4915
|
-
if (
|
|
5190
|
+
if (d(e)) throw e;
|
|
4916
5191
|
}
|
|
4917
|
-
r() || (e.save(),
|
|
5192
|
+
r() || (e.save(), Hr(e, t, n), f ? e.drawImage(f, s, c, l, u) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(s, c, l, u)), a || nn(e, s + l / 2, c + u / 2, l, u, "paused"), e.restore());
|
|
4918
5193
|
}
|
|
4919
|
-
function
|
|
4920
|
-
let
|
|
4921
|
-
if (
|
|
4922
|
-
let
|
|
5194
|
+
function Br(e, t, n, r, i, a, o) {
|
|
5195
|
+
let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5196
|
+
if (u === 0) return;
|
|
5197
|
+
let d = -l / u, f = c / u, p;
|
|
4923
5198
|
switch (i) {
|
|
4924
5199
|
case "dbl":
|
|
4925
|
-
|
|
5200
|
+
p = [{
|
|
4926
5201
|
offset: -1 / 3,
|
|
4927
5202
|
widthFrac: 1 / 3
|
|
4928
5203
|
}, {
|
|
@@ -4931,7 +5206,7 @@ function wr(e, t, n, r, i, a) {
|
|
|
4931
5206
|
}];
|
|
4932
5207
|
break;
|
|
4933
5208
|
case "thinThick":
|
|
4934
|
-
|
|
5209
|
+
p = [{
|
|
4935
5210
|
offset: -3 / 8,
|
|
4936
5211
|
widthFrac: 1 / 4
|
|
4937
5212
|
}, {
|
|
@@ -4940,7 +5215,7 @@ function wr(e, t, n, r, i, a) {
|
|
|
4940
5215
|
}];
|
|
4941
5216
|
break;
|
|
4942
5217
|
case "thickThin":
|
|
4943
|
-
|
|
5218
|
+
p = [{
|
|
4944
5219
|
offset: -1 / 4,
|
|
4945
5220
|
widthFrac: 1 / 2
|
|
4946
5221
|
}, {
|
|
@@ -4949,7 +5224,7 @@ function wr(e, t, n, r, i, a) {
|
|
|
4949
5224
|
}];
|
|
4950
5225
|
break;
|
|
4951
5226
|
case "tri":
|
|
4952
|
-
|
|
5227
|
+
p = [
|
|
4953
5228
|
{
|
|
4954
5229
|
offset: -2 / 5,
|
|
4955
5230
|
widthFrac: 1 / 5
|
|
@@ -4966,38 +5241,41 @@ function wr(e, t, n, r, i, a) {
|
|
|
4966
5241
|
break;
|
|
4967
5242
|
default: return;
|
|
4968
5243
|
}
|
|
4969
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth =
|
|
4970
|
-
for (let r of
|
|
4971
|
-
let i =
|
|
4972
|
-
e.lineWidth = Math.max(.5,
|
|
5244
|
+
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 ? Tn(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);
|
|
5245
|
+
for (let r of p) {
|
|
5246
|
+
let i = d * (s * r.offset), a = f * (s * r.offset);
|
|
5247
|
+
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();
|
|
4973
5248
|
}
|
|
4974
5249
|
e.restore();
|
|
4975
5250
|
}
|
|
4976
|
-
function
|
|
4977
|
-
|
|
5251
|
+
function Vr(e, t, n, r, i = 0) {
|
|
5252
|
+
if (ie(e, t, n), t?.fill && r) {
|
|
5253
|
+
let n = Tn(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5254
|
+
n && (e.strokeStyle = n);
|
|
5255
|
+
}
|
|
4978
5256
|
}
|
|
4979
|
-
function
|
|
5257
|
+
function Hr(e, t, n) {
|
|
4980
5258
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
4981
|
-
let r =
|
|
5259
|
+
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
4982
5260
|
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));
|
|
4983
5261
|
}
|
|
4984
|
-
function
|
|
5262
|
+
function Ur(e, t, n, r, i = {
|
|
4985
5263
|
themeMajorFont: null,
|
|
4986
5264
|
themeMinorFont: null,
|
|
4987
5265
|
dpr: 1
|
|
4988
5266
|
}) {
|
|
4989
|
-
e.save(),
|
|
4990
|
-
let a =
|
|
5267
|
+
e.save(), Hr(e, t, n);
|
|
5268
|
+
let a = X(t.x, n), o = X(t.y, n), s = t.cols.map((e) => X(e, n)), c = s.length, l = (e, t) => {
|
|
4991
5269
|
let n = 0;
|
|
4992
5270
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
4993
5271
|
return n;
|
|
4994
|
-
}, u = t.rows.map((e) =>
|
|
5272
|
+
}, u = t.rows.map((e) => X(e.height, n));
|
|
4995
5273
|
for (let a = 0; a < t.rows.length; a++) {
|
|
4996
5274
|
let o = t.rows[a];
|
|
4997
5275
|
for (let t = 0; t < o.cells.length; t++) {
|
|
4998
5276
|
let s = o.cells[t];
|
|
4999
5277
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5000
|
-
let c = l(t, s.gridSpan || 1), d =
|
|
5278
|
+
let c = l(t, s.gridSpan || 1), d = Ar(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
5001
5279
|
d > u[a] && (u[a] = d);
|
|
5002
5280
|
}
|
|
5003
5281
|
}
|
|
@@ -5008,7 +5286,7 @@ function Er(e, t, n, r, i = {
|
|
|
5008
5286
|
if (s.hMerge || s.vMerge) continue;
|
|
5009
5287
|
let c = s.rowSpan || 1;
|
|
5010
5288
|
if (c <= 1 || !s.textBody) continue;
|
|
5011
|
-
let d = l(t, s.gridSpan || 1), f =
|
|
5289
|
+
let d = l(t, s.gridSpan || 1), f = Ar(e, s.textBody, 0, 0, d, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
5012
5290
|
for (let e = 0; e < c && a + e < u.length; e++) p += u[a + e];
|
|
5013
5291
|
if (f > p) {
|
|
5014
5292
|
let e = (f - p) / c;
|
|
@@ -5052,21 +5330,26 @@ function Er(e, t, n, r, i = {
|
|
|
5052
5330
|
for (let t = e; t <= _; t++) for (let e = i; e < i + o && e < c; e++) g[t][e] = v;
|
|
5053
5331
|
}
|
|
5054
5332
|
}
|
|
5055
|
-
for (let { cell:
|
|
5056
|
-
let
|
|
5057
|
-
if (
|
|
5058
|
-
let
|
|
5059
|
-
|
|
5333
|
+
for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l } of h) {
|
|
5334
|
+
let u = Tn(a.fill, e, o, s, c, l, t.rotation);
|
|
5335
|
+
if (u && (e.fillStyle = u, e.fillRect(o, s, c, l)), a.textBody) {
|
|
5336
|
+
let t = a.textColor ? Z(a.textColor) : null;
|
|
5337
|
+
Ar(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i);
|
|
5060
5338
|
}
|
|
5061
5339
|
}
|
|
5062
5340
|
let _ = i.dpr, v = (e, t) => {
|
|
5063
5341
|
if (e < 0 || e >= g.length || t < 0 || t >= c) return null;
|
|
5064
5342
|
let n = g[e][t];
|
|
5065
5343
|
return n < 0 ? null : h[n];
|
|
5066
|
-
}, y = (
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5344
|
+
}, y = (r, i, a, o, s) => {
|
|
5345
|
+
Vr(e, r, n, {
|
|
5346
|
+
x: Math.min(i, o),
|
|
5347
|
+
y: Math.min(a, s),
|
|
5348
|
+
w: Math.max(1, Math.abs(o - i)),
|
|
5349
|
+
h: Math.max(1, Math.abs(s - a))
|
|
5350
|
+
}, t.rotation);
|
|
5351
|
+
let c = i === o ? J(i, e.lineWidth, _) : 0, l = a === s ? J(a, e.lineWidth, _) : 0;
|
|
5352
|
+
e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
|
|
5070
5353
|
};
|
|
5071
5354
|
for (let r of h) {
|
|
5072
5355
|
let { cell: i, colX: a, rowY: o, cellW: s, cellH: d } = r;
|
|
@@ -5080,7 +5363,7 @@ function Er(e, t, n, r, i = {
|
|
|
5080
5363
|
for (; a < n;) {
|
|
5081
5364
|
let r = g[e][a], o = a + 1;
|
|
5082
5365
|
for (; o < n && g[e][o] === r;) o++;
|
|
5083
|
-
let s = v(e, a), c =
|
|
5366
|
+
let s = v(e, a), c = pn(i.borderB, s ? s.cell.borderT : null);
|
|
5084
5367
|
if (c) {
|
|
5085
5368
|
let e = p(a, o - a);
|
|
5086
5369
|
y(c, e, t, e + l(a, o - a), t);
|
|
@@ -5096,22 +5379,32 @@ function Er(e, t, n, r, i = {
|
|
|
5096
5379
|
for (; t <= r.lastRi;) {
|
|
5097
5380
|
let n = g[t][x], i = t;
|
|
5098
5381
|
for (; i + 1 <= r.lastRi && g[i + 1][x] === n;) i++;
|
|
5099
|
-
let a = v(t, x), o =
|
|
5382
|
+
let a = v(t, x), o = pn(h, a ? S(a.cell) : null);
|
|
5100
5383
|
o && y(o, e, m[t], e, m[i] + u[i]), t = i + 1;
|
|
5101
5384
|
}
|
|
5102
5385
|
}
|
|
5103
|
-
i.diagonalTL && (
|
|
5386
|
+
i.diagonalTL && (Vr(e, i.diagonalTL, n, {
|
|
5387
|
+
x: a,
|
|
5388
|
+
y: o,
|
|
5389
|
+
w: s,
|
|
5390
|
+
h: d
|
|
5391
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (Vr(e, i.diagonalTR, n, {
|
|
5392
|
+
x: a,
|
|
5393
|
+
y: o,
|
|
5394
|
+
w: s,
|
|
5395
|
+
h: d
|
|
5396
|
+
}, t.rotation), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + d), e.stroke()), e.restore();
|
|
5104
5397
|
}
|
|
5105
5398
|
e.restore();
|
|
5106
5399
|
}
|
|
5107
|
-
function
|
|
5400
|
+
function Wr(e, t, n, r) {
|
|
5108
5401
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5109
5402
|
}
|
|
5110
|
-
var
|
|
5111
|
-
function
|
|
5112
|
-
|
|
5403
|
+
var Gr = /* @__PURE__ */ new WeakMap();
|
|
5404
|
+
function Kr(e) {
|
|
5405
|
+
Gr.set(e, (Gr.get(e) ?? 0) + 1);
|
|
5113
5406
|
}
|
|
5114
|
-
function
|
|
5407
|
+
function qr(e, t, n, r, i) {
|
|
5115
5408
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5116
5409
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5117
5410
|
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([]);
|
|
@@ -5131,86 +5424,86 @@ function Ar(e, t, n, r, i) {
|
|
|
5131
5424
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5132
5425
|
e.restore();
|
|
5133
5426
|
}
|
|
5134
|
-
async function
|
|
5135
|
-
let o = i.fetchImage ?? (i.fetchMedia ?
|
|
5427
|
+
async function Jr(e, t, n, r, i = {}, a) {
|
|
5428
|
+
let o = i.fetchImage ?? (i.fetchMedia ? Ir(i.fetchMedia) : void 0), s = o ? g(o) : void 0;
|
|
5136
5429
|
try {
|
|
5137
|
-
return await
|
|
5430
|
+
return await Yr(e, t, n, r, i, a, o);
|
|
5138
5431
|
} finally {
|
|
5139
5432
|
s?.();
|
|
5140
5433
|
}
|
|
5141
5434
|
}
|
|
5142
|
-
async function
|
|
5143
|
-
let
|
|
5144
|
-
|
|
5145
|
-
let
|
|
5146
|
-
e.width = v.width, e.height = v.height,
|
|
5435
|
+
async function Yr(e, n, r, i, o = {}, s, c) {
|
|
5436
|
+
let l = (Gr.get(e) ?? 0) + 1;
|
|
5437
|
+
Gr.set(e, l);
|
|
5438
|
+
let f = () => Gr.get(e) !== l, p = o.width ?? ((z(e) ? e.offsetWidth : 0) || 960), m = p / r, h = Math.round(p), g = Math.round(i * m), _ = o.dpr ?? V(), v = re(h * _, g * _), y = v.clamped ? _ * v.scale : _;
|
|
5439
|
+
e.width = v.width, e.height = v.height, z(e) && (e.style.width = `${h}px`, e.style.display || (e.style.display = "block"));
|
|
5147
5440
|
let b = e.getContext("2d");
|
|
5148
5441
|
if (!b) throw Error("Could not get 2D context");
|
|
5149
|
-
if (b.scale(y, y),
|
|
5150
|
-
let
|
|
5151
|
-
themeMajorFont:
|
|
5152
|
-
themeMinorFont:
|
|
5153
|
-
themeHlinkColor:
|
|
5442
|
+
if (b.scale(y, y), n.parseError) return qr(b, h, g, n.slideNumber, n.parseError), e;
|
|
5443
|
+
let S = o.defaultTextColor ? `#${o.defaultTextColor}` : "#000000", C = {
|
|
5444
|
+
themeMajorFont: o.majorFont ?? null,
|
|
5445
|
+
themeMinorFont: o.minorFont ?? null,
|
|
5446
|
+
themeHlinkColor: o.hlinkColor ?? null,
|
|
5154
5447
|
dpr: y,
|
|
5155
|
-
smartArtFallbackTextColor:
|
|
5448
|
+
smartArtFallbackTextColor: _n(n.background, S)
|
|
5156
5449
|
};
|
|
5157
|
-
if (await
|
|
5158
|
-
let w =
|
|
5159
|
-
for (let e of
|
|
5450
|
+
if (await Xn(b, n.background, h, g, m, f, o.fetchImage), f() || (o.math && await Mn(n, o.math), f())) return e;
|
|
5451
|
+
let w = n.slideNumber;
|
|
5452
|
+
for (let e of n.elements) if (e.type === "picture" && o.fetchImage) {
|
|
5160
5453
|
let t = e, n = t.mimeType === "image/svg+xml";
|
|
5161
|
-
if (
|
|
5162
|
-
else if (n)
|
|
5454
|
+
if (ue(t)) a(t.svgImagePath, o.fetchImage).catch(() => void 0);
|
|
5455
|
+
else if (n) a(t.imagePath, o.fetchImage).catch(() => void 0);
|
|
5163
5456
|
else {
|
|
5164
|
-
let e =
|
|
5165
|
-
|
|
5457
|
+
let e = x(t.mimeType, t.srcRect, t.width / U, t.height / U);
|
|
5458
|
+
Te(t.imagePath, t.mimeType, t.duotone, o.fetchImage, {
|
|
5166
5459
|
widthPt: e.widthPt,
|
|
5167
5460
|
heightPt: e.heightPt
|
|
5168
5461
|
}).catch(() => void 0);
|
|
5169
5462
|
}
|
|
5170
5463
|
} else if (e.type === "media") {
|
|
5171
5464
|
let t = e;
|
|
5172
|
-
t.posterPath &&
|
|
5465
|
+
t.posterPath && o.fetchMedia && Lr(t, o.fetchMedia, c).catch(() => void 0);
|
|
5173
5466
|
}
|
|
5174
|
-
if (
|
|
5175
|
-
let r =
|
|
5176
|
-
for (let e of
|
|
5177
|
-
let e =
|
|
5467
|
+
if (o.fetchImage) {
|
|
5468
|
+
let r = o.fetchImage, i = /* @__PURE__ */ new Set();
|
|
5469
|
+
for (let e of n.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5470
|
+
let e = De(t.bullet);
|
|
5178
5471
|
e.type === "blip" && i.add(`${e.imagePath} ${e.mimeType}`);
|
|
5179
5472
|
}
|
|
5180
5473
|
if (i.size > 0 && (await Promise.all([...i].map((e) => {
|
|
5181
|
-
let [
|
|
5182
|
-
return n
|
|
5183
|
-
if (
|
|
5474
|
+
let [n, i] = e.split(" ");
|
|
5475
|
+
return t(n, i, r).catch((e) => {
|
|
5476
|
+
if (d(e)) throw e;
|
|
5184
5477
|
});
|
|
5185
|
-
})),
|
|
5478
|
+
})), f())) return e;
|
|
5186
5479
|
}
|
|
5187
|
-
for (let [
|
|
5188
|
-
if (
|
|
5189
|
-
if (r.type === "shape")
|
|
5480
|
+
for (let [t, r] of n.elements.entries()) {
|
|
5481
|
+
if (f()) return e;
|
|
5482
|
+
if (r.type === "shape") wr(b, r, m, S, w, C, s ? (e) => s({
|
|
5190
5483
|
...e,
|
|
5191
|
-
elementIndex:
|
|
5192
|
-
origin:
|
|
5193
|
-
}) : void 0,
|
|
5194
|
-
else if (r.type === "picture") await
|
|
5195
|
-
else if (r.type === "table")
|
|
5196
|
-
else if (r.type === "media") await
|
|
5484
|
+
elementIndex: t,
|
|
5485
|
+
origin: n.elementSources?.[t]?.origin ?? "slide"
|
|
5486
|
+
}) : void 0, o.fetchImage);
|
|
5487
|
+
else if (r.type === "picture") await Rr(b, r, m, f, o.fetchImage);
|
|
5488
|
+
else if (r.type === "table") Ur(b, r, m, w, C);
|
|
5489
|
+
else if (r.type === "media") await zr(b, r, m, f, o.fetchMedia, o.skipMediaControls, o.fetchImage);
|
|
5197
5490
|
else if (r.type === "chart") {
|
|
5198
|
-
let e =
|
|
5199
|
-
b.save(),
|
|
5200
|
-
x:
|
|
5201
|
-
y:
|
|
5202
|
-
w:
|
|
5203
|
-
h:
|
|
5491
|
+
let e = U * m;
|
|
5492
|
+
b.save(), Hr(b, r, m), u(b, r.chart, {
|
|
5493
|
+
x: X(r.x, m),
|
|
5494
|
+
y: X(r.y, m),
|
|
5495
|
+
w: X(r.width, m),
|
|
5496
|
+
h: X(r.height, m)
|
|
5204
5497
|
}, e), b.restore();
|
|
5205
5498
|
}
|
|
5206
5499
|
}
|
|
5207
|
-
return
|
|
5500
|
+
return f() || o.dim && Wr(b, o.dim, h, g), e;
|
|
5208
5501
|
}
|
|
5209
5502
|
//#endregion
|
|
5210
5503
|
//#region packages/pptx/src/google-fonts.ts
|
|
5211
|
-
var
|
|
5212
|
-
...
|
|
5213
|
-
...
|
|
5504
|
+
var Xr = {
|
|
5505
|
+
...ee,
|
|
5506
|
+
...K
|
|
5214
5507
|
};
|
|
5215
5508
|
Object.freeze({
|
|
5216
5509
|
archiveEntryCount: 0,
|
|
@@ -5221,7 +5514,7 @@ Object.freeze({
|
|
|
5221
5514
|
function $(e, t) {
|
|
5222
5515
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5223
5516
|
}
|
|
5224
|
-
function
|
|
5517
|
+
function Zr(e, t) {
|
|
5225
5518
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5226
5519
|
let n = e;
|
|
5227
5520
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5231,7 +5524,7 @@ function Pr(e, t) {
|
|
|
5231
5524
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5232
5525
|
});
|
|
5233
5526
|
}
|
|
5234
|
-
function
|
|
5527
|
+
function Qr(e) {
|
|
5235
5528
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5236
5529
|
let t = e;
|
|
5237
5530
|
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.slides) || t.slides.length !== t.slideCount) throw Error("invalid PPTX presentation bootstrap dimensions or slide count");
|
|
@@ -5244,10 +5537,10 @@ function Fr(e) {
|
|
|
5244
5537
|
minorFont: t.minorFont,
|
|
5245
5538
|
hlinkColor: t.hlinkColor,
|
|
5246
5539
|
folHlinkColor: t.folHlinkColor,
|
|
5247
|
-
slides: Object.freeze(t.slides.map(
|
|
5540
|
+
slides: Object.freeze(t.slides.map(Zr))
|
|
5248
5541
|
});
|
|
5249
5542
|
}
|
|
5250
|
-
function
|
|
5543
|
+
function $r(e) {
|
|
5251
5544
|
return Object.freeze({
|
|
5252
5545
|
type: "media",
|
|
5253
5546
|
x: e.x,
|
|
@@ -5264,7 +5557,7 @@ function Ir(e) {
|
|
|
5264
5557
|
mimeType: e.mimeType
|
|
5265
5558
|
});
|
|
5266
5559
|
}
|
|
5267
|
-
function
|
|
5560
|
+
function ei(e, t) {
|
|
5268
5561
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
5269
5562
|
let n = e;
|
|
5270
5563
|
for (let e of [
|
|
@@ -5275,9 +5568,9 @@ function Lr(e, t) {
|
|
|
5275
5568
|
"rotation"
|
|
5276
5569
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
5277
5570
|
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}`);
|
|
5278
|
-
return
|
|
5571
|
+
return $r(n);
|
|
5279
5572
|
}
|
|
5280
|
-
function
|
|
5573
|
+
function ti(e) {
|
|
5281
5574
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5282
5575
|
let t = e;
|
|
5283
5576
|
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.slides) || t.slides.length !== t.slideCount || !Array.isArray(t.fontPreloadNames)) throw Error("invalid PPTX presentation preflight dimensions or slide count");
|
|
@@ -5291,7 +5584,7 @@ function Rr(e) {
|
|
|
5291
5584
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
5292
5585
|
notes: n.notes,
|
|
5293
5586
|
hidden: n.hidden,
|
|
5294
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
5587
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => ei(e, t)))
|
|
5295
5588
|
});
|
|
5296
5589
|
}), r = t.fontPreloadNames.map((e, t) => {
|
|
5297
5590
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
|
|
@@ -5310,7 +5603,7 @@ function Rr(e) {
|
|
|
5310
5603
|
fontPreloadNames: Object.freeze(r)
|
|
5311
5604
|
});
|
|
5312
5605
|
}
|
|
5313
|
-
function
|
|
5606
|
+
function ni(e, t) {
|
|
5314
5607
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
5315
5608
|
if (e.mediaPath === t) return e.mimeType;
|
|
5316
5609
|
if (e.posterPath === t) return e.posterMimeType;
|
|
@@ -5319,7 +5612,7 @@ function zr(e, t) {
|
|
|
5319
5612
|
}
|
|
5320
5613
|
//#endregion
|
|
5321
5614
|
//#region packages/pptx/src/slide-pull-client.ts
|
|
5322
|
-
var
|
|
5615
|
+
var ri = 1024 * 1024, ii = class {
|
|
5323
5616
|
active = /* @__PURE__ */ new Set();
|
|
5324
5617
|
nextSessionId = 1;
|
|
5325
5618
|
constructor(e) {
|
|
@@ -5332,15 +5625,15 @@ var Br = 1024 * 1024, Vr = class {
|
|
|
5332
5625
|
sessionId: r,
|
|
5333
5626
|
operationId: r,
|
|
5334
5627
|
generation: this.options.generation ?? 1
|
|
5335
|
-
}, a = new
|
|
5628
|
+
}, a = new p(this.options.transport, {
|
|
5336
5629
|
...i,
|
|
5337
|
-
maxByteCredit:
|
|
5630
|
+
maxByteCredit: l,
|
|
5338
5631
|
timeoutMs: n
|
|
5339
5632
|
});
|
|
5340
5633
|
this.active.add(a);
|
|
5341
5634
|
try {
|
|
5342
5635
|
await this.options.open(e, i, n);
|
|
5343
|
-
let r = await
|
|
5636
|
+
let r = await oi(a);
|
|
5344
5637
|
try {
|
|
5345
5638
|
let e = r.usage ?? a.usageCheckpoint;
|
|
5346
5639
|
e && this.options.onUsage?.(e);
|
|
@@ -5363,20 +5656,20 @@ var Br = 1024 * 1024, Vr = class {
|
|
|
5363
5656
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
5364
5657
|
}
|
|
5365
5658
|
};
|
|
5366
|
-
function
|
|
5659
|
+
function ai(e) {
|
|
5367
5660
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
5368
5661
|
}
|
|
5369
|
-
async function
|
|
5662
|
+
async function oi(e) {
|
|
5370
5663
|
try {
|
|
5371
|
-
return await e.pull(
|
|
5664
|
+
return await e.pull(ri);
|
|
5372
5665
|
} catch (t) {
|
|
5373
|
-
let n =
|
|
5666
|
+
let n = si(t);
|
|
5374
5667
|
if (n === void 0) throw t;
|
|
5375
5668
|
return e.pull(n);
|
|
5376
5669
|
}
|
|
5377
5670
|
}
|
|
5378
|
-
function
|
|
5379
|
-
return
|
|
5671
|
+
function si(e) {
|
|
5672
|
+
return M(e, ri, l);
|
|
5380
5673
|
}
|
|
5381
5674
|
//#endregion
|
|
5382
|
-
export {
|
|
5675
|
+
export { ti as a, Jr as c, Qr as i, nn as l, ai as n, Xr as o, ni as r, Kr as s, ii as t };
|