@silurus/ooxml 0.71.0 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/THIRD_PARTY_NOTICES.md +73 -0
- package/dist/docx-BPF-eH0O.js +10183 -0
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-DgyGlCIw.js → find-cursor-DTrEBxjE.js} +7934 -1323
- package/dist/highlight-rect-B--cPQOV.js +881 -0
- package/dist/index.mjs +4 -4
- package/dist/math.mjs +1 -1
- package/dist/{pptx-C2qCkfTT.js → pptx-BMxDfEYI.js} +1337 -1130
- package/dist/pptx.mjs +3 -3
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-DL_kkykF.js +27 -0
- package/dist/render-worker-host-S0HOWgs0.js +27 -0
- package/dist/render-worker-host-l8yqDUfE.js +27 -0
- package/dist/{segments-BLmJVJRb.js → segments-Da-soh2U.js} +1 -1
- package/dist/types/docx.d.ts +218 -15
- package/dist/types/index.d.ts +338 -24
- package/dist/types/pptx.d.ts +106 -8
- package/dist/types/xlsx.d.ts +30 -1
- package/dist/visible-index-5hdq_oAL.js +50 -0
- package/dist/{xlsx-1PnsOb7Z.js → xlsx-bwQD8c1Q.js} +1307 -1255
- package/dist/xlsx.mjs +3 -3
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/docx-B84Lzf0A.js +0 -6396
- package/dist/highlight-rect-CBqVAarx.js +0 -911
- package/dist/render-worker-host-B_mY9aaj.js +0 -27
- package/dist/render-worker-host-CSA5bTZW.js +0 -27
- package/dist/render-worker-host-DL0cvjox.js +0 -27
- package/dist/visible-index-C4c37k-n.js +0 -17
- /package/dist/{mathjax-BRfWlbSJ.js → mathjax-Dk_JzbFj.js} +0 -0
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
//#region packages/pptx/src/text-layer.ts
|
|
6
|
-
function Ne(e, t, n, r, i) {
|
|
7
|
-
e.innerHTML = "", e.style.width = `${n}px`, e.style.height = `${r}px`;
|
|
8
|
-
let a = /* @__PURE__ */ new Map();
|
|
9
|
-
for (let n of t) {
|
|
10
|
-
let t = n.rotation + (n.textBodyRotation ?? 0), r = `${n.shapeX},${n.shapeY},${n.shapeW},${n.shapeH},${t}`;
|
|
11
|
-
if (!a.has(r)) {
|
|
12
|
-
let i = document.createElement("div");
|
|
13
|
-
i.style.cssText = `position:absolute;left:${n.shapeX}px;top:${n.shapeY}px;width:${n.shapeW}px;height:${n.shapeH}px;pointer-events:all;overflow:hidden;`, t !== 0 && (i.style.transformOrigin = "center center", i.style.transform = `rotate(${t}deg)`), a.set(r, {
|
|
14
|
-
div: i,
|
|
15
|
-
x: n.shapeX,
|
|
16
|
-
y: n.shapeY,
|
|
17
|
-
w: n.shapeW,
|
|
18
|
-
h: n.shapeH,
|
|
19
|
-
rot: t
|
|
20
|
-
}), e.appendChild(i);
|
|
21
|
-
}
|
|
22
|
-
let o = a.get(r), s = document.createElement("span");
|
|
23
|
-
s.textContent = n.text;
|
|
24
|
-
let c = i ? n.hyperlink : void 0;
|
|
25
|
-
s.style.cssText = `position:absolute;left:${n.inShapeX}px;top:${n.inShapeY}px;font:${n.font};line-height:${n.h}px;letter-spacing:0;white-space:pre;color:transparent;cursor:${c ? "pointer" : "text"};`, c && i && (s.title = c.kind === "external" ? c.url : c.ref, s.addEventListener("click", (e) => {
|
|
26
|
-
e.preventDefault(), i(c);
|
|
27
|
-
})), o.div.appendChild(s);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
1
|
+
import { At as e, B as t, Bt as n, C as r, E as i, Ft as a, G as o, H as s, Ht as c, I as l, It as u, J as d, Jt as f, K as p, L as m, Lt as h, M as g, Mt as _, N as v, Nt as y, O as b, Pt as x, Q as S, S as C, T as w, Tt as T, U as E, Ut as D, V as O, W as k, X as A, Xt as j, Yt as M, Z as N, _ as P, _t as F, at as I, b as L, bt as R, c as z, ct as B, d as V, dt as H, f as U, ft as W, gt as ee, h as te, ht as ne, i as re, it as ie, j as ae, kt as G, l as oe, lt as se, m as ce, mt as le, n as ue, nt as de, o as fe, ot as pe, p as me, pt as he, q as ge, qt as _e, r as ve, s as ye, st as be, t as xe, tt as Se, u as Ce, ut as we, v as Te, vt as Ee, w as De, x as Oe, xt as ke, y as Ae, z as je, zt as Me } from "./find-cursor-DTrEBxjE.js";
|
|
2
|
+
import { a as Ne, c as Pe, d as Fe, f as Ie, i as Le, l as Re, n as ze, o as Be, p as Ve, r as He, s as Ue, t as K, u as We } from "./highlight-rect-B--cPQOV.js";
|
|
3
|
+
import { a as Ge, i as Ke, n as qe, r as Je, t as Ye } from "./visible-index-5hdq_oAL.js";
|
|
4
|
+
import { t as Xe } from "./mathjax-Dk_JzbFj.js";
|
|
31
5
|
//#region packages/core/src/shape/custgeom-endpoints.ts
|
|
32
|
-
var
|
|
33
|
-
function
|
|
6
|
+
var q = 1e-9;
|
|
7
|
+
function Ze(e) {
|
|
34
8
|
return e.cmd === "lineTo" || e.cmd === "cubicBezTo" || e.cmd === "arcTo";
|
|
35
9
|
}
|
|
36
|
-
function
|
|
10
|
+
function Qe(e, t, n, r) {
|
|
37
11
|
let i = n === 0 ? 0 : n, a = r === 0 ? 0 : r;
|
|
38
12
|
return {
|
|
39
13
|
x: e,
|
|
@@ -43,7 +17,7 @@ function Fe(e, t, n, r) {
|
|
|
43
17
|
angle: Math.atan2(a, i)
|
|
44
18
|
};
|
|
45
19
|
}
|
|
46
|
-
function
|
|
20
|
+
function $e(e, t, n) {
|
|
47
21
|
switch (n.cmd) {
|
|
48
22
|
case "lineTo": return {
|
|
49
23
|
dx: n.x - e,
|
|
@@ -51,7 +25,7 @@ function Ie(e, t, n) {
|
|
|
51
25
|
};
|
|
52
26
|
case "cubicBezTo": {
|
|
53
27
|
let r = n.x1 - e, i = n.y1 - t;
|
|
54
|
-
return Math.abs(r) <
|
|
28
|
+
return Math.abs(r) < q && Math.abs(i) < q && (r = n.x2 - e, i = n.y2 - t), Math.abs(r) < q && Math.abs(i) < q && (r = n.x - e, i = n.y - t), {
|
|
55
29
|
dx: r,
|
|
56
30
|
dy: i
|
|
57
31
|
};
|
|
@@ -69,7 +43,7 @@ function Ie(e, t, n) {
|
|
|
69
43
|
};
|
|
70
44
|
}
|
|
71
45
|
}
|
|
72
|
-
function
|
|
46
|
+
function et(e, t, n) {
|
|
73
47
|
switch (n.cmd) {
|
|
74
48
|
case "moveTo":
|
|
75
49
|
case "lineTo":
|
|
@@ -94,8 +68,8 @@ function Le(e, t, n) {
|
|
|
94
68
|
};
|
|
95
69
|
}
|
|
96
70
|
}
|
|
97
|
-
function
|
|
98
|
-
let { x: r, y: i } =
|
|
71
|
+
function tt(e, t, n) {
|
|
72
|
+
let { x: r, y: i } = et(e, t, n);
|
|
99
73
|
switch (n.cmd) {
|
|
100
74
|
case "lineTo": return {
|
|
101
75
|
dx: n.x - e,
|
|
@@ -105,7 +79,7 @@ function Re(e, t, n) {
|
|
|
105
79
|
};
|
|
106
80
|
case "cubicBezTo": {
|
|
107
81
|
let a = n.x - n.x2, o = n.y - n.y2;
|
|
108
|
-
return Math.abs(a) <
|
|
82
|
+
return Math.abs(a) < q && Math.abs(o) < q && (a = n.x - n.x1, o = n.y - n.y1), Math.abs(a) < q && Math.abs(o) < q && (a = n.x - e, o = n.y - t), {
|
|
109
83
|
dx: a,
|
|
110
84
|
dy: o,
|
|
111
85
|
x: r,
|
|
@@ -135,78 +109,48 @@ function Re(e, t, n) {
|
|
|
135
109
|
};
|
|
136
110
|
}
|
|
137
111
|
}
|
|
138
|
-
function
|
|
112
|
+
function nt(e) {
|
|
139
113
|
let t = 0, n = 0, r = !1;
|
|
140
|
-
for (let i of e) i.cmd === "moveTo" && (r = !0), {x: t, y: n} =
|
|
114
|
+
for (let i of e) i.cmd === "moveTo" && (r = !0), {x: t, y: n} = et(t, n, i);
|
|
141
115
|
return r ? {
|
|
142
116
|
x: t,
|
|
143
117
|
y: n
|
|
144
118
|
} : null;
|
|
145
119
|
}
|
|
146
|
-
function
|
|
120
|
+
function rt(e) {
|
|
147
121
|
if (e.some((e) => e.cmd === "close")) return !0;
|
|
148
122
|
let t = e.find((e) => e.cmd === "moveTo");
|
|
149
123
|
if (!t) return !1;
|
|
150
|
-
let n =
|
|
151
|
-
return !n || !e.some(
|
|
124
|
+
let n = nt(e);
|
|
125
|
+
return !n || !e.some(Ze) ? !1 : Math.abs(n.x - t.x) < q && Math.abs(n.y - t.y) < q;
|
|
152
126
|
}
|
|
153
|
-
function
|
|
127
|
+
function it(e) {
|
|
154
128
|
let t = {
|
|
155
129
|
start: null,
|
|
156
130
|
end: null
|
|
157
131
|
};
|
|
158
132
|
if (!e || e.length === 0) return t;
|
|
159
133
|
let n = e[0];
|
|
160
|
-
if (n && n.length > 0 && !
|
|
161
|
-
let e = n.find((e) => e.cmd === "moveTo"), r = n.find(
|
|
134
|
+
if (n && n.length > 0 && !rt(n)) {
|
|
135
|
+
let e = n.find((e) => e.cmd === "moveTo"), r = n.find(Ze);
|
|
162
136
|
if (e && r) {
|
|
163
|
-
let n =
|
|
164
|
-
(Math.abs(n.dx) >
|
|
137
|
+
let n = $e(e.x, e.y, r);
|
|
138
|
+
(Math.abs(n.dx) > q || Math.abs(n.dy) > q) && (t.start = Qe(e.x, e.y, -n.dx, -n.dy));
|
|
165
139
|
}
|
|
166
140
|
}
|
|
167
141
|
let r = e[e.length - 1];
|
|
168
|
-
if (r && r.length > 0 && !
|
|
142
|
+
if (r && r.length > 0 && !rt(r)) {
|
|
169
143
|
let e = 0, n = 0, i = -1;
|
|
170
|
-
for (let e = 0; e < r.length; e++)
|
|
144
|
+
for (let e = 0; e < r.length; e++) Ze(r[e]) && (i = e);
|
|
171
145
|
if (i >= 0) {
|
|
172
|
-
for (let t = 0; t < i; t++) ({x: e, y: n} =
|
|
173
|
-
let a =
|
|
174
|
-
(Math.abs(a.dx) >
|
|
146
|
+
for (let t = 0; t < i; t++) ({x: e, y: n} = et(e, n, r[t]));
|
|
147
|
+
let a = tt(e, n, r[i]);
|
|
148
|
+
(Math.abs(a.dx) > q || Math.abs(a.dy) > q) && (t.end = Qe(a.x, a.y, a.dx, a.dy));
|
|
175
149
|
}
|
|
176
150
|
}
|
|
177
151
|
return t;
|
|
178
152
|
}
|
|
179
|
-
|
|
180
|
-
//#region packages/core/src/image/duotone-bitmap-by-path.ts
|
|
181
|
-
function He(e, t) {
|
|
182
|
-
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
183
|
-
}
|
|
184
|
-
var Ue = /* @__PURE__ */ new WeakMap();
|
|
185
|
-
function We(e) {
|
|
186
|
-
let t = Ue.get(e);
|
|
187
|
-
return t || (t = /* @__PURE__ */ new Map(), Ue.set(e, t)), t;
|
|
188
|
-
}
|
|
189
|
-
async function Ge(e, t, n, r, i = {}) {
|
|
190
|
-
let { offscreenFactory: a, ...o } = i, c = await Ee(e, t, r, o);
|
|
191
|
-
if (!n || !c) return c;
|
|
192
|
-
let l = We(r), u = He(e, n), d = l.get(u);
|
|
193
|
-
return d || (d = (async () => {
|
|
194
|
-
let { w: e, h: t } = s(c);
|
|
195
|
-
return e <= 0 || t <= 0 ? c : await p(c, n, {
|
|
196
|
-
width: e,
|
|
197
|
-
height: t,
|
|
198
|
-
offscreenFactory: a
|
|
199
|
-
});
|
|
200
|
-
})(), d.catch(() => l.delete(u)), l.set(u, d)), d;
|
|
201
|
-
}
|
|
202
|
-
function Ke(e) {
|
|
203
|
-
let t = Ue.get(e);
|
|
204
|
-
if (t) {
|
|
205
|
-
for (let e of t.values()) e.then((e) => e?.close()).catch(() => {});
|
|
206
|
-
t.clear(), Ue.delete(e);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
var qe = {
|
|
153
|
+
var at = {
|
|
210
154
|
textarchdown: {
|
|
211
155
|
adj: [["adj", "val 0"]],
|
|
212
156
|
gd: [
|
|
@@ -2588,22 +2532,22 @@ var qe = {
|
|
|
2588
2532
|
]
|
|
2589
2533
|
}]
|
|
2590
2534
|
}
|
|
2591
|
-
},
|
|
2592
|
-
function
|
|
2593
|
-
return e.toLowerCase() in
|
|
2535
|
+
}, ot = Math.PI * 2 / 216e5, st = at, ct = /* @__PURE__ */ new Map();
|
|
2536
|
+
function lt(e) {
|
|
2537
|
+
return e.toLowerCase() in st;
|
|
2594
2538
|
}
|
|
2595
|
-
function
|
|
2596
|
-
let t =
|
|
2539
|
+
function ut(e) {
|
|
2540
|
+
let t = ct.get(e);
|
|
2597
2541
|
if (t) return t;
|
|
2598
|
-
let n =
|
|
2542
|
+
let n = st[e];
|
|
2599
2543
|
return n ? (t = {
|
|
2600
|
-
adj: n.adj.map(([e, t]) => [e,
|
|
2601
|
-
gd: n.gd.map(([e, t]) => [e,
|
|
2544
|
+
adj: n.adj.map(([e, t]) => [e, le(t)]),
|
|
2545
|
+
gd: n.gd.map(([e, t]) => [e, le(t)]),
|
|
2602
2546
|
paths: n.paths
|
|
2603
|
-
},
|
|
2547
|
+
}, ct.set(e, t), t) : null;
|
|
2604
2548
|
}
|
|
2605
|
-
var
|
|
2606
|
-
function
|
|
2549
|
+
var dt = 48;
|
|
2550
|
+
function ft(e, t, n, r) {
|
|
2607
2551
|
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;
|
|
2608
2552
|
for (let n of e.cmds) switch (n[0]) {
|
|
2609
2553
|
case "m":
|
|
@@ -2620,8 +2564,8 @@ function et(e, t, n, r) {
|
|
|
2620
2564
|
break;
|
|
2621
2565
|
case "C": {
|
|
2622
2566
|
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]));
|
|
2623
|
-
for (let t = 1; t <=
|
|
2624
|
-
let n = t /
|
|
2567
|
+
for (let t = 1; t <= dt; t++) {
|
|
2568
|
+
let n = t / dt, 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;
|
|
2625
2569
|
c.push({
|
|
2626
2570
|
x: s,
|
|
2627
2571
|
y: p
|
|
@@ -2632,8 +2576,8 @@ function et(e, t, n, r) {
|
|
|
2632
2576
|
}
|
|
2633
2577
|
case "Q": {
|
|
2634
2578
|
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]));
|
|
2635
|
-
for (let t = 1; t <=
|
|
2636
|
-
let n = t /
|
|
2579
|
+
for (let t = 1; t <= dt; t++) {
|
|
2580
|
+
let n = t / dt, 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;
|
|
2637
2581
|
c.push({
|
|
2638
2582
|
x: s,
|
|
2639
2583
|
y: d
|
|
@@ -2643,9 +2587,9 @@ function et(e, t, n, r) {
|
|
|
2643
2587
|
break;
|
|
2644
2588
|
}
|
|
2645
2589
|
case "a": {
|
|
2646
|
-
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) *
|
|
2590
|
+
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * ot, f = t.resolve(n[4]) * ot, 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;
|
|
2647
2591
|
_ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
|
|
2648
|
-
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(
|
|
2592
|
+
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(dt, Math.ceil(Math.abs(y) / m * 96));
|
|
2649
2593
|
for (let e = 1; e <= S; e++) {
|
|
2650
2594
|
let t = h + y * e / S;
|
|
2651
2595
|
c.push({
|
|
@@ -2660,7 +2604,7 @@ function et(e, t, n, r) {
|
|
|
2660
2604
|
}
|
|
2661
2605
|
return c;
|
|
2662
2606
|
}
|
|
2663
|
-
function
|
|
2607
|
+
function pt(e) {
|
|
2664
2608
|
let t = [0];
|
|
2665
2609
|
for (let n = 1; n < e.length; n++) {
|
|
2666
2610
|
let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
|
|
@@ -2668,23 +2612,23 @@ function tt(e) {
|
|
|
2668
2612
|
}
|
|
2669
2613
|
return t;
|
|
2670
2614
|
}
|
|
2671
|
-
function
|
|
2672
|
-
let i =
|
|
2615
|
+
function mt(e, t, n, r) {
|
|
2616
|
+
let i = ut(e.toLowerCase());
|
|
2673
2617
|
if (!i || i.paths.length === 0) return null;
|
|
2674
|
-
let a =
|
|
2618
|
+
let a = ne({
|
|
2675
2619
|
w: n,
|
|
2676
2620
|
h: r,
|
|
2677
2621
|
adj: t
|
|
2678
|
-
}, i.adj, i.gd), o = i.paths.length === 1, s =
|
|
2622
|
+
}, i.adj, i.gd), o = i.paths.length === 1, s = ft(i.paths[0], a, n, r), c = o ? s : ft(i.paths[i.paths.length - 1], a, n, r);
|
|
2679
2623
|
return {
|
|
2680
2624
|
top: s,
|
|
2681
2625
|
bottom: c,
|
|
2682
|
-
topLen:
|
|
2683
|
-
bottomLen:
|
|
2626
|
+
topLen: pt(s),
|
|
2627
|
+
bottomLen: pt(c),
|
|
2684
2628
|
singleEdge: o
|
|
2685
2629
|
};
|
|
2686
2630
|
}
|
|
2687
|
-
function
|
|
2631
|
+
function ht(e, t, n) {
|
|
2688
2632
|
let r = t[t.length - 1];
|
|
2689
2633
|
if (e.length === 1 || r === 0) return {
|
|
2690
2634
|
x: e[0].x,
|
|
@@ -2705,17 +2649,17 @@ function rt(e, t, n) {
|
|
|
2705
2649
|
ty: f / p
|
|
2706
2650
|
};
|
|
2707
2651
|
}
|
|
2708
|
-
function
|
|
2652
|
+
function gt(e) {
|
|
2709
2653
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2710
2654
|
}
|
|
2711
|
-
function
|
|
2655
|
+
function _t(e, t) {
|
|
2712
2656
|
if (!e.singleEdge) return 1;
|
|
2713
|
-
let n =
|
|
2657
|
+
let n = gt(e);
|
|
2714
2658
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2715
2659
|
}
|
|
2716
|
-
function
|
|
2660
|
+
function vt(e, t, n, r) {
|
|
2717
2661
|
if (e.singleEdge) {
|
|
2718
|
-
let i =
|
|
2662
|
+
let i = ht(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2719
2663
|
return {
|
|
2720
2664
|
x: i.x - o * c,
|
|
2721
2665
|
y: i.y - s * c,
|
|
@@ -2724,7 +2668,7 @@ function ot(e, t, n, r) {
|
|
|
2724
2668
|
shear: 0
|
|
2725
2669
|
};
|
|
2726
2670
|
}
|
|
2727
|
-
let i =
|
|
2671
|
+
let i = ht(e.top, e.topLen, t), a = ht(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);
|
|
2728
2672
|
return {
|
|
2729
2673
|
x: c,
|
|
2730
2674
|
y: l,
|
|
@@ -2735,13 +2679,13 @@ function ot(e, t, n, r) {
|
|
|
2735
2679
|
}
|
|
2736
2680
|
//#endregion
|
|
2737
2681
|
//#region packages/core/src/shape/effects.ts
|
|
2738
|
-
function
|
|
2682
|
+
function yt(e, t) {
|
|
2739
2683
|
return e * t;
|
|
2740
2684
|
}
|
|
2741
|
-
function
|
|
2685
|
+
function bt(e) {
|
|
2742
2686
|
return e.getContext("2d") ?? null;
|
|
2743
2687
|
}
|
|
2744
|
-
function
|
|
2688
|
+
function xt(e, t, n, r) {
|
|
2745
2689
|
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));
|
|
2746
2690
|
return {
|
|
2747
2691
|
x: i,
|
|
@@ -2750,7 +2694,7 @@ function lt(e, t, n, r) {
|
|
|
2750
2694
|
h: Math.max(1, s - a)
|
|
2751
2695
|
};
|
|
2752
2696
|
}
|
|
2753
|
-
function
|
|
2697
|
+
function St(e, t) {
|
|
2754
2698
|
if (t.x === 0 && t.y === 0) return e;
|
|
2755
2699
|
let n = t.x, r = t.y;
|
|
2756
2700
|
return new Proxy(e, {
|
|
@@ -2766,58 +2710,58 @@ function ut(e, t) {
|
|
|
2766
2710
|
}
|
|
2767
2711
|
});
|
|
2768
2712
|
}
|
|
2769
|
-
function
|
|
2770
|
-
let s =
|
|
2713
|
+
function Ct(e, t, n, r, i, a, o) {
|
|
2714
|
+
let s = yt(r.blur, i), c = yt(r.dist, i), l = r.dir * Math.PI / 180, u = Math.cos(l) * c, d = Math.sin(l) * c, f = xt(n, Math.ceil(3 * s + Math.abs(c)) + 2, a, o), p = T(f.w, f.h);
|
|
2771
2715
|
if (!p) return;
|
|
2772
|
-
let m =
|
|
2716
|
+
let m = bt(p);
|
|
2773
2717
|
if (!m) return;
|
|
2774
|
-
let h =
|
|
2775
|
-
h.save(), h.fillStyle =
|
|
2718
|
+
let h = St(m, f);
|
|
2719
|
+
h.save(), h.fillStyle = R(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();
|
|
2776
2720
|
}
|
|
2777
|
-
function
|
|
2778
|
-
let c =
|
|
2721
|
+
function wt(e, t, n, r, i, a, o, s) {
|
|
2722
|
+
let c = yt(r.radius, i);
|
|
2779
2723
|
if (c <= 0) {
|
|
2780
2724
|
t(e);
|
|
2781
2725
|
return;
|
|
2782
2726
|
}
|
|
2783
|
-
let l =
|
|
2727
|
+
let l = xt(n, Math.ceil(c) + 2, a, o), u = n.x - l.x, d = n.y - l.y, f = T(l.w, l.h);
|
|
2784
2728
|
if (!f) {
|
|
2785
2729
|
t(e);
|
|
2786
2730
|
return;
|
|
2787
2731
|
}
|
|
2788
|
-
let p =
|
|
2732
|
+
let p = bt(f);
|
|
2789
2733
|
if (!p) {
|
|
2790
2734
|
t(e);
|
|
2791
2735
|
return;
|
|
2792
2736
|
}
|
|
2793
|
-
let m =
|
|
2737
|
+
let m = St(p, l), h = s ?? t;
|
|
2794
2738
|
t(m);
|
|
2795
|
-
let g =
|
|
2739
|
+
let g = T(l.w, l.h), _ = T(l.w, l.h), v = g ? bt(g) : null, y = _ ? bt(_) : null;
|
|
2796
2740
|
if (g && v && _ && y) {
|
|
2797
|
-
let t =
|
|
2741
|
+
let t = St(v, l);
|
|
2798
2742
|
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();
|
|
2799
2743
|
return;
|
|
2800
2744
|
}
|
|
2801
2745
|
e.save(), e.drawImage(f, 0, 0), e.restore();
|
|
2802
2746
|
}
|
|
2803
|
-
function
|
|
2804
|
-
let s =
|
|
2747
|
+
function Tt(e, t, n, r, i, a, o) {
|
|
2748
|
+
let s = T(a, o);
|
|
2805
2749
|
if (!s) return;
|
|
2806
|
-
let c =
|
|
2750
|
+
let c = bt(s);
|
|
2807
2751
|
if (!c) return;
|
|
2808
|
-
let l =
|
|
2752
|
+
let l = yt(r.blur, i);
|
|
2809
2753
|
c.save(), l > 0 && (c.filter = `blur(${l}px)`), t(c), c.restore(), c.save(), c.globalCompositeOperation = "destination-in";
|
|
2810
|
-
let u = n.y, d = n.y + n.h, f = c.createLinearGradient(0, d, 0, u), p =
|
|
2754
|
+
let u = n.y, d = n.y + n.h, f = c.createLinearGradient(0, d, 0, u), p = Et(r.stPos), m = Et(r.endPos);
|
|
2811
2755
|
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();
|
|
2812
|
-
let h =
|
|
2756
|
+
let h = yt(r.dist, i), g = r.dir * Math.PI / 180, _ = Math.cos(g) * h, v = Math.sin(g) * h;
|
|
2813
2757
|
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();
|
|
2814
2758
|
}
|
|
2815
|
-
function
|
|
2759
|
+
function Et(e) {
|
|
2816
2760
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2817
2761
|
}
|
|
2818
2762
|
//#endregion
|
|
2819
2763
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2820
|
-
var
|
|
2764
|
+
var J = 26, Dt = {
|
|
2821
2765
|
orthographicFront: {
|
|
2822
2766
|
kind: "orthographic",
|
|
2823
2767
|
baseLat: 0,
|
|
@@ -2830,52 +2774,52 @@ var Y = 26, ht = {
|
|
|
2830
2774
|
baseLat: 0,
|
|
2831
2775
|
baseLon: 0,
|
|
2832
2776
|
baseRev: 0,
|
|
2833
|
-
fovDeg:
|
|
2777
|
+
fovDeg: J
|
|
2834
2778
|
},
|
|
2835
2779
|
perspectiveRelaxed: {
|
|
2836
2780
|
kind: "perspective",
|
|
2837
2781
|
baseLat: 0,
|
|
2838
2782
|
baseLon: 0,
|
|
2839
2783
|
baseRev: 0,
|
|
2840
|
-
fovDeg:
|
|
2784
|
+
fovDeg: J
|
|
2841
2785
|
},
|
|
2842
2786
|
perspectiveRelaxedModerately: {
|
|
2843
2787
|
kind: "perspective",
|
|
2844
2788
|
baseLat: 0,
|
|
2845
2789
|
baseLon: 0,
|
|
2846
2790
|
baseRev: 0,
|
|
2847
|
-
fovDeg:
|
|
2791
|
+
fovDeg: J
|
|
2848
2792
|
},
|
|
2849
2793
|
perspectiveAbove: {
|
|
2850
2794
|
kind: "perspective",
|
|
2851
2795
|
baseLat: -20,
|
|
2852
2796
|
baseLon: 0,
|
|
2853
2797
|
baseRev: 0,
|
|
2854
|
-
fovDeg:
|
|
2798
|
+
fovDeg: J
|
|
2855
2799
|
},
|
|
2856
2800
|
perspectiveBelow: {
|
|
2857
2801
|
kind: "perspective",
|
|
2858
2802
|
baseLat: 20,
|
|
2859
2803
|
baseLon: 0,
|
|
2860
2804
|
baseRev: 0,
|
|
2861
|
-
fovDeg:
|
|
2805
|
+
fovDeg: J
|
|
2862
2806
|
},
|
|
2863
2807
|
perspectiveLeft: {
|
|
2864
2808
|
kind: "perspective",
|
|
2865
2809
|
baseLat: 0,
|
|
2866
2810
|
baseLon: -20,
|
|
2867
2811
|
baseRev: 0,
|
|
2868
|
-
fovDeg:
|
|
2812
|
+
fovDeg: J
|
|
2869
2813
|
},
|
|
2870
2814
|
perspectiveRight: {
|
|
2871
2815
|
kind: "perspective",
|
|
2872
2816
|
baseLat: 0,
|
|
2873
2817
|
baseLon: 20,
|
|
2874
2818
|
baseRev: 0,
|
|
2875
|
-
fovDeg:
|
|
2819
|
+
fovDeg: J
|
|
2876
2820
|
}
|
|
2877
2821
|
};
|
|
2878
|
-
function
|
|
2822
|
+
function Ot(e, t) {
|
|
2879
2823
|
let n = Array(9).fill(0);
|
|
2880
2824
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
2881
2825
|
let a = 0;
|
|
@@ -2884,7 +2828,7 @@ function gt(e, t) {
|
|
|
2884
2828
|
}
|
|
2885
2829
|
return n;
|
|
2886
2830
|
}
|
|
2887
|
-
function
|
|
2831
|
+
function kt(e) {
|
|
2888
2832
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2889
2833
|
return [
|
|
2890
2834
|
1,
|
|
@@ -2898,7 +2842,7 @@ function _t(e) {
|
|
|
2898
2842
|
n
|
|
2899
2843
|
];
|
|
2900
2844
|
}
|
|
2901
|
-
function
|
|
2845
|
+
function At(e) {
|
|
2902
2846
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2903
2847
|
return [
|
|
2904
2848
|
n,
|
|
@@ -2912,7 +2856,7 @@ function vt(e) {
|
|
|
2912
2856
|
n
|
|
2913
2857
|
];
|
|
2914
2858
|
}
|
|
2915
|
-
function
|
|
2859
|
+
function jt(e) {
|
|
2916
2860
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2917
2861
|
return [
|
|
2918
2862
|
n,
|
|
@@ -2926,22 +2870,22 @@ function yt(e) {
|
|
|
2926
2870
|
1
|
|
2927
2871
|
];
|
|
2928
2872
|
}
|
|
2929
|
-
function
|
|
2873
|
+
function Mt(e, t, n, r) {
|
|
2930
2874
|
return [
|
|
2931
2875
|
e[0] * t + e[1] * n + e[2] * r,
|
|
2932
2876
|
e[3] * t + e[4] * n + e[5] * r,
|
|
2933
2877
|
e[6] * t + e[7] * n + e[8] * r
|
|
2934
2878
|
];
|
|
2935
2879
|
}
|
|
2936
|
-
function
|
|
2880
|
+
function Nt(e, t) {
|
|
2937
2881
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2938
|
-
return
|
|
2882
|
+
return Ot(jt(-(t ? t.rev : e.baseRev)), Ot(kt(-n), At(-r)));
|
|
2939
2883
|
}
|
|
2940
|
-
function
|
|
2941
|
-
return
|
|
2884
|
+
function Pt(e) {
|
|
2885
|
+
return Dt[e] ?? Dt.orthographicFront;
|
|
2942
2886
|
}
|
|
2943
|
-
function
|
|
2944
|
-
let r =
|
|
2887
|
+
function Ft(e, t, n) {
|
|
2888
|
+
let r = Pt(e.prst), i = Nt(r, e.rot);
|
|
2945
2889
|
if (t <= 0 || n <= 0) return {
|
|
2946
2890
|
corners: [
|
|
2947
2891
|
{
|
|
@@ -2973,11 +2917,11 @@ function Ct(e, t, n) {
|
|
|
2973
2917
|
if (r.kind === "perspective") {
|
|
2974
2918
|
let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
|
|
2975
2919
|
u = s.map(([e, t]) => {
|
|
2976
|
-
let [n, r, o] =
|
|
2920
|
+
let [n, r, o] = Mt(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
|
|
2977
2921
|
return [n * c, r * c];
|
|
2978
2922
|
});
|
|
2979
2923
|
} else u = s.map(([e, t]) => {
|
|
2980
|
-
let [n, r] =
|
|
2924
|
+
let [n, r] = Mt(i, e, t, 0);
|
|
2981
2925
|
return [n, r];
|
|
2982
2926
|
});
|
|
2983
2927
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
@@ -3002,18 +2946,18 @@ function Ct(e, t, n) {
|
|
|
3002
2946
|
isIdentity: E
|
|
3003
2947
|
};
|
|
3004
2948
|
}
|
|
3005
|
-
function
|
|
3006
|
-
let { isIdentity: t } =
|
|
2949
|
+
function It(e) {
|
|
2950
|
+
let { isIdentity: t } = Ft(e, 1e3, 1e3);
|
|
3007
2951
|
return !t;
|
|
3008
2952
|
}
|
|
3009
|
-
function
|
|
3010
|
-
let i =
|
|
2953
|
+
function Lt(e, t, n, r) {
|
|
2954
|
+
let i = Pt(e.prst), a = Nt(i, e.rot);
|
|
3011
2955
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
3012
2956
|
x: 0,
|
|
3013
2957
|
y: 0
|
|
3014
2958
|
};
|
|
3015
2959
|
let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
|
|
3016
|
-
let [n, r, o] =
|
|
2960
|
+
let [n, r, o] = Mt(a, 0, 0, t);
|
|
3017
2961
|
if (i.kind === "perspective") {
|
|
3018
2962
|
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);
|
|
3019
2963
|
return [n * d * l, r * d * l];
|
|
@@ -3027,7 +2971,7 @@ function Tt(e, t, n, r) {
|
|
|
3027
2971
|
}
|
|
3028
2972
|
//#endregion
|
|
3029
2973
|
//#region packages/core/src/shape/scene3d-draw.ts
|
|
3030
|
-
function
|
|
2974
|
+
function Rt(e, t, n, r) {
|
|
3031
2975
|
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;
|
|
3032
2976
|
if (Math.abs(m) < 1e-12 && Math.abs(_) < 1e-12) v = 0, y = 0;
|
|
3033
2977
|
else {
|
|
@@ -3047,15 +2991,15 @@ function Et(e, t, n, r) {
|
|
|
3047
2991
|
1
|
|
3048
2992
|
];
|
|
3049
2993
|
}
|
|
3050
|
-
function
|
|
2994
|
+
function zt(e, t, n) {
|
|
3051
2995
|
let r = e[6] * t + e[7] * n + e[8];
|
|
3052
2996
|
return {
|
|
3053
2997
|
x: (e[0] * t + e[1] * n + e[2]) / r,
|
|
3054
2998
|
y: (e[3] * t + e[4] * n + e[5]) / r
|
|
3055
2999
|
};
|
|
3056
3000
|
}
|
|
3057
|
-
var
|
|
3058
|
-
function
|
|
3001
|
+
var Bt = 1;
|
|
3002
|
+
function Vt(e, t) {
|
|
3059
3003
|
let [n, r, i, a, o, s] = e, [c, l, u, d, f, p] = t;
|
|
3060
3004
|
return [
|
|
3061
3005
|
n * c + i * l,
|
|
@@ -3066,13 +3010,13 @@ function kt(e, t) {
|
|
|
3066
3010
|
r * f + a * p + s
|
|
3067
3011
|
];
|
|
3068
3012
|
}
|
|
3069
|
-
function
|
|
3013
|
+
function Ht(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
3070
3014
|
let p = c - o, m = l - s;
|
|
3071
3015
|
if (p <= 0 || m <= 0) return;
|
|
3072
|
-
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 =
|
|
3016
|
+
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 = Bt * p / y, S = Bt * 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;
|
|
3073
3017
|
if (D <= 0 || O <= 0) return;
|
|
3074
3018
|
e.save();
|
|
3075
|
-
let [k, A, j, M, N, P] =
|
|
3019
|
+
let [k, A, j, M, N, P] = Vt(i, [
|
|
3076
3020
|
h,
|
|
3077
3021
|
g,
|
|
3078
3022
|
_,
|
|
@@ -3082,22 +3026,22 @@ function At(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
3082
3026
|
]);
|
|
3083
3027
|
e.setTransform(k, A, j, M, N, P), e.drawImage(t, C, w, D, O, C, w, D, O), e.restore();
|
|
3084
3028
|
}
|
|
3085
|
-
function
|
|
3086
|
-
let p =
|
|
3029
|
+
function Ut(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
3030
|
+
let p = zt(o, s, c), m = zt(o, l, c), h = zt(o, s, u), g = zt(o, l, u), _ = (s + l) / 2, v = (c + u) / 2, y = zt(o, _, v), b = {
|
|
3087
3031
|
x: (p.x + m.x + h.x + g.x) / 4,
|
|
3088
3032
|
y: (p.y + m.y + h.y + g.y) / 4
|
|
3089
|
-
}, x =
|
|
3033
|
+
}, x = Gt(i), S = Math.hypot(y.x - b.x, y.y - b.y) * x;
|
|
3090
3034
|
if (f <= 0 || S <= d) {
|
|
3091
|
-
|
|
3035
|
+
Ht(e, t, n, r, i, a, s * n, c * r, l * n, u * r, p, m, h);
|
|
3092
3036
|
return;
|
|
3093
3037
|
}
|
|
3094
|
-
l - s >= u - c ? (
|
|
3038
|
+
l - s >= u - c ? (Ut(e, t, n, r, i, a, o, s, c, _, u, d, f - 1), Ut(e, t, n, r, i, a, o, _, c, l, u, d, f - 1)) : (Ut(e, t, n, r, i, a, o, s, c, l, v, d, f - 1), Ut(e, t, n, r, i, a, o, s, v, l, u, d, f - 1));
|
|
3095
3039
|
}
|
|
3096
|
-
function
|
|
3040
|
+
function Wt(e, t, n, r, i, a = .5) {
|
|
3097
3041
|
if (n <= 0 || r <= 0) return;
|
|
3098
3042
|
let [o, s, c, l] = i;
|
|
3099
3043
|
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;
|
|
3100
|
-
let u =
|
|
3044
|
+
let u = Rt(i[0], i[1], i[2], i[3]);
|
|
3101
3045
|
if (!u) return;
|
|
3102
3046
|
let d = t.getTransform(), f = [
|
|
3103
3047
|
d.a,
|
|
@@ -3106,14 +3050,14 @@ function Mt(e, t, n, r, i, a = .5) {
|
|
|
3106
3050
|
d.d,
|
|
3107
3051
|
d.e,
|
|
3108
3052
|
d.f
|
|
3109
|
-
], p =
|
|
3110
|
-
|
|
3053
|
+
], p = Gt(f);
|
|
3054
|
+
Xt(e, t, n, r, i, f, p, u, a, 14) || (Jt(), 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(), Ut(t, e, n, r, f, p, u, 0, 0, 1, 1, a, 14), t.restore());
|
|
3111
3055
|
}
|
|
3112
|
-
function
|
|
3056
|
+
function Gt(e) {
|
|
3113
3057
|
return Math.sqrt(Math.abs(e[0] * e[3] - e[1] * e[2])) || 1;
|
|
3114
3058
|
}
|
|
3115
|
-
function
|
|
3116
|
-
let r =
|
|
3059
|
+
function Kt(e, t, n) {
|
|
3060
|
+
let r = Rt(e[0], e[1], e[2], e[3]);
|
|
3117
3061
|
if (!r) return null;
|
|
3118
3062
|
let i = [
|
|
3119
3063
|
[-t, -n],
|
|
@@ -3123,16 +3067,16 @@ function Pt(e, t, n) {
|
|
|
3123
3067
|
], a = [];
|
|
3124
3068
|
for (let [e, t] of i) {
|
|
3125
3069
|
if (!(r[6] * e + r[7] * t + r[8] > 1e-9)) return null;
|
|
3126
|
-
a.push(
|
|
3070
|
+
a.push(zt(r, e, t));
|
|
3127
3071
|
}
|
|
3128
3072
|
return a;
|
|
3129
3073
|
}
|
|
3130
|
-
var
|
|
3131
|
-
function
|
|
3132
|
-
|
|
3074
|
+
var qt = !1;
|
|
3075
|
+
function Jt() {
|
|
3076
|
+
qt || (qt = !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."));
|
|
3133
3077
|
}
|
|
3134
|
-
var
|
|
3135
|
-
function
|
|
3078
|
+
var Yt = 2;
|
|
3079
|
+
function Xt(e, t, n, r, i, a, o, s, c, l) {
|
|
3136
3080
|
let u = i.map((e) => ({
|
|
3137
3081
|
x: a[0] * e.x + a[2] * e.y + a[4],
|
|
3138
3082
|
y: a[1] * e.x + a[3] * e.y + a[5]
|
|
@@ -3141,11 +3085,11 @@ function Rt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3141
3085
|
d = Math.floor(d) - 1, f = Math.floor(f) - 1, p = Math.ceil(p) + 1, m = Math.ceil(m) + 1;
|
|
3142
3086
|
let h = p - d, g = m - f;
|
|
3143
3087
|
if (h <= 0 || g <= 0) return !1;
|
|
3144
|
-
let _ = Math.max(1, Math.ceil(h *
|
|
3088
|
+
let _ = Math.max(1, Math.ceil(h * Yt)), v = Math.max(1, Math.ceil(g * Yt)), y = T(_, v);
|
|
3145
3089
|
if (!y || y.width !== _ || y.height !== v) return !1;
|
|
3146
3090
|
let b = y.getContext("2d") ?? null;
|
|
3147
3091
|
if (!b) return !1;
|
|
3148
|
-
let x =
|
|
3092
|
+
let x = Yt, S = [
|
|
3149
3093
|
a[0] * x,
|
|
3150
3094
|
a[1] * x,
|
|
3151
3095
|
a[2] * x,
|
|
@@ -3153,18 +3097,18 @@ function Rt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3153
3097
|
(a[4] - d) * x,
|
|
3154
3098
|
(a[5] - f) * x
|
|
3155
3099
|
];
|
|
3156
|
-
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(),
|
|
3100
|
+
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(), Ut(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);
|
|
3157
3101
|
let C = t.imageSmoothingEnabled, w = t.imageSmoothingQuality;
|
|
3158
3102
|
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;
|
|
3159
3103
|
}
|
|
3160
3104
|
//#endregion
|
|
3161
3105
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
3162
|
-
function
|
|
3106
|
+
function Zt(e, t) {
|
|
3163
3107
|
if (t <= 0) return () => 1;
|
|
3164
3108
|
let n = (e) => Math.max(0, Math.min(1, e / t));
|
|
3165
3109
|
switch (e) {
|
|
3166
3110
|
case "hardEdge": {
|
|
3167
|
-
let e =
|
|
3111
|
+
let e = on;
|
|
3168
3112
|
return (t) => {
|
|
3169
3113
|
let r = Math.min(1, n(t) / e);
|
|
3170
3114
|
return r * r * (3 - 2 * r);
|
|
@@ -3184,7 +3128,7 @@ function zt(e, t) {
|
|
|
3184
3128
|
};
|
|
3185
3129
|
}
|
|
3186
3130
|
}
|
|
3187
|
-
function
|
|
3131
|
+
function Qt(e) {
|
|
3188
3132
|
let t = e.length, n = new Float64Array(t);
|
|
3189
3133
|
if (t === 0) return n;
|
|
3190
3134
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -3202,7 +3146,7 @@ function Bt(e) {
|
|
|
3202
3146
|
}
|
|
3203
3147
|
return n;
|
|
3204
3148
|
}
|
|
3205
|
-
function
|
|
3149
|
+
function $t(e, t = 3) {
|
|
3206
3150
|
if (e <= 0) return Array(t).fill(1);
|
|
3207
3151
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
3208
3152
|
r % 2 == 0 && r--;
|
|
@@ -3210,7 +3154,7 @@ function Vt(e, t = 3) {
|
|
|
3210
3154
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
3211
3155
|
return s;
|
|
3212
3156
|
}
|
|
3213
|
-
function
|
|
3157
|
+
function en(e, t, n, r, i, a) {
|
|
3214
3158
|
let o = 1 / (2 * i + 1);
|
|
3215
3159
|
if (a) for (let a = 0; a < r; a++) {
|
|
3216
3160
|
let r = a * n, s = 0;
|
|
@@ -3231,29 +3175,29 @@ function Ht(e, t, n, r, i, a) {
|
|
|
3231
3175
|
}
|
|
3232
3176
|
}
|
|
3233
3177
|
}
|
|
3234
|
-
function
|
|
3178
|
+
function tn(e, t, n, r) {
|
|
3235
3179
|
let i = Float64Array.from(e);
|
|
3236
3180
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
3237
3181
|
let a = new Float64Array(t * n);
|
|
3238
|
-
for (let e of
|
|
3182
|
+
for (let e of $t(r, 3)) {
|
|
3239
3183
|
let r = Math.max(1, (e - 1) / 2);
|
|
3240
|
-
|
|
3184
|
+
en(i, a, t, n, r, !0), en(a, i, t, n, r, !1);
|
|
3241
3185
|
}
|
|
3242
3186
|
return i;
|
|
3243
3187
|
}
|
|
3244
|
-
function
|
|
3188
|
+
function nn(e, t, n, r = 128) {
|
|
3245
3189
|
let i = new Float64Array(t * n);
|
|
3246
3190
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
3247
3191
|
let a = new Float64Array(n);
|
|
3248
3192
|
for (let e = 0; e < t; e++) {
|
|
3249
3193
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
3250
|
-
let r =
|
|
3194
|
+
let r = Qt(a);
|
|
3251
3195
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
3252
3196
|
}
|
|
3253
3197
|
let o = new Float64Array(t);
|
|
3254
3198
|
for (let e = 0; e < n; e++) {
|
|
3255
3199
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
3256
|
-
let n =
|
|
3200
|
+
let n = Qt(o);
|
|
3257
3201
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
3258
3202
|
}
|
|
3259
3203
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -3265,15 +3209,15 @@ function Wt(e, t, n, r = 128) {
|
|
|
3265
3209
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
3266
3210
|
return i;
|
|
3267
3211
|
}
|
|
3268
|
-
var
|
|
3269
|
-
function
|
|
3212
|
+
var rn = .25, an = .35, on = .5;
|
|
3213
|
+
function sn(e, t, n, r, i, a) {
|
|
3270
3214
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
3271
3215
|
if (t <= 0 || n <= 0) return {
|
|
3272
3216
|
normals: o,
|
|
3273
3217
|
bandMask: s,
|
|
3274
3218
|
bandWeight: c
|
|
3275
3219
|
};
|
|
3276
|
-
let l =
|
|
3220
|
+
let l = nn(e, t, n), u = Zt(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = tn(l, t, n, Math.max(1, r * rn)), m = (e) => {
|
|
3277
3221
|
let t = u(Math.max(0, e - .5));
|
|
3278
3222
|
return u(e + .5) - t;
|
|
3279
3223
|
};
|
|
@@ -3288,9 +3232,9 @@ function Jt(e, t, n, r, i, a) {
|
|
|
3288
3232
|
o[a * 3 + 2] = 1;
|
|
3289
3233
|
continue;
|
|
3290
3234
|
}
|
|
3291
|
-
let g = u / r, _ = 1 -
|
|
3235
|
+
let g = u / r, _ = 1 - an, v = 1;
|
|
3292
3236
|
if (g > _) {
|
|
3293
|
-
let e = Math.min(1, (g - _) /
|
|
3237
|
+
let e = Math.min(1, (g - _) / an);
|
|
3294
3238
|
v = 1 - e * e * (3 - 2 * e);
|
|
3295
3239
|
}
|
|
3296
3240
|
c[a] = v;
|
|
@@ -3305,7 +3249,7 @@ function Jt(e, t, n, r, i, a) {
|
|
|
3305
3249
|
bandWeight: c
|
|
3306
3250
|
};
|
|
3307
3251
|
}
|
|
3308
|
-
var
|
|
3252
|
+
var cn = 35 * Math.PI / 180, ln = 12 * Math.PI / 180, un = {
|
|
3309
3253
|
t: {
|
|
3310
3254
|
x: 0,
|
|
3311
3255
|
y: -1
|
|
@@ -3339,22 +3283,22 @@ var Yt = 35 * Math.PI / 180, Xt = 12 * Math.PI / 180, Zt = {
|
|
|
3339
3283
|
y: 1
|
|
3340
3284
|
}
|
|
3341
3285
|
};
|
|
3342
|
-
function
|
|
3286
|
+
function dn(e, t, n) {
|
|
3343
3287
|
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
3344
3288
|
return {
|
|
3345
3289
|
x: e * i - t * a,
|
|
3346
3290
|
y: e * a + t * i
|
|
3347
3291
|
};
|
|
3348
3292
|
}
|
|
3349
|
-
function
|
|
3350
|
-
let r =
|
|
3351
|
-
return n && n.rev && (r =
|
|
3293
|
+
function fn(e, t, n) {
|
|
3294
|
+
let r = un[t] ?? un.t;
|
|
3295
|
+
return n && n.rev && (r = dn(r.x, r.y, n.rev)), mn(r.x, r.y, cn);
|
|
3352
3296
|
}
|
|
3353
|
-
function
|
|
3297
|
+
function pn(e) {
|
|
3354
3298
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
3355
|
-
return
|
|
3299
|
+
return mn(-e.x / t, -e.y / t, ln);
|
|
3356
3300
|
}
|
|
3357
|
-
function
|
|
3301
|
+
function mn(e, t, n) {
|
|
3358
3302
|
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;
|
|
3359
3303
|
return {
|
|
3360
3304
|
x: o / l,
|
|
@@ -3362,7 +3306,7 @@ function tn(e, t, n) {
|
|
|
3362
3306
|
z: c / l
|
|
3363
3307
|
};
|
|
3364
3308
|
}
|
|
3365
|
-
var
|
|
3309
|
+
var hn = 2, gn = {
|
|
3366
3310
|
matte: {
|
|
3367
3311
|
ambient: .62,
|
|
3368
3312
|
diffuse: .45,
|
|
@@ -3375,8 +3319,8 @@ var nn = 2, rn = {
|
|
|
3375
3319
|
specular: .35,
|
|
3376
3320
|
shininess: 22
|
|
3377
3321
|
}
|
|
3378
|
-
},
|
|
3379
|
-
function
|
|
3322
|
+
}, _n = .8;
|
|
3323
|
+
function vn(e) {
|
|
3380
3324
|
switch (e) {
|
|
3381
3325
|
case "plastic":
|
|
3382
3326
|
case "metal":
|
|
@@ -3387,8 +3331,8 @@ function on(e) {
|
|
|
3387
3331
|
default: return "matte";
|
|
3388
3332
|
}
|
|
3389
3333
|
}
|
|
3390
|
-
function
|
|
3391
|
-
let r =
|
|
3334
|
+
function yn(e, t, n = !0) {
|
|
3335
|
+
let r = gn[e], i = {
|
|
3392
3336
|
light: t,
|
|
3393
3337
|
material: e,
|
|
3394
3338
|
ambient: r.ambient,
|
|
@@ -3396,9 +3340,9 @@ function sn(e, t, n = !0) {
|
|
|
3396
3340
|
specular: r.specular,
|
|
3397
3341
|
shininess: r.shininess
|
|
3398
3342
|
};
|
|
3399
|
-
return n && (i.fillLight =
|
|
3343
|
+
return n && (i.fillLight = pn(t), i.fillDiffuse = i.diffuse * _n), i;
|
|
3400
3344
|
}
|
|
3401
|
-
function
|
|
3345
|
+
function bn(e, t) {
|
|
3402
3346
|
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;
|
|
3403
3347
|
if (t.fillLight && t.fillDiffuse) {
|
|
3404
3348
|
let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
|
|
@@ -3411,7 +3355,7 @@ function cn(e, t) {
|
|
|
3411
3355
|
}
|
|
3412
3356
|
return Math.max(0, t.ambient + r + i + a);
|
|
3413
3357
|
}
|
|
3414
|
-
function
|
|
3358
|
+
function xn(e, t, n) {
|
|
3415
3359
|
if (!e) return {
|
|
3416
3360
|
x: 0,
|
|
3417
3361
|
y: 0,
|
|
@@ -3426,16 +3370,16 @@ function ln(e, t, n) {
|
|
|
3426
3370
|
h: Math.max(0, o - i)
|
|
3427
3371
|
};
|
|
3428
3372
|
}
|
|
3429
|
-
function
|
|
3373
|
+
function Sn(e, t, n) {
|
|
3430
3374
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3431
3375
|
if (r <= 0 || i <= 0) return;
|
|
3432
3376
|
let a = t.widthPx;
|
|
3433
3377
|
if (a < .75) return;
|
|
3434
|
-
let { x: o, y: s, w: c, h: l } =
|
|
3378
|
+
let { x: o, y: s, w: c, h: l } = xn(n, r, i);
|
|
3435
3379
|
if (c <= 0 || l <= 0) return;
|
|
3436
3380
|
let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
|
|
3437
3381
|
for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
|
|
3438
|
-
let { bandMask: p, bandWeight: m, normals: h } =
|
|
3382
|
+
let { bandMask: p, bandWeight: m, normals: h } = sn(f, c, l, a, t.prst, t.heightPx), g = yn(t.material, t.light), _ = bn({
|
|
3439
3383
|
x: 0,
|
|
3440
3384
|
y: 0,
|
|
3441
3385
|
z: 1
|
|
@@ -3446,13 +3390,13 @@ function un(e, t, n) {
|
|
|
3446
3390
|
if (n <= 0) continue;
|
|
3447
3391
|
let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
|
|
3448
3392
|
t.bottom && (r = -r, i = -i);
|
|
3449
|
-
let o = 1 + (
|
|
3393
|
+
let o = 1 + (bn({
|
|
3450
3394
|
x: r,
|
|
3451
3395
|
y: i,
|
|
3452
3396
|
z: a
|
|
3453
3397
|
}, g) / _ - 1) * n, s = e * 4;
|
|
3454
3398
|
if (o >= 1) {
|
|
3455
|
-
let e = Math.min(1, (o - 1) *
|
|
3399
|
+
let e = Math.min(1, (o - 1) * hn);
|
|
3456
3400
|
for (let t = 0; t < 3; t++) {
|
|
3457
3401
|
let n = Math.min(255, d[s + t] * o);
|
|
3458
3402
|
d[s + t] = n + (255 - n) * e;
|
|
@@ -3461,12 +3405,12 @@ function un(e, t, n) {
|
|
|
3461
3405
|
}
|
|
3462
3406
|
e.putImageData(u, o, s);
|
|
3463
3407
|
}
|
|
3464
|
-
function
|
|
3408
|
+
function Cn(e, t, n) {
|
|
3465
3409
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3466
3410
|
if (r <= 0 || i <= 0) return;
|
|
3467
3411
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
3468
3412
|
if (s < .75) return;
|
|
3469
|
-
let { x: c, y: l, w: u, h: d } =
|
|
3413
|
+
let { x: c, y: l, w: u, h: d } = xn(n, r, i);
|
|
3470
3414
|
if (u <= 0 || d <= 0) return;
|
|
3471
3415
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
3472
3416
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -3490,7 +3434,7 @@ function dn(e, t, n) {
|
|
|
3490
3434
|
}
|
|
3491
3435
|
//#endregion
|
|
3492
3436
|
//#region packages/core/src/text/highlight-box.ts
|
|
3493
|
-
function
|
|
3437
|
+
function wn(e, t) {
|
|
3494
3438
|
return {
|
|
3495
3439
|
top: e - t * .85,
|
|
3496
3440
|
height: t * 1.1
|
|
@@ -3498,20 +3442,20 @@ function fn(e, t) {
|
|
|
3498
3442
|
}
|
|
3499
3443
|
//#endregion
|
|
3500
3444
|
//#region packages/core/src/nav/internal-target.ts
|
|
3501
|
-
function
|
|
3445
|
+
function Tn(e, t) {
|
|
3502
3446
|
let n = t.startsWith("/") ? [] : e.split("/").filter((e) => e !== "");
|
|
3503
3447
|
for (let e of t.split("/")) if (e === "..") n.pop();
|
|
3504
3448
|
else if (e === "." || e === "") continue;
|
|
3505
3449
|
else n.push(e);
|
|
3506
3450
|
return n.join("/");
|
|
3507
3451
|
}
|
|
3508
|
-
function
|
|
3452
|
+
function En(e) {
|
|
3509
3453
|
let t = /[?&]jump=([a-zA-Z]+)/.exec(e);
|
|
3510
3454
|
if (!t) return null;
|
|
3511
3455
|
let n = t[1].toLowerCase();
|
|
3512
3456
|
return n === "firstslide" || n === "lastslide" || n === "nextslide" || n === "previousslide" ? n : null;
|
|
3513
3457
|
}
|
|
3514
|
-
function
|
|
3458
|
+
function Dn(e, t, n) {
|
|
3515
3459
|
if (!(n <= 0)) switch (e) {
|
|
3516
3460
|
case "firstslide": return 0;
|
|
3517
3461
|
case "lastslide": return n - 1;
|
|
@@ -3519,27 +3463,61 @@ function hn(e, t, n) {
|
|
|
3519
3463
|
case "previousslide": return Math.max(t - 1, 0);
|
|
3520
3464
|
}
|
|
3521
3465
|
}
|
|
3522
|
-
|
|
3523
|
-
|
|
3466
|
+
//#endregion
|
|
3467
|
+
//#region packages/pptx/src/text-layer.ts
|
|
3468
|
+
function On(e, t, n, r, i) {
|
|
3469
|
+
e.innerHTML = "";
|
|
3470
|
+
let a = /* @__PURE__ */ new Map();
|
|
3471
|
+
for (let o of t) {
|
|
3472
|
+
let t = o.rotation + (o.textBodyRotation ?? 0), s = `${o.shapeX},${o.shapeY},${o.shapeW},${o.shapeH},${t}`;
|
|
3473
|
+
if (!a.has(s)) {
|
|
3474
|
+
let i = document.createElement("div");
|
|
3475
|
+
i.style.cssText = `position:absolute;left:${K(o.shapeX, n)};top:${K(o.shapeY, r)};width:${K(o.shapeW, n)};height:${K(o.shapeH, r)};pointer-events:all;overflow:hidden;`, t !== 0 && (i.style.transformOrigin = "center center", i.style.transform = `rotate(${t}deg)`), a.set(s, {
|
|
3476
|
+
div: i,
|
|
3477
|
+
x: o.shapeX,
|
|
3478
|
+
y: o.shapeY,
|
|
3479
|
+
w: o.shapeW,
|
|
3480
|
+
h: o.shapeH,
|
|
3481
|
+
rot: t
|
|
3482
|
+
}), e.appendChild(i);
|
|
3483
|
+
}
|
|
3484
|
+
let c = a.get(s), l = document.createElement("span");
|
|
3485
|
+
l.textContent = o.text;
|
|
3486
|
+
let u = i ? o.hyperlink : void 0;
|
|
3487
|
+
l.style.cssText = `position:absolute;left:${K(o.inShapeX, c.w)};top:${K(o.inShapeY, c.h)};font:${o.font};line-height:${o.h}px;letter-spacing:0;white-space:pre;color:transparent;cursor:${u ? "pointer" : "text"};`, u && i && (l.title = u.kind === "external" ? u.url : u.ref, l.addEventListener("click", (e) => {
|
|
3488
|
+
e.preventDefault(), i(u);
|
|
3489
|
+
})), c.div.appendChild(l);
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
function kn(e, t, n, r, i, a, o = {}) {
|
|
3493
|
+
e.innerHTML = "";
|
|
3524
3494
|
let s = o.match ?? "rgba(255, 214, 0, 0.42)", c = o.active ?? "rgba(255, 140, 0, 0.55)", l = /* @__PURE__ */ new Map(), u = (t) => {
|
|
3525
|
-
let n = t.rotation + (t.textBodyRotation ?? 0),
|
|
3526
|
-
|
|
3495
|
+
let n = t.rotation + (t.textBodyRotation ?? 0), a = `${t.shapeX},${t.shapeY},${t.shapeW},${t.shapeH},${n}`, o = l.get(a);
|
|
3496
|
+
if (!o) {
|
|
3497
|
+
let s = document.createElement("div");
|
|
3498
|
+
s.style.cssText = `position:absolute;left:${K(t.shapeX, r)};top:${K(t.shapeY, i)};width:${K(t.shapeW, r)};height:${K(t.shapeH, i)};pointer-events:none;overflow:hidden;`, n !== 0 && (s.style.transformOrigin = "center center", s.style.transform = `rotate(${n}deg)`), o = {
|
|
3499
|
+
div: s,
|
|
3500
|
+
w: t.shapeW,
|
|
3501
|
+
h: t.shapeH
|
|
3502
|
+
}, l.set(a, o), e.appendChild(s);
|
|
3503
|
+
}
|
|
3504
|
+
return o;
|
|
3527
3505
|
};
|
|
3528
3506
|
for (let e of n) {
|
|
3529
3507
|
let n = e.active ? c : s;
|
|
3530
3508
|
for (let r of e.slices) {
|
|
3531
3509
|
let e = t[r.runIndex];
|
|
3532
3510
|
if (!e) continue;
|
|
3533
|
-
let i = a(e.font), { x: o, width: s } =
|
|
3511
|
+
let i = a(e.font), { x: o, width: s } = ze(e.text, r.start, r.end, i);
|
|
3534
3512
|
if (s <= 0) continue;
|
|
3535
|
-
let c = document.createElement("div");
|
|
3536
|
-
|
|
3513
|
+
let c = u(e), l = document.createElement("div");
|
|
3514
|
+
l.style.cssText = `position:absolute;left:${K(e.inShapeX + o, c.w)};top:${K(e.inShapeY, c.h)};width:${K(s, c.w)};height:${K(e.h, c.h)};background:${n};pointer-events:none;`, c.div.appendChild(l);
|
|
3537
3515
|
}
|
|
3538
3516
|
}
|
|
3539
3517
|
}
|
|
3540
3518
|
//#endregion
|
|
3541
3519
|
//#region packages/pptx/src/find.ts
|
|
3542
|
-
var
|
|
3520
|
+
var An = class {
|
|
3543
3521
|
_slideRuns = /* @__PURE__ */ new Map();
|
|
3544
3522
|
_matches = [];
|
|
3545
3523
|
_active = -1;
|
|
@@ -3581,8 +3559,8 @@ var _n = class {
|
|
|
3581
3559
|
if (this._matches = [], this._active = -1, e.length === 0) return [];
|
|
3582
3560
|
let n = this._slideCount();
|
|
3583
3561
|
for (let r = 0; r < n; r++) {
|
|
3584
|
-
let n = await this._ensureSlideRuns(r), i =
|
|
3585
|
-
for (let a of
|
|
3562
|
+
let n = await this._ensureSlideRuns(r), i = ve(n);
|
|
3563
|
+
for (let a of re(i, e, t)) {
|
|
3586
3564
|
let e = a.slices.map((e) => n[e.runIndex].text.slice(e.start, e.end)).join("");
|
|
3587
3565
|
this._matches.push({
|
|
3588
3566
|
slide: r,
|
|
@@ -3594,10 +3572,10 @@ var _n = class {
|
|
|
3594
3572
|
return this.matches();
|
|
3595
3573
|
}
|
|
3596
3574
|
next() {
|
|
3597
|
-
return this._active =
|
|
3575
|
+
return this._active = xe(this._active, this._matches.length), this._activePublic();
|
|
3598
3576
|
}
|
|
3599
3577
|
prev() {
|
|
3600
|
-
return this._active =
|
|
3578
|
+
return this._active = ue(this._active, this._matches.length), this._activePublic();
|
|
3601
3579
|
}
|
|
3602
3580
|
_activePublic() {
|
|
3603
3581
|
let e = this._matches[this._active];
|
|
@@ -3616,20 +3594,20 @@ var _n = class {
|
|
|
3616
3594
|
};
|
|
3617
3595
|
//#endregion
|
|
3618
3596
|
//#region packages/pptx/src/types.ts
|
|
3619
|
-
function
|
|
3597
|
+
function jn(e) {
|
|
3620
3598
|
return e;
|
|
3621
3599
|
}
|
|
3622
3600
|
//#endregion
|
|
3623
3601
|
//#region packages/pptx/src/hyperlink.ts
|
|
3624
|
-
function
|
|
3602
|
+
function Mn(e, t) {
|
|
3625
3603
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3626
3604
|
if (n === void 0 && r === void 0) return;
|
|
3627
3605
|
if (r !== void 0) return {
|
|
3628
3606
|
kind: "internal",
|
|
3629
3607
|
ref: n ?? r
|
|
3630
3608
|
};
|
|
3631
|
-
let i = n, a =
|
|
3632
|
-
return a !== null &&
|
|
3609
|
+
let i = n, a = z(i);
|
|
3610
|
+
return a !== null && ye.includes(a) ? {
|
|
3633
3611
|
kind: "external",
|
|
3634
3612
|
url: i
|
|
3635
3613
|
} : {
|
|
@@ -3639,7 +3617,7 @@ function yn(e, t) {
|
|
|
3639
3617
|
}
|
|
3640
3618
|
//#endregion
|
|
3641
3619
|
//#region packages/pptx/src/media-chrome.ts
|
|
3642
|
-
function
|
|
3620
|
+
function Nn(e, t, n, r, i, a) {
|
|
3643
3621
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3644
3622
|
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") {
|
|
3645
3623
|
e.beginPath();
|
|
@@ -3653,39 +3631,43 @@ function bn(e, t, n, r, i, a) {
|
|
|
3653
3631
|
}
|
|
3654
3632
|
//#endregion
|
|
3655
3633
|
//#region packages/pptx/src/bidi-line.ts
|
|
3656
|
-
var
|
|
3634
|
+
var Pn = (e) => {
|
|
3657
3635
|
let t = e.text;
|
|
3658
3636
|
return typeof t == "string" ? t : void 0;
|
|
3659
|
-
};
|
|
3660
|
-
function
|
|
3661
|
-
for (let
|
|
3662
|
-
let e =
|
|
3663
|
-
if (e !== void 0 &&
|
|
3637
|
+
}, Fn = (e) => "isTab" in e;
|
|
3638
|
+
function In(e) {
|
|
3639
|
+
for (let n of e) {
|
|
3640
|
+
let e = Pn(n);
|
|
3641
|
+
if (e !== void 0 && t(e)) return !0;
|
|
3664
3642
|
}
|
|
3665
3643
|
return !1;
|
|
3666
3644
|
}
|
|
3667
|
-
function
|
|
3645
|
+
function Ln(e, t) {
|
|
3668
3646
|
let n = e.length;
|
|
3669
3647
|
if (n === 0) return {
|
|
3670
3648
|
order: [],
|
|
3671
3649
|
rtl: []
|
|
3672
3650
|
};
|
|
3673
|
-
let r = "", i = Array(n);
|
|
3651
|
+
let r = "", i = Array(n), a;
|
|
3674
3652
|
for (let t = 0; t < n; t++) {
|
|
3675
3653
|
i[t] = r.length;
|
|
3676
|
-
let n =
|
|
3677
|
-
r += n.length > 0 ? n : ""
|
|
3654
|
+
let n = Pn(e[t]) ?? "";
|
|
3655
|
+
if (r += n.length > 0 ? n : "", Fn(e[t])) {
|
|
3656
|
+
for (a ??= []; a.length < r.length;) a.push(null);
|
|
3657
|
+
a[i[t]] = "S";
|
|
3658
|
+
}
|
|
3678
3659
|
}
|
|
3679
|
-
|
|
3680
|
-
|
|
3660
|
+
if (a) for (; a.length < r.length;) a.push(null);
|
|
3661
|
+
let { levels: o, paragraphLevel: s } = O().computeLevels(r, t ? "rtl" : "ltr", a), { order: c, segLevels: l } = je(o, s, i), u = Array(n);
|
|
3662
|
+
for (let e = 0; e < n; e++) u[e] = (l[e] & 1) == 1;
|
|
3681
3663
|
return {
|
|
3682
|
-
order:
|
|
3683
|
-
rtl:
|
|
3664
|
+
order: c,
|
|
3665
|
+
rtl: u
|
|
3684
3666
|
};
|
|
3685
3667
|
}
|
|
3686
3668
|
//#endregion
|
|
3687
3669
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3688
|
-
function
|
|
3670
|
+
function Rn(e, t, n, r) {
|
|
3689
3671
|
if (e.length === 0) return 0;
|
|
3690
3672
|
let i = t === 0, a = 0, o = t;
|
|
3691
3673
|
for (let t of e) {
|
|
@@ -3696,20 +3678,21 @@ function wn(e, t, n, r) {
|
|
|
3696
3678
|
}
|
|
3697
3679
|
o += t.w, a++;
|
|
3698
3680
|
}
|
|
3699
|
-
return a === 0 ? 0 : a >= e.length ? e.length :
|
|
3681
|
+
return a === 0 ? 0 : a >= e.length ? e.length : l(e.map((e) => e.ch), a, r, +!!i);
|
|
3700
3682
|
}
|
|
3701
3683
|
//#endregion
|
|
3702
3684
|
//#region packages/pptx/src/text-justify.ts
|
|
3703
|
-
var
|
|
3704
|
-
function
|
|
3685
|
+
var zn = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3686
|
+
function Bn(e, t, n, r, i) {
|
|
3705
3687
|
if (r === "just" && i) return null;
|
|
3706
3688
|
let a = t - n;
|
|
3707
3689
|
if (a <= .5) return null;
|
|
3708
|
-
let o =
|
|
3690
|
+
let o = Ne(e, a, {
|
|
3709
3691
|
firstContentSi: 0,
|
|
3710
3692
|
lastDrawnSi: e.length,
|
|
3711
|
-
isGapChar:
|
|
3712
|
-
isWhitespace:
|
|
3693
|
+
isGapChar: v,
|
|
3694
|
+
isWhitespace: zn,
|
|
3695
|
+
seaClusterGaps: r === "thaiDist"
|
|
3713
3696
|
});
|
|
3714
3697
|
if (!o) return null;
|
|
3715
3698
|
let { perGap: s, perSeg: c } = o, l = [];
|
|
@@ -3729,7 +3712,7 @@ function En(e, t, n, r, i) {
|
|
|
3729
3712
|
}
|
|
3730
3713
|
//#endregion
|
|
3731
3714
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3732
|
-
function
|
|
3715
|
+
function Vn(e) {
|
|
3733
3716
|
if (!e) return {
|
|
3734
3717
|
r: 0,
|
|
3735
3718
|
g: 0,
|
|
@@ -3746,36 +3729,140 @@ function Dn(e) {
|
|
|
3746
3729
|
b: parseInt(t.slice(4, 6), 16)
|
|
3747
3730
|
};
|
|
3748
3731
|
}
|
|
3749
|
-
function
|
|
3750
|
-
let t =
|
|
3732
|
+
function Hn(e) {
|
|
3733
|
+
let t = Vn(e);
|
|
3751
3734
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3752
3735
|
}
|
|
3753
|
-
function
|
|
3736
|
+
function Un(e, t) {
|
|
3754
3737
|
if (!e && !t) return null;
|
|
3755
3738
|
if (!e) return t;
|
|
3756
3739
|
if (!t) return e;
|
|
3757
3740
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3758
|
-
let n =
|
|
3741
|
+
let n = Hn(e.color), r = Hn(t.color);
|
|
3759
3742
|
return n === r || n < r ? e : t;
|
|
3760
3743
|
}
|
|
3761
3744
|
//#endregion
|
|
3745
|
+
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3746
|
+
function Wn(e) {
|
|
3747
|
+
let t = A(e.length === 8 ? e.slice(0, 6) : e);
|
|
3748
|
+
if (!t) return null;
|
|
3749
|
+
let n = N(t[0], t[1], t[2]);
|
|
3750
|
+
if (e.length !== 8) return n;
|
|
3751
|
+
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
3752
|
+
if (Number.isNaN(r)) return null;
|
|
3753
|
+
let i = r / 255;
|
|
3754
|
+
return i * n + (1 - i);
|
|
3755
|
+
}
|
|
3756
|
+
function Gn(e) {
|
|
3757
|
+
if (!e) return null;
|
|
3758
|
+
if (e.fillType === "solid") return Wn(e.color);
|
|
3759
|
+
if (e.fillType === "gradient") {
|
|
3760
|
+
let t = e.stops.map((e) => ({
|
|
3761
|
+
p: Math.min(1, Math.max(0, e.position)),
|
|
3762
|
+
l: Wn(e.color)
|
|
3763
|
+
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3764
|
+
if (t.length === 0) return null;
|
|
3765
|
+
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
3766
|
+
for (let e = 0; e + 1 < t.length; e++) i += (t[e].l + t[e + 1].l) / 2 * (t[e + 1].p - t[e].p);
|
|
3767
|
+
return i;
|
|
3768
|
+
}
|
|
3769
|
+
return null;
|
|
3770
|
+
}
|
|
3771
|
+
function Kn(e) {
|
|
3772
|
+
return e.name === "SmartArt" && e.id === void 0;
|
|
3773
|
+
}
|
|
3774
|
+
function qn(e, t) {
|
|
3775
|
+
let n = Gn(e);
|
|
3776
|
+
if (n === null || n >= .5) return null;
|
|
3777
|
+
let r = Wn(t.replace(/^#/, ""));
|
|
3778
|
+
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3779
|
+
}
|
|
3780
|
+
//#endregion
|
|
3781
|
+
//#region packages/pptx/src/tab-layout.ts
|
|
3782
|
+
function Jn(e, t, n, r, i, a = 0) {
|
|
3783
|
+
let o = e.map((e) => e.width), s = (t) => {
|
|
3784
|
+
let n = 0;
|
|
3785
|
+
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
3786
|
+
return n;
|
|
3787
|
+
}, c = n;
|
|
3788
|
+
for (let n = 0; n < e.length; n++) {
|
|
3789
|
+
if (!e[n].isTab) {
|
|
3790
|
+
c += o[n];
|
|
3791
|
+
continue;
|
|
3792
|
+
}
|
|
3793
|
+
let l = null;
|
|
3794
|
+
for (let e of t) e.pos > c && (l === null || e.pos < l.pos) && (l = e);
|
|
3795
|
+
if (l === null) if (a > 0) l = {
|
|
3796
|
+
pos: (Math.floor(c / a) + 1) * a,
|
|
3797
|
+
algn: "l"
|
|
3798
|
+
};
|
|
3799
|
+
else {
|
|
3800
|
+
o[n] = i, c += i;
|
|
3801
|
+
continue;
|
|
3802
|
+
}
|
|
3803
|
+
let u = s(n + 1), d = l.algn === "ctr" ? .5 : +(l.algn === "r" || l.algn === "dec"), f = l.pos - u * d;
|
|
3804
|
+
f + u > r && (f = r - u), f < c && (f = c), o[n] = f - c, c = f;
|
|
3805
|
+
}
|
|
3806
|
+
return o;
|
|
3807
|
+
}
|
|
3808
|
+
//#endregion
|
|
3809
|
+
//#region packages/pptx/src/vertical-text.ts
|
|
3810
|
+
var Yn = () => !1;
|
|
3811
|
+
function Xn(e, t, n) {
|
|
3812
|
+
let r = e.textBaseline;
|
|
3813
|
+
e.textBaseline = "alphabetic";
|
|
3814
|
+
let i = e.measureText(t);
|
|
3815
|
+
e.textBaseline = r;
|
|
3816
|
+
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3817
|
+
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3818
|
+
}
|
|
3819
|
+
function Zn(e, t) {
|
|
3820
|
+
let n = e.textAlign, r = e.textBaseline;
|
|
3821
|
+
e.textAlign = "center", e.textBaseline = "middle";
|
|
3822
|
+
let i = e.measureText(t);
|
|
3823
|
+
e.textAlign = n, e.textBaseline = r;
|
|
3824
|
+
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3825
|
+
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3826
|
+
}
|
|
3827
|
+
function Qn(e, t, n, i, a, o, s = "fill", c = Yn) {
|
|
3828
|
+
let l = e.textAlign, u = e.textBaseline, d = s === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), f = i - Xn(e, t, a), p = 0;
|
|
3829
|
+
for (let s of t) {
|
|
3830
|
+
let t = s.codePointAt(0) ?? 0, u = Oe(t), m = e.measureText(s).width + o, h = u === "Tr" ? Ae(t) : null, g = u === "Tr" && h === null && r(t), _ = u === "U" || u === "Tu" || h !== null || g;
|
|
3831
|
+
if (C(t) && c(t)) {
|
|
3832
|
+
let t = n + p + m / 2;
|
|
3833
|
+
e.save(), e.translate(t, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", Te(e, () => d(s, 0, 0)), e.restore();
|
|
3834
|
+
} else if (_) {
|
|
3835
|
+
let r = h === null && u === "Tu" ? L(t) : null, i = h === null ? r : h, o = i === null ? s : String.fromCodePoint(i), c = n + p + m / 2, l = r === null ? Zn(e, o) / a : 0;
|
|
3836
|
+
e.save(), e.translate(c, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", d(o, 0, l * a), e.restore();
|
|
3837
|
+
} else if (u === "Tr") {
|
|
3838
|
+
let t = n + p + m / 2;
|
|
3839
|
+
e.textAlign = "center", e.textBaseline = "middle", d(s, t, f);
|
|
3840
|
+
} else e.textAlign = l, e.textBaseline = "alphabetic", d(s, n + p, i);
|
|
3841
|
+
p += m;
|
|
3842
|
+
}
|
|
3843
|
+
e.textAlign = l, e.textBaseline = u;
|
|
3844
|
+
}
|
|
3845
|
+
function $n(e, t, n, r, i, a, o = "fill") {
|
|
3846
|
+
Qn(e, t, n, r, i, a, o, (t) => P(e, t));
|
|
3847
|
+
}
|
|
3848
|
+
//#endregion
|
|
3762
3849
|
//#region packages/pptx/src/renderer.ts
|
|
3763
|
-
function
|
|
3850
|
+
function Y(e, t) {
|
|
3764
3851
|
return e * t;
|
|
3765
3852
|
}
|
|
3766
|
-
var
|
|
3767
|
-
function
|
|
3768
|
-
let { top: s, height: c } =
|
|
3853
|
+
var X = R;
|
|
3854
|
+
function er(e, t, n, r, i, a, o) {
|
|
3855
|
+
let { top: s, height: c } = wn(n, i);
|
|
3769
3856
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3770
3857
|
}
|
|
3771
|
-
function
|
|
3772
|
-
return !e || e.fillType === "none" ? null : e.fillType === "solid" ?
|
|
3858
|
+
function tr(e) {
|
|
3859
|
+
return !e || e.fillType === "none" ? null : e.fillType === "solid" ? X(e.color) : e.fillType === "gradient" ? e.stops.length > 0 ? X(e.stops[0].color) : null : e.fillType === "pattern" ? X(e.fg) : null;
|
|
3773
3860
|
}
|
|
3774
|
-
function
|
|
3775
|
-
return
|
|
3861
|
+
function nr(e, t, n, r, i, a) {
|
|
3862
|
+
return ke(e, t, n, r, i, a);
|
|
3776
3863
|
}
|
|
3777
|
-
var
|
|
3778
|
-
function
|
|
3864
|
+
var rr = /* @__PURE__ */ new WeakMap();
|
|
3865
|
+
function ir(e, t) {
|
|
3779
3866
|
let n = e.tinted.get(t);
|
|
3780
3867
|
if (n) return n;
|
|
3781
3868
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -3783,18 +3870,18 @@ function Pn(e, t) {
|
|
|
3783
3870
|
let o = a.getContext("2d");
|
|
3784
3871
|
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;
|
|
3785
3872
|
}
|
|
3786
|
-
function
|
|
3873
|
+
function ar(e) {
|
|
3787
3874
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3788
3875
|
return new Promise((e, r) => {
|
|
3789
3876
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3790
3877
|
});
|
|
3791
3878
|
}
|
|
3792
|
-
var
|
|
3793
|
-
function
|
|
3794
|
-
let r = Math.max(1, Math.round(t *
|
|
3879
|
+
var or = 256;
|
|
3880
|
+
function sr(e, t, n) {
|
|
3881
|
+
let r = Math.max(1, Math.round(t * or)), i = Math.max(1, Math.round(n * or));
|
|
3795
3882
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3796
3883
|
}
|
|
3797
|
-
function
|
|
3884
|
+
function cr(e) {
|
|
3798
3885
|
let t = [], n = (e) => {
|
|
3799
3886
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3800
3887
|
nodes: e.nodes,
|
|
@@ -3805,26 +3892,26 @@ function Rn(e) {
|
|
|
3805
3892
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3806
3893
|
return t;
|
|
3807
3894
|
}
|
|
3808
|
-
async function
|
|
3809
|
-
let
|
|
3810
|
-
if (
|
|
3811
|
-
await
|
|
3812
|
-
for (let
|
|
3813
|
-
let
|
|
3814
|
-
|
|
3815
|
-
img:
|
|
3816
|
-
widthEm:
|
|
3817
|
-
ascentEm:
|
|
3818
|
-
descentEm:
|
|
3895
|
+
async function lr(e, t) {
|
|
3896
|
+
let n = cr(e);
|
|
3897
|
+
if (n.length !== 0) {
|
|
3898
|
+
await t.loadMathJax();
|
|
3899
|
+
for (let e of n) if (!rr.has(e.nodes)) try {
|
|
3900
|
+
let n = await t.mathMLToSvg(ge(e.nodes, e.display)), r = await ar(sr(Xe(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3901
|
+
rr.set(e.nodes, {
|
|
3902
|
+
img: r,
|
|
3903
|
+
widthEm: n.widthEm,
|
|
3904
|
+
ascentEm: n.ascentEm,
|
|
3905
|
+
descentEm: n.descentEm,
|
|
3819
3906
|
tinted: /* @__PURE__ */ new Map()
|
|
3820
3907
|
});
|
|
3821
3908
|
} catch {}
|
|
3822
3909
|
}
|
|
3823
3910
|
}
|
|
3824
|
-
function
|
|
3911
|
+
function ur(e, t) {
|
|
3825
3912
|
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";
|
|
3826
3913
|
}
|
|
3827
|
-
var
|
|
3914
|
+
var dr = new Set([
|
|
3828
3915
|
"serif",
|
|
3829
3916
|
"sans-serif",
|
|
3830
3917
|
"monospace",
|
|
@@ -3832,11 +3919,11 @@ var Vn = new Set([
|
|
|
3832
3919
|
"fantasy",
|
|
3833
3920
|
"system-ui"
|
|
3834
3921
|
]);
|
|
3835
|
-
function
|
|
3836
|
-
let t =
|
|
3922
|
+
function fr(e) {
|
|
3923
|
+
let t = h(e);
|
|
3837
3924
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3838
3925
|
}
|
|
3839
|
-
var
|
|
3926
|
+
var pr = {
|
|
3840
3927
|
calibri: "Carlito",
|
|
3841
3928
|
"calibri light": "Carlito",
|
|
3842
3929
|
cambria: "Caladea",
|
|
@@ -3846,116 +3933,121 @@ var Un = {
|
|
|
3846
3933
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3847
3934
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3848
3935
|
"univers next arabic": "Noto Sans Arabic"
|
|
3849
|
-
},
|
|
3850
|
-
function
|
|
3851
|
-
if (
|
|
3936
|
+
}, mr = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3937
|
+
function hr(e) {
|
|
3938
|
+
if (pr[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3852
3939
|
let t = e.toLowerCase();
|
|
3853
3940
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3854
3941
|
}
|
|
3855
|
-
function
|
|
3942
|
+
function gr(e) {
|
|
3856
3943
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3857
3944
|
}
|
|
3858
|
-
function
|
|
3859
|
-
let t =
|
|
3860
|
-
if (
|
|
3861
|
-
let i = t === "serif" ? "serif" : "sans",
|
|
3862
|
-
return `"${e}", ${r}${
|
|
3945
|
+
function _r(e) {
|
|
3946
|
+
let t = fr(e), n = pr[e.toLowerCase()], r = n ? `"${n}", ` : "";
|
|
3947
|
+
if (hr(e)) return `"${e}", ${r}${mr}, ${t}`;
|
|
3948
|
+
let i = t === "serif" ? "serif" : "sans", o = u(e);
|
|
3949
|
+
return `"${e}", ${r}${o ? `${gr(a(o, i))}, ` : ""}${`${gr(i === "serif" ? y : _)}, `}${t}`;
|
|
3863
3950
|
}
|
|
3864
|
-
function
|
|
3951
|
+
function vr(e) {
|
|
3865
3952
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3866
3953
|
}
|
|
3867
|
-
function
|
|
3868
|
-
let a = t ? "italic " : "", o = e ? "bold " : "", s =
|
|
3869
|
-
return
|
|
3954
|
+
function Z(e, t, n, r, i) {
|
|
3955
|
+
let a = t ? "italic " : "", o = e ? "bold " : "", s = ur(r, i);
|
|
3956
|
+
return dr.has(s) ? `${a}${o}${n}px ${s}` : `${a}${o}${n}px ${_r(s)}`;
|
|
3870
3957
|
}
|
|
3871
|
-
function
|
|
3872
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3958
|
+
function yr(e) {
|
|
3959
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || jn(e.bullet).type === "blip";
|
|
3873
3960
|
}
|
|
3874
|
-
function
|
|
3961
|
+
function br(e, t) {
|
|
3875
3962
|
return e ? 0 : Math.max(0, t);
|
|
3876
3963
|
}
|
|
3877
|
-
function
|
|
3964
|
+
function xr(e, t, n, r, i, a, o) {
|
|
3878
3965
|
let s = (t.defaultFontSize ?? 18) * G * a;
|
|
3879
3966
|
for (let c of t.paragraphs) {
|
|
3880
|
-
let l =
|
|
3967
|
+
let l = Y(c.marL, a), u = Y(c.marR, a), d = Y(c.indent, a), f = br(yr(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3881
3968
|
for (let n of c.runs) {
|
|
3882
3969
|
if (n.type !== "text") continue;
|
|
3883
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * G * a : n.fontSize * G * a, i =
|
|
3884
|
-
if (e.font =
|
|
3970
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * G * a : n.fontSize * G * a, i = ur(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3971
|
+
if (e.font = Z(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;
|
|
3885
3972
|
}
|
|
3886
3973
|
}
|
|
3887
3974
|
return !1;
|
|
3888
3975
|
}
|
|
3889
|
-
function
|
|
3890
|
-
for (let t of e) if (
|
|
3976
|
+
function Sr(e) {
|
|
3977
|
+
for (let t of e) if (v(t.codePointAt(0) ?? 0)) return !0;
|
|
3891
3978
|
return !1;
|
|
3892
3979
|
}
|
|
3893
|
-
function
|
|
3980
|
+
function Q(e) {
|
|
3894
3981
|
let t = 0;
|
|
3895
3982
|
for (let n of e) t++;
|
|
3896
3983
|
return t;
|
|
3897
3984
|
}
|
|
3898
|
-
function
|
|
3985
|
+
function Cr(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3899
3986
|
themeMajorFont: null,
|
|
3900
3987
|
themeMinorFont: null,
|
|
3901
3988
|
dpr: 1
|
|
3902
|
-
},
|
|
3903
|
-
let
|
|
3904
|
-
|
|
3905
|
-
|
|
3989
|
+
}, p = 0) {
|
|
3990
|
+
let h = [], _ = () => n - (h.length === 0 ? p : 0), y = { segments: [] }, x = 0, S = !1, C = t.rtl === !0, T = Y(t.marR, o), E = (t.tabStops ?? []).map((e) => ({
|
|
3991
|
+
pos: Y(e.pos, o),
|
|
3992
|
+
algn: e.algn
|
|
3993
|
+
})), D = Y(t.defTabSz ?? 914400, o), O = !1, k = [], A = 0, j = () => C ? T : s + (h.length === 0 ? p : 0), M = (e = 0) => {
|
|
3994
|
+
let t = Jn(e > 0 ? [...k, {
|
|
3995
|
+
isTab: !1,
|
|
3996
|
+
width: e
|
|
3997
|
+
}] : k, E, j(), Infinity, A, D), n = 0;
|
|
3998
|
+
for (let e of t) n += e;
|
|
3999
|
+
return n;
|
|
4000
|
+
}, N = (e) => {
|
|
4001
|
+
let t = _();
|
|
4002
|
+
return Number.isFinite(t) ? O ? M(e) <= t : x + e <= t : !0;
|
|
4003
|
+
}, P = () => {
|
|
4004
|
+
let e = _();
|
|
4005
|
+
if (!O) return e - x;
|
|
4006
|
+
if (!Number.isFinite(e)) return Infinity;
|
|
4007
|
+
if (M(0) >= e) return 0;
|
|
4008
|
+
let t = 0, n = e;
|
|
4009
|
+
for (let r = 0; r < 40; r++) {
|
|
4010
|
+
let r = (t + n) / 2;
|
|
4011
|
+
M(r) <= e ? t = r : n = r;
|
|
4012
|
+
}
|
|
4013
|
+
return t;
|
|
4014
|
+
}, F = (e = !1) => {
|
|
4015
|
+
e && (y.endsWithBreak = !0), h.push(y), y = { segments: [] }, x = 0, O = !1, k = [], S = !1;
|
|
4016
|
+
}, I = (t, n, r, i, a, o, s, c) => {
|
|
3906
4017
|
if (!t) return;
|
|
3907
4018
|
e.font = n;
|
|
3908
|
-
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l *
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
font: n,
|
|
3935
|
-
fontFamily: b,
|
|
3936
|
-
sizePx: r,
|
|
3937
|
-
color: i,
|
|
3938
|
-
underline: a,
|
|
3939
|
-
underlineStyle: f,
|
|
3940
|
-
underlineColor: p,
|
|
3941
|
-
strikethrough: o,
|
|
3942
|
-
strikeDouble: d,
|
|
3943
|
-
letterSpacingPx: l || void 0,
|
|
3944
|
-
baseline: s,
|
|
3945
|
-
shadow: m,
|
|
3946
|
-
outline: _,
|
|
3947
|
-
highlight: y,
|
|
3948
|
-
hyperlink: x
|
|
3949
|
-
});
|
|
3950
|
-
}
|
|
3951
|
-
}, S = () => {
|
|
3952
|
-
let e = h.segments.at(-1);
|
|
4019
|
+
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l * Q(t), d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.outline, g = c?.highlight, _ = c?.fontFamily, v = c?.hyperlink, b = (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.outline === h && (e.highlight ?? "") === (g ?? "") && (e.fontFamily ?? "") === (_ ?? "") && vr(e.hyperlink) === vr(v);
|
|
4020
|
+
x += u, k.push({
|
|
4021
|
+
isTab: !1,
|
|
4022
|
+
width: u
|
|
4023
|
+
});
|
|
4024
|
+
let S = y.segments.at(-1);
|
|
4025
|
+
S && b(S) ? S.text += t : y.segments.push({
|
|
4026
|
+
text: t,
|
|
4027
|
+
font: n,
|
|
4028
|
+
fontFamily: _,
|
|
4029
|
+
sizePx: r,
|
|
4030
|
+
color: i,
|
|
4031
|
+
underline: a,
|
|
4032
|
+
underlineStyle: f,
|
|
4033
|
+
underlineColor: p,
|
|
4034
|
+
strikethrough: o,
|
|
4035
|
+
strikeDouble: d,
|
|
4036
|
+
letterSpacingPx: l || void 0,
|
|
4037
|
+
baseline: s,
|
|
4038
|
+
shadow: m,
|
|
4039
|
+
outline: h,
|
|
4040
|
+
highlight: g,
|
|
4041
|
+
hyperlink: v
|
|
4042
|
+
});
|
|
4043
|
+
}, L = () => {
|
|
4044
|
+
let e = y.segments.at(-1);
|
|
3953
4045
|
if (!e || e.math) return !1;
|
|
3954
4046
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
3955
4047
|
if (t) e.text = t[1], n = t[2];
|
|
3956
|
-
else if (
|
|
4048
|
+
else if (y.segments.length > 1) y.segments.pop(), n = e.text;
|
|
3957
4049
|
else return !1;
|
|
3958
|
-
return
|
|
4050
|
+
return F(), I(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
3959
4051
|
strikeDouble: e.strikeDouble,
|
|
3960
4052
|
letterSpacingPx: e.letterSpacingPx,
|
|
3961
4053
|
underlineStyle: e.underlineStyle,
|
|
@@ -3968,81 +4060,88 @@ function $n(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
3968
4060
|
};
|
|
3969
4061
|
for (let n of t.runs) {
|
|
3970
4062
|
if (n.type === "break") {
|
|
3971
|
-
|
|
4063
|
+
F(!0);
|
|
3972
4064
|
continue;
|
|
3973
4065
|
}
|
|
3974
4066
|
if (n.type === "math") {
|
|
3975
|
-
let e =
|
|
3976
|
-
(n.display &&
|
|
4067
|
+
let e = rr.get(n.nodes), t = n.fontSize == null ? r : n.fontSize * G * o * u, i = e ? e.widthEm * t : 0, s = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
4068
|
+
(n.display && x > 0 || !N(i) && x > 0) && F(), k.push({
|
|
4069
|
+
isTab: !1,
|
|
4070
|
+
width: i
|
|
4071
|
+
}), y.segments.push({
|
|
3977
4072
|
text: "",
|
|
3978
4073
|
font: `${t}px sans-serif`,
|
|
3979
4074
|
sizePx: t,
|
|
3980
|
-
color: n.color ?
|
|
4075
|
+
color: n.color ? X(n.color) : a,
|
|
3981
4076
|
underline: !1,
|
|
3982
4077
|
strikethrough: !1,
|
|
3983
4078
|
math: {
|
|
3984
4079
|
nodes: n.nodes,
|
|
3985
4080
|
display: n.display,
|
|
3986
|
-
width:
|
|
4081
|
+
width: i,
|
|
3987
4082
|
ascent: s,
|
|
3988
4083
|
descent: c
|
|
3989
4084
|
}
|
|
3990
|
-
}),
|
|
4085
|
+
}), x += i, n.display && F();
|
|
3991
4086
|
continue;
|
|
3992
4087
|
}
|
|
3993
|
-
let
|
|
3994
|
-
T = n.color ?
|
|
3995
|
-
let E = n.bold ?? t.defBold ??
|
|
3996
|
-
e.font =
|
|
3997
|
-
let
|
|
3998
|
-
(
|
|
3999
|
-
let
|
|
4000
|
-
strikeDouble:
|
|
4001
|
-
letterSpacingPx:
|
|
4088
|
+
let s = n.fontSize == null ? r : n.fontSize * G * o * u, p = ur(n.fontFamily ?? t.defFontFamily ?? null, f), h = n.fontFamilyEa ? ur(n.fontFamilyEa, f) : null, C = n.fontFamilySym ? ur(n.fontFamilySym, f) : null, T;
|
|
4089
|
+
T = n.color ? X(n.color) : n.hyperlink && f.themeHlinkColor ? X(f.themeHlinkColor) : a;
|
|
4090
|
+
let E = n.bold ?? t.defBold ?? c, D = n.italic ?? t.defItalic ?? l, j = Z(E, D, s, p, f), M = h ? Z(E, D, s, h, f) : j;
|
|
4091
|
+
e.font = j;
|
|
4092
|
+
let R = n.caps, z = n.text;
|
|
4093
|
+
(R === "all" || R === "small") && (z = z.toUpperCase());
|
|
4094
|
+
let B = n.fieldType === "slidenum" && d !== void 0 ? String(d) : z, V = n.underline || n.hyperlink !== void 0, H = n.strikeDouble === !0, U = n.letterSpacing == null ? 0 : n.letterSpacing * G * o, W = {
|
|
4095
|
+
strikeDouble: H,
|
|
4096
|
+
letterSpacingPx: U,
|
|
4002
4097
|
underlineStyle: n.underlineStyle,
|
|
4003
|
-
underlineColor: n.underlineColor ?
|
|
4098
|
+
underlineColor: n.underlineColor ? X(n.underlineColor) : void 0,
|
|
4004
4099
|
shadow: n.shadow,
|
|
4005
4100
|
outline: n.outline,
|
|
4006
4101
|
fontFamily: p,
|
|
4007
|
-
highlight: n.highlight ?
|
|
4008
|
-
hyperlink:
|
|
4009
|
-
},
|
|
4010
|
-
for (let r of
|
|
4102
|
+
highlight: n.highlight ? X(n.highlight) : void 0,
|
|
4103
|
+
hyperlink: Mn(n.hyperlink)
|
|
4104
|
+
}, ee = B.split(/(\s+)/);
|
|
4105
|
+
for (let r of ee) {
|
|
4011
4106
|
if (!r) continue;
|
|
4012
4107
|
if (/^\t+$/.test(r)) {
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4108
|
+
O || (e.font = j, A = e.measureText(" ").width);
|
|
4109
|
+
for (let e of r) y.segments.push({
|
|
4110
|
+
text: "",
|
|
4111
|
+
isTab: !0,
|
|
4112
|
+
font: j,
|
|
4113
|
+
fontFamily: p,
|
|
4114
|
+
sizePx: s,
|
|
4115
|
+
color: T,
|
|
4116
|
+
underline: !1,
|
|
4117
|
+
strikethrough: !1
|
|
4118
|
+
}), k.push({
|
|
4119
|
+
isTab: !0,
|
|
4120
|
+
width: 0
|
|
4121
|
+
});
|
|
4122
|
+
O = !0;
|
|
4025
4123
|
continue;
|
|
4026
4124
|
}
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4125
|
+
e.font = j;
|
|
4126
|
+
let a = e.measureText(r).width, o = /^\s+$/.test(r), c = /[-]/;
|
|
4127
|
+
if (c.test(r) && (C != null || Ie(p))) {
|
|
4128
|
+
let t = C ?? p;
|
|
4030
4129
|
for (let i of r) {
|
|
4031
|
-
let r = i, a =
|
|
4130
|
+
let r = i, a = j;
|
|
4032
4131
|
if (c.test(i)) {
|
|
4033
|
-
let e =
|
|
4034
|
-
e === i ? a =
|
|
4132
|
+
let e = Ve(i, t);
|
|
4133
|
+
e === i ? a = Z(E, D, s, t, f) : (r = e, a = Z(E, D, s, "sans-serif", f));
|
|
4035
4134
|
}
|
|
4036
4135
|
e.font = a;
|
|
4037
4136
|
let o = e.measureText(r).width;
|
|
4038
|
-
|
|
4137
|
+
!N(o) && x > 0 && F(), I(r, a, s, T, V, n.strikethrough, n.baseline ?? void 0, W);
|
|
4039
4138
|
}
|
|
4040
4139
|
continue;
|
|
4041
4140
|
}
|
|
4042
|
-
if (
|
|
4141
|
+
if (Sr(r) && (!De(r) || t.eaLnBrk === !1)) {
|
|
4043
4142
|
let i = [];
|
|
4044
4143
|
for (let t of r) {
|
|
4045
|
-
let n =
|
|
4144
|
+
let n = v(t.codePointAt(0) ?? 0) && h != null, r = n ? M : j, a = n ? h : p;
|
|
4046
4145
|
e.font = r, i.push({
|
|
4047
4146
|
ch: t,
|
|
4048
4147
|
w: e.measureText(t).width,
|
|
@@ -4052,59 +4151,104 @@ function $n(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
4052
4151
|
}
|
|
4053
4152
|
if (t.eaLnBrk === !1) {
|
|
4054
4153
|
let e = i.reduce((e, t) => e + t.w, 0);
|
|
4055
|
-
|
|
4056
|
-
for (let e of i)
|
|
4057
|
-
...
|
|
4154
|
+
x > 0 && !N(e) && F();
|
|
4155
|
+
for (let e of i) I(e.ch, e.font, s, T, V, n.strikethrough, n.baseline ?? void 0, {
|
|
4156
|
+
...W,
|
|
4058
4157
|
fontFamily: e.family
|
|
4059
4158
|
});
|
|
4060
4159
|
continue;
|
|
4061
4160
|
}
|
|
4062
4161
|
let a = i;
|
|
4063
4162
|
for (; a.length > 0;) {
|
|
4064
|
-
let e =
|
|
4065
|
-
if (
|
|
4066
|
-
|
|
4067
|
-
|
|
4163
|
+
let e = Number.isFinite(_()) ? _() - P() : x, t = Rn(a, e, _(), m);
|
|
4164
|
+
if (t === 0) {
|
|
4165
|
+
if (x > 0) {
|
|
4166
|
+
F();
|
|
4167
|
+
continue;
|
|
4168
|
+
}
|
|
4169
|
+
t = 1;
|
|
4068
4170
|
}
|
|
4069
|
-
for (let
|
|
4070
|
-
let
|
|
4071
|
-
|
|
4072
|
-
...
|
|
4073
|
-
fontFamily:
|
|
4171
|
+
for (let e = 0; e < t; e++) {
|
|
4172
|
+
let t = a[e];
|
|
4173
|
+
I(t.ch, t.font, s, T, V, n.strikethrough, n.baseline ?? void 0, {
|
|
4174
|
+
...W,
|
|
4175
|
+
fontFamily: t.family
|
|
4074
4176
|
});
|
|
4075
4177
|
}
|
|
4076
|
-
a = a.slice(
|
|
4178
|
+
a = a.slice(t), a.length > 0 && F();
|
|
4077
4179
|
}
|
|
4078
4180
|
continue;
|
|
4079
4181
|
}
|
|
4080
|
-
if (
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4182
|
+
if (De(r)) {
|
|
4183
|
+
let t = ae(r, {
|
|
4184
|
+
cjk: !0,
|
|
4185
|
+
kinsoku: m
|
|
4186
|
+
}), a = h != null && M !== j, o = (e) => a && v(e.codePointAt(0) ?? 0), c = (t) => {
|
|
4187
|
+
let n = U * Q(t), r = "", i = null, a = () => {
|
|
4188
|
+
r !== "" && (e.font = i ? M : j, n += e.measureText(r).width, r = "");
|
|
4189
|
+
};
|
|
4190
|
+
for (let e of t) {
|
|
4191
|
+
let t = o(e);
|
|
4192
|
+
i === null || t === i ? (r += e, i = t) : (a(), r = e, i = t);
|
|
4193
|
+
}
|
|
4194
|
+
return a(), n;
|
|
4195
|
+
}, l = (e) => {
|
|
4196
|
+
let t = "", r = null, i = () => {
|
|
4197
|
+
if (t === "") return;
|
|
4198
|
+
let e = r ? M : j, i = r ? h : p;
|
|
4199
|
+
I(t, e, s, T, V, n.strikethrough, n.baseline ?? void 0, {
|
|
4200
|
+
...W,
|
|
4201
|
+
fontFamily: i
|
|
4202
|
+
}), t = "";
|
|
4203
|
+
};
|
|
4204
|
+
for (let n of e) {
|
|
4205
|
+
let e = o(n);
|
|
4206
|
+
r === null || e === r ? (t += n, r = e) : (i(), t = n, r = e);
|
|
4207
|
+
}
|
|
4208
|
+
i();
|
|
4209
|
+
}, u = b(r), d = r.length, f = 0;
|
|
4210
|
+
for (; f < d;) {
|
|
4211
|
+
let e = P(), n = w(r, t, f, e, c, u);
|
|
4212
|
+
if (n <= f) {
|
|
4213
|
+
if (x > 0) {
|
|
4214
|
+
F();
|
|
4215
|
+
continue;
|
|
4216
|
+
}
|
|
4217
|
+
let a = t.find((e) => e > f) ?? d, o = r.slice(f, a), s = i(o), l = w(o, s, 0, e, c, u);
|
|
4218
|
+
l <= 0 && (l = s.length > 0 ? s[0] : o.length), n = f + l;
|
|
4219
|
+
}
|
|
4220
|
+
l(r.slice(f, n)), f = n, f < d && F();
|
|
4221
|
+
}
|
|
4222
|
+
continue;
|
|
4223
|
+
}
|
|
4224
|
+
if (N(a)) I(r, j, s, T, V, n.strikethrough, n.baseline ?? void 0, W), o && (S = !0);
|
|
4225
|
+
else if (o) x > 0 && F();
|
|
4226
|
+
else if (a > _()) {
|
|
4227
|
+
x > 0 && F();
|
|
4084
4228
|
for (let t of r) {
|
|
4085
|
-
e.font =
|
|
4229
|
+
e.font = j;
|
|
4086
4230
|
let r = e.measureText(t).width;
|
|
4087
|
-
|
|
4231
|
+
!N(r) && x > 0 && F(), I(t, j, s, T, V, n.strikethrough, n.baseline ?? void 0, W);
|
|
4088
4232
|
}
|
|
4089
|
-
} else if (!
|
|
4233
|
+
} else if (!S) I(r, j, s, T, V, n.strikethrough, n.baseline ?? void 0, W);
|
|
4090
4234
|
else {
|
|
4091
|
-
let e = r.codePointAt(0);
|
|
4092
|
-
|
|
4235
|
+
let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), i = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && i !== 8203 && t !== 8203, o = t !== void 0 && m.lineStartForbidden.has(t) && a, c = i !== void 0 && t !== void 0 && a && !De(e) && !De(r) && g(i, t);
|
|
4236
|
+
(o || c) && L() || F(), I(r, j, s, T, V, n.strikethrough, n.baseline ?? void 0, W);
|
|
4093
4237
|
}
|
|
4094
4238
|
}
|
|
4095
4239
|
}
|
|
4096
|
-
return
|
|
4240
|
+
return h.push(y), h;
|
|
4097
4241
|
}
|
|
4098
|
-
async function
|
|
4242
|
+
async function wr(e, t, n, r, i, a) {
|
|
4099
4243
|
if (t && t.fillType === "image") {
|
|
4100
4244
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !a) return;
|
|
4101
4245
|
try {
|
|
4102
|
-
let o = await
|
|
4246
|
+
let o = await Ge(t.imagePath, t.mimeType, t.duotone, a, {
|
|
4103
4247
|
widthPt: n / i / G,
|
|
4104
4248
|
heightPt: r / i / G
|
|
4105
4249
|
});
|
|
4106
4250
|
if (!o) return;
|
|
4107
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
4251
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) Dr(e, o, t.tile, n, r, i);
|
|
4108
4252
|
else {
|
|
4109
4253
|
let i = t.fillRect ?? {}, a = i.l ?? 0, s = i.t ?? 0, c = i.r ?? 0, l = i.b ?? 0, u = a * n, d = s * r, f = n * (1 - a - c), p = r * (1 - s - l);
|
|
4110
4254
|
e.drawImage(o, u, d, f, p);
|
|
@@ -4113,10 +4257,10 @@ async function er(e, t, n, r, i, a) {
|
|
|
4113
4257
|
} catch {}
|
|
4114
4258
|
return;
|
|
4115
4259
|
}
|
|
4116
|
-
e.fillStyle =
|
|
4260
|
+
e.fillStyle = nr(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
4117
4261
|
}
|
|
4118
|
-
var
|
|
4119
|
-
function
|
|
4262
|
+
var Tr = 9525;
|
|
4263
|
+
function Er(e, t, n, r, i) {
|
|
4120
4264
|
let a;
|
|
4121
4265
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4122
4266
|
let o;
|
|
@@ -4125,10 +4269,10 @@ function nr(e, t, n, r, i) {
|
|
|
4125
4269
|
ay: o
|
|
4126
4270
|
};
|
|
4127
4271
|
}
|
|
4128
|
-
function
|
|
4129
|
-
let o = t.width *
|
|
4272
|
+
function Dr(e, t, n, r, i, a) {
|
|
4273
|
+
let o = t.width * Tr * n.sx * a, s = t.height * Tr * n.sy * a;
|
|
4130
4274
|
if (!(o > 0) || !(s > 0)) return;
|
|
4131
|
-
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u =
|
|
4275
|
+
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = T(o * (c ? 2 : 1), s * (l ? 2 : 1));
|
|
4132
4276
|
if (!u) return;
|
|
4133
4277
|
let d = u.getContext("2d");
|
|
4134
4278
|
if (!d) return;
|
|
@@ -4138,79 +4282,121 @@ function rr(e, t, n, r, i, a) {
|
|
|
4138
4282
|
f(0, 0, !1, !1), c && f(o, 0, !0, !1), l && f(0, s, !1, !0), c && l && f(o, s, !0, !0);
|
|
4139
4283
|
let p = e.createPattern(u, "repeat");
|
|
4140
4284
|
if (!p) return;
|
|
4141
|
-
let { ax: m, ay: h } =
|
|
4285
|
+
let { ax: m, ay: h } = Er(n.algn, r, i, o, s), g = m + Y(n.tx, a), _ = h + Y(n.ty, a);
|
|
4142
4286
|
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());
|
|
4143
4287
|
}
|
|
4144
|
-
function
|
|
4288
|
+
function Or(e, t, n) {
|
|
4145
4289
|
if (!t) return;
|
|
4146
|
-
let r = t.dir * Math.PI / 180, i =
|
|
4147
|
-
e.shadowColor =
|
|
4290
|
+
let r = t.dir * Math.PI / 180, i = Y(t.dist, n);
|
|
4291
|
+
e.shadowColor = X(t.color, t.alpha), e.shadowBlur = Y(t.blur, n), e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4148
4292
|
}
|
|
4149
|
-
function
|
|
4150
|
-
t && (e.shadowColor =
|
|
4293
|
+
function kr(e, t, n) {
|
|
4294
|
+
t && (e.shadowColor = X(t.color, t.alpha), e.shadowBlur = Y(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4151
4295
|
}
|
|
4152
|
-
function
|
|
4296
|
+
function Ar(e) {
|
|
4153
4297
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4154
4298
|
}
|
|
4155
|
-
var
|
|
4156
|
-
function
|
|
4299
|
+
var jr = 8, Mr = 1, Nr = 1, Pr = 256;
|
|
4300
|
+
function Fr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
4157
4301
|
if (r <= 0) return;
|
|
4158
|
-
let
|
|
4159
|
-
for (;
|
|
4160
|
-
let e = Math.min(
|
|
4161
|
-
if (n >=
|
|
4162
|
-
|
|
4302
|
+
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(Pr, Math.max(1, Math.round(b / jr))), S = (e) => Rr(e, a, r, o, s, c, u, d), C = S(x), w = Br(C, a, o, s, c, u, d, l, i, -g, _);
|
|
4303
|
+
for (; w > Nr && x < Pr;) {
|
|
4304
|
+
let e = Math.min(Pr, x * 2), t = S(e), n = Br(t, a, o, s, c, u, d, l, i, -g, _);
|
|
4305
|
+
if (n >= w * .75) {
|
|
4306
|
+
C = t;
|
|
4163
4307
|
break;
|
|
4164
4308
|
}
|
|
4165
|
-
|
|
4309
|
+
x = e, C = t, w = n;
|
|
4310
|
+
}
|
|
4311
|
+
let E = 1e4, D = Mr / (l * i), O = C.length - 1, k = (e, t, n) => e === 0 ? -E : t - n - D, A = (e, t, n) => e === O ? E : t - n + D, j = (e, r) => {
|
|
4312
|
+
e.fillStyle = r;
|
|
4313
|
+
for (let r = 0; r <= O; r++) {
|
|
4314
|
+
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
4315
|
+
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();
|
|
4316
|
+
let c = k(r, i, s), u = A(r, a, s);
|
|
4317
|
+
e.rect(c, -E, u - c, 2 * E), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4318
|
+
}
|
|
4319
|
+
}, M = Ir(m), N = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4320
|
+
if (M >= 1 && N >= 1) {
|
|
4321
|
+
j(e, m);
|
|
4322
|
+
return;
|
|
4323
|
+
}
|
|
4324
|
+
if (M <= 0 || N <= 0) return;
|
|
4325
|
+
let P = typeof e.getTransform == "function" ? e.getTransform() : null;
|
|
4326
|
+
if (!P) {
|
|
4327
|
+
j(e, m);
|
|
4328
|
+
return;
|
|
4329
|
+
}
|
|
4330
|
+
let F = Infinity, I = Infinity, L = -Infinity, R = -Infinity;
|
|
4331
|
+
for (let e = 0; e <= O; e++) {
|
|
4332
|
+
let { s0: t, s1: r, g: i } = C[e], a = (t + r) / 2, o = -a + n / 2, s = Math.max(k(e, t, a), o - v), c = Math.min(A(e, r, a), o + y);
|
|
4333
|
+
if (!(c <= s)) for (let [e, t] of [
|
|
4334
|
+
[s, -g],
|
|
4335
|
+
[c, -g],
|
|
4336
|
+
[s, _],
|
|
4337
|
+
[c, _]
|
|
4338
|
+
]) {
|
|
4339
|
+
let n = zr(i, l, e, t), r = f + n.x, a = p + n.y, o = P.a * r + P.c * a + P.e, s = P.b * r + P.d * a + P.f;
|
|
4340
|
+
o < F && (F = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
|
|
4341
|
+
}
|
|
4166
4342
|
}
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
e.beginPath(), e.rect(c, -S, u - c, 2 * S), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4343
|
+
if (!(L > F && R > I)) return;
|
|
4344
|
+
let z = Math.floor(F - 2), B = Math.floor(I - 2), V = T(Math.ceil(L + 2) - z, Math.ceil(R + 2) - B), H = V ? V.getContext("2d") : null;
|
|
4345
|
+
if (!V || !H) {
|
|
4346
|
+
j(e, m);
|
|
4347
|
+
return;
|
|
4173
4348
|
}
|
|
4349
|
+
H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H, Lr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = N * M, e.drawImage(V, z, B), e.restore();
|
|
4350
|
+
}
|
|
4351
|
+
function Ir(e) {
|
|
4352
|
+
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4353
|
+
if (!t) return 1;
|
|
4354
|
+
let n = parseFloat(t[1]);
|
|
4355
|
+
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4174
4356
|
}
|
|
4175
|
-
function
|
|
4357
|
+
function Lr(e) {
|
|
4358
|
+
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4359
|
+
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4360
|
+
}
|
|
4361
|
+
function Rr(e, t, n, r, i, a, o, s) {
|
|
4176
4362
|
let c = Array(e);
|
|
4177
4363
|
for (let l = 0; l < e; l++) {
|
|
4178
4364
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4179
4365
|
c[l] = {
|
|
4180
4366
|
s0: u,
|
|
4181
4367
|
s1: d,
|
|
4182
|
-
g:
|
|
4368
|
+
g: vt(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4183
4369
|
};
|
|
4184
4370
|
}
|
|
4185
4371
|
return c;
|
|
4186
4372
|
}
|
|
4187
|
-
function
|
|
4373
|
+
function zr(e, t, n, r) {
|
|
4188
4374
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4189
4375
|
return {
|
|
4190
4376
|
x: e.x + s * o - c * a,
|
|
4191
4377
|
y: e.y + c * o + s * a
|
|
4192
4378
|
};
|
|
4193
4379
|
}
|
|
4194
|
-
function
|
|
4380
|
+
function Br(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4195
4381
|
let d = 0;
|
|
4196
4382
|
for (let f of e) {
|
|
4197
4383
|
let e = (f.s0 + f.s1) / 2;
|
|
4198
4384
|
for (let p of [f.s0, f.s1]) {
|
|
4199
|
-
let m =
|
|
4385
|
+
let m = vt(t, (n + p) / r * i, a, o);
|
|
4200
4386
|
for (let t of [l, u]) {
|
|
4201
|
-
let n =
|
|
4387
|
+
let n = zr(m, s, 0, t), r = zr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4202
4388
|
i > d && (d = i);
|
|
4203
4389
|
}
|
|
4204
4390
|
}
|
|
4205
4391
|
}
|
|
4206
4392
|
return d;
|
|
4207
4393
|
}
|
|
4208
|
-
function
|
|
4209
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4394
|
+
function Vr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4395
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = mt(n, r, p, m);
|
|
4210
4396
|
if (!h) return;
|
|
4211
4397
|
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * G * c, y = [];
|
|
4212
4398
|
for (let n of t.paragraphs) {
|
|
4213
|
-
let t =
|
|
4399
|
+
let t = Cr(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * G * c, n.defColor ? X(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4214
4400
|
for (let e of t) y.push(e);
|
|
4215
4401
|
}
|
|
4216
4402
|
if (y.length === 0) return;
|
|
@@ -4229,10 +4415,10 @@ function hr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4229
4415
|
}
|
|
4230
4416
|
e.font = t.font;
|
|
4231
4417
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4232
|
-
a += r.width + n *
|
|
4418
|
+
a += r.width + n * Q(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));
|
|
4233
4419
|
}
|
|
4234
4420
|
if (a <= 0) continue;
|
|
4235
|
-
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 =
|
|
4421
|
+
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 = _t(h, a), b = 0;
|
|
4236
4422
|
for (let t of n.segments) {
|
|
4237
4423
|
if (t.math) {
|
|
4238
4424
|
b += t.math.width;
|
|
@@ -4240,20 +4426,20 @@ function hr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4240
4426
|
}
|
|
4241
4427
|
e.font = t.font, e.fillStyle = t.color;
|
|
4242
4428
|
let n = t.letterSpacingPx ?? 0, o = [...t.text];
|
|
4243
|
-
for (let
|
|
4244
|
-
let o = e.measureText(
|
|
4429
|
+
for (let s of o) {
|
|
4430
|
+
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4245
4431
|
if (!h.singleEdge && o > 0) {
|
|
4246
|
-
|
|
4432
|
+
Fr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4247
4433
|
continue;
|
|
4248
4434
|
}
|
|
4249
|
-
let
|
|
4250
|
-
e.save(), e.translate(d +
|
|
4435
|
+
let l = vt(h, (b + o / 2) / a * v, _, c);
|
|
4436
|
+
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;
|
|
4251
4437
|
}
|
|
4252
4438
|
}
|
|
4253
4439
|
}
|
|
4254
4440
|
e.restore();
|
|
4255
4441
|
}
|
|
4256
|
-
function
|
|
4442
|
+
function Hr(e, t, n, r, i, a, o) {
|
|
4257
4443
|
let s = Math.min(r, i);
|
|
4258
4444
|
switch (e) {
|
|
4259
4445
|
case "rightarrow":
|
|
@@ -4283,23 +4469,26 @@ function gr(e, t, n, r, i, a, o) {
|
|
|
4283
4469
|
default: return null;
|
|
4284
4470
|
}
|
|
4285
4471
|
}
|
|
4286
|
-
function
|
|
4472
|
+
function Ur(e, t) {
|
|
4473
|
+
return e.defaultTextColor ? X(e.defaultTextColor) : t.smartArtFallbackTextColor != null && Kn(e) ? t.smartArtFallbackTextColor : null;
|
|
4474
|
+
}
|
|
4475
|
+
function Wr(e, t, n, r = "#000000", i, a = {
|
|
4287
4476
|
themeMajorFont: null,
|
|
4288
4477
|
themeMinorFont: null,
|
|
4289
4478
|
dpr: 1
|
|
4290
4479
|
}, o, s) {
|
|
4291
|
-
let c =
|
|
4292
|
-
if (
|
|
4293
|
-
if (t.stroke && (e.save(),
|
|
4294
|
-
let
|
|
4295
|
-
|
|
4480
|
+
let c = Y(t.x, n), l = Y(t.y, n), u = Y(t.width, n), d = Y(t.height, n);
|
|
4481
|
+
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4482
|
+
if (t.stroke && (e.save(), $(e, t.stroke, n), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
4483
|
+
let f = Ur(t, a);
|
|
4484
|
+
Xr(e, t.textBody, c, l, u, d, n, f, t.rotation, t.flipH, t.flipV, r, i, a, o, !1, s);
|
|
4296
4485
|
}
|
|
4297
4486
|
return;
|
|
4298
4487
|
}
|
|
4299
|
-
let
|
|
4300
|
-
if (
|
|
4301
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c),
|
|
4302
|
-
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c +
|
|
4488
|
+
let f = t.scene3d && It(t.scene3d.camera) ? t.scene3d : null;
|
|
4489
|
+
if (f && u > 0 && d > 0) {
|
|
4490
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), p = s > 0 ? Math.sqrt(s) : 1, m = Zr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, p), h = Qr(t.sp3d, f.camera, u, d, n, p);
|
|
4491
|
+
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4303
4492
|
let g = {
|
|
4304
4493
|
...t,
|
|
4305
4494
|
x: 0,
|
|
@@ -4309,22 +4498,22 @@ function _r(e, t, n, r = "#000000", i, a = {
|
|
|
4309
4498
|
flipV: !1,
|
|
4310
4499
|
scene3d: void 0
|
|
4311
4500
|
};
|
|
4312
|
-
if (
|
|
4313
|
-
|
|
4501
|
+
if ($r(e, f.camera, c, l, u, d, (e) => {
|
|
4502
|
+
Wr(e, g, n, r, i, a, void 0);
|
|
4314
4503
|
}, {
|
|
4315
4504
|
bevels: m,
|
|
4316
4505
|
extrusion: h ?? void 0,
|
|
4317
|
-
edgePadCss: (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (h ? Math.hypot(h.offsetX, h.offsetY) /
|
|
4506
|
+
edgePadCss: (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (h ? Math.hypot(h.offsetX, h.offsetY) / p : 0) + 2
|
|
4318
4507
|
})) {
|
|
4319
4508
|
e.restore();
|
|
4320
4509
|
return;
|
|
4321
4510
|
}
|
|
4322
4511
|
e.restore();
|
|
4323
4512
|
}
|
|
4324
|
-
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c +
|
|
4325
|
-
let
|
|
4326
|
-
|
|
4327
|
-
let
|
|
4513
|
+
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4514
|
+
let p = t.geometry.toLowerCase(), m = nr(t.fill, e, c, l, u, d);
|
|
4515
|
+
Or(e, t.shadow ?? null, n), t.shadow || kr(e, t.glow ?? null, n);
|
|
4516
|
+
let h = new Set([
|
|
4328
4517
|
"line",
|
|
4329
4518
|
"straightconnector1",
|
|
4330
4519
|
"bentconnector2",
|
|
@@ -4335,7 +4524,7 @@ function _r(e, t, n, r = "#000000", i, a = {
|
|
|
4335
4524
|
"curvedconnector3",
|
|
4336
4525
|
"curvedconnector4",
|
|
4337
4526
|
"curvedconnector5"
|
|
4338
|
-
]),
|
|
4527
|
+
]), g = new Set([
|
|
4339
4528
|
"callout1",
|
|
4340
4529
|
"callout2",
|
|
4341
4530
|
"callout3",
|
|
@@ -4348,12 +4537,12 @@ function _r(e, t, n, r = "#000000", i, a = {
|
|
|
4348
4537
|
"accentbordercallout1",
|
|
4349
4538
|
"accentbordercallout2",
|
|
4350
4539
|
"accentbordercallout3"
|
|
4351
|
-
]),
|
|
4352
|
-
let i = r ??
|
|
4353
|
-
|
|
4354
|
-
} : null, o = () =>
|
|
4355
|
-
if (
|
|
4356
|
-
|
|
4540
|
+
]), _ = (e) => g.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), v = !t.custGeom && W(p), y = (e, r) => {
|
|
4541
|
+
let i = r ?? m, a = r ? null : t.stroke ? () => {
|
|
4542
|
+
$(e, t.stroke, n), e.stroke();
|
|
4543
|
+
} : null, o = () => Ar(e);
|
|
4544
|
+
if (v && !r) {
|
|
4545
|
+
he(e, p, c, l, u, d, [
|
|
4357
4546
|
t.adj,
|
|
4358
4547
|
t.adj2,
|
|
4359
4548
|
t.adj3,
|
|
@@ -4362,28 +4551,28 @@ function _r(e, t, n, r = "#000000", i, a = {
|
|
|
4362
4551
|
t.adj6,
|
|
4363
4552
|
t.adj7,
|
|
4364
4553
|
t.adj8
|
|
4365
|
-
], i, a, o,
|
|
4554
|
+
], i, a, o, _(p) ? { skipTrailingStroke: !0 } : void 0);
|
|
4366
4555
|
return;
|
|
4367
4556
|
}
|
|
4368
|
-
e.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4369
|
-
},
|
|
4370
|
-
x: c *
|
|
4371
|
-
y:
|
|
4372
|
-
w:
|
|
4373
|
-
h:
|
|
4374
|
-
},
|
|
4375
|
-
e.setTransform(
|
|
4557
|
+
e.beginPath(), t.custGeom && t.custGeom.length > 0 ? Gr(e, t.custGeom, c, l, u, d) : We(e, p, c, l, u, d, t.adj, t.adj2, t.adj3, t.adj4), i && p !== "arc" && (e.fillStyle = i, p === "donut" || p === "smileyface" || p === "frame" ? e.fill("evenodd") : e.fill(), r || o()), a && a();
|
|
4558
|
+
}, b = e.canvas.width || 0, x = e.canvas.height || 0, S = e.getTransform(), C = Math.abs(S.a * S.d - S.b * S.c), w = C > 0 ? Math.sqrt(C) : 1, T = {
|
|
4559
|
+
x: c * w,
|
|
4560
|
+
y: l * w,
|
|
4561
|
+
w: u * w,
|
|
4562
|
+
h: d * w
|
|
4563
|
+
}, E = n * w, D = (e) => {
|
|
4564
|
+
e.setTransform(S);
|
|
4376
4565
|
};
|
|
4377
|
-
if (t.reflection &&
|
|
4378
|
-
|
|
4379
|
-
},
|
|
4380
|
-
|
|
4381
|
-
},
|
|
4382
|
-
|
|
4383
|
-
}), e.restore()) :
|
|
4384
|
-
|
|
4385
|
-
},
|
|
4386
|
-
let r =
|
|
4566
|
+
if (t.reflection && b > 0 && x > 0 && (e.save(), e.setTransform(new DOMMatrix()), Tt(e, (e) => {
|
|
4567
|
+
D(e), y(e);
|
|
4568
|
+
}, T, t.reflection, E, b, x), e.restore()), t.softEdge && b > 0 && x > 0 ? (e.save(), e.setTransform(new DOMMatrix()), wt(e, (e) => {
|
|
4569
|
+
D(e), y(e);
|
|
4570
|
+
}, T, t.softEdge, E, b, x, (e) => {
|
|
4571
|
+
D(e), y(e, "#000");
|
|
4572
|
+
}), e.restore()) : y(e), t.innerShadow && b > 0 && x > 0 && (e.save(), e.setTransform(new DOMMatrix()), Ct(e, (e) => {
|
|
4573
|
+
D(e), y(e, "#000");
|
|
4574
|
+
}, T, t.innerShadow, E, b, x), e.restore()), t.stroke && (h.has(p) || g.has(p))) {
|
|
4575
|
+
let r = H(p, c, l, u, d, [
|
|
4387
4576
|
t.adj,
|
|
4388
4577
|
t.adj2,
|
|
4389
4578
|
t.adj3,
|
|
@@ -4394,52 +4583,52 @@ function _r(e, t, n, r = "#000000", i, a = {
|
|
|
4394
4583
|
t.adj8
|
|
4395
4584
|
]);
|
|
4396
4585
|
if (r) {
|
|
4397
|
-
let i = t.stroke.cmpd, a =
|
|
4398
|
-
if (
|
|
4586
|
+
let i = t.stroke.cmpd, a = p === "line" || p === "straightconnector1";
|
|
4587
|
+
if (_(p) && r.vertices.length >= 2 && !(i && a)) {
|
|
4399
4588
|
let i = r.vertices.map((e) => ({
|
|
4400
4589
|
x: e.x,
|
|
4401
4590
|
y: e.y
|
|
4402
4591
|
}));
|
|
4403
4592
|
if (t.stroke.tailEnd) {
|
|
4404
|
-
let e =
|
|
4405
|
-
i[i.length - 1] =
|
|
4593
|
+
let e = Pe(t.stroke.tailEnd, t.stroke, n);
|
|
4594
|
+
i[i.length - 1] = Re(i[i.length - 1], i[i.length - 2], e);
|
|
4406
4595
|
}
|
|
4407
4596
|
if (t.stroke.headEnd) {
|
|
4408
|
-
let e =
|
|
4409
|
-
i[0] =
|
|
4597
|
+
let e = Pe(t.stroke.headEnd, t.stroke, n);
|
|
4598
|
+
i[0] = Re(i[0], i[1], e);
|
|
4410
4599
|
}
|
|
4411
|
-
|
|
4600
|
+
$(e, t.stroke, n), e.beginPath(), e.moveTo(i[0].x, i[0].y);
|
|
4412
4601
|
for (let t = 1; t < i.length; t++) e.lineTo(i[t].x, i[t].y);
|
|
4413
4602
|
e.stroke();
|
|
4414
4603
|
}
|
|
4415
|
-
i && a &&
|
|
4604
|
+
i && a && ai(e, r.start, r.end, t.stroke, i, n), t.stroke.tailEnd && Ue(e, r.end.x, r.end.y, r.end.angle, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && Ue(e, r.start.x, r.start.y, r.start.angle, t.stroke.headEnd, t.stroke, n);
|
|
4416
4605
|
}
|
|
4417
4606
|
} else 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")) {
|
|
4418
|
-
let { start: r, end: i } =
|
|
4419
|
-
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" &&
|
|
4607
|
+
let { start: r, end: i } = it(t.custGeom);
|
|
4608
|
+
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && Ue(e, c + r.x * u, l + r.y * d, Math.atan2(r.dy * d, r.dx * u), t.stroke.headEnd, t.stroke, n), i && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && Ue(e, c + i.x * u, l + i.y * d, Math.atan2(i.dy * d, i.dx * u), t.stroke.tailEnd, t.stroke, n);
|
|
4420
4609
|
}
|
|
4421
4610
|
if (t.textBody) {
|
|
4422
|
-
let
|
|
4611
|
+
let f = Ur(t, a);
|
|
4423
4612
|
if (e.save(), t.flipH || t.flipV) {
|
|
4424
|
-
let n = c +
|
|
4613
|
+
let n = c + u / 2, r = l + d / 2;
|
|
4425
4614
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4426
4615
|
}
|
|
4427
|
-
let
|
|
4428
|
-
if (t.textRect)
|
|
4429
|
-
else if (
|
|
4430
|
-
let e =
|
|
4431
|
-
|
|
4616
|
+
let m = c, h = l, g = u, _ = d;
|
|
4617
|
+
if (t.textRect) m = Y(t.textRect.x, n), h = Y(t.textRect.y, n), g = Y(t.textRect.width, n), _ = Y(t.textRect.height, n);
|
|
4618
|
+
else if (p === "ellipse") {
|
|
4619
|
+
let e = u * (1 - 1 / Math.SQRT2) / 2, t = d * (1 - 1 / Math.SQRT2) / 2;
|
|
4620
|
+
m = c + e, h = l + t, g = u / Math.SQRT2, _ = d / Math.SQRT2;
|
|
4432
4621
|
} else {
|
|
4433
|
-
let e =
|
|
4434
|
-
e && (
|
|
4622
|
+
let e = Hr(p, c, l, u, d, t.adj, t.adj2);
|
|
4623
|
+
e && (m = e.tx, h = e.ty, g = e.tw, _ = e.th);
|
|
4435
4624
|
}
|
|
4436
|
-
|
|
4625
|
+
Xr(e, t.textBody, m, h, g, _, n, f, t.rotation, !1, !1, r, i, a, o, !1, s), e.restore();
|
|
4437
4626
|
}
|
|
4438
4627
|
e.restore();
|
|
4439
4628
|
}
|
|
4440
|
-
var
|
|
4441
|
-
function
|
|
4442
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4629
|
+
var Gr = Fe;
|
|
4630
|
+
function Kr(e, t) {
|
|
4631
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = qr(e).toLowerCase(), o = qr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4443
4632
|
switch (t) {
|
|
4444
4633
|
case "arabicPlain": return n;
|
|
4445
4634
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4466,7 +4655,7 @@ function yr(e, t) {
|
|
|
4466
4655
|
default: return `${n}.`;
|
|
4467
4656
|
}
|
|
4468
4657
|
}
|
|
4469
|
-
function
|
|
4658
|
+
function qr(e) {
|
|
4470
4659
|
let t = [
|
|
4471
4660
|
1e3,
|
|
4472
4661
|
900,
|
|
@@ -4499,100 +4688,100 @@ function br(e) {
|
|
|
4499
4688
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4500
4689
|
return r;
|
|
4501
4690
|
}
|
|
4502
|
-
function
|
|
4691
|
+
function Jr(e) {
|
|
4503
4692
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4504
4693
|
return !1;
|
|
4505
4694
|
}
|
|
4506
|
-
function
|
|
4507
|
-
let n =
|
|
4508
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4695
|
+
function Yr(e, t) {
|
|
4696
|
+
let n = Jr(e);
|
|
4697
|
+
if (e.bullet.type === "char") return t.clear(), n ? Ve(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4509
4698
|
if (e.bullet.type === "autoNum") {
|
|
4510
4699
|
if (!n) return "";
|
|
4511
4700
|
let r = e.lvl;
|
|
4512
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4701
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Kr(t.get(r), e.bullet.numType);
|
|
4513
4702
|
}
|
|
4514
4703
|
return t.clear(), "";
|
|
4515
4704
|
}
|
|
4516
|
-
function
|
|
4705
|
+
function Xr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
|
|
4517
4706
|
themeMajorFont: null,
|
|
4518
4707
|
themeMinorFont: null,
|
|
4519
4708
|
dpr: 1
|
|
4520
|
-
},
|
|
4709
|
+
}, m, h = !1, g, _ = !1) {
|
|
4521
4710
|
let v = t.vert === "vert" || t.vert === "eaVert", y = t.vert === "vert270";
|
|
4522
4711
|
if (v || y) {
|
|
4523
|
-
let
|
|
4712
|
+
let l = n + i / 2, u = r + a / 2, _ = v ? 90 : -90, b = m ? (e) => m({
|
|
4524
4713
|
...e,
|
|
4525
|
-
inShapeX: e.inShapeX -
|
|
4526
|
-
inShapeY: e.inShapeY -
|
|
4714
|
+
inShapeX: e.inShapeX - a / 2 + i / 2,
|
|
4715
|
+
inShapeY: e.inShapeY - i / 2 + a / 2,
|
|
4527
4716
|
shapeX: n,
|
|
4528
|
-
shapeY:
|
|
4529
|
-
shapeW:
|
|
4530
|
-
shapeH:
|
|
4531
|
-
rotation:
|
|
4532
|
-
textBodyRotation:
|
|
4717
|
+
shapeY: r,
|
|
4718
|
+
shapeW: i,
|
|
4719
|
+
shapeH: a,
|
|
4720
|
+
rotation: c,
|
|
4721
|
+
textBodyRotation: _
|
|
4533
4722
|
}) : void 0;
|
|
4534
|
-
if (
|
|
4535
|
-
e.save(), e.translate(
|
|
4723
|
+
if (h) return i;
|
|
4724
|
+
e.save(), e.translate(l, u), e.rotate(y ? -Math.PI / 2 : Math.PI / 2), Xr(e, {
|
|
4536
4725
|
...t,
|
|
4537
4726
|
vert: "horz"
|
|
4538
|
-
}, -
|
|
4727
|
+
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, b, !1, g, t.vert === "eaVert"), e.restore();
|
|
4539
4728
|
return;
|
|
4540
4729
|
}
|
|
4541
4730
|
let b = t.textWarp;
|
|
4542
|
-
if (!
|
|
4543
|
-
|
|
4731
|
+
if (!h && b && lt(b.preset)) {
|
|
4732
|
+
Vr(e, t, b.preset, b.adj ?? [], n, r, i, a, o, s ?? d, p);
|
|
4544
4733
|
return;
|
|
4545
4734
|
}
|
|
4546
|
-
let x =
|
|
4547
|
-
let
|
|
4735
|
+
let x = Y(t.lIns, o), S = Y(t.rIns, o), C = Y(t.tIns, o), w = Y(t.bIns, o), T = t.wrap !== "none", E = t.autoFit === "sp" ? T && xr(e, t, i, x, S, o, p) : T, D = Math.max(1, t.numCol ?? 1), O = Y(t.spcCol ?? 0, o), A = t.defaultBold ?? !1, j = t.defaultItalic ?? !1, M = s ?? d, N = (r) => {
|
|
4736
|
+
let a = (t.defaultFontSize ?? 18) * G * o * r, s = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4548
4737
|
for (let u = 0; u < t.paragraphs.length; u++) {
|
|
4549
|
-
let d = t.paragraphs[u],
|
|
4738
|
+
let d = t.paragraphs[u], m = Y(d.marL, o), h = Y(d.marR, o), g = Y(d.indent, o), _ = d.defFontSize == null ? a : d.defFontSize * G * o * r, v = d.defColor ? X(d.defColor) : M, y = yr(d), b = (() => {
|
|
4550
4739
|
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4551
4740
|
return null;
|
|
4552
|
-
})(), C = b == null ? _ : b * G *
|
|
4741
|
+
})(), C = b == null ? _ : b * G * o * r, w = (() => {
|
|
4553
4742
|
for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
|
|
4554
4743
|
return null;
|
|
4555
|
-
})(), T = w ?
|
|
4556
|
-
|
|
4557
|
-
let I =
|
|
4744
|
+
})(), T = w ? X(w) : v, k = "", N = Z(!1, !1, C, "sans-serif", p), P = T, F = null;
|
|
4745
|
+
k = Yr(d, l);
|
|
4746
|
+
let I = jn(d.bullet);
|
|
4558
4747
|
if (I.type === "char") {
|
|
4559
4748
|
let e = I;
|
|
4560
|
-
N =
|
|
4561
|
-
} else if (I.type === "autoNum") N =
|
|
4749
|
+
N = Z(!1, !1, e.sizePts == null ? e.sizePct == null ? C : C * (e.sizePct / 100) : e.sizePts * G * o * r, k === e.char ? ur(e.fontFamily ?? null, p) : "sans-serif", p), P = e.color ? X(e.color) : T;
|
|
4750
|
+
} else if (I.type === "autoNum") N = Z(!1, !1, C, "sans-serif", p), P = I.color ? X(I.color) : T;
|
|
4562
4751
|
else if (I.type === "blip") {
|
|
4563
|
-
let e = I, t = e.sizePct == null ? C : C * (e.sizePct / 100);
|
|
4752
|
+
let e = I, t = e.sizePts == null ? e.sizePct == null ? C : C * (e.sizePct / 100) : e.sizePts * G * o * r;
|
|
4564
4753
|
F = {
|
|
4565
4754
|
imagePath: e.imagePath,
|
|
4566
4755
|
mimeType: e.mimeType,
|
|
4567
4756
|
sizePx: t
|
|
4568
4757
|
};
|
|
4569
4758
|
}
|
|
4570
|
-
let L = D > 1 ? (
|
|
4759
|
+
let L = D > 1 ? (i - x - S - (D - 1) * O) / D : i - x - S, R = n + x + m, z = n + x + m + g, B = L - m - h, V = Cr(e, d, E ? B : Infinity, _, v, o, m, A, j, r, f, p, br(y, g)), H = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * G * o * r, U = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * G * o * r;
|
|
4571
4760
|
for (let n = 0; n < V.length; n++) {
|
|
4572
4761
|
let r = V[n], i = n === 0, a = n === V.length - 1, l = 0, f = 0;
|
|
4573
4762
|
for (let e of r.segments) {
|
|
4574
4763
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4575
4764
|
if (t > l && (l = t), !e.math) {
|
|
4576
|
-
let t =
|
|
4765
|
+
let t = fe(e.fontFamily, e.sizePx);
|
|
4577
4766
|
t > f && (f = t);
|
|
4578
4767
|
}
|
|
4579
4768
|
}
|
|
4580
|
-
if (l === 0 && (l = _), i &&
|
|
4769
|
+
if (l === 0 && (l = _), i && k) {
|
|
4581
4770
|
e.font = N;
|
|
4582
4771
|
let t = e.measureText("M"), n = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
|
|
4583
4772
|
n > l && (l = n);
|
|
4584
4773
|
}
|
|
4585
4774
|
i && F && F.sizePx > l && (l = F.sizePx);
|
|
4586
4775
|
let p = Math.max(l * 1.2, f), m;
|
|
4587
|
-
m = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val * G *
|
|
4588
|
-
let h = m + (a ?
|
|
4589
|
-
|
|
4776
|
+
m = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val * G * o : p, t.autoFit === "norm" && t.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (m *= 1 - t.lnSpcReduction);
|
|
4777
|
+
let h = m + (a ? U : 0), v = i && u > 0 ? H : 0, b = i ? br(y, g) : 0, x = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), S = i && x ? F : null;
|
|
4778
|
+
s.push({
|
|
4590
4779
|
line: r,
|
|
4591
4780
|
linePx: h,
|
|
4592
4781
|
lineHeight: m,
|
|
4593
4782
|
topGapPx: v,
|
|
4594
4783
|
textXOffset: b,
|
|
4595
|
-
bulletLabel: i ?
|
|
4784
|
+
bulletLabel: i ? k : "",
|
|
4596
4785
|
bulletFont: N,
|
|
4597
4786
|
bulletColor: P,
|
|
4598
4787
|
bulletX: z,
|
|
@@ -4606,84 +4795,118 @@ function Cr(e, t, n, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4606
4795
|
}
|
|
4607
4796
|
}
|
|
4608
4797
|
return {
|
|
4609
|
-
allLines:
|
|
4798
|
+
allLines: s,
|
|
4610
4799
|
totalHeight: c
|
|
4611
4800
|
};
|
|
4612
|
-
}, { allLines:
|
|
4613
|
-
if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines:
|
|
4801
|
+
}, { allLines: P, totalHeight: F } = N(1);
|
|
4802
|
+
if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: P, totalHeight: F} = N(t.fontScale));
|
|
4614
4803
|
else {
|
|
4615
|
-
let e =
|
|
4616
|
-
if (
|
|
4804
|
+
let e = a - C - w;
|
|
4805
|
+
if (F > e && e > 0) {
|
|
4617
4806
|
let t = .1, n = 1;
|
|
4618
4807
|
for (let r = 0; r < 6; r++) {
|
|
4619
4808
|
let r = (t + n) / 2;
|
|
4620
|
-
|
|
4809
|
+
N(r).totalHeight <= e ? t = r : n = r;
|
|
4621
4810
|
}
|
|
4622
|
-
({allLines:
|
|
4811
|
+
({allLines: P, totalHeight: F} = N(t));
|
|
4623
4812
|
}
|
|
4624
4813
|
}
|
|
4625
|
-
if (
|
|
4626
|
-
let
|
|
4627
|
-
|
|
4628
|
-
let
|
|
4629
|
-
|
|
4630
|
-
let
|
|
4631
|
-
for (let
|
|
4632
|
-
let { line:
|
|
4633
|
-
D > 1 &&
|
|
4634
|
-
let
|
|
4635
|
-
|
|
4814
|
+
if (h) return C + F + w;
|
|
4815
|
+
let I = t.verticalAnchor ?? "t", L = r, R;
|
|
4816
|
+
a === 0 && I === "b" ? (R = C + F + w, L = r - R) : R = t.autoFit === "sp" ? Math.max(a, C + F + w) : a;
|
|
4817
|
+
let z, B = Math.max(0, R - C - w);
|
|
4818
|
+
z = I === "ctr" ? L + C + (B - F) / 2 : I === "b" ? L + R - w - F : L + C, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4819
|
+
let V = z, H = D > 1 ? (i - x - S - (D - 1) * O) / D + O : 0, U = Math.max(0, R - C - w), W = a === 0 || F <= U + .5, ee = D > 1 && !W ? Math.ceil(P.length / D) : P.length, te = 0, ne = 0;
|
|
4820
|
+
for (let s of P) {
|
|
4821
|
+
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: v, bulletFont: y, bulletColor: b, bulletImage: x, alignment: S, isLastLine: C } = s;
|
|
4822
|
+
D > 1 && te < D - 1 && ne >= ee && (te++, ne = 0, z = V), z += f, ne++;
|
|
4823
|
+
let w = (t.rtlCol ? D - 1 - te : te) * H, T = s.textX + w, E = s.bulletX + w, O = s.textMaxW, A = s.para.rtl === !0, j = A || In(l.segments), M = l.segments.some((e) => e.isTab);
|
|
4824
|
+
if (M) {
|
|
4825
|
+
let t = Y(s.para.marL, o), n = Y(s.para.marR, o), r = A ? n : t + h, i = O + t + n;
|
|
4826
|
+
e.font = l.segments.find((e) => e.isTab).font;
|
|
4827
|
+
let a = e.measureText(" ").width, c = Jn(l.segments.map((t) => {
|
|
4828
|
+
if (t.isTab) return {
|
|
4829
|
+
isTab: !0,
|
|
4830
|
+
width: 0
|
|
4831
|
+
};
|
|
4832
|
+
if (t.math) return {
|
|
4833
|
+
isTab: !1,
|
|
4834
|
+
width: t.math.width
|
|
4835
|
+
};
|
|
4836
|
+
e.font = t.font;
|
|
4837
|
+
let n = t.letterSpacingPx ?? 0;
|
|
4838
|
+
return {
|
|
4839
|
+
isTab: !1,
|
|
4840
|
+
width: t.text ? e.measureText(t.text).width + n * Q(t.text) : 0
|
|
4841
|
+
};
|
|
4842
|
+
}), (s.para.tabStops ?? []).map((e) => ({
|
|
4843
|
+
pos: Y(e.pos, o),
|
|
4844
|
+
algn: e.algn
|
|
4845
|
+
})), r, i, a, Y(s.para.defTabSz ?? 914400, o));
|
|
4846
|
+
for (let e = 0; e < l.segments.length; e++) l.segments[e].isTab && (l.segments[e].tabWidthPx = c[e]);
|
|
4847
|
+
}
|
|
4848
|
+
let N = 0, P = d * .8;
|
|
4849
|
+
for (let t of l.segments) {
|
|
4850
|
+
if (t.isTab) {
|
|
4851
|
+
N += t.tabWidthPx ?? 0;
|
|
4852
|
+
continue;
|
|
4853
|
+
}
|
|
4636
4854
|
if (t.math) {
|
|
4637
|
-
|
|
4855
|
+
N += t.math.width, P = Math.max(P, t.math.ascent);
|
|
4638
4856
|
continue;
|
|
4639
4857
|
}
|
|
4640
4858
|
e.font = t.font;
|
|
4641
4859
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4642
|
-
|
|
4860
|
+
N += t.text ? n.width + r * Q(t.text) : 0, n.actualBoundingBoxAscent > 0 && (P = Math.max(P, n.actualBoundingBoxAscent));
|
|
4861
|
+
}
|
|
4862
|
+
let F = z + P, I = T + O, L = 0, R = null;
|
|
4863
|
+
if (j && A) {
|
|
4864
|
+
if (v) e.font = y, L = e.measureText(v).width;
|
|
4865
|
+
else if (x && g && (R = pe(x.imagePath, g), R)) {
|
|
4866
|
+
let e = x.sizePx;
|
|
4867
|
+
L = R.height > 0 ? e * (R.width / R.height) : e;
|
|
4868
|
+
}
|
|
4643
4869
|
}
|
|
4644
|
-
let P = R + N;
|
|
4645
4870
|
if (v) if (e.font = y, e.fillStyle = b, j && A) {
|
|
4646
4871
|
let t = e.direction;
|
|
4647
|
-
e.direction = "rtl";
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
if (S && _) {
|
|
4652
|
-
let t = he(S.imagePath, _);
|
|
4872
|
+
e.direction = "rtl", e.fillText(v, I - L, F), e.direction = t;
|
|
4873
|
+
} else e.fillText(v, E, F);
|
|
4874
|
+
if (x && g) {
|
|
4875
|
+
let t = pe(x.imagePath, g);
|
|
4653
4876
|
if (t) {
|
|
4654
|
-
let n =
|
|
4655
|
-
|
|
4656
|
-
let a = E + k + (E - O) - r;
|
|
4657
|
-
e.drawImage(t, a, i, r, n);
|
|
4658
|
-
} else e.drawImage(t, O, i, r, n);
|
|
4877
|
+
let n = x.sizePx, r = t.height > 0 ? n * (t.width / t.height) : n, i = F - n;
|
|
4878
|
+
j && A ? e.drawImage(t, I - r, i, r, n) : e.drawImage(t, E, i, r, n);
|
|
4659
4879
|
}
|
|
4660
4880
|
}
|
|
4661
|
-
let
|
|
4662
|
-
|
|
4663
|
-
let
|
|
4881
|
+
let B = T + h, U;
|
|
4882
|
+
U = M ? A ? T + O - L - N : B : S === "ctr" ? B + (O - h - N) / 2 : S === "r" ? T + O - L - N : B;
|
|
4883
|
+
let W = S === "just" || S === "justLow" ? "just" : S === "thaiDist" ? "thaiDist" : S === "dist" ? "dist" : null, re = C || (l.endsWithBreak ?? !1), ie = (W && !j && !M ? Bn(l.segments, O - h, N, W, re) : null) ?? l.segments, ae = j ? Ln(l.segments, A) : null, G = ie.length;
|
|
4664
4884
|
for (let t = 0; t < G; t++) {
|
|
4665
|
-
let
|
|
4666
|
-
j && (e.direction =
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4885
|
+
let s = ae ? ae.order[t] : t, l = ie[s], u = ae ? ae.rtl[s] : !1;
|
|
4886
|
+
if (j && (e.direction = u ? "rtl" : "ltr"), l.isTab) {
|
|
4887
|
+
U += l.tabWidthPx ?? 0;
|
|
4888
|
+
continue;
|
|
4889
|
+
}
|
|
4890
|
+
let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, v = h && h.length > 0 ? h.length * g : 0;
|
|
4891
|
+
if (l.math) {
|
|
4892
|
+
let t = rr.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
|
|
4670
4893
|
if (t && n > 0 && r > 0) {
|
|
4671
|
-
let i =
|
|
4672
|
-
e.drawImage(a,
|
|
4894
|
+
let i = F - l.math.ascent, a = ir(t, l.color);
|
|
4895
|
+
e.drawImage(a, U, i, n, r);
|
|
4673
4896
|
}
|
|
4674
|
-
|
|
4897
|
+
U += n, U += f;
|
|
4675
4898
|
continue;
|
|
4676
4899
|
}
|
|
4677
|
-
e.font =
|
|
4678
|
-
let y =
|
|
4679
|
-
if (
|
|
4680
|
-
let t = e.measureText(
|
|
4681
|
-
|
|
4900
|
+
e.font = l.font, e.fillStyle = l.color;
|
|
4901
|
+
let y = F + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), b = l.letterSpacingPx ?? 0;
|
|
4902
|
+
if (l.highlight && l.text) {
|
|
4903
|
+
let t = e.measureText(l.text).width + (b > 0 ? b * Q(l.text) : 0) + v + f;
|
|
4904
|
+
er(e, U, y, t, l.sizePx, l.highlight, l.color);
|
|
4682
4905
|
}
|
|
4683
|
-
let x =
|
|
4906
|
+
let x = l.shadow;
|
|
4684
4907
|
if (x) {
|
|
4685
|
-
let t = x.dir * Math.PI / 180, n =
|
|
4686
|
-
e.save(), e.shadowColor =
|
|
4908
|
+
let t = x.dir * Math.PI / 180, n = Y(x.dist, o);
|
|
4909
|
+
e.save(), e.shadowColor = X(x.color, x.alpha), e.shadowBlur = Y(x.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4687
4910
|
}
|
|
4688
4911
|
let S = (t, n, r) => {
|
|
4689
4912
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
@@ -4697,103 +4920,63 @@ function Cr(e, t, n, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4697
4920
|
r.letterSpacing = a;
|
|
4698
4921
|
} catch {}
|
|
4699
4922
|
} else i(t, n, y);
|
|
4700
|
-
}, C = (t) => e.measureText(t).width, w =
|
|
4923
|
+
}, C = (t) => e.measureText(t).width, w = h && h.length > 0 ? Le([...l.text], h, g, C, b) : null, T = [...l.text], E = !!h && h.length === T.length - 1 && T.length > 1, D = (t) => {
|
|
4924
|
+
if (_) {
|
|
4925
|
+
let n = E ? b + g : b;
|
|
4926
|
+
$n(e, l.text, U, y, l.sizePx, n, t);
|
|
4927
|
+
return;
|
|
4928
|
+
}
|
|
4701
4929
|
if (E) {
|
|
4702
4930
|
let n = e, r = n.letterSpacing;
|
|
4703
4931
|
try {
|
|
4704
|
-
n.letterSpacing = `${b +
|
|
4932
|
+
n.letterSpacing = `${b + g}px`;
|
|
4705
4933
|
} catch {}
|
|
4706
|
-
(t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e))(
|
|
4934
|
+
(t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e))(l.text, U, y);
|
|
4707
4935
|
try {
|
|
4708
4936
|
n.letterSpacing = r;
|
|
4709
4937
|
} catch {}
|
|
4710
|
-
} else if (w) for (let { text: e, dx: n } of w) S(e,
|
|
4711
|
-
else S(
|
|
4938
|
+
} else if (w) for (let { text: e, dx: n } of w) S(e, U + n, t);
|
|
4939
|
+
else S(l.text, U, t);
|
|
4712
4940
|
};
|
|
4713
4941
|
D("fill"), x && e.restore();
|
|
4714
|
-
let O =
|
|
4715
|
-
O && O.width > 0 && (e.save(), e.lineWidth = Math.max(.5,
|
|
4716
|
-
let
|
|
4717
|
-
if (
|
|
4718
|
-
text:
|
|
4719
|
-
inShapeX:
|
|
4720
|
-
inShapeY:
|
|
4721
|
-
w:
|
|
4722
|
-
h:
|
|
4723
|
-
fontSize:
|
|
4724
|
-
font:
|
|
4942
|
+
let O = l.outline;
|
|
4943
|
+
O && O.width > 0 && (e.save(), e.lineWidth = Math.max(.5, Y(O.width, o)), e.strokeStyle = O.color ? `#${O.color}` : l.color, e.lineJoin = "round", D("stroke"), e.restore()), e.font = l.font;
|
|
4944
|
+
let A = e.measureText(l.text).width + (b > 0 ? b * Q(l.text) : 0) + v;
|
|
4945
|
+
if (m && l.text && m({
|
|
4946
|
+
text: l.text,
|
|
4947
|
+
inShapeX: U - n,
|
|
4948
|
+
inShapeY: z - r,
|
|
4949
|
+
w: A + f,
|
|
4950
|
+
h: d,
|
|
4951
|
+
fontSize: l.sizePx,
|
|
4952
|
+
font: l.font,
|
|
4725
4953
|
shapeX: n,
|
|
4726
|
-
shapeY:
|
|
4727
|
-
shapeW:
|
|
4728
|
-
shapeH:
|
|
4729
|
-
rotation:
|
|
4730
|
-
hyperlink:
|
|
4731
|
-
}),
|
|
4732
|
-
let t = Math.max(1,
|
|
4733
|
-
e.strokeStyle =
|
|
4734
|
-
let n = y -
|
|
4735
|
-
if (
|
|
4736
|
-
let
|
|
4737
|
-
e.beginPath(), e.moveTo(
|
|
4954
|
+
shapeY: r,
|
|
4955
|
+
shapeW: i,
|
|
4956
|
+
shapeH: a,
|
|
4957
|
+
rotation: c,
|
|
4958
|
+
hyperlink: l.hyperlink
|
|
4959
|
+
}), l.underline && Be(e, U, y, A + f, l.sizePx, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
|
|
4960
|
+
let t = Math.max(1, l.sizePx * .05);
|
|
4961
|
+
e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash([]);
|
|
4962
|
+
let n = y - l.sizePx * .32;
|
|
4963
|
+
if (l.strikeDouble) {
|
|
4964
|
+
let r = t * .9, i = n - r, a = n + r;
|
|
4965
|
+
e.beginPath(), e.moveTo(U, i + k(i, t, p.dpr)), e.lineTo(U + A + f, i + k(i, t, p.dpr)), e.moveTo(U, a + k(a, t, p.dpr)), e.lineTo(U + A + f, a + k(a, t, p.dpr)), e.stroke();
|
|
4738
4966
|
} else {
|
|
4739
|
-
let
|
|
4740
|
-
e.beginPath(), e.moveTo(
|
|
4967
|
+
let r = n + k(n, t, p.dpr);
|
|
4968
|
+
e.beginPath(), e.moveTo(U, r), e.lineTo(U + A + f, r), e.stroke();
|
|
4741
4969
|
}
|
|
4742
4970
|
}
|
|
4743
|
-
|
|
4971
|
+
U += A, U += f;
|
|
4744
4972
|
}
|
|
4745
|
-
|
|
4746
|
-
let t = n + x + u.tabStop.px, r = 0;
|
|
4747
|
-
for (let t of u.tabStop.segments) {
|
|
4748
|
-
e.font = t.font;
|
|
4749
|
-
let n = t.letterSpacingPx ?? 0;
|
|
4750
|
-
r += e.measureText(t.text).width + n * $(t.text);
|
|
4751
|
-
}
|
|
4752
|
-
let s;
|
|
4753
|
-
s = u.tabStop.algn === "r" ? t - r : u.tabStop.algn === "ctr" ? t - r / 2 : t;
|
|
4754
|
-
for (let t of u.tabStop.segments) {
|
|
4755
|
-
e.font = t.font, e.fillStyle = t.color;
|
|
4756
|
-
let r = t.letterSpacingPx ?? 0;
|
|
4757
|
-
if (t.highlight && t.text) {
|
|
4758
|
-
let n = e.measureText(t.text).width + r * $(t.text);
|
|
4759
|
-
An(e, s, P, n, t.sizePx, t.highlight, t.color);
|
|
4760
|
-
}
|
|
4761
|
-
if (r > 0 && t.text.length > 1) {
|
|
4762
|
-
let n = e, i = n.letterSpacing;
|
|
4763
|
-
try {
|
|
4764
|
-
n.letterSpacing = `${r}px`;
|
|
4765
|
-
} catch {}
|
|
4766
|
-
e.fillText(t.text, s, P);
|
|
4767
|
-
try {
|
|
4768
|
-
n.letterSpacing = i;
|
|
4769
|
-
} catch {}
|
|
4770
|
-
} else e.fillText(t.text, s, P);
|
|
4771
|
-
e.font = t.font;
|
|
4772
|
-
let c = e.measureText(t.text).width + r * $(t.text);
|
|
4773
|
-
h && t.text && h({
|
|
4774
|
-
text: t.text,
|
|
4775
|
-
inShapeX: s - n,
|
|
4776
|
-
inShapeY: R - i,
|
|
4777
|
-
w: c,
|
|
4778
|
-
h: f,
|
|
4779
|
-
fontSize: t.sizePx,
|
|
4780
|
-
font: t.font,
|
|
4781
|
-
shapeX: n,
|
|
4782
|
-
shapeY: i,
|
|
4783
|
-
shapeW: a,
|
|
4784
|
-
shapeH: o,
|
|
4785
|
-
rotation: l,
|
|
4786
|
-
hyperlink: t.hyperlink
|
|
4787
|
-
}), s += c;
|
|
4788
|
-
}
|
|
4789
|
-
}
|
|
4790
|
-
R += d;
|
|
4973
|
+
j && (e.direction = "ltr"), z += u;
|
|
4791
4974
|
}
|
|
4792
4975
|
e.restore();
|
|
4793
4976
|
}
|
|
4794
|
-
function
|
|
4977
|
+
function Zr(e, t, n, r, i) {
|
|
4795
4978
|
if (!e) return [];
|
|
4796
|
-
let a =
|
|
4979
|
+
let a = fn(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = vn(n), s = r * i, c = [];
|
|
4797
4980
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4798
4981
|
widthPx: e.bevelT.w * s,
|
|
4799
4982
|
heightPx: e.bevelT.h * s,
|
|
@@ -4809,9 +4992,9 @@ function wr(e, t, n, r, i) {
|
|
|
4809
4992
|
bottom: !0
|
|
4810
4993
|
}), c;
|
|
4811
4994
|
}
|
|
4812
|
-
function
|
|
4995
|
+
function Qr(e, t, n, r, i, a) {
|
|
4813
4996
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4814
|
-
let o = e.extrusionH * i * a, s =
|
|
4997
|
+
let o = e.extrusionH * i * a, s = Lt(t, n * a, r * a, o);
|
|
4815
4998
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4816
4999
|
let c = [
|
|
4817
5000
|
64,
|
|
@@ -4832,14 +5015,14 @@ function Tr(e, t, n, r, i, a) {
|
|
|
4832
5015
|
rgb: c
|
|
4833
5016
|
};
|
|
4834
5017
|
}
|
|
4835
|
-
function
|
|
5018
|
+
function $r(e, t, n, r, i, a, o, s = {}) {
|
|
4836
5019
|
if (i <= 0 || a <= 0) return !1;
|
|
4837
|
-
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 =
|
|
5020
|
+
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 = Ft(t, i, a), p = f.corners;
|
|
4838
5021
|
if (d > 0) {
|
|
4839
|
-
let e = d / u, t =
|
|
5022
|
+
let e = d / u, t = Kt(f.corners, e / i, e / a);
|
|
4840
5023
|
t ? p = t : d = 0;
|
|
4841
5024
|
}
|
|
4842
|
-
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ =
|
|
5025
|
+
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = T(h, g);
|
|
4843
5026
|
if (!_) return !1;
|
|
4844
5027
|
let v = _.getContext("2d");
|
|
4845
5028
|
if (!v) return !1;
|
|
@@ -4852,17 +5035,17 @@ function Er(e, t, n, r, i, a, o, s = {}) {
|
|
|
4852
5035
|
});
|
|
4853
5036
|
if (s.extrusion) {
|
|
4854
5037
|
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
4855
|
-
|
|
5038
|
+
Cn(v, s.extrusion, x(e));
|
|
4856
5039
|
}
|
|
4857
|
-
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels)
|
|
4858
|
-
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()),
|
|
5040
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Sn(v, e, x(Math.ceil(e.widthPx) + 2));
|
|
5041
|
+
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), Wt(_, e, h, g, p.map((e) => ({
|
|
4859
5042
|
x: n + e.x,
|
|
4860
5043
|
y: r + e.y
|
|
4861
5044
|
}))), !0;
|
|
4862
5045
|
}
|
|
4863
|
-
function
|
|
5046
|
+
function ei(e, t, n, r, i, a, o, s, c = 0) {
|
|
4864
5047
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
4865
|
-
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 =
|
|
5048
|
+
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 = T(m, h);
|
|
4866
5049
|
if (!g) return !1;
|
|
4867
5050
|
let _ = g.getContext("2d");
|
|
4868
5051
|
if (!_) return !1;
|
|
@@ -4870,7 +5053,7 @@ function Dr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
4870
5053
|
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
4871
5054
|
for (let e of a) {
|
|
4872
5055
|
let t = Math.ceil(e.widthPx) + 2;
|
|
4873
|
-
|
|
5056
|
+
Sn(_, e, {
|
|
4874
5057
|
x: f - t,
|
|
4875
5058
|
y: f - t,
|
|
4876
5059
|
w: v + 2 * t,
|
|
@@ -4879,99 +5062,99 @@ function Dr(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
4879
5062
|
}
|
|
4880
5063
|
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;
|
|
4881
5064
|
}
|
|
4882
|
-
var
|
|
4883
|
-
function
|
|
4884
|
-
let n =
|
|
5065
|
+
var ti = /* @__PURE__ */ new WeakMap();
|
|
5066
|
+
function ni(e, t) {
|
|
5067
|
+
let n = ti.get(e);
|
|
4885
5068
|
if (n) return n;
|
|
4886
5069
|
let r = (async () => {
|
|
4887
5070
|
let n = await t(e.posterPath), r = e.posterMimeType ? new Blob([n], { type: e.posterMimeType }) : n;
|
|
4888
|
-
if (
|
|
5071
|
+
if (be(new Uint8Array(await r.slice(0, 64 * 1024).arrayBuffer()))) throw Error("poster raster exceeds the pixel budget");
|
|
4889
5072
|
return createImageBitmap(r);
|
|
4890
5073
|
})();
|
|
4891
|
-
return
|
|
5074
|
+
return ti.set(e, r), r;
|
|
4892
5075
|
}
|
|
4893
|
-
async function
|
|
4894
|
-
if (
|
|
4895
|
-
let
|
|
4896
|
-
if (
|
|
4897
|
-
|
|
5076
|
+
async function ri(e, t, n, r) {
|
|
5077
|
+
if (r) try {
|
|
5078
|
+
let i = t.mimeType === "image/svg+xml", { widthPt: a, heightPt: o } = Se(t.mimeType, t.srcRect, t.width / G, t.height / G), s;
|
|
5079
|
+
if (d(t)) try {
|
|
5080
|
+
s = await se(t.svgImagePath, r);
|
|
4898
5081
|
} catch {
|
|
4899
|
-
|
|
4900
|
-
widthPt:
|
|
4901
|
-
heightPt:
|
|
5082
|
+
s = i ? await se(t.imagePath, r) : await Ge(t.imagePath, t.mimeType, t.duotone, r, {
|
|
5083
|
+
widthPt: a,
|
|
5084
|
+
heightPt: o
|
|
4902
5085
|
});
|
|
4903
5086
|
}
|
|
4904
|
-
else
|
|
4905
|
-
widthPt:
|
|
4906
|
-
heightPt:
|
|
5087
|
+
else s = i ? await se(t.imagePath, r) : await Ge(t.imagePath, t.mimeType, t.duotone, r, {
|
|
5088
|
+
widthPt: a,
|
|
5089
|
+
heightPt: o
|
|
4907
5090
|
});
|
|
4908
|
-
if (!
|
|
4909
|
-
e.save(),
|
|
4910
|
-
let
|
|
4911
|
-
(
|
|
4912
|
-
let
|
|
4913
|
-
|
|
4914
|
-
},
|
|
4915
|
-
e.beginPath(),
|
|
4916
|
-
},
|
|
4917
|
-
(
|
|
4918
|
-
},
|
|
4919
|
-
|
|
4920
|
-
},
|
|
4921
|
-
let s =
|
|
5091
|
+
if (!s) return;
|
|
5092
|
+
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5093
|
+
let c = Y(t.x, n), l = Y(t.y, n), u = Y(t.width, n), f = Y(t.height, n);
|
|
5094
|
+
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + f / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + f / 2)));
|
|
5095
|
+
let p = S(s, t.srcRect), m = (e, n, r, i, a) => {
|
|
5096
|
+
t.custGeom && t.custGeom.length > 0 ? Gr(e, t.custGeom, n, r, i, a) : t.prstGeom && we(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
5097
|
+
}, h = (e, t, n, r, i) => {
|
|
5098
|
+
e.beginPath(), m(e, t, n, r, i);
|
|
5099
|
+
}, g = (e, n, r, i, a) => {
|
|
5100
|
+
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (h(e, n, r, i, a), e.clip());
|
|
5101
|
+
}, _ = (e, r, i, a, o) => {
|
|
5102
|
+
t.stroke && (e.save(), $(e, t.stroke, n), h(e, r, i, a, o), e.stroke(), e.restore());
|
|
5103
|
+
}, v = (e, r, i, a, o) => {
|
|
5104
|
+
let s = t.sp3d;
|
|
4922
5105
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
4923
|
-
let
|
|
5106
|
+
let t = Math.max(.5, s.contourW * n);
|
|
4924
5107
|
e.save(), e.beginPath();
|
|
4925
|
-
let c =
|
|
4926
|
-
e.rect(
|
|
5108
|
+
let c = t * 2 + Math.max(a, o);
|
|
5109
|
+
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), m(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), h(e, r, i, a, o), e.strokeStyle = X(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
4927
5110
|
}
|
|
4928
|
-
},
|
|
4929
|
-
e.save(),
|
|
4930
|
-
},
|
|
4931
|
-
|
|
4932
|
-
},
|
|
4933
|
-
|
|
4934
|
-
},
|
|
4935
|
-
if (
|
|
4936
|
-
if (
|
|
4937
|
-
bevels:
|
|
4938
|
-
extrusion:
|
|
4939
|
-
paintEdges:
|
|
4940
|
-
edgePadCss:
|
|
5111
|
+
}, y = t.scene3d && It(t.scene3d.camera) ? t.scene3d : null, b = (e, t, n, r, i) => {
|
|
5112
|
+
e.save(), g(e, t, n, r, i), p ? e.drawImage(s, p.sx, p.sy, p.sw, p.sh, t, n, r, i) : e.drawImage(s, t, n, r, i), e.restore();
|
|
5113
|
+
}, x = (e, t, n, r, i) => {
|
|
5114
|
+
b(e, t, n, r, i), _(e, t, n, r, i), v(e, t, n, r, i);
|
|
5115
|
+
}, C = (e, t, n, r, i) => {
|
|
5116
|
+
b(e, t, n, r, i), _(e, t, n, r, i);
|
|
5117
|
+
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = Zr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, E), O = y ? Qr(t.sp3d, y.camera, u, f, n, E) : null, k = t.stroke ? t.stroke.width * n / 2 : 0, A = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, j = O ? Math.hypot(O.offsetX, O.offsetY) / E : 0, M = k + A + j + 2, N = (e) => {
|
|
5118
|
+
if (y) {
|
|
5119
|
+
if ($r(e, y.camera, c, l, u, f, C, {
|
|
5120
|
+
bevels: D,
|
|
5121
|
+
extrusion: O ?? void 0,
|
|
5122
|
+
paintEdges: v,
|
|
5123
|
+
edgePadCss: M
|
|
4941
5124
|
})) return;
|
|
4942
|
-
} else if (
|
|
4943
|
-
|
|
4944
|
-
},
|
|
4945
|
-
e.save(),
|
|
4946
|
-
},
|
|
4947
|
-
|
|
4948
|
-
},
|
|
4949
|
-
x:
|
|
4950
|
-
y:
|
|
4951
|
-
w:
|
|
4952
|
-
h:
|
|
4953
|
-
},
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
},
|
|
4957
|
-
|
|
4958
|
-
},
|
|
4959
|
-
|
|
4960
|
-
}), e.restore()) :
|
|
4961
|
-
|
|
4962
|
-
},
|
|
5125
|
+
} else if (D.length > 0 && ei(e, c, l, u, f, D, C, v, M)) return;
|
|
5126
|
+
x(e, c, l, u, f);
|
|
5127
|
+
}, P = (e, t, n, r, i, a) => {
|
|
5128
|
+
e.save(), g(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5129
|
+
}, F = (e, t) => {
|
|
5130
|
+
y && $r(e, y.camera, c, l, u, f, (e, n, r, i, a) => P(e, t, n, r, i, a)) || P(e, t, c, l, u, f);
|
|
5131
|
+
}, I = e.canvas.width || 0, L = e.canvas.height || 0, R = e.getTransform(), z = Math.abs(R.a * R.d - R.b * R.c), B = z > 0 ? Math.sqrt(z) : 1, V = {
|
|
5132
|
+
x: c * B,
|
|
5133
|
+
y: l * B,
|
|
5134
|
+
w: u * B,
|
|
5135
|
+
h: f * B
|
|
5136
|
+
}, H = n * B, U = (e) => e.setTransform(R), W = I > 0 && L > 0;
|
|
5137
|
+
t.reflection && W && (e.save(), e.setTransform(new DOMMatrix()), Tt(e, (e) => {
|
|
5138
|
+
U(e), N(e);
|
|
5139
|
+
}, V, t.reflection, H, I, L), e.restore()), t.shadow ? Or(e, t.shadow, n) : t.glow && kr(e, t.glow, n), t.softEdge && W ? (e.save(), e.setTransform(new DOMMatrix()), wt(e, (e) => {
|
|
5140
|
+
U(e), N(e);
|
|
5141
|
+
}, V, t.softEdge, H, I, L, (e) => {
|
|
5142
|
+
U(e), F(e, "#000");
|
|
5143
|
+
}), e.restore()) : N(e), (t.shadow || t.glow) && Ar(e), t.innerShadow && W && (e.save(), e.setTransform(new DOMMatrix()), Ct(e, (e) => {
|
|
5144
|
+
U(e), F(e, "#000");
|
|
5145
|
+
}, V, t.innerShadow, H, I, L), e.restore()), e.restore();
|
|
4963
5146
|
} catch {}
|
|
4964
5147
|
}
|
|
4965
|
-
async function
|
|
4966
|
-
let a =
|
|
5148
|
+
async function ii(e, t, n, r, i) {
|
|
5149
|
+
let a = Y(t.x, n), o = Y(t.y, n), s = Y(t.width, n), c = Y(t.height, n), l = !1;
|
|
4967
5150
|
if (t.posterPath && r) try {
|
|
4968
|
-
let n = await
|
|
5151
|
+
let n = await ni(t, r);
|
|
4969
5152
|
e.drawImage(n, a, o, s, c), l = !0;
|
|
4970
5153
|
} catch {}
|
|
4971
|
-
l || (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), !i &&
|
|
5154
|
+
l || (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), !i && Nn(e, a + s / 2, o + c / 2, s, c, "paused");
|
|
4972
5155
|
}
|
|
4973
|
-
function
|
|
4974
|
-
let o = Math.max(.5,
|
|
5156
|
+
function ai(e, t, n, r, i, a) {
|
|
5157
|
+
let o = Math.max(.5, Y(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
|
|
4975
5158
|
if (l === 0) return;
|
|
4976
5159
|
let u = -c / l, d = s / l, f;
|
|
4977
5160
|
switch (i) {
|
|
@@ -5020,133 +5203,142 @@ function Mr(e, t, n, r, i, a) {
|
|
|
5020
5203
|
break;
|
|
5021
5204
|
default: return;
|
|
5022
5205
|
}
|
|
5023
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = o + .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 =
|
|
5206
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = o + .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 = X(r.color);
|
|
5024
5207
|
for (let r of f) {
|
|
5025
5208
|
let i = u * (o * r.offset), a = d * (o * r.offset);
|
|
5026
5209
|
e.lineWidth = Math.max(.5, o * r.widthFrac), e.beginPath(), e.moveTo(t.x + i, t.y + a), e.lineTo(n.x + i, n.y + a), e.stroke();
|
|
5027
5210
|
}
|
|
5028
5211
|
e.restore();
|
|
5029
5212
|
}
|
|
5030
|
-
function
|
|
5031
|
-
|
|
5213
|
+
function $(e, t, n) {
|
|
5214
|
+
Ee(e, t, n);
|
|
5032
5215
|
}
|
|
5033
|
-
function
|
|
5216
|
+
function oi(e, t, n, r, i = {
|
|
5034
5217
|
themeMajorFont: null,
|
|
5035
5218
|
themeMinorFont: null,
|
|
5036
5219
|
dpr: 1
|
|
5037
5220
|
}) {
|
|
5038
|
-
let
|
|
5221
|
+
let a = Y(t.x, n), o = Y(t.y, n), s = t.cols.map((e) => Y(e, n)), c = s.length, l = (e, t) => {
|
|
5039
5222
|
let n = 0;
|
|
5040
|
-
for (let r = 0; r < t; r++) n +=
|
|
5223
|
+
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
5041
5224
|
return n;
|
|
5042
|
-
},
|
|
5043
|
-
for (let
|
|
5044
|
-
let o = t.rows[
|
|
5225
|
+
}, u = t.rows.map((e) => Y(e.height, n));
|
|
5226
|
+
for (let a = 0; a < t.rows.length; a++) {
|
|
5227
|
+
let o = t.rows[a];
|
|
5045
5228
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5046
5229
|
let s = o.cells[t];
|
|
5047
5230
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5048
|
-
let c =
|
|
5049
|
-
|
|
5231
|
+
let c = l(t, s.gridSpan || 1), d = Xr(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
5232
|
+
d > u[a] && (u[a] = d);
|
|
5050
5233
|
}
|
|
5051
5234
|
}
|
|
5052
|
-
for (let
|
|
5053
|
-
let o = t.rows[
|
|
5235
|
+
for (let a = 0; a < t.rows.length; a++) {
|
|
5236
|
+
let o = t.rows[a];
|
|
5054
5237
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5055
5238
|
let s = o.cells[t];
|
|
5056
5239
|
if (s.hMerge || s.vMerge) continue;
|
|
5057
5240
|
let c = s.rowSpan || 1;
|
|
5058
5241
|
if (c <= 1 || !s.textBody) continue;
|
|
5059
|
-
let
|
|
5060
|
-
for (let e = 0; e < c &&
|
|
5242
|
+
let d = l(t, s.gridSpan || 1), f = Xr(e, s.textBody, 0, 0, d, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
5243
|
+
for (let e = 0; e < c && a + e < u.length; e++) p += u[a + e];
|
|
5061
5244
|
if (f > p) {
|
|
5062
5245
|
let e = (f - p) / c;
|
|
5063
|
-
for (let t = 0; t < c &&
|
|
5246
|
+
for (let t = 0; t < c && a + t < u.length; t++) u[a + t] += e;
|
|
5064
5247
|
}
|
|
5065
5248
|
}
|
|
5066
5249
|
}
|
|
5067
|
-
let
|
|
5250
|
+
let d = s.reduce((e, t) => e + t, 0), f = Array(c);
|
|
5068
5251
|
if (t.rtl) {
|
|
5069
|
-
let e =
|
|
5070
|
-
for (let t = 0; t <
|
|
5252
|
+
let e = a + d;
|
|
5253
|
+
for (let t = 0; t < c; t++) e -= s[t], f[t] = e;
|
|
5071
5254
|
} else {
|
|
5072
|
-
let e =
|
|
5073
|
-
for (let t = 0; t <
|
|
5255
|
+
let e = a;
|
|
5256
|
+
for (let t = 0; t < c; t++) f[t] = e, e += s[t];
|
|
5074
5257
|
}
|
|
5075
|
-
let
|
|
5258
|
+
let p = (e, n) => t.rtl ? f[e + n - 1] : f[e], m = Array(t.rows.length);
|
|
5076
5259
|
{
|
|
5077
|
-
let e =
|
|
5078
|
-
for (let n = 0; n < t.rows.length; n++)
|
|
5260
|
+
let e = o;
|
|
5261
|
+
for (let n = 0; n < t.rows.length; n++) m[n] = e, e += u[n];
|
|
5079
5262
|
}
|
|
5080
|
-
let
|
|
5263
|
+
let h = [], g = t.rows.map(() => Array(c).fill(-1));
|
|
5081
5264
|
for (let e = 0; e < t.rows.length; e++) {
|
|
5082
|
-
let n = t.rows[e], r =
|
|
5265
|
+
let n = t.rows[e], r = m[e];
|
|
5083
5266
|
for (let i = 0; i < n.cells.length; i++) {
|
|
5084
5267
|
let a = n.cells[i];
|
|
5085
5268
|
if (a.hMerge || a.vMerge) continue;
|
|
5086
|
-
let o = a.gridSpan || 1, s = a.rowSpan || 1,
|
|
5087
|
-
for (let t = 0; t < s; t++) f +=
|
|
5088
|
-
let
|
|
5089
|
-
|
|
5269
|
+
let o = a.gridSpan || 1, s = a.rowSpan || 1, d = l(i, o), f = 0;
|
|
5270
|
+
for (let t = 0; t < s; t++) f += u[e + t] ?? 0;
|
|
5271
|
+
let m = p(i, o), _ = Math.min(e + s - 1, t.rows.length - 1), v = h.length;
|
|
5272
|
+
h.push({
|
|
5090
5273
|
cell: a,
|
|
5091
|
-
colX:
|
|
5274
|
+
colX: m,
|
|
5092
5275
|
rowY: r,
|
|
5093
|
-
cellW:
|
|
5276
|
+
cellW: d,
|
|
5094
5277
|
cellH: f,
|
|
5095
5278
|
ci: i,
|
|
5096
5279
|
ri: e,
|
|
5097
5280
|
span: o,
|
|
5098
|
-
lastRi:
|
|
5281
|
+
lastRi: _
|
|
5099
5282
|
});
|
|
5100
|
-
for (let t = e; t <=
|
|
5283
|
+
for (let t = e; t <= _; t++) for (let e = i; e < i + o && e < c; e++) g[t][e] = v;
|
|
5101
5284
|
}
|
|
5102
5285
|
}
|
|
5103
|
-
for (let { cell: t, colX:
|
|
5104
|
-
let l =
|
|
5105
|
-
if (l && (e.fillStyle = l, e.fillRect(
|
|
5106
|
-
let l = t.textColor ?
|
|
5107
|
-
|
|
5286
|
+
for (let { cell: t, colX: a, rowY: o, cellW: s, cellH: c } of h) {
|
|
5287
|
+
let l = tr(t.fill);
|
|
5288
|
+
if (l && (e.fillStyle = l, e.fillRect(a, o, s, c)), t.textBody) {
|
|
5289
|
+
let l = t.textColor ? X(t.textColor) : null;
|
|
5290
|
+
Xr(e, t.textBody, a, o, s, c, n, l, 0, !1, !1, "#000000", r, i);
|
|
5108
5291
|
}
|
|
5109
5292
|
}
|
|
5110
|
-
let
|
|
5111
|
-
if (e < 0 || e >=
|
|
5112
|
-
let n =
|
|
5113
|
-
return n < 0 ? null :
|
|
5114
|
-
},
|
|
5115
|
-
|
|
5116
|
-
let
|
|
5117
|
-
e.beginPath(), e.moveTo(
|
|
5293
|
+
let _ = i.dpr, v = (e, t) => {
|
|
5294
|
+
if (e < 0 || e >= g.length || t < 0 || t >= c) return null;
|
|
5295
|
+
let n = g[e][t];
|
|
5296
|
+
return n < 0 ? null : h[n];
|
|
5297
|
+
}, y = (t, r, i, a, o) => {
|
|
5298
|
+
$(e, t, n);
|
|
5299
|
+
let s = r === a ? k(r, e.lineWidth, _) : 0, c = i === o ? k(i, e.lineWidth, _) : 0;
|
|
5300
|
+
e.beginPath(), e.moveTo(r + s, i + c), e.lineTo(a + s, o + c), e.stroke();
|
|
5118
5301
|
};
|
|
5119
|
-
for (let r of
|
|
5120
|
-
let { cell: i, colX: a, rowY: o, cellW: s, cellH:
|
|
5302
|
+
for (let r of h) {
|
|
5303
|
+
let { cell: i, colX: a, rowY: o, cellW: s, cellH: d } = r;
|
|
5121
5304
|
e.save();
|
|
5122
|
-
let
|
|
5123
|
-
r.ri === 0 && i.borderT &&
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5305
|
+
let f = t.rtl ? i.borderR : i.borderL, h = t.rtl ? i.borderL : i.borderR, _ = t.rtl ? r.ci + r.span === c : r.ci === 0, b = t.rtl ? r.ci === 0 : r.ci + r.span === c, x = t.rtl ? r.ci - 1 : r.ci + r.span, S = (e) => t.rtl ? e.borderR : e.borderL;
|
|
5306
|
+
if (r.ri === 0 && i.borderT && y(i.borderT, a, o, a + s, o), _ && f && y(f, a, o, a, o + d), r.lastRi === t.rows.length - 1) {
|
|
5307
|
+
let e = i.borderB;
|
|
5308
|
+
e && y(e, a, o + d, a + s, o + d);
|
|
5309
|
+
} else {
|
|
5310
|
+
let e = r.lastRi + 1, t = o + d, n = Math.min(r.ci + r.span, c), a = r.ci;
|
|
5311
|
+
for (; a < n;) {
|
|
5312
|
+
let r = g[e][a], o = a + 1;
|
|
5313
|
+
for (; o < n && g[e][o] === r;) o++;
|
|
5314
|
+
let s = v(e, a), c = Un(i.borderB, s ? s.cell.borderT : null);
|
|
5315
|
+
if (c) {
|
|
5316
|
+
let e = p(a, o - a);
|
|
5317
|
+
y(c, e, t, e + l(a, o - a), t);
|
|
5318
|
+
}
|
|
5319
|
+
a = o;
|
|
5130
5320
|
}
|
|
5131
|
-
e && b(e, a, o + c, a + s, o + c);
|
|
5132
5321
|
}
|
|
5133
|
-
{
|
|
5134
|
-
let e;
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5322
|
+
if (b) {
|
|
5323
|
+
let e = h;
|
|
5324
|
+
e && y(e, a + s, o, a + s, o + d);
|
|
5325
|
+
} else {
|
|
5326
|
+
let e = a + s, t = r.ri;
|
|
5327
|
+
for (; t <= r.lastRi;) {
|
|
5328
|
+
let n = g[t][x], i = t;
|
|
5329
|
+
for (; i + 1 <= r.lastRi && g[i + 1][x] === n;) i++;
|
|
5330
|
+
let a = v(t, x), o = Un(h, a ? S(a.cell) : null);
|
|
5331
|
+
o && y(o, e, m[t], e, m[i] + u[i]), t = i + 1;
|
|
5139
5332
|
}
|
|
5140
|
-
e && b(e, a + s, o, a + s, o + c);
|
|
5141
5333
|
}
|
|
5142
|
-
i.diagonalTL && (
|
|
5334
|
+
i.diagonalTL && ($(e, i.diagonalTL, n), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && ($(e, i.diagonalTR, n), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + d), e.stroke()), e.restore();
|
|
5143
5335
|
}
|
|
5144
5336
|
}
|
|
5145
|
-
function
|
|
5337
|
+
function si(e, t, n, r) {
|
|
5146
5338
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5147
5339
|
}
|
|
5148
|
-
var
|
|
5149
|
-
function
|
|
5340
|
+
var ci = /* @__PURE__ */ new WeakMap();
|
|
5341
|
+
function li(e, t, n, r, i) {
|
|
5150
5342
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5151
5343
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5152
5344
|
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([]);
|
|
@@ -5166,84 +5358,93 @@ function Lr(e, t, n, r, i) {
|
|
|
5166
5358
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5167
5359
|
e.restore();
|
|
5168
5360
|
}
|
|
5169
|
-
async function
|
|
5170
|
-
let
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5361
|
+
async function ui(e, t, n, r, i = {}, a) {
|
|
5362
|
+
let o = i.fetchImage ? de(i.fetchImage) : void 0;
|
|
5363
|
+
try {
|
|
5364
|
+
return await di(e, t, n, r, i, a);
|
|
5365
|
+
} finally {
|
|
5366
|
+
o?.();
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
async function di(e, t, n, r, i = {}, a) {
|
|
5370
|
+
let s = (ci.get(e) ?? 0) + 1;
|
|
5371
|
+
ci.set(e, s);
|
|
5372
|
+
let c = () => ci.get(e) !== s, l = i.width ?? ((p(e) ? e.offsetWidth : 0) || 960), u = l / n, f = Math.round(l), m = Math.round(r * u), h = i.dpr ?? o(), g = E(f * h, m * h), _ = g.clamped ? h * g.scale : h;
|
|
5373
|
+
e.width = g.width, e.height = g.height, p(e) && (e.style.width = `${f}px`, e.style.display || (e.style.display = "block"));
|
|
5374
|
+
let v = e.getContext("2d");
|
|
5375
|
+
if (!v) throw Error("Could not get 2D context");
|
|
5376
|
+
if (v.scale(_, _), t.parseError) return li(v, f, m, t.slideNumber, t.parseError), e;
|
|
5377
|
+
let y = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", b = {
|
|
5378
|
+
themeMajorFont: i.majorFont ?? null,
|
|
5379
|
+
themeMinorFont: i.minorFont ?? null,
|
|
5380
|
+
themeHlinkColor: i.hlinkColor ?? null,
|
|
5381
|
+
dpr: _,
|
|
5382
|
+
smartArtFallbackTextColor: qn(t.background, y)
|
|
5182
5383
|
};
|
|
5183
|
-
if (await
|
|
5184
|
-
let
|
|
5185
|
-
for (let e of
|
|
5186
|
-
let
|
|
5187
|
-
if (
|
|
5188
|
-
else if (
|
|
5384
|
+
if (await wr(v, t.background, f, m, u, i.fetchImage), c() || (i.math && await lr(t, i.math), c())) return e;
|
|
5385
|
+
let x = t.slideNumber;
|
|
5386
|
+
for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
|
|
5387
|
+
let t = e, n = t.mimeType === "image/svg+xml";
|
|
5388
|
+
if (d(t)) se(t.svgImagePath, i.fetchImage).catch(() => void 0);
|
|
5389
|
+
else if (n) se(t.imagePath, i.fetchImage).catch(() => void 0);
|
|
5189
5390
|
else {
|
|
5190
|
-
let e =
|
|
5191
|
-
Ge(
|
|
5391
|
+
let e = Se(t.mimeType, t.srcRect, t.width / G, t.height / G);
|
|
5392
|
+
Ge(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
|
|
5192
5393
|
widthPt: e.widthPt,
|
|
5193
5394
|
heightPt: e.heightPt
|
|
5194
5395
|
}).catch(() => void 0);
|
|
5195
5396
|
}
|
|
5196
5397
|
} else if (e.type === "media") {
|
|
5197
5398
|
let t = e;
|
|
5198
|
-
t.posterPath &&
|
|
5399
|
+
t.posterPath && i.fetchMedia && ni(t, i.fetchMedia).catch(() => void 0);
|
|
5199
5400
|
}
|
|
5200
|
-
if (
|
|
5201
|
-
let
|
|
5202
|
-
for (let e of
|
|
5203
|
-
let e =
|
|
5401
|
+
if (i.fetchImage) {
|
|
5402
|
+
let n = i.fetchImage, r = /* @__PURE__ */ new Set();
|
|
5403
|
+
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5404
|
+
let e = jn(t.bullet);
|
|
5204
5405
|
e.type === "blip" && r.add(`${e.imagePath} ${e.mimeType}`);
|
|
5205
5406
|
}
|
|
5206
5407
|
if (r.size > 0 && (await Promise.all([...r].map((e) => {
|
|
5207
|
-
let [
|
|
5208
|
-
return
|
|
5209
|
-
})),
|
|
5210
|
-
}
|
|
5211
|
-
for (let
|
|
5212
|
-
if (
|
|
5213
|
-
if (
|
|
5214
|
-
else if (
|
|
5215
|
-
else if (
|
|
5216
|
-
else if (
|
|
5217
|
-
else if (
|
|
5218
|
-
let e = G *
|
|
5219
|
-
|
|
5220
|
-
x:
|
|
5221
|
-
y:
|
|
5222
|
-
w:
|
|
5223
|
-
h:
|
|
5408
|
+
let [t, r] = e.split(" ");
|
|
5409
|
+
return I(t, r, n).catch(() => void 0);
|
|
5410
|
+
})), c())) return e;
|
|
5411
|
+
}
|
|
5412
|
+
for (let n of t.elements) {
|
|
5413
|
+
if (c()) return e;
|
|
5414
|
+
if (n.type === "shape") Wr(v, n, u, y, x, b, a, i.fetchImage);
|
|
5415
|
+
else if (n.type === "picture") await ri(v, n, u, i.fetchImage);
|
|
5416
|
+
else if (n.type === "table") oi(v, n, u, x, b);
|
|
5417
|
+
else if (n.type === "media") await ii(v, n, u, i.fetchMedia, i.skipMediaControls);
|
|
5418
|
+
else if (n.type === "chart") {
|
|
5419
|
+
let e = G * u;
|
|
5420
|
+
F(v, n.chart, {
|
|
5421
|
+
x: Y(n.x, u),
|
|
5422
|
+
y: Y(n.y, u),
|
|
5423
|
+
w: Y(n.width, u),
|
|
5424
|
+
h: Y(n.height, u)
|
|
5224
5425
|
}, e);
|
|
5225
5426
|
}
|
|
5226
5427
|
}
|
|
5227
|
-
return
|
|
5428
|
+
return c() || i.dim && si(v, i.dim, f, m), e;
|
|
5228
5429
|
}
|
|
5229
5430
|
//#endregion
|
|
5230
5431
|
//#region packages/pptx/src/tabular-text.ts
|
|
5231
|
-
var
|
|
5232
|
-
function
|
|
5432
|
+
var fi = (e) => e >= "0" && e <= "9";
|
|
5433
|
+
function pi(e) {
|
|
5233
5434
|
let t = 0;
|
|
5234
5435
|
for (let n = 0; n < 10; n++) t = Math.max(t, e.measureText(String(n)).width);
|
|
5235
5436
|
return t;
|
|
5236
5437
|
}
|
|
5237
|
-
function
|
|
5438
|
+
function mi(e, t, n) {
|
|
5238
5439
|
let r = 0;
|
|
5239
|
-
for (let i of t) r +=
|
|
5440
|
+
for (let i of t) r += fi(i) ? n : e.measureText(i).width;
|
|
5240
5441
|
return r;
|
|
5241
5442
|
}
|
|
5242
|
-
function
|
|
5443
|
+
function hi(e, t, n, r, i) {
|
|
5243
5444
|
let a = e.textAlign;
|
|
5244
5445
|
e.textAlign = "left";
|
|
5245
5446
|
let o = n;
|
|
5246
|
-
for (let n of t) if (
|
|
5447
|
+
for (let n of t) if (fi(n)) {
|
|
5247
5448
|
let t = e.measureText(n).width;
|
|
5248
5449
|
e.fillText(n, o + (i - t) / 2, r), o += i;
|
|
5249
5450
|
} else e.fillText(n, o, r), o += e.measureText(n).width;
|
|
@@ -5251,75 +5452,75 @@ function Hr(e, t, n, r, i) {
|
|
|
5251
5452
|
}
|
|
5252
5453
|
//#endregion
|
|
5253
5454
|
//#region packages/pptx/src/presentation-handle.ts
|
|
5254
|
-
var
|
|
5255
|
-
async function
|
|
5256
|
-
let
|
|
5257
|
-
if (!
|
|
5258
|
-
let
|
|
5259
|
-
await
|
|
5260
|
-
let
|
|
5261
|
-
|
|
5262
|
-
let
|
|
5263
|
-
if (!
|
|
5264
|
-
|
|
5265
|
-
let
|
|
5266
|
-
for (let e of
|
|
5455
|
+
var gi = (t, n) => t / e * n;
|
|
5456
|
+
async function _i(t, n, r) {
|
|
5457
|
+
let i = t.getContext("2d");
|
|
5458
|
+
if (!i) throw Error("2D context not available");
|
|
5459
|
+
let a = r.width / (r.slideWidthEmu / e);
|
|
5460
|
+
await r.drawBase();
|
|
5461
|
+
let o = document.createElement("canvas");
|
|
5462
|
+
o.width = t.width, o.height = t.height;
|
|
5463
|
+
let s = o.getContext("2d");
|
|
5464
|
+
if (!s) throw Error("base 2D context not available");
|
|
5465
|
+
s.drawImage(t, 0, 0);
|
|
5466
|
+
let c = [];
|
|
5467
|
+
for (let e of n) {
|
|
5267
5468
|
let t;
|
|
5268
5469
|
try {
|
|
5269
|
-
t = await
|
|
5470
|
+
t = await r.fetchMedia(e.mediaPath);
|
|
5270
5471
|
} catch {
|
|
5271
5472
|
continue;
|
|
5272
5473
|
}
|
|
5273
|
-
let
|
|
5274
|
-
|
|
5474
|
+
let n = e.mimeType || t.type, i = t.type === n ? t : new Blob([t], { type: n }), o = URL.createObjectURL(i), s = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
|
|
5475
|
+
s.src = o, s.preload = "metadata", e.mediaKind === "video" && (s.playsInline = !0);
|
|
5275
5476
|
let l = {
|
|
5276
|
-
x:
|
|
5277
|
-
y:
|
|
5278
|
-
w:
|
|
5279
|
-
h:
|
|
5477
|
+
x: gi(e.x, a),
|
|
5478
|
+
y: gi(e.y, a),
|
|
5479
|
+
w: gi(e.width, a),
|
|
5480
|
+
h: gi(e.height, a)
|
|
5280
5481
|
}, u = e.mediaKind === "audio" ? {
|
|
5281
5482
|
x: l.x + l.w / 2 - Math.max(l.w, 260) / 2,
|
|
5282
5483
|
y: l.y,
|
|
5283
5484
|
w: Math.max(l.w, 260),
|
|
5284
5485
|
h: l.h + 36
|
|
5285
5486
|
} : l;
|
|
5286
|
-
|
|
5487
|
+
c.push({
|
|
5287
5488
|
el: e,
|
|
5288
5489
|
rect: u,
|
|
5289
5490
|
posterRect: l,
|
|
5290
|
-
media:
|
|
5491
|
+
media: s,
|
|
5291
5492
|
objectUrl: o
|
|
5292
5493
|
});
|
|
5293
5494
|
}
|
|
5294
|
-
let
|
|
5295
|
-
|
|
5296
|
-
let
|
|
5297
|
-
|
|
5298
|
-
for (let e of
|
|
5495
|
+
let l = null, u = !1, d = null, f = () => {
|
|
5496
|
+
i.setTransform(r.dpr, 0, 0, r.dpr, 0, 0);
|
|
5497
|
+
let e = t.width / r.dpr, n = t.height / r.dpr;
|
|
5498
|
+
i.drawImage(o, 0, 0, t.width, t.height, 0, 0, e, n);
|
|
5499
|
+
for (let e of c) {
|
|
5299
5500
|
let t = e.media;
|
|
5300
5501
|
if (e.el.mediaKind === "video" && t.readyState >= 2) {
|
|
5301
|
-
let { x: n, y:
|
|
5302
|
-
|
|
5502
|
+
let { x: n, y: r, w: a, h: o } = e.posterRect;
|
|
5503
|
+
i.drawImage(t, n, r, a, o);
|
|
5303
5504
|
}
|
|
5304
|
-
if (e ===
|
|
5505
|
+
if (e === d || g?.state === e) Ci(i, e, t);
|
|
5305
5506
|
else if (t.paused) {
|
|
5306
|
-
let { x: t, y: n, w:
|
|
5307
|
-
|
|
5507
|
+
let { x: t, y: n, w: r, h: a } = e.posterRect;
|
|
5508
|
+
Nn(i, t + r / 2, n + a / 2, r, a, "paused");
|
|
5308
5509
|
}
|
|
5309
5510
|
}
|
|
5310
|
-
},
|
|
5311
|
-
|
|
5312
|
-
},
|
|
5313
|
-
let i =
|
|
5511
|
+
}, p = () => {
|
|
5512
|
+
u || (f(), l = requestAnimationFrame(p));
|
|
5513
|
+
}, m = (e, n) => {
|
|
5514
|
+
let i = t.getBoundingClientRect(), a = t.width / r.dpr, o = t.height / r.dpr;
|
|
5314
5515
|
return {
|
|
5315
|
-
x: (
|
|
5316
|
-
y: (
|
|
5516
|
+
x: (e - i.left) / i.width * a,
|
|
5517
|
+
y: (n - i.top) / i.height * o
|
|
5317
5518
|
};
|
|
5318
|
-
},
|
|
5319
|
-
for (let n of
|
|
5519
|
+
}, h = (e, t) => {
|
|
5520
|
+
for (let n of c) {
|
|
5320
5521
|
let { x: r, y: i, w: a, h: o } = n.rect;
|
|
5321
5522
|
if (e < r || e > r + a || t < i || t > i + o) continue;
|
|
5322
|
-
let s =
|
|
5523
|
+
let s = ki(n), c = s.y - 12, l = s.y + s.h + 8;
|
|
5323
5524
|
return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
|
|
5324
5525
|
kind: "seek",
|
|
5325
5526
|
state: n,
|
|
@@ -5330,131 +5531,131 @@ async function Wr(e, t, n) {
|
|
|
5330
5531
|
};
|
|
5331
5532
|
}
|
|
5332
5533
|
return null;
|
|
5333
|
-
},
|
|
5534
|
+
}, g = null, _ = (e, t) => {
|
|
5334
5535
|
let n = Number.isFinite(e.media.duration) ? e.media.duration : 0;
|
|
5335
5536
|
n <= 0 || (e.media.currentTime = n * t);
|
|
5336
|
-
},
|
|
5337
|
-
let { x: n, y: r } =
|
|
5338
|
-
i && (i.kind === "seek" ? (
|
|
5537
|
+
}, v = (e) => {
|
|
5538
|
+
let { x: n, y: r } = m(e.clientX, e.clientY), i = h(n, r);
|
|
5539
|
+
i && (i.kind === "seek" ? (g = {
|
|
5339
5540
|
state: i.state,
|
|
5340
5541
|
wasPlaying: !i.state.media.paused
|
|
5341
|
-
}, i.state.media.pause(),
|
|
5342
|
-
},
|
|
5343
|
-
let { x: t, y: n } =
|
|
5344
|
-
|
|
5345
|
-
for (let e of
|
|
5542
|
+
}, i.state.media.pause(), _(i.state, i.fraction), t.setPointerCapture(e.pointerId), e.preventDefault()) : i.state.media.paused ? i.state.media.play().catch(() => void 0) : i.state.media.pause());
|
|
5543
|
+
}, y = (e) => {
|
|
5544
|
+
let { x: t, y: n } = m(e.clientX, e.clientY);
|
|
5545
|
+
d = null;
|
|
5546
|
+
for (let e of c) {
|
|
5346
5547
|
let { x: r, y: i, w: a, h: o } = e.rect;
|
|
5347
5548
|
if (t >= r && t <= r + a && n >= i && n <= i + o) {
|
|
5348
|
-
|
|
5549
|
+
d = e;
|
|
5349
5550
|
break;
|
|
5350
5551
|
}
|
|
5351
5552
|
}
|
|
5352
|
-
if (
|
|
5353
|
-
let e =
|
|
5354
|
-
g
|
|
5553
|
+
if (g) {
|
|
5554
|
+
let e = ki(g.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
|
|
5555
|
+
_(g.state, n);
|
|
5355
5556
|
}
|
|
5356
|
-
},
|
|
5357
|
-
|
|
5358
|
-
},
|
|
5359
|
-
if (!
|
|
5360
|
-
let { wasPlaying: n, state: r } =
|
|
5361
|
-
|
|
5557
|
+
}, b = () => {
|
|
5558
|
+
d = null;
|
|
5559
|
+
}, x = (e) => {
|
|
5560
|
+
if (!g) return;
|
|
5561
|
+
let { wasPlaying: n, state: r } = g;
|
|
5562
|
+
g = null, t.releasePointerCapture(e.pointerId), n && r.media.play().catch(() => void 0);
|
|
5362
5563
|
};
|
|
5363
|
-
return
|
|
5564
|
+
return c.length > 0 && (t.addEventListener("pointerdown", v), t.addEventListener("pointermove", y), t.addEventListener("pointerleave", b), t.addEventListener("pointerup", x), t.addEventListener("pointercancel", x), t.style.cursor = "pointer", p()), {
|
|
5364
5565
|
play(e) {
|
|
5365
|
-
for (let t of
|
|
5566
|
+
for (let t of c) (!e || t.el.mediaPath === e) && t.media.play().catch(() => void 0);
|
|
5366
5567
|
},
|
|
5367
5568
|
pause(e) {
|
|
5368
|
-
for (let t of
|
|
5569
|
+
for (let t of c) (!e || t.el.mediaPath === e) && t.media.pause();
|
|
5369
5570
|
},
|
|
5370
5571
|
destroy() {
|
|
5371
|
-
if (!
|
|
5372
|
-
|
|
5373
|
-
for (let e of
|
|
5572
|
+
if (!u) {
|
|
5573
|
+
u = !0, l !== null && cancelAnimationFrame(l), t.removeEventListener("pointerdown", v), t.removeEventListener("pointermove", y), t.removeEventListener("pointerleave", b), t.removeEventListener("pointerup", x), t.removeEventListener("pointercancel", x), t.style.cursor = "";
|
|
5574
|
+
for (let e of c) e.media.pause(), e.media.removeAttribute("src"), e.media.load(), URL.revokeObjectURL(e.objectUrl);
|
|
5374
5575
|
}
|
|
5375
5576
|
}
|
|
5376
5577
|
};
|
|
5377
5578
|
}
|
|
5378
|
-
var
|
|
5379
|
-
function
|
|
5579
|
+
var vi = 28, yi = 14, bi = 72, xi = 10, Si = 3;
|
|
5580
|
+
function Ci(e, t, n) {
|
|
5380
5581
|
let r = Number.isFinite(n.duration) ? n.duration : 0, i = r > 0 ? Math.min(1, n.currentTime / r) : 0, a = t.posterRect;
|
|
5381
|
-
|
|
5582
|
+
Nn(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? Ti(e, t, n, r, i) : wi(e, t, n, r, i);
|
|
5382
5583
|
}
|
|
5383
|
-
function
|
|
5584
|
+
function wi(e, t, n, r, i) {
|
|
5384
5585
|
let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
|
|
5385
5586
|
e.save();
|
|
5386
5587
|
let d = e.createLinearGradient(0, u, 0, o + c);
|
|
5387
5588
|
d.addColorStop(0, "rgba(0, 0, 0, 0)"), d.addColorStop(1, "rgba(0, 0, 0, 0.55)"), e.fillStyle = d, e.fillRect(a, u, s, l), e.restore();
|
|
5388
|
-
let f =
|
|
5389
|
-
|
|
5589
|
+
let f = ki(t);
|
|
5590
|
+
Di(e, f, i, r > 0), e.save(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.shadowColor = "rgba(0, 0, 0, 0.75)", e.shadowBlur = 3, e.fillStyle = "rgba(255, 255, 255, 0.95)", Ei(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
|
|
5390
5591
|
}
|
|
5391
|
-
function
|
|
5392
|
-
let a =
|
|
5393
|
-
e.save(),
|
|
5592
|
+
function Ti(e, t, n, r, i) {
|
|
5593
|
+
let a = Oi(t.rect);
|
|
5594
|
+
e.save(), Ai(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)", Ei(e, n.currentTime, r, a.x + yi, a.y + a.h / 2, "middle"), e.restore(), Di(e, ki(t), i, r > 0);
|
|
5394
5595
|
}
|
|
5395
|
-
function
|
|
5396
|
-
let o =
|
|
5397
|
-
|
|
5596
|
+
function Ei(e, t, n, r, i, a) {
|
|
5597
|
+
let o = ji(t), s = ji(n), c = pi(e), l = mi(e, o, c), u = mi(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
|
|
5598
|
+
hi(e, o, r + f - l, i, c);
|
|
5398
5599
|
let p = e.textAlign;
|
|
5399
|
-
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p,
|
|
5600
|
+
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, hi(e, s, r + f + d, i, c);
|
|
5400
5601
|
}
|
|
5401
|
-
function
|
|
5602
|
+
function Di(e, t, n, r) {
|
|
5402
5603
|
let i = t.h / 2;
|
|
5403
|
-
if (e.save(),
|
|
5604
|
+
if (e.save(), Ai(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (Ai(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
|
|
5404
5605
|
let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
|
|
5405
5606
|
e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = 3, e.fillStyle = "#fff", e.beginPath(), e.arc(r, t.y + t.h / 2, 5, 0, Math.PI * 2), e.fill();
|
|
5406
5607
|
}
|
|
5407
5608
|
e.restore();
|
|
5408
5609
|
}
|
|
5409
|
-
function
|
|
5610
|
+
function Oi(e) {
|
|
5410
5611
|
let t = Math.max(220, e.w - 24);
|
|
5411
5612
|
return {
|
|
5412
5613
|
x: e.x + e.w / 2 - t / 2,
|
|
5413
|
-
y: e.y + e.h -
|
|
5614
|
+
y: e.y + e.h - vi - 4,
|
|
5414
5615
|
w: t,
|
|
5415
|
-
h:
|
|
5616
|
+
h: vi
|
|
5416
5617
|
};
|
|
5417
5618
|
}
|
|
5418
|
-
function
|
|
5619
|
+
function ki(e) {
|
|
5419
5620
|
if (e.el.mediaKind === "audio") {
|
|
5420
|
-
let t =
|
|
5621
|
+
let t = Oi(e.rect), n = t.x + yi + bi + xi, r = Math.max(40, t.x + t.w - yi - n);
|
|
5421
5622
|
return {
|
|
5422
5623
|
x: n,
|
|
5423
|
-
y: t.y + (t.h -
|
|
5624
|
+
y: t.y + (t.h - Si) / 2,
|
|
5424
5625
|
w: r,
|
|
5425
|
-
h:
|
|
5626
|
+
h: Si
|
|
5426
5627
|
};
|
|
5427
5628
|
}
|
|
5428
5629
|
let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
|
|
5429
5630
|
return {
|
|
5430
5631
|
x: t.x + n,
|
|
5431
|
-
y: t.y + t.h -
|
|
5632
|
+
y: t.y + t.h - Si - r,
|
|
5432
5633
|
w: t.w - n * 2,
|
|
5433
|
-
h:
|
|
5634
|
+
h: Si
|
|
5434
5635
|
};
|
|
5435
5636
|
}
|
|
5436
|
-
function
|
|
5637
|
+
function Ai(e, t, n, r, i, a) {
|
|
5437
5638
|
let o = Math.min(a, i / 2, r / 2);
|
|
5438
5639
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
|
|
5439
5640
|
}
|
|
5440
|
-
function
|
|
5641
|
+
function ji(e) {
|
|
5441
5642
|
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
5442
5643
|
let t = Math.floor(e);
|
|
5443
5644
|
return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
|
|
5444
5645
|
}
|
|
5445
5646
|
//#endregion
|
|
5446
5647
|
//#region packages/pptx/src/notes.ts
|
|
5447
|
-
function
|
|
5648
|
+
function Mi(e, t) {
|
|
5448
5649
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? null : e[t].notes ?? null;
|
|
5449
5650
|
}
|
|
5450
5651
|
//#endregion
|
|
5451
5652
|
//#region packages/pptx/src/hidden.ts
|
|
5452
|
-
function
|
|
5653
|
+
function Ni(e, t) {
|
|
5453
5654
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? !1 : e[t].hidden ?? !1;
|
|
5454
5655
|
}
|
|
5455
5656
|
//#endregion
|
|
5456
5657
|
//#region packages/pptx/src/slide-nav.ts
|
|
5457
|
-
function
|
|
5658
|
+
function Pi(e) {
|
|
5458
5659
|
let t = /* @__PURE__ */ new Map();
|
|
5459
5660
|
for (let n = 0; n < e.length; n++) {
|
|
5460
5661
|
let r = e[n];
|
|
@@ -5462,44 +5663,44 @@ function si(e) {
|
|
|
5462
5663
|
}
|
|
5463
5664
|
return t;
|
|
5464
5665
|
}
|
|
5465
|
-
function
|
|
5666
|
+
function Fi(e, t) {
|
|
5466
5667
|
if (e === "") return;
|
|
5467
|
-
let n =
|
|
5668
|
+
let n = Tn("ppt/slides", e);
|
|
5468
5669
|
return t.get(n);
|
|
5469
5670
|
}
|
|
5470
|
-
function
|
|
5471
|
-
let r =
|
|
5472
|
-
return r === null ?
|
|
5671
|
+
function Ii(e, t, n) {
|
|
5672
|
+
let r = En(e);
|
|
5673
|
+
return r === null ? Fi(e, t) : Dn(r, n, t.size);
|
|
5473
5674
|
}
|
|
5474
5675
|
//#endregion
|
|
5475
5676
|
//#region packages/pptx/src/google-fonts.ts
|
|
5476
|
-
var
|
|
5477
|
-
...
|
|
5478
|
-
...
|
|
5677
|
+
var Li = {
|
|
5678
|
+
...n,
|
|
5679
|
+
...x
|
|
5479
5680
|
};
|
|
5480
|
-
function*
|
|
5681
|
+
function* Ri(e) {
|
|
5481
5682
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5482
5683
|
}
|
|
5483
|
-
function*
|
|
5484
|
-
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield*
|
|
5485
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield*
|
|
5684
|
+
function* zi(e) {
|
|
5685
|
+
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield* Ri(e.textBody);
|
|
5686
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield* Ri(e.textBody);
|
|
5486
5687
|
else if (e.type === "chart") {
|
|
5487
5688
|
e.chart.title && (yield e.chart.title);
|
|
5488
5689
|
for (let t of e.chart.categories) yield t;
|
|
5489
5690
|
for (let t of e.chart.series) t.name && (yield t.name);
|
|
5490
5691
|
}
|
|
5491
5692
|
}
|
|
5492
|
-
function
|
|
5493
|
-
let t =
|
|
5693
|
+
function Bi(e) {
|
|
5694
|
+
let t = u(e.majorFont) ?? u(e.minorFont) ?? null;
|
|
5494
5695
|
return [
|
|
5495
5696
|
e.majorFont,
|
|
5496
5697
|
e.minorFont,
|
|
5497
|
-
...
|
|
5698
|
+
...Me(zi(e), t)
|
|
5498
5699
|
];
|
|
5499
5700
|
}
|
|
5500
5701
|
//#endregion
|
|
5501
5702
|
//#region packages/pptx/src/media-mime.ts
|
|
5502
|
-
function
|
|
5703
|
+
function Vi(e, t) {
|
|
5503
5704
|
for (let n of e.slides) for (let e of n.elements) {
|
|
5504
5705
|
if (e.type !== "media") continue;
|
|
5505
5706
|
let n = e;
|
|
@@ -5510,11 +5711,11 @@ function mi(e, t) {
|
|
|
5510
5711
|
}
|
|
5511
5712
|
//#endregion
|
|
5512
5713
|
//#region packages/pptx/src/worker.ts?worker&inline
|
|
5513
|
-
var
|
|
5514
|
-
function
|
|
5714
|
+
var Hi = "function e(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var t=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function n(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}var r=class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw n(e)?(this._poison(),new t(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}},i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,o.unregister(this),e}free(){let e=this.__destroy_into_raw();S.__wbg_pptxarchive_free(e,0)}extract_image(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}extract_media(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_media(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t){let n=m(e,S.__wbindgen_malloc),r=x,i=S.pptxarchive_new(n,r,!p(t),p(t)?BigInt(0):t);if(i[2])throw g(i[1]);return this.__wbg_ptr=i[0]>>>0,o.register(this,this.__wbg_ptr,this),this}parse(){let e=S.pptxarchive_parse(this.__wbg_ptr);if(e[3])throw g(e[2]);var t=s(e[0],e[1]).slice();return S.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=S.pptxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,g(i[2]);return e=n,t=r,u(n,r)}finally{S.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);function a(){return{__proto__:null,\"./pptx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(u(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(u(e,t))}finally{S.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=h(n,S.__wbindgen_malloc,S.__wbindgen_realloc),i=x;l().setInt32(e+4,i,!0),l().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return u(e,t)},__wbindgen_init_externref_table:function(){let e=S.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const o=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>S.__wbg_pptxarchive_free(e>>>0,1));function s(e,t){return e>>>=0,f().subarray(e/1,e/1+t)}let c=null;function l(){return(c===null||c.buffer.detached===!0||c.buffer.detached===void 0&&c.buffer!==S.memory.buffer)&&(c=new DataView(S.memory.buffer)),c}function u(e,t){return e>>>=0,y(e,t)}let d=null;function f(){return(d===null||d.byteLength===0)&&(d=new Uint8Array(S.memory.buffer)),d}function p(e){return e==null}function m(e,t){let n=t(e.length*1,1)>>>0;return f().set(e,n/1),x=e.length,n}function h(e,t,n){if(n===void 0){let n=b.encode(e),r=t(n.length,1)>>>0;return f().subarray(r,r+n.length).set(n),x=n.length,r}let r=e.length,i=t(r,1)>>>0,a=f(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=f().subarray(i+o,i+r),a=b.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return x=o,i}function g(e){let t=S.__wbindgen_externrefs.get(e);return S.__externref_table_dealloc(e),t}let _=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});_.decode();let v=0;function y(e,t){return v+=t,v>=2146435072&&(_=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),_.decode(),v=t),_.decode(f().subarray(e,e+t))}const b=new TextEncoder;`encodeInto`in b||(b.encodeInto=function(e,t){let n=b.encode(e);return t.set(n),{read:e.length,written:n.length}});let x=0,S;function C(e,t){return S=e.exports,c=null,d=null,S.__wbindgen_start(),S}async function w(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function T(e){if(S!==void 0)return S;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=a();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await w(await e,t);return C(n,r)}async function E(e){return S=void 0,c=null,d=null,T(e)}const D=new r(T,{freeArchive:e=>e.free(),reinit:E});self.onmessage=async t=>{let n=t.data;if(n.kind===`init`){D.setWasmUrl(e(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await D.ensureReady(),n.kind===`parse`){let e=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,t=new Uint8Array(n.buffer),a=D.run(()=>{let n=new i(t,e);return D.setArchive(n),n.parse()}).buffer,o={kind:`parsed`,id:r,presentationJson:a};self.postMessage(o,[a]);return}let e=D.archive;if(n.kind===`extractMedia`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_media(n.path).buffer),i={kind:`mediaExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`extractImage`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_image(n.path).buffer),i={kind:`imageExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`toMarkdown`){if(!e)throw Error(`No pptx loaded`);let t={kind:`markdownRendered`,id:r,markdown:D.run(()=>e.to_markdown())};self.postMessage(t);return}}catch(e){let t={kind:`error`,id:r,message:e instanceof Error?e.message:String(e)};self.postMessage(t)}};", Ui = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Hi], { type: "text/javascript;charset=utf-8" });
|
|
5715
|
+
function Wi(e) {
|
|
5515
5716
|
let t;
|
|
5516
5717
|
try {
|
|
5517
|
-
if (t =
|
|
5718
|
+
if (t = Ui && (self.URL || self.webkitURL).createObjectURL(Ui), !t) throw "";
|
|
5518
5719
|
let n = new Worker(t, {
|
|
5519
5720
|
type: "module",
|
|
5520
5721
|
name: e?.name
|
|
@@ -5523,7 +5724,7 @@ function _i(e) {
|
|
|
5523
5724
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
5524
5725
|
}), n;
|
|
5525
5726
|
} catch {
|
|
5526
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
5727
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Hi), {
|
|
5527
5728
|
type: "module",
|
|
5528
5729
|
name: e?.name
|
|
5529
5730
|
});
|
|
@@ -5531,7 +5732,7 @@ function _i(e) {
|
|
|
5531
5732
|
}
|
|
5532
5733
|
//#endregion
|
|
5533
5734
|
//#region packages/pptx/src/wasm/pptx_parser_bg.wasm?url
|
|
5534
|
-
var
|
|
5735
|
+
var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
|
|
5535
5736
|
_worker;
|
|
5536
5737
|
_bridge;
|
|
5537
5738
|
_mode = "main";
|
|
@@ -5544,11 +5745,11 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5544
5745
|
_fetchImage = (e, t) => this.getImage(e, t);
|
|
5545
5746
|
_math;
|
|
5546
5747
|
constructor(e, t, n) {
|
|
5547
|
-
this._worker = e, this._mode = t, this._bridge = new
|
|
5748
|
+
this._worker = e, this._mode = t, this._bridge = new s(this._worker, {
|
|
5548
5749
|
correlate: (e) => e.id,
|
|
5549
5750
|
toError: (e) => e.kind === "error" ? e.message : void 0
|
|
5550
5751
|
});
|
|
5551
|
-
let r = new URL(n ??
|
|
5752
|
+
let r = new URL(n ?? Gi, location.href).href;
|
|
5552
5753
|
this._bridge.post({
|
|
5553
5754
|
kind: "init",
|
|
5554
5755
|
wasmUrl: r
|
|
@@ -5563,9 +5764,9 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5563
5764
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
5564
5765
|
i = await e.arrayBuffer();
|
|
5565
5766
|
} else i = t;
|
|
5566
|
-
i =
|
|
5567
|
-
let a = new e(r === "worker" ? (await import("./render-worker-host-
|
|
5568
|
-
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await
|
|
5767
|
+
i = f(await _e(i, n.password));
|
|
5768
|
+
let a = new e(r === "worker" ? (await import("./render-worker-host-DL_kkykF.js")).createRenderWorker() : new Wi(), r, n.wasmUrl);
|
|
5769
|
+
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await c(Bi(a._presentation), Li)), a;
|
|
5569
5770
|
}
|
|
5570
5771
|
async _parse(e, t, n = !1, r) {
|
|
5571
5772
|
let i = await this._bridge.request((r) => this._mode === "worker" ? {
|
|
@@ -5599,30 +5800,30 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5599
5800
|
return this._mode;
|
|
5600
5801
|
}
|
|
5601
5802
|
getNotes(e) {
|
|
5602
|
-
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null :
|
|
5803
|
+
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null : Mi(this._presentation?.slides ?? [], e);
|
|
5603
5804
|
}
|
|
5604
5805
|
isHidden(e) {
|
|
5605
|
-
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 :
|
|
5806
|
+
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 : Ni(this._presentation?.slides ?? [], e);
|
|
5606
5807
|
}
|
|
5607
5808
|
_partNames() {
|
|
5608
5809
|
return this._meta ? this._meta.partNames : (this._presentation?.slides ?? []).map((e) => e.partName);
|
|
5609
5810
|
}
|
|
5610
5811
|
_partIndex() {
|
|
5611
|
-
return this._slidePartIndex ||=
|
|
5812
|
+
return this._slidePartIndex ||= Pi(this._partNames()), this._slidePartIndex;
|
|
5612
5813
|
}
|
|
5613
5814
|
getSlideIndexByPartName(e) {
|
|
5614
5815
|
return this._partIndex().get(e);
|
|
5615
5816
|
}
|
|
5616
5817
|
resolveInternalTarget(e, t = 0) {
|
|
5617
|
-
return
|
|
5818
|
+
return Ii(e, this._partIndex(), t);
|
|
5618
5819
|
}
|
|
5619
5820
|
async renderSlide(e, t, n = {}) {
|
|
5620
5821
|
if (this._mode === "worker") throw Error("renderSlide(canvas) is unavailable in mode: 'worker'; use renderSlideToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
5621
5822
|
if (!this._presentation) throw Error("Presentation not loaded");
|
|
5622
5823
|
let r = this._presentation.slides[t];
|
|
5623
5824
|
if (!r) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
|
|
5624
|
-
let i = n.dpr ??
|
|
5625
|
-
await
|
|
5825
|
+
let i = n.dpr ?? o(), a = n.width ?? ((p(e) ? e.offsetWidth : 0) || 960);
|
|
5826
|
+
await ui(e, r, this._presentation.slideWidth, this._presentation.slideHeight, {
|
|
5626
5827
|
width: a,
|
|
5627
5828
|
dpr: i,
|
|
5628
5829
|
defaultTextColor: this._presentation.defaultTextColor,
|
|
@@ -5637,7 +5838,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5637
5838
|
}, n.onTextRun);
|
|
5638
5839
|
}
|
|
5639
5840
|
async renderSlideToBitmap(e, t = {}) {
|
|
5640
|
-
let n = t.width ?? 960, r = t.dpr ??
|
|
5841
|
+
let n = t.width ?? 960, r = t.dpr ?? o();
|
|
5641
5842
|
if (this._mode === "worker") {
|
|
5642
5843
|
if (!Number.isInteger(e) || e < 0 || e >= this.slideCount) throw Error(`Slide index ${e} out of range (count: ${this.slideCount})`);
|
|
5643
5844
|
let i = await this._bridge.request((i) => ({
|
|
@@ -5691,7 +5892,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5691
5892
|
return this._mediaCache.set(e, r), r;
|
|
5692
5893
|
}
|
|
5693
5894
|
_findMimeTypeForPath(e) {
|
|
5694
|
-
return this._presentation ?
|
|
5895
|
+
return this._presentation ? Vi(this._presentation, e) : "";
|
|
5695
5896
|
}
|
|
5696
5897
|
async getImage(e, t) {
|
|
5697
5898
|
let n = this._imageCache.get(e);
|
|
@@ -5715,7 +5916,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5715
5916
|
async presentSlide(e, t, n = {}) {
|
|
5716
5917
|
if (this._mode === "main" && !this._presentation) throw Error("Presentation not loaded");
|
|
5717
5918
|
if (!Number.isInteger(t) || t < 0 || t >= this.slideCount) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
|
|
5718
|
-
let r = n.dpr ??
|
|
5919
|
+
let r = n.dpr ?? o(), i = n.width ?? (e.offsetWidth || 960), a = this._mode === "worker" ? async () => {
|
|
5719
5920
|
let a = await this.renderSlideToBitmap(t, {
|
|
5720
5921
|
width: i,
|
|
5721
5922
|
dpr: r,
|
|
@@ -5734,7 +5935,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5734
5935
|
dim: n.dim,
|
|
5735
5936
|
onTextRun: n.onTextRun
|
|
5736
5937
|
});
|
|
5737
|
-
return
|
|
5938
|
+
return _i(e, this._mode === "worker" ? this._meta?.mediaElements[t] ?? [] : this._presentation.slides[t].elements.filter((e) => e.type === "media"), {
|
|
5738
5939
|
width: i,
|
|
5739
5940
|
dpr: r,
|
|
5740
5941
|
slideWidthEmu: this.slideWidth,
|
|
@@ -5744,12 +5945,12 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5744
5945
|
});
|
|
5745
5946
|
}
|
|
5746
5947
|
destroy() {
|
|
5747
|
-
this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (
|
|
5948
|
+
this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (D(this._googleFontFaces), this._googleFontFaces = []), ie(this._fetchImage), Ke(this._fetchImage), B(this._fetchImage);
|
|
5748
5949
|
}
|
|
5749
|
-
},
|
|
5950
|
+
}, qi = {
|
|
5750
5951
|
color: "#ffffff",
|
|
5751
5952
|
opacity: .6
|
|
5752
|
-
},
|
|
5953
|
+
}, Ji = class {
|
|
5753
5954
|
canvas;
|
|
5754
5955
|
wrapper;
|
|
5755
5956
|
_scale = null;
|
|
@@ -5772,12 +5973,12 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5772
5973
|
constructor(e, t = {}) {
|
|
5773
5974
|
this.opts = t, this.canvas = e, this._mode = t.mode ?? "main", this._hiddenMode = t.hiddenSlideMode ?? "show";
|
|
5774
5975
|
let n = e.parentElement;
|
|
5775
|
-
this._originalParent = n, this._originalNextSibling = e.nextSibling, this._originalDisplay = e.style.display, this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;display:inline-block;vertical-align:top;", e.style.display || (e.style.display = "block"), n && n.insertBefore(this.wrapper, e), this.wrapper.appendChild(e), this._mode === "worker" && !t.enableMediaPlayback && (this._bitmapCtx = e.getContext("bitmaprenderer")), t.enableTextSelection && (this.textLayer = document.createElement("div"), this.textLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", this.wrapper.appendChild(this.textLayer)), this.highlightLayer = document.createElement("div"), this.highlightLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", this.wrapper.appendChild(this.highlightLayer), this._find = new
|
|
5976
|
+
this._originalParent = n, this._originalNextSibling = e.nextSibling, this._originalDisplay = e.style.display, this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;display:inline-block;vertical-align:top;", e.style.display || (e.style.display = "block"), n && n.insertBefore(this.wrapper, e), this.wrapper.appendChild(e), this._mode === "worker" && !t.enableMediaPlayback && (this._bitmapCtx = e.getContext("bitmaprenderer")), t.enableTextSelection && (this.textLayer = document.createElement("div"), this.textLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", this.wrapper.appendChild(this.textLayer)), this.highlightLayer = document.createElement("div"), this.highlightLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", this.wrapper.appendChild(this.highlightLayer), this._find = new An(() => this.slideCount, (e) => this._collectSlideRuns(e));
|
|
5776
5977
|
}
|
|
5777
5978
|
async load(e) {
|
|
5778
5979
|
let t = ++this._loadGen, n = this.engine;
|
|
5779
5980
|
try {
|
|
5780
|
-
let r = await
|
|
5981
|
+
let r = await Ki.load(e, {
|
|
5781
5982
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
5782
5983
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
5783
5984
|
workerTimeoutMs: this.opts.workerTimeoutMs,
|
|
@@ -5810,19 +6011,19 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5810
6011
|
await this.goToSlide(this._step(-1));
|
|
5811
6012
|
}
|
|
5812
6013
|
_step(e) {
|
|
5813
|
-
return this._hiddenMode === "skip" && this.engine ?
|
|
6014
|
+
return this._hiddenMode === "skip" && this.engine ? qe(this.currentSlide, e, (e) => this.engine.isHidden(e), this.slideCount) : this.currentSlide + e;
|
|
5814
6015
|
}
|
|
5815
6016
|
_initialSlide() {
|
|
5816
|
-
return this._hiddenMode === "skip" && this.engine ?
|
|
6017
|
+
return this._hiddenMode === "skip" && this.engine ? Je(0, (e) => this.engine.isHidden(e), this.slideCount) : 0;
|
|
5817
6018
|
}
|
|
5818
6019
|
_dim() {
|
|
5819
6020
|
return {
|
|
5820
|
-
color: this.opts.hiddenSlideDim?.color ??
|
|
5821
|
-
opacity: this.opts.hiddenSlideDim?.opacity ??
|
|
6021
|
+
color: this.opts.hiddenSlideDim?.color ?? qi.color,
|
|
6022
|
+
opacity: this.opts.hiddenSlideDim?.opacity ?? qi.opacity
|
|
5822
6023
|
};
|
|
5823
6024
|
}
|
|
5824
6025
|
async setHiddenSlideMode(e) {
|
|
5825
|
-
this._hiddenMode = e, e === "skip" && this.engine && (this.currentSlide =
|
|
6026
|
+
this._hiddenMode = e, e === "skip" && this.engine && (this.currentSlide = Je(this.currentSlide, (e) => this.engine.isHidden(e), this.slideCount)), await this.renderCurrentSlide();
|
|
5826
6027
|
}
|
|
5827
6028
|
get hiddenSlideMode() {
|
|
5828
6029
|
return this._hiddenMode;
|
|
@@ -5830,7 +6031,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5830
6031
|
get visibleSlideCount() {
|
|
5831
6032
|
if (!this.engine) return 0;
|
|
5832
6033
|
let e = this.engine;
|
|
5833
|
-
return
|
|
6034
|
+
return Ye((t) => e.isHidden(t), this.slideCount);
|
|
5834
6035
|
}
|
|
5835
6036
|
get slideIndex() {
|
|
5836
6037
|
return this.currentSlide;
|
|
@@ -5845,8 +6046,8 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5845
6046
|
return this.canvas;
|
|
5846
6047
|
}
|
|
5847
6048
|
_naturalWidthPx() {
|
|
5848
|
-
let
|
|
5849
|
-
return
|
|
6049
|
+
let t = this.engine?.slideWidth ?? 0;
|
|
6050
|
+
return t > 0 ? t / e : 0;
|
|
5850
6051
|
}
|
|
5851
6052
|
_targetWidth() {
|
|
5852
6053
|
if (this._scale === null) return this.opts.width ?? (this.canvas.offsetWidth || 960);
|
|
@@ -5865,14 +6066,14 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5865
6066
|
return this.opts.zoomMax ?? 4;
|
|
5866
6067
|
}
|
|
5867
6068
|
async setScale(e) {
|
|
5868
|
-
let t =
|
|
6069
|
+
let t = Ce(e, this._zoomMin(), this._zoomMax()), n = t !== this.getScale();
|
|
5869
6070
|
this._scale = t, await this.renderCurrentSlide(), n && this.opts.onScaleChange?.(t);
|
|
5870
6071
|
}
|
|
5871
6072
|
async zoomIn() {
|
|
5872
|
-
await this.setScale(
|
|
6073
|
+
await this.setScale(U(this.getScale()));
|
|
5873
6074
|
}
|
|
5874
6075
|
async zoomOut() {
|
|
5875
|
-
await this.setScale(
|
|
6076
|
+
await this.setScale(me(this.getScale()));
|
|
5876
6077
|
}
|
|
5877
6078
|
async fitWidth() {
|
|
5878
6079
|
await this._fit("width");
|
|
@@ -5880,17 +6081,17 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5880
6081
|
async fitPage() {
|
|
5881
6082
|
await this._fit("page");
|
|
5882
6083
|
}
|
|
5883
|
-
async _fit(
|
|
6084
|
+
async _fit(t) {
|
|
5884
6085
|
if (!this.engine) return;
|
|
5885
|
-
let
|
|
5886
|
-
if (!
|
|
5887
|
-
let
|
|
5888
|
-
contentWidth: this.engine.slideWidth /
|
|
5889
|
-
contentHeight: this.engine.slideHeight /
|
|
5890
|
-
containerWidth:
|
|
5891
|
-
containerHeight:
|
|
5892
|
-
},
|
|
5893
|
-
|
|
6086
|
+
let n = this.wrapper.parentElement;
|
|
6087
|
+
if (!n) return;
|
|
6088
|
+
let r = V({
|
|
6089
|
+
contentWidth: this.engine.slideWidth / e,
|
|
6090
|
+
contentHeight: this.engine.slideHeight / e,
|
|
6091
|
+
containerWidth: n.clientWidth,
|
|
6092
|
+
containerHeight: n.clientHeight
|
|
6093
|
+
}, t);
|
|
6094
|
+
r <= 0 || await this.setScale(r);
|
|
5894
6095
|
}
|
|
5895
6096
|
async renderCurrentSlide() {
|
|
5896
6097
|
if (!this.engine) return;
|
|
@@ -5926,7 +6127,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5926
6127
|
}
|
|
5927
6128
|
_buildHighlightLayer(e, t, n) {
|
|
5928
6129
|
let r = this.highlightLayer;
|
|
5929
|
-
r &&
|
|
6130
|
+
r && kn(r, e, this._find.slideHighlights(this.currentSlide), t, n, (e) => this._measureForFont(e));
|
|
5930
6131
|
}
|
|
5931
6132
|
_measureForFont(e) {
|
|
5932
6133
|
this._measureCtx ||= document.createElement("canvas").getContext("2d");
|
|
@@ -5958,7 +6159,10 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5958
6159
|
this._buildHighlightLayer(e, t, n);
|
|
5959
6160
|
}
|
|
5960
6161
|
_buildTextLayer(e, t, n, r) {
|
|
5961
|
-
|
|
6162
|
+
On(e, t, n, r, this._hyperlinkHandler());
|
|
6163
|
+
}
|
|
6164
|
+
_hyperlinkHandler() {
|
|
6165
|
+
if (this.opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
|
|
5962
6166
|
}
|
|
5963
6167
|
_onHyperlinkClick(e) {
|
|
5964
6168
|
let t = this._resolveInternalSlideIndex(e);
|
|
@@ -5967,7 +6171,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5967
6171
|
return;
|
|
5968
6172
|
}
|
|
5969
6173
|
if (t.kind === "external") {
|
|
5970
|
-
|
|
6174
|
+
oe(t.url);
|
|
5971
6175
|
return;
|
|
5972
6176
|
}
|
|
5973
6177
|
t.slideIndex !== void 0 && this.goToSlide(t.slideIndex);
|
|
@@ -5992,7 +6196,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
5992
6196
|
} else this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
|
|
5993
6197
|
this.canvas.style.display = this._originalDisplay, this.wrapper.remove();
|
|
5994
6198
|
}
|
|
5995
|
-
},
|
|
6199
|
+
}, Yi = 150, Xi = "0 1px 3px rgba(0,0,0,0.2)", Zi = class {
|
|
5996
6200
|
_pres = null;
|
|
5997
6201
|
_injected;
|
|
5998
6202
|
_opts;
|
|
@@ -6023,7 +6227,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6023
6227
|
_pageShadow;
|
|
6024
6228
|
constructor(e, t = {}) {
|
|
6025
6229
|
if (e.tagName === "CANVAS") throw Error("PptxScrollViewer takes a container element (e.g. a <div>), not a <canvas> — the viewer creates and manages its own canvases. Pass a block container; for the single-slide canvas API use PptxViewer.");
|
|
6026
|
-
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ??
|
|
6230
|
+
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ?? Xi, this._injected = !!t.presentation, this._injected) {
|
|
6027
6231
|
let e = t.presentation;
|
|
6028
6232
|
if (t.mode !== void 0 && t.mode !== e.mode) throw Error(`PptxScrollViewer: opts.mode='${t.mode}' conflicts with the injected engine's mode='${e.mode}'. Omit opts.mode when injecting an engine — the engine owns its render mode.`);
|
|
6029
6233
|
this._pres = e, this._mode = e.mode;
|
|
@@ -6034,14 +6238,14 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6034
6238
|
this._pendingZoomAnchor = Number.isFinite(n) && Number.isFinite(r) ? {
|
|
6035
6239
|
x: n,
|
|
6036
6240
|
y: r
|
|
6037
|
-
} : null, this.setScale(
|
|
6241
|
+
} : null, this.setScale(te(this._scale, e.deltaY));
|
|
6038
6242
|
}, this._scrollHost.addEventListener("wheel", this._wheelListener, { passive: !1 })), typeof ResizeObserver < "u" && (this._resizeObserver = new ResizeObserver(() => this._onResize()), this._resizeObserver.observe(this._container)), this._injected && this.relayout();
|
|
6039
6243
|
}
|
|
6040
6244
|
async load(e) {
|
|
6041
6245
|
if (this._injected) throw Error("PptxScrollViewer.load() is unsupported when an engine is injected via opts.presentation; the injected engine is already loaded.");
|
|
6042
6246
|
let t = ++this._loadGen, n = this._pres;
|
|
6043
6247
|
try {
|
|
6044
|
-
let r = await
|
|
6248
|
+
let r = await Ki.load(e, {
|
|
6045
6249
|
useGoogleFonts: this._opts.useGoogleFonts,
|
|
6046
6250
|
maxZipEntryBytes: this._opts.maxZipEntryBytes,
|
|
6047
6251
|
workerTimeoutMs: this._opts.workerTimeoutMs,
|
|
@@ -6072,10 +6276,10 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6072
6276
|
return this._pres?.slideCount ?? 0;
|
|
6073
6277
|
}
|
|
6074
6278
|
_slideWidthPx() {
|
|
6075
|
-
return this._pres.slideWidth /
|
|
6279
|
+
return this._pres.slideWidth / e * this._scale;
|
|
6076
6280
|
}
|
|
6077
6281
|
_slideHeightPx() {
|
|
6078
|
-
return this._pres.slideHeight /
|
|
6282
|
+
return this._pres.slideHeight / e * this._scale;
|
|
6079
6283
|
}
|
|
6080
6284
|
_fitWidthPx() {
|
|
6081
6285
|
if (this._opts.width && this._opts.width > 0) return this._opts.width;
|
|
@@ -6086,8 +6290,8 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6086
6290
|
}
|
|
6087
6291
|
_baseScale() {
|
|
6088
6292
|
if (!this._pres || this._pres.slideCount === 0) return 0;
|
|
6089
|
-
let
|
|
6090
|
-
return
|
|
6293
|
+
let t = this._fitWidthPx(), n = this._pres.slideWidth / e;
|
|
6294
|
+
return t <= 0 || n <= 0 ? 0 : t / n;
|
|
6091
6295
|
}
|
|
6092
6296
|
relayout() {
|
|
6093
6297
|
if (this._pres) {
|
|
@@ -6136,7 +6340,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6136
6340
|
return a;
|
|
6137
6341
|
}
|
|
6138
6342
|
_range() {
|
|
6139
|
-
return
|
|
6343
|
+
return He(this._heights, this._gap(), this._scrollHost.scrollTop, this._scrollHost.clientHeight, this._overscan(), this._pad());
|
|
6140
6344
|
}
|
|
6141
6345
|
_syncSpacer() {
|
|
6142
6346
|
let e = this._range();
|
|
@@ -6209,7 +6413,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6209
6413
|
dpr: n,
|
|
6210
6414
|
onTextRun: c
|
|
6211
6415
|
}).then(() => {
|
|
6212
|
-
i !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e || (t.renderedScale = a, s && t.textLayer &&
|
|
6416
|
+
i !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e || (t.renderedScale = a, s && t.textLayer && On(t.textLayer, o, Math.round(r), Math.round(this._slideHeightPx()), this._hyperlinkHandler()));
|
|
6213
6417
|
}).catch((e) => {
|
|
6214
6418
|
this._reportRenderError(e);
|
|
6215
6419
|
});
|
|
@@ -6236,7 +6440,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6236
6440
|
l.close();
|
|
6237
6441
|
return;
|
|
6238
6442
|
}
|
|
6239
|
-
t.bitmap && t.bitmap.close(), t.bitmap = l, t.canvas.width = l.width, t.canvas.height = l.height, t.canvas.style.width = `${Math.round(l.width / r)}px`, t.canvas.style.height = `${Math.round(l.height / r)}px`, t.bitmapCtx?.transferFromImageBitmap(l), t.bitmap = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", s &&
|
|
6443
|
+
t.bitmap && t.bitmap.close(), t.bitmap = l, t.canvas.width = l.width, t.canvas.height = l.height, t.canvas.style.width = `${Math.round(l.width / r)}px`, t.canvas.style.height = `${Math.round(l.height / r)}px`, t.bitmapCtx?.transferFromImageBitmap(l), t.bitmap = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", s && On(t.textLayer, c, Math.round(n), Math.round(this._slideHeightPx()), this._hyperlinkHandler())), o = !0;
|
|
6240
6444
|
} catch (e) {
|
|
6241
6445
|
this._reportRenderError(e);
|
|
6242
6446
|
} finally {
|
|
@@ -6256,12 +6460,12 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6256
6460
|
d = Math.min(1, Math.max(0, d));
|
|
6257
6461
|
let f = this._padH().left, p = this._scrollHost.scrollLeft || 0;
|
|
6258
6462
|
this._renderEpoch++, this._scale = r, this._recomputeHeights();
|
|
6259
|
-
let m =
|
|
6463
|
+
let m = He(this._heights, this._gap(), 0, this._scrollHost.clientHeight, this._overscan(), this._pad());
|
|
6260
6464
|
this._spacer.style.height = `${m.totalHeight}px`, this._syncSpacerWidth();
|
|
6261
6465
|
let h = Math.max(0, m.totalHeight - this._scrollHost.clientHeight), g = (m.offsets[l] ?? 0) + d * (this._heights[l] || 0);
|
|
6262
6466
|
if (this._scrollHost.scrollTop = Math.min(h, Math.max(0, g - o)), i) {
|
|
6263
6467
|
let e = Math.max(0, (this._spacer.offsetWidth || 0) - this._scrollHost.clientWidth);
|
|
6264
|
-
this._scrollHost.scrollLeft =
|
|
6468
|
+
this._scrollHost.scrollLeft = ce(p, i.x - f, a, r, { maxScroll: e });
|
|
6265
6469
|
}
|
|
6266
6470
|
this._previewVisible(), this._scheduleSettle(), this._opts.onScaleChange?.(r);
|
|
6267
6471
|
}
|
|
@@ -6269,10 +6473,10 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6269
6473
|
return this._scaleEstablished ? this._scale : this._pendingScale ?? 1;
|
|
6270
6474
|
}
|
|
6271
6475
|
zoomIn() {
|
|
6272
|
-
this.setScale(
|
|
6476
|
+
this.setScale(U(this.getScale()));
|
|
6273
6477
|
}
|
|
6274
6478
|
zoomOut() {
|
|
6275
|
-
this.setScale(
|
|
6479
|
+
this.setScale(me(this.getScale()));
|
|
6276
6480
|
}
|
|
6277
6481
|
fitWidth() {
|
|
6278
6482
|
this._fit("width");
|
|
@@ -6280,15 +6484,15 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6280
6484
|
fitPage() {
|
|
6281
6485
|
this._fit("page");
|
|
6282
6486
|
}
|
|
6283
|
-
_fit(
|
|
6487
|
+
_fit(t) {
|
|
6284
6488
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
6285
|
-
let
|
|
6286
|
-
contentWidth: this._pres.slideWidth /
|
|
6287
|
-
contentHeight: this._pres.slideHeight /
|
|
6489
|
+
let n = V({
|
|
6490
|
+
contentWidth: this._pres.slideWidth / e,
|
|
6491
|
+
contentHeight: this._pres.slideHeight / e,
|
|
6288
6492
|
containerWidth: this._fitWidthPx(),
|
|
6289
6493
|
containerHeight: this._scrollHost.clientHeight
|
|
6290
|
-
},
|
|
6291
|
-
|
|
6494
|
+
}, t);
|
|
6495
|
+
n <= 0 || this.setScale(n);
|
|
6292
6496
|
}
|
|
6293
6497
|
_previewVisible() {
|
|
6294
6498
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
@@ -6314,7 +6518,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6314
6518
|
_scheduleSettle() {
|
|
6315
6519
|
this._settleTimer !== null && clearTimeout(this._settleTimer), this._settleTimer = setTimeout(() => {
|
|
6316
6520
|
this._settleTimer = null, this._settleRender();
|
|
6317
|
-
},
|
|
6521
|
+
}, Yi);
|
|
6318
6522
|
}
|
|
6319
6523
|
_settleRender() {
|
|
6320
6524
|
if (!(this._destroyed || !this._pres || this._pres.slideCount === 0)) for (let [e, t] of [...this._slots]) t.renderedScale !== this._scale && this._settleSlot(e, t);
|
|
@@ -6336,19 +6540,22 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6336
6540
|
}).then(() => {
|
|
6337
6541
|
if (a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) return;
|
|
6338
6542
|
let n = t.canvas;
|
|
6339
|
-
t.wrapper.insertBefore(o, n), n.remove(), t.canvas = o, t.bitmapCtx = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", c &&
|
|
6543
|
+
t.wrapper.insertBefore(o, n), n.remove(), t.canvas = o, t.bitmapCtx = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", c && On(t.textLayer, s, Math.round(r), Math.round(this._slideHeightPx()), this._hyperlinkHandler()));
|
|
6340
6544
|
}).catch((e) => {
|
|
6341
6545
|
this._reportRenderError(e);
|
|
6342
6546
|
});
|
|
6343
6547
|
}
|
|
6344
6548
|
scrollToSlide(e, t) {
|
|
6345
6549
|
if (!this._pres || this._pres.slideCount === 0 || !this._scaleEstablished) return;
|
|
6346
|
-
let n = Math.max(0, Math.min(e, this._pres.slideCount - 1)), r =
|
|
6550
|
+
let n = Math.max(0, Math.min(e, this._pres.slideCount - 1)), r = He(this._heights, this._gap(), 0, this._scrollHost.clientHeight, this._overscan(), this._pad()), i = r.offsets[n] ?? 0, a = Math.max(0, r.totalHeight - this._scrollHost.clientHeight), o = Math.min(a, Math.max(0, i)), s = this._scrollHost;
|
|
6347
6551
|
typeof s.scrollTo == "function" ? s.scrollTo({
|
|
6348
6552
|
top: o,
|
|
6349
6553
|
behavior: t?.behavior ?? "auto"
|
|
6350
6554
|
}) : this._scrollHost.scrollTop = o, this._mountVisible();
|
|
6351
6555
|
}
|
|
6556
|
+
_hyperlinkHandler() {
|
|
6557
|
+
if (this._opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
|
|
6558
|
+
}
|
|
6352
6559
|
_onHyperlinkClick(e) {
|
|
6353
6560
|
let t = this._resolveInternalSlideIndex(e);
|
|
6354
6561
|
if (this._opts.onHyperlinkClick) {
|
|
@@ -6356,7 +6563,7 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6356
6563
|
return;
|
|
6357
6564
|
}
|
|
6358
6565
|
if (t.kind === "external") {
|
|
6359
|
-
|
|
6566
|
+
oe(t.url);
|
|
6360
6567
|
return;
|
|
6361
6568
|
}
|
|
6362
6569
|
t.slideIndex !== void 0 && this.scrollToSlide(t.slideIndex);
|
|
@@ -6419,16 +6626,16 @@ var vi = new URL("pptx_parser_bg.wasm", import.meta.url).href, yi = class e {
|
|
|
6419
6626
|
for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
|
|
6420
6627
|
this._free.length = 0, this._injected || this._pres?.destroy(), this._pres = null, this._wrapper.remove();
|
|
6421
6628
|
}
|
|
6422
|
-
},
|
|
6423
|
-
OoxmlError: () =>
|
|
6424
|
-
PptxPresentation: () =>
|
|
6425
|
-
PptxScrollViewer: () =>
|
|
6426
|
-
PptxViewer: () =>
|
|
6427
|
-
autoResize: () =>
|
|
6428
|
-
buildPptxHighlightLayer: () =>
|
|
6429
|
-
buildPptxTextLayer: () =>
|
|
6430
|
-
openExternalHyperlink: () =>
|
|
6431
|
-
renderSlide: () =>
|
|
6629
|
+
}, Qi = /* @__PURE__ */ j({
|
|
6630
|
+
OoxmlError: () => M,
|
|
6631
|
+
PptxPresentation: () => Ki,
|
|
6632
|
+
PptxScrollViewer: () => Zi,
|
|
6633
|
+
PptxViewer: () => Ji,
|
|
6634
|
+
autoResize: () => ee,
|
|
6635
|
+
buildPptxHighlightLayer: () => kn,
|
|
6636
|
+
buildPptxTextLayer: () => On,
|
|
6637
|
+
openExternalHyperlink: () => oe,
|
|
6638
|
+
renderSlide: () => ui
|
|
6432
6639
|
});
|
|
6433
6640
|
//#endregion
|
|
6434
|
-
export {
|
|
6641
|
+
export { ui as a, Ki as i, Zi as n, kn as o, Ji as r, On as s, Qi as t };
|