@silurus/ooxml 0.85.3 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -7
- package/dist/assets/render-worker-BCGnuBLj.js +10 -0
- package/dist/assets/render-worker-CB4DxjXg.js +31 -0
- package/dist/assets/render-worker-CHW0F0n6.js +11 -0
- package/dist/{bounded-raw-part-cache-C6ro6Ezf.js → bounded-raw-part-cache-DVx3Camo.js} +12 -10
- package/dist/{canvas-viewer-mechanics-CDNMJ-Yz.js → canvas-viewer-mechanics-B3A7KLLi.js} +1 -1
- package/dist/{comment-ui-runtime-DAKBCpsM.js → comment-ui-runtime-DEtgcmj7.js} +5 -5
- package/dist/comment-ui-runtime-TLHustXJ.js +2 -0
- package/dist/{comment-ui-runtime-CAbpuWi_.js → comment-ui-runtime-ssI6IE39.js} +4 -4
- package/dist/{comments-Brfxa3hQ.js → comments-CAn2A_Xh.js} +1 -1
- package/dist/delimited-text-worker-host-DcHj_JZt.js +27 -0
- package/dist/{document-pull-client-F3ox_VXK.js → document-pull-client-xZrA2IjM.js} +577 -576
- package/dist/{docx-BYvm3TWw.js → docx-DzDiGvqe.js} +63 -63
- package/dist/docx.mjs +5 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-CDGegIB5.js → dom-interaction-boundary-DK1JLkrz.js} +2 -2
- package/dist/{line-metrics-BGtFM-ec.js → hyperlink-enyPbflR.js} +847 -877
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-BFB575d6.js +1023 -0
- package/dist/line-metrics-CBbw80Ko.js +60 -0
- package/dist/node.mjs +91 -91
- package/dist/{pptx-BqpVTP8p.js → pptx-D_U62nl-.js} +71 -71
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DeZpRCfx.js → render-DSn0d35X.js} +1 -1
- package/dist/{render-worker-host-CBcQXsR5.js → render-worker-host-BHz9vjxB.js} +1 -1
- package/dist/{render-worker-host-BKtXmlEF.js → render-worker-host-CO0UYoQh.js} +1 -1
- package/dist/{render-worker-host-CNKQ76tu.js → render-worker-host-CbYDBg7U.js} +1 -1
- package/dist/{resource-measurement-D41R-0Bl.js → resource-measurement-Do07ZRcR.js} +7 -7
- package/dist/{session-n2p5_jxV.js → session-C1GYhr6n.js} +77 -77
- package/dist/{slide-pull-client-Dwek7xW8.js → slide-pull-client-DuEaUxPw.js} +732 -732
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +10 -10
- package/dist/types/index.d.ts +38 -18
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +6 -5
- package/dist/types/pptx.d.ts +10 -10
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +34 -14
- package/dist/{worksheet-pull-client-C9sC36Vu.js → worksheet-pull-client-eDiHHEG2.js} +99 -96
- package/dist/{xlsx-DSU6pV1O.js → xlsx-CMHmYTHP.js} +1629 -1469
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-D1O73gYW.js +0 -10
- package/dist/assets/render-worker-DHP0rgcW.js +0 -24
- package/dist/assets/render-worker-V2wWYA4O.js +0 -11
- package/dist/comment-ui-runtime-DTaaZdXC.js +0 -2
- package/dist/line-distribute-BsV4MVZ2.js +0 -1023
- /package/dist/{comment-occurrence-tj54AXXB.js → comment-occurrence-Dhdplprg.js} +0 -0
- /package/dist/{highlight-rect-DBcYVJDv.js → highlight-rect-FuUSmL3a.js} +0 -0
- /package/dist/{read-only-comment-decoration-Mv_SAiHy.js → read-only-comment-decoration-BTnWEeo5.js} +0 -0
- /package/dist/{read-only-comment-margin-Cqu-Ir0C.js → read-only-comment-margin-plStyGfE.js} +0 -0
- /package/dist/{source-key-BkBB3X82.js → source-key-Ktb1GRE5.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, Bt as r,
|
|
2
|
-
import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-
|
|
1
|
+
import { $ as e, A as t, At as n, Bt as r, Ct as i, E as a, Et as o, Ft as s, It as c, Jt as l, K as u, Lt as d, Mt as f, Nt as p, O as m, Ot as h, Pt as g, Q as _, Rt as v, S as y, St as b, T as x, Ut as S, Vt as C, Yt as w, Z as T, _ as E, a as D, b as O, bt as k, c as A, d as j, et as M, f as N, ft as P, h as F, ht as I, j as L, jt as R, k as z, kt as B, l as V, lt as H, m as ee, mt as U, n as W, nt as te, o as G, ot as K, p as q, rt as J, sn as ne, st as re, t as ie, tt as ae, u as oe, vt as se, wt as ce, x as le, xt as ue, yt as de, zt as fe } from "./hyperlink-enyPbflR.js";
|
|
2
|
+
import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-BFB575d6.js";
|
|
3
3
|
import { A as Te, D as Ee, S as De, _ as Oe, h as ke, hn as Ae, in as je, j as Me, on as Ne, sn as Pe, v as Fe, w as Ie } from "./plot-area-frame-D5hEOgkJ.js";
|
|
4
4
|
import { l as Le } from "./pixel-budget-Dgjw269h.js";
|
|
5
5
|
import { r as Y } from "./units-EJdC96r6.js";
|
|
6
6
|
import { A as Re, F as ze, I as Be, L as Ve, M as He, N as Ue, P as We, j as Ge } from "./three-d-YYghQndN.js";
|
|
7
7
|
import { k as Ke } from "./renderer-XFSCOT6m.js";
|
|
8
8
|
import { s as qe } from "./raster-target-ojDdQizC.js";
|
|
9
|
-
import { a as Je, i as Ye, n as Xe, t as Ze } from "./resource-measurement-
|
|
9
|
+
import { a as Je, i as Ye, n as Xe, t as Ze } from "./resource-measurement-Do07ZRcR.js";
|
|
10
10
|
//#region packages/pptx/src/types.ts
|
|
11
11
|
function Qe(e) {
|
|
12
12
|
return e;
|
|
@@ -2402,8 +2402,8 @@ function it(e) {
|
|
|
2402
2402
|
if (t) return t;
|
|
2403
2403
|
let n = tt[e];
|
|
2404
2404
|
return n ? (t = {
|
|
2405
|
-
adj: n.adj.map(([e, t]) => [e,
|
|
2406
|
-
gd: n.gd.map(([e, t]) => [e,
|
|
2405
|
+
adj: n.adj.map(([e, t]) => [e, f(t)]),
|
|
2406
|
+
gd: n.gd.map(([e, t]) => [e, f(t)]),
|
|
2407
2407
|
paths: n.paths
|
|
2408
2408
|
}, nt.set(e, t), t) : null;
|
|
2409
2409
|
}
|
|
@@ -2476,16 +2476,16 @@ function st(e) {
|
|
|
2476
2476
|
function ct(e, t, n, r) {
|
|
2477
2477
|
let i = it(e.toLowerCase());
|
|
2478
2478
|
if (!i || i.paths.length === 0) return null;
|
|
2479
|
-
let a =
|
|
2479
|
+
let a = p({
|
|
2480
2480
|
w: n,
|
|
2481
2481
|
h: r,
|
|
2482
2482
|
adj: t
|
|
2483
|
-
}, i.adj, i.gd), o = i.paths.length === 1, s = ot(i.paths[0], a, n, r),
|
|
2483
|
+
}, i.adj, i.gd), o = i.paths.length === 1, s = ot(i.paths[0], a, n, r), c = o ? s : ot(i.paths[i.paths.length - 1], a, n, r);
|
|
2484
2484
|
return {
|
|
2485
2485
|
top: s,
|
|
2486
|
-
bottom:
|
|
2486
|
+
bottom: c,
|
|
2487
2487
|
topLen: st(s),
|
|
2488
|
-
bottomLen: st(
|
|
2488
|
+
bottomLen: st(c),
|
|
2489
2489
|
singleEdge: o
|
|
2490
2490
|
};
|
|
2491
2491
|
}
|
|
@@ -3079,32 +3079,32 @@ function Xt(e, t, n) {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
//#endregion
|
|
3081
3081
|
//#region packages/core/src/text/underline.ts
|
|
3082
|
-
function Zt(t, n, r, i, a, o, s
|
|
3083
|
-
let
|
|
3084
|
-
if (
|
|
3085
|
-
let
|
|
3086
|
-
|
|
3087
|
-
let a = Math.max(1,
|
|
3088
|
-
for (let o = 0; o <=
|
|
3089
|
-
let
|
|
3090
|
-
|
|
3082
|
+
function Zt(e, t, n, r, i, a, o, s = 1) {
|
|
3083
|
+
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = T(u, l, s);
|
|
3084
|
+
if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
|
|
3085
|
+
let n = l, i = l * 6;
|
|
3086
|
+
e.beginPath(), e.moveTo(t, u);
|
|
3087
|
+
let a = Math.max(1, l * .5);
|
|
3088
|
+
for (let o = 0; o <= r; o += a) {
|
|
3089
|
+
let r = u + Math.sin(o / i * Math.PI * 2) * n;
|
|
3090
|
+
e.lineTo(t + o, r);
|
|
3091
3091
|
}
|
|
3092
|
-
if (
|
|
3093
|
-
|
|
3094
|
-
for (let o = 0; o <=
|
|
3095
|
-
let
|
|
3096
|
-
|
|
3092
|
+
if (e.stroke(), o === "wavyDbl") {
|
|
3093
|
+
e.beginPath(), e.moveTo(t, u + n * 2.5);
|
|
3094
|
+
for (let o = 0; o <= r; o += a) {
|
|
3095
|
+
let r = u + n * 2.5 + Math.sin(o / i * Math.PI * 2) * n;
|
|
3096
|
+
e.lineTo(t + o, r);
|
|
3097
3097
|
}
|
|
3098
|
-
|
|
3098
|
+
e.stroke();
|
|
3099
3099
|
}
|
|
3100
3100
|
return;
|
|
3101
3101
|
}
|
|
3102
|
-
if (
|
|
3103
|
-
let
|
|
3104
|
-
|
|
3102
|
+
if (o === "dbl") {
|
|
3103
|
+
let n = l * 1.4, i = u - n / 2, a = u + n / 2;
|
|
3104
|
+
e.beginPath(), e.moveTo(t, i + T(i, l, s)), e.lineTo(t + r, i + T(i, l, s)), e.moveTo(t, a + T(a, l, s)), e.lineTo(t + r, a + T(a, l, s)), e.stroke();
|
|
3105
3105
|
return;
|
|
3106
3106
|
}
|
|
3107
|
-
|
|
3107
|
+
e.setLineDash(De(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
|
|
3108
3108
|
}
|
|
3109
3109
|
//#endregion
|
|
3110
3110
|
//#region packages/core/src/text/highlight-box.ts
|
|
@@ -3159,8 +3159,8 @@ function rn(e, t) {
|
|
|
3159
3159
|
kind: "internal",
|
|
3160
3160
|
ref: n ?? r
|
|
3161
3161
|
};
|
|
3162
|
-
let i = n, a =
|
|
3163
|
-
return a !== null &&
|
|
3162
|
+
let i = n, a = W(i);
|
|
3163
|
+
return a !== null && ie.includes(a) ? {
|
|
3164
3164
|
kind: "external",
|
|
3165
3165
|
url: i
|
|
3166
3166
|
} : {
|
|
@@ -3191,7 +3191,7 @@ var on = (e) => {
|
|
|
3191
3191
|
function cn(e) {
|
|
3192
3192
|
for (let t of e) {
|
|
3193
3193
|
let e = on(t);
|
|
3194
|
-
if (e !== void 0 &&
|
|
3194
|
+
if (e !== void 0 && z(e)) return !0;
|
|
3195
3195
|
}
|
|
3196
3196
|
return !1;
|
|
3197
3197
|
}
|
|
@@ -3211,7 +3211,7 @@ function ln(e, n) {
|
|
|
3211
3211
|
}
|
|
3212
3212
|
}
|
|
3213
3213
|
if (o) for (; o.length < i.length;) o.push(null);
|
|
3214
|
-
let { levels: s, paragraphLevel: c } =
|
|
3214
|
+
let { levels: s, paragraphLevel: c } = t().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = m(s, c, a), d = Array(r);
|
|
3215
3215
|
for (let e = 0; e < r; e++) d[e] = (u[e] & 1) == 1;
|
|
3216
3216
|
return {
|
|
3217
3217
|
order: l,
|
|
@@ -3222,17 +3222,17 @@ function ln(e, n) {
|
|
|
3222
3222
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3223
3223
|
function un(e, t, n, r, i = 0, a = !1) {
|
|
3224
3224
|
if (e.length === 0) return 0;
|
|
3225
|
-
let
|
|
3225
|
+
let o = t === 0, s = 0, c = t;
|
|
3226
3226
|
for (let t of e) {
|
|
3227
|
-
let e =
|
|
3228
|
-
if (
|
|
3229
|
-
if (
|
|
3230
|
-
|
|
3227
|
+
let e = s > 0 || a ? i : 0;
|
|
3228
|
+
if (c + e + t.w > n) {
|
|
3229
|
+
if (s > 0 || !o) break;
|
|
3230
|
+
c += e + t.w, s++;
|
|
3231
3231
|
break;
|
|
3232
3232
|
}
|
|
3233
|
-
|
|
3233
|
+
c += e + t.w, s++;
|
|
3234
3234
|
}
|
|
3235
|
-
return
|
|
3235
|
+
return s === 0 ? 0 : s >= e.length ? e.length : x(e.map((e) => e.ch), s, r, +!!o);
|
|
3236
3236
|
}
|
|
3237
3237
|
//#endregion
|
|
3238
3238
|
//#region packages/pptx/src/text-justify.ts
|
|
@@ -3244,7 +3244,7 @@ function fn(e, t, n, r, i) {
|
|
|
3244
3244
|
let o = Ce(e, a, {
|
|
3245
3245
|
firstContentSi: 0,
|
|
3246
3246
|
lastDrawnSi: e.length,
|
|
3247
|
-
isGapChar:
|
|
3247
|
+
isGapChar: y,
|
|
3248
3248
|
isWhitespace: dn,
|
|
3249
3249
|
seaClusterGaps: r === "thaiDist"
|
|
3250
3250
|
});
|
|
@@ -3298,9 +3298,9 @@ function hn(e, t) {
|
|
|
3298
3298
|
//#endregion
|
|
3299
3299
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3300
3300
|
function gn(e) {
|
|
3301
|
-
let t =
|
|
3301
|
+
let t = K(e.length === 8 ? e.slice(0, 6) : e);
|
|
3302
3302
|
if (!t) return null;
|
|
3303
|
-
let n =
|
|
3303
|
+
let n = re(t[0], t[1], t[2]);
|
|
3304
3304
|
if (e.length !== 8) return n;
|
|
3305
3305
|
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
3306
3306
|
if (Number.isNaN(r)) return null;
|
|
@@ -3381,12 +3381,12 @@ function Cn(e, t) {
|
|
|
3381
3381
|
function wn(e, t, n, r, i, a, o = "fill", s = xn) {
|
|
3382
3382
|
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Sn(e, t, i), f = 0;
|
|
3383
3383
|
for (let o of t) {
|
|
3384
|
-
let t = o.codePointAt(0) ?? 0, l =
|
|
3385
|
-
if (
|
|
3384
|
+
let t = o.codePointAt(0) ?? 0, l = oe(t), p = e.measureText(o).width + a, m = l === "Tr" ? A(t) : null, h = l === "Tr" && m === null && N(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3385
|
+
if (j(t) && s(t)) {
|
|
3386
3386
|
let t = n + f + p / 2;
|
|
3387
|
-
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
3387
|
+
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", G(e, () => u(o, 0, 0)), e.restore();
|
|
3388
3388
|
} else if (g) {
|
|
3389
|
-
let r = m === null && l === "Tu" ?
|
|
3389
|
+
let r = m === null && l === "Tu" ? V(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? Cn(e, s) / i : 0;
|
|
3390
3390
|
e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
|
|
3391
3391
|
} else if (l === "Tr") {
|
|
3392
3392
|
let t = n + f + p / 2;
|
|
@@ -3397,7 +3397,7 @@ function wn(e, t, n, r, i, a, o = "fill", s = xn) {
|
|
|
3397
3397
|
e.textAlign = c, e.textBaseline = l;
|
|
3398
3398
|
}
|
|
3399
3399
|
function Tn(e, t, n, r, i, a, o = "fill") {
|
|
3400
|
-
wn(e, t, n, r, i, a, o, (t) =>
|
|
3400
|
+
wn(e, t, n, r, i, a, o, (t) => D(e, t));
|
|
3401
3401
|
}
|
|
3402
3402
|
//#endregion
|
|
3403
3403
|
//#region packages/pptx/src/renderer.ts
|
|
@@ -3423,7 +3423,7 @@ function Dn(e, t) {
|
|
|
3423
3423
|
} : void 0;
|
|
3424
3424
|
}
|
|
3425
3425
|
function On(e) {
|
|
3426
|
-
return
|
|
3426
|
+
return J(e) ? e.svgImagePath : e.imagePath;
|
|
3427
3427
|
}
|
|
3428
3428
|
function kn(e, t, n, r) {
|
|
3429
3429
|
let i = Qe(t.bullet);
|
|
@@ -3436,64 +3436,64 @@ function kn(e, t, n, r) {
|
|
|
3436
3436
|
let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
|
|
3437
3437
|
return Math.max(1, s * Y * n * r);
|
|
3438
3438
|
}
|
|
3439
|
-
async function An(e, t, n, r,
|
|
3440
|
-
let d =
|
|
3441
|
-
if (!(!t || !
|
|
3442
|
-
if (
|
|
3439
|
+
async function An(e, t, n, r, a, o, s, c, l, u) {
|
|
3440
|
+
let d = de(o), f = [], p = [], m = (e, t, n, r, a, o = 1, s = a) => {
|
|
3441
|
+
if (!(!t || !a)) {
|
|
3442
|
+
if (i(r) && (d.resolution === "display" || d.strategy === "adaptive")) {
|
|
3443
3443
|
f.push({
|
|
3444
3444
|
key: e,
|
|
3445
3445
|
...t,
|
|
3446
|
-
retainedSurfaceCount:
|
|
3446
|
+
retainedSurfaceCount: o
|
|
3447
3447
|
});
|
|
3448
3448
|
return;
|
|
3449
3449
|
}
|
|
3450
|
-
p.push(
|
|
3450
|
+
p.push(U(n, r, a, s).then((n) => n.dimensions && ce(n.format, u !== void 0) ? {
|
|
3451
3451
|
key: e,
|
|
3452
3452
|
...t,
|
|
3453
3453
|
sourceWidthPx: n.dimensions.width,
|
|
3454
3454
|
sourceHeightPx: n.dimensions.height,
|
|
3455
|
-
retainedSurfaceCount:
|
|
3455
|
+
retainedSurfaceCount: o
|
|
3456
3456
|
} : null).catch(() => null));
|
|
3457
3457
|
}
|
|
3458
3458
|
}, h = e.background;
|
|
3459
3459
|
if (h?.fillType === "image" && h.imagePath && !h.tile && !h.duotone) {
|
|
3460
|
-
let e = h.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)),
|
|
3461
|
-
m(Z(h.imagePath, h.duotone), En(r,
|
|
3460
|
+
let e = h.fillRect ?? {}, r = t * (1 - (e.l ?? 0) - (e.r ?? 0)), i = n * (1 - (e.t ?? 0) - (e.b ?? 0));
|
|
3461
|
+
m(Z(h.imagePath, h.duotone), En(r, i, a, h.srcRect), h.imagePath, h.mimeType, s, 1);
|
|
3462
3462
|
}
|
|
3463
|
-
for (let t of e.elements) if (t.type === "picture") !(
|
|
3463
|
+
for (let t of e.elements) if (t.type === "picture") !(J(t) || t.mimeType === "image/svg+xml") && !t.duotone && m(Z(t.imagePath, t.duotone), En(X(t.width, r), X(t.height, r), a, t.srcRect), t.imagePath, t.mimeType, s, 1);
|
|
3464
3464
|
else if (t.type === "media" && t.posterPath) {
|
|
3465
3465
|
let e = c ? qr(c) : void 0;
|
|
3466
|
-
m(Z(t.posterPath), En(X(t.width, r), X(t.height, r),
|
|
3466
|
+
m(Z(t.posterPath), En(X(t.width, r), X(t.height, r), a), t.posterPath, t.posterMimeType || "application/octet-stream", e, 1, l ?? e);
|
|
3467
3467
|
} else if (t.type === "chart") {
|
|
3468
3468
|
let e = {
|
|
3469
3469
|
widthPt: t.width / Y,
|
|
3470
3470
|
heightPt: t.height / Y,
|
|
3471
|
-
targetWidthPx: X(t.width, r) *
|
|
3472
|
-
targetHeightPx: X(t.height, r) *
|
|
3471
|
+
targetWidthPx: X(t.width, r) * a,
|
|
3472
|
+
targetHeightPx: X(t.height, r) * a
|
|
3473
3473
|
};
|
|
3474
3474
|
for (let n of Te(t.chart)) {
|
|
3475
3475
|
let t = n.fill, r = Ee(n, e);
|
|
3476
|
-
!(t.mimeType === "image/svg+xml" ||
|
|
3476
|
+
!(t.mimeType === "image/svg+xml" || J({
|
|
3477
3477
|
svgImagePath: t.svgImagePath,
|
|
3478
3478
|
srcRect: n.hasSourceCrop ? !0 : null
|
|
3479
3479
|
})) && !t.duotone && !n.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(Z(t.imagePath, t.duotone), {
|
|
3480
3480
|
targetWidthPx: r.targetWidthPx,
|
|
3481
3481
|
targetHeightPx: r.targetHeightPx
|
|
3482
|
-
}, t.imagePath, t.mimeType,
|
|
3482
|
+
}, t.imagePath, t.mimeType, s, 1);
|
|
3483
3483
|
}
|
|
3484
3484
|
} else if (t.type === "shape" && t.textBody) for (let e of t.textBody.paragraphs) {
|
|
3485
3485
|
let n = Qe(e.bullet);
|
|
3486
3486
|
if (n.type !== "blip") continue;
|
|
3487
|
-
let
|
|
3488
|
-
!
|
|
3487
|
+
let i = kn(t.textBody, e, r, a);
|
|
3488
|
+
!i || !s || p.push(U(n.imagePath, n.mimeType, s).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && ce(e.format, u !== void 0) ? {
|
|
3489
3489
|
key: Z(n.imagePath),
|
|
3490
|
-
targetWidthPx:
|
|
3491
|
-
targetHeightPx:
|
|
3490
|
+
targetWidthPx: i * e.dimensions.width / e.dimensions.height,
|
|
3491
|
+
targetHeightPx: i,
|
|
3492
3492
|
sourceWidthPx: e.dimensions.width,
|
|
3493
3493
|
sourceHeightPx: e.dimensions.height
|
|
3494
3494
|
} : null).catch(() => null));
|
|
3495
3495
|
}
|
|
3496
|
-
return f.push(...(await Promise.all(p)).filter((e) => e !== null)),
|
|
3496
|
+
return f.push(...(await Promise.all(p)).filter((e) => e !== null)), k(f, d);
|
|
3497
3497
|
}
|
|
3498
3498
|
function jn(e) {
|
|
3499
3499
|
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? Te(e.chart).length > 0 : e.type === "shape" && !!e.textBody?.paragraphs.some((e) => Qe(e.bullet).type === "blip"));
|
|
@@ -3510,7 +3510,7 @@ var Pn = /* @__PURE__ */ new WeakMap();
|
|
|
3510
3510
|
function Fn(e, t) {
|
|
3511
3511
|
let n = e.tinted.get(t);
|
|
3512
3512
|
if (n) return n;
|
|
3513
|
-
let r =
|
|
3513
|
+
let r = ae(e.raster, t);
|
|
3514
3514
|
return e.tinted.set(t, r), r;
|
|
3515
3515
|
}
|
|
3516
3516
|
function In(e) {
|
|
@@ -3529,7 +3529,7 @@ async function Ln(e, t) {
|
|
|
3529
3529
|
if (n.length !== 0) {
|
|
3530
3530
|
await t.loadMathJax();
|
|
3531
3531
|
for (let e of n) if (!Pn.has(e.nodes)) try {
|
|
3532
|
-
let n = await t.mathMLToSvg(
|
|
3532
|
+
let n = await t.mathMLToSvg(te(e.nodes, e.display)), r = await M(n, "#000000");
|
|
3533
3533
|
Pn.set(e.nodes, {
|
|
3534
3534
|
raster: r,
|
|
3535
3535
|
widthEm: n.widthEm,
|
|
@@ -3556,7 +3556,7 @@ var zn = new Set([
|
|
|
3556
3556
|
"system-ui"
|
|
3557
3557
|
]);
|
|
3558
3558
|
function Bn(e) {
|
|
3559
|
-
let t =
|
|
3559
|
+
let t = r(e);
|
|
3560
3560
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3561
3561
|
}
|
|
3562
3562
|
var Vn = {
|
|
@@ -3581,10 +3581,10 @@ function Wn(e) {
|
|
|
3581
3581
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3582
3582
|
}
|
|
3583
3583
|
function Gn(e, t = e) {
|
|
3584
|
-
let n = Bn(t),
|
|
3585
|
-
if (Un(t)) return `"${e}", ${
|
|
3586
|
-
let
|
|
3587
|
-
return `"${e}", ${
|
|
3584
|
+
let n = Bn(t), r = Vn[t.toLowerCase()], i = r ? `"${r}", ` : "", a = C(t), o = a ? `"${a}", ` : "";
|
|
3585
|
+
if (Un(t)) return `"${e}", ${i}${Hn}, ${n}`;
|
|
3586
|
+
let c = n === "serif" ? "serif" : "sans", l = fe(t), u = l ? v(l, c).filter((e) => e !== a) : [];
|
|
3587
|
+
return `"${e}", ${i}${o}${u.length > 0 ? `${Wn(u)}, ` : ""}${`${Wn(c === "serif" ? s : g)}, `}${n}`;
|
|
3588
3588
|
}
|
|
3589
3589
|
function Kn(e) {
|
|
3590
3590
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
@@ -3666,7 +3666,7 @@ function er(e, t, n, r, i, a, o) {
|
|
|
3666
3666
|
return !1;
|
|
3667
3667
|
}
|
|
3668
3668
|
function tr(e) {
|
|
3669
|
-
for (let t of e) if (
|
|
3669
|
+
for (let t of e) if (y(t.codePointAt(0) ?? 0)) return !0;
|
|
3670
3670
|
return !1;
|
|
3671
3671
|
}
|
|
3672
3672
|
function nr(e) {
|
|
@@ -3710,7 +3710,7 @@ function $(e, t, n) {
|
|
|
3710
3710
|
let a = Math.max(0, nr(t) - 1);
|
|
3711
3711
|
return e.measureText(t).width + n * a;
|
|
3712
3712
|
}
|
|
3713
|
-
function ar(e, t, n, r,
|
|
3713
|
+
function ar(e, t, n, r, i, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3714
3714
|
themeMajorFont: null,
|
|
3715
3715
|
themeMinorFont: null,
|
|
3716
3716
|
dpr: 1
|
|
@@ -3723,21 +3723,21 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3723
3723
|
let r = n.text.replace(/ +$/u, "");
|
|
3724
3724
|
r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (g = !1);
|
|
3725
3725
|
}
|
|
3726
|
-
let
|
|
3726
|
+
let _ = () => n - (m.length === 0 ? p : 0), v = { segments: [] }, b = 0, x = !1, S = t.rtl === !0, C = X(t.marR, o), w = (t.tabStops ?? []).map((e) => ({
|
|
3727
3727
|
pos: X(e.pos, o),
|
|
3728
3728
|
algn: e.algn
|
|
3729
|
-
})),
|
|
3729
|
+
})), T = X(t.defTabSz ?? 914400, o), D = !1, k = [], A = 0, j = () => S ? C : s + (m.length === 0 ? p : 0), M = (e = 0) => {
|
|
3730
3730
|
let t = bn(e > 0 ? [...k, {
|
|
3731
3731
|
isTab: !1,
|
|
3732
3732
|
width: e
|
|
3733
|
-
}] : k,
|
|
3733
|
+
}] : k, w, j(), Infinity, A, T), n = 0;
|
|
3734
3734
|
for (let e of t) n += e;
|
|
3735
3735
|
return n;
|
|
3736
3736
|
}, N = (e) => {
|
|
3737
|
-
let t =
|
|
3737
|
+
let t = _();
|
|
3738
3738
|
return Number.isFinite(t) ? D ? M(e) <= t : b + e <= t : !0;
|
|
3739
3739
|
}, P = () => {
|
|
3740
|
-
let e =
|
|
3740
|
+
let e = _();
|
|
3741
3741
|
if (!D) return e - b;
|
|
3742
3742
|
if (!Number.isFinite(e)) return Infinity;
|
|
3743
3743
|
if (M(0) >= e) return 0;
|
|
@@ -3747,28 +3747,27 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3747
3747
|
M(r) <= e ? t = r : n = r;
|
|
3748
3748
|
}
|
|
3749
3749
|
return t;
|
|
3750
|
-
},
|
|
3751
|
-
e && (
|
|
3752
|
-
},
|
|
3750
|
+
}, I = (e = !1) => {
|
|
3751
|
+
e && (v.endsWithBreak = !0), m.push(v), v = { segments: [] }, b = 0, D = !1, k = [], x = !1;
|
|
3752
|
+
}, L = (t, n, r, i) => {
|
|
3753
3753
|
e.font = n;
|
|
3754
|
-
let a = $(e, t, r), o =
|
|
3754
|
+
let a = $(e, t, r), o = v.segments.at(-1);
|
|
3755
3755
|
return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? $(e, o.text + t, r) - $(e, o.text, r) : a + r;
|
|
3756
|
-
},
|
|
3756
|
+
}, R = (t, n, r, i, a, o, s, c) => {
|
|
3757
3757
|
if (!t) return;
|
|
3758
3758
|
e.font = n;
|
|
3759
|
-
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight,
|
|
3760
|
-
if (
|
|
3759
|
+
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, y = c?.hyperlink, x = c?.drawSizePx ?? r, S = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.drawSizePx ?? e.sizePx) === x && Kn(e.hyperlink) === Kn(y) && (l === 0 || e.sourceRunId === u), C = v.segments.at(-1), w = $(e, t, l);
|
|
3760
|
+
if (C && S(C) ? w = $(e, C.text + t, l) - $(e, C.text, l) : C && !C.isTab && !C.math && u != null && C.sourceRunId === u && (w += l), b += w, k.push({
|
|
3761
3761
|
isTab: !1,
|
|
3762
|
-
width:
|
|
3763
|
-
}),
|
|
3762
|
+
width: w
|
|
3763
|
+
}), C && S(C)) C.text += t;
|
|
3764
3764
|
else {
|
|
3765
|
-
let e =
|
|
3766
|
-
|
|
3765
|
+
let e = C && !C.isTab && !C.math && u != null && C.sourceRunId === u ? l : 0;
|
|
3766
|
+
v.segments.push({
|
|
3767
3767
|
text: t,
|
|
3768
3768
|
font: n,
|
|
3769
|
-
fontFamily: v,
|
|
3770
3769
|
sizePx: r,
|
|
3771
|
-
drawSizePx:
|
|
3770
|
+
drawSizePx: x,
|
|
3772
3771
|
color: i,
|
|
3773
3772
|
underline: a,
|
|
3774
3773
|
underlineStyle: f,
|
|
@@ -3783,17 +3782,17 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3783
3782
|
reflection: h,
|
|
3784
3783
|
outline: g,
|
|
3785
3784
|
highlight: _,
|
|
3786
|
-
hyperlink:
|
|
3785
|
+
hyperlink: y
|
|
3787
3786
|
});
|
|
3788
3787
|
}
|
|
3789
|
-
},
|
|
3790
|
-
let e =
|
|
3788
|
+
}, z = () => {
|
|
3789
|
+
let e = v.segments.at(-1);
|
|
3791
3790
|
if (!e || e.math) return !1;
|
|
3792
3791
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
3793
3792
|
if (t) e.text = t[1], n = t[2];
|
|
3794
|
-
else if (
|
|
3793
|
+
else if (v.segments.length > 1) v.segments.pop(), n = e.text;
|
|
3795
3794
|
else return !1;
|
|
3796
|
-
return
|
|
3795
|
+
return I(), R(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
3797
3796
|
strikeDouble: e.strikeDouble,
|
|
3798
3797
|
letterSpacingPx: e.letterSpacingPx,
|
|
3799
3798
|
underlineStyle: e.underlineStyle,
|
|
@@ -3802,69 +3801,66 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3802
3801
|
reflection: e.reflection,
|
|
3803
3802
|
outline: e.outline,
|
|
3804
3803
|
highlight: e.highlight,
|
|
3805
|
-
fontFamily: e.fontFamily,
|
|
3806
3804
|
sourceRunId: e.sourceRunId,
|
|
3807
3805
|
drawSizePx: e.drawSizePx
|
|
3808
3806
|
}), !0;
|
|
3809
3807
|
};
|
|
3810
3808
|
for (let [n, s] of t.runs.entries()) {
|
|
3811
3809
|
if (s.type === "break") {
|
|
3812
|
-
|
|
3810
|
+
I(!0);
|
|
3813
3811
|
continue;
|
|
3814
3812
|
}
|
|
3815
3813
|
if (s.type === "math") {
|
|
3816
|
-
let e = Pn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * Y * o * u, n = e ? e.widthEm * t : 0,
|
|
3817
|
-
(s.display && b > 0 || !N(n) && b > 0) &&
|
|
3814
|
+
let e = Pn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * Y * o * u, n = e ? e.widthEm * t : 0, a = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
3815
|
+
(s.display && b > 0 || !N(n) && b > 0) && I(), k.push({
|
|
3818
3816
|
isTab: !1,
|
|
3819
3817
|
width: n
|
|
3820
|
-
}),
|
|
3818
|
+
}), v.segments.push({
|
|
3821
3819
|
text: "",
|
|
3822
3820
|
font: `${t}px sans-serif`,
|
|
3823
3821
|
sizePx: t,
|
|
3824
|
-
color: s.color ? Q(s.color) :
|
|
3822
|
+
color: s.color ? Q(s.color) : i,
|
|
3825
3823
|
underline: !1,
|
|
3826
3824
|
strikethrough: !1,
|
|
3827
3825
|
math: {
|
|
3828
3826
|
nodes: s.nodes,
|
|
3829
3827
|
display: s.display,
|
|
3830
3828
|
width: n,
|
|
3831
|
-
ascent:
|
|
3829
|
+
ascent: a,
|
|
3832
3830
|
descent: c
|
|
3833
3831
|
}
|
|
3834
|
-
}), b += n, s.display &&
|
|
3832
|
+
}), b += n, s.display && I();
|
|
3835
3833
|
continue;
|
|
3836
3834
|
}
|
|
3837
|
-
let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m = $n(p, s.baseline ?? void 0), g = Rn(s.fontFamily ?? t.defFontFamily ?? null, f),
|
|
3838
|
-
|
|
3839
|
-
let
|
|
3835
|
+
let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m = $n(p, s.baseline ?? void 0), g = Rn(s.fontFamily ?? t.defFontFamily ?? null, f), S = s.fontFamilyEa ? Rn(s.fontFamilyEa, f) : null, C = s.fontFamilySym ? Rn(s.fontFamilySym, f) : null, w;
|
|
3836
|
+
w = s.color ? Q(s.color) : s.hyperlink && f.themeHlinkColor ? Q(f.themeHlinkColor) : i;
|
|
3837
|
+
let T = s.bold ?? t.defBold ?? c, j = s.italic ?? t.defItalic ?? l, M = Yn(T, j, m, g, f), B = S ? Yn(T, j, m, S, f) : M;
|
|
3840
3838
|
e.font = M;
|
|
3841
|
-
let
|
|
3842
|
-
(
|
|
3843
|
-
let
|
|
3844
|
-
strikeDouble:
|
|
3845
|
-
letterSpacingPx:
|
|
3839
|
+
let V = s.caps, H = h.get(s) ?? s.text;
|
|
3840
|
+
(V === "all" || V === "small") && (H = H.toUpperCase());
|
|
3841
|
+
let U = s.fieldType === "slidenum" && d !== void 0 ? String(d) : H, W = s.underline || s.hyperlink !== void 0, te = s.strikeDouble === !0, G = s.letterSpacing == null ? 0 : s.letterSpacing * Y * o, K = {
|
|
3842
|
+
strikeDouble: te,
|
|
3843
|
+
letterSpacingPx: G,
|
|
3846
3844
|
underlineStyle: s.underlineStyle,
|
|
3847
3845
|
underlineColor: s.underlineColor ? Q(s.underlineColor) : void 0,
|
|
3848
3846
|
shadow: s.shadow,
|
|
3849
3847
|
reflection: s.reflection,
|
|
3850
3848
|
outline: s.outline,
|
|
3851
|
-
fontFamily: g,
|
|
3852
3849
|
highlight: s.highlight ? Q(s.highlight) : void 0,
|
|
3853
3850
|
hyperlink: rn(s.hyperlink),
|
|
3854
3851
|
sourceRunId: n,
|
|
3855
3852
|
drawSizePx: m
|
|
3856
|
-
}, J =
|
|
3853
|
+
}, J = U.split(/(\s+)/);
|
|
3857
3854
|
for (let r of J) {
|
|
3858
3855
|
if (!r) continue;
|
|
3859
3856
|
if (/^\t+$/.test(r)) {
|
|
3860
3857
|
D || (e.font = M, A = e.measureText(" ").width);
|
|
3861
|
-
for (let e of r)
|
|
3858
|
+
for (let e of r) v.segments.push({
|
|
3862
3859
|
text: "",
|
|
3863
3860
|
isTab: !0,
|
|
3864
3861
|
font: M,
|
|
3865
|
-
fontFamily: g,
|
|
3866
3862
|
sizePx: p,
|
|
3867
|
-
color:
|
|
3863
|
+
color: w,
|
|
3868
3864
|
underline: !1,
|
|
3869
3865
|
strikethrough: !1
|
|
3870
3866
|
}), k.push({
|
|
@@ -3875,132 +3871,133 @@ function ar(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3875
3871
|
continue;
|
|
3876
3872
|
}
|
|
3877
3873
|
e.font = M;
|
|
3878
|
-
let
|
|
3879
|
-
if (c.test(r) && (
|
|
3880
|
-
let t =
|
|
3874
|
+
let i = L(r, M, G, n), o = /^\s+$/.test(r), c = /[-]/;
|
|
3875
|
+
if (c.test(r) && (C != null || ge(g))) {
|
|
3876
|
+
let t = C ?? g;
|
|
3881
3877
|
for (let i of r) {
|
|
3882
3878
|
let r = i, a = M;
|
|
3883
3879
|
if (c.test(i)) {
|
|
3884
3880
|
let e = be(i, t);
|
|
3885
|
-
e === i ? a = Yn(
|
|
3881
|
+
e === i ? a = Yn(T, j, m, t, f) : (r = e, a = Yn(T, j, m, "sans-serif", f));
|
|
3886
3882
|
}
|
|
3887
|
-
e.font = a, !N(
|
|
3883
|
+
e.font = a, !N(L(r, a, G, n)) && b > 0 && I(), R(r, a, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3888
3884
|
}
|
|
3889
3885
|
continue;
|
|
3890
3886
|
}
|
|
3891
|
-
if (tr(r) && (!
|
|
3892
|
-
let i = []
|
|
3887
|
+
if (tr(r) && (!q(r) || t.eaLnBrk === !1)) {
|
|
3888
|
+
let i = [], o = "", c = () => {
|
|
3889
|
+
o !== "" && (e.font = M, i.push({
|
|
3890
|
+
ch: o,
|
|
3891
|
+
w: $(e, o, G),
|
|
3892
|
+
font: M
|
|
3893
|
+
}), o = "");
|
|
3894
|
+
};
|
|
3893
3895
|
for (let t of r) {
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
+
if (!y(t.codePointAt(0) ?? 0)) {
|
|
3897
|
+
o += t;
|
|
3898
|
+
continue;
|
|
3899
|
+
}
|
|
3900
|
+
c();
|
|
3901
|
+
let n = S == null ? M : B;
|
|
3902
|
+
e.font = n, i.push({
|
|
3896
3903
|
ch: t,
|
|
3897
3904
|
w: $(e, t, 0),
|
|
3898
|
-
font:
|
|
3899
|
-
family: a
|
|
3905
|
+
font: n
|
|
3900
3906
|
});
|
|
3901
3907
|
}
|
|
3902
|
-
if (t.eaLnBrk === !1) {
|
|
3903
|
-
let e =
|
|
3904
|
-
b > 0 && !N(r) &&
|
|
3905
|
-
for (let e of i)
|
|
3906
|
-
...q,
|
|
3907
|
-
fontFamily: e.family
|
|
3908
|
-
});
|
|
3908
|
+
if (c(), t.eaLnBrk === !1) {
|
|
3909
|
+
let e = v.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * G + (t && i.length > 0 ? G : 0);
|
|
3910
|
+
b > 0 && !N(r) && I();
|
|
3911
|
+
for (let e of i) R(e.ch, e.font, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3909
3912
|
continue;
|
|
3910
3913
|
}
|
|
3911
|
-
let
|
|
3912
|
-
for (;
|
|
3913
|
-
let e = Number.isFinite(
|
|
3914
|
+
let l = i;
|
|
3915
|
+
for (; l.length > 0;) {
|
|
3916
|
+
let e = Number.isFinite(_()) ? _() - P() : b, t = v.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = un(l, e, _(), a, G, r);
|
|
3914
3917
|
if (i === 0) {
|
|
3915
3918
|
if (b > 0) {
|
|
3916
|
-
|
|
3919
|
+
I();
|
|
3917
3920
|
continue;
|
|
3918
3921
|
}
|
|
3919
3922
|
i = 1;
|
|
3920
3923
|
}
|
|
3921
3924
|
for (let e = 0; e < i; e++) {
|
|
3922
|
-
let t =
|
|
3923
|
-
|
|
3924
|
-
...q,
|
|
3925
|
-
fontFamily: t.family
|
|
3926
|
-
});
|
|
3925
|
+
let t = l[e];
|
|
3926
|
+
R(t.ch, t.font, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3927
3927
|
}
|
|
3928
|
-
|
|
3928
|
+
l = l.slice(i), l.length > 0 && I();
|
|
3929
3929
|
}
|
|
3930
3930
|
continue;
|
|
3931
3931
|
}
|
|
3932
|
-
if (
|
|
3933
|
-
let t =
|
|
3932
|
+
if (q(r)) {
|
|
3933
|
+
let t = O(r, {
|
|
3934
3934
|
cjk: !0,
|
|
3935
|
-
kinsoku:
|
|
3936
|
-
}), i =
|
|
3937
|
-
let r = 0, i =
|
|
3938
|
-
s !== "" && (e.font = c ? B : M, r += $(e, s,
|
|
3935
|
+
kinsoku: a
|
|
3936
|
+
}), i = S != null && B !== M, o = (e) => i && y(e.codePointAt(0) ?? 0), c = (t) => {
|
|
3937
|
+
let r = 0, i = v.segments.at(-1), a = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
|
|
3938
|
+
s !== "" && (e.font = c ? B : M, r += $(e, s, G), a && (r += G), a = !0, s = "");
|
|
3939
3939
|
};
|
|
3940
3940
|
for (let e of t) {
|
|
3941
|
-
let t =
|
|
3941
|
+
let t = o(e);
|
|
3942
3942
|
c === null || t === c ? (s += e, c = t) : (l(), s = e, c = t);
|
|
3943
3943
|
}
|
|
3944
3944
|
return l(), r;
|
|
3945
|
-
},
|
|
3945
|
+
}, l = (e) => {
|
|
3946
3946
|
let t = "", n = null, r = () => {
|
|
3947
|
-
|
|
3948
|
-
let e = n ? B : M, r = n ? C : g;
|
|
3949
|
-
L(t, e, p, T, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3950
|
-
...q,
|
|
3951
|
-
fontFamily: r
|
|
3952
|
-
}), t = "";
|
|
3947
|
+
t !== "" && (R(t, n ? B : M, p, w, W, s.strikethrough, s.baseline ?? void 0, K), t = "");
|
|
3953
3948
|
};
|
|
3954
3949
|
for (let i of e) {
|
|
3955
|
-
let e =
|
|
3950
|
+
let e = o(i);
|
|
3956
3951
|
n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
|
|
3957
3952
|
}
|
|
3958
3953
|
r();
|
|
3959
|
-
},
|
|
3960
|
-
for (;
|
|
3961
|
-
let e = P(), n =
|
|
3962
|
-
if (n <=
|
|
3954
|
+
}, u = E(r), d = r.length, f = 0;
|
|
3955
|
+
for (; f < d;) {
|
|
3956
|
+
let e = P(), n = ee(r, t, f, e, c, u);
|
|
3957
|
+
if (n <= f) {
|
|
3963
3958
|
if (b > 0) {
|
|
3964
|
-
|
|
3959
|
+
I();
|
|
3965
3960
|
continue;
|
|
3966
3961
|
}
|
|
3967
|
-
let i = t.find((e) => e >
|
|
3968
|
-
|
|
3962
|
+
let i = t.find((e) => e > f) ?? d, a = r.slice(f, i), o = F(a), s = ee(a, o, 0, e, c, u);
|
|
3963
|
+
s <= 0 && (s = o.length > 0 ? o[0] : a.length), n = f + s;
|
|
3969
3964
|
}
|
|
3970
|
-
|
|
3965
|
+
l(r.slice(f, n)), f = n, f < d && I();
|
|
3971
3966
|
}
|
|
3972
3967
|
continue;
|
|
3973
3968
|
}
|
|
3974
|
-
if (N(
|
|
3975
|
-
else if (o) b > 0 &&
|
|
3976
|
-
else if (
|
|
3977
|
-
b > 0 &&
|
|
3978
|
-
for (let t of r) e.font = M, !N(
|
|
3979
|
-
} else if (
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3969
|
+
if (N(i)) R(r, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K), o && (x = !0);
|
|
3970
|
+
else if (o) b > 0 && I();
|
|
3971
|
+
else if (i > _()) {
|
|
3972
|
+
b > 0 && I();
|
|
3973
|
+
for (let t of r) e.font = M, !N(L(t, M, G, n)) && b > 0 && I(), R(t, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3974
|
+
} else if (x) {
|
|
3975
|
+
let e = v.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), i = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && a.lineStartForbidden.has(t) && i, c = n !== void 0 && t !== void 0 && i && !q(e) && !q(r) && le(n, t);
|
|
3976
|
+
(o || c) && z() || I(), R(r, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3977
|
+
} else {
|
|
3978
|
+
let e = [...v.segments.at(-1)?.text ?? ""].at(-1)?.codePointAt(0), t = r.codePointAt(0);
|
|
3979
|
+
e !== void 0 && t !== void 0 && y(e) !== y(t) && !le(e, t) && b > 0 && I(), R(r, M, p, w, W, s.strikethrough, s.baseline ?? void 0, K);
|
|
3983
3980
|
}
|
|
3984
3981
|
}
|
|
3985
3982
|
}
|
|
3986
|
-
return m.push(
|
|
3983
|
+
return m.push(v), m;
|
|
3987
3984
|
}
|
|
3988
|
-
async function or(e, t, n, r, i, o, s, c, l
|
|
3985
|
+
async function or(e, t, n, r, i, a, o, s, c, l) {
|
|
3989
3986
|
if (t && t.fillType === "image") {
|
|
3990
|
-
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !
|
|
3987
|
+
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
|
|
3991
3988
|
try {
|
|
3992
|
-
let
|
|
3989
|
+
let u = t.fillRect ?? {}, d = u.l ?? 0, f = u.t ?? 0, p = u.r ?? 0, m = u.b ?? 0, h = d * n, g = f * r, _ = n * (1 - d - p), v = r * (1 - f - m), y = l && !t.duotone ? Dn(l, Z(t.imagePath, t.duotone)) : void 0, b = t.tile ? await U(t.imagePath, t.mimeType, o) : void 0, x = await Je(t.imagePath, t.mimeType, t.duotone, o, {
|
|
3993
3990
|
widthPt: n / i / Y,
|
|
3994
3991
|
heightPt: r / i / Y,
|
|
3995
3992
|
...y ?? {},
|
|
3996
|
-
tiff:
|
|
3997
|
-
svgDecoder:
|
|
3993
|
+
tiff: s,
|
|
3994
|
+
svgDecoder: c
|
|
3998
3995
|
});
|
|
3999
|
-
if (
|
|
3996
|
+
if (a() || !x) return;
|
|
4000
3997
|
e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile ? ur(e, x, t.tile, n, r, i, t.srcRect, b?.dimensions ?? void 0) : je(e, x, t.srcRect, h, g, _, v), e.restore();
|
|
4001
3998
|
} catch (t) {
|
|
4002
|
-
if (
|
|
4003
|
-
|
|
3999
|
+
if (ue(t, "tiff")) {
|
|
4000
|
+
b(e, "tiff", {
|
|
4004
4001
|
x: 0,
|
|
4005
4002
|
y: 0,
|
|
4006
4003
|
width: n,
|
|
@@ -4361,9 +4358,9 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4361
4358
|
}
|
|
4362
4359
|
return;
|
|
4363
4360
|
}
|
|
4364
|
-
let
|
|
4365
|
-
if (
|
|
4366
|
-
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c),
|
|
4361
|
+
let m = t.scene3d && Ct(t.scene3d.camera) ? t.scene3d : null;
|
|
4362
|
+
if (m && d > 0 && f > 0) {
|
|
4363
|
+
let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, p = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), h = Ur(t.sp3d, m.camera, d, f, r, c), g = Dr(t.rotation, t.flipH, t.flipV);
|
|
4367
4364
|
e.save(), g.outerRotation !== 0 && (e.translate(l + d / 2, u + f / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(l + d / 2), -(u + f / 2)));
|
|
4368
4365
|
let _ = {
|
|
4369
4366
|
...t,
|
|
@@ -4386,15 +4383,15 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4386
4383
|
..._,
|
|
4387
4384
|
fill: null,
|
|
4388
4385
|
stroke: null
|
|
4389
|
-
}, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (
|
|
4386
|
+
}, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (h ? Math.hypot(h.offsetX, h.offsetY) / c : 0) + 2, x = (e, t, n) => Wr(e, m.camera, l, u, d, f, (e) => {
|
|
4390
4387
|
Fr(e, t, r, i, a, o, void 0);
|
|
4391
4388
|
}, n ? {
|
|
4392
4389
|
bevels: p,
|
|
4393
|
-
extrusion:
|
|
4390
|
+
extrusion: h ?? void 0,
|
|
4394
4391
|
edgePadCss: b
|
|
4395
4392
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4396
4393
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4397
|
-
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Mr(
|
|
4394
|
+
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = Mr(m.camera, n, l, u, d, f, b, t.shadow?.algn), s = !1, c = Nr((e) => {
|
|
4398
4395
|
s = S(e) || s;
|
|
4399
4396
|
}, n, o.bbox, {
|
|
4400
4397
|
w: e.canvas.width || 0,
|
|
@@ -4411,9 +4408,9 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4411
4408
|
e.restore();
|
|
4412
4409
|
}
|
|
4413
4410
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(l + d / 2, u + f / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(l + d / 2), -(u + f / 2)));
|
|
4414
|
-
let
|
|
4411
|
+
let g = t.geometry.toLowerCase(), _ = Nn(t.fill, e, l, u, d, f, t.rotation);
|
|
4415
4412
|
t.shadow || fr(e, t.glow ?? null, r);
|
|
4416
|
-
let
|
|
4413
|
+
let v = new Set([
|
|
4417
4414
|
"line",
|
|
4418
4415
|
"straightconnector1",
|
|
4419
4416
|
"bentconnector2",
|
|
@@ -4424,7 +4421,7 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4424
4421
|
"curvedconnector3",
|
|
4425
4422
|
"curvedconnector4",
|
|
4426
4423
|
"curvedconnector5"
|
|
4427
|
-
]),
|
|
4424
|
+
]), y = new Set([
|
|
4428
4425
|
"callout1",
|
|
4429
4426
|
"callout2",
|
|
4430
4427
|
"callout3",
|
|
@@ -4437,22 +4434,22 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4437
4434
|
"accentbordercallout1",
|
|
4438
4435
|
"accentbordercallout2",
|
|
4439
4436
|
"accentbordercallout3"
|
|
4440
|
-
]),
|
|
4437
|
+
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && n(g), S = (n, i, a = {
|
|
4441
4438
|
x: l,
|
|
4442
4439
|
y: u,
|
|
4443
4440
|
w: d,
|
|
4444
4441
|
h: f
|
|
4445
4442
|
}) => {
|
|
4446
|
-
let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ?
|
|
4443
|
+
let { x: o, y: s, w: c, h: p } = a, m = i ?? (n === e && o === l && s === u && c === d && p === f ? _ : Nn(t.fill, n, o, s, c, p, t.rotation)), h = i ? null : t.stroke ? () => {
|
|
4447
4444
|
$r(n, t.stroke, r, {
|
|
4448
4445
|
x: o,
|
|
4449
4446
|
y: s,
|
|
4450
4447
|
w: c,
|
|
4451
4448
|
h: p
|
|
4452
4449
|
}, t.rotation), n.stroke();
|
|
4453
|
-
} : null,
|
|
4454
|
-
if (
|
|
4455
|
-
|
|
4450
|
+
} : null, v = () => pr(n);
|
|
4451
|
+
if (x && !i) {
|
|
4452
|
+
R(n, g, o, s, c, p, [
|
|
4456
4453
|
t.adj,
|
|
4457
4454
|
t.adj2,
|
|
4458
4455
|
t.adj3,
|
|
@@ -4461,11 +4458,11 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4461
4458
|
t.adj6,
|
|
4462
4459
|
t.adj7,
|
|
4463
4460
|
t.adj8
|
|
4464
|
-
], m, h,
|
|
4461
|
+
], m, h, v, b(g) ? { skipTrailingStroke: !0 } : void 0);
|
|
4465
4462
|
return;
|
|
4466
4463
|
}
|
|
4467
|
-
n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Ir(n, t.custGeom, o, s, c, p) : me(n,
|
|
4468
|
-
},
|
|
4464
|
+
n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Ir(n, t.custGeom, o, s, c, p) : me(n, g, o, s, c, p, t.adj, t.adj2, t.adj3, t.adj4), m && g !== "arc" && (n.fillStyle = m, g === "donut" || g === "smileyface" || g === "frame" ? n.fill("evenodd") : n.fill(), i || v()), h && h();
|
|
4465
|
+
}, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? B(g, l, u, d, f, [
|
|
4469
4466
|
t.adj,
|
|
4470
4467
|
t.adj2,
|
|
4471
4468
|
t.adj3,
|
|
@@ -4479,15 +4476,15 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4479
4476
|
y: u,
|
|
4480
4477
|
w: d,
|
|
4481
4478
|
h: f
|
|
4482
|
-
},
|
|
4483
|
-
x:
|
|
4484
|
-
y:
|
|
4485
|
-
w:
|
|
4486
|
-
h:
|
|
4487
|
-
} :
|
|
4488
|
-
let
|
|
4489
|
-
if (t.stroke && (
|
|
4490
|
-
let
|
|
4479
|
+
}, D = t.stroke ? t.stroke.width * r / 2 : 0, O = t.stroke ? Math.max(t.stroke.headEnd ? pe(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? pe(t.stroke.tailEnd, t.stroke, r) : 0) : 0, k = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, A = Math.max(D, O, k), j = A > 0 ? {
|
|
4480
|
+
x: E.x - A,
|
|
4481
|
+
y: E.y - A,
|
|
4482
|
+
w: E.w + A * 2,
|
|
4483
|
+
h: E.h + A * 2
|
|
4484
|
+
} : E, M = Or(C, j.x, j.y, j.w, j.h), N = r * T, P = m ? [] : Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, T), F = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, I = (e) => {
|
|
4485
|
+
let n = t.stroke?.fill ? Nn(t.stroke.fill, e, l, u, d, f, t.rotation) ?? void 0 : void 0;
|
|
4486
|
+
if (t.stroke && (v.has(g) || y.has(g))) {
|
|
4487
|
+
let i = h(g, l, u, d, f, [
|
|
4491
4488
|
t.adj,
|
|
4492
4489
|
t.adj2,
|
|
4493
4490
|
t.adj3,
|
|
@@ -4497,10 +4494,10 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4497
4494
|
t.adj7,
|
|
4498
4495
|
t.adj8
|
|
4499
4496
|
]);
|
|
4500
|
-
if (!
|
|
4501
|
-
let
|
|
4502
|
-
if (
|
|
4503
|
-
let n =
|
|
4497
|
+
if (!i) return;
|
|
4498
|
+
let a = t.stroke.cmpd, o = g === "line" || g === "straightconnector1";
|
|
4499
|
+
if (b(g) && i.vertices.length >= 2 && !(a && o)) {
|
|
4500
|
+
let n = i.vertices.map((e) => ({
|
|
4504
4501
|
x: e.x,
|
|
4505
4502
|
y: e.y
|
|
4506
4503
|
}));
|
|
@@ -4521,40 +4518,40 @@ function Fr(e, t, r, i = "#000000", a, o = {
|
|
|
4521
4518
|
for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
|
|
4522
4519
|
e.stroke();
|
|
4523
4520
|
}
|
|
4524
|
-
|
|
4521
|
+
a && o && Qr(e, i.start, i.end, t.stroke, a, r, t.rotation), t.stroke.tailEnd && _e(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, r, n), t.stroke.headEnd && _e(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, r, n);
|
|
4525
4522
|
return;
|
|
4526
4523
|
}
|
|
4527
4524
|
if (!t.stroke || !t.custGeom || t.custGeom.length === 0 || (!t.stroke.headEnd || t.stroke.headEnd.type === "none") && (!t.stroke.tailEnd || t.stroke.tailEnd.type === "none")) return;
|
|
4528
|
-
let { start:
|
|
4529
|
-
|
|
4530
|
-
},
|
|
4531
|
-
if (
|
|
4525
|
+
let { start: i, end: a } = ve(t.custGeom);
|
|
4526
|
+
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && _e(e, l + i.x * d, u + i.y * f, Math.atan2(i.dy * f, i.dx * d), t.stroke.headEnd, t.stroke, r, n), a && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && _e(e, l + a.x * d, u + a.y * f, Math.atan2(a.dy * f, a.dx * d), t.stroke.tailEnd, t.stroke, r, n);
|
|
4527
|
+
}, L = (e) => {
|
|
4528
|
+
if (P.length > 0 && Gr(e, l, u, d, f, P, (e, t, n, r, i) => S(e, void 0, {
|
|
4532
4529
|
x: t,
|
|
4533
4530
|
y: n,
|
|
4534
4531
|
w: r,
|
|
4535
4532
|
h: i
|
|
4536
|
-
}), void 0,
|
|
4537
|
-
|
|
4533
|
+
}), void 0, F)) {
|
|
4534
|
+
I(e), pr(e);
|
|
4538
4535
|
return;
|
|
4539
4536
|
}
|
|
4540
|
-
|
|
4537
|
+
S(e), I(e);
|
|
4541
4538
|
};
|
|
4542
|
-
if (Pr(e, t,
|
|
4539
|
+
if (Pr(e, t, L, L, M, jr(C, l, u, d, f, t.shadow?.algn), r, N, C, !!_, (e) => S(e, "#000")), t.textBody) {
|
|
4543
4540
|
let n = Er(t, o);
|
|
4544
4541
|
if (e.save(), t.flipH || t.flipV) {
|
|
4545
4542
|
let n = l + d / 2, r = u + f / 2;
|
|
4546
4543
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4547
4544
|
}
|
|
4548
|
-
let s = l, m = u, h = d,
|
|
4549
|
-
if (t.textRect) s = X(t.textRect.x, r), m = X(t.textRect.y, r), h = X(t.textRect.width, r),
|
|
4550
|
-
else if (
|
|
4545
|
+
let s = l, m = u, h = d, _ = f;
|
|
4546
|
+
if (t.textRect) s = X(t.textRect.x, r), m = X(t.textRect.y, r), h = X(t.textRect.width, r), _ = X(t.textRect.height, r);
|
|
4547
|
+
else if (g === "ellipse") {
|
|
4551
4548
|
let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
|
|
4552
|
-
s = l + e, m = u + t, h = d / Math.SQRT2,
|
|
4549
|
+
s = l + e, m = u + t, h = d / Math.SQRT2, _ = f / Math.SQRT2;
|
|
4553
4550
|
} else {
|
|
4554
|
-
let e = Tr(
|
|
4555
|
-
e && (s = e.tx, m = e.ty, h = e.tw,
|
|
4551
|
+
let e = Tr(g, l, u, d, f, t.adj, t.adj2);
|
|
4552
|
+
e && (s = e.tx, m = e.ty, h = e.tw, _ = e.th);
|
|
4556
4553
|
}
|
|
4557
|
-
Vr(e, t.textBody, s, m, h,
|
|
4554
|
+
Vr(e, t.textBody, s, m, h, _, r, n, t.rotation, !1, !1, i, a, o, p, !1, c), e.restore();
|
|
4558
4555
|
}
|
|
4559
4556
|
e.restore();
|
|
4560
4557
|
}
|
|
@@ -4634,231 +4631,234 @@ function Br(e, t) {
|
|
|
4634
4631
|
}
|
|
4635
4632
|
return t.clear(), "";
|
|
4636
4633
|
}
|
|
4637
|
-
function Vr(t, n, r, i, a, o, s
|
|
4634
|
+
function Vr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
|
|
4638
4635
|
themeMajorFont: null,
|
|
4639
4636
|
themeMinorFont: null,
|
|
4640
4637
|
dpr: 1
|
|
4641
|
-
},
|
|
4642
|
-
let
|
|
4643
|
-
if (
|
|
4644
|
-
let
|
|
4638
|
+
}, m, h = !1, g, _ = !1, v = h) {
|
|
4639
|
+
let y = t.vert === "vert" || t.vert === "eaVert", b = t.vert === "vert270";
|
|
4640
|
+
if (y || b) {
|
|
4641
|
+
let l = n + i / 2, u = r + a / 2, _ = y ? 90 : -90, v = m ? (e) => m({
|
|
4645
4642
|
...e,
|
|
4646
|
-
inShapeX: e.inShapeX -
|
|
4647
|
-
inShapeY: e.inShapeY -
|
|
4648
|
-
shapeX:
|
|
4649
|
-
shapeY:
|
|
4650
|
-
shapeW:
|
|
4651
|
-
shapeH:
|
|
4652
|
-
rotation:
|
|
4653
|
-
textBodyRotation:
|
|
4643
|
+
inShapeX: e.inShapeX - a / 2 + i / 2,
|
|
4644
|
+
inShapeY: e.inShapeY - i / 2 + a / 2,
|
|
4645
|
+
shapeX: n,
|
|
4646
|
+
shapeY: r,
|
|
4647
|
+
shapeW: i,
|
|
4648
|
+
shapeH: a,
|
|
4649
|
+
rotation: c,
|
|
4650
|
+
textBodyRotation: _
|
|
4654
4651
|
}) : void 0;
|
|
4655
|
-
if (
|
|
4656
|
-
|
|
4657
|
-
...
|
|
4652
|
+
if (h) return i;
|
|
4653
|
+
e.save(), e.translate(l, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2), Vr(e, {
|
|
4654
|
+
...t,
|
|
4658
4655
|
vert: "horz"
|
|
4659
|
-
}, -
|
|
4656
|
+
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, g, t.vert === "eaVert"), e.restore();
|
|
4660
4657
|
return;
|
|
4661
4658
|
}
|
|
4662
|
-
let
|
|
4663
|
-
if (!
|
|
4664
|
-
wr(
|
|
4659
|
+
let x = t.textWarp;
|
|
4660
|
+
if (!h && x && rt(x.preset)) {
|
|
4661
|
+
wr(e, t, x.preset, x.adj ?? [], n, r, i, a, o, s ?? d, p);
|
|
4665
4662
|
return;
|
|
4666
4663
|
}
|
|
4667
|
-
let
|
|
4668
|
-
let
|
|
4669
|
-
for (let
|
|
4670
|
-
let
|
|
4671
|
-
for (let e of
|
|
4672
|
-
return
|
|
4673
|
-
})() * Y *
|
|
4674
|
-
for (let e of
|
|
4664
|
+
let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), E = X(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D && er(e, t, i, S, C, o, p) : D, A = Math.max(1, t.numCol ?? 1), j = X(t.spcCol ?? 0, o), M = t.defaultBold ?? !1, N = t.defaultItalic ?? !1, P = s ?? d, F = (r) => {
|
|
4665
|
+
let a = (t.defaultFontSize ?? 18) * Y * o * r, s = [], c = 0, l = 0, u = /* @__PURE__ */ new Map();
|
|
4666
|
+
for (let d = 0; d < t.paragraphs.length; d++) {
|
|
4667
|
+
let m = t.paragraphs[d], g = X(m.marL, o), _ = X(m.marR, o), y = X(m.indent, o), b = m.defFontSize == null ? a : m.defFontSize * Y * o * r, x = m.defColor ? Q(m.defColor) : P, w = Xn(m), T = (() => {
|
|
4668
|
+
for (let e of m.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4669
|
+
return m.defFontSize ?? t.defaultFontSize ?? 18;
|
|
4670
|
+
})() * Y * o * r, E = (() => {
|
|
4671
|
+
for (let e of m.runs) if (e.type === "text" && e.color) return e.color;
|
|
4675
4672
|
return null;
|
|
4676
|
-
})(),
|
|
4677
|
-
for (let e of
|
|
4678
|
-
return
|
|
4679
|
-
})(),
|
|
4680
|
-
|
|
4681
|
-
let
|
|
4682
|
-
if (
|
|
4683
|
-
let
|
|
4684
|
-
|
|
4685
|
-
} else if (
|
|
4686
|
-
let
|
|
4687
|
-
|
|
4688
|
-
} else if (
|
|
4689
|
-
let
|
|
4690
|
-
|
|
4691
|
-
imagePath:
|
|
4692
|
-
mimeType:
|
|
4693
|
-
sizePx:
|
|
4673
|
+
})(), D = E ? Q(E) : x, F = (() => {
|
|
4674
|
+
for (let e of m.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4675
|
+
return m.defFontFamily ?? null;
|
|
4676
|
+
})(), I = "", L = Yn(!1, !1, T, "sans-serif", p), R = D, z = null;
|
|
4677
|
+
I = Br(m, u);
|
|
4678
|
+
let B = Qe(m.bullet);
|
|
4679
|
+
if (B.type === "char") {
|
|
4680
|
+
let e = B;
|
|
4681
|
+
L = Yn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, I === e.char ? Rn(e.fontFamily ?? null, p) : "sans-serif", p), R = e.color ? Q(e.color) : D;
|
|
4682
|
+
} else if (B.type === "autoNum") {
|
|
4683
|
+
let e = B;
|
|
4684
|
+
L = Yn(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * Y * o * r, Rn(e.fontFamily ?? F, p), p), R = B.color ? Q(B.color) : D;
|
|
4685
|
+
} else if (B.type === "blip") {
|
|
4686
|
+
let e = B, n = Zn(t, m, e) * Y * o * r;
|
|
4687
|
+
z = {
|
|
4688
|
+
imagePath: e.imagePath,
|
|
4689
|
+
mimeType: e.mimeType,
|
|
4690
|
+
sizePx: n
|
|
4694
4691
|
};
|
|
4695
4692
|
}
|
|
4696
|
-
let
|
|
4697
|
-
for (let
|
|
4698
|
-
let r =
|
|
4699
|
-
for (let
|
|
4700
|
-
let n =
|
|
4701
|
-
if (n >
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
let n = t.measureText(e.text || "M"), r = (n.fontBoundingBoxAscent ?? 0) + (n.fontBoundingBoxDescent ?? 0);
|
|
4706
|
-
r > p && (p = r);
|
|
4707
|
-
}
|
|
4693
|
+
let V = A > 1 ? (i - S - C - (A - 1) * j) / A : i - S - C, H = n + S + g, ee = n + S + g + y, U = V - g - _, W = ar(e, m, k ? U : Infinity, b, x, o, g, M, N, r, f, p, Qn(w, y)), te = m.spaceBefore == null ? 0 : m.spaceBefore / 100 * Y * o * r, G = m.spaceAfter == null ? 0 : m.spaceAfter / 100 * Y * o * r;
|
|
4694
|
+
for (let n = 0; n < W.length; n++) {
|
|
4695
|
+
let r = W[n], i = n === 0, a = n === W.length - 1, u = 0, f = 0;
|
|
4696
|
+
for (let t of r.segments) {
|
|
4697
|
+
let n = t.math ? Math.max(t.sizePx, (t.math.ascent + t.math.descent) / 1.2) : t.sizePx;
|
|
4698
|
+
if (n > u && (u = n), !t.math && O) {
|
|
4699
|
+
e.font = t.font;
|
|
4700
|
+
let n = e.measureText(t.text || "M"), r = (n.fontBoundingBoxAscent ?? 0) + (n.fontBoundingBoxDescent ?? 0);
|
|
4701
|
+
r > f && (f = r);
|
|
4708
4702
|
}
|
|
4709
4703
|
}
|
|
4710
|
-
if (
|
|
4711
|
-
|
|
4712
|
-
let
|
|
4713
|
-
n >
|
|
4704
|
+
if (u === 0 && (u = b), i && I) {
|
|
4705
|
+
e.font = L;
|
|
4706
|
+
let t = e.measureText("M"), n = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
|
|
4707
|
+
n > u && (u = n);
|
|
4714
4708
|
}
|
|
4715
|
-
i &&
|
|
4716
|
-
let
|
|
4717
|
-
|
|
4718
|
-
let
|
|
4719
|
-
|
|
4709
|
+
i && z && z.sizePx > u && (u = z.sizePx);
|
|
4710
|
+
let p = u * 1.2, g = O && f > p, _ = p, x;
|
|
4711
|
+
x = m.spaceLine ? m.spaceLine.type === "pct" ? (h ? u : p) * (m.spaceLine.val / 1e5) : m.spaceLine.val * Y * o : h && !O ? v ? p : u : _;
|
|
4712
|
+
let S = m.spaceLine?.type === "pct" ? u * (m.spaceLine.val / 1e5) : x;
|
|
4713
|
+
t.autoFit === "norm" && t.lnSpcReduction != null && m.spaceLine?.type !== "pts" && (x *= 1 - t.lnSpcReduction);
|
|
4714
|
+
let C = x + (a ? G : 0), T = i && d > 0 ? te : 0, E = i ? Qn(w, y) : 0, D = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), k = i && D ? z : null;
|
|
4715
|
+
s.push({
|
|
4720
4716
|
line: r,
|
|
4721
4717
|
linePx: C,
|
|
4722
|
-
lineHeight:
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4718
|
+
lineHeight: x,
|
|
4719
|
+
baselineLineHeight: S,
|
|
4720
|
+
topGapPx: T,
|
|
4721
|
+
textXOffset: E,
|
|
4722
|
+
bulletLabel: i ? I : "",
|
|
4723
|
+
bulletFont: L,
|
|
4724
|
+
bulletColor: R,
|
|
4725
|
+
bulletX: ee,
|
|
4726
|
+
bulletImage: k,
|
|
4727
|
+
textX: H,
|
|
4731
4728
|
textMaxW: U,
|
|
4732
|
-
alignment:
|
|
4729
|
+
alignment: m.alignment,
|
|
4733
4730
|
isLastLine: a,
|
|
4734
|
-
para:
|
|
4735
|
-
useResolvedFontMetrics:
|
|
4736
|
-
})
|
|
4731
|
+
para: m,
|
|
4732
|
+
useResolvedFontMetrics: g
|
|
4733
|
+
});
|
|
4734
|
+
let A = c + T;
|
|
4735
|
+
c += C + T, l = Math.max(l, c, A + (g ? Math.max(x, f) : x) + (a ? G : 0));
|
|
4737
4736
|
}
|
|
4738
4737
|
}
|
|
4739
4738
|
return {
|
|
4740
|
-
allLines:
|
|
4741
|
-
totalHeight: c
|
|
4739
|
+
allLines: s,
|
|
4740
|
+
totalHeight: c,
|
|
4741
|
+
requiredHeight: l
|
|
4742
4742
|
};
|
|
4743
|
-
}, { allLines: L, totalHeight: R } =
|
|
4744
|
-
if (
|
|
4743
|
+
}, { allLines: L, totalHeight: R, requiredHeight: z } = F(1);
|
|
4744
|
+
if (t.autoFit === "norm") if (t.fontScale != null && t.fontScale > 0) t.fontScale < 1 && ({allLines: L, totalHeight: R, requiredHeight: z} = F(t.fontScale));
|
|
4745
4745
|
else {
|
|
4746
|
-
let e =
|
|
4747
|
-
if (
|
|
4746
|
+
let e = a - w - E;
|
|
4747
|
+
if (z > e && e > 0) {
|
|
4748
4748
|
let t = .1, n = 1;
|
|
4749
4749
|
for (let r = 0; r < 6; r++) {
|
|
4750
4750
|
let r = (t + n) / 2;
|
|
4751
|
-
|
|
4751
|
+
F(r).requiredHeight <= e ? t = r : n = r;
|
|
4752
4752
|
}
|
|
4753
|
-
({allLines: L, totalHeight: R} =
|
|
4753
|
+
({allLines: L, totalHeight: R, requiredHeight: z} = F(t));
|
|
4754
4754
|
}
|
|
4755
4755
|
}
|
|
4756
|
-
if (
|
|
4757
|
-
let
|
|
4758
|
-
|
|
4759
|
-
let
|
|
4760
|
-
|
|
4761
|
-
let
|
|
4762
|
-
for (let
|
|
4763
|
-
let { line:
|
|
4764
|
-
|
|
4765
|
-
let E = (
|
|
4766
|
-
if (
|
|
4767
|
-
let
|
|
4768
|
-
|
|
4769
|
-
let a =
|
|
4770
|
-
if (
|
|
4756
|
+
if (h) return w + z + E;
|
|
4757
|
+
let B = t.verticalAnchor ?? "t", V = r, H;
|
|
4758
|
+
a === 0 && B === "b" ? (H = w + z + E, V = r - H) : H = t.autoFit === "sp" ? Math.max(a, w + z + E) : a;
|
|
4759
|
+
let ee, U = Math.max(0, H - w - E);
|
|
4760
|
+
ee = B === "ctr" ? V + w + (U - z) / 2 : B === "b" ? V + H - E - z : V + w, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4761
|
+
let W = ee, te = A > 1 ? (i - S - C - (A - 1) * j) / A + j : 0, G = Math.max(0, H - w - E), K = L[L.length - 1], q = K ? Math.max(0, K.linePx - K.lineHeight) : 0, J = z - q, ne = a === 0 || J <= G + .5, re = A > 1 && !ne ? Math.ceil(L.length / A) : L.length, ie = 0, ae = 0;
|
|
4762
|
+
for (let s of L) {
|
|
4763
|
+
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: v, bulletFont: y, bulletColor: b, bulletImage: x, alignment: S, isLastLine: C, useResolvedFontMetrics: w } = s;
|
|
4764
|
+
A > 1 && ie < A - 1 && ae >= re && (ie++, ae = 0, ee = W), ee += f, ae++;
|
|
4765
|
+
let E = (t.rtlCol ? A - 1 - ie : ie) * te, D = s.textX + E, O = s.bulletX + E, k = s.textMaxW, j = s.para.rtl === !0, M = j || cn(l.segments), N = l.segments.some((e) => e.isTab);
|
|
4766
|
+
if (N) {
|
|
4767
|
+
let t = X(s.para.marL, o), n = X(s.para.marR, o), r = j ? n : t + h, i = k + t + n;
|
|
4768
|
+
e.font = l.segments.find((e) => e.isTab).font;
|
|
4769
|
+
let a = e.measureText(" ").width, c = bn(l.segments.map((t) => {
|
|
4770
|
+
if (t.isTab) return {
|
|
4771
4771
|
isTab: !0,
|
|
4772
4772
|
width: 0
|
|
4773
4773
|
};
|
|
4774
|
-
if (
|
|
4774
|
+
if (t.math) return {
|
|
4775
4775
|
isTab: !1,
|
|
4776
|
-
width:
|
|
4776
|
+
width: t.math.width
|
|
4777
4777
|
};
|
|
4778
|
-
|
|
4779
|
-
let n =
|
|
4778
|
+
e.font = t.font;
|
|
4779
|
+
let n = t.letterSpacingPx ?? 0;
|
|
4780
4780
|
return {
|
|
4781
4781
|
isTab: !1,
|
|
4782
|
-
width:
|
|
4782
|
+
width: t.text ? (t.leadingLetterSpacingPx ?? 0) + $(e, t.text, n) : 0
|
|
4783
4783
|
};
|
|
4784
|
-
}), (
|
|
4785
|
-
pos: X(e.pos,
|
|
4784
|
+
}), (s.para.tabStops ?? []).map((e) => ({
|
|
4785
|
+
pos: X(e.pos, o),
|
|
4786
4786
|
algn: e.algn
|
|
4787
|
-
})), r, i, a, X(
|
|
4788
|
-
for (let e = 0; e <
|
|
4787
|
+
})), r, i, a, X(s.para.defTabSz ?? 914400, o));
|
|
4788
|
+
for (let e = 0; e < l.segments.length; e++) l.segments[e].isTab && (l.segments[e].tabWidthPx = c[e]);
|
|
4789
4789
|
}
|
|
4790
|
-
let
|
|
4791
|
-
for (let
|
|
4792
|
-
if (
|
|
4793
|
-
|
|
4790
|
+
let P = 0, F = 0, L = 0, R = 0;
|
|
4791
|
+
for (let t of l.segments) {
|
|
4792
|
+
if (t.isTab) {
|
|
4793
|
+
P += t.tabWidthPx ?? 0;
|
|
4794
4794
|
continue;
|
|
4795
4795
|
}
|
|
4796
|
-
if (
|
|
4797
|
-
|
|
4796
|
+
if (t.math) {
|
|
4797
|
+
P += t.math.width, F = Math.max(F, t.math.ascent);
|
|
4798
4798
|
continue;
|
|
4799
4799
|
}
|
|
4800
|
-
|
|
4801
|
-
let n =
|
|
4802
|
-
if (
|
|
4800
|
+
e.font = t.font;
|
|
4801
|
+
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4802
|
+
if (P += t.leadingLetterSpacingPx ?? 0, P += t.text ? $(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (F = Math.max(F, n.actualBoundingBoxAscent)), w) {
|
|
4803
4803
|
let e = n.fontBoundingBoxAscent ?? 0, t = e + (n.fontBoundingBoxDescent ?? 0);
|
|
4804
4804
|
t > R && (R = t, L = e);
|
|
4805
4805
|
}
|
|
4806
4806
|
}
|
|
4807
|
-
let
|
|
4808
|
-
if (
|
|
4809
|
-
if (
|
|
4810
|
-
else if (
|
|
4811
|
-
let e =
|
|
4812
|
-
|
|
4807
|
+
let z = w && R > 0 ? B === "t" && F > 0 ? s.para.spaceLine?.type === "pct" ? Math.max(F, L + (s.baselineLineHeight - R) / 2) : F : Math.max(F, L + Math.max(0, d - R) / 2) : Math.max(d * .8, F), V = ee + z, H = D + k, U = x && g ? p.pictureBulletImages?.has(x.imagePath) ? p.pictureBulletImages.get(x.imagePath) : I(x.imagePath, g) : void 0, G = 0;
|
|
4808
|
+
if (M && j) {
|
|
4809
|
+
if (v) e.font = y, G = e.measureText(v).width;
|
|
4810
|
+
else if (x && U) {
|
|
4811
|
+
let e = x.sizePx;
|
|
4812
|
+
G = U.height > 0 ? e * (U.width / U.height) : e;
|
|
4813
4813
|
}
|
|
4814
4814
|
}
|
|
4815
|
-
if (
|
|
4816
|
-
let
|
|
4817
|
-
|
|
4818
|
-
} else
|
|
4819
|
-
if (
|
|
4820
|
-
let
|
|
4821
|
-
|
|
4815
|
+
if (v) if (e.font = y, e.fillStyle = b, M && j) {
|
|
4816
|
+
let t = e.direction;
|
|
4817
|
+
e.direction = "rtl", e.fillText(v, H - G, V), e.direction = t;
|
|
4818
|
+
} else e.fillText(v, O, V);
|
|
4819
|
+
if (x && g && U) {
|
|
4820
|
+
let t = x.sizePx, n = U.height > 0 ? t * (U.width / U.height) : t, r = V - t;
|
|
4821
|
+
M && j ? e.drawImage(U, H - n, r, n, t) : e.drawImage(U, O, r, n, t);
|
|
4822
4822
|
}
|
|
4823
|
-
let
|
|
4824
|
-
|
|
4825
|
-
let
|
|
4823
|
+
let K = D + h, q;
|
|
4824
|
+
q = N ? j ? D + k - G - P : K : S === "ctr" ? K + (k - h - P) / 2 : S === "r" ? D + k - G - P : K;
|
|
4825
|
+
let J = S === "just" || S === "justLow" ? "just" : S === "thaiDist" ? "thaiDist" : S === "dist" ? "dist" : null, ne = C || (l.endsWithBreak ?? !1), oe = (J && !M && !N ? fn(l.segments, k - h, P, J, ne) : null) ?? l.segments, se = M ? ln(l.segments, j) : null, ce = (e, t) => {
|
|
4826
4826
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4827
|
-
let n =
|
|
4827
|
+
let n = l.segments[Math.min(e, t)], r = l.segments[Math.max(e, t)];
|
|
4828
4828
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
4829
4829
|
}, le = oe.length;
|
|
4830
|
-
for (let
|
|
4831
|
-
let
|
|
4832
|
-
if (
|
|
4833
|
-
let e = se ? se.order[
|
|
4834
|
-
|
|
4830
|
+
for (let t = 0; t < le; t++) {
|
|
4831
|
+
let s = se ? se.order[t] : t, l = oe[s], u = se ? se.rtl[s] : !1;
|
|
4832
|
+
if (M && (e.direction = u ? "rtl" : "ltr"), t > 0) {
|
|
4833
|
+
let e = se ? se.order[t - 1] : t - 1;
|
|
4834
|
+
q += ce(e, s);
|
|
4835
4835
|
}
|
|
4836
|
-
if (
|
|
4837
|
-
|
|
4836
|
+
if (l.isTab) {
|
|
4837
|
+
q += l.tabWidthPx ?? 0;
|
|
4838
4838
|
continue;
|
|
4839
4839
|
}
|
|
4840
|
-
let
|
|
4841
|
-
if (
|
|
4842
|
-
let
|
|
4843
|
-
if (
|
|
4844
|
-
let i = V -
|
|
4845
|
-
|
|
4840
|
+
let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, v = h && h.length > 0 ? h.length * g : 0;
|
|
4841
|
+
if (l.math) {
|
|
4842
|
+
let t = Pn.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
|
|
4843
|
+
if (t && n > 0 && r > 0) {
|
|
4844
|
+
let i = V - l.math.ascent, a = Fn(t, l.color);
|
|
4845
|
+
e.drawImage(a, q, i, n, r);
|
|
4846
4846
|
}
|
|
4847
|
-
|
|
4847
|
+
q += n, q += f;
|
|
4848
4848
|
continue;
|
|
4849
4849
|
}
|
|
4850
|
-
|
|
4851
|
-
let
|
|
4852
|
-
if (
|
|
4853
|
-
let
|
|
4854
|
-
Mn(
|
|
4850
|
+
e.font = l.font, e.fillStyle = l.color;
|
|
4851
|
+
let y = l.drawSizePx ?? l.sizePx, b = V + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), x = l.letterSpacingPx ?? 0;
|
|
4852
|
+
if (l.highlight && l.text) {
|
|
4853
|
+
let t = $(e, l.text, x) + v + f;
|
|
4854
|
+
Mn(e, q, b, t, y, l.highlight, l.color);
|
|
4855
4855
|
}
|
|
4856
|
-
let
|
|
4856
|
+
let S = l.shadow, C = (e, t, n, r) => {
|
|
4857
4857
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4858
|
-
if (
|
|
4858
|
+
if (x !== 0 && nr(t) > 1) {
|
|
4859
4859
|
let r = e, a = r.letterSpacing;
|
|
4860
4860
|
if (ir(e)) {
|
|
4861
|
-
r.letterSpacing = `${
|
|
4861
|
+
r.letterSpacing = `${x}px`, i(t, n, b);
|
|
4862
4862
|
try {
|
|
4863
4863
|
r.letterSpacing = a;
|
|
4864
4864
|
} catch {}
|
|
@@ -4866,88 +4866,88 @@ function Vr(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4866
4866
|
let r = n, a = [...t];
|
|
4867
4867
|
for (let t = 0; t < a.length; t++) {
|
|
4868
4868
|
let n = a[t];
|
|
4869
|
-
i(n, r,
|
|
4869
|
+
i(n, r, b), t < a.length - 1 && (r += e.measureText(n).width + x);
|
|
4870
4870
|
}
|
|
4871
4871
|
}
|
|
4872
|
-
} else i(t, n,
|
|
4873
|
-
},
|
|
4874
|
-
if (
|
|
4875
|
-
let n = O ?
|
|
4876
|
-
Tn(e,
|
|
4872
|
+
} else i(t, n, b);
|
|
4873
|
+
}, w = (t) => $(e, t, x), E = h && h.length > 0 ? $t([...l.text], h, g, w) : null, D = [...l.text], O = !!h && h.length === D.length - 1 && D.length > 1, k = (e, t) => {
|
|
4874
|
+
if (_) {
|
|
4875
|
+
let n = O ? x + g : x;
|
|
4876
|
+
Tn(e, l.text, q, b, y, n, t);
|
|
4877
4877
|
return;
|
|
4878
4878
|
}
|
|
4879
4879
|
if (O) {
|
|
4880
|
-
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r =
|
|
4880
|
+
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = x + g;
|
|
4881
4881
|
if (ir(e)) {
|
|
4882
4882
|
let t = e, i = t.letterSpacing;
|
|
4883
|
-
t.letterSpacing = `${r}px`, n(
|
|
4883
|
+
t.letterSpacing = `${r}px`, n(l.text, q, b);
|
|
4884
4884
|
try {
|
|
4885
4885
|
t.letterSpacing = i;
|
|
4886
4886
|
} catch {}
|
|
4887
4887
|
} else {
|
|
4888
|
-
let t =
|
|
4888
|
+
let t = q;
|
|
4889
4889
|
for (let i = 0; i < D.length; i++) {
|
|
4890
4890
|
let a = D[i];
|
|
4891
|
-
n(a, t,
|
|
4891
|
+
n(a, t, b), i < D.length - 1 && (t += e.measureText(a).width + r);
|
|
4892
4892
|
}
|
|
4893
4893
|
}
|
|
4894
|
-
} else if (E) for (let { text: n, dx: r } of E)
|
|
4895
|
-
else
|
|
4896
|
-
}, A =
|
|
4897
|
-
if (A &&
|
|
4898
|
-
let
|
|
4899
|
-
if (
|
|
4900
|
-
|
|
4901
|
-
let r =
|
|
4902
|
-
Jn(
|
|
4903
|
-
e.font =
|
|
4894
|
+
} else if (E) for (let { text: n, dx: r } of E) C(e, n, q + r, t);
|
|
4895
|
+
else C(e, l.text, q, t);
|
|
4896
|
+
}, A = l.reflection;
|
|
4897
|
+
if (A && l.text) {
|
|
4898
|
+
let t = e.canvas.width || 0, n = e.canvas.height || 0;
|
|
4899
|
+
if (t > 0 && n > 0) {
|
|
4900
|
+
e.font = l.font;
|
|
4901
|
+
let r = e.measureText(l.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : y * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : y * .2, s = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, c = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1;
|
|
4902
|
+
Jn(e, (e) => {
|
|
4903
|
+
e.font = l.font, e.fillStyle = l.color, k(e, "fill");
|
|
4904
4904
|
}, {
|
|
4905
|
-
x: (
|
|
4906
|
-
y: (
|
|
4907
|
-
w: Math.max(1,
|
|
4905
|
+
x: (q - s) * f,
|
|
4906
|
+
y: (b - i) * f,
|
|
4907
|
+
w: Math.max(1, s + c) * f,
|
|
4908
4908
|
h: Math.max(1, i + a) * f
|
|
4909
|
-
}, A,
|
|
4909
|
+
}, A, o * f, u, t, n), e.font = l.font, e.fillStyle = l.color;
|
|
4910
4910
|
}
|
|
4911
4911
|
}
|
|
4912
|
-
if (
|
|
4913
|
-
let
|
|
4914
|
-
|
|
4912
|
+
if (S) {
|
|
4913
|
+
let t = S.dir * Math.PI / 180, n = X(S.dist, o);
|
|
4914
|
+
e.save(), e.shadowColor = Q(S.color, S.alpha), e.shadowBlur = X(S.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4915
4915
|
}
|
|
4916
|
-
k(
|
|
4917
|
-
let j =
|
|
4918
|
-
j && j.width > 0 && (
|
|
4919
|
-
let
|
|
4920
|
-
if (
|
|
4921
|
-
text:
|
|
4922
|
-
inShapeX:
|
|
4923
|
-
inShapeY:
|
|
4924
|
-
w:
|
|
4925
|
-
h:
|
|
4926
|
-
fontSize:
|
|
4927
|
-
font:
|
|
4928
|
-
shapeX:
|
|
4929
|
-
shapeY:
|
|
4930
|
-
shapeW:
|
|
4931
|
-
shapeH:
|
|
4932
|
-
rotation:
|
|
4933
|
-
hyperlink:
|
|
4934
|
-
}),
|
|
4935
|
-
let
|
|
4936
|
-
|
|
4937
|
-
let
|
|
4938
|
-
if (
|
|
4939
|
-
let
|
|
4940
|
-
|
|
4916
|
+
k(e, "fill"), S && e.restore();
|
|
4917
|
+
let j = l.outline;
|
|
4918
|
+
j && j.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(j.width, o)), e.strokeStyle = j.color ? `#${j.color}` : l.color, e.lineJoin = "round", k(e, "stroke"), e.restore()), e.font = l.font;
|
|
4919
|
+
let N = $(e, l.text, x) + v;
|
|
4920
|
+
if (m && l.text && m({
|
|
4921
|
+
text: l.text,
|
|
4922
|
+
inShapeX: q - n,
|
|
4923
|
+
inShapeY: ee - r,
|
|
4924
|
+
w: N + f,
|
|
4925
|
+
h: d,
|
|
4926
|
+
fontSize: y,
|
|
4927
|
+
font: l.font,
|
|
4928
|
+
shapeX: n,
|
|
4929
|
+
shapeY: r,
|
|
4930
|
+
shapeW: i,
|
|
4931
|
+
shapeH: a,
|
|
4932
|
+
rotation: c,
|
|
4933
|
+
hyperlink: l.hyperlink
|
|
4934
|
+
}), l.underline && Zt(e, q, b, N + f, y, l.underlineColor ?? l.color, l.underlineStyle, p.dpr), l.strikethrough) {
|
|
4935
|
+
let t = Math.max(1, y * .05);
|
|
4936
|
+
e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash([]);
|
|
4937
|
+
let n = b - y * .32;
|
|
4938
|
+
if (l.strikeDouble) {
|
|
4939
|
+
let r = t * .9, i = n - r, a = n + r;
|
|
4940
|
+
e.beginPath(), e.moveTo(q, i + T(i, t, p.dpr)), e.lineTo(q + N + f, i + T(i, t, p.dpr)), e.moveTo(q, a + T(a, t, p.dpr)), e.lineTo(q + N + f, a + T(a, t, p.dpr)), e.stroke();
|
|
4941
4941
|
} else {
|
|
4942
|
-
let
|
|
4943
|
-
|
|
4942
|
+
let r = n + T(n, t, p.dpr);
|
|
4943
|
+
e.beginPath(), e.moveTo(q, r), e.lineTo(q + N + f, r), e.stroke();
|
|
4944
4944
|
}
|
|
4945
4945
|
}
|
|
4946
|
-
|
|
4946
|
+
q += N, q += f;
|
|
4947
4947
|
}
|
|
4948
|
-
|
|
4948
|
+
M && (e.direction = "ltr"), ee += u;
|
|
4949
4949
|
}
|
|
4950
|
-
|
|
4950
|
+
e.restore();
|
|
4951
4951
|
}
|
|
4952
4952
|
function Hr(e, t, n, r, i) {
|
|
4953
4953
|
if (!e) return [];
|
|
@@ -5047,7 +5047,7 @@ function qr(e) {
|
|
|
5047
5047
|
}
|
|
5048
5048
|
function Jr(e, t, n = qr(t), r, i, a) {
|
|
5049
5049
|
let o = qr(t);
|
|
5050
|
-
return
|
|
5050
|
+
return P(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
|
|
5051
5051
|
tiff: r,
|
|
5052
5052
|
svgDecoder: a,
|
|
5053
5053
|
...i ?? {}
|
|
@@ -5060,7 +5060,7 @@ function Yr(e, t, n) {
|
|
|
5060
5060
|
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5061
5061
|
e.save();
|
|
5062
5062
|
try {
|
|
5063
|
-
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))),
|
|
5063
|
+
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(r + a / 2), -(i + o / 2))), b(e, "tiff", {
|
|
5064
5064
|
x: r,
|
|
5065
5065
|
y: i,
|
|
5066
5066
|
width: a,
|
|
@@ -5070,117 +5070,117 @@ function Yr(e, t, n) {
|
|
|
5070
5070
|
e.restore();
|
|
5071
5071
|
}
|
|
5072
5072
|
}
|
|
5073
|
-
async function Xr(e, t,
|
|
5074
|
-
if (
|
|
5075
|
-
let
|
|
5076
|
-
if (!
|
|
5077
|
-
let { widthPt:
|
|
5078
|
-
...
|
|
5079
|
-
targetWidthPx:
|
|
5080
|
-
targetHeightPx:
|
|
5081
|
-
...
|
|
5073
|
+
async function Xr(e, t, r, i, a, s, c = 1, l, u) {
|
|
5074
|
+
if (a) try {
|
|
5075
|
+
let d = t.mimeType === "image/svg+xml", f = Ne(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5076
|
+
if (!f) return;
|
|
5077
|
+
let { widthPt: p, heightPt: m } = f, h = En(X(t.width, r), X(t.height, r), c, t.srcRect), g = J(t) || d, _ = g ? h : u && !t.duotone ? Dn(u, Z(On(t), g ? void 0 : t.duotone)) : void 0, v = _ && "maxRetainedPixels" in _ ? _.maxRetainedPixels : void 0, y = {
|
|
5078
|
+
..._ ? {
|
|
5079
|
+
targetWidthPx: _.targetWidthPx,
|
|
5080
|
+
targetHeightPx: _.targetHeightPx,
|
|
5081
|
+
...v === void 0 ? {} : { maxRetainedPixels: v }
|
|
5082
5082
|
} : {},
|
|
5083
|
-
workerDecoder:
|
|
5083
|
+
workerDecoder: l
|
|
5084
5084
|
}, b;
|
|
5085
|
-
if (
|
|
5086
|
-
b = await
|
|
5085
|
+
if (J(t)) try {
|
|
5086
|
+
b = await H(t.svgImagePath, a, y);
|
|
5087
5087
|
} catch {
|
|
5088
|
-
b =
|
|
5089
|
-
widthPt:
|
|
5090
|
-
heightPt:
|
|
5091
|
-
...
|
|
5092
|
-
tiff:
|
|
5088
|
+
b = d ? await H(t.imagePath, a, y) : await Je(t.imagePath, t.mimeType, t.duotone, a, {
|
|
5089
|
+
widthPt: p,
|
|
5090
|
+
heightPt: m,
|
|
5091
|
+
..._ ?? {},
|
|
5092
|
+
tiff: s
|
|
5093
5093
|
});
|
|
5094
5094
|
}
|
|
5095
|
-
else b =
|
|
5096
|
-
widthPt:
|
|
5097
|
-
heightPt:
|
|
5098
|
-
...
|
|
5099
|
-
tiff:
|
|
5095
|
+
else b = d ? await H(t.imagePath, a, y) : await Je(t.imagePath, t.mimeType, t.duotone, a, {
|
|
5096
|
+
widthPt: p,
|
|
5097
|
+
heightPt: m,
|
|
5098
|
+
..._ ?? {},
|
|
5099
|
+
tiff: s
|
|
5100
5100
|
});
|
|
5101
|
-
if (!b ||
|
|
5101
|
+
if (!b || i()) return;
|
|
5102
5102
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5103
|
-
let x = X(t.x,
|
|
5103
|
+
let x = X(t.x, r), S = X(t.y, r), C = X(t.width, r), w = X(t.height, r);
|
|
5104
5104
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(x + C / 2, S + w / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(x + C / 2), -(S + w / 2)));
|
|
5105
5105
|
let T = (e, n, r, i, a) => {
|
|
5106
|
-
t.custGeom && t.custGeom.length > 0 ? Ir(e, t.custGeom, n, r, i, a) : t.prstGeom &&
|
|
5106
|
+
t.custGeom && t.custGeom.length > 0 ? Ir(e, t.custGeom, n, r, i, a) : t.prstGeom && o(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
5107
5107
|
}, E = (e, t, n, r, i) => {
|
|
5108
5108
|
e.beginPath(), T(e, t, n, r, i);
|
|
5109
5109
|
}, D = (e, n, r, i, a) => {
|
|
5110
5110
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (E(e, n, r, i, a), e.clip());
|
|
5111
|
-
}, O = (e,
|
|
5112
|
-
t.stroke && (e.save(), $r(e, t.stroke,
|
|
5113
|
-
x:
|
|
5111
|
+
}, O = (e, n, i, a, o) => {
|
|
5112
|
+
t.stroke && (e.save(), $r(e, t.stroke, r, {
|
|
5113
|
+
x: n,
|
|
5114
5114
|
y: i,
|
|
5115
5115
|
w: a,
|
|
5116
5116
|
h: o
|
|
5117
|
-
}, t.rotation), E(e,
|
|
5118
|
-
}, k = (e,
|
|
5117
|
+
}, t.rotation), E(e, n, i, a, o), e.stroke(), e.restore());
|
|
5118
|
+
}, k = (e, n, i, a, o) => {
|
|
5119
5119
|
let s = t.sp3d;
|
|
5120
5120
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
5121
|
-
let t = Math.max(.5, s.contourW *
|
|
5121
|
+
let t = Math.max(.5, s.contourW * r);
|
|
5122
5122
|
e.save(), e.beginPath();
|
|
5123
5123
|
let c = t * 2 + Math.max(a, o);
|
|
5124
|
-
e.rect(
|
|
5124
|
+
e.rect(n - c, i - c, a + 2 * c, o + 2 * c), T(e, n, i, a, o), e.clip("evenodd"), e.beginPath(), E(e, n, i, a, o), e.strokeStyle = Q(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5125
5125
|
}
|
|
5126
|
-
},
|
|
5126
|
+
}, A = t.scene3d && Ct(t.scene3d.camera) ? t.scene3d : null, j = (e, n, r, i, a) => {
|
|
5127
5127
|
e.save(), D(e, n, r, i, a), je(e, b, t.srcRect, n, r, i, a), e.restore();
|
|
5128
|
+
}, M = (e, t, n, r, i) => {
|
|
5129
|
+
j(e, t, n, r, i), O(e, t, n, r, i), k(e, t, n, r, i);
|
|
5128
5130
|
}, N = (e, t, n, r, i) => {
|
|
5129
|
-
|
|
5130
|
-
}, P = (
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
bevels: z,
|
|
5136
|
-
extrusion: B ?? void 0,
|
|
5131
|
+
j(e, t, n, r, i), O(e, t, n, r, i);
|
|
5132
|
+
}, P = e.getTransform(), F = Math.abs(P.a * P.d - P.b * P.c), I = F > 0 ? Math.sqrt(F) : 1, L = Hr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, I), R = A ? Ur(t.sp3d, A.camera, C, w, r, I) : null, z = t.stroke ? t.stroke.width * r / 2 : 0, V = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, ee = R ? Math.hypot(R.offsetX, R.offsetY) / I : 0, U = z + V + ee + 2, W = (e) => {
|
|
5133
|
+
if (A) {
|
|
5134
|
+
if (Wr(e, A.camera, x, S, C, w, N, {
|
|
5135
|
+
bevels: L,
|
|
5136
|
+
extrusion: R ?? void 0,
|
|
5137
5137
|
paintEdges: k,
|
|
5138
|
-
edgePadCss:
|
|
5138
|
+
edgePadCss: U
|
|
5139
5139
|
})) return;
|
|
5140
|
-
} else if (
|
|
5141
|
-
|
|
5142
|
-
},
|
|
5140
|
+
} else if (L.length > 0 && Gr(e, x, S, C, w, L, N, k, U)) return;
|
|
5141
|
+
M(e, x, S, C, w);
|
|
5142
|
+
}, te = (e, t, n, r, i, a) => {
|
|
5143
5143
|
e.save(), D(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5144
|
-
},
|
|
5145
|
-
|
|
5146
|
-
},
|
|
5144
|
+
}, G = (e, t) => {
|
|
5145
|
+
A && Wr(e, A.camera, x, S, C, w, (e, n, r, i, a) => te(e, t, n, r, i, a)) || te(e, t, x, S, C, w);
|
|
5146
|
+
}, K = e.getTransform(), q = Math.abs(K.a * K.d - K.b * K.c), ne = q > 0 ? Math.sqrt(q) : 1, re = z + V, ie = (t.custGeom && t.custGeom.length > 0 ? he(t.custGeom, x, S, C, w) : t.prstGeom && n(t.prstGeom.toLowerCase()) ? B(t.prstGeom.toLowerCase(), x, S, C, w, t.prstAdjust ?? []) : null) ?? {
|
|
5147
5147
|
x,
|
|
5148
5148
|
y: S,
|
|
5149
5149
|
w: C,
|
|
5150
5150
|
h: w
|
|
5151
|
-
}, ae =
|
|
5152
|
-
bbox: Or(
|
|
5153
|
-
anchor: jr(
|
|
5154
|
-
}, oe =
|
|
5155
|
-
Pr(e, t,
|
|
5151
|
+
}, ae = A ? Mr(A.camera, K, x, S, C, w, U, t.shadow?.algn) : {
|
|
5152
|
+
bbox: Or(K, ie.x - re, ie.y - re, ie.w + re * 2, ie.h + re * 2),
|
|
5153
|
+
anchor: jr(K, x, S, C, w, t.shadow?.algn)
|
|
5154
|
+
}, oe = r * ne, se = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), ce = (e) => G(e, "#000");
|
|
5155
|
+
Pr(e, t, A && se ? Nr(W, K, ae.bbox, {
|
|
5156
5156
|
w: e.canvas.width || 0,
|
|
5157
5157
|
h: e.canvas.height || 0
|
|
5158
|
-
}) :
|
|
5158
|
+
}) : W, A && se ? Nr(ce, K, ae.bbox, {
|
|
5159
5159
|
w: e.canvas.width || 0,
|
|
5160
5160
|
h: e.canvas.height || 0
|
|
5161
|
-
}) : ce, ae.bbox, ae.anchor,
|
|
5162
|
-
} catch (
|
|
5163
|
-
if (
|
|
5164
|
-
|
|
5161
|
+
}) : ce, ae.bbox, ae.anchor, r, oe, K), e.restore();
|
|
5162
|
+
} catch (n) {
|
|
5163
|
+
if (ue(n, "tiff")) {
|
|
5164
|
+
i() || Yr(e, t, r);
|
|
5165
5165
|
return;
|
|
5166
5166
|
}
|
|
5167
|
-
if (Le(
|
|
5167
|
+
if (Le(n) || qe(n)) throw n;
|
|
5168
5168
|
}
|
|
5169
5169
|
}
|
|
5170
|
-
async function Zr(e, t, n, r, i, o, s, c
|
|
5171
|
-
let
|
|
5170
|
+
async function Zr(e, t, n, r, i, a, o, s, c = 1, l, u) {
|
|
5171
|
+
let d = X(t.x, n), f = X(t.y, n), p = X(t.width, n), m = X(t.height, n), h, g = !1;
|
|
5172
5172
|
if (t.posterPath && i) try {
|
|
5173
|
-
|
|
5173
|
+
h = await Jr(t, i, o, s, t.posterMimeType === "image/svg+xml" ? En(p, m, c) : u ? Dn(u, Z(t.posterPath)) : void 0, l);
|
|
5174
5174
|
} catch (e) {
|
|
5175
|
-
if (
|
|
5175
|
+
if (ue(e, "tiff")) g = !0;
|
|
5176
5176
|
else if (Le(e) || qe(e)) throw e;
|
|
5177
5177
|
}
|
|
5178
|
-
r() || (e.save(), ei(e, t, n),
|
|
5179
|
-
x:
|
|
5180
|
-
y:
|
|
5181
|
-
width:
|
|
5182
|
-
height:
|
|
5183
|
-
})),
|
|
5178
|
+
r() || (e.save(), ei(e, t, n), h ? e.drawImage(h, d, f, p, m) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(d, f, p, m), g && b(e, "tiff", {
|
|
5179
|
+
x: d,
|
|
5180
|
+
y: f,
|
|
5181
|
+
width: p,
|
|
5182
|
+
height: m
|
|
5183
|
+
})), a || an(e, d + p / 2, f + m / 2, p, m, "paused"), e.restore());
|
|
5184
5184
|
}
|
|
5185
5185
|
function Qr(e, t, n, r, i, a, o) {
|
|
5186
5186
|
let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
@@ -5250,172 +5250,172 @@ function ei(e, t, n) {
|
|
|
5250
5250
|
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5251
5251
|
e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(r + a / 2), -(i + o / 2));
|
|
5252
5252
|
}
|
|
5253
|
-
function ti(t, n, r, i
|
|
5253
|
+
function ti(e, t, n, r, i = {
|
|
5254
5254
|
themeMajorFont: null,
|
|
5255
5255
|
themeMinorFont: null,
|
|
5256
5256
|
dpr: 1
|
|
5257
|
-
},
|
|
5258
|
-
|
|
5259
|
-
let
|
|
5257
|
+
}, a) {
|
|
5258
|
+
e.save(), ei(e, t, n);
|
|
5259
|
+
let o = X(t.x, n), s = X(t.y, n), c = t.cols.map((e) => X(e, n)), l = c.length, u = (e, t) => {
|
|
5260
5260
|
let n = 0;
|
|
5261
|
-
for (let r = 0; r < t; r++) n +=
|
|
5261
|
+
for (let r = 0; r < t; r++) n += c[e + r] ?? 0;
|
|
5262
5262
|
return n;
|
|
5263
|
-
},
|
|
5264
|
-
for (let
|
|
5265
|
-
let o =
|
|
5266
|
-
for (let
|
|
5267
|
-
let s = o.cells[
|
|
5263
|
+
}, d = t.rows.map((e) => X(e.height, n));
|
|
5264
|
+
for (let a = 0; a < t.rows.length; a++) {
|
|
5265
|
+
let o = t.rows[a];
|
|
5266
|
+
for (let t = 0; t < o.cells.length; t++) {
|
|
5267
|
+
let s = o.cells[t];
|
|
5268
5268
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5269
|
-
let c =
|
|
5270
|
-
l >
|
|
5269
|
+
let c = u(t, s.gridSpan || 1), l = Vr(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, o.height === 0) || 0;
|
|
5270
|
+
l > d[a] && (d[a] = l);
|
|
5271
5271
|
}
|
|
5272
5272
|
}
|
|
5273
|
-
for (let
|
|
5274
|
-
let o =
|
|
5273
|
+
for (let a = 0; a < t.rows.length; a++) {
|
|
5274
|
+
let o = t.rows[a];
|
|
5275
5275
|
for (let s = 0; s < o.cells.length; s++) {
|
|
5276
5276
|
let c = o.cells[s];
|
|
5277
5277
|
if (c.hMerge || c.vMerge) continue;
|
|
5278
5278
|
let l = c.rowSpan || 1;
|
|
5279
5279
|
if (l <= 1 || !c.textBody) continue;
|
|
5280
|
-
let
|
|
5281
|
-
for (let
|
|
5280
|
+
let f = u(s, c.gridSpan || 1), p = t.rows.slice(a, Math.min(t.rows.length, a + l)).some((e) => e.height === 0), m = Vr(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, p) || 0, h = 0;
|
|
5281
|
+
for (let e = 0; e < l && a + e < d.length; e++) h += d[a + e];
|
|
5282
5282
|
if (m > h) {
|
|
5283
|
-
let
|
|
5284
|
-
for (let
|
|
5283
|
+
let e = (m - h) / l;
|
|
5284
|
+
for (let t = 0; t < l && a + t < d.length; t++) d[a + t] += e;
|
|
5285
5285
|
}
|
|
5286
5286
|
}
|
|
5287
5287
|
}
|
|
5288
|
-
let
|
|
5289
|
-
if (
|
|
5290
|
-
let e =
|
|
5291
|
-
for (let t = 0; t <
|
|
5288
|
+
let f = c.reduce((e, t) => e + t, 0), p = Array(l);
|
|
5289
|
+
if (t.rtl) {
|
|
5290
|
+
let e = o + f;
|
|
5291
|
+
for (let t = 0; t < l; t++) e -= c[t], p[t] = e;
|
|
5292
5292
|
} else {
|
|
5293
|
-
let e =
|
|
5294
|
-
for (let t = 0; t <
|
|
5293
|
+
let e = o;
|
|
5294
|
+
for (let t = 0; t < l; t++) p[t] = e, e += c[t];
|
|
5295
5295
|
}
|
|
5296
|
-
let
|
|
5296
|
+
let m = (e, n) => t.rtl ? p[e + n - 1] : p[e], h = Array(t.rows.length);
|
|
5297
5297
|
{
|
|
5298
|
-
let e =
|
|
5299
|
-
for (let
|
|
5298
|
+
let e = s;
|
|
5299
|
+
for (let n = 0; n < t.rows.length; n++) h[n] = e, e += d[n];
|
|
5300
5300
|
}
|
|
5301
|
-
let
|
|
5301
|
+
let g, _ = {
|
|
5302
5302
|
row: 0,
|
|
5303
5303
|
column: 0
|
|
5304
5304
|
};
|
|
5305
|
-
if (
|
|
5306
|
-
let e = X(
|
|
5307
|
-
|
|
5308
|
-
let
|
|
5309
|
-
|
|
5310
|
-
let
|
|
5311
|
-
|
|
5305
|
+
if (a) {
|
|
5306
|
+
let e = X(t.width, n), r = X(t.height, n), i = o + e / 2, c = s + r / 2, l = t.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l);
|
|
5307
|
+
g = (e) => {
|
|
5308
|
+
let n = e.shapeX + e.shapeW / 2 - i, r = e.shapeY + e.shapeH / 2 - c;
|
|
5309
|
+
t.flipH && (n = -n), t.flipV && (r = -r);
|
|
5310
|
+
let o = i + u * n - d * r, s = c + d * n + u * r;
|
|
5311
|
+
a({
|
|
5312
5312
|
...e,
|
|
5313
|
-
...
|
|
5314
|
-
shapeX:
|
|
5315
|
-
shapeY:
|
|
5316
|
-
rotation:
|
|
5317
|
-
...
|
|
5318
|
-
...
|
|
5319
|
-
tableCell:
|
|
5313
|
+
...t.id === void 0 ? {} : { shapeId: t.id },
|
|
5314
|
+
shapeX: o - e.shapeW / 2,
|
|
5315
|
+
shapeY: s - e.shapeH / 2,
|
|
5316
|
+
rotation: t.rotation,
|
|
5317
|
+
...t.flipH ? { shapeFlipH: !0 } : {},
|
|
5318
|
+
...t.flipV ? { shapeFlipV: !0 } : {},
|
|
5319
|
+
tableCell: _
|
|
5320
5320
|
});
|
|
5321
5321
|
};
|
|
5322
5322
|
}
|
|
5323
|
-
let
|
|
5324
|
-
for (let e = 0; e <
|
|
5325
|
-
let
|
|
5326
|
-
for (let i = 0; i <
|
|
5327
|
-
let a =
|
|
5323
|
+
let v = [], y = t.rows.map(() => Array(l).fill(-1));
|
|
5324
|
+
for (let e = 0; e < t.rows.length; e++) {
|
|
5325
|
+
let n = t.rows[e], r = h[e];
|
|
5326
|
+
for (let i = 0; i < n.cells.length; i++) {
|
|
5327
|
+
let a = n.cells[i];
|
|
5328
5328
|
if (a.hMerge || a.vMerge) continue;
|
|
5329
|
-
let o = a.gridSpan || 1, s = a.rowSpan || 1, c =
|
|
5330
|
-
for (let t = 0; t < s; t++)
|
|
5331
|
-
let p =
|
|
5332
|
-
|
|
5329
|
+
let o = a.gridSpan || 1, s = a.rowSpan || 1, c = u(i, o), f = 0;
|
|
5330
|
+
for (let t = 0; t < s; t++) f += d[e + t] ?? 0;
|
|
5331
|
+
let p = m(i, o), h = Math.min(e + s - 1, t.rows.length - 1), g = v.length;
|
|
5332
|
+
v.push({
|
|
5333
5333
|
cell: a,
|
|
5334
5334
|
colX: p,
|
|
5335
5335
|
rowY: r,
|
|
5336
5336
|
cellW: c,
|
|
5337
|
-
cellH:
|
|
5337
|
+
cellH: f,
|
|
5338
5338
|
ci: i,
|
|
5339
5339
|
ri: e,
|
|
5340
5340
|
span: o,
|
|
5341
|
-
lastRi:
|
|
5341
|
+
lastRi: h
|
|
5342
5342
|
});
|
|
5343
|
-
for (let t = e; t <=
|
|
5343
|
+
for (let t = e; t <= h; t++) for (let e = i; e < i + o && e < l; e++) y[t][e] = g;
|
|
5344
5344
|
}
|
|
5345
5345
|
}
|
|
5346
|
-
for (let { cell:
|
|
5347
|
-
let f = Nn(
|
|
5348
|
-
if (f && (
|
|
5349
|
-
|
|
5346
|
+
for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l, ci: u, ri: d } of v) {
|
|
5347
|
+
let f = Nn(a.fill, e, o, s, c, l, t.rotation);
|
|
5348
|
+
if (f && (e.fillStyle = f, e.fillRect(o, s, c, l)), a.textBody) {
|
|
5349
|
+
g && (_ = {
|
|
5350
5350
|
row: d,
|
|
5351
5351
|
column: u
|
|
5352
5352
|
});
|
|
5353
|
-
let
|
|
5354
|
-
Vr(
|
|
5353
|
+
let t = a.textColor ? Q(a.textColor) : null;
|
|
5354
|
+
Vr(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i, g);
|
|
5355
5355
|
}
|
|
5356
5356
|
}
|
|
5357
|
-
let
|
|
5358
|
-
if (e < 0 || e >=
|
|
5359
|
-
let n =
|
|
5360
|
-
return n < 0 ? null :
|
|
5361
|
-
},
|
|
5362
|
-
if ($r(
|
|
5363
|
-
x: Math.min(
|
|
5364
|
-
y: Math.min(
|
|
5365
|
-
w: Math.max(1, Math.abs(
|
|
5366
|
-
h: Math.max(1, Math.abs(
|
|
5367
|
-
},
|
|
5368
|
-
|
|
5357
|
+
let b = i.dpr, x = (e, t) => {
|
|
5358
|
+
if (e < 0 || e >= y.length || t < 0 || t >= l) return null;
|
|
5359
|
+
let n = y[e][t];
|
|
5360
|
+
return n < 0 ? null : v[n];
|
|
5361
|
+
}, S = (r, i, a, o, s) => {
|
|
5362
|
+
if ($r(e, r, n, {
|
|
5363
|
+
x: Math.min(i, o),
|
|
5364
|
+
y: Math.min(a, s),
|
|
5365
|
+
w: Math.max(1, Math.abs(o - i)),
|
|
5366
|
+
h: Math.max(1, Math.abs(s - a))
|
|
5367
|
+
}, t.rotation), r.cmpd === "dbl" && !r.dashStyle && !r.customDash?.length && (i === o || a === s)) {
|
|
5368
|
+
e.fillStyle = e.strokeStyle, xe(e, i, a, o, s, Math.max(.5, X(r.width, n)), b);
|
|
5369
5369
|
return;
|
|
5370
5370
|
}
|
|
5371
|
-
let
|
|
5372
|
-
|
|
5371
|
+
let c = i === o ? T(i, e.lineWidth, b) : 0, l = a === s ? T(a, e.lineWidth, b) : 0;
|
|
5372
|
+
e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
|
|
5373
5373
|
};
|
|
5374
|
-
for (let
|
|
5375
|
-
let { cell: i, colX: a, rowY: o, cellW: s, cellH: c } =
|
|
5376
|
-
|
|
5377
|
-
let
|
|
5378
|
-
if (
|
|
5374
|
+
for (let r of v) {
|
|
5375
|
+
let { cell: i, colX: a, rowY: o, cellW: s, cellH: c } = r;
|
|
5376
|
+
e.save();
|
|
5377
|
+
let f = t.rtl ? i.borderR : i.borderL, p = t.rtl ? i.borderL : i.borderR, g = t.rtl ? r.ci + r.span === l : r.ci === 0, _ = t.rtl ? r.ci === 0 : r.ci + r.span === l, v = t.rtl ? r.ci - 1 : r.ci + r.span, b = (e) => t.rtl ? e.borderR : e.borderL;
|
|
5378
|
+
if (r.ri === 0 && i.borderT && S(i.borderT, a, o, a + s, o), g && f && S(f, a, o, a, o + c), r.lastRi === t.rows.length - 1) {
|
|
5379
5379
|
let e = i.borderB;
|
|
5380
|
-
e &&
|
|
5380
|
+
e && S(e, a, o + c, a + s, o + c);
|
|
5381
5381
|
} else {
|
|
5382
|
-
let
|
|
5383
|
-
for (; a <
|
|
5384
|
-
let
|
|
5385
|
-
for (; o <
|
|
5386
|
-
let s =
|
|
5382
|
+
let e = r.lastRi + 1, t = o + c, n = Math.min(r.ci + r.span, l), a = r.ci;
|
|
5383
|
+
for (; a < n;) {
|
|
5384
|
+
let r = y[e][a], o = a + 1;
|
|
5385
|
+
for (; o < n && y[e][o] === r;) o++;
|
|
5386
|
+
let s = x(e, a), c = hn(i.borderB, s ? s.cell.borderT : null);
|
|
5387
5387
|
if (c) {
|
|
5388
|
-
let e =
|
|
5389
|
-
|
|
5388
|
+
let e = m(a, o - a);
|
|
5389
|
+
S(c, e, t, e + u(a, o - a), t);
|
|
5390
5390
|
}
|
|
5391
5391
|
a = o;
|
|
5392
5392
|
}
|
|
5393
5393
|
}
|
|
5394
5394
|
if (_) {
|
|
5395
5395
|
let e = p;
|
|
5396
|
-
e &&
|
|
5396
|
+
e && S(e, a + s, o, a + s, o + c);
|
|
5397
5397
|
} else {
|
|
5398
|
-
let
|
|
5399
|
-
for (;
|
|
5400
|
-
let
|
|
5401
|
-
for (; i + 1 <=
|
|
5402
|
-
let a =
|
|
5403
|
-
o &&
|
|
5398
|
+
let e = a + s, t = r.ri;
|
|
5399
|
+
for (; t <= r.lastRi;) {
|
|
5400
|
+
let n = y[t][v], i = t;
|
|
5401
|
+
for (; i + 1 <= r.lastRi && y[i + 1][v] === n;) i++;
|
|
5402
|
+
let a = x(t, v), o = hn(p, a ? b(a.cell) : null);
|
|
5403
|
+
o && S(o, e, h[t], e, h[i] + d[i]), t = i + 1;
|
|
5404
5404
|
}
|
|
5405
5405
|
}
|
|
5406
|
-
i.diagonalTL && ($r(
|
|
5406
|
+
i.diagonalTL && ($r(e, i.diagonalTL, n, {
|
|
5407
5407
|
x: a,
|
|
5408
5408
|
y: o,
|
|
5409
5409
|
w: s,
|
|
5410
5410
|
h: c
|
|
5411
|
-
},
|
|
5411
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && ($r(e, i.diagonalTR, n, {
|
|
5412
5412
|
x: a,
|
|
5413
5413
|
y: o,
|
|
5414
5414
|
w: s,
|
|
5415
5415
|
h: c
|
|
5416
|
-
},
|
|
5416
|
+
}, t.rotation), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + c), e.stroke()), e.restore();
|
|
5417
5417
|
}
|
|
5418
|
-
|
|
5418
|
+
e.restore();
|
|
5419
5419
|
}
|
|
5420
5420
|
function ni(e, t, n, r) {
|
|
5421
5421
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
@@ -5451,56 +5451,56 @@ async function si(e, t, n, r, i = {}, a) {
|
|
|
5451
5451
|
let o = i.fetchImage ?? (i.fetchMedia ? qr(i.fetchMedia) : void 0), s = (ri.get(e) ?? 0) + 1;
|
|
5452
5452
|
ri.set(e, s);
|
|
5453
5453
|
let c = () => ri.get(e) !== s, l = () => c() ? Promise.resolve(e) : ci(e, t, n, r, i, a, o, c);
|
|
5454
|
-
return o && jn(t) ?
|
|
5455
|
-
}
|
|
5456
|
-
async function ci(
|
|
5457
|
-
let l =
|
|
5458
|
-
|
|
5459
|
-
let
|
|
5460
|
-
if (!
|
|
5461
|
-
if (
|
|
5462
|
-
let
|
|
5463
|
-
themeMajorFont:
|
|
5464
|
-
themeMinorFont:
|
|
5465
|
-
themeHlinkColor:
|
|
5466
|
-
embeddedFontAliases:
|
|
5467
|
-
embeddedFontAuthoredFamilies:
|
|
5454
|
+
return o && jn(t) ? se(o, i.imageResources, l) : l();
|
|
5455
|
+
}
|
|
5456
|
+
async function ci(t, n, r, i, a = {}, o, s, c = () => !1) {
|
|
5457
|
+
let l = a.width ?? ((e(t) ? t.offsetWidth : 0) || 960), u = l / r, d = Math.round(l), f = Math.round(i * u), p = a.dpr ?? _(), m = Ve(d * p, f * p), h = m.clamped ? p * m.scale : p, g = await An(n, d, f, u, h, a.imageResources, a.fetchImage, a.fetchMedia, s, a.tiff);
|
|
5458
|
+
t.width = m.width, t.height = m.height, e(t) && (t.style.width = `${d}px`, t.style.display || (t.style.display = "block"));
|
|
5459
|
+
let v = t.getContext("2d");
|
|
5460
|
+
if (!v) throw Error("Could not get 2D context");
|
|
5461
|
+
if (v.scale(h, h), n.parseError) return ai(v, d, f, n.slideNumber, n.parseError), t;
|
|
5462
|
+
let y = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", b = /* @__PURE__ */ new Map(), x = {
|
|
5463
|
+
themeMajorFont: a.majorFont ?? null,
|
|
5464
|
+
themeMinorFont: a.minorFont ?? null,
|
|
5465
|
+
themeHlinkColor: a.hlinkColor ?? null,
|
|
5466
|
+
embeddedFontAliases: a.embeddedFontAliases,
|
|
5467
|
+
embeddedFontAuthoredFamilies: a.embeddedFontAuthoredFamilies,
|
|
5468
5468
|
dpr: h,
|
|
5469
|
-
smartArtFallbackTextColor: yn(
|
|
5470
|
-
pictureBulletImages:
|
|
5469
|
+
smartArtFallbackTextColor: yn(n.background, y),
|
|
5470
|
+
pictureBulletImages: b
|
|
5471
5471
|
};
|
|
5472
|
-
if (await or(
|
|
5473
|
-
let
|
|
5474
|
-
for (let e of
|
|
5475
|
-
let t = e, n = t.mimeType === "image/svg+xml", r =
|
|
5472
|
+
if (await or(v, n.background, d, f, u, c, a.fetchImage, a.tiff, a.svgDecoder, g), c() || (a.math && await Ln(n, a.math), c())) return t;
|
|
5473
|
+
let S = n.slideNumber;
|
|
5474
|
+
for (let e of n.elements) if (e.type === "picture" && a.fetchImage) {
|
|
5475
|
+
let t = e, n = t.mimeType === "image/svg+xml", r = J(t) || n, i = !r && !t.duotone ? Dn(g, Z(On(t), t.duotone)) : void 0, o = En(X(t.width, u), X(t.height, u), h, t.srcRect), s = r ? o : i, c = s && "maxRetainedPixels" in s ? s.maxRetainedPixels : void 0, l = {
|
|
5476
5476
|
...s ? {
|
|
5477
5477
|
targetWidthPx: s.targetWidthPx,
|
|
5478
5478
|
targetHeightPx: s.targetHeightPx,
|
|
5479
5479
|
...c === void 0 ? {} : { maxRetainedPixels: c }
|
|
5480
5480
|
} : {},
|
|
5481
|
-
workerDecoder:
|
|
5481
|
+
workerDecoder: a.svgDecoder
|
|
5482
5482
|
};
|
|
5483
|
-
if (
|
|
5484
|
-
else if (n)
|
|
5483
|
+
if (J(t)) H(t.svgImagePath, a.fetchImage, l).catch(() => void 0);
|
|
5484
|
+
else if (n) H(t.imagePath, a.fetchImage, l).catch(() => void 0);
|
|
5485
5485
|
else {
|
|
5486
5486
|
let e = Ne(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5487
5487
|
if (!e) continue;
|
|
5488
|
-
Je(t.imagePath, t.mimeType, t.duotone,
|
|
5488
|
+
Je(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
|
|
5489
5489
|
widthPt: e.widthPt,
|
|
5490
5490
|
heightPt: e.heightPt,
|
|
5491
5491
|
...s ?? {},
|
|
5492
|
-
tiff:
|
|
5493
|
-
svgDecoder:
|
|
5492
|
+
tiff: a.tiff,
|
|
5493
|
+
svgDecoder: a.svgDecoder
|
|
5494
5494
|
}).catch(() => void 0);
|
|
5495
5495
|
}
|
|
5496
5496
|
} else if (e.type === "media") {
|
|
5497
5497
|
let t = e;
|
|
5498
|
-
t.posterPath &&
|
|
5498
|
+
t.posterPath && a.fetchMedia && Jr(t, a.fetchMedia, s, a.tiff, t.posterMimeType === "image/svg+xml" ? En(X(t.width, u), X(t.height, u), h) : Dn(g, Z(t.posterPath)), a.svgDecoder).catch(() => void 0);
|
|
5499
5499
|
}
|
|
5500
|
-
let
|
|
5501
|
-
if (
|
|
5502
|
-
let
|
|
5503
|
-
for (let e of
|
|
5500
|
+
let C = /* @__PURE__ */ new Map();
|
|
5501
|
+
if (a.fetchImage) {
|
|
5502
|
+
let e = a.fetchImage, r = /* @__PURE__ */ new Map(), i = [];
|
|
5503
|
+
for (let e of n.elements) {
|
|
5504
5504
|
if (e.type !== "chart" || !Number.isFinite(e.width) || e.width <= 0 || !Number.isFinite(e.height) || e.height <= 0) continue;
|
|
5505
5505
|
let t = {
|
|
5506
5506
|
widthPt: e.width / Y,
|
|
@@ -5519,16 +5519,16 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5519
5519
|
size: e
|
|
5520
5520
|
});
|
|
5521
5521
|
}
|
|
5522
|
-
r &&
|
|
5522
|
+
r && i.push({
|
|
5523
5523
|
element: e,
|
|
5524
5524
|
frame: t,
|
|
5525
5525
|
usages: n
|
|
5526
5526
|
});
|
|
5527
5527
|
}
|
|
5528
|
-
let
|
|
5529
|
-
for (let e of Me(
|
|
5528
|
+
let o = /* @__PURE__ */ new Map();
|
|
5529
|
+
for (let e of Me(i.map(({ element: e }) => e.chart), (e, t) => Ee(e, i[t].frame) != null)) {
|
|
5530
5530
|
let { fill: t } = e, n = Ie(t);
|
|
5531
|
-
|
|
5531
|
+
o.has(n) || o.set(n, {
|
|
5532
5532
|
fill: t,
|
|
5533
5533
|
widthPt: 0,
|
|
5534
5534
|
heightPt: 0,
|
|
@@ -5536,14 +5536,14 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5536
5536
|
hasSourceCrop: e.hasSourceCrop
|
|
5537
5537
|
});
|
|
5538
5538
|
}
|
|
5539
|
-
for (let { usages: e } of
|
|
5540
|
-
let { fill: e } = t, r = Ie(e), i =
|
|
5539
|
+
for (let { usages: e } of i) for (let { usage: t, size: n } of e) {
|
|
5540
|
+
let { fill: e } = t, r = Ie(e), i = o.get(r);
|
|
5541
5541
|
if (!i) continue;
|
|
5542
|
-
let a = i.preserveNaturalSize || t.preserveNaturalSize,
|
|
5542
|
+
let a = i.preserveNaturalSize || t.preserveNaturalSize, s = i.hasSourceCrop || t.hasSourceCrop, c = a || e.duotone ? void 0 : Dn(g, Z(e.imagePath, e.duotone)), l = !e.duotone && (e.mimeType === "image/svg+xml" || J({
|
|
5543
5543
|
svgImagePath: e.svgImagePath,
|
|
5544
|
-
srcRect:
|
|
5544
|
+
srcRect: s ? !0 : null
|
|
5545
5545
|
}));
|
|
5546
|
-
|
|
5546
|
+
o.set(r, {
|
|
5547
5547
|
...i,
|
|
5548
5548
|
widthPt: Math.max(i.widthPt, n.widthPt),
|
|
5549
5549
|
heightPt: Math.max(i.heightPt, n.heightPt),
|
|
@@ -5551,10 +5551,10 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5551
5551
|
targetHeightPx: a ? void 0 : c?.targetHeightPx ?? (l && Math.max(i.targetHeightPx ?? 0, n.targetHeightPx ?? 0) || void 0),
|
|
5552
5552
|
maxRetainedPixels: c?.maxRetainedPixels,
|
|
5553
5553
|
preserveNaturalSize: a,
|
|
5554
|
-
hasSourceCrop:
|
|
5554
|
+
hasSourceCrop: s
|
|
5555
5555
|
});
|
|
5556
5556
|
}
|
|
5557
|
-
for (let e of
|
|
5557
|
+
for (let e of n.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5558
5558
|
let n = Qe(t.bullet);
|
|
5559
5559
|
if (n.type === "blip") {
|
|
5560
5560
|
let i = Zn(e.textBody, t, n) * Y * u * h, a = r.get(n.imagePath);
|
|
@@ -5564,101 +5564,101 @@ async function ci(e, t, n, r, i = {}, o, s, c = () => !1) {
|
|
|
5564
5564
|
});
|
|
5565
5565
|
}
|
|
5566
5566
|
}
|
|
5567
|
-
if (r.size > 0 ||
|
|
5568
|
-
let
|
|
5567
|
+
if (r.size > 0 || o.size > 0) {
|
|
5568
|
+
let n = [...r].map(async ([t, { mimeType: n, targetHeightPx: r }]) => {
|
|
5569
5569
|
try {
|
|
5570
|
-
let
|
|
5570
|
+
let i = n === "image/svg+xml" ? r === void 0 ? {} : {
|
|
5571
5571
|
targetWidthPx: 1,
|
|
5572
5572
|
targetHeightPx: r
|
|
5573
|
-
} : Dn(g, Z(
|
|
5574
|
-
...
|
|
5575
|
-
workerDecoder:
|
|
5576
|
-
}) : await
|
|
5577
|
-
tiff:
|
|
5578
|
-
...
|
|
5573
|
+
} : Dn(g, Z(t)) ?? {}, o = n === "image/svg+xml" ? await H(t, e, {
|
|
5574
|
+
...i,
|
|
5575
|
+
workerDecoder: a.svgDecoder
|
|
5576
|
+
}) : await P(t, n, e, {
|
|
5577
|
+
tiff: a.tiff,
|
|
5578
|
+
...i
|
|
5579
5579
|
});
|
|
5580
|
-
|
|
5581
|
-
} catch (
|
|
5582
|
-
if (
|
|
5583
|
-
|
|
5580
|
+
b.set(t, o);
|
|
5581
|
+
} catch (e) {
|
|
5582
|
+
if (ue(e, "tiff")) {
|
|
5583
|
+
b.set(t, null);
|
|
5584
5584
|
return;
|
|
5585
5585
|
}
|
|
5586
|
-
if (Le(
|
|
5587
|
-
|
|
5586
|
+
if (Le(e) || qe(e)) throw e;
|
|
5587
|
+
b.set(t, null);
|
|
5588
5588
|
}
|
|
5589
|
-
}),
|
|
5590
|
-
let { fill: r, widthPt:
|
|
5591
|
-
targetWidthPx:
|
|
5592
|
-
targetHeightPx:
|
|
5593
|
-
...
|
|
5589
|
+
}), i = [...o].map(async ([t, n]) => {
|
|
5590
|
+
let { fill: r, widthPt: i, heightPt: o, targetWidthPx: s, targetHeightPx: c, maxRetainedPixels: l, hasSourceCrop: u } = n, d = s && c ? {
|
|
5591
|
+
targetWidthPx: s,
|
|
5592
|
+
targetHeightPx: c,
|
|
5593
|
+
...l === void 0 ? {} : { maxRetainedPixels: l }
|
|
5594
5594
|
} : void 0;
|
|
5595
5595
|
try {
|
|
5596
|
-
let
|
|
5597
|
-
...
|
|
5598
|
-
workerDecoder:
|
|
5599
|
-
}) : Je(r.imagePath, r.mimeType, r.duotone,
|
|
5600
|
-
widthPt:
|
|
5601
|
-
heightPt:
|
|
5602
|
-
...
|
|
5596
|
+
let n = () => r.mimeType === "image/svg+xml" ? r.duotone ? Promise.resolve(null) : H(r.imagePath, e, {
|
|
5597
|
+
...d ?? {},
|
|
5598
|
+
workerDecoder: a.svgDecoder
|
|
5599
|
+
}) : Je(r.imagePath, r.mimeType, r.duotone, e, {
|
|
5600
|
+
widthPt: i,
|
|
5601
|
+
heightPt: o,
|
|
5602
|
+
...d ?? {},
|
|
5603
5603
|
failClosedOnDuotoneFailure: !0,
|
|
5604
|
-
tiff:
|
|
5605
|
-
}),
|
|
5604
|
+
tiff: a.tiff
|
|
5605
|
+
}), s, c = {
|
|
5606
5606
|
svgImagePath: r.svgImagePath,
|
|
5607
|
-
srcRect:
|
|
5607
|
+
srcRect: u ? !0 : null
|
|
5608
5608
|
};
|
|
5609
|
-
if (!r.duotone &&
|
|
5610
|
-
|
|
5611
|
-
...
|
|
5612
|
-
workerDecoder:
|
|
5609
|
+
if (!r.duotone && J(c)) try {
|
|
5610
|
+
s = await H(c.svgImagePath, e, {
|
|
5611
|
+
...d ?? {},
|
|
5612
|
+
workerDecoder: a.svgDecoder
|
|
5613
5613
|
});
|
|
5614
5614
|
} catch {
|
|
5615
|
-
|
|
5615
|
+
s = await n();
|
|
5616
5616
|
}
|
|
5617
|
-
else
|
|
5618
|
-
|
|
5619
|
-
} catch (
|
|
5620
|
-
if (
|
|
5621
|
-
|
|
5617
|
+
else s = await n();
|
|
5618
|
+
C.set(t, s);
|
|
5619
|
+
} catch (e) {
|
|
5620
|
+
if (ue(e, "tiff")) {
|
|
5621
|
+
C.set(t, null);
|
|
5622
5622
|
return;
|
|
5623
5623
|
}
|
|
5624
|
-
if (Le(
|
|
5625
|
-
|
|
5624
|
+
if (Le(e) || qe(e)) throw e;
|
|
5625
|
+
C.set(t, null);
|
|
5626
5626
|
}
|
|
5627
5627
|
});
|
|
5628
|
-
if (await Promise.all([...
|
|
5628
|
+
if (await Promise.all([...n, ...i]), c()) return t;
|
|
5629
5629
|
}
|
|
5630
5630
|
}
|
|
5631
|
-
for (let [
|
|
5632
|
-
if (c()) return
|
|
5633
|
-
if (r.type === "shape") Fr(
|
|
5634
|
-
...
|
|
5635
|
-
elementIndex:
|
|
5636
|
-
origin:
|
|
5637
|
-
}) : void 0,
|
|
5638
|
-
else if (r.type === "picture") await Xr(
|
|
5639
|
-
else if (r.type === "table") ti(
|
|
5640
|
-
...
|
|
5641
|
-
elementIndex:
|
|
5642
|
-
origin:
|
|
5631
|
+
for (let [e, r] of n.elements.entries()) {
|
|
5632
|
+
if (c()) return t;
|
|
5633
|
+
if (r.type === "shape") Fr(v, r, u, y, S, x, o ? (t) => o({
|
|
5634
|
+
...t,
|
|
5635
|
+
elementIndex: e,
|
|
5636
|
+
origin: n.elementSources?.[e]?.origin ?? "slide"
|
|
5637
|
+
}) : void 0, a.fetchImage);
|
|
5638
|
+
else if (r.type === "picture") await Xr(v, r, u, c, a.fetchImage, a.tiff, h, a.svgDecoder, g);
|
|
5639
|
+
else if (r.type === "table") ti(v, r, u, S, x, o ? (t) => o({
|
|
5640
|
+
...t,
|
|
5641
|
+
elementIndex: e,
|
|
5642
|
+
origin: n.elementSources?.[e]?.origin ?? "slide"
|
|
5643
5643
|
}) : void 0);
|
|
5644
|
-
else if (r.type === "media") await Zr(
|
|
5644
|
+
else if (r.type === "media") await Zr(v, r, u, c, a.fetchMedia, a.skipMediaControls, a.fetchImage, a.tiff, h, a.svgDecoder, g);
|
|
5645
5645
|
else if (r.type === "chart") {
|
|
5646
5646
|
let e = Y * u;
|
|
5647
|
-
|
|
5647
|
+
v.save(), ei(v, r, u), Ke(v, r.chart, {
|
|
5648
5648
|
x: X(r.x, u),
|
|
5649
5649
|
y: X(r.y, u),
|
|
5650
5650
|
w: X(r.width, u),
|
|
5651
5651
|
h: X(r.height, u)
|
|
5652
|
-
}, e, r.rotation,
|
|
5652
|
+
}, e, r.rotation, a.threeD, a.regionMap, (e) => C.get(Ie(e)), a.chartEx), v.restore();
|
|
5653
5653
|
}
|
|
5654
5654
|
}
|
|
5655
|
-
return c() ||
|
|
5655
|
+
return c() || a.dim && ni(v, a.dim, d, f), t;
|
|
5656
5656
|
}
|
|
5657
5657
|
//#endregion
|
|
5658
5658
|
//#region packages/pptx/src/google-fonts.ts
|
|
5659
5659
|
var li = {
|
|
5660
|
-
...
|
|
5661
|
-
...
|
|
5660
|
+
...S,
|
|
5661
|
+
...c
|
|
5662
5662
|
};
|
|
5663
5663
|
function* ui(e) {
|
|
5664
5664
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
@@ -5683,8 +5683,8 @@ var pi = class e {
|
|
|
5683
5683
|
families;
|
|
5684
5684
|
constructor(e, t, n, r) {
|
|
5685
5685
|
this.majorFont = e, this.minorFont = t;
|
|
5686
|
-
let i =
|
|
5687
|
-
this.scripts = n ?? new
|
|
5686
|
+
let i = fe(e) ?? fe(t) ?? null;
|
|
5687
|
+
this.scripts = n ?? new d(i), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
|
|
5688
5688
|
}
|
|
5689
5689
|
addSlide(e) {
|
|
5690
5690
|
this.scripts.addText(fi(e));
|
|
@@ -5703,7 +5703,7 @@ var pi = class e {
|
|
|
5703
5703
|
declaredInflatedBytes: 0,
|
|
5704
5704
|
distinctInflatedBytes: 0,
|
|
5705
5705
|
operationInflatedBytes: 0
|
|
5706
|
-
}), hi =
|
|
5706
|
+
}), hi = l;
|
|
5707
5707
|
function gi(e, t) {
|
|
5708
5708
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5709
5709
|
}
|
|
@@ -5945,7 +5945,7 @@ function Ni(e, t) {
|
|
|
5945
5945
|
});
|
|
5946
5946
|
}
|
|
5947
5947
|
function Pi(e, t, n) {
|
|
5948
|
-
if (!(e <= t)) throw new
|
|
5948
|
+
if (!(e <= t)) throw new ne(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
|
|
5949
5949
|
stage: "parsing",
|
|
5950
5950
|
violation: {
|
|
5951
5951
|
format: "pptx",
|
|
@@ -6100,9 +6100,9 @@ var Fi = class {
|
|
|
6100
6100
|
sessionId: r,
|
|
6101
6101
|
operationId: r,
|
|
6102
6102
|
generation: this.options.generation ?? 1
|
|
6103
|
-
}, a = new
|
|
6103
|
+
}, a = new L(this.options.transport, {
|
|
6104
6104
|
...i,
|
|
6105
|
-
maxByteCredit:
|
|
6105
|
+
maxByteCredit: w,
|
|
6106
6106
|
timeoutMs: n
|
|
6107
6107
|
});
|
|
6108
6108
|
this.active.add(a);
|
|
@@ -6144,7 +6144,7 @@ async function zi(e) {
|
|
|
6144
6144
|
}
|
|
6145
6145
|
}
|
|
6146
6146
|
function Bi(e) {
|
|
6147
|
-
return
|
|
6147
|
+
return u(e, Ii, w);
|
|
6148
6148
|
}
|
|
6149
6149
|
//#endregion
|
|
6150
6150
|
export { yi as a, li as c, si as d, an as f, Mi as i, ii as l, Ri as n, Ai as o, Fi as r, ji as s, Li as t, oi as u };
|