@silurus/ooxml 0.89.10 → 0.89.12
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/dist/assets/{render-worker-jGsxSIGb.js → render-worker-BD7EhV2y.js} +17 -17
- package/dist/assets/render-worker-BiKxVVB1.js +16 -0
- package/dist/assets/{render-worker-Coh33rbW.js → render-worker-CVqXtEMW.js} +13 -13
- package/dist/{bounded-raw-part-cache-B5a6cGKO.js → bounded-raw-part-cache-D2Q0FIoE.js} +719 -663
- package/dist/{canvas-viewer-mechanics-BsqaoYgK.js → canvas-viewer-mechanics-_ZBxW_sN.js} +1 -1
- package/dist/{comment-overlay-controller-b3tKmzMa.js → comment-overlay-controller-CVvQCYhQ.js} +8 -8
- package/dist/{comment-ui-runtime-Bp37ytDC.js → comment-ui-runtime-CYkt_9-b.js} +2 -2
- package/dist/{comment-ui-runtime-BkpFlPT0.js → comment-ui-runtime-DhTTGSay.js} +3 -3
- package/dist/{document-model-source-Ca2fk_Fc.js → document-model-source-C6wGN8m3.js} +45 -45
- package/dist/{document-pull-client-CTGM4i1m.js → document-pull-client-BfGXPuQc.js} +4117 -4128
- package/dist/{document-pull-worker-hMKJ5RdB.js → document-pull-worker-Bl3wlLXC.js} +4 -4
- package/dist/{docx-B-47Ff78.js → docx-CNscQaT8.js} +496 -496
- package/dist/{docx-DwdB7I59.js → docx-Cry-eklK.js} +7 -7
- package/dist/{docx-model-source-CWuvf9jk.js → docx-model-source-Cj8DGdLl.js} +6 -6
- package/dist/docx.mjs +3 -3
- package/dist/{drawingml-shape-B1_kg4BV.js → drawingml-shape-CFzAXuvj.js} +88 -116
- package/dist/{font-preload-demand-NqcVKIpX.js → font-preload-demand-DhFVOxz4.js} +1 -1
- package/dist/{host-layout-measure-IFLllYwV.js → host-layout-measure-CWKDrVpo.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-CwtditQo.js → line-distribute-DxnuaRdO.js} +24 -24
- package/dist/{model-source-Cch44xsb.js → model-source-DksDDVb4.js} +1 -1
- package/dist/{model-source-session-DRcqFGfM.js → model-source-session-8wqlNxsQ.js} +2 -2
- package/dist/{model-source-session-ClNCRDOg.js → model-source-session-BogYRDwj.js} +2 -2
- package/dist/{model-source-session-DSABX94B.js → model-source-session-ifwyPPhZ.js} +2 -2
- package/dist/node.mjs +4 -4
- package/dist/{pptx-DbjWegUB.js → pptx-Bons7t3Y.js} +26 -26
- package/dist/{pptx-C1CiFW1D.js → pptx-CQtPbMxI.js} +10 -10
- package/dist/{pptx-model-source-C9TuBisH.js → pptx-model-source-mg-O0LR9.js} +5 -5
- package/dist/pptx.mjs +4 -4
- package/dist/{presentation-model-source-DLNioq7T.js → presentation-model-source-CK6_hY1W.js} +5 -5
- package/dist/{render-Bf_Gywxw.js → render-C7F07FrC.js} +2 -2
- package/dist/{render-worker-host-80mSndWp.js → render-worker-host-Cj-U3WPe.js} +1 -1
- package/dist/{render-worker-host-CVr53kg0.js → render-worker-host-D7L6GMbE.js} +1 -1
- package/dist/{render-worker-host-pKls3F_t.js → render-worker-host-stI5Lppz.js} +1 -1
- package/dist/{renderer-DuYC3xXi.js → renderer-N76SnQW7.js} +1286 -1212
- package/dist/{resource-measurement-CfJtbwiR.js → resource-measurement-B2hzmYlu.js} +90 -90
- package/dist/{session-DPXK_lpI.js → session-D5au4i-W.js} +166 -166
- package/dist/{slide-pull-client-3g6TxaKa.js → slide-pull-client-3mJmNjjB.js} +854 -904
- package/dist/{wasm-runtime-generation-D97yoAXz.js → wasm-runtime-generation--_2SjW2G.js} +1 -1
- package/dist/{workbook-model-source-D1dmkDMP.js → workbook-model-source-CI1q6nxK.js} +6 -6
- package/dist/{worksheet-pull-client-BudfclVl.js → worksheet-pull-client-C2h4AMwt.js} +18 -18
- package/dist/{xlsx-DBhYlJKp.js → xlsx-CKXeKvxl.js} +452 -452
- package/dist/{xlsx-DA0uR1B1.js → xlsx-DujIp7CR.js} +4 -4
- package/dist/{xlsx-model-source-zemVDAfl.js → xlsx-model-source-fs0svOUo.js} +6 -6
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-Ck21oePL.js +0 -16
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Ao as e, Co as t, Do as n, Dr as r, Fa as i, Fo as a, Fr as o, Gn as s, Hn as c, Io as l, Ir as u, Jn as d, Kn as f, No as p, Oo as m, Pa as h, Pr as g, So as _, Tr as v, Un as y, Vn as b, Vr as x, Wn as S, Yn as C, _o as w, a as T, ai as E, ar as D, bo as O, c as k, cr as A, d as j, do as M, fo as N, fr as P, go as F, gr as I, h as L, ho as R, i as z, ii as B, jo as V, ko as H, lr as U, m as W, mo as G, mr as ee, ni as te, nr as K, o as ne, oi as q, or as re, po as ie, pr as ae, qn as oe, r as se, ri as ce, u as le, uo as ue, ur as de, vo as fe, wo as J, wr as pe, xo as me, xr as he, yo as ge } from "./plot-area-frame-DNYMd9Pf.js";
|
|
2
|
-
import { $ as _e,
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as
|
|
5
|
-
import { H as
|
|
6
|
-
import { i as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { a as
|
|
9
|
-
import { _ as
|
|
10
|
-
function
|
|
2
|
+
import { $ as _e, Bt as ve, Ct as ye, Dt as be, Ht as xe, It as Se, Lt as Ce, Mt as we, Nt as Te, Ot as Ee, Pt as De, Q as Oe, Qt as ke, Rt as Ae, S as je, St as Me, Tt as Ne, Vt as Pe, Xt as Fe, Z as Ie, Zt as Le, a as Re, at as ze, b as Be, bn as Ve, bt as He, cn as Ue, d as We, et as Ge, f as Ke, g as qe, gt as Je, h as Ye, ht as Xe, in as Ze, it as Qe, jt as $e, k as et, kt as tt, l as nt, mn as rt, nt as it, pt as at, rt as ot, s as st, tt as ct, ut as lt, v as ut, wt as dt, x as ft, xn as pt, xt as mt, y as ht, yt as gt, zt as _t } from "./bounded-raw-part-cache-D2Q0FIoE.js";
|
|
3
|
+
import { a as vt, c as yt, d as bt, f as xt, h as St, m as Ct, o as wt, p as Tt, r as Et, s as Dt, t as Ot, u as kt, y as At } from "./line-distribute-DxnuaRdO.js";
|
|
4
|
+
import { a as jt, f as Mt, i as Nt, u as Pt } from "./pixel-budget-DI82Hn3R.js";
|
|
5
|
+
import { H as Ft, L as It, M as Lt, R as Rt, V as zt, n as Bt, r as Vt, t as Ht } from "./renderer-DpTePxGq.js";
|
|
6
|
+
import { i as Ut } from "./tiff-contract-DEd8CGuz.js";
|
|
7
|
+
import { _ as Wt, g as Gt, h as Kt } from "./three-d-BfMZVR0w.js";
|
|
8
|
+
import { a as qt, o as Jt } from "./duotone-GK4Hqn7f.js";
|
|
9
|
+
import { _ as Yt, a as Xt, c as Zt, d as Qt, f as $t, h as en, i as tn, l as nn, m as rn, n as an, o as on, p as sn, s as cn, t as ln, u as un, v as dn, y as fn } from "./resource-measurement-B2hzmYlu.js";
|
|
10
|
+
function pn(e, t, n) {
|
|
11
11
|
let r = typeof e.getTransform == "function" ? e.getTransform() : {
|
|
12
12
|
a: 1,
|
|
13
13
|
b: 0,
|
|
@@ -42,11 +42,11 @@ function un(e, t, n) {
|
|
|
42
42
|
let f = d - u;
|
|
43
43
|
Number.isFinite(f) && (e.beginPath(), e.rect(t, u, n, f), e.clip());
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function mn(e, t) {
|
|
46
46
|
let n = e.fieldType === "slidenum" && t !== void 0 ? String(t) : e.text;
|
|
47
47
|
return e.caps === "all" || e.caps === "small" ? n.toUpperCase() : n;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function hn(e, t) {
|
|
50
50
|
let n = ce(e, 1, 1)?.getContext("2d");
|
|
51
51
|
if (!n) return;
|
|
52
52
|
let r = { paths: [] }, i = Infinity, a = Infinity, o = -Infinity, s = -Infinity, c = (e) => {
|
|
@@ -130,7 +130,7 @@ function fn(e, t) {
|
|
|
130
130
|
h: s - a
|
|
131
131
|
} : void 0;
|
|
132
132
|
}
|
|
133
|
-
var
|
|
133
|
+
var gn = 6.28, _n = 26;
|
|
134
134
|
function Y(e = 0, t = 0, n = 0, r = 0, i = 0) {
|
|
135
135
|
return {
|
|
136
136
|
kind: "orthographic",
|
|
@@ -149,12 +149,12 @@ function X(e, t, n, r = 45) {
|
|
|
149
149
|
baseLon: t,
|
|
150
150
|
baseRev: n,
|
|
151
151
|
fovDeg: r,
|
|
152
|
-
sceneInches:
|
|
152
|
+
sceneInches: gn,
|
|
153
153
|
shearX: 0,
|
|
154
154
|
shearY: 0
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
var
|
|
157
|
+
var vn = {
|
|
158
158
|
isometricBottomDown: Y(35.4, 314.7, 299.8),
|
|
159
159
|
isometricBottomUp: Y(35.4, 45.3, 60.2),
|
|
160
160
|
isometricLeftDown: Y(35, 45, 0),
|
|
@@ -199,11 +199,11 @@ var hn = {
|
|
|
199
199
|
perspectiveRelaxed: X(309.6, 0, 0),
|
|
200
200
|
perspectiveRelaxedModerately: X(324.8, 0, 0),
|
|
201
201
|
perspectiveRight: X(0, 340, 0)
|
|
202
|
-
},
|
|
203
|
-
...X(0, 0, 0,
|
|
202
|
+
}, yn = {
|
|
203
|
+
...X(0, 0, 0, _n),
|
|
204
204
|
sceneInches: void 0
|
|
205
205
|
};
|
|
206
|
-
function
|
|
206
|
+
function bn(e, t) {
|
|
207
207
|
let n = Array(9).fill(0);
|
|
208
208
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
209
209
|
let a = 0;
|
|
@@ -212,7 +212,7 @@ function _n(e, t) {
|
|
|
212
212
|
}
|
|
213
213
|
return n;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function xn(e) {
|
|
216
216
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
217
217
|
return [
|
|
218
218
|
1,
|
|
@@ -226,7 +226,7 @@ function vn(e) {
|
|
|
226
226
|
n
|
|
227
227
|
];
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Sn(e) {
|
|
230
230
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
231
231
|
return [
|
|
232
232
|
n,
|
|
@@ -240,7 +240,7 @@ function yn(e) {
|
|
|
240
240
|
n
|
|
241
241
|
];
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Cn(e) {
|
|
244
244
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
245
245
|
return [
|
|
246
246
|
n,
|
|
@@ -254,26 +254,26 @@ function bn(e) {
|
|
|
254
254
|
1
|
|
255
255
|
];
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function wn(e, t, n, r) {
|
|
258
258
|
return [
|
|
259
259
|
e[0] * t + e[1] * n + e[2] * r,
|
|
260
260
|
e[3] * t + e[4] * n + e[5] * r,
|
|
261
261
|
e[6] * t + e[7] * n + e[8] * r
|
|
262
262
|
];
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Tn(e, t) {
|
|
265
265
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
266
|
-
return
|
|
266
|
+
return bn(Cn(-(t ? t.rev : e.baseRev)), bn(xn(-n), Sn(-r)));
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return l(
|
|
268
|
+
function En(e) {
|
|
269
|
+
return l(vn, e) || (e.startsWith("perspective") ? yn : vn.orthographicFront);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Dn(e, t, n, r, i, a) {
|
|
272
272
|
let o = e.fov ?? t.fovDeg, s = Math.max(1, Math.min(179, o)) * Math.PI / 180, c = (t.sceneInches === void 0 ? Math.max(r, i) / 2 : t.sceneInches * (e.unitsPerInch ?? 96)) / Math.tan(s / 2), l = Math.max(0, e.sceneDepth ?? 0, a), u = Math.abs(n[6]) * r / 2 + Math.abs(n[7]) * i / 2, d = -n[8] * l, f = u + Math.max(0, d), p = 2 * u + Math.abs(d);
|
|
273
273
|
return Math.max(c, f + .02 * p);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
let i =
|
|
275
|
+
function On(e, t, n, r = 0) {
|
|
276
|
+
let i = En(e.prst), a = Tn(i, e.rot);
|
|
277
277
|
if (t <= 0 || n <= 0) return {
|
|
278
278
|
corners: [
|
|
279
279
|
{
|
|
@@ -303,13 +303,13 @@ function Tn(e, t, n, r = 0) {
|
|
|
303
303
|
[-o, s]
|
|
304
304
|
], l = e.zoom ?? 1, u;
|
|
305
305
|
if (i.kind === "perspective") {
|
|
306
|
-
let o =
|
|
306
|
+
let o = Dn(e, i, a, t, n, r);
|
|
307
307
|
u = c.map(([e, t]) => {
|
|
308
|
-
let [n, i, s] =
|
|
308
|
+
let [n, i, s] = wn(a, e, t, -r), c = o / (o - s);
|
|
309
309
|
return [n * c, i * c];
|
|
310
310
|
});
|
|
311
311
|
} else u = c.map(([e, t]) => {
|
|
312
|
-
let [n, o, s] =
|
|
312
|
+
let [n, o, s] = wn(a, e, t, -r);
|
|
313
313
|
return [n + s * i.shearX, o + s * i.shearY];
|
|
314
314
|
});
|
|
315
315
|
u = u.map(([e, t]) => [e * l, t * l]);
|
|
@@ -332,20 +332,20 @@ function Tn(e, t, n, r = 0) {
|
|
|
332
332
|
isIdentity: _
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function kn(e, t, n, r = 0) {
|
|
336
336
|
if (t !== void 0 && n !== void 0) {
|
|
337
337
|
if (t <= 0 || n <= 0) return !1;
|
|
338
338
|
if (e = {
|
|
339
339
|
...e,
|
|
340
340
|
sceneDepth: Math.max(e.sceneDepth ?? 0, r)
|
|
341
|
-
}, !
|
|
341
|
+
}, !On(e, t, n).isIdentity) return !0;
|
|
342
342
|
if (r <= 0) return !1;
|
|
343
|
-
let i =
|
|
344
|
-
if (
|
|
343
|
+
let i = On(e, t, n, r);
|
|
344
|
+
if (En(e.prst).sceneInches === void 0) return !i.isIdentity;
|
|
345
345
|
let a = .001 * Math.max(t, n);
|
|
346
346
|
return i.corners.some((e) => e.x < -a || e.y < -a || e.x > t + a || e.y > n + a);
|
|
347
347
|
}
|
|
348
|
-
let i =
|
|
348
|
+
let i = En(e.prst), a = Tn(i, e.rot), o = i.kind === "perspective" ? [
|
|
349
349
|
a[0] - 1,
|
|
350
350
|
a[1],
|
|
351
351
|
a[3],
|
|
@@ -364,21 +364,21 @@ function En(e, t, n, r = 0) {
|
|
|
364
364
|
}
|
|
365
365
|
return (e.zoom ?? 1) !== 1 || o.some((e) => Math.abs(e) > 1e-12);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
let t =
|
|
367
|
+
function An(e) {
|
|
368
|
+
let t = En(e.prst), n = Tn(t, e.rot);
|
|
369
369
|
return {
|
|
370
370
|
rotation: n,
|
|
371
371
|
backFacing: n[8] - t.shearX * n[2] - t.shearY * n[5] < 0
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
let i =
|
|
374
|
+
function jn(e, t, n, r) {
|
|
375
|
+
let i = En(e.prst), a = Tn(i, e.rot);
|
|
376
376
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
377
377
|
x: 0,
|
|
378
378
|
y: 0
|
|
379
379
|
};
|
|
380
|
-
let o = e.zoom ?? 1, s = i.kind === "perspective" ?
|
|
381
|
-
let [t, n, r] =
|
|
380
|
+
let o = e.zoom ?? 1, s = i.kind === "perspective" ? Dn(e, i, a, t, n, r) : 0, c = (e) => {
|
|
381
|
+
let [t, n, r] = wn(a, 0, 0, e);
|
|
382
382
|
if (i.kind === "perspective") {
|
|
383
383
|
let e = s / (s - r);
|
|
384
384
|
return [t * e * o, n * e * o];
|
|
@@ -390,7 +390,7 @@ function On(e, t, n, r) {
|
|
|
390
390
|
y: f - u
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
var
|
|
393
|
+
var Mn = {
|
|
394
394
|
angle: [[1, 1]],
|
|
395
395
|
artDeco: [[
|
|
396
396
|
0,
|
|
@@ -668,8 +668,8 @@ var kn = {
|
|
|
668
668
|
1,
|
|
669
669
|
.33333
|
|
670
670
|
]]
|
|
671
|
-
},
|
|
672
|
-
function
|
|
671
|
+
}, Nn = 1024;
|
|
672
|
+
function Pn(e) {
|
|
673
673
|
let t = new Float64Array(1025).fill(-Infinity), n = new Float64Array(1025), r = [0], i = [0], a = 0, o = 0;
|
|
674
674
|
for (let t of e) {
|
|
675
675
|
let e = t.length / 2;
|
|
@@ -683,31 +683,31 @@ function jn(e) {
|
|
|
683
683
|
for (let e = 1; e < r.length; e++) {
|
|
684
684
|
let a = r[e - 1], o = r[e], c = i[e - 1] / s, l = o - a, u = i[e] / s - c;
|
|
685
685
|
if (l === 0) continue;
|
|
686
|
-
let d = Math.max(0, Math.ceil(Math.min(a, o) *
|
|
686
|
+
let d = Math.max(0, Math.ceil(Math.min(a, o) * Nn)), f = Math.min(Nn, Math.floor(Math.max(a, o) * Nn));
|
|
687
687
|
for (let e = d; e <= f; e++) {
|
|
688
|
-
let r = c + (e /
|
|
688
|
+
let r = c + (e / Nn - a) * u / l;
|
|
689
689
|
r > t[e] && (t[e] = r, n[e] = u / l);
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
|
-
for (let e = 0; e <=
|
|
692
|
+
for (let e = 0; e <= Nn; e++) e / Nn >= a && (t[e] = o / s, n[e] = 0);
|
|
693
693
|
return {
|
|
694
694
|
height: t,
|
|
695
695
|
slope: n
|
|
696
696
|
};
|
|
697
697
|
}
|
|
698
|
-
var
|
|
699
|
-
function
|
|
700
|
-
let t = Object.hasOwn(
|
|
701
|
-
return n === void 0 && (n =
|
|
698
|
+
var Fn = /* @__PURE__ */ new Map();
|
|
699
|
+
function In(e) {
|
|
700
|
+
let t = Object.hasOwn(Mn, e) ? e : "circle", n = Fn.get(t);
|
|
701
|
+
return n === void 0 && (n = Pn(Mn[t]), Fn.set(t, n)), n;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
let n = Math.max(0, Math.min(1, t)) *
|
|
703
|
+
function Ln(e, t) {
|
|
704
|
+
let n = Math.max(0, Math.min(1, t)) * Nn, r = Math.min(Nn - 1, Math.floor(n));
|
|
705
705
|
return e[r] + (e[r + 1] - e[r]) * (n - r);
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
707
|
+
function Rn(e, t) {
|
|
708
|
+
return Ln(In(e).slope, t);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function zn(e, t, n, r, i, a, o, s) {
|
|
711
711
|
let c = e.slice(), l = new Int8Array(r * i);
|
|
712
712
|
for (let t = 0; t < i; t++) for (let a = 0; a < r; a++) {
|
|
713
713
|
let o = t * r + a, s = (a + 1 < r ? n[o + 1] : 0) - (a > 0 ? n[o - 1] : 0), c = (t + 1 < i ? n[o + r] : 0) - (t > 0 ? n[o - r] : 0);
|
|
@@ -734,7 +734,7 @@ function In(e, t, n, r, i, a, o, s) {
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
var
|
|
737
|
+
var Bn = {
|
|
738
738
|
threePt: {
|
|
739
739
|
ambient: 0,
|
|
740
740
|
lights: [
|
|
@@ -1516,7 +1516,7 @@ var Ln = {
|
|
|
1516
1516
|
}
|
|
1517
1517
|
]
|
|
1518
1518
|
}
|
|
1519
|
-
},
|
|
1519
|
+
}, Vn = a();
|
|
1520
1520
|
for (let [e, t, n, r, i, a] of [
|
|
1521
1521
|
[
|
|
1522
1522
|
"Flat",
|
|
@@ -1560,7 +1560,7 @@ for (let [e, t, n, r, i, a] of [
|
|
|
1560
1560
|
1,
|
|
1561
1561
|
-.2
|
|
1562
1562
|
];
|
|
1563
|
-
|
|
1563
|
+
Vn[`legacy${e}${o}`] = {
|
|
1564
1564
|
ambient: r,
|
|
1565
1565
|
lights: [{
|
|
1566
1566
|
rgb: [
|
|
@@ -1587,10 +1587,10 @@ for (let [e, t, n, r, i, a] of [
|
|
|
1587
1587
|
}]
|
|
1588
1588
|
};
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1591
|
-
return Object.hasOwn(
|
|
1590
|
+
function Hn(e) {
|
|
1591
|
+
return Object.hasOwn(Bn, e) ? Bn[e] : Object.hasOwn(Vn, e) ? Vn[e] : Bn.threePt;
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function Un(e, t, n, r, i, a = !1, o = 0, s = 0, c = 1, l = c, u = 0) {
|
|
1594
1594
|
return {
|
|
1595
1595
|
specularShape: e,
|
|
1596
1596
|
specularWhite: t,
|
|
@@ -1605,27 +1605,27 @@ function Bn(e, t, n, r, i, a = !1, o = 0, s = 0, c = 1, l = c, u = 0) {
|
|
|
1605
1605
|
emissive: u
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
|
-
var
|
|
1609
|
-
legacyMatte:
|
|
1610
|
-
legacyPlastic:
|
|
1611
|
-
legacyMetal:
|
|
1612
|
-
legacyWireframe:
|
|
1613
|
-
matte:
|
|
1614
|
-
plastic:
|
|
1615
|
-
metal:
|
|
1616
|
-
warmMatte:
|
|
1617
|
-
translucentPowder:
|
|
1618
|
-
powder:
|
|
1619
|
-
dkEdge:
|
|
1620
|
-
softEdge:
|
|
1621
|
-
clear:
|
|
1622
|
-
flat:
|
|
1623
|
-
softmetal:
|
|
1608
|
+
var Wn = {
|
|
1609
|
+
legacyMatte: Un(0, 0, 1, 0, 0, !0),
|
|
1610
|
+
legacyPlastic: Un(0, 1, 1, 0, 32, !0),
|
|
1611
|
+
legacyMetal: Un(1, 0, 2 / 3, 0, 32, !0),
|
|
1612
|
+
legacyWireframe: Un(0, 0, 0, 0, 0),
|
|
1613
|
+
matte: Un(0, 0, 1, 0, 0),
|
|
1614
|
+
plastic: Un(0, .6, 1, 0, 12),
|
|
1615
|
+
metal: Un(-.32, 1.32, 1, 0, 12, !1, 4),
|
|
1616
|
+
warmMatte: Un(0, .3, 1, 0, 8),
|
|
1617
|
+
translucentPowder: Un(0, .3, 1, 0, 10, !0, 2, -1, .7),
|
|
1618
|
+
powder: Un(0, .3, .5, .5, 10, !0, 2),
|
|
1619
|
+
dkEdge: Un(0, 1, 1, 0, 35, !1, -2),
|
|
1620
|
+
softEdge: Un(0, 1, 1, 0, 35, !1, 4, -10),
|
|
1621
|
+
clear: Un(0, .6, 1, 0, 20, !1, -8, 1, .1, 1),
|
|
1622
|
+
flat: Un(0, .8, 0, 0, 50, !1, -4, 0, 1, 1, 1),
|
|
1623
|
+
softmetal: Un(.5, .5, 1, 0, 8)
|
|
1624
1624
|
};
|
|
1625
|
-
function
|
|
1626
|
-
return e && Object.hasOwn(
|
|
1625
|
+
function Gn(e) {
|
|
1626
|
+
return e && Object.hasOwn(Wn, e) ? e : "matte";
|
|
1627
1627
|
}
|
|
1628
|
-
var
|
|
1628
|
+
var Kn = {
|
|
1629
1629
|
t: 0,
|
|
1630
1630
|
tr: 45,
|
|
1631
1631
|
r: 90,
|
|
@@ -1635,8 +1635,8 @@ var Un = {
|
|
|
1635
1635
|
l: 270,
|
|
1636
1636
|
tl: 315
|
|
1637
1637
|
};
|
|
1638
|
-
function
|
|
1639
|
-
let r =
|
|
1638
|
+
function qn(e, t, n) {
|
|
1639
|
+
let r = Hn(e), i = Math.PI / 180, a = (n?.lat ?? 0) * i, o = (n?.lon ?? 0) * i, s = (n ? n.rev : Object.hasOwn(Kn, t) ? Kn[t] : 0) * i, c = Math.cos(a), l = Math.sin(a), u = Math.cos(o), d = Math.sin(o), f = Math.cos(s), p = Math.sin(s), m = r.lights.map((e) => {
|
|
1640
1640
|
let [t, n, r] = e.direction, i = Math.hypot(t, n, r) || 1, a = n / i, o = t / i, s = -r / i, m = f * a - p * o, h = p * a + f * o, g = c * h - l * s, _ = l * h + c * s, v = u * m + d * _, y = -d * m + u * _, b = Math.hypot(v, g, y + 1) || 1;
|
|
1641
1641
|
return {
|
|
1642
1642
|
x: v,
|
|
@@ -1660,9 +1660,9 @@ function Wn(e, t, n) {
|
|
|
1660
1660
|
rigAmbient: r.ambient
|
|
1661
1661
|
};
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1663
|
+
function Jn(e, t) {
|
|
1664
1664
|
let n = t, r = Math.hypot(t.x, t.y, t.z + 1) || 1, i = {
|
|
1665
|
-
material:
|
|
1665
|
+
material: Wn[e],
|
|
1666
1666
|
ambient: n.rigAmbient ?? 0,
|
|
1667
1667
|
lights: n.rigLights ?? [{
|
|
1668
1668
|
...t,
|
|
@@ -1682,9 +1682,9 @@ function Gn(e, t) {
|
|
|
1682
1682
|
terms: new Float64Array(6),
|
|
1683
1683
|
flatTerms: new Float64Array(6)
|
|
1684
1684
|
};
|
|
1685
|
-
return
|
|
1685
|
+
return Yn(i.flatTerms, 0, 0, 1, i), i;
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function Yn(e, t, n, r, i) {
|
|
1688
1688
|
let a = i.material, o = 0, s = 0, c = 0, l = 0, u = 0, d = 0;
|
|
1689
1689
|
for (let e of i.lights) {
|
|
1690
1690
|
let i = t * e.x + n * e.y + r * e.z;
|
|
@@ -1699,11 +1699,11 @@ function Kn(e, t, n, r, i) {
|
|
|
1699
1699
|
}
|
|
1700
1700
|
e[0] = o, e[1] = s, e[2] = c, e[3] = l, e[4] = u, e[5] = d;
|
|
1701
1701
|
}
|
|
1702
|
-
function
|
|
1702
|
+
function Xn(e, t, n, r, i, a, o, s, c) {
|
|
1703
1703
|
let l = c.material, u = 1 - Math.min(1, Math.abs(s)), d = l.diffuseFresnel === 0 ? 0 : u ** +Math.abs(l.diffuseFresnel), f = l.alphaFresnel === 0 ? 0 : u ** +Math.abs(l.alphaFresnel), p = l.diffuseAlpha;
|
|
1704
1704
|
l.alphaFresnel > 0 ? p += (1 - p) * f : l.alphaFresnel < 0 && (p *= 1 - f);
|
|
1705
1705
|
let m = a === 0 && o === 0 && s === 1 ? c.flatTerms : c.terms;
|
|
1706
|
-
m === c.terms &&
|
|
1706
|
+
m === c.terms && Yn(m, a, o, s, c);
|
|
1707
1707
|
for (let i = 0; i < 3; i++) {
|
|
1708
1708
|
let a = (i === 0 ? t : i === 1 ? n : r) / 255, o = a * l.diffuseShape + l.diffuseWhite;
|
|
1709
1709
|
o = l.diffuseFresnel > 0 ? o + (1 - o) * d : o * (1 - d);
|
|
@@ -1712,7 +1712,7 @@ function qn(e, t, n, r, i, a, o, s, c) {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
e[3] = i * Math.max(0, Math.min(1, p));
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function Zn(e) {
|
|
1716
1716
|
let t = e.length, n = new Float64Array(t);
|
|
1717
1717
|
if (t === 0) return n;
|
|
1718
1718
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -1730,7 +1730,7 @@ function Jn(e) {
|
|
|
1730
1730
|
}
|
|
1731
1731
|
return n;
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1733
|
+
function Qn(e, t = 3) {
|
|
1734
1734
|
if (e <= 0) return Array(t).fill(1);
|
|
1735
1735
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
1736
1736
|
r % 2 == 0 && r--;
|
|
@@ -1738,7 +1738,7 @@ function Yn(e, t = 3) {
|
|
|
1738
1738
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
1739
1739
|
return s;
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1741
|
+
function $n(e, t, n, r, i, a) {
|
|
1742
1742
|
let o = 1 / (2 * i + 1);
|
|
1743
1743
|
if (a) for (let a = 0; a < r; a++) {
|
|
1744
1744
|
let r = a * n, s = 0;
|
|
@@ -1759,29 +1759,29 @@ function Xn(e, t, n, r, i, a) {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1762
|
+
function er(e, t, n, r) {
|
|
1763
1763
|
let i = Float64Array.from(e);
|
|
1764
1764
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
1765
1765
|
let a = new Float64Array(t * n);
|
|
1766
|
-
for (let e of
|
|
1766
|
+
for (let e of Qn(r, 3)) {
|
|
1767
1767
|
let r = Math.max(1, (e - 1) / 2);
|
|
1768
|
-
|
|
1768
|
+
$n(i, a, t, n, r, !0), $n(a, i, t, n, r, !1);
|
|
1769
1769
|
}
|
|
1770
1770
|
return i;
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function tr(e, t, n, r = 128) {
|
|
1773
1773
|
let i = new Float64Array(t * n);
|
|
1774
1774
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
1775
1775
|
let a = new Float64Array(n);
|
|
1776
1776
|
for (let e = 0; e < t; e++) {
|
|
1777
1777
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
1778
|
-
let r =
|
|
1778
|
+
let r = Zn(a);
|
|
1779
1779
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
1780
1780
|
}
|
|
1781
1781
|
let o = new Float64Array(t);
|
|
1782
1782
|
for (let e = 0; e < n; e++) {
|
|
1783
1783
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
1784
|
-
let n =
|
|
1784
|
+
let n = Zn(o);
|
|
1785
1785
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
1786
1786
|
}
|
|
1787
1787
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -1793,21 +1793,21 @@ function Qn(e, t, n, r = 128) {
|
|
|
1793
1793
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
1794
1794
|
return i;
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function nr(e, t, n, r, i, a) {
|
|
1797
1797
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
1798
1798
|
if (t <= 0 || n <= 0) return {
|
|
1799
1799
|
normals: o,
|
|
1800
1800
|
bandMask: s,
|
|
1801
1801
|
bandWeight: c
|
|
1802
1802
|
};
|
|
1803
|
-
let l =
|
|
1803
|
+
let l = tr(e, t, n, 1), u = r > 0 ? er(l, t, n, Math.max(1, r * .25)) : l;
|
|
1804
1804
|
for (let d = 0; d < n; d++) for (let f = 0; f < t; f++) {
|
|
1805
1805
|
let p = d * t + f;
|
|
1806
1806
|
if (o[p * 3 + 2] = 1, (e[p] ?? 0) === 0 || r <= 0 || a <= 0) continue;
|
|
1807
1807
|
let m = Math.max(0, l[p] - .5);
|
|
1808
1808
|
if (m >= r) continue;
|
|
1809
1809
|
s[p] = 1, c[p] = 1;
|
|
1810
|
-
let h = Math.max(0, f - 1), g = Math.min(t - 1, f + 1), _ = Math.max(0, d - 1), v = Math.min(n - 1, d + 1), y = (u[d * t + g] - u[d * t + h]) / (g - h || 1), b = (u[v * t + f] - u[_ * t + f]) / (v - _ || 1), x = Math.hypot(y, b), S =
|
|
1810
|
+
let h = Math.max(0, f - 1), g = Math.min(t - 1, f + 1), _ = Math.max(0, d - 1), v = Math.min(n - 1, d + 1), y = (u[d * t + g] - u[d * t + h]) / (g - h || 1), b = (u[v * t + f] - u[_ * t + f]) / (v - _ || 1), x = Math.hypot(y, b), S = Rn(i, m / r) * a / r, C = x > 1e-9 ? -S * y / x : 0, w = x > 1e-9 ? -S * b / x : 0, T = Math.hypot(C, w, 1);
|
|
1811
1811
|
o[p * 3] = C / T, o[p * 3 + 1] = w / T, o[p * 3 + 2] = 1 / T;
|
|
1812
1812
|
}
|
|
1813
1813
|
return {
|
|
@@ -1816,13 +1816,13 @@ function $n(e, t, n, r, i, a) {
|
|
|
1816
1816
|
bandWeight: c
|
|
1817
1817
|
};
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1820
|
-
return
|
|
1819
|
+
function rr(e, t, n) {
|
|
1820
|
+
return qn(e, t, n);
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1823
|
-
return
|
|
1822
|
+
function ir(e) {
|
|
1823
|
+
return Gn(e);
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1825
|
+
function ar(e, t, n) {
|
|
1826
1826
|
if (!e) return {
|
|
1827
1827
|
x: 0,
|
|
1828
1828
|
y: 0,
|
|
@@ -1837,19 +1837,19 @@ function nr(e, t, n) {
|
|
|
1837
1837
|
h: Math.max(0, o - i)
|
|
1838
1838
|
};
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function or(e, t, n) {
|
|
1841
1841
|
if (e.canvas.width <= 0 || e.canvas.height <= 0) return;
|
|
1842
|
-
let r = t.camera ?
|
|
1842
|
+
let r = t.camera ? An(t.camera) : void 0, i = r?.backFacing ?? !1;
|
|
1843
1843
|
if (!!t.bottom !== i) return;
|
|
1844
|
-
let { x: a, y: o, w: s, h: c } =
|
|
1844
|
+
let { x: a, y: o, w: s, h: c } = ar(n, e.canvas.width, e.canvas.height);
|
|
1845
1845
|
if (s <= 0 || c <= 0) return;
|
|
1846
1846
|
let l = e.getImageData(a, o, s, c), u = l.data, d = new Uint8ClampedArray(s * c);
|
|
1847
1847
|
for (let e = 0; e < s * c; e++) d[e] = u[e * 4 + 3] > 0 ? 255 : 0;
|
|
1848
1848
|
if (t.material === "legacyWireframe") {
|
|
1849
|
-
|
|
1849
|
+
zn(u, d, tr(d, s, c), s, c, t.widthPx, t.wireframeLinePx ?? 1, t.wireframeDepth), e.putImageData(l, a, o);
|
|
1850
1850
|
return;
|
|
1851
1851
|
}
|
|
1852
|
-
let { normals: f } =
|
|
1852
|
+
let { normals: f } = nr(d, s, c, t.widthPx, t.prst, t.heightPx), p = Jn(t.material, t.light), m = new Float64Array(4);
|
|
1853
1853
|
for (let e = 0; e < s * c; e++) {
|
|
1854
1854
|
let n = e * 4;
|
|
1855
1855
|
if (u[n + 3] === 0) continue;
|
|
@@ -1858,16 +1858,16 @@ function rr(e, t, n) {
|
|
|
1858
1858
|
let e = r.rotation, t = e[0] * i + e[1] * a - e[2] * o, n = e[3] * i + e[4] * a - e[5] * o;
|
|
1859
1859
|
o = e[6] * i + e[7] * a - e[8] * o, i = t, a = n;
|
|
1860
1860
|
}
|
|
1861
|
-
|
|
1861
|
+
Xn(m, u[n], u[n + 1], u[n + 2], u[n + 3], i, a, o, p), u[n] = m[0], u[n + 1] = m[1], u[n + 2] = m[2], u[n + 3] = m[3];
|
|
1862
1862
|
}
|
|
1863
1863
|
e.putImageData(l, a, o);
|
|
1864
1864
|
}
|
|
1865
|
-
function
|
|
1865
|
+
function sr(e, t, n) {
|
|
1866
1866
|
let r = e.canvas.width, i = e.canvas.height;
|
|
1867
1867
|
if (r <= 0 || i <= 0) return;
|
|
1868
1868
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
1869
1869
|
if (s < .75) return;
|
|
1870
|
-
let { x: c, y: l, w: u, h: d } =
|
|
1870
|
+
let { x: c, y: l, w: u, h: d } = ar(n, r, i);
|
|
1871
1871
|
if (u <= 0 || d <= 0) return;
|
|
1872
1872
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
1873
1873
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -1889,13 +1889,13 @@ function ir(e, t, n) {
|
|
|
1889
1889
|
}
|
|
1890
1890
|
e.putImageData(f, c, l);
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function cr(e, t) {
|
|
1893
1893
|
return {
|
|
1894
1894
|
top: e - t * .85,
|
|
1895
1895
|
height: t * 1.1
|
|
1896
1896
|
};
|
|
1897
1897
|
}
|
|
1898
|
-
function
|
|
1898
|
+
function lr(e, t, n, r, i = 0) {
|
|
1899
1899
|
let a = [], o = 0, s = 0;
|
|
1900
1900
|
for (let c of t) a.push({
|
|
1901
1901
|
text: e.slice(o, c).join(""),
|
|
@@ -1906,23 +1906,23 @@ function or(e, t, n, r, i = 0) {
|
|
|
1906
1906
|
dx: r(e.slice(0, o).join("")) + o * i + s * n
|
|
1907
1907
|
}), a;
|
|
1908
1908
|
}
|
|
1909
|
-
var
|
|
1909
|
+
var ur = {
|
|
1910
1910
|
palatino: "Palatino Linotype",
|
|
1911
1911
|
helvetica: "Arial",
|
|
1912
1912
|
"helvetica neue": "Arial"
|
|
1913
|
-
},
|
|
1914
|
-
function
|
|
1915
|
-
let r = `${e.trim().toLocaleLowerCase("en-US")}|${t ? 700 : 400}|${n ? "i" : "n"}`, i =
|
|
1916
|
-
if (i !== void 0) return
|
|
1917
|
-
let a =
|
|
1918
|
-
if (
|
|
1919
|
-
let e =
|
|
1920
|
-
e !== void 0 &&
|
|
1913
|
+
}, dr = /* @__PURE__ */ new Map();
|
|
1914
|
+
function fr(e, t, n) {
|
|
1915
|
+
let r = `${e.trim().toLocaleLowerCase("en-US")}|${t ? 700 : 400}|${n ? "i" : "n"}`, i = dr.get(r);
|
|
1916
|
+
if (i !== void 0) return dr.delete(r), dr.set(r, i), i ?? void 0;
|
|
1917
|
+
let a = hr(e, t, n);
|
|
1918
|
+
if (dr.set(r, a ?? null), dr.size > 256) {
|
|
1919
|
+
let e = dr.keys().next().value;
|
|
1920
|
+
e !== void 0 && dr.delete(e);
|
|
1921
1921
|
}
|
|
1922
1922
|
return a;
|
|
1923
1923
|
}
|
|
1924
|
-
function
|
|
1925
|
-
let r = t ? 700 : 400, i = l(
|
|
1924
|
+
function pr(e, t, n) {
|
|
1925
|
+
let r = t ? 700 : 400, i = l(ur, e.trim().toLocaleLowerCase("en-US")) ?? e.trim();
|
|
1926
1926
|
if (!i) return r;
|
|
1927
1927
|
let a = n ? "italic" : "normal";
|
|
1928
1928
|
if (_(i, {
|
|
@@ -1932,10 +1932,10 @@ function ur(e, t, n) {
|
|
|
1932
1932
|
let o = _(i, { style: a });
|
|
1933
1933
|
return o.length > 0 && o.every((e) => e.weight === o[0].weight) ? o[0].weight : r;
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function mr(e, t, n) {
|
|
1936
1936
|
let r = e.trim();
|
|
1937
1937
|
if (!r) return [];
|
|
1938
|
-
let i = l(
|
|
1938
|
+
let i = l(ur, r.toLocaleLowerCase("en-US")) ?? r, a = n ? "italic" : "normal", o = _(i, {
|
|
1939
1939
|
weight: t ? 700 : 400,
|
|
1940
1940
|
style: a
|
|
1941
1941
|
});
|
|
@@ -1946,8 +1946,8 @@ function dr(e, t, n) {
|
|
|
1946
1946
|
let s = o.filter((e) => e.source === "macos-supplemental");
|
|
1947
1947
|
return s.length > 0 ? s : o.filter((e) => e.source === "office-mac");
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1950
|
-
let r =
|
|
1949
|
+
function hr(e, t, n) {
|
|
1950
|
+
let r = mr(e, t, n);
|
|
1951
1951
|
if (r.length === 0) return;
|
|
1952
1952
|
let i;
|
|
1953
1953
|
for (let e of r) {
|
|
@@ -1964,8 +1964,8 @@ function fr(e, t, n) {
|
|
|
1964
1964
|
}
|
|
1965
1965
|
return i;
|
|
1966
1966
|
}
|
|
1967
|
-
function
|
|
1968
|
-
let r =
|
|
1967
|
+
function gr(e, t, n) {
|
|
1968
|
+
let r = mr(e, t, n);
|
|
1969
1969
|
if (r.length === 0) return;
|
|
1970
1970
|
let i;
|
|
1971
1971
|
for (let e of r) {
|
|
@@ -1990,11 +1990,11 @@ function pr(e, t, n) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
return i;
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1993
|
+
function _r(e, t, n) {
|
|
1994
1994
|
let r;
|
|
1995
|
-
for (let i of
|
|
1995
|
+
for (let i of mr(e, t, n)) {
|
|
1996
1996
|
if (i.farEastCodePage == null || !i.win) return;
|
|
1997
|
-
let e =
|
|
1997
|
+
let e = nt({
|
|
1998
1998
|
faceSource: i.source === "macos-supplemental" ? "system" : "office-bundle",
|
|
1999
1999
|
unitsPerEm: i.unitsPerEm,
|
|
2000
2000
|
hhea: i.hhea,
|
|
@@ -2010,9 +2010,9 @@ function mr(e, t, n) {
|
|
|
2010
2010
|
}
|
|
2011
2011
|
return r;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function vr(e, t, n) {
|
|
2014
2014
|
let r;
|
|
2015
|
-
for (let i of
|
|
2015
|
+
for (let i of mr(e, t, n)) {
|
|
2016
2016
|
let e = i.decoration;
|
|
2017
2017
|
if (!e || !(i.unitsPerEm > 0)) return;
|
|
2018
2018
|
let [t, n, a, o] = e;
|
|
@@ -2028,29 +2028,29 @@ function hr(e, t, n) {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
return r;
|
|
2030
2030
|
}
|
|
2031
|
-
var
|
|
2032
|
-
function
|
|
2033
|
-
let r = `${e.trim().toLocaleLowerCase("en-US")}|${t ? 700 : 400}|${n ? "i" : "n"}`, i =
|
|
2034
|
-
if (i !== void 0) return
|
|
2035
|
-
let a =
|
|
2031
|
+
var yr = /* @__PURE__ */ new Map();
|
|
2032
|
+
function br(e, t, n) {
|
|
2033
|
+
let r = `${e.trim().toLocaleLowerCase("en-US")}|${t ? 700 : 400}|${n ? "i" : "n"}`, i = yr.get(r);
|
|
2034
|
+
if (i !== void 0) return yr.delete(r), yr.set(r, i), i ?? void 0;
|
|
2035
|
+
let a = fr(e, t, n), o = a === void 0 ? null : Object.freeze({
|
|
2036
2036
|
share: a,
|
|
2037
|
-
glyph:
|
|
2038
|
-
excel:
|
|
2039
|
-
decoration:
|
|
2037
|
+
glyph: gr(e, t, n),
|
|
2038
|
+
excel: _r(e, t, n),
|
|
2039
|
+
decoration: vr(e, t, n)
|
|
2040
2040
|
});
|
|
2041
|
-
if (
|
|
2042
|
-
let e =
|
|
2043
|
-
e !== void 0 &&
|
|
2041
|
+
if (yr.set(r, o), yr.size > 256) {
|
|
2042
|
+
let e = yr.keys().next().value;
|
|
2043
|
+
e !== void 0 && yr.delete(e);
|
|
2044
2044
|
}
|
|
2045
2045
|
return o ?? void 0;
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2047
|
+
function xr(e) {
|
|
2048
2048
|
let t = 0, n = 0, r = 0;
|
|
2049
2049
|
for (let i of e) t = Math.max(t, i.sizePx), n = Math.max(n, 1.2 * i.sizePx * i.share), r = Math.max(r, 1.2 * i.sizePx * (1 - i.share));
|
|
2050
2050
|
let i = 1.2 * t;
|
|
2051
2051
|
if (!(n + r > 0)) return {
|
|
2052
|
-
ascent: i *
|
|
2053
|
-
descent: i *
|
|
2052
|
+
ascent: i * bt,
|
|
2053
|
+
descent: i * xt
|
|
2054
2054
|
};
|
|
2055
2055
|
let a = i * n / (n + r);
|
|
2056
2056
|
return {
|
|
@@ -2058,10 +2058,10 @@ function vr(e) {
|
|
|
2058
2058
|
descent: i - a
|
|
2059
2059
|
};
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2061
|
+
function Sr(e) {
|
|
2062
2062
|
return Math.floor(e + .5);
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function Cr(e) {
|
|
2065
2065
|
let t = 0, n = 0;
|
|
2066
2066
|
for (let r of e) t = Math.max(t, r.box.ascent * r.sizePx), n = Math.max(n, r.box.descent * r.sizePx);
|
|
2067
2067
|
return {
|
|
@@ -2069,15 +2069,15 @@ function br(e) {
|
|
|
2069
2069
|
descent: n
|
|
2070
2070
|
};
|
|
2071
2071
|
}
|
|
2072
|
-
var
|
|
2073
|
-
function
|
|
2072
|
+
var wr = .72;
|
|
2073
|
+
function Tr(e, t) {
|
|
2074
2074
|
return t ? e.face.excel : e.face.glyph;
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function Er(e, t, n, r) {
|
|
2077
2077
|
if (t.length === 0) return;
|
|
2078
2078
|
let i = [];
|
|
2079
2079
|
for (let e of t) {
|
|
2080
|
-
let t =
|
|
2080
|
+
let t = Tr(e, n);
|
|
2081
2081
|
if (!t) return;
|
|
2082
2082
|
i.push({
|
|
2083
2083
|
ascent: t.ascent * e.sizePx,
|
|
@@ -2096,7 +2096,7 @@ function Cr(e, t, n, r) {
|
|
|
2096
2096
|
ascent: i / 2,
|
|
2097
2097
|
descent: i / 2
|
|
2098
2098
|
};
|
|
2099
|
-
let a =
|
|
2099
|
+
let a = xr(t.map((e) => ({
|
|
2100
2100
|
sizePx: e.sizePx,
|
|
2101
2101
|
share: e.face.share
|
|
2102
2102
|
}))), o = (i - Math.round(a.ascent / r) * r) / 2;
|
|
@@ -2123,19 +2123,19 @@ function Cr(e, t, n, r) {
|
|
|
2123
2123
|
descent: a / 2
|
|
2124
2124
|
};
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2127
|
-
let i =
|
|
2126
|
+
function Dr(e, t, n, r) {
|
|
2127
|
+
let i = Tr(t, n);
|
|
2128
2128
|
if (!i) return;
|
|
2129
2129
|
let a = i.ascent * t.sizePx, o = i.descent * t.sizePx;
|
|
2130
2130
|
if (e === "b") return -Math.round(o / 2 / r) * r;
|
|
2131
2131
|
let s = e === "t" ? a : (a - o) / 2;
|
|
2132
2132
|
return Math.round(s / r) * r;
|
|
2133
2133
|
}
|
|
2134
|
-
var
|
|
2134
|
+
var Or = {
|
|
2135
2135
|
...V,
|
|
2136
2136
|
...N
|
|
2137
2137
|
};
|
|
2138
|
-
function*
|
|
2138
|
+
function* kr(e) {
|
|
2139
2139
|
let t = [e[Symbol.iterator]()];
|
|
2140
2140
|
for (; t.length;) {
|
|
2141
2141
|
let e = t[t.length - 1].next();
|
|
@@ -2147,28 +2147,28 @@ function* Er(e) {
|
|
|
2147
2147
|
yield n, (n.type === "shape" || n.type === "table") && n.mathFallback && t.push(n.mathFallback.elements[Symbol.iterator]());
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
|
-
function*
|
|
2150
|
+
function* Ar(e) {
|
|
2151
2151
|
for (let t of e?.paragraphs ?? []) {
|
|
2152
2152
|
for (let e of t.mathFallbacks ?? []) yield e.text;
|
|
2153
2153
|
for (let e of t.runs) e.type === "text" && (yield e.text), e.type === "math" && e.fallbackText && (yield e.fallbackText);
|
|
2154
2154
|
}
|
|
2155
2155
|
}
|
|
2156
|
-
function*
|
|
2156
|
+
function* jr(e) {
|
|
2157
2157
|
for (let t of e?.paragraphs ?? []) {
|
|
2158
2158
|
t.defFontFamily && (yield t.defFontFamily);
|
|
2159
2159
|
for (let e of t.runs) e.type === "text" && (e.fontFamily && (yield e.fontFamily), e.fontFamilyEa && (yield e.fontFamilyEa), e.fontFamilyCs && (yield e.fontFamilyCs), e.fontFamilySym && (yield e.fontFamilySym));
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
|
-
function*
|
|
2163
|
-
for (let t of
|
|
2164
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield*
|
|
2162
|
+
function* Mr(e) {
|
|
2163
|
+
for (let t of kr(e.elements)) if (t.type === "shape") yield* Ar(t.textBody);
|
|
2164
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) yield* Ar(t.textBody);
|
|
2165
2165
|
else if (t.type === "chart") {
|
|
2166
2166
|
t.chart.title && (yield t.chart.title);
|
|
2167
2167
|
for (let e of t.chart.categories) yield e;
|
|
2168
2168
|
for (let e of t.chart.series) e.name && (yield e.name);
|
|
2169
2169
|
}
|
|
2170
2170
|
}
|
|
2171
|
-
var
|
|
2171
|
+
var Nr = class e {
|
|
2172
2172
|
majorFont;
|
|
2173
2173
|
minorFont;
|
|
2174
2174
|
fallback;
|
|
@@ -2181,10 +2181,10 @@ var Ar = class e {
|
|
|
2181
2181
|
this.scripts = n ?? new ie(o), this.families = r ?? /* @__PURE__ */ new Set(), e && this.families.add(e), t && this.families.add(t);
|
|
2182
2182
|
}
|
|
2183
2183
|
addSlide(e) {
|
|
2184
|
-
e.theme?.majorFont && this.families.add(e.theme.majorFont), e.theme?.minorFont && this.families.add(e.theme.minorFont), this.scripts.addText(
|
|
2185
|
-
for (let t of me(
|
|
2186
|
-
for (let t of
|
|
2187
|
-
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of
|
|
2184
|
+
e.theme?.majorFont && this.families.add(e.theme.majorFont), e.theme?.minorFont && this.families.add(e.theme.minorFont), this.scripts.addText(Mr(e));
|
|
2185
|
+
for (let t of me(Mr(e), F(e.theme ? e.theme.majorFont : this.majorFont) ?? F(e.theme ? e.theme.minorFont : this.minorFont) ?? this.fallback ?? null)) this.scriptNames.add(t);
|
|
2186
|
+
for (let t of kr(e.elements)) if (t.type === "shape") for (let e of jr(t.textBody)) this.families.add(e);
|
|
2187
|
+
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) for (let e of jr(t.textBody)) this.families.add(e);
|
|
2188
2188
|
}
|
|
2189
2189
|
names() {
|
|
2190
2190
|
return [...new Set([
|
|
@@ -2197,7 +2197,7 @@ var Ar = class e {
|
|
|
2197
2197
|
let n = new e(this.majorFont, this.minorFont, this.scripts.clone(), new Set(this.families), this.fallback, new Set(this.scriptNames));
|
|
2198
2198
|
return n.addSlide(t), n;
|
|
2199
2199
|
}
|
|
2200
|
-
},
|
|
2200
|
+
}, Pr = new Set([
|
|
2201
2201
|
"serif",
|
|
2202
2202
|
"sans-serif",
|
|
2203
2203
|
"monospace",
|
|
@@ -2205,12 +2205,12 @@ var Ar = class e {
|
|
|
2205
2205
|
"fantasy",
|
|
2206
2206
|
"system-ui"
|
|
2207
2207
|
]);
|
|
2208
|
-
function
|
|
2208
|
+
function Fr(e, t, n) {
|
|
2209
2209
|
e.theme && (t = e.theme.majorFont, n = e.theme.minorFont);
|
|
2210
2210
|
let r = /* @__PURE__ */ new Map(), i = (e) => e ? e.startsWith("+mn-") ? n : e.startsWith("+mj-") ? t : e.split(",")[0]?.trim() ?? null : null, a = (e, t, n) => {
|
|
2211
2211
|
let a = i(e);
|
|
2212
|
-
if (!a ||
|
|
2213
|
-
let o =
|
|
2212
|
+
if (!a || Pr.has(a.toLowerCase())) return;
|
|
2213
|
+
let o = pr(a, t, n), s = n ? "italic" : "normal";
|
|
2214
2214
|
r.set(`${a.toLowerCase()}:${o}:${s}`, {
|
|
2215
2215
|
family: a,
|
|
2216
2216
|
weight: o,
|
|
@@ -2237,23 +2237,23 @@ function Mr(e, t, n) {
|
|
|
2237
2237
|
}
|
|
2238
2238
|
}
|
|
2239
2239
|
};
|
|
2240
|
-
for (let t of
|
|
2240
|
+
for (let t of kr(e.elements)) if (t.type === "shape" && o(t.textBody), t.type === "table") for (let e of t.rows) for (let t of e.cells) o(t.textBody);
|
|
2241
2241
|
return [...r.values()];
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2244
|
-
return R(
|
|
2243
|
+
function Ir(e, t, n, r) {
|
|
2244
|
+
return R(Mr(e), F(t) ?? F(n) ?? r);
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2246
|
+
function Lr(e) {
|
|
2247
2247
|
return e;
|
|
2248
2248
|
}
|
|
2249
|
-
var
|
|
2250
|
-
function
|
|
2249
|
+
var Rr = .5;
|
|
2250
|
+
function zr(e, t) {
|
|
2251
2251
|
if (!(t > 0) || !(e.h > 0)) return [{
|
|
2252
2252
|
y: e.y,
|
|
2253
2253
|
h: Math.max(0, e.h),
|
|
2254
2254
|
radius: 0
|
|
2255
2255
|
}];
|
|
2256
|
-
let n = Math.max(4, Math.min(24, Math.ceil(t /
|
|
2256
|
+
let n = Math.max(4, Math.min(24, Math.ceil(t / Rr) + 1)), r = e.y + e.h, i = [];
|
|
2257
2257
|
for (let a = 0; a < n; a++) {
|
|
2258
2258
|
let o = Math.sqrt(a / (n - 1)), s = a === 0 ? 0 : Math.sqrt((a - 1) / (n - 1)), c = a === n - 1 ? 1 : Math.sqrt((a + 1) / (n - 1)), l = a === 0 ? 0 : (s + o) / 2, u = a === n - 1 ? 1 : (o + c) / 2, d = r - u * e.h;
|
|
2259
2259
|
i.push({
|
|
@@ -2264,18 +2264,18 @@ function Ir(e, t) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
return i;
|
|
2266
2266
|
}
|
|
2267
|
-
function
|
|
2268
|
-
for (let a of
|
|
2267
|
+
function Br(e, t, n, r, i) {
|
|
2268
|
+
for (let a of zr(n, r)) e.save(), e.beginPath(), e.rect(0, a.y, i, a.h), e.clip(), e.filter = a.radius > 0 ? `blur(${a.radius}px)` : "none", e.drawImage(t, 0, 0), e.restore();
|
|
2269
2269
|
}
|
|
2270
|
-
function
|
|
2270
|
+
function Vr(e, t) {
|
|
2271
2271
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
2272
2272
|
if (n === void 0 && r === void 0) return;
|
|
2273
2273
|
if (r !== void 0) return {
|
|
2274
2274
|
kind: "internal",
|
|
2275
2275
|
ref: n ?? r
|
|
2276
2276
|
};
|
|
2277
|
-
let i = n, a =
|
|
2278
|
-
return a !== null &&
|
|
2277
|
+
let i = n, a = Ke(i);
|
|
2278
|
+
return a !== null && We.includes(a) ? {
|
|
2279
2279
|
kind: "external",
|
|
2280
2280
|
url: i
|
|
2281
2281
|
} : {
|
|
@@ -2283,7 +2283,7 @@ function Rr(e, t) {
|
|
|
2283
2283
|
ref: i
|
|
2284
2284
|
};
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function Hr(e, t, n, r, i, a) {
|
|
2287
2287
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
2288
2288
|
if (e.save(), e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = o * .35, e.fillStyle = "rgba(20, 20, 20, 0.7)", e.beginPath(), e.arc(t, n, o, 0, Math.PI * 2), e.fill(), e.shadowColor = "transparent", e.shadowBlur = 0, e.fillStyle = "#fff", a === "paused") {
|
|
2289
2289
|
e.beginPath();
|
|
@@ -2295,16 +2295,16 @@ function zr(e, t, n, r, i, a) {
|
|
|
2295
2295
|
}
|
|
2296
2296
|
e.restore();
|
|
2297
2297
|
}
|
|
2298
|
-
var
|
|
2299
|
-
function
|
|
2298
|
+
var Ur = { isTab: (e) => "isTab" in e }, Wr = (e) => st(e), Gr = (e, t) => Re(e, t, Ur), Kr = (e) => /\s/.test(String.fromCodePoint(e));
|
|
2299
|
+
function qr(e, t, n, r, i) {
|
|
2300
2300
|
if (r === "just" && i) return null;
|
|
2301
2301
|
let a = t - n;
|
|
2302
2302
|
if (a <= .5) return null;
|
|
2303
|
-
let o =
|
|
2303
|
+
let o = Ot(e, a, {
|
|
2304
2304
|
firstContentSi: 0,
|
|
2305
2305
|
lastDrawnSi: e.length,
|
|
2306
|
-
isGapChar:
|
|
2307
|
-
isWhitespace:
|
|
2306
|
+
isGapChar: rt,
|
|
2307
|
+
isWhitespace: Kr,
|
|
2308
2308
|
seaClusterGaps: r === "thaiDist"
|
|
2309
2309
|
});
|
|
2310
2310
|
if (!o) return null;
|
|
@@ -2323,8 +2323,8 @@ function Wr(e, t, n, r, i) {
|
|
|
2323
2323
|
}
|
|
2324
2324
|
return l;
|
|
2325
2325
|
}
|
|
2326
|
-
function
|
|
2327
|
-
let t = e ?
|
|
2326
|
+
function Jr(e) {
|
|
2327
|
+
let t = e ? qt(e.replace(/^#/, "").slice(0, 6)) : null;
|
|
2328
2328
|
return t ? {
|
|
2329
2329
|
r: t[0],
|
|
2330
2330
|
g: t[1],
|
|
@@ -2335,35 +2335,35 @@ function Gr(e) {
|
|
|
2335
2335
|
b: 0
|
|
2336
2336
|
};
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2339
|
-
let t =
|
|
2338
|
+
function Yr(e) {
|
|
2339
|
+
let t = Jr(e);
|
|
2340
2340
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
2341
2341
|
}
|
|
2342
|
-
function
|
|
2342
|
+
function Xr(e, t) {
|
|
2343
2343
|
if (!e && !t) return null;
|
|
2344
2344
|
if (!e) return t;
|
|
2345
2345
|
if (!t) return e;
|
|
2346
2346
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
2347
|
-
let n =
|
|
2347
|
+
let n = Yr(e.color), r = Yr(t.color);
|
|
2348
2348
|
return n === r || n < r ? e : t;
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2351
|
-
let t =
|
|
2350
|
+
function Zr(e) {
|
|
2351
|
+
let t = qt(e.length === 8 ? e.slice(0, 6) : e);
|
|
2352
2352
|
if (!t) return null;
|
|
2353
|
-
let n =
|
|
2353
|
+
let n = Jt(t[0], t[1], t[2]);
|
|
2354
2354
|
if (e.length !== 8) return n;
|
|
2355
2355
|
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
2356
2356
|
if (Number.isNaN(r)) return null;
|
|
2357
2357
|
let i = r / 255;
|
|
2358
2358
|
return i * n + (1 - i);
|
|
2359
2359
|
}
|
|
2360
|
-
function
|
|
2360
|
+
function Qr(e) {
|
|
2361
2361
|
if (!e) return null;
|
|
2362
|
-
if (e.fillType === "solid") return
|
|
2362
|
+
if (e.fillType === "solid") return Zr(e.color);
|
|
2363
2363
|
if (e.fillType === "gradient") {
|
|
2364
2364
|
let t = e.stops.map((e) => ({
|
|
2365
2365
|
p: Math.min(1, Math.max(0, e.position)),
|
|
2366
|
-
l:
|
|
2366
|
+
l: Zr(e.color)
|
|
2367
2367
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
2368
2368
|
if (t.length === 0) return null;
|
|
2369
2369
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -2372,16 +2372,16 @@ function Yr(e) {
|
|
|
2372
2372
|
}
|
|
2373
2373
|
return null;
|
|
2374
2374
|
}
|
|
2375
|
-
function
|
|
2375
|
+
function $r(e) {
|
|
2376
2376
|
return e.name === "SmartArt" && e.id === void 0;
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2379
|
-
let n =
|
|
2378
|
+
function ei(e, t) {
|
|
2379
|
+
let n = Qr(e);
|
|
2380
2380
|
if (n === null || n >= .5) return null;
|
|
2381
|
-
let r =
|
|
2381
|
+
let r = Zr(t.replace(/^#/, ""));
|
|
2382
2382
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
2383
2383
|
}
|
|
2384
|
-
function
|
|
2384
|
+
function ti(e, t, n, r, i, a = 0) {
|
|
2385
2385
|
let o = e.map((e) => e.width), s = (t) => {
|
|
2386
2386
|
let n = 0;
|
|
2387
2387
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -2407,16 +2407,16 @@ function Qr(e, t, n, r, i, a = 0) {
|
|
|
2407
2407
|
}
|
|
2408
2408
|
return o;
|
|
2409
2409
|
}
|
|
2410
|
-
var
|
|
2411
|
-
function
|
|
2412
|
-
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r -
|
|
2410
|
+
var ni = () => !1;
|
|
2411
|
+
function ri(e, t, n, r, i, a, o = "fill", s = ni) {
|
|
2412
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - Tt(e, t, i), f = 0;
|
|
2413
2413
|
for (let o of t) {
|
|
2414
|
-
let t = o.codePointAt(0) ?? 0, l =
|
|
2415
|
-
if (
|
|
2414
|
+
let t = o.codePointAt(0) ?? 0, l = Be(t), p = e.measureText(o).width + a, m = l === "Tr" ? ut(t) : null, h = l === "Tr" && m === null && je(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
2415
|
+
if (ft(t) && s(t)) {
|
|
2416
2416
|
let t = n + f + p / 2;
|
|
2417
|
-
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
2417
|
+
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", qe(e, () => u(o, 0, 0)), e.restore();
|
|
2418
2418
|
} else if (g) {
|
|
2419
|
-
let r = m === null && l === "Tu" ?
|
|
2419
|
+
let r = m === null && l === "Tu" ? ht(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? Et(e, s) / i : 0;
|
|
2420
2420
|
e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
|
|
2421
2421
|
} else if (l === "Tr") {
|
|
2422
2422
|
let t = n + f + p / 2;
|
|
@@ -2426,20 +2426,20 @@ function ei(e, t, n, r, i, a, o = "fill", s = $r) {
|
|
|
2426
2426
|
}
|
|
2427
2427
|
e.textAlign = c, e.textBaseline = l;
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2430
|
-
|
|
2429
|
+
function ii(e, t, n, r, i, a, o = "fill") {
|
|
2430
|
+
ri(e, t, n, r, i, a, o, (t) => Ye(e, t));
|
|
2431
2431
|
}
|
|
2432
|
-
var
|
|
2433
|
-
function
|
|
2432
|
+
var ai = /* @__PURE__ */ new WeakMap();
|
|
2433
|
+
function oi(e) {
|
|
2434
2434
|
let t = 0;
|
|
2435
2435
|
for (let n of e) t++;
|
|
2436
2436
|
return t;
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2439
|
-
let t =
|
|
2438
|
+
function si(e) {
|
|
2439
|
+
let t = ai.get(e);
|
|
2440
2440
|
if (t !== void 0) return t;
|
|
2441
2441
|
let n = e, r = n.letterSpacing;
|
|
2442
|
-
if (typeof r != "string") return
|
|
2442
|
+
if (typeof r != "string") return ai.set(e, !1), !1;
|
|
2443
2443
|
let i = !1;
|
|
2444
2444
|
try {
|
|
2445
2445
|
n.letterSpacing = "0px";
|
|
@@ -2454,11 +2454,11 @@ function ii(e) {
|
|
|
2454
2454
|
n.letterSpacing = r;
|
|
2455
2455
|
} catch {}
|
|
2456
2456
|
}
|
|
2457
|
-
return
|
|
2457
|
+
return ai.set(e, i), i;
|
|
2458
2458
|
}
|
|
2459
|
-
function
|
|
2459
|
+
function ci(e, t, n = 0) {
|
|
2460
2460
|
let r = e, i = r.letterSpacing;
|
|
2461
|
-
if (n !== 0 &&
|
|
2461
|
+
if (n !== 0 && si(e)) try {
|
|
2462
2462
|
r.letterSpacing = `${n}px`;
|
|
2463
2463
|
let i = e.measureText(t).width;
|
|
2464
2464
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -2467,10 +2467,10 @@ function ai(e, t, n = 0) {
|
|
|
2467
2467
|
r.letterSpacing = i;
|
|
2468
2468
|
} catch {}
|
|
2469
2469
|
}
|
|
2470
|
-
return e.measureText(t).width + n * Math.max(0,
|
|
2470
|
+
return e.measureText(t).width + n * Math.max(0, oi(t) - 1);
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2473
|
-
let n = t.lineMetric?.glyph ?? (t.faceFamily ?
|
|
2472
|
+
function li(e, t) {
|
|
2473
|
+
let n = t.lineMetric?.glyph ?? (t.faceFamily ? un(t.faceFamily, /\bbold\b/.test(t.font), /\bitalic\b/.test(t.font)) : void 0);
|
|
2474
2474
|
if (n) return n;
|
|
2475
2475
|
e.font = t.font;
|
|
2476
2476
|
let r = e.measureText("M"), i = t.sizePx || 1, a = r.fontBoundingBoxAscent, o = r.fontBoundingBoxDescent;
|
|
@@ -2482,13 +2482,13 @@ function oi(e, t) {
|
|
|
2482
2482
|
descent: .25
|
|
2483
2483
|
};
|
|
2484
2484
|
}
|
|
2485
|
-
function
|
|
2485
|
+
function ui(e) {
|
|
2486
2486
|
let t = /* @__PURE__ */ new Map();
|
|
2487
2487
|
return (n, r, i = !1) => {
|
|
2488
2488
|
let a = t.get(r);
|
|
2489
|
-
a || (a =
|
|
2490
|
-
let o = r.faceFamily ?? "", s = a.ascent + a.descent, c =
|
|
2491
|
-
return
|
|
2489
|
+
a || (a = li(e, r), t.set(r, a));
|
|
2490
|
+
let o = r.faceFamily ?? "", s = a.ascent + a.descent, c = nn * s * r.sizePx, l = r.faceFamilyLatin ?? o, u = r.lineMetricLatin?.glyph ?? un(l, /\bbold\b/.test(r.font), /\bitalic\b/.test(r.font)), d = l === o ? s : u ? u.ascent + u.descent : s, f = Math.max(c, nn * d * r.sizePx), p = r.letterSpacingPx ?? 0;
|
|
2491
|
+
return on(n, {
|
|
2492
2492
|
family: o,
|
|
2493
2493
|
bold: /\bbold\b/.test(r.font),
|
|
2494
2494
|
italic: /\bitalic\b/.test(r.font)
|
|
@@ -2509,8 +2509,8 @@ function si(e) {
|
|
|
2509
2509
|
}));
|
|
2510
2510
|
};
|
|
2511
2511
|
}
|
|
2512
|
-
function
|
|
2513
|
-
let n =
|
|
2512
|
+
function di(e, t) {
|
|
2513
|
+
let n = ui(e), r = t.paragraphs.map((e) => e.marker && "text" in e.marker ? n(e.marker.text, e.marker.style, !0) : []), i = Qt(t.paragraphs.map((e, t) => ({
|
|
2514
2514
|
runs: e.runs.map((e) => e.type === "object" && e.style.math ? {
|
|
2515
2515
|
...e,
|
|
2516
2516
|
width: e.style.math.ascent + e.style.math.descent
|
|
@@ -2609,11 +2609,11 @@ function ci(e, t) {
|
|
|
2609
2609
|
};
|
|
2610
2610
|
if (!c.noFill) if (e.fillStyle = s && t.markerPaint ? t.markerPaint(a, r, i + n.cell - l.descent * u) : c.color, n.kind === "upright") {
|
|
2611
2611
|
e.textAlign = "center", e.textBaseline = "alphabetic";
|
|
2612
|
-
let t =
|
|
2612
|
+
let t = cn(i, n.cell, l, u);
|
|
2613
2613
|
d(n.text, r, t, !0), n.space || e.fillText(n.text, r, t);
|
|
2614
2614
|
} else if (n.kind === "verticalGlyph") {
|
|
2615
|
-
let a =
|
|
2616
|
-
if (a !== null)
|
|
2615
|
+
let a = Zt(n);
|
|
2616
|
+
if (a !== null) Xt(e, a, r, i, l, u, (e, t) => d(a, e, t));
|
|
2617
2617
|
else {
|
|
2618
2618
|
let a = r - (l.ascent + l.descent) * u / 2;
|
|
2619
2619
|
if (e.save(), e.translate(a + u / 2, i + u / 2), e.rotate(Math.PI / 2), e.textAlign = "center", !s && c.strikethrough && t.drawStrike) {
|
|
@@ -2625,7 +2625,7 @@ function ci(e, t) {
|
|
|
2625
2625
|
}
|
|
2626
2626
|
e.textBaseline = "middle", e.fillText(n.text, 0, 0), e.restore();
|
|
2627
2627
|
}
|
|
2628
|
-
} else
|
|
2628
|
+
} else tn(e, n.text, r, i, l, u, () => d(n.text, 0, 0));
|
|
2629
2629
|
}, u = 0;
|
|
2630
2630
|
for (let [a, o] of i.columns.entries()) {
|
|
2631
2631
|
if (o.prefixTop !== void 0) {
|
|
@@ -2648,12 +2648,12 @@ function ci(e, t) {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
return e.textAlign = s, e.textBaseline = c, o;
|
|
2650
2650
|
}
|
|
2651
|
-
var
|
|
2651
|
+
var fi = [
|
|
2652
2652
|
[12288, 40959],
|
|
2653
2653
|
[44032, 55203],
|
|
2654
2654
|
[63744, 64255],
|
|
2655
2655
|
[65280, 65519]
|
|
2656
|
-
],
|
|
2656
|
+
], pi = "/////wEA/zj+////////////f/7///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAD/////TwD+/wAAAAD///////////8P//////////////////////////9/+P//////////////P////39EAAAAAFAAAAAAAAAABQAAAAAEAAAAIBCCAAAIAAAAAAAAAIAAAAAAAAAAYAhAAAAAAAAAQAEAACAAAAQAABAAIAAAAAAAAAAABAAAAAAAAAAAQgIAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAGGCAAACAAAAAAAAACAAAABAEQIAEAAAAAgEAAAQAAEAIAAAAAAAAAAAAAAAAAAAAAAAAEAACABAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAgAAAAAAAAAAAAAAMAAAAQAAABAABQEAAAAAAAAAAAggACAIQAAEABAAAggAAAAAAEAAIAAAEAAAAAAAAAAAAAAAAAAAAAAAAAACAAEAAAAAAAAAAJAAAAAAAAAAAAQAAAAAAAABAAAAAABABAAAAAAACAAAAAAAACAAAAAAEEBAAAIABAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAIAAAACkAAAAAAAAQAAAAAKAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAIAAAAAAAAAAAAAAAAACgAAAAAAAAAAIEAAAgAAAAAAAAAAAAQgAAAAABAQAgAgEAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAQABAIAAAAAAEAAAAAAgAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAEABAAABgBAEAAAAAAAICAAAQAQAAAIAAAAIQAAAEAAAAAAAACEAACAAAAAIAAAAAAAAAAAAACAAAAABAAAAACAEAAAAgAAAAAAAAAIAAAAgAAAAAAAAAAKAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAgAABAAAAAAAAQQAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAgAAABBAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAABAQEAAABAAAAAIAAAQAAAAAAAAAAAAAAAAAAAAAAAAAQAAIAAAAAAIAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAv//3w1r/Z5u/6eL3DAM6wmV/9vt3+Uke3+3x7z/p7/gP/+c2AMD7f837//8Z1uv/fv/f7wPo5Pp//5e9f8Bv9ff+3//+f20K79fvlu00dyF75X/fD7S/br32e/f+435O33v1/4q1vp///72VdX/qWX3+7yN/P//1fL9ueed2/2f/Tf4htEfvH7i+8P171r+jvTf+nfm+83/7t/f7/xf/z++96/+7vy//7z+eX+vyv++cQVinc+/9LS3//O7///8FHv8P7NP/cnvd5yLA1H/7uHv/Z5D3/47/32cAAWf3TvTz83EAAMxue/O2y31bAAD438+e95h/RYD6Wp79HALA4uDn1wsAk/+73/oZSF+/dgXxnTDm5XveUC//i//7ac+mn79uvf/3menl9AcC9u+73g4buPafFwkhydn88Nsi8f99PyDq06Q3pgO+t8eWCyXTq7/Z8EdPDl++df/3N9qfPmS+fT++/+/h2MO/76//fDsefOyquPGNXlovH/b4zdaJG3KO1bmnYRDzEyFE7DSAzBAITd6FEC79VpvBFGtGYSwDG8AqJjRVQSsY9/14yyv1+//7v3zz/5f/8t3v99t75f7/zsRde2f/Y+0r3r/zcz6AlRegzz/+XaAKhSID53cswmj3r90KEqLMXS+SF7ZJxp4dvaqVWJU3iHrPa/9LvmvNOHavIentYbla89keff3/m8zgFPU96uNO33/+Lxvb/9//+/v++/P5s3XbO9++v/e/v89zl/+7M7g733MX/2+9gOT9v/evKgTPP/emv7+jwH5//u39B/959M86/69B/z/P9//ehx3z9vZ/KOet2f/Zn2zft7F/RFfP/yHw7rL09Zt3f/zPzh3r33t/XRvhSv495v9bQBnq/vT3/z8D9P7wnj9Lg4CvZP5e/r0b4Hv2vZ3Xdc///zRoe8N/HCt+/AdApt1Rdbdx5ATIHr2LolgvqIEv73p7Dfq2frcF/7b37DOHWPtc3vb/uOP3480YtSW+V6e7+/i9s37b1YvnMzfe3fd+8P//+55/34b////535t7x79VaDbb39NQvkFbvf+r6/z6xX3a5eLze/J/9P/YstrvP0eC/zt/x59/1tL/2h4A2eOGvx/7f3e/u4jI995+odm/7+9/Hni//7e7/ec++//PHm4Fe6tkRrh+f/+//wdkdhnj6Zfdq/3LY6zvfuovnL7uH0/97/BPZ4vWDA7F22qT+C/cG+lOE3v8lBUPPPyOx+ibmeTvyHZdq//eue9/LuDJHf+///n73I3K2IqCNOefithR+M0H7LX+ha1db/4z/Z8GbB//drb/Pq//HwiR3I7O8M9++zIAgN/71pETp3f+GwDctLP13Wfvd9//H7EPqO7/+lRfOP/e+YzJTOgFsEmzpezerL//OmIA+JTrVrd7DW2+b9kigJ7/V/ERdd9534X7xWtS7wcwzRPba3bjrqLtyZGVVphfMmE42mFxYkb0ixD4mw8AjXqzEBACJvibEFZD6EMR4l7vVvVTACKxlXSOBdEPxhtb/ZbhcCDbwSOprBC9df/v2e3/j8uW+5diTAiF8VdC31LliycymH+0LMz7tN/+7jjgxeHJ36cf+0750WUvrLpl/0xi62ay7/sGCgx2/3+G2yiu/t3vT0Dri4fX788nrgCXWd3dz9edenDu1fufz//Z/5f+977//+bePzY8CL/3//S8+5/SH9afv2z7/yM9H/8fZJO291d9/3lp/v/l0aduf9Ta+1VXW9NftN514/B35eTE3f8dHfYReHLEtfZr+ogipt799hsZZHI2Iu9wtYS40QZwG90UVML0uuWaty/84l9/jNOV3O7DUAfe4X4z/POP+/2lK4TeM/x6OcLPG++Xv3bl/z4DGY1/st+D6Lf//fPhsq8uced/Df/BCdZp3vj/Lr7vv1Pv1I0Wy+n/e6rj+3cg8fa/htDq9/8jtHc995/QLnEn/Vff+p7K6x3a52m0//+78i1yzqq1yfdpz/615/z3xYp0Tf2v/39P/C/2//nLfu5Fb69uu8r+zfz/7/385nd/v3YOMw+n+M/57u76bHXn5u4p+873f30AAAAAAAAAAAAAAAAAAAAAAABA/bjwP7n7b6fj7f3TdF7nVLNr1TSIa9sN/v/9//NTUfn+WQRExVeh/+ryW0h/9r4WB3j19G9z4H9/7C/AXZmSK3bgXL+A4+uTh3/NaX0dQz3tb+/q77s9f/+/993/Bl/8F/nKwrfd7dbrm25er/v/n/9gAL/e/63abv9fwPkO+f83veb/AQwAqbn1Znz/xT8i4KPWW7Ejj9c72vyqAgWWIjPg58af//77NzYIvdJCpxb/1/9LFoDUl7zNULvd/rx84EvP7/cfr4Du85+bu/X/0feG7iG3cyfI3vVsz0+WokG3R2D9/5+a4g6AP2o12q/7g/tqtt758gB//e8f1yrDlv4peqqje8VWmfw7qcON+Crs009lln287s/q7n/fjmFnHn9/7v8fi6fqBynE3xVNs/Q//D77goG/c9b0bXfhDedPf7LE3F/svfzLr/md45b9tAEA9DXoKlqjvdX/6X+8+nzrY/9573rv3v2678f7883a3L///Nd4+9X3fNP+QzmJUn7zXt9IutfzO/x99gAAAAAAAAAAAAAAAAAAAAAAAIDn4t+7L14/aF/kfh17l//dv//van5ftbf9uu/dCAAAAAAAAAAA8HrbgDYlI8JJmaxe5d3yrrqdP7Byn1PgzwT7I5f/Mfofslcevi4/b4b+a0z7vRaYDGmDf62X/fvr//jP//a+8T4AAAAAAAD4++H33XdsPwR97/Nvf/n774/3/tO+/n977/P1t7/fowtvhX9hulWk+zap9eB1IfVXreLXNsj/3A++NrwP7m6/UVb9f73/+9v/+vbjuvN2/3F40/nX/e/Df/fD4/spZ+6fsanEv+/5rbO7d42fVaEz9//f/AyQL/ddsf579Ae99E3ae3EG+j/L8/YBoi+e4/mHAsh+rToVLt4P7afwGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgEPd/17j/ztU/sg/f/d3AAAAAAAAcHbVnr8XuNX5flT9/X7v8r/5x98/835m/wyPxw7951p+ngVPa97n5l/fb9q/c6rh1015ftf6f5t7E+D+jf7131d7+L150Pz+T+ycGwAAAAAAAO3TnfwZAJjv7l9wrBf//ddZPn7ne7fbAQAAAAAAwOtocT+2egM//4R8N/s+3E9GnWnrQb989q00DgAAAAAAAAD19dtbwf/b/f6+rn97Rb/t774+PvnyTWr9/IP57t/kwX+X28PH16m+za+nVb9/f/7n5276x939qW/lDQAAAAAAAAAAAAAAAOAa3QLMS6b5SJ0d/P4FH/I/ns1c2ObsBxLeNr/fhvjG6eodZ4RkZ34AAAAAAAAAAAAAIL+/2e7pcPc5/1j5N/ux8fe7jMP/jkeclv76zPzlz/fvJACg93AvAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIwAAQAAAAAAAAQAAAAAAAAAAAAAAAQAAEAAAAAAPz////z/////////wMAAAAAAAAAAAAAAAAAAAAAAOD/////////////////////////DwAAAAAAAADw9wc=", mi = [
|
|
2657
2657
|
[12288, 12291],
|
|
2658
2658
|
[12293, 12306],
|
|
2659
2659
|
[12308, 12309],
|
|
@@ -2684,7 +2684,7 @@ var li = [
|
|
|
2684
2684
|
[65377, 65439],
|
|
2685
2685
|
[65504, 65509],
|
|
2686
2686
|
[65517, 65517]
|
|
2687
|
-
],
|
|
2687
|
+
], hi = [
|
|
2688
2688
|
[12288, 12351],
|
|
2689
2689
|
[12353, 12438],
|
|
2690
2690
|
[12441, 12543],
|
|
@@ -2711,39 +2711,39 @@ var li = [
|
|
|
2711
2711
|
[65498, 65500],
|
|
2712
2712
|
[65504, 65510],
|
|
2713
2713
|
[65512, 65518]
|
|
2714
|
-
],
|
|
2714
|
+
], gi = [
|
|
2715
2715
|
"MS Mincho",
|
|
2716
2716
|
"PMingLiU",
|
|
2717
2717
|
"Batang"
|
|
2718
|
-
],
|
|
2718
|
+
], _i = [
|
|
2719
2719
|
"MS Gothic",
|
|
2720
2720
|
"Microsoft JhengHei",
|
|
2721
2721
|
"Malgun Gothic"
|
|
2722
|
-
],
|
|
2722
|
+
], vi = Object.freeze([
|
|
2723
2723
|
"Arial",
|
|
2724
2724
|
"Angsana New",
|
|
2725
2725
|
"Mangal",
|
|
2726
2726
|
"Latha"
|
|
2727
|
-
]),
|
|
2728
|
-
function
|
|
2729
|
-
return
|
|
2730
|
-
}
|
|
2731
|
-
var
|
|
2732
|
-
function
|
|
2733
|
-
if (
|
|
2734
|
-
let e = atob(
|
|
2727
|
+
]), yi = /\p{Script=Thai}/u, bi = /\p{Script=Devanagari}/u, xi = /\p{Script=Tamil}/u;
|
|
2728
|
+
function Si(e) {
|
|
2729
|
+
return yi.test(e) ? "Angsana New" : bi.test(e) ? "Mangal" : xi.test(e) ? "Latha" : "Arial";
|
|
2730
|
+
}
|
|
2731
|
+
var Ci;
|
|
2732
|
+
function wi() {
|
|
2733
|
+
if (Ci) return Ci;
|
|
2734
|
+
let e = atob(pi), t = new Uint8Array(e.length);
|
|
2735
2735
|
for (let n = 0; n < e.length; n++) t[n] = e.charCodeAt(n);
|
|
2736
|
-
return
|
|
2736
|
+
return Ci = t, t;
|
|
2737
2737
|
}
|
|
2738
|
-
function
|
|
2738
|
+
function Ti(e) {
|
|
2739
2739
|
let t = 0;
|
|
2740
|
-
for (let [n, r] of
|
|
2740
|
+
for (let [n, r] of fi) {
|
|
2741
2741
|
if (e >= n && e <= r) return t + e - n;
|
|
2742
2742
|
t += r - n + 1;
|
|
2743
2743
|
}
|
|
2744
2744
|
return -1;
|
|
2745
2745
|
}
|
|
2746
|
-
function
|
|
2746
|
+
function Ei(e, t) {
|
|
2747
2747
|
let n = 0, r = t.length - 1;
|
|
2748
2748
|
for (; n <= r;) {
|
|
2749
2749
|
let i = n + r >> 1, [a, o] = t[i];
|
|
@@ -2753,32 +2753,32 @@ function Ci(e, t) {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
return !1;
|
|
2755
2755
|
}
|
|
2756
|
-
function
|
|
2757
|
-
let t =
|
|
2758
|
-
return t < 0 ? !1 : (
|
|
2756
|
+
function Di(e) {
|
|
2757
|
+
let t = Ti(e);
|
|
2758
|
+
return t < 0 ? !1 : (wi()[t >> 3] & 1 << (t & 7)) != 0;
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2760
|
+
function Oi(e, t) {
|
|
2761
2761
|
for (let n of t) {
|
|
2762
2762
|
let t = n.codePointAt(0) ?? 0;
|
|
2763
|
-
if (!/\s/u.test(n) && !(e === "MS Mincho" || e === "MS Gothic" ?
|
|
2763
|
+
if (!/\s/u.test(n) && !(e === "MS Mincho" || e === "MS Gothic" ? Di(t) : e === "PMingLiU" ? Ei(t, mi) : e === "Microsoft JhengHei" && Ei(t, hi))) return !1;
|
|
2764
2764
|
}
|
|
2765
2765
|
return !0;
|
|
2766
2766
|
}
|
|
2767
|
-
function
|
|
2767
|
+
function ki(e) {
|
|
2768
2768
|
let t = _(e, { source: "office-mac" });
|
|
2769
2769
|
return t.length > 0 ? t : _(e);
|
|
2770
2770
|
}
|
|
2771
|
-
function
|
|
2772
|
-
return
|
|
2771
|
+
function Ai(e) {
|
|
2772
|
+
return ki(e).some((e) => e.farEastCodePage === !0);
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2775
|
-
return
|
|
2774
|
+
function ji(e) {
|
|
2775
|
+
return ki(e).some((e) => {
|
|
2776
2776
|
let t = e.panose;
|
|
2777
2777
|
return !!t && t[0] === 2 && t[1] >= 2 && t[1] <= 10;
|
|
2778
2778
|
});
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2781
|
-
if (e &&
|
|
2780
|
+
function Mi(e, t) {
|
|
2781
|
+
if (e && Ai(e)) return F(e) === "jp" ? [
|
|
2782
2782
|
e,
|
|
2783
2783
|
"Microsoft JhengHei",
|
|
2784
2784
|
"Malgun Gothic"
|
|
@@ -2787,44 +2787,44 @@ function ki(e, t) {
|
|
|
2787
2787
|
"PMingLiU",
|
|
2788
2788
|
"Batang"
|
|
2789
2789
|
];
|
|
2790
|
-
let n = e &&
|
|
2790
|
+
let n = e && ji(e) ? gi : _i, r = n.slice(0, 2).find((e) => Oi(e, t));
|
|
2791
2791
|
return r ? [r, ...n.filter((e) => e !== r)] : [
|
|
2792
2792
|
n[2],
|
|
2793
2793
|
n[0],
|
|
2794
2794
|
n[1]
|
|
2795
2795
|
];
|
|
2796
2796
|
}
|
|
2797
|
-
var
|
|
2797
|
+
var Ni = new Set([
|
|
2798
2798
|
167,
|
|
2799
2799
|
168,
|
|
2800
2800
|
176,
|
|
2801
2801
|
177,
|
|
2802
2802
|
180
|
|
2803
|
-
]),
|
|
2803
|
+
]), Pi = new Set([
|
|
2804
2804
|
215,
|
|
2805
2805
|
247,
|
|
2806
2806
|
8263,
|
|
2807
2807
|
8264
|
|
2808
|
-
]),
|
|
2809
|
-
function
|
|
2810
|
-
return
|
|
2808
|
+
]), Fi = /^(?:ja|ko|zh)(?:[-_]|$)/i, Ii = /^(?:ar|he|hi|th)(?:[-_]|$)/i;
|
|
2809
|
+
function Li(e, t) {
|
|
2810
|
+
return Ni.has(e) || e >= 9312 && e <= 9471 || e >= 9632 && e <= 10175 || e >= 65072 && e <= 65103 ? !0 : Pi.has(e) ? !Ii.test(t ?? "") : e >= 8216 && e <= 8222 && Fi.test(t ?? "");
|
|
2811
2811
|
}
|
|
2812
2812
|
function Z(e, t) {
|
|
2813
2813
|
return e * t;
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2815
|
+
function Ri(e, t, n, r) {
|
|
2816
2816
|
let i = v(Math.abs(e * n), Math.abs(t * n), r);
|
|
2817
2817
|
return i ? {
|
|
2818
2818
|
targetWidthPx: i.width,
|
|
2819
2819
|
targetHeightPx: i.height
|
|
2820
2820
|
} : void 0;
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function zi(e, t) {
|
|
2823
2823
|
return e.blipEffects?.length ? t.catch((e) => {
|
|
2824
|
-
throw
|
|
2824
|
+
throw Lt(e);
|
|
2825
2825
|
}) : t;
|
|
2826
2826
|
}
|
|
2827
|
-
function
|
|
2827
|
+
function Bi(e) {
|
|
2828
2828
|
return e instanceof t && e.code === "unsupported-image-effect";
|
|
2829
2829
|
}
|
|
2830
2830
|
function Q(e, t = e) {
|
|
@@ -2842,7 +2842,7 @@ function Q(e, t = e) {
|
|
|
2842
2842
|
}
|
|
2843
2843
|
};
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2845
|
+
function Vi(e, t, n) {
|
|
2846
2846
|
return e.tile && e.blipEffects?.length ? {
|
|
2847
2847
|
widthPt: 0,
|
|
2848
2848
|
heightPt: 0
|
|
@@ -2851,10 +2851,10 @@ function Ri(e, t, n) {
|
|
|
2851
2851
|
heightPt: n
|
|
2852
2852
|
};
|
|
2853
2853
|
}
|
|
2854
|
-
function
|
|
2855
|
-
return
|
|
2854
|
+
function Hi(e, t) {
|
|
2855
|
+
return ot(e, t);
|
|
2856
2856
|
}
|
|
2857
|
-
function
|
|
2857
|
+
function Ui(e, t) {
|
|
2858
2858
|
let n = e.targets.get(t);
|
|
2859
2859
|
return n ? {
|
|
2860
2860
|
targetWidthPx: n.width,
|
|
@@ -2862,11 +2862,11 @@ function Bi(e, t) {
|
|
|
2862
2862
|
maxRetainedPixels: n.maxRetainedPixels
|
|
2863
2863
|
} : void 0;
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2866
|
-
return !Q(e) &&
|
|
2865
|
+
function Wi(e) {
|
|
2866
|
+
return !Q(e) && ze(e) ? e.svgImagePath : e.imagePath;
|
|
2867
2867
|
}
|
|
2868
|
-
function
|
|
2869
|
-
let i =
|
|
2868
|
+
function Gi(e, t, n, r) {
|
|
2869
|
+
let i = Lr(t.bullet);
|
|
2870
2870
|
if (i.type !== "blip") return;
|
|
2871
2871
|
let a;
|
|
2872
2872
|
for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
|
|
@@ -2876,10 +2876,10 @@ function Hi(e, t, n, r) {
|
|
|
2876
2876
|
let o = a ?? t.defFontSize ?? e.defaultFontSize ?? 18, s = i.sizePts == null ? o * ((i.sizePct ?? 100) / 100) : i.sizePts;
|
|
2877
2877
|
return Math.max(1, s * h * n * r);
|
|
2878
2878
|
}
|
|
2879
|
-
async function
|
|
2880
|
-
let d =
|
|
2879
|
+
async function Ki(e, n, r, i, a, o, s, c, l, u) {
|
|
2880
|
+
let d = mt(o), f = [], p = [], m = (e, t, n, r, i, a = 1, o = i) => {
|
|
2881
2881
|
if (!(!t || !i)) {
|
|
2882
|
-
if (
|
|
2882
|
+
if (It(r) && (d.resolution === "display" || d.strategy === "adaptive")) {
|
|
2883
2883
|
f.push({
|
|
2884
2884
|
key: e,
|
|
2885
2885
|
...t,
|
|
@@ -2887,31 +2887,31 @@ async function Ui(e, n, r, i, a, o, s, c, l, u) {
|
|
|
2887
2887
|
});
|
|
2888
2888
|
return;
|
|
2889
2889
|
}
|
|
2890
|
-
p.push(
|
|
2890
|
+
p.push(Xe(n, r, i, o).then((n) => n.dimensions && Rt(n.format, u !== void 0) ? {
|
|
2891
2891
|
key: e,
|
|
2892
2892
|
...t,
|
|
2893
2893
|
sourceWidthPx: n.dimensions.width,
|
|
2894
2894
|
sourceHeightPx: n.dimensions.height,
|
|
2895
2895
|
retainedSurfaceCount: a
|
|
2896
2896
|
} : null).catch((e) => {
|
|
2897
|
-
if (e instanceof J ||
|
|
2897
|
+
if (e instanceof J || Bi(e) || Mt(e)) throw e;
|
|
2898
2898
|
return null;
|
|
2899
2899
|
}));
|
|
2900
2900
|
}
|
|
2901
2901
|
}, g = e.background;
|
|
2902
2902
|
if (g?.fillType === "image" && g.imagePath && !g.tile && !Q(g)) {
|
|
2903
2903
|
let e = g.fillRect ?? {}, t = n * (1 - (e.l ?? 0) - (e.r ?? 0)), i = r * (1 - (e.t ?? 0) - (e.b ?? 0));
|
|
2904
|
-
m(
|
|
2904
|
+
m(Hi(g.imagePath, Q(g)), Ri(t, i, a, g.srcRect), g.imagePath, g.mimeType, s, 1);
|
|
2905
2905
|
}
|
|
2906
2906
|
for (let n of e.elements) {
|
|
2907
|
-
for (let { fill: e, width: t, height: r } of
|
|
2907
|
+
for (let { fill: e, width: t, height: r } of qi(n)) if (!e.tile && !Q(e)) {
|
|
2908
2908
|
let n = e.fillRect ?? {}, o = Z(t, i) * (1 - (n.l ?? 0) - (n.r ?? 0)), c = Z(r, i) * (1 - (n.t ?? 0) - (n.b ?? 0));
|
|
2909
|
-
e.mimeType === "image/svg+xml" ||
|
|
2909
|
+
e.mimeType === "image/svg+xml" || ze(e) || m(Hi(e.imagePath, Q(e)), Ri(o, c, a, e.srcRect), e.imagePath, e.mimeType, s, 1);
|
|
2910
2910
|
}
|
|
2911
|
-
if (n.type === "picture") !(
|
|
2911
|
+
if (n.type === "picture") !(ze(n) || n.mimeType === "image/svg+xml") && !Q(n) && m(Hi(n.imagePath, Q(n)), Ri(Z(n.width, i), Z(n.height, i), a, n.srcRect), n.imagePath, n.mimeType, s, 1);
|
|
2912
2912
|
else if (n.type === "media" && n.posterPath) {
|
|
2913
|
-
let e = c ?
|
|
2914
|
-
m(
|
|
2913
|
+
let e = c ? Io(c) : void 0;
|
|
2914
|
+
m(Hi(n.posterPath), Ri(Z(n.width, i), Z(n.height, i), a), n.posterPath, n.posterMimeType || "application/octet-stream", e, 1, l ?? e);
|
|
2915
2915
|
} else if (n.type === "chart") {
|
|
2916
2916
|
if (!Number.isFinite(n.width) || !Number.isFinite(n.height) || n.width < 0 || n.height < 0) throw new t("unsupported-image-effect", "Invalid chart image frame");
|
|
2917
2917
|
if (!(n.width > 0 && n.height > 0)) continue;
|
|
@@ -2923,10 +2923,10 @@ async function Ui(e, n, r, i, a, o, s, c, l, u) {
|
|
|
2923
2923
|
};
|
|
2924
2924
|
for (let t of W(n.chart)) {
|
|
2925
2925
|
let n = t.fill, r = j(t, e);
|
|
2926
|
-
!(n.mimeType === "image/svg+xml" ||
|
|
2926
|
+
!(n.mimeType === "image/svg+xml" || ze({
|
|
2927
2927
|
svgImagePath: n.svgImagePath,
|
|
2928
2928
|
srcRect: t.hasSourceCrop ? !0 : null
|
|
2929
|
-
})) && !Q(n) && !t.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(
|
|
2929
|
+
})) && !Q(n) && !t.preserveNaturalSize && r?.targetWidthPx && r.targetHeightPx && m(Hi(n.imagePath, Q(n)), {
|
|
2930
2930
|
targetWidthPx: r.targetWidthPx,
|
|
2931
2931
|
targetHeightPx: r.targetHeightPx
|
|
2932
2932
|
}, n.imagePath, n.mimeType, s, 1);
|
|
@@ -2934,26 +2934,26 @@ async function Ui(e, n, r, i, a, o, s, c, l, u) {
|
|
|
2934
2934
|
} else if (n.type === "shape") {
|
|
2935
2935
|
if (!n.textBody) continue;
|
|
2936
2936
|
for (let e of n.textBody.paragraphs) {
|
|
2937
|
-
let t =
|
|
2937
|
+
let t = Lr(e.bullet);
|
|
2938
2938
|
if (t.type !== "blip") continue;
|
|
2939
|
-
let r =
|
|
2940
|
-
!r || !s || p.push(
|
|
2941
|
-
key:
|
|
2939
|
+
let r = Gi(n.textBody, e, i, a);
|
|
2940
|
+
!r || !s || p.push(Xe(t.imagePath, t.mimeType, s).then((e) => e.dimensions && e.dimensions.width > 0 && e.dimensions.height > 0 && Rt(e.format, u !== void 0) ? {
|
|
2941
|
+
key: Hi(t.imagePath),
|
|
2942
2942
|
targetWidthPx: r * e.dimensions.width / e.dimensions.height,
|
|
2943
2943
|
targetHeightPx: r,
|
|
2944
2944
|
sourceWidthPx: e.dimensions.width,
|
|
2945
2945
|
sourceHeightPx: e.dimensions.height
|
|
2946
2946
|
} : null).catch((e) => {
|
|
2947
|
-
if (e instanceof J ||
|
|
2947
|
+
if (e instanceof J || Bi(e) || Mt(e)) throw e;
|
|
2948
2948
|
return null;
|
|
2949
2949
|
}));
|
|
2950
2950
|
}
|
|
2951
2951
|
}
|
|
2952
2952
|
}
|
|
2953
|
-
return f.push(...(await Promise.all(p)).filter((e) => e !== null)),
|
|
2953
|
+
return f.push(...(await Promise.all(p)).filter((e) => e !== null)), Me(f, d);
|
|
2954
2954
|
}
|
|
2955
|
-
function*
|
|
2956
|
-
let n = (t, n, r) => t?.fillType === "image" &&
|
|
2955
|
+
function* qi(e) {
|
|
2956
|
+
let n = (t, n, r) => t?.fillType === "image" && Ga(t) ? {
|
|
2957
2957
|
fill: t,
|
|
2958
2958
|
width: n,
|
|
2959
2959
|
height: r,
|
|
@@ -2974,34 +2974,34 @@ function* Wi(e) {
|
|
|
2974
2974
|
let a = e.rows[i];
|
|
2975
2975
|
for (let o = 0; o < a.cells.length; o++) {
|
|
2976
2976
|
let s = a.cells[o];
|
|
2977
|
-
if (s.hMerge || s.vMerge || s.fill?.fillType !== "image" || !
|
|
2977
|
+
if (s.hMerge || s.vMerge || s.fill?.fillType !== "image" || !Ga(s.fill)) continue;
|
|
2978
2978
|
let c = (t[Math.min(o + (s.gridSpan || 1), e.cols.length)] ?? 0) - (t[o] ?? 0), l = r[Math.min(i + (s.rowSpan || 1), e.rows.length)] - r[i] || e.height, u = n(s.fill, c, l);
|
|
2979
2979
|
u && (yield u);
|
|
2980
2980
|
}
|
|
2981
2981
|
}
|
|
2982
2982
|
}
|
|
2983
2983
|
}
|
|
2984
|
-
function*
|
|
2985
|
-
for (let t of e.elements) yield*
|
|
2984
|
+
function* Ji(e) {
|
|
2985
|
+
for (let t of e.elements) yield* qi(t);
|
|
2986
2986
|
}
|
|
2987
|
-
function
|
|
2988
|
-
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? W(e.chart).length > 0 : !
|
|
2987
|
+
function Yi(e) {
|
|
2988
|
+
return e.background?.fillType === "image" ? !0 : e.elements.some((e) => e.type === "picture" ? !0 : e.type === "media" ? !!e.posterPath : e.type === "chart" ? W(e.chart).length > 0 : !qi(e).next().done || (e.type === "shape" || e.type === "table") && e.mathFallback?.elements.length ? !0 : e.type === "shape" && (e.fill?.fillType === "image" || !!e.textBody?.paragraphs.some((e) => Lr(e.bullet).type === "blip")));
|
|
2989
2989
|
}
|
|
2990
2990
|
var $ = D;
|
|
2991
|
-
function
|
|
2991
|
+
function Xi(e, t, n, r, i, a, o, s) {
|
|
2992
2992
|
let c = s?.glyph, { top: l, height: u } = s && c ? (() => {
|
|
2993
2993
|
let e = n + 1.2 * i * (1 - s.share), t = (c.ascent + c.descent) * i;
|
|
2994
2994
|
return {
|
|
2995
2995
|
top: e - t,
|
|
2996
2996
|
height: t
|
|
2997
2997
|
};
|
|
2998
|
-
})() :
|
|
2998
|
+
})() : cr(n, i);
|
|
2999
2999
|
e.fillStyle = a, e.fillRect(t, l, r, u), e.fillStyle = o;
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3001
|
+
function Zi(e, t, n, r, i, a, o = 0, s = 4 / 3, c, l) {
|
|
3002
3002
|
return re(e, t, n, r, i, a, o, s, void 0, c, l);
|
|
3003
3003
|
}
|
|
3004
|
-
function
|
|
3004
|
+
function Qi(e, t, n, r, i, a, o, s, c = t.drawSizePx ?? t.sizePx) {
|
|
3005
3005
|
if (t.underline && !t.underlineLineNoFill && (!t.noFill || t.underlineFill || t.underlineColor || t.underlineLine?.fill)) {
|
|
3006
3006
|
let l = t.underlineFill ? re(t.underlineFill, e, n, r, i, c * .05, 0, o * 12700) ?? "rgba(0,0,0,0)" : t.underlineLine?.fill ? re(t.underlineLine.fill, e, n, r, i, c * .05, 0, o * 12700) ?? "rgba(0,0,0,0)" : t.underlineColor ?? a, d = t.lineMetric?.decoration;
|
|
3007
3007
|
u(e, n, r, i, c, l, t.underlineStyle, s, t.underlineLine?.width ? Z(t.underlineLine.width, o) : void 0, d ? {
|
|
@@ -3010,7 +3010,7 @@ function Yi(e, t, n, r, i, a, o, s, c = t.drawSizePx ?? t.sizePx) {
|
|
|
3010
3010
|
} : void 0);
|
|
3011
3011
|
}
|
|
3012
3012
|
}
|
|
3013
|
-
function
|
|
3013
|
+
function $i(e, t, n, r, i, a, s) {
|
|
3014
3014
|
let c = t.drawSizePx ?? t.sizePx;
|
|
3015
3015
|
if (t.strikethrough && !t.noFill) {
|
|
3016
3016
|
let l = t.lineMetric?.decoration, u = l ? l.strikeThicknessEm * c : Math.max(1, c * g);
|
|
@@ -3025,35 +3025,35 @@ function Xi(e, t, n, r, i, a, s) {
|
|
|
3025
3025
|
}
|
|
3026
3026
|
}
|
|
3027
3027
|
}
|
|
3028
|
-
function
|
|
3029
|
-
|
|
3028
|
+
function ea(e, t, n, r, i, a, o, s) {
|
|
3029
|
+
Qi(e, t, n, r, i, a, o, s), $i(e, t, n, r, i, a, s);
|
|
3030
3030
|
}
|
|
3031
|
-
var
|
|
3032
|
-
function*
|
|
3031
|
+
var ta = /* @__PURE__ */ new WeakMap(), na = /* @__PURE__ */ new WeakSet();
|
|
3032
|
+
function* ra(e) {
|
|
3033
3033
|
if (e.type === "shape" && e.textBody) yield e.textBody;
|
|
3034
3034
|
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) e.textBody && (yield e.textBody);
|
|
3035
3035
|
}
|
|
3036
|
-
function
|
|
3036
|
+
function ia(e) {
|
|
3037
3037
|
let t = [];
|
|
3038
|
-
for (let n of e.elements) for (let e of
|
|
3038
|
+
for (let n of e.elements) for (let e of ra(n)) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3039
3039
|
nodes: e.nodes,
|
|
3040
3040
|
display: e.display
|
|
3041
3041
|
});
|
|
3042
3042
|
return t;
|
|
3043
3043
|
}
|
|
3044
|
-
async function
|
|
3045
|
-
let n =
|
|
3044
|
+
async function aa(e, t) {
|
|
3045
|
+
let n = ia(e);
|
|
3046
3046
|
if (n.length !== 0) {
|
|
3047
3047
|
try {
|
|
3048
3048
|
await t.loadMathJax();
|
|
3049
3049
|
} catch (e) {
|
|
3050
|
-
if (e instanceof J ||
|
|
3051
|
-
for (let e of n)
|
|
3050
|
+
if (e instanceof J || Mt(e)) throw e;
|
|
3051
|
+
for (let e of n) ta.has(e.nodes) || na.add(e.nodes);
|
|
3052
3052
|
return;
|
|
3053
3053
|
}
|
|
3054
|
-
for (let e of n) if (!
|
|
3055
|
-
let n = await t.mathMLToSvg(
|
|
3056
|
-
|
|
3054
|
+
for (let e of n) if (!ta.has(e.nodes)) try {
|
|
3055
|
+
let n = await t.mathMLToSvg(it(e.nodes, e.display)), r = await ct(n, "#000000");
|
|
3056
|
+
na.delete(e.nodes), ta.set(e.nodes, {
|
|
3057
3057
|
raster: r,
|
|
3058
3058
|
widthEm: n.widthEm,
|
|
3059
3059
|
ascentEm: n.ascentEm,
|
|
@@ -3061,39 +3061,39 @@ async function na(e, t) {
|
|
|
3061
3061
|
tinted: /* @__PURE__ */ new Map()
|
|
3062
3062
|
});
|
|
3063
3063
|
} catch (t) {
|
|
3064
|
-
if (t instanceof J ||
|
|
3065
|
-
|
|
3064
|
+
if (t instanceof J || Bi(t) || Mt(t)) throw t;
|
|
3065
|
+
na.add(e.nodes);
|
|
3066
3066
|
}
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
function
|
|
3070
|
-
let i = t.math, a = i.unavailable ? void 0 :
|
|
3071
|
-
if (i.width > 0 && o > 0) if (a) e.drawImage(
|
|
3069
|
+
function oa(e, t, n, r) {
|
|
3070
|
+
let i = t.math, a = i.unavailable ? void 0 : ta.get(i.nodes), o = i.ascent + i.descent;
|
|
3071
|
+
if (i.width > 0 && o > 0) if (a) e.drawImage(Ge(a, t.color), n, r, i.width, o);
|
|
3072
3072
|
else if (i.fallbackText) {
|
|
3073
3073
|
e.font = t.font, e.fillStyle = t.color;
|
|
3074
3074
|
let a = e.textBaseline, o = e.textAlign;
|
|
3075
3075
|
e.textBaseline = "top", e.textAlign = "left", e.fillText(i.fallbackText, n, r), e.textBaseline = a, e.textAlign = o;
|
|
3076
|
-
} else i.unavailable &&
|
|
3076
|
+
} else i.unavailable && Ft(e, "equation", {
|
|
3077
3077
|
x: n,
|
|
3078
3078
|
y: r,
|
|
3079
3079
|
width: i.width,
|
|
3080
3080
|
height: o
|
|
3081
3081
|
});
|
|
3082
3082
|
}
|
|
3083
|
-
function
|
|
3083
|
+
function sa(e, t, n, r, i) {
|
|
3084
3084
|
return t.patternFill ? re(t.patternFill, e, n, r, 0, 0, 0, i * 12700) ?? t.color : t.color;
|
|
3085
3085
|
}
|
|
3086
|
-
function
|
|
3086
|
+
function ca(e, t) {
|
|
3087
3087
|
let n = (e) => t.embeddedFontAliases?.get(e.trim().toLowerCase()) ?? e;
|
|
3088
3088
|
if (!e) return n(t.themeMinorFont ?? "sans-serif");
|
|
3089
3089
|
if (e.startsWith("+")) return n(e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif");
|
|
3090
3090
|
let r = e.split(",")[0].trim();
|
|
3091
3091
|
return r ? n(r) : t.themeMinorFont ?? "sans-serif";
|
|
3092
3092
|
}
|
|
3093
|
-
function
|
|
3093
|
+
function la(e) {
|
|
3094
3094
|
return !!e?.trim();
|
|
3095
3095
|
}
|
|
3096
|
-
var
|
|
3096
|
+
var ua = new Set([
|
|
3097
3097
|
"serif",
|
|
3098
3098
|
"sans-serif",
|
|
3099
3099
|
"monospace",
|
|
@@ -3101,32 +3101,32 @@ var sa = new Set([
|
|
|
3101
3101
|
"fantasy",
|
|
3102
3102
|
"system-ui"
|
|
3103
3103
|
]);
|
|
3104
|
-
function
|
|
3104
|
+
function da(e) {
|
|
3105
3105
|
let t = w(e);
|
|
3106
3106
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3107
3107
|
}
|
|
3108
|
-
function
|
|
3108
|
+
function fa(e) {
|
|
3109
3109
|
if (H(e)?.includes("Arabic")) return !0;
|
|
3110
3110
|
let t = e.toLowerCase();
|
|
3111
3111
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3112
3112
|
}
|
|
3113
|
-
function
|
|
3114
|
-
let s =
|
|
3115
|
-
if (
|
|
3113
|
+
function pa(t, r = t, i, a = "", o = !1) {
|
|
3114
|
+
let s = da(r), c = m(a), u = o ? H(r) : void 0, d = u && At(l(V, r.toLowerCase()), a, "any") ? u : void 0, f = d ? `${p(d)}, ` : "", h = ge(r), g = h ? `${p(h)}, ` : "", _ = n(s === "serif"), v = c ? `${e(_)}, ` : "";
|
|
3115
|
+
if (fa(r) && c) {
|
|
3116
3116
|
let n = i ? G(i, "sans") : [];
|
|
3117
3117
|
return `${p(t)}, ${f}${v}${n.length ? `${e(n)}, ` : ""}${s}`;
|
|
3118
3118
|
}
|
|
3119
3119
|
let y = s === "serif" ? "serif" : "sans", b = F(r), x = b ?? i, S = x ? G(x, y).filter((e) => e !== h) : [], C = S.length > 0 ? `${e(S)}, ` : "", w = `${e(y === "serif" ? M : ue)}, `;
|
|
3120
3120
|
return b ? `${p(t)}, ${f}${g}${C}${w}${v}${s}` : `${p(t)}, ${f}${g}${w}${C}${v}${s}`;
|
|
3121
3121
|
}
|
|
3122
|
-
function
|
|
3122
|
+
function ma(e) {
|
|
3123
3123
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function ha(e) {
|
|
3126
3126
|
let t = e.toLowerCase();
|
|
3127
3127
|
return /\bthin\b/.test(t) ? 100 : /\b(extra[- ]?light|ultra[- ]?light)\b/.test(t) ? 200 : /\blight\b/.test(t) ? 300 : /\b(black|heavy)\b/.test(t) ? 900 : /\b(extra[- ]?bold|ultra[- ]?bold)\b/.test(t) ? 800 : /\b(semi[- ]?bold|demi[- ]?bold)\b/.test(t) ? 600 : /\bbold\b/.test(t) ? 700 : /\bmedium\b/.test(t) ? 500 : /\b(normal|regular)\b/.test(t) ? 400 : null;
|
|
3128
3128
|
}
|
|
3129
|
-
function
|
|
3129
|
+
function ga(e, t, n, r, i, a, o, s) {
|
|
3130
3130
|
let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = te(m, h), _ = g?.getContext("2d");
|
|
3131
3131
|
if (!g || !_) return;
|
|
3132
3132
|
_.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), U(e, _, () => t(_), {
|
|
@@ -3138,7 +3138,7 @@ function pa(e, t, n, r, i, a, o, s) {
|
|
|
3138
3138
|
let e = te(m, h), t = e?.getContext("2d");
|
|
3139
3139
|
e && t && (b = e, x = t);
|
|
3140
3140
|
}
|
|
3141
|
-
b !== g &&
|
|
3141
|
+
b !== g && Br(x, g, {
|
|
3142
3142
|
x: n.x - u,
|
|
3143
3143
|
y: v,
|
|
3144
3144
|
w: n.w,
|
|
@@ -3165,9 +3165,9 @@ function pa(e, t, n, r, i, a, o, s) {
|
|
|
3165
3165
|
let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
|
|
3166
3166
|
e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.translate(n.x + Math.cos(E) * T, D + Math.sin(E) * T), e.scale(r.sx, r.sy), e.translate(-n.x, -D), e.drawImage(b, u, d), e.restore();
|
|
3167
3167
|
}
|
|
3168
|
-
function
|
|
3169
|
-
let l = n ? "italic " : "", u =
|
|
3170
|
-
if (
|
|
3168
|
+
function _a(t, n, r, i, a, o = "", s = !0, c = []) {
|
|
3169
|
+
let l = n ? "italic " : "", u = ca(i, a), { authoredFamily: d, officeRoute: f } = ya(u, t, n, a), p = ha(d), m = t ? "bold " : p ? `${p} ` : "", h = s ? f : void 0, g = fe(o) ? a.cjkFallback ?? F(a.themeMajorFont) ?? F(a.themeMinorFont) ?? void 0 : void 0;
|
|
3170
|
+
if (ua.has(u)) {
|
|
3171
3171
|
let t = g ? G(g, u === "serif" ? "serif" : "sans") : [], n = u === "monospace" ? ["Courier New", "Liberation Mono"] : u === "serif" ? [
|
|
3172
3172
|
...M,
|
|
3173
3173
|
"Times New Roman",
|
|
@@ -3180,34 +3180,34 @@ function ma(t, n, r, i, a, o = "", s = !0, c = []) {
|
|
|
3180
3180
|
];
|
|
3181
3181
|
return `${l}${m}${r}px ${t.length ? `${e([...n, ...t])}, ` : ""}${u}`;
|
|
3182
3182
|
}
|
|
3183
|
-
let _ =
|
|
3183
|
+
let _ = pa(h?.family ?? u, d, g, o, a.googleSubstitutes === !0), v = c.filter((e) => e !== u);
|
|
3184
3184
|
return `${l}${m}${r}px ${v.length ? _.replace(/^("(?:[^"\\]|\\.)*"), /u, (t, n) => `${n}, ${e(v)}, `) : _}`;
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3187
|
-
if (
|
|
3188
|
-
let { authoredFamily: i, embedded: a, officeRoute: o } =
|
|
3189
|
-
if (o) return
|
|
3190
|
-
if (!(a || !
|
|
3186
|
+
function va(e, t, n, r) {
|
|
3187
|
+
if (ua.has(e)) return;
|
|
3188
|
+
let { authoredFamily: i, embedded: a, officeRoute: o } = ya(ca(e, r), t, n, r);
|
|
3189
|
+
if (o) return br(a ? i : e, t, n);
|
|
3190
|
+
if (!(a || !ba(i, r))) return br(e, t, n);
|
|
3191
3191
|
}
|
|
3192
|
-
function
|
|
3193
|
-
let i = r.embeddedFontAuthoredFamilies?.get(e), a = i ?? e, o =
|
|
3192
|
+
function ya(e, t, n, r) {
|
|
3193
|
+
let i = r.embeddedFontAuthoredFamilies?.get(e), a = i ?? e, o = ha(a), s = `${a.toLowerCase()}:${t || o === 700 ? 700 : 400}:${n ? "italic" : "normal"}`, c = r.embeddedFontTuples?.has(s) ? void 0 : r.officeFontRoutes ? l(r.officeFontRoutes, xa(a, pr(a, t, n), n)) : void 0;
|
|
3194
3194
|
return {
|
|
3195
3195
|
authoredFamily: a,
|
|
3196
3196
|
embedded: i !== void 0,
|
|
3197
3197
|
officeRoute: c
|
|
3198
3198
|
};
|
|
3199
3199
|
}
|
|
3200
|
-
function
|
|
3201
|
-
return t.officeInstalledFamilies?.includes(
|
|
3200
|
+
function ba(e, t) {
|
|
3201
|
+
return t.officeInstalledFamilies?.includes(Ze(e)) === !0;
|
|
3202
3202
|
}
|
|
3203
|
-
function
|
|
3204
|
-
let r =
|
|
3203
|
+
function xa(e, t, n) {
|
|
3204
|
+
let r = Ze(e);
|
|
3205
3205
|
return t === 400 && !n ? r : `${r}:${t}:${n ? "italic" : "normal"}`;
|
|
3206
3206
|
}
|
|
3207
|
-
function
|
|
3208
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3207
|
+
function Sa(e) {
|
|
3208
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || Lr(e.bullet).type === "blip";
|
|
3209
3209
|
}
|
|
3210
|
-
function
|
|
3210
|
+
function Ca(e, t, n) {
|
|
3211
3211
|
let r = null;
|
|
3212
3212
|
for (let e of t.runs) if (e.type === "text" && e.fontSize != null) {
|
|
3213
3213
|
r = e.fontSize;
|
|
@@ -3216,17 +3216,17 @@ function ba(e, t, n) {
|
|
|
3216
3216
|
let i = r ?? t.defFontSize ?? e.defaultFontSize ?? 18;
|
|
3217
3217
|
return n.sizePts == null ? i * ((n.sizePct ?? 100) / 100) : n.sizePts;
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3219
|
+
function wa(e, t) {
|
|
3220
3220
|
return e ? 0 : t;
|
|
3221
3221
|
}
|
|
3222
|
-
var
|
|
3223
|
-
function
|
|
3222
|
+
var Ta = /[\p{Script=Devanagari}\p{Script=Thai}\p{Script=Bengali}\p{Script=Tamil}\p{Script=Telugu}\p{Script=Kannada}\p{Script=Malayalam}\p{Script=Gujarati}\p{Script=Gurmukhi}\p{Script=Oriya}\p{Script=Sinhala}\p{Script=Khmer}\p{Script=Lao}\p{Script=Myanmar}\p{Script=Tibetan}]/u;
|
|
3223
|
+
function Ea(e, t) {
|
|
3224
3224
|
return t != null && t !== 0 ? e * .65 : e;
|
|
3225
3225
|
}
|
|
3226
|
-
function
|
|
3226
|
+
function Da(e, t, n, r, i, a, o, s) {
|
|
3227
3227
|
let c = (t.defaultFontSize ?? 18) * h * a;
|
|
3228
3228
|
for (let l of t.paragraphs) {
|
|
3229
|
-
let u = Z(l.marL, a), d = Z(l.marR, a), f = Z(l.indent, a), p =
|
|
3229
|
+
let u = Z(l.marL, a), d = Z(l.marR, a), f = Z(l.indent, a), p = wa(Sa(l), f), m = n - r - i - u - d - p, { input: g } = Ma(l, l.defFontSize == null ? c : l.defFontSize * h * a, "", a, t.defaultBold ?? !1, t.defaultItalic ?? !1, 1, s, o), _ = 0, v;
|
|
3230
3230
|
for (let t of g) {
|
|
3231
3231
|
if (t.type !== "text") {
|
|
3232
3232
|
v = void 0;
|
|
@@ -3234,22 +3234,22 @@ function wa(e, t, n, r, i, a, o, s) {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
e.font = t.style.font;
|
|
3236
3236
|
let n = t.style.letterSpacingPx ?? 0;
|
|
3237
|
-
if (_ +=
|
|
3237
|
+
if (_ += ja(e, t.text, n), v?.sourceRunId === t.style.sourceRunId && (_ += n), v = t.style, _ > m) return !0;
|
|
3238
3238
|
}
|
|
3239
3239
|
}
|
|
3240
3240
|
return !1;
|
|
3241
3241
|
}
|
|
3242
|
-
function
|
|
3242
|
+
function Oa(e) {
|
|
3243
3243
|
let t = 0;
|
|
3244
3244
|
for (let n of e) t++;
|
|
3245
3245
|
return t;
|
|
3246
3246
|
}
|
|
3247
|
-
var
|
|
3248
|
-
function
|
|
3249
|
-
let t =
|
|
3247
|
+
var ka = /* @__PURE__ */ new WeakMap();
|
|
3248
|
+
function Aa(e) {
|
|
3249
|
+
let t = ka.get(e);
|
|
3250
3250
|
if (t != null) return t;
|
|
3251
3251
|
let n = e, r = n.letterSpacing;
|
|
3252
|
-
if (typeof r != "string") return
|
|
3252
|
+
if (typeof r != "string") return ka.set(e, !1), !1;
|
|
3253
3253
|
let i = !1;
|
|
3254
3254
|
try {
|
|
3255
3255
|
n.letterSpacing = "0px";
|
|
@@ -3264,11 +3264,11 @@ function Da(e) {
|
|
|
3264
3264
|
n.letterSpacing = r;
|
|
3265
3265
|
} catch {}
|
|
3266
3266
|
}
|
|
3267
|
-
return
|
|
3267
|
+
return ka.set(e, i), i;
|
|
3268
3268
|
}
|
|
3269
|
-
function
|
|
3269
|
+
function ja(e, t, n) {
|
|
3270
3270
|
let r = e, i = r.letterSpacing;
|
|
3271
|
-
if (n !== 0 &&
|
|
3271
|
+
if (n !== 0 && Aa(e)) try {
|
|
3272
3272
|
r.letterSpacing = `${n}px`;
|
|
3273
3273
|
let i = e.measureText(t).width;
|
|
3274
3274
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3277,13 +3277,13 @@ function Oa(e, t, n) {
|
|
|
3277
3277
|
r.letterSpacing = i;
|
|
3278
3278
|
} catch {}
|
|
3279
3279
|
}
|
|
3280
|
-
let a = Math.max(0,
|
|
3280
|
+
let a = Math.max(0, Oa(t) - 1);
|
|
3281
3281
|
return e.measureText(t).width + n * a;
|
|
3282
3282
|
}
|
|
3283
|
-
function
|
|
3284
|
-
let d = [], f = e.runs.map((e) => e.type === "text" ?
|
|
3283
|
+
function Ma(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
3284
|
+
let d = [], f = e.runs.map((e) => e.type === "text" ? mn(e, s) : null), p = [], g = "";
|
|
3285
3285
|
for (let e of f) p.push(g.length), g += e ?? "\n";
|
|
3286
|
-
let _ =
|
|
3286
|
+
let _ = Ue(g);
|
|
3287
3287
|
_.push(g.length);
|
|
3288
3288
|
let v = 0, y = (e) => {
|
|
3289
3289
|
for (; v < _.length && _[v] < e;) v++;
|
|
@@ -3292,7 +3292,7 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3292
3292
|
if (e.mathFallbacks?.length) {
|
|
3293
3293
|
S = /* @__PURE__ */ new Map();
|
|
3294
3294
|
let t = [0];
|
|
3295
|
-
for (let n of e.runs) t.push(t[t.length - 1] + (n.type === "math" &&
|
|
3295
|
+
for (let n of e.runs) t.push(t[t.length - 1] + (n.type === "math" && na.has(n.nodes) ? 1 : 0));
|
|
3296
3296
|
for (let n of e.mathFallbacks) {
|
|
3297
3297
|
let { start: r, end: i } = n;
|
|
3298
3298
|
Number.isInteger(r) && Number.isInteger(i) && r >= 0 && i <= e.runs.length && i > r && e.runs[r].type === "math" && t[i] > t[r] && i >= (S.get(r)?.end ?? r) && S.set(r, n);
|
|
@@ -3303,23 +3303,23 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3303
3303
|
if (s < C) continue;
|
|
3304
3304
|
let _ = S?.get(s);
|
|
3305
3305
|
if (_ && (C = _.end), g.type !== "text" && (b = null), g.type === "break") {
|
|
3306
|
-
let s = g.fontSize == null ? t : g.fontSize * h * r * o, l =
|
|
3306
|
+
let s = g.fontSize == null ? t : g.fontSize * h * r * o, l = ca(g.fontFamily ?? e.defFontFamily ?? null, c), u = g.bold ?? e.defBold ?? i, f = g.italic ?? e.defItalic ?? a, p = g.fontSize != null || g.fontFamily != null || g.bold != null || g.italic != null ? {
|
|
3307
3307
|
text: "",
|
|
3308
3308
|
sizePx: s,
|
|
3309
3309
|
color: n,
|
|
3310
|
-
font:
|
|
3310
|
+
font: _a(u, f, s, l, c, ""),
|
|
3311
3311
|
underline: !1,
|
|
3312
3312
|
strikethrough: !1,
|
|
3313
|
-
lineMetric:
|
|
3313
|
+
lineMetric: va(l, u, f, c)
|
|
3314
3314
|
} : void 0;
|
|
3315
3315
|
x.set(d.length, {
|
|
3316
3316
|
text: "",
|
|
3317
3317
|
sizePx: s,
|
|
3318
3318
|
color: n,
|
|
3319
|
-
font:
|
|
3319
|
+
font: _a(u, f, s, l, c, ""),
|
|
3320
3320
|
underline: !1,
|
|
3321
3321
|
strikethrough: !1,
|
|
3322
|
-
lineMetric:
|
|
3322
|
+
lineMetric: va(l, u, f, c),
|
|
3323
3323
|
markFace: {
|
|
3324
3324
|
family: l,
|
|
3325
3325
|
bold: u,
|
|
@@ -3332,7 +3332,7 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3332
3332
|
continue;
|
|
3333
3333
|
}
|
|
3334
3334
|
if (g.type === "math") {
|
|
3335
|
-
let e = _ ? void 0 :
|
|
3335
|
+
let e = _ ? void 0 : ta.get(g.nodes), i = g.fontSize == null ? t : g.fontSize * h * r * o, a = !!_ || !e && na.has(g.nodes), s = _?.text ?? (a ? g.fallbackText : void 0);
|
|
3336
3336
|
u && (u.font = `${i}px sans-serif`);
|
|
3337
3337
|
let c = e ? e.widthEm * i : a ? u?.measureText(s ?? "Equation unavailable").width ?? 0 : 0, l = {
|
|
3338
3338
|
text: "",
|
|
@@ -3359,17 +3359,17 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3359
3359
|
});
|
|
3360
3360
|
continue;
|
|
3361
3361
|
}
|
|
3362
|
-
let v = g.fontSize == null ? t : g.fontSize * h * r * o, w =
|
|
3362
|
+
let v = g.fontSize == null ? t : g.fontSize * h * r * o, w = Ea(v, g.baseline ?? void 0), T = ca(g.fontFamily ?? e.defFontFamily ?? null, c), E = g.fontFamilySym ? ca(g.fontFamilySym, c) : null, D = g.bold ?? e.defBold ?? i, k = g.italic ?? e.defItalic ?? a, A = f[s] ?? "", j = g.fontFamilyEa ? [] : Mi(g.fontFamily ?? e.defFontFamily ?? c.themeMinorFont ?? null, [...A].filter((e) => rt(e.codePointAt(0) ?? 0)).join("")), M = g.fontFamilyEa ? ca(g.fontFamilyEa, c) : j[0], N = g.fontFamilyCs ? ca(g.fontFamilyCs, c) : null, P = p[s], F = P + A.length;
|
|
3363
3363
|
if (b && A) {
|
|
3364
3364
|
let e = Math.min(y(P), F);
|
|
3365
3365
|
e > P && (b.text += A.slice(0, e - P), A = A.slice(e - P), P = e);
|
|
3366
3366
|
}
|
|
3367
|
-
let I =
|
|
3367
|
+
let I = _a(D, k, w, M, c, A, !0, j.slice(1)), L = /* @__PURE__ */ new Map(), R = (e, t, n, r = []) => {
|
|
3368
3368
|
let i = `${e}\0${+!!n}\0${+!!fe(t)}\0${+!!m(t)}\0${r.join("\0")}`, a = L.get(i);
|
|
3369
3369
|
if (a !== void 0) return a;
|
|
3370
|
-
let o =
|
|
3370
|
+
let o = _a(D, k, w, e, c, t, n, r);
|
|
3371
3371
|
return L.set(i, o), o;
|
|
3372
|
-
}, z = (e, t) => R(e, t, !0,
|
|
3372
|
+
}, z = (e, t) => R(e, t, !0, vi), B = (g.letterSpacing ?? 0) * h * r, V = {
|
|
3373
3373
|
text: "",
|
|
3374
3374
|
font: "",
|
|
3375
3375
|
sizePx: v,
|
|
@@ -3393,8 +3393,8 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3393
3393
|
reflection: g.reflection,
|
|
3394
3394
|
outline: g.outline,
|
|
3395
3395
|
highlight: g.highlight ? $(g.highlight) : void 0,
|
|
3396
|
-
hyperlink:
|
|
3397
|
-
}, H = "", U = "", W, G = T, ee =
|
|
3396
|
+
hyperlink: Vr(g.hyperlink)
|
|
3397
|
+
}, H = "", U = "", W, G = T, ee = va(T, D, k, c) ?? null, te = () => {
|
|
3398
3398
|
H && d.push({
|
|
3399
3399
|
type: "text",
|
|
3400
3400
|
text: H,
|
|
@@ -3407,16 +3407,16 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3407
3407
|
faceFamilyLatin: T
|
|
3408
3408
|
}
|
|
3409
3409
|
}), H = "";
|
|
3410
|
-
}, K = 0, ne = !1, q = "", re = l &&
|
|
3410
|
+
}, K = 0, ne = !1, q = "", re = l && Pa.test(g.lang ?? "");
|
|
3411
3411
|
for (; K < A.length;) {
|
|
3412
3412
|
let t = Math.min(y(P + K + 1), F) - P, n = A.slice(K, t);
|
|
3413
3413
|
K = t, ne = !0;
|
|
3414
|
-
let r = String.fromCodePoint(n.codePointAt(0) ?? 0), i = n, a = r.codePointAt(0) ?? 0, o = !
|
|
3415
|
-
if (/[\uf020-\uf0ff]/u.test(r) && (E != null ||
|
|
3416
|
-
let e = E ?? T, t =
|
|
3417
|
-
i = t + n.slice(r.length), d =
|
|
3414
|
+
let r = String.fromCodePoint(n.codePointAt(0) ?? 0), i = n, a = r.codePointAt(0) ?? 0, o = !rt(a) && !!g.fontFamilyEa && Li(a, g.lang), s = o || rt(a), l = O(a) || Ta.test(r), u = l ? N ?? Si(r) : T, d = o ? R(M, n, !0) : s ? I : l ? z(u, n) : R(T, n, la(g.fontFamily ?? e.defFontFamily)), f = s ? M : u, p = va(f, D, k, c);
|
|
3415
|
+
if (/[\uf020-\uf0ff]/u.test(r) && (E != null || Ct(T))) {
|
|
3416
|
+
let e = E ?? T, t = St(r, e);
|
|
3417
|
+
i = t + n.slice(r.length), d = _a(D, k, w, t === r ? e : "sans-serif", c, i), p = void 0, f = t === r ? e : "sans-serif";
|
|
3418
3418
|
}
|
|
3419
|
-
let m = re && (
|
|
3419
|
+
let m = re && (Fa(n) && Ia(q) || Fa(q) && Ia(n));
|
|
3420
3420
|
H && (d !== U || p !== W || m) && te(), H += i, U = d, W = p, G = f, q = n;
|
|
3421
3421
|
}
|
|
3422
3422
|
if (te(), ne) {
|
|
@@ -3426,30 +3426,30 @@ function ka(e, t, n, r, i, a, o, s, c, l = !1, u) {
|
|
|
3426
3426
|
}
|
|
3427
3427
|
return {
|
|
3428
3428
|
input: d,
|
|
3429
|
-
sameStyle: (e, t) => e.font === t.font && e.color === t.color && e.patternFill === t.patternFill && e.noFill === t.noFill && e.sizePx === t.sizePx && e.drawSizePx === t.drawSizePx && e.underline === t.underline && e.underlineStyle === t.underlineStyle && e.underlineColor === t.underlineColor && e.underlineFill === t.underlineFill && e.underlineLine === t.underlineLine && e.underlineLineNoFill === t.underlineLineNoFill && e.strikethrough === t.strikethrough && e.strikeDouble === t.strikeDouble && e.letterSpacingPx === t.letterSpacingPx && e.baseline === t.baseline && e.shadow === t.shadow && e.reflection === t.reflection && e.outline === t.outline && e.highlight === t.highlight &&
|
|
3429
|
+
sameStyle: (e, t) => e.font === t.font && e.color === t.color && e.patternFill === t.patternFill && e.noFill === t.noFill && e.sizePx === t.sizePx && e.drawSizePx === t.drawSizePx && e.underline === t.underline && e.underlineStyle === t.underlineStyle && e.underlineColor === t.underlineColor && e.underlineFill === t.underlineFill && e.underlineLine === t.underlineLine && e.underlineLineNoFill === t.underlineLineNoFill && e.strikethrough === t.strikethrough && e.strikeDouble === t.strikeDouble && e.letterSpacingPx === t.letterSpacingPx && e.baseline === t.baseline && e.shadow === t.shadow && e.reflection === t.reflection && e.outline === t.outline && e.highlight === t.highlight && ma(e.hyperlink) === ma(t.hyperlink) && (!e.letterSpacingPx || e.sourceRunId === t.sourceRunId) && e.lineMetric === t.lineMetric && e.lineMetricLatin === t.lineMetricLatin,
|
|
3430
3430
|
breakMarks: x
|
|
3431
3431
|
};
|
|
3432
3432
|
}
|
|
3433
|
-
var
|
|
3434
|
-
function
|
|
3433
|
+
var Na = /^ja(?:[-_]|$)/i, Pa = /^(?:en-US|ja-JP)$/i;
|
|
3434
|
+
function Fa(e) {
|
|
3435
3435
|
return e === "“" || e === "”";
|
|
3436
3436
|
}
|
|
3437
|
-
function
|
|
3437
|
+
function Ia(e) {
|
|
3438
3438
|
return /^\p{Script=Han}/u.test(e);
|
|
3439
3439
|
}
|
|
3440
|
-
function
|
|
3441
|
-
return
|
|
3440
|
+
function La(e, t, n, r) {
|
|
3441
|
+
return Na.test(e.lang ?? "") && Na.test(t.lang ?? "") && (Fa(n) && Ia(r) || Ia(n) && Fa(r));
|
|
3442
3442
|
}
|
|
3443
|
-
function
|
|
3443
|
+
function Ra(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
3444
3444
|
themeMajorFont: null,
|
|
3445
3445
|
themeMinorFont: null,
|
|
3446
3446
|
dpr: 1
|
|
3447
3447
|
}, f = 0) {
|
|
3448
|
-
let { input: p, sameStyle: m, breakMarks: g } =
|
|
3448
|
+
let { input: p, sameStyle: m, breakMarks: g } = Ma(t, r, i, a, s, c, l, u, d, !0, e), _ = Z(t.marR, a), v = fn(p, {
|
|
3449
3449
|
maxWidth: n,
|
|
3450
3450
|
firstLineIndent: f,
|
|
3451
3451
|
measureText(t, n) {
|
|
3452
|
-
return e.font = n.font,
|
|
3452
|
+
return e.font = n.font, ci(e, t, n.letterSpacingPx ?? 0);
|
|
3453
3453
|
},
|
|
3454
3454
|
sameStyle: m,
|
|
3455
3455
|
boundaryAdvance: (e, t) => e.sourceRunId === t.sourceRunId ? t.letterSpacingPx ?? 0 : 0,
|
|
@@ -3461,23 +3461,23 @@ function Fa(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
3461
3461
|
tabStartPen: (e) => t.rtl ? _ : o + (e === 0 ? f : 0),
|
|
3462
3462
|
nonMonotoneMeasure: p.some((e) => e.type === "text" && (e.style.letterSpacingPx ?? 0) < 0),
|
|
3463
3463
|
eastAsianLineBreak: t.eaLnBrk !== !1,
|
|
3464
|
-
kinsokuAcrossRuns:
|
|
3465
|
-
}), y = t.endRunProperties, b = y?.fontSize == null ? r : y.fontSize * h * a * l, x =
|
|
3464
|
+
kinsokuAcrossRuns: La
|
|
3465
|
+
}), y = t.endRunProperties, b = y?.fontSize == null ? r : y.fontSize * h * a * l, x = ca(y?.fontFamily ?? t.defFontFamily ?? null, d), S = y?.bold ?? t.defBold ?? s, C = y?.italic ?? t.defItalic ?? c, w = y && (y.fontSize != null || y.fontFamily != null || y.bold != null || y.italic != null) ? {
|
|
3466
3466
|
text: "",
|
|
3467
3467
|
sizePx: b,
|
|
3468
3468
|
color: i,
|
|
3469
|
-
font:
|
|
3469
|
+
font: _a(S, C, b, x, d, ""),
|
|
3470
3470
|
underline: !1,
|
|
3471
3471
|
strikethrough: !1,
|
|
3472
|
-
lineMetric:
|
|
3472
|
+
lineMetric: va(x, S, C, d)
|
|
3473
3473
|
} : void 0, T = y ? {
|
|
3474
3474
|
text: "",
|
|
3475
3475
|
sizePx: b,
|
|
3476
3476
|
color: i,
|
|
3477
|
-
font:
|
|
3477
|
+
font: _a(S, C, b, x, d, ""),
|
|
3478
3478
|
underline: !1,
|
|
3479
3479
|
strikethrough: !1,
|
|
3480
|
-
lineMetric:
|
|
3480
|
+
lineMetric: va(x, S, C, d),
|
|
3481
3481
|
markFace: {
|
|
3482
3482
|
family: x,
|
|
3483
3483
|
bold: S,
|
|
@@ -3494,7 +3494,7 @@ function Fa(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
3494
3494
|
...e,
|
|
3495
3495
|
text: "",
|
|
3496
3496
|
sizePx: n.sizePx,
|
|
3497
|
-
font:
|
|
3497
|
+
font: _a(i, a, n.sizePx, r, d, "")
|
|
3498
3498
|
};
|
|
3499
3499
|
};
|
|
3500
3500
|
return v.map((e, t) => {
|
|
@@ -3530,34 +3530,34 @@ function Fa(e, t, n, r, i, a, o, s = !1, c = !1, l = 1, u, d = {
|
|
|
3530
3530
|
};
|
|
3531
3531
|
});
|
|
3532
3532
|
}
|
|
3533
|
-
var
|
|
3534
|
-
async function
|
|
3533
|
+
var za = { paint: () => {} };
|
|
3534
|
+
async function Ba(e, t, n, i, a, o, s, c) {
|
|
3535
3535
|
if (e && e.fillType === "image") {
|
|
3536
3536
|
let l = (e) => {
|
|
3537
3537
|
e.fillStyle = "#FFFFFF", e.fillRect(0, 0, t, n);
|
|
3538
3538
|
};
|
|
3539
3539
|
if (!e.imagePath || !e.mimeType || !a) return { paint: l };
|
|
3540
|
-
let u = (e) =>
|
|
3541
|
-
l(e),
|
|
3540
|
+
let u = (e) => zt(e, "tiff") ? { paint: (e) => {
|
|
3541
|
+
l(e), Ft(e, "tiff", {
|
|
3542
3542
|
x: 0,
|
|
3543
3543
|
y: 0,
|
|
3544
3544
|
width: t,
|
|
3545
3545
|
height: n
|
|
3546
3546
|
});
|
|
3547
|
-
} } : e instanceof J ||
|
|
3547
|
+
} } : e instanceof J || Bi(e) || Mt(e) || Ut(e) ? {
|
|
3548
3548
|
paint: l,
|
|
3549
3549
|
failure: { error: e }
|
|
3550
3550
|
} : { paint: l }, d, f;
|
|
3551
3551
|
try {
|
|
3552
|
-
let l = c && !Q(e) ?
|
|
3553
|
-
f = e.tile ? await
|
|
3552
|
+
let l = c && !Q(e) ? Ui(c, Hi(e.imagePath, Q(e))) : void 0;
|
|
3553
|
+
f = e.tile ? await zi(e, Xe(e.imagePath, e.mimeType, a)) : void 0, d = await Qe(e.imagePath, e.mimeType, Q(e.tile ? {
|
|
3554
3554
|
...e,
|
|
3555
3555
|
dpi: void 0
|
|
3556
3556
|
} : e), a, {
|
|
3557
3557
|
...e.blipEffects?.length && !e.tile ? ((e) => ({
|
|
3558
3558
|
widthPt: e.width,
|
|
3559
3559
|
heightPt: e.height
|
|
3560
|
-
}))(r(t / i / h, n / i / h, e.srcRect, e.fillRect)) :
|
|
3560
|
+
}))(r(t / i / h, n / i / h, e.srcRect, e.fillRect)) : Vi(e, t / i / h, n / i / h),
|
|
3561
3561
|
...l ?? {},
|
|
3562
3562
|
tiff: o,
|
|
3563
3563
|
svgDecoder: s
|
|
@@ -3573,13 +3573,13 @@ async function La(e, t, n, i, a, o, s, c) {
|
|
|
3573
3573
|
let a = e.fillRect ?? {}, o = a.l ?? 0, s = a.t ?? 0, c = a.r ?? 0, l = a.b ?? 0, u = o * t, d = s * n, m = t * (1 - o - c), h = n * (1 - s - l);
|
|
3574
3574
|
r.save();
|
|
3575
3575
|
try {
|
|
3576
|
-
r.beginPath(), r.rect(0, 0, t, n), r.clip(), e.alpha != null && (r.globalAlpha = e.alpha), e.tile ?
|
|
3576
|
+
r.beginPath(), r.rect(0, 0, t, n), r.clip(), e.alpha != null && (r.globalAlpha = e.alpha), e.tile ? Ua(r, p, e.tile, t, n, i, e.srcRect, f?.dimensions ?? void 0) : he(r, p, e.srcRect, u, d, m, h);
|
|
3577
3577
|
} finally {
|
|
3578
3578
|
r.restore();
|
|
3579
3579
|
}
|
|
3580
3580
|
} catch (i) {
|
|
3581
|
-
if (
|
|
3582
|
-
|
|
3581
|
+
if (zt(i, "tiff")) {
|
|
3582
|
+
Ft(r, "tiff", {
|
|
3583
3583
|
x: 0,
|
|
3584
3584
|
y: 0,
|
|
3585
3585
|
width: t,
|
|
@@ -3587,16 +3587,16 @@ async function La(e, t, n, i, a, o, s, c) {
|
|
|
3587
3587
|
});
|
|
3588
3588
|
return;
|
|
3589
3589
|
}
|
|
3590
|
-
if (i instanceof J ||
|
|
3591
|
-
if (e.blipEffects?.length) throw
|
|
3590
|
+
if (i instanceof J || Bi(i) || Mt(i) || Ut(i)) throw i;
|
|
3591
|
+
if (e.blipEffects?.length) throw Lt(i);
|
|
3592
3592
|
}
|
|
3593
3593
|
} };
|
|
3594
3594
|
}
|
|
3595
3595
|
return { paint: (r) => {
|
|
3596
|
-
r.fillStyle =
|
|
3596
|
+
r.fillStyle = Zi(e, r, 0, 0, t, n, 0, i * 12700) ?? "#FFFFFF", r.fillRect(0, 0, t, n);
|
|
3597
3597
|
} };
|
|
3598
3598
|
}
|
|
3599
|
-
function
|
|
3599
|
+
function Va(e, t, n, r, i) {
|
|
3600
3600
|
let a;
|
|
3601
3601
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
3602
3602
|
let o;
|
|
@@ -3605,19 +3605,19 @@ function Ra(e, t, n, r, i) {
|
|
|
3605
3605
|
ay: o
|
|
3606
3606
|
};
|
|
3607
3607
|
}
|
|
3608
|
-
function
|
|
3608
|
+
function Ha(e, t, n) {
|
|
3609
3609
|
return {
|
|
3610
3610
|
width: e * (n ? 1 - n.l - n.r : 1),
|
|
3611
3611
|
height: t * (n ? 1 - n.t - n.b : 1)
|
|
3612
3612
|
};
|
|
3613
3613
|
}
|
|
3614
|
-
function
|
|
3614
|
+
function Ua(e, n, r, a, o, s, c, l, u = 96, f = {
|
|
3615
3615
|
x: 0,
|
|
3616
3616
|
y: 0,
|
|
3617
3617
|
w: a,
|
|
3618
3618
|
h: o
|
|
3619
3619
|
}) {
|
|
3620
|
-
let p = E(n), m =
|
|
3620
|
+
let p = E(n), m = Ha(l?.width ?? p?.width ?? n.width, l?.height ?? p?.height ?? n.height, c), h = i * 96 / u, g = m.width * h * (r.sx ?? 1) * s, _ = m.height * h * (r.sy ?? 1) * s;
|
|
3621
3621
|
if (![g, _].every((e) => Number.isFinite(e) && e > 0)) throw new t("unsupported-image-effect", "Unrepresentable picture tile size");
|
|
3622
3622
|
let v = r.flip === "x" || r.flip === "xy", y = r.flip === "y" || r.flip === "xy", b = g * (v ? 2 : 1), x = _ * (y ? 2 : 1);
|
|
3623
3623
|
if (!Number.isFinite(b) || !Number.isFinite(x)) throw new t("unsupported-image-effect", "Unrepresentable picture tile cell");
|
|
@@ -3634,33 +3634,33 @@ function Ba(e, n, r, a, o, s, c, l, u = 96, f = {
|
|
|
3634
3634
|
let A = (e, t, r, i) => {
|
|
3635
3635
|
k.save(), k.translate(e + (r ? g : 0), t + (i ? _ : 0)), k.scale(r ? -1 : 1, i ? -1 : 1), he(k, n, c, 0, 0, g, _), k.restore();
|
|
3636
3636
|
}, j = q(n, c != null), M = Math.ceil(j.x / (v ? 2 : 1)), N = Math.ceil(j.y / (y ? 2 : 1)), P = (2 * M + 1) * (2 * N + 1) * (v ? 2 : 1) * (y ? 2 : 1);
|
|
3637
|
-
if (!Number.isSafeInteger(P) || P >
|
|
3637
|
+
if (!Number.isSafeInteger(P) || P > Nt * Nt) throw O.width = 0, new Pt("image-effect-work", Nt * Nt, Number.isSafeInteger(P) ? P : 2 ** 53 - 1);
|
|
3638
3638
|
let F = P > (v ? 2 : 1) * (y ? 2 : 1) ? P * S * C : 0;
|
|
3639
|
-
if (!Number.isSafeInteger(F) || F > 134217728) throw O.width = 0, new
|
|
3639
|
+
if (!Number.isSafeInteger(F) || F > 134217728) throw O.width = 0, new Pt("image-effect-work", jt, Number.isSafeInteger(F) ? F : 2 ** 53 - 1);
|
|
3640
3640
|
for (let e = -N; e <= N; e++) for (let t = -M; t <= M; t++) {
|
|
3641
3641
|
let n = t * b, r = e * x;
|
|
3642
3642
|
A(n, r, !1, !1), v && A(n + g, r, !0, !1), y && A(n, r + _, !1, !0), v && y && A(n + g, r + _, !0, !0);
|
|
3643
3643
|
}
|
|
3644
3644
|
let I = e.createPattern(O, "repeat");
|
|
3645
3645
|
if (!I) throw new t("unsupported-image-effect", "Picture tile surface unavailable");
|
|
3646
|
-
let { ax: L, ay: R } =
|
|
3646
|
+
let { ax: L, ay: R } = Va(r.algn ?? "tl", a, o, g, _), z = L + Z(r.tx ?? 0, s), B = R + Z(r.ty ?? 0, s);
|
|
3647
3647
|
if (![z, B].every(Number.isFinite)) throw new t("unsupported-image-effect", "Unrepresentable picture tile phase");
|
|
3648
3648
|
return typeof I.setTransform == "function" && typeof DOMMatrix < "u" ? (I.setTransform(new DOMMatrix().translateSelf(z, B).scaleSelf(1 / T, 1 / D)), e.fillStyle = I, e.fillRect(f.x, f.y, f.w, f.h)) : (e.save(), e.translate(z, B), e.scale(1 / T, 1 / D), e.fillStyle = I, e.fillRect((f.x - z) * T, (f.y - B) * D, f.w * T, f.h * D), e.restore()), !0;
|
|
3649
3649
|
}
|
|
3650
|
-
function
|
|
3650
|
+
function Wa(e, t, n, i = {}) {
|
|
3651
3651
|
return JSON.stringify([
|
|
3652
3652
|
e.svgImagePath ?? null,
|
|
3653
|
-
|
|
3653
|
+
Hi(e.imagePath, Q(e, i)),
|
|
3654
3654
|
...e.blipEffects?.length ? ((e) => [e.width, e.height])(e.tile ? {
|
|
3655
3655
|
width: t,
|
|
3656
3656
|
height: n
|
|
3657
3657
|
} : r(t, n, e.srcRect, e.fillRect)) : []
|
|
3658
3658
|
]);
|
|
3659
3659
|
}
|
|
3660
|
-
function
|
|
3660
|
+
function Ga(e) {
|
|
3661
3661
|
return e.tile != null != (e.stretch === !0);
|
|
3662
3662
|
}
|
|
3663
|
-
function
|
|
3663
|
+
function Ka(e, n, r, i, a, o = !1, s = {
|
|
3664
3664
|
rotation: 0,
|
|
3665
3665
|
flipH: !1,
|
|
3666
3666
|
flipV: !1
|
|
@@ -3672,7 +3672,7 @@ function Ua(e, n, r, i, a, o = !1, s = {
|
|
|
3672
3672
|
i.h,
|
|
3673
3673
|
a
|
|
3674
3674
|
].every(Number.isFinite) || i.w < 0 || i.h < 0) throw new t("unsupported-image-effect", "Invalid image fill geometry");
|
|
3675
|
-
if (!r || !(i.w > 0) || !(i.h > 0) || !
|
|
3675
|
+
if (!r || !(i.w > 0) || !(i.h > 0) || !Ga(n)) return !1;
|
|
3676
3676
|
let { x: c, y: l, w: u, h: d } = i;
|
|
3677
3677
|
e.save();
|
|
3678
3678
|
try {
|
|
@@ -3686,14 +3686,14 @@ function Ua(e, n, r, i, a, o = !1, s = {
|
|
|
3686
3686
|
let t = Math.abs(Math.cos(i)), o = Math.abs(Math.sin(i)), s = u * t + d * o, f = u * o + d * t;
|
|
3687
3687
|
e.translate(c, l);
|
|
3688
3688
|
try {
|
|
3689
|
-
return
|
|
3689
|
+
return Ua(e, r.image, n.tile, u, d, a, n.srcRect, r.intrinsicSize, n.dpi && n.dpi > 0 ? n.dpi : 96, {
|
|
3690
3690
|
x: (u - s) / 2,
|
|
3691
3691
|
y: (d - f) / 2,
|
|
3692
3692
|
w: s,
|
|
3693
3693
|
h: f
|
|
3694
3694
|
});
|
|
3695
3695
|
} catch (e) {
|
|
3696
|
-
throw n.blipEffects?.length ?
|
|
3696
|
+
throw n.blipEffects?.length ? Lt(e) : e;
|
|
3697
3697
|
}
|
|
3698
3698
|
}
|
|
3699
3699
|
let f = n.fillRect ?? {}, p = c + (f.l ?? 0) * u, m = l + (f.t ?? 0) * d, h = (1 - (f.l ?? 0) - (f.r ?? 0)) * u, g = (1 - (f.t ?? 0) - (f.b ?? 0)) * d;
|
|
@@ -3708,30 +3708,30 @@ function Ua(e, n, r, i, a, o = !1, s = {
|
|
|
3708
3708
|
e.restore();
|
|
3709
3709
|
}
|
|
3710
3710
|
}
|
|
3711
|
-
function
|
|
3711
|
+
function qa(e, t, n) {
|
|
3712
3712
|
if (!t) return;
|
|
3713
3713
|
let r = t.dir * Math.PI / 180, i = Z(t.dist, n);
|
|
3714
3714
|
e.shadowColor = $(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
3715
3715
|
}
|
|
3716
|
-
function
|
|
3716
|
+
function Ja(e, t, n) {
|
|
3717
3717
|
t && (e.shadowColor = $(t.color, t.alpha), e.shadowBlur = Z(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
3718
3718
|
}
|
|
3719
|
-
function
|
|
3719
|
+
function Ya(e) {
|
|
3720
3720
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
3721
3721
|
}
|
|
3722
|
-
var
|
|
3723
|
-
function
|
|
3722
|
+
var Xa = 8, Za = 1, Qa = 1, $a = 256;
|
|
3723
|
+
function eo(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = 0) {
|
|
3724
3724
|
if (r <= 0) return;
|
|
3725
|
-
let _ = e.measureText(t), v = _.actualBoundingBoxAscent > 0 ? _.actualBoundingBoxAscent : r, y = _.actualBoundingBoxDescent > 0 ? _.actualBoundingBoxDescent : r * .25, b = _.actualBoundingBoxLeft > 0 ? _.actualBoundingBoxLeft : 0, x = _.actualBoundingBoxRight > 0 ? _.actualBoundingBoxRight : r, S = r * l * i, C = Math.min(
|
|
3726
|
-
for (; E >
|
|
3727
|
-
let e = Math.min(
|
|
3725
|
+
let _ = e.measureText(t), v = _.actualBoundingBoxAscent > 0 ? _.actualBoundingBoxAscent : r, y = _.actualBoundingBoxDescent > 0 ? _.actualBoundingBoxDescent : r * .25, b = _.actualBoundingBoxLeft > 0 ? _.actualBoundingBoxLeft : 0, x = _.actualBoundingBoxRight > 0 ? _.actualBoundingBoxRight : r, S = r * l * i, C = Math.min($a, Math.max(1, Math.round(S / Xa))), w = (e) => ro(e, a, r, o, s, c, u, d), T = w(C), E = ao(T, a, o, s, c, u, d, l, i, -v, y);
|
|
3726
|
+
for (; E > Qa && C < $a;) {
|
|
3727
|
+
let e = Math.min($a, C * 2), t = w(e), n = ao(t, a, o, s, c, u, d, l, i, -v, y);
|
|
3728
3728
|
if (n >= E * .75) {
|
|
3729
3729
|
T = t;
|
|
3730
3730
|
break;
|
|
3731
3731
|
}
|
|
3732
3732
|
C = e, T = t, E = n;
|
|
3733
3733
|
}
|
|
3734
|
-
let D = 1e4, O =
|
|
3734
|
+
let D = 1e4, O = Za / (l * i), k = T.length - 1, A = (e, t, n) => e === 0 ? -1e4 : t - n - O, j = (e, t, n) => e === k ? D : t - n + O, M = (e, r) => {
|
|
3735
3735
|
g > 0 ? (e.strokeStyle = r, e.lineWidth = g, e.lineJoin = "round") : e.fillStyle = r;
|
|
3736
3736
|
for (let r = 0; r <= k; r++) {
|
|
3737
3737
|
let { s0: i, s1: a, g: o } = T[r], s = (i + a) / 2;
|
|
@@ -3739,7 +3739,7 @@ function Za(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = 0) {
|
|
|
3739
3739
|
let c = A(r, i, s), u = j(r, a, s);
|
|
3740
3740
|
e.rect(c, -1e4, u - c, 2 * D), e.clip(), g > 0 ? e.strokeText(t, -s + n / 2, 0) : e.fillText(t, -s + n / 2, 0), e.restore();
|
|
3741
3741
|
}
|
|
3742
|
-
}, N = typeof m == "string" ?
|
|
3742
|
+
}, N = typeof m == "string" ? to(m) : 1, P = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
3743
3743
|
if (typeof m == "string" && N >= 1 && P >= 1) {
|
|
3744
3744
|
M(e, m);
|
|
3745
3745
|
return;
|
|
@@ -3759,7 +3759,7 @@ function Za(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = 0) {
|
|
|
3759
3759
|
[s, y],
|
|
3760
3760
|
[c, y]
|
|
3761
3761
|
]) {
|
|
3762
|
-
let n =
|
|
3762
|
+
let n = io(i, l, e, t), r = f + n.x, a = p + n.y, o = F.a * r + F.c * a + F.e, s = F.b * r + F.d * a + F.f;
|
|
3763
3763
|
o < I && (I = o), o > R && (R = o), s < L && (L = s), s > z && (z = s);
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
@@ -3769,62 +3769,62 @@ function Za(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = 0) {
|
|
|
3769
3769
|
M(e, m);
|
|
3770
3770
|
return;
|
|
3771
3771
|
}
|
|
3772
|
-
K.font = e.font, K.textAlign = "left", K.textBaseline = "alphabetic", K.setTransform(F.a, F.b, F.c, F.d, F.e - V, F.f - H), typeof m == "string" ? M(K,
|
|
3772
|
+
K.font = e.font, K.textAlign = "left", K.textBaseline = "alphabetic", K.setTransform(F.a, F.b, F.c, F.d, F.e - V, F.f - H), typeof m == "string" ? M(K, no(m)) : (M(K, "#fff"), K.save(), K.setTransform(1, 0, 0, 1, 0, 0), K.globalCompositeOperation = "source-in", U(e, K, () => {
|
|
3773
3773
|
K.fillStyle = h?.(K) ?? m, K.fillRect(0, 0, W, G);
|
|
3774
3774
|
}, {
|
|
3775
3775
|
x: V,
|
|
3776
3776
|
y: H
|
|
3777
3777
|
}), K.restore()), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = P * N, e.drawImage(ee, V, H), e.restore();
|
|
3778
3778
|
}
|
|
3779
|
-
function
|
|
3779
|
+
function to(e) {
|
|
3780
3780
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
3781
3781
|
if (!t) return 1;
|
|
3782
3782
|
let n = parseFloat(t[1]);
|
|
3783
3783
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
3784
3784
|
}
|
|
3785
|
-
function
|
|
3785
|
+
function no(e) {
|
|
3786
3786
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
3787
3787
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
3788
3788
|
}
|
|
3789
|
-
function
|
|
3789
|
+
function ro(e, t, n, r, i, a, o, s) {
|
|
3790
3790
|
let c = Array(e);
|
|
3791
3791
|
for (let l = 0; l < e; l++) {
|
|
3792
3792
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
3793
3793
|
c[l] = {
|
|
3794
3794
|
s0: u,
|
|
3795
3795
|
s1: d,
|
|
3796
|
-
g:
|
|
3796
|
+
g: kt(t, (r + (u + d) / 2) / i * a, o, s)
|
|
3797
3797
|
};
|
|
3798
3798
|
}
|
|
3799
3799
|
return c;
|
|
3800
3800
|
}
|
|
3801
|
-
function
|
|
3801
|
+
function io(e, t, n, r) {
|
|
3802
3802
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
3803
3803
|
return {
|
|
3804
3804
|
x: e.x + s * o - c * a,
|
|
3805
3805
|
y: e.y + c * o + s * a
|
|
3806
3806
|
};
|
|
3807
3807
|
}
|
|
3808
|
-
function
|
|
3808
|
+
function ao(e, t, n, r, i, a, o, s, c, l, u) {
|
|
3809
3809
|
let d = 0;
|
|
3810
3810
|
for (let f of e) {
|
|
3811
3811
|
let e = (f.s0 + f.s1) / 2;
|
|
3812
3812
|
for (let p of [f.s0, f.s1]) {
|
|
3813
|
-
let m =
|
|
3813
|
+
let m = kt(t, (n + p) / r * i, a, o);
|
|
3814
3814
|
for (let t of [l, u]) {
|
|
3815
|
-
let n =
|
|
3815
|
+
let n = io(m, s, 0, t), r = io(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
3816
3816
|
i > d && (d = i);
|
|
3817
3817
|
}
|
|
3818
3818
|
}
|
|
3819
3819
|
}
|
|
3820
3820
|
return d;
|
|
3821
3821
|
}
|
|
3822
|
-
function
|
|
3823
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), _ =
|
|
3822
|
+
function oo(e, t, n, r, i, a, o, s, c, l, u) {
|
|
3823
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), _ = wt(n, r, p, m);
|
|
3824
3824
|
if (!_) return;
|
|
3825
3825
|
let v = t.defaultBold ?? !1, y = t.defaultItalic ?? !1, b = (t.defaultFontSize ?? 18) * h * c, x = [], S = 0;
|
|
3826
3826
|
for (let n of t.paragraphs) {
|
|
3827
|
-
let t = n.defFontSize == null ? b : n.defFontSize * h * c, r =
|
|
3827
|
+
let t = n.defFontSize == null ? b : n.defFontSize * h * c, r = Ra(e, n, Infinity, t, n.defColor ? $(n.defColor) : l, c, 0, v, y, 1, void 0, u, 0);
|
|
3828
3828
|
x.length > 0 && (S += (n.spaceBefore ?? 0) / 100 * h * c);
|
|
3829
3829
|
for (let e of r) {
|
|
3830
3830
|
let r = e.segments.reduce((e, t) => Math.max(e, t.sizePx), 0) || t, i = n.spaceLine?.type === "pts" ? n.spaceLine.val * h * c : r * 1.2 * (n.spaceLine ? n.spaceLine.val / 1e5 : 1);
|
|
@@ -3852,10 +3852,10 @@ function ro(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
3852
3852
|
}
|
|
3853
3853
|
e.font = t.font;
|
|
3854
3854
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
3855
|
-
l += r.width + n *
|
|
3855
|
+
l += r.width + n * Oa(t.text), u = Math.max(u, t.sizePx), r.actualBoundingBoxAscent > 0 && (v = Math.max(v, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (y = Math.max(y, r.actualBoundingBoxDescent));
|
|
3856
3856
|
}
|
|
3857
3857
|
if (l <= 0) continue;
|
|
3858
|
-
let b = _.singleEdge ? Math.max(0, O ? k - x[t].baseline : x[t].baseline - k) : 0, S = b > 0 ?
|
|
3858
|
+
let b = _.singleEdge ? Math.max(0, O ? k - x[t].baseline : x[t].baseline - k) : 0, S = b > 0 ? wt(n, r, p + 2 * b, m + 2 * b) ?? _ : _, C = v + y > 0 ? v + y : u, E = _.singleEdge ? .8 : C > 0 ? v / C : .8, D = _.singleEdge ? 1 : p / l, A = _.singleEdge ? C : C / (s - o), j = Dt(S, l), M = _.singleEdge ? (1 - j) * (a === "r" ? 1 : a === "ctr" ? .5 : 0) : 0, N = 0;
|
|
3859
3859
|
for (let t of i.segments) {
|
|
3860
3860
|
let n = N, r = _.singleEdge ? E : o + E * (s - o);
|
|
3861
3861
|
if (t.math) {
|
|
@@ -3863,7 +3863,7 @@ function ro(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
3863
3863
|
continue;
|
|
3864
3864
|
}
|
|
3865
3865
|
e.font = t.font;
|
|
3866
|
-
let i =
|
|
3866
|
+
let i = sa(e, t, d, f, c);
|
|
3867
3867
|
e.fillStyle = i;
|
|
3868
3868
|
let a = t.outline && t.outline.width > 0 ? t.outline : void 0, u = a?.fill, v = a ? u ? re(u, e, d, f, p, m, 0, c * h) : a.color ? `#${a.color}` : t.noFill ? void 0 : i : void 0, y = a ? Math.max(.5, Z(a.width, c)) : 0, x = t.letterSpacingPx ?? 0, C = [...t.text];
|
|
3869
3869
|
for (let n of C) {
|
|
@@ -3874,10 +3874,10 @@ function ro(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
let h = _.singleEdge ? E : o + E * (s - o);
|
|
3876
3876
|
if (!_.singleEdge && r > 0) {
|
|
3877
|
-
t.noFill ||
|
|
3877
|
+
t.noFill || eo(e, n, x, r, w(), _, N, l, j, D, A, h, d, f, i, t.patternFill ? (e) => sa(e, t, d, f, c) : void 0), v && a && eo(e, n, x, r, w(), _, N, l, j, D, A, h, d, f, v, u ? (e) => re(u, e, d, f, p, m, 0, c * 12700) ?? "rgba(0,0,0,0)" : void 0, y), N += r;
|
|
3878
3878
|
continue;
|
|
3879
3879
|
}
|
|
3880
|
-
let g =
|
|
3880
|
+
let g = kt(S, M + (N + r / 2) / l * j, A, h);
|
|
3881
3881
|
g.x -= b, g.y -= b, e.save(), e.translate(d + g.x, f + g.y), e.rotate(g.angle), g.shear !== 0 && e.transform(1, 0, g.shear, 1, 0, 0), (D !== 1 || g.vScale !== 1) && e.scale(D, g.vScale), t.noFill || e.fillText(n, -r / 2 + x / 2, 0), v && (e.strokeStyle = v, e.lineWidth = y, e.lineJoin = "round", e.strokeText(n, -r / 2 + x / 2, 0)), e.restore(), N += r;
|
|
3882
3882
|
}
|
|
3883
3883
|
if (t.underline && !t.underlineLineNoFill && N > n && (!t.noFill || t.underlineFill || t.underlineColor || t.underlineLine?.fill)) {
|
|
@@ -3886,7 +3886,7 @@ function ro(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
3886
3886
|
e.save(), e.strokeStyle = a, e.lineWidth = t.underlineLine?.width ? Z(t.underlineLine.width, c) : Math.max(1, t.sizePx * g), e.beginPath();
|
|
3887
3887
|
let i = Math.max(2, Math.ceil((N - n) / 8));
|
|
3888
3888
|
for (let t = 0; t <= i; t++) {
|
|
3889
|
-
let a =
|
|
3889
|
+
let a = kt(S, M + (n + (N - n) * t / i) / l * j, A, r), o = Math.max(2, e.lineWidth) * a.vScale, s = d + a.x - b - Math.sin(a.angle) * o, c = f + a.y + Math.cos(a.angle) * o;
|
|
3890
3890
|
t === 0 ? e.moveTo(s, c) : e.lineTo(s, c);
|
|
3891
3891
|
}
|
|
3892
3892
|
e.stroke(), e.restore();
|
|
@@ -3896,7 +3896,7 @@ function ro(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
3896
3896
|
}
|
|
3897
3897
|
e.restore();
|
|
3898
3898
|
}
|
|
3899
|
-
function
|
|
3899
|
+
function so(e, t, n, r, i, a, o) {
|
|
3900
3900
|
let s = Math.min(r, i);
|
|
3901
3901
|
switch (e) {
|
|
3902
3902
|
case "rightarrow":
|
|
@@ -3926,17 +3926,17 @@ function io(e, t, n, r, i, a, o) {
|
|
|
3926
3926
|
default: return null;
|
|
3927
3927
|
}
|
|
3928
3928
|
}
|
|
3929
|
-
function
|
|
3930
|
-
return e.defaultTextColor ? $(e.defaultTextColor) : t.smartArtFallbackTextColor != null &&
|
|
3929
|
+
function co(e, t) {
|
|
3930
|
+
return e.defaultTextColor ? $(e.defaultTextColor) : t.smartArtFallbackTextColor != null && $r(e) ? t.smartArtFallbackTextColor : null;
|
|
3931
3931
|
}
|
|
3932
|
-
function
|
|
3932
|
+
function lo(e, t, n) {
|
|
3933
3933
|
return {
|
|
3934
3934
|
outerRotation: e,
|
|
3935
3935
|
localFlipH: t,
|
|
3936
3936
|
localFlipV: n
|
|
3937
3937
|
};
|
|
3938
3938
|
}
|
|
3939
|
-
function
|
|
3939
|
+
function uo(e, t, n, r, i) {
|
|
3940
3940
|
let a = [
|
|
3941
3941
|
{
|
|
3942
3942
|
x: t,
|
|
@@ -3965,7 +3965,7 @@ function so(e, t, n, r, i) {
|
|
|
3965
3965
|
h: l - s
|
|
3966
3966
|
};
|
|
3967
3967
|
}
|
|
3968
|
-
var
|
|
3968
|
+
var fo = {
|
|
3969
3969
|
tl: [0, 0],
|
|
3970
3970
|
t: [.5, 0],
|
|
3971
3971
|
tr: [1, 0],
|
|
@@ -3976,19 +3976,19 @@ var co = {
|
|
|
3976
3976
|
b: [.5, 1],
|
|
3977
3977
|
br: [1, 1]
|
|
3978
3978
|
};
|
|
3979
|
-
function
|
|
3979
|
+
function po(e, t, n) {
|
|
3980
3980
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
3981
3981
|
}
|
|
3982
|
-
function
|
|
3983
|
-
let [o, s] = l(
|
|
3984
|
-
return
|
|
3982
|
+
function mo(e, t, n, r, i, a) {
|
|
3983
|
+
let [o, s] = l(fo, a ?? "b") ?? fo.b;
|
|
3984
|
+
return po(e, t + o * r, n + s * i);
|
|
3985
3985
|
}
|
|
3986
|
-
function
|
|
3986
|
+
function ho(e, t, n, r = 0, i = 0, a = 1) {
|
|
3987
3987
|
r > (e.sceneDepth ?? 0) && (e = {
|
|
3988
3988
|
...e,
|
|
3989
3989
|
sceneDepth: r
|
|
3990
3990
|
});
|
|
3991
|
-
let o =
|
|
3991
|
+
let o = On(e, t, n), [s, c, , l] = o.corners, u = (c.x - s.x) * (l.y - s.y) - (c.y - s.y) * (l.x - s.x) < 0, d = u && r > 0 ? On(e, t, n, r) : o, f = Math.max(0, Math.ceil(i * a)), p = f > 0 ? Gt(d.corners, f / a / t, f / a / n) : null;
|
|
3992
3992
|
return p || (f = 0), {
|
|
3993
3993
|
face: d.corners,
|
|
3994
3994
|
corners: p ?? d.corners,
|
|
@@ -3997,8 +3997,8 @@ function fo(e, t, n, r = 0, i = 0, a = 1) {
|
|
|
3997
3997
|
padCss: f / a
|
|
3998
3998
|
};
|
|
3999
3999
|
}
|
|
4000
|
-
function
|
|
4001
|
-
let u = Math.abs(t.a * t.d - t.b * t.c), { face: d, corners: f } =
|
|
4000
|
+
function go(e, t, n, r, i, a, o, s, c = 0) {
|
|
4001
|
+
let u = Math.abs(t.a * t.d - t.b * t.c), { face: d, corners: f } = ho(e, i, a, c, o, u > 0 ? Math.sqrt(u) : 1), p = f.map((e) => po(t, n + e.x, r + e.y)), m = p.map(([e]) => e), h = p.map(([, e]) => e), g = Math.min(...m), _ = Math.min(...h), v = Math.max(...m), y = Math.max(...h), [b, x] = l(fo, s ?? "b") ?? fo.b, S = Wt(d, b, x);
|
|
4002
4002
|
return {
|
|
4003
4003
|
bbox: {
|
|
4004
4004
|
x: g,
|
|
@@ -4006,10 +4006,10 @@ function po(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
4006
4006
|
w: v - g,
|
|
4007
4007
|
h: y - _
|
|
4008
4008
|
},
|
|
4009
|
-
anchor: S ?
|
|
4009
|
+
anchor: S ? po(t, n + S.x, r + S.y) : mo(t, n, r, i, a, s)
|
|
4010
4010
|
};
|
|
4011
4011
|
}
|
|
4012
|
-
function
|
|
4012
|
+
function _o(e, t, n, r, i) {
|
|
4013
4013
|
let a = Math.floor(n.x) - 1, o = Math.floor(n.y) - 1, s = Math.max(1, Math.ceil(n.x + n.w) - a + 1), c = Math.max(1, Math.ceil(n.y + n.h) - o + 1);
|
|
4014
4014
|
if (r && (a + s <= 0 || o + c <= 0 || a >= r.w || o >= r.h) || C(s, c).clamped) return e;
|
|
4015
4015
|
let l = null;
|
|
@@ -4036,7 +4036,7 @@ function mo(e, t, n, r, i) {
|
|
|
4036
4036
|
e.save(), e.setTransform(d), e.drawImage(l, a, o), e.restore();
|
|
4037
4037
|
};
|
|
4038
4038
|
}
|
|
4039
|
-
function
|
|
4039
|
+
function vo(e, t, n, r, i, a, o, l, u, d = !0, p = !1) {
|
|
4040
4040
|
let m = e.canvas.width || 0, h = e.canvas.height || 0, g = m > 0 && h > 0, _ = {
|
|
4041
4041
|
a: 1,
|
|
4042
4042
|
b: 0,
|
|
@@ -4049,17 +4049,17 @@ function ho(e, t, n, r, i, a, o, l, u, d = !0, p = !1) {
|
|
|
4049
4049
|
}, C = (t) => {
|
|
4050
4050
|
v(t), U(e, t, () => r(t));
|
|
4051
4051
|
}, w = p && g && (t.softEdge || t.innerShadow) ? s(C, f(i, t, l, m, h)) : null, T = !p || !!w, E = !1;
|
|
4052
|
-
t.shadow && g ? (e.save(), e.setTransform(_), E = !c(e, x, i, t.shadow, l, m, h, Math.atan2(u.b, u.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (E = !0), t.reflection && g && (e.save(), e.setTransform(_), y(e, x, i, t.reflection, l, m, h), e.restore()), E ?
|
|
4052
|
+
t.shadow && g ? (e.save(), e.setTransform(_), E = !c(e, x, i, t.shadow, l, m, h, Math.atan2(u.b, u.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (E = !0), t.reflection && g && (e.save(), e.setTransform(_), y(e, x, i, t.reflection, l, m, h), e.restore()), E ? qa(e, t.shadow ?? null, o) : t.glow && Ja(e, t.glow, o), t.softEdge && g && T ? (e.save(), e.setTransform(_), S(e, x, i, t.softEdge, l, m, h, w ?? C), e.restore()) : n(e), (E || t.glow) && Ya(e), t.innerShadow && d && g && T && (e.save(), e.setTransform(_), b(e, w ?? C, i, t.innerShadow, l, m, h), e.restore());
|
|
4053
4053
|
}
|
|
4054
|
-
function
|
|
4054
|
+
function yo(e, t, n) {
|
|
4055
4055
|
if (t === n || !Number.isFinite(e)) return e;
|
|
4056
4056
|
let r = ((e + 180) % 360 + 360) % 360 - 180;
|
|
4057
4057
|
return r > 90 ? r -= 180 : r < -90 && (r += 180), Object.is(r, -0) ? 0 : r;
|
|
4058
4058
|
}
|
|
4059
|
-
function
|
|
4060
|
-
return e === "wordArtVert" || e === "wordArtVertRtl" ? t + (r ? 180 : 0) :
|
|
4059
|
+
function bo(e, t, n, r) {
|
|
4060
|
+
return e === "wordArtVert" || e === "wordArtVertRtl" ? t + (r ? 180 : 0) : yo(t, n, r);
|
|
4061
4061
|
}
|
|
4062
|
-
function
|
|
4062
|
+
function xo(e, t, n, r = "#000000", i, a = {
|
|
4063
4063
|
themeMajorFont: null,
|
|
4064
4064
|
themeMinorFont: null,
|
|
4065
4065
|
dpr: 1
|
|
@@ -4070,14 +4070,14 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4070
4070
|
shapeId: t.id
|
|
4071
4071
|
}) : o;
|
|
4072
4072
|
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4073
|
-
if (t.stroke && (e.save(), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l),
|
|
4073
|
+
if (t.stroke && (e.save(), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), Wo(e, t.stroke, n, {
|
|
4074
4074
|
x: c,
|
|
4075
4075
|
y: l,
|
|
4076
4076
|
w: u,
|
|
4077
4077
|
h: 1
|
|
4078
4078
|
}, t.rotation), e.stroke(), e.restore()), t.textBody) {
|
|
4079
|
-
let o =
|
|
4080
|
-
|
|
4079
|
+
let o = co(t, a);
|
|
4080
|
+
ko(e, t.textBody, c, l, u, d, n, o, t.rotation, t.flipH, t.flipV, r, i, a, f, !1, s);
|
|
4081
4081
|
}
|
|
4082
4082
|
return;
|
|
4083
4083
|
}
|
|
@@ -4085,12 +4085,12 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4085
4085
|
...t.scene3d.camera,
|
|
4086
4086
|
unitsPerInch: 914400 * n,
|
|
4087
4087
|
sceneDepth: (t.sp3d?.extrusionH ?? 0) * n
|
|
4088
|
-
}, m = p &&
|
|
4088
|
+
}, m = p && kn(p, u, d, (t.sp3d?.extrusionH ?? 0) * n) ? {
|
|
4089
4089
|
...t.scene3d,
|
|
4090
4090
|
camera: p
|
|
4091
4091
|
} : null;
|
|
4092
4092
|
if (m && u > 0 && d > 0) {
|
|
4093
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, p =
|
|
4093
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, p = Ao(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, f, m.camera), h = (p.find((e) => e.bottom)?.depthPx ?? 0) / f, g = jo(t.sp3d, m.camera, u, d, n, f), _ = lo(t.rotation, t.flipH, t.flipV);
|
|
4094
4094
|
e.save(), _.outerRotation !== 0 && (e.translate(c + u / 2, l + d / 2), e.rotate(_.outerRotation * Math.PI / 180), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4095
4095
|
let v = {
|
|
4096
4096
|
...t,
|
|
@@ -4113,8 +4113,8 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4113
4113
|
...v,
|
|
4114
4114
|
fill: null,
|
|
4115
4115
|
stroke: null
|
|
4116
|
-
}, x = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (g ? Math.hypot(g.offsetX, g.offsetY) / f : 0) + 2, S = t.textBody?.paragraphs.some((e) => e.runs.some((e) => e.type === "text" && (e.patternFill?.fillType === "pattern" || e.outline?.fill?.fillType === "pattern" || e.underlineFill?.fillType === "pattern"))) ?? !1, C = (e, t, o, s = !1) =>
|
|
4117
|
-
|
|
4116
|
+
}, x = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (g ? Math.hypot(g.offsetX, g.offsetY) / f : 0) + 2, S = t.textBody?.paragraphs.some((e) => e.runs.some((e) => e.type === "text" && (e.patternFill?.fillType === "pattern" || e.outline?.fill?.fillType === "pattern" || e.underlineFill?.fillType === "pattern"))) ?? !1, C = (e, t, o, s = !1) => No(e, m.camera, c, l, u, d, (e) => {
|
|
4117
|
+
xo(e, t, n, r, i, a, void 0);
|
|
4118
4118
|
}, o ? {
|
|
4119
4119
|
bevels: p,
|
|
4120
4120
|
backDepthCss: h,
|
|
@@ -4125,16 +4125,16 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4125
4125
|
preservePatternFrame: s,
|
|
4126
4126
|
measureOverflow: !0
|
|
4127
4127
|
}), w = (e) => C(e, y, !0), T = (e) => {
|
|
4128
|
-
!t.textBody || C(e, b, !1, S) || (e.save(), e.translate(c, l),
|
|
4128
|
+
!t.textBody || C(e, b, !1, S) || (e.save(), e.translate(c, l), xo(e, b, n, r, i, a), e.restore());
|
|
4129
4129
|
};
|
|
4130
4130
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4131
|
-
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4131
|
+
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o = go(m.camera, r, c, l, u, d, x, t.shadow?.algn, h), s = !1, f = _o((e) => {
|
|
4132
4132
|
s = w(e) || s;
|
|
4133
4133
|
}, r, o.bbox, {
|
|
4134
4134
|
w: e.canvas.width || 0,
|
|
4135
4135
|
h: e.canvas.height || 0
|
|
4136
4136
|
}, e);
|
|
4137
|
-
if (
|
|
4137
|
+
if (vo(e, t, f, f, o.bbox, o.anchor, n, n * a, r, !!t.fill, !0), s) {
|
|
4138
4138
|
T(e), e.restore();
|
|
4139
4139
|
return;
|
|
4140
4140
|
}
|
|
@@ -4146,7 +4146,7 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4146
4146
|
}
|
|
4147
4147
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4148
4148
|
let g = t.geometry.toLowerCase(), _ = (e, n, r, i, a) => {
|
|
4149
|
-
t.custGeom ?
|
|
4149
|
+
t.custGeom ? So(e, t.custGeomPaint?.length === t.custGeom.length ? t.custGeom.filter((e, n) => t.custGeomPaint?.[n].fill !== "none") : t.custGeom, n, r, i, a) : Ae(e, g, n, r, i, a, [
|
|
4150
4150
|
t.adj,
|
|
4151
4151
|
t.adj2,
|
|
4152
4152
|
t.adj3,
|
|
@@ -4155,55 +4155,31 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4155
4155
|
t.adj6,
|
|
4156
4156
|
t.adj7,
|
|
4157
4157
|
t.adj8
|
|
4158
|
-
]) ||
|
|
4159
|
-
}, v =
|
|
4160
|
-
t.shadow ||
|
|
4161
|
-
let S =
|
|
4162
|
-
"line",
|
|
4163
|
-
"straightconnector1",
|
|
4164
|
-
"bentconnector2",
|
|
4165
|
-
"bentconnector3",
|
|
4166
|
-
"bentconnector4",
|
|
4167
|
-
"bentconnector5",
|
|
4168
|
-
"curvedconnector2",
|
|
4169
|
-
"curvedconnector3",
|
|
4170
|
-
"curvedconnector4",
|
|
4171
|
-
"curvedconnector5"
|
|
4172
|
-
]), C = new Set([
|
|
4173
|
-
"callout1",
|
|
4174
|
-
"callout2",
|
|
4175
|
-
"callout3",
|
|
4176
|
-
"bordercallout1",
|
|
4177
|
-
"bordercallout2",
|
|
4178
|
-
"bordercallout3",
|
|
4179
|
-
"accentcallout1",
|
|
4180
|
-
"accentcallout2",
|
|
4181
|
-
"accentcallout3",
|
|
4182
|
-
"accentbordercallout1",
|
|
4183
|
-
"accentbordercallout2",
|
|
4184
|
-
"accentbordercallout3"
|
|
4185
|
-
]), w = (e) => C.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), T = t.stroke?.headEnd ? ve(t.stroke.headEnd, t.stroke, n, h) : 0, E = t.stroke?.tailEnd ? ve(t.stroke.tailEnd, t.stroke, n, h) : 0, D = g.startsWith("curvedconnector") && (T > 0 || E > 0), O = t.custGeom && t.custGeom.length > 0 && (T > 0 || E > 0) ? Te(t.custGeom) : null, k = O?.start ? T : 0, j = O?.end ? E : 0, M = !t.custGeom && Ee(g), N = (r, i, a = {
|
|
4158
|
+
]) || Ce(e, g, n, r, i, a, t.adj, t.adj2, t.adj3, t.adj4);
|
|
4159
|
+
}, v = Zi(t.fill, e, c, l, u, d, t.rotation, n * h, _), y = t.fill?.fillType === "image" && Ga(t.fill) ? t.fill : null, b = y ? a.shapeFillImages?.get(Wa(y, t.width, t.height, t)) : void 0, x = !!(y && b);
|
|
4160
|
+
t.shadow || Ja(e, t.glow ?? null, n);
|
|
4161
|
+
let S = be(g, t.stroke, n, h, !0), C = t.stroke?.headEnd ? De(t.stroke.headEnd, t.stroke, n, h) : 0, w = t.stroke?.tailEnd ? De(t.stroke.tailEnd, t.stroke, n, h) : 0, T = t.custGeom && t.custGeom.length > 0 && (C > 0 || w > 0) ? Fe(t.custGeom) : null, E = T?.start ? C : 0, D = T?.end ? w : 0, O = !t.custGeom && Pe(g), k = (r, i, a = {
|
|
4186
4162
|
x: c,
|
|
4187
4163
|
y: l,
|
|
4188
4164
|
w: u,
|
|
4189
4165
|
h: d
|
|
4190
4166
|
}) => {
|
|
4191
4167
|
A(t.stroke?.fill) && (r = ae(r));
|
|
4192
|
-
let { x: o, y: s, w: f, h: p } = a, m = i ?? (r === e && o === c && s === l && f === u && p === d ? v :
|
|
4193
|
-
|
|
4168
|
+
let { x: o, y: s, w: f, h: p } = a, m = i ?? (r === e && o === c && s === l && f === u && p === d ? v : Zi(t.fill, r, o, s, f, p, t.rotation, n * 12700, _)), h = i ? null : t.stroke ? () => {
|
|
4169
|
+
Wo(r, t.stroke, n, {
|
|
4194
4170
|
x: o,
|
|
4195
4171
|
y: s,
|
|
4196
4172
|
w: f,
|
|
4197
4173
|
h: p
|
|
4198
4174
|
}, t.rotation), r.stroke();
|
|
4199
|
-
} : null, x = () =>
|
|
4175
|
+
} : null, x = () => Ya(r), C = g === "donut" || g === "smileyface" || g === "frame", w = y && !i ? (e) => Ka(e, y, b, {
|
|
4200
4176
|
x: o,
|
|
4201
4177
|
y: s,
|
|
4202
4178
|
w: f,
|
|
4203
4179
|
h: p
|
|
4204
|
-
}, n,
|
|
4205
|
-
if (
|
|
4206
|
-
let e =
|
|
4180
|
+
}, n, C, t) : void 0;
|
|
4181
|
+
if (O && !i) {
|
|
4182
|
+
let e = S?.restroke != null;
|
|
4207
4183
|
ye(r, g, o, s, f, p, [
|
|
4208
4184
|
t.adj,
|
|
4209
4185
|
t.adj2,
|
|
@@ -4213,9 +4189,9 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4213
4189
|
t.adj6,
|
|
4214
4190
|
t.adj7,
|
|
4215
4191
|
t.adj8
|
|
4216
|
-
], m, h, x, e ||
|
|
4192
|
+
], m, h, x, e || w ? {
|
|
4217
4193
|
...e ? { skipTrailingStroke: !0 } : {},
|
|
4218
|
-
paintFill:
|
|
4194
|
+
paintFill: w
|
|
4219
4195
|
} : void 0);
|
|
4220
4196
|
return;
|
|
4221
4197
|
}
|
|
@@ -4225,29 +4201,29 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4225
4201
|
t.custGeom.forEach((n, a) => {
|
|
4226
4202
|
let c = T[a], l = c.fill !== "none";
|
|
4227
4203
|
if (!(i && !l)) {
|
|
4228
|
-
if (r.beginPath(),
|
|
4204
|
+
if (r.beginPath(), So(r, [n], o, s, f, p), l) {
|
|
4229
4205
|
let t = !1;
|
|
4230
|
-
if (
|
|
4206
|
+
if (w) {
|
|
4231
4207
|
r.save();
|
|
4232
4208
|
try {
|
|
4233
|
-
t =
|
|
4209
|
+
t = w(r);
|
|
4234
4210
|
} finally {
|
|
4235
4211
|
r.restore();
|
|
4236
4212
|
}
|
|
4237
4213
|
} else m && (r.fillStyle = m, r.fill(), t = !0);
|
|
4238
|
-
let n = t && !i ?
|
|
4214
|
+
let n = t && !i ? xe(c.fill) : null;
|
|
4239
4215
|
n && (r.save(), r.fillStyle = n, r.fill(), r.restore()), t && !i && !e && (x(), e = !0);
|
|
4240
4216
|
}
|
|
4241
4217
|
if (c.stroke && h) {
|
|
4242
|
-
let e = a === 0 ?
|
|
4243
|
-
(e > 0 || i > 0) && (r.beginPath(),
|
|
4218
|
+
let e = a === 0 ? E : 0, i = a === t.custGeom.length - 1 ? D : 0;
|
|
4219
|
+
(e > 0 || i > 0) && (r.beginPath(), we(r, (e) => So(e, [n], o, s, f, p), e, i)), h();
|
|
4244
4220
|
}
|
|
4245
4221
|
}
|
|
4246
4222
|
});
|
|
4247
4223
|
return;
|
|
4248
4224
|
}
|
|
4249
|
-
r.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4250
|
-
},
|
|
4225
|
+
r.beginPath(), t.custGeom && t.custGeom.length > 0 ? So(r, t.custGeom, o, s, f, p) : Ce(r, g, o, s, f, p, t.adj, t.adj2, t.adj3, t.adj4), w && g !== "arc" ? w(r) && x() : m && g !== "arc" && (r.fillStyle = m, C ? r.fill("evenodd") : r.fill(), i || x()), h && (t.custGeom && t.custGeom.length > 0 && (E > 0 || D > 0) && (r.beginPath(), we(r, (e) => So(e, t.custGeom, o, s, f, p), E, D)), h());
|
|
4226
|
+
}, j = e.getTransform(), M = Math.abs(j.a * j.d - j.b * j.c), N = M > 0 ? Math.sqrt(M) : 1, P = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? O ? ve(g, c, l, u, d, [
|
|
4251
4227
|
t.adj,
|
|
4252
4228
|
t.adj2,
|
|
4253
4229
|
t.adj3,
|
|
@@ -4256,43 +4232,19 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4256
4232
|
t.adj6,
|
|
4257
4233
|
t.adj7,
|
|
4258
4234
|
t.adj8
|
|
4259
|
-
]) : t.custGeom && t.custGeom.length > 0 ?
|
|
4235
|
+
]) : t.custGeom && t.custGeom.length > 0 ? ke(t.custGeom, c, l, u, d) : null : null) ?? {
|
|
4260
4236
|
x: c,
|
|
4261
4237
|
y: l,
|
|
4262
4238
|
w: u,
|
|
4263
4239
|
h: d
|
|
4264
|
-
},
|
|
4265
|
-
x:
|
|
4266
|
-
y:
|
|
4267
|
-
w:
|
|
4268
|
-
h:
|
|
4269
|
-
} :
|
|
4270
|
-
if (A(t.stroke?.fill) && (e = ae(e)), t.stroke && (
|
|
4271
|
-
let r =
|
|
4272
|
-
t.adj,
|
|
4273
|
-
t.adj2,
|
|
4274
|
-
t.adj3,
|
|
4275
|
-
t.adj4,
|
|
4276
|
-
t.adj5,
|
|
4277
|
-
t.adj6,
|
|
4278
|
-
t.adj7,
|
|
4279
|
-
t.adj8
|
|
4280
|
-
]);
|
|
4281
|
-
if (!r) return;
|
|
4282
|
-
let i = t.stroke.cmpd, a = g === "line" || g === "straightconnector1";
|
|
4283
|
-
if (w(g) && r.vertices.length >= 2 && !(i && a)) {
|
|
4284
|
-
let i = r.vertices;
|
|
4285
|
-
e.beginPath(), ke(e, (e) => {
|
|
4286
|
-
e.moveTo(i[0].x, i[0].y);
|
|
4287
|
-
for (let t = 1; t < i.length; t++) e.lineTo(i[t].x, i[t].y);
|
|
4288
|
-
}, T, E), Vo(e, t.stroke, n, {
|
|
4289
|
-
x: c,
|
|
4290
|
-
y: l,
|
|
4291
|
-
w: u,
|
|
4292
|
-
h: d
|
|
4293
|
-
}, t.rotation), e.stroke();
|
|
4294
|
-
}
|
|
4295
|
-
if (D && (e.beginPath(), be(e, g, c, l, u, d, [
|
|
4240
|
+
}, F = t.stroke ? t.stroke.width * n / 2 : 0, I = t.stroke ? Math.max(t.stroke.headEnd ? Te(t.stroke.headEnd, t.stroke, n, h) : 0, t.stroke.tailEnd ? Te(t.stroke.tailEnd, t.stroke, n, h) : 0) : 0, L = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, R = Math.max(F, I, L), z = R > 0 ? {
|
|
4241
|
+
x: P.x - R,
|
|
4242
|
+
y: P.y - R,
|
|
4243
|
+
w: P.w + R * 2,
|
|
4244
|
+
h: P.h + R * 2
|
|
4245
|
+
} : P, B = uo(j, z.x, z.y, z.w, z.h), V = n * N, H = m ? [] : Ao(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, N, t.scene3d?.camera), U = (t.stroke ? t.stroke.width * n / 2 : 0) + 2, W = (e) => {
|
|
4246
|
+
if (A(t.stroke?.fill) && (e = ae(e)), t.stroke && Ne(g)) {
|
|
4247
|
+
let r = [
|
|
4296
4248
|
t.adj,
|
|
4297
4249
|
t.adj2,
|
|
4298
4250
|
t.adj3,
|
|
@@ -4301,67 +4253,65 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4301
4253
|
t.adj6,
|
|
4302
4254
|
t.adj7,
|
|
4303
4255
|
t.adj8
|
|
4304
|
-
],
|
|
4256
|
+
], i = _t(g, c, l, u, d, r);
|
|
4257
|
+
if (!i) return;
|
|
4258
|
+
let a = t.stroke.cmpd, o = g === "line" || g === "straightconnector1";
|
|
4259
|
+
if (S?.restroke && !(a && o) && (e.beginPath(), Ee(e, S, g, i, c, l, u, d, r) && (Wo(e, t.stroke, n, {
|
|
4305
4260
|
x: c,
|
|
4306
4261
|
y: l,
|
|
4307
4262
|
w: u,
|
|
4308
4263
|
h: d
|
|
4309
|
-
}, t.rotation), e.stroke())),
|
|
4310
|
-
let
|
|
4264
|
+
}, t.rotation), e.stroke())), a && o) {
|
|
4265
|
+
let r = Se([{
|
|
4311
4266
|
op: "moveTo",
|
|
4312
|
-
args: [
|
|
4267
|
+
args: [i.start.x, i.start.y]
|
|
4313
4268
|
}, {
|
|
4314
4269
|
op: "lineTo",
|
|
4315
|
-
args: [
|
|
4316
|
-
}],
|
|
4317
|
-
|
|
4318
|
-
x:
|
|
4319
|
-
y:
|
|
4270
|
+
args: [i.end.x, i.end.y]
|
|
4271
|
+
}], C, w);
|
|
4272
|
+
r.length === 2 && Uo(e, {
|
|
4273
|
+
x: r[0].args[0],
|
|
4274
|
+
y: r[0].args[1]
|
|
4320
4275
|
}, {
|
|
4321
|
-
x:
|
|
4322
|
-
y:
|
|
4323
|
-
}, t.stroke,
|
|
4276
|
+
x: r[1].args[0],
|
|
4277
|
+
y: r[1].args[1]
|
|
4278
|
+
}, t.stroke, a, n, t.rotation);
|
|
4324
4279
|
}
|
|
4325
|
-
|
|
4280
|
+
dt(e, i, t.stroke, n, h, {
|
|
4326
4281
|
x: c,
|
|
4327
4282
|
y: l,
|
|
4328
4283
|
w: u,
|
|
4329
4284
|
h: d
|
|
4330
|
-
}, t.rotation, n * h)
|
|
4331
|
-
x: c,
|
|
4332
|
-
y: l,
|
|
4333
|
-
w: u,
|
|
4334
|
-
h: d
|
|
4335
|
-
}, t.rotation, n * h));
|
|
4285
|
+
}, t.rotation, n * h);
|
|
4336
4286
|
return;
|
|
4337
4287
|
}
|
|
4338
4288
|
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;
|
|
4339
|
-
let { start: r, end: i } =
|
|
4340
|
-
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" &&
|
|
4289
|
+
let { start: r, end: i } = Fe(t.custGeom);
|
|
4290
|
+
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && tt(e, c + r.x * u, l + r.y * d, Math.atan2(r.dy * d, r.dx * u), t.stroke.headEnd, t.stroke, n, h, $e(e, t.stroke, n, h, c + r.x * u, l + r.y * d, Math.atan2(r.dy * d, r.dx * u), t.stroke.headEnd, {
|
|
4341
4291
|
x: c,
|
|
4342
4292
|
y: l,
|
|
4343
4293
|
w: u,
|
|
4344
4294
|
h: d
|
|
4345
|
-
}, t.rotation, n * h)), i && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" &&
|
|
4295
|
+
}, t.rotation, n * h)), i && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && tt(e, c + i.x * u, l + i.y * d, Math.atan2(i.dy * d, i.dx * u), t.stroke.tailEnd, t.stroke, n, h, $e(e, t.stroke, n, h, c + i.x * u, l + i.y * d, Math.atan2(i.dy * d, i.dx * u), t.stroke.tailEnd, {
|
|
4346
4296
|
x: c,
|
|
4347
4297
|
y: l,
|
|
4348
4298
|
w: u,
|
|
4349
4299
|
h: d
|
|
4350
4300
|
}, t.rotation, n * h));
|
|
4351
|
-
},
|
|
4352
|
-
if (
|
|
4301
|
+
}, G = (e) => {
|
|
4302
|
+
if (H.length > 0 && Po(e, c, l, u, d, H, (e, t, n, r, i) => k(e, void 0, {
|
|
4353
4303
|
x: t,
|
|
4354
4304
|
y: n,
|
|
4355
4305
|
w: r,
|
|
4356
4306
|
h: i
|
|
4357
|
-
}), void 0,
|
|
4358
|
-
|
|
4307
|
+
}), void 0, U)) {
|
|
4308
|
+
W(e), Ya(e);
|
|
4359
4309
|
return;
|
|
4360
4310
|
}
|
|
4361
|
-
|
|
4311
|
+
k(e), W(e);
|
|
4362
4312
|
};
|
|
4363
|
-
if (
|
|
4364
|
-
let o =
|
|
4313
|
+
if (vo(e, t, G, G, B, mo(j, c, l, u, d, t.shadow?.algn), n, V, j, !!v || x, !0), t.textBody) {
|
|
4314
|
+
let o = co(t, a), p = bo(t.textBody.vert, t.rotation, t.flipH, t.flipV);
|
|
4365
4315
|
if (e.save(), t.flipH || t.flipV) {
|
|
4366
4316
|
let n = c + u / 2, r = l + d / 2;
|
|
4367
4317
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
@@ -4377,16 +4327,16 @@ function vo(e, t, n, r = "#000000", i, a = {
|
|
|
4377
4327
|
let e = u * (1 - 1 / Math.SQRT2) / 2, t = d * (1 - 1 / Math.SQRT2) / 2;
|
|
4378
4328
|
h = c + e, _ = l + t, v = u / Math.SQRT2, y = d / Math.SQRT2;
|
|
4379
4329
|
} else {
|
|
4380
|
-
let e =
|
|
4330
|
+
let e = so(g, c, l, u, d, t.adj, t.adj2);
|
|
4381
4331
|
e && (h = e.tx, _ = e.ty, v = e.tw, y = e.th);
|
|
4382
4332
|
}
|
|
4383
|
-
|
|
4333
|
+
ko(e, t.textBody, h, _, v, y, n, o, p, !1, !1, r, i, a, f, !1, s), e.restore();
|
|
4384
4334
|
}
|
|
4385
4335
|
e.restore();
|
|
4386
4336
|
}
|
|
4387
|
-
var
|
|
4388
|
-
function
|
|
4389
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4337
|
+
var So = Le;
|
|
4338
|
+
function Co(e, t) {
|
|
4339
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = wo(e).toLowerCase(), o = wo(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4390
4340
|
switch (t) {
|
|
4391
4341
|
case "arabicPlain": return n;
|
|
4392
4342
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4413,7 +4363,7 @@ function bo(e, t) {
|
|
|
4413
4363
|
default: return `${n}.`;
|
|
4414
4364
|
}
|
|
4415
4365
|
}
|
|
4416
|
-
function
|
|
4366
|
+
function wo(e) {
|
|
4417
4367
|
let t = [
|
|
4418
4368
|
1e3,
|
|
4419
4369
|
900,
|
|
@@ -4446,21 +4396,21 @@ function xo(e) {
|
|
|
4446
4396
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4447
4397
|
return r;
|
|
4448
4398
|
}
|
|
4449
|
-
function
|
|
4399
|
+
function To(e) {
|
|
4450
4400
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4451
4401
|
return !1;
|
|
4452
4402
|
}
|
|
4453
|
-
function
|
|
4454
|
-
let n =
|
|
4455
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4403
|
+
function Eo(e, t) {
|
|
4404
|
+
let n = To(e);
|
|
4405
|
+
if (e.bullet.type === "char") return t.clear(), n ? St(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4456
4406
|
if (e.bullet.type === "autoNum") {
|
|
4457
4407
|
if (!n) return "";
|
|
4458
4408
|
let r = e.lvl;
|
|
4459
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4409
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Co(t.get(r), e.bullet.numType);
|
|
4460
4410
|
}
|
|
4461
4411
|
return t.clear(), "";
|
|
4462
4412
|
}
|
|
4463
|
-
function
|
|
4413
|
+
function Do(e, t, n, r, i, a, o) {
|
|
4464
4414
|
let s = (() => {
|
|
4465
4415
|
for (let e of t.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4466
4416
|
return t.defFontSize ?? e.defaultFontSize ?? 18;
|
|
@@ -4470,17 +4420,17 @@ function wo(e, t, n, r, i, a, o) {
|
|
|
4470
4420
|
})(), l = c ? $(c) : n, u = (() => {
|
|
4471
4421
|
for (let e of t.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4472
4422
|
return t.defFontFamily ?? null;
|
|
4473
|
-
})(), d = "", f = s, p = "sans-serif", m =
|
|
4474
|
-
d =
|
|
4475
|
-
let y =
|
|
4423
|
+
})(), d = "", f = s, p = "sans-serif", m = _a(!1, !1, f, p, a), g = l, _ = !1, v = null;
|
|
4424
|
+
d = Eo(t, o);
|
|
4425
|
+
let y = Lr(t.bullet);
|
|
4476
4426
|
if (y.type === "char") {
|
|
4477
|
-
let e = y, t = e.sizePts == null ? e.sizePct == null ? s : s * (e.sizePct / 100) : e.sizePts * h * r * i, n = d === e.char ?
|
|
4478
|
-
f = t, p = n, m =
|
|
4427
|
+
let e = y, t = e.sizePts == null ? e.sizePct == null ? s : s * (e.sizePct / 100) : e.sizePts * h * r * i, n = d === e.char ? ca(e.fontFamily ?? null, a) : "sans-serif";
|
|
4428
|
+
f = t, p = n, m = _a(!1, !1, t, n, a, d, la(e.fontFamily)), g = e.color ? $(e.color) : l, _ = !e.color;
|
|
4479
4429
|
} else if (y.type === "autoNum") {
|
|
4480
4430
|
let e = y, t = e.sizePts == null ? e.sizePct == null ? s : s * (e.sizePct / 100) : e.sizePts * h * r * i;
|
|
4481
|
-
f = t, p =
|
|
4431
|
+
f = t, p = ca(e.fontFamily ?? u, a), m = _a(!1, !1, t, ca(e.fontFamily ?? u, a), a, d, la(e.fontFamily ?? u)), g = y.color ? $(y.color) : l, _ = !y.color;
|
|
4482
4432
|
} else if (y.type === "blip") {
|
|
4483
|
-
let n = y, a =
|
|
4433
|
+
let n = y, a = Ca(e, t, n) * h * r * i;
|
|
4484
4434
|
v = {
|
|
4485
4435
|
imagePath: n.imagePath,
|
|
4486
4436
|
mimeType: n.mimeType,
|
|
@@ -4497,27 +4447,27 @@ function wo(e, t, n, r, i, a, o) {
|
|
|
4497
4447
|
bulletImage: v
|
|
4498
4448
|
};
|
|
4499
4449
|
}
|
|
4500
|
-
function
|
|
4501
|
-
let m = t.autoFit === "norm" && t.fontScale != null && t.fontScale > 0 && t.fontScale < 1 ? t.fontScale : 1, g = h * s, _ =
|
|
4450
|
+
function Oo(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
4451
|
+
let m = t.autoFit === "norm" && t.fontScale != null && t.fontScale > 0 && t.fontScale < 1 ? t.fontScale : 1, g = h * s, _ = dn(a, o, {
|
|
4502
4452
|
lIns: t.lIns,
|
|
4503
4453
|
rIns: t.rIns,
|
|
4504
4454
|
tIns: t.tIns,
|
|
4505
4455
|
bIns: t.bIns
|
|
4506
4456
|
}, s), v = (t.defaultFontSize ?? 18) * g * m, y = t.defaultBold ?? !1, b = t.defaultItalic ?? !1, x, S = /* @__PURE__ */ new Map(), C = [], w = t.paragraphs.map((n) => {
|
|
4507
|
-
let r = n.defFontSize == null ? v : n.defFontSize * g * m, i = n.defColor ? $(n.defColor) : c, a =
|
|
4457
|
+
let r = n.defFontSize == null ? v : n.defFontSize * g * m, i = n.defColor ? $(n.defColor) : c, a = Do(t, n, i, s, m, d, S);
|
|
4508
4458
|
C.push(a);
|
|
4509
|
-
let o =
|
|
4459
|
+
let o = Ma(n, r, i, s, y, b, m, u, d, !1, e);
|
|
4510
4460
|
x ??= o.sameStyle;
|
|
4511
|
-
let l = o.input.find((e) => e.type === "text"), f =
|
|
4461
|
+
let l = o.input.find((e) => e.type === "text"), f = ca(n.defFontFamily ?? null, d), p = n.defBold ?? y, h = n.defItalic ?? b, _ = l?.type === "text" ? l.style : {
|
|
4512
4462
|
text: "",
|
|
4513
|
-
font:
|
|
4463
|
+
font: _a(p, h, r, f, d, ""),
|
|
4514
4464
|
sizePx: r,
|
|
4515
4465
|
color: i,
|
|
4516
4466
|
underline: !1,
|
|
4517
4467
|
strikethrough: !1,
|
|
4518
|
-
lineMetric:
|
|
4468
|
+
lineMetric: va(f, p, h, d),
|
|
4519
4469
|
faceFamily: f
|
|
4520
|
-
}, w = n.endRunProperties, T = w ?
|
|
4470
|
+
}, w = n.endRunProperties, T = w ? Ma({
|
|
4521
4471
|
...n,
|
|
4522
4472
|
runs: [{
|
|
4523
4473
|
...w,
|
|
@@ -4535,7 +4485,7 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4535
4485
|
marginStart: Z(n.marL, s),
|
|
4536
4486
|
marginEnd: Z(n.marR, s),
|
|
4537
4487
|
firstLineIndent: Z(n.indent, s),
|
|
4538
|
-
marker:
|
|
4488
|
+
marker: To(n) ? a.bulletLabel ? {
|
|
4539
4489
|
text: a.bulletLabel,
|
|
4540
4490
|
style: {
|
|
4541
4491
|
text: a.bulletLabel,
|
|
@@ -4545,7 +4495,7 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4545
4495
|
underline: !1,
|
|
4546
4496
|
strikethrough: !1,
|
|
4547
4497
|
faceFamily: a.bulletFamily,
|
|
4548
|
-
lineMetric:
|
|
4498
|
+
lineMetric: va(a.bulletFamily, !1, !1, d)
|
|
4549
4499
|
}
|
|
4550
4500
|
} : a.bulletImage ? {
|
|
4551
4501
|
advance: a.bulletImage.sizePx,
|
|
@@ -4554,7 +4504,7 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4554
4504
|
alignment: n.alignment,
|
|
4555
4505
|
lineSpacing: n.spaceLine?.type === "pts" ? {
|
|
4556
4506
|
type: "pts",
|
|
4557
|
-
val:
|
|
4507
|
+
val: Sr(n.spaceLine.val)
|
|
4558
4508
|
} : n.spaceLine,
|
|
4559
4509
|
spaceBefore: E(n.spaceBefore, n.spaceBeforePct),
|
|
4560
4510
|
spaceAfter: E(n.spaceAfter, n.spaceAfterPct),
|
|
@@ -4562,7 +4512,7 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4562
4512
|
endMarkStyle: T?.type === "text" ? T.style : void 0,
|
|
4563
4513
|
eastAsianLineBreak: n.eaLnBrk !== !1
|
|
4564
4514
|
};
|
|
4565
|
-
}), T =
|
|
4515
|
+
}), T = di(e, {
|
|
4566
4516
|
vert: n,
|
|
4567
4517
|
rect: {
|
|
4568
4518
|
left: r + _.left,
|
|
@@ -4580,10 +4530,10 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4580
4530
|
sameStyle: x,
|
|
4581
4531
|
drawMarker: (n, r, i) => {
|
|
4582
4532
|
let a = t.paragraphs[n];
|
|
4583
|
-
if (!
|
|
4533
|
+
if (!To(a)) return;
|
|
4584
4534
|
let o = C[n], s = i;
|
|
4585
4535
|
e.save();
|
|
4586
|
-
let c = o.bulletImage, l = c ? d.pictureBulletImages?.has(c.imagePath) ? d.pictureBulletImages.get(c.imagePath) : p ?
|
|
4536
|
+
let c = o.bulletImage, l = c ? d.pictureBulletImages?.has(c.imagePath) ? d.pictureBulletImages.get(c.imagePath) : p ? Je(c.imagePath, p) : null : null;
|
|
4587
4537
|
if (c && l) {
|
|
4588
4538
|
let t = c.sizePx, n = l.height > 0 ? t * l.width / l.height : t;
|
|
4589
4539
|
e.drawImage(l, r - n / 2, s, n, t);
|
|
@@ -4592,17 +4542,17 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4592
4542
|
},
|
|
4593
4543
|
markerPaint: (t, n, r) => {
|
|
4594
4544
|
let i = C[t], a = w[t].runs.find((e) => e.type === "text");
|
|
4595
|
-
return i.bulletFollowsText && a?.type === "text" && a.style.patternFill ?
|
|
4545
|
+
return i.bulletFollowsText && a?.type === "text" && a.style.patternFill ? sa(e, a.style, n, r, s) : i.bulletColor;
|
|
4596
4546
|
},
|
|
4597
4547
|
drawUnderline: (t, n, r) => {
|
|
4598
|
-
|
|
4548
|
+
Qi(e, t, 0, 0, n, t.color, s, d.dpr, r);
|
|
4599
4549
|
},
|
|
4600
4550
|
sameUnderline: (e, t) => e.underline === t.underline && e.underlineStyle === t.underlineStyle && e.underlineColor === t.underlineColor && e.underlineFill === t.underlineFill && e.underlineLine === t.underlineLine && e.underlineLineNoFill === t.underlineLineNoFill && e.color === t.color && e.noFill === t.noFill,
|
|
4601
4551
|
drawStrike: (t, n, r, i) => {
|
|
4602
|
-
|
|
4552
|
+
$i(e, t, n, r, i, t.color, d.dpr);
|
|
4603
4553
|
},
|
|
4604
4554
|
drawObject: (t, n, r) => {
|
|
4605
|
-
|
|
4555
|
+
oa(e, t, n, r);
|
|
4606
4556
|
}
|
|
4607
4557
|
});
|
|
4608
4558
|
if (f) for (let e of T) f({
|
|
@@ -4621,14 +4571,14 @@ function To(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
4621
4571
|
...e.hyperlink ? { hyperlink: e.hyperlink } : {}
|
|
4622
4572
|
});
|
|
4623
4573
|
}
|
|
4624
|
-
function
|
|
4574
|
+
function ko(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
|
|
4625
4575
|
themeMajorFont: null,
|
|
4626
4576
|
themeMinorFont: null,
|
|
4627
4577
|
dpr: 1
|
|
4628
4578
|
}, m, g = !1, _, v = !1, y = g) {
|
|
4629
4579
|
if (t.vert === "wordArtVert" || t.vert === "wordArtVertRtl") {
|
|
4630
4580
|
if (g) return i;
|
|
4631
|
-
|
|
4581
|
+
Oo(e, t, t.vert, n, r, i, a, o, s ?? d, c, f, p, m, _);
|
|
4632
4582
|
return;
|
|
4633
4583
|
}
|
|
4634
4584
|
let b = t.vert === "vert" || t.vert === "eaVert", x = t.vert === "vert270";
|
|
@@ -4645,26 +4595,26 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4645
4595
|
textBodyRotation: h
|
|
4646
4596
|
}) : void 0;
|
|
4647
4597
|
if (g) return i;
|
|
4648
|
-
e.save(), e.translate(l, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4598
|
+
e.save(), e.translate(l, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), ko(e, {
|
|
4649
4599
|
...t,
|
|
4650
4600
|
vert: "horz"
|
|
4651
4601
|
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, _, t.vert === "eaVert"), e.restore();
|
|
4652
4602
|
return;
|
|
4653
4603
|
}
|
|
4654
4604
|
let S = t.textWarp;
|
|
4655
|
-
if (!g && S &&
|
|
4656
|
-
|
|
4605
|
+
if (!g && S && yt(S.preset)) {
|
|
4606
|
+
oo(e, t, S.preset, S.adj ?? [], n, r, i, a, o, s ?? d, p);
|
|
4657
4607
|
return;
|
|
4658
4608
|
}
|
|
4659
|
-
let C =
|
|
4609
|
+
let C = dn(i, a, {
|
|
4660
4610
|
lIns: t.lIns,
|
|
4661
4611
|
rIns: t.rIns,
|
|
4662
4612
|
tIns: t.tIns,
|
|
4663
4613
|
bIns: t.bIns
|
|
4664
|
-
}, o).left, w = Z(t.rIns, o), T = Z(t.tIns, o), E = Z(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D &&
|
|
4614
|
+
}, o).left, w = Z(t.rIns, o), T = Z(t.tIns, o), E = Z(t.bIns, o), D = t.wrap !== "none", O = t.autoFit === "sp", k = O ? D && Da(e, t, i, C, w, o, p, f) : D, A = Math.max(1, t.numCol ?? 1), j = Z(t.spcCol ?? 0, o), M = t.defaultBold ?? !1, N = t.defaultItalic ?? !1, P = s ?? d, F = (r, a) => {
|
|
4665
4615
|
let s = (t.defaultFontSize ?? 18) * h * o * r, c = [], l = 0, u = 0, d = a, m = /* @__PURE__ */ new Map();
|
|
4666
4616
|
for (let _ = 0; _ < t.paragraphs.length; _++) {
|
|
4667
|
-
let v = t.paragraphs[_], b = Z(v.marL, o), x = Z(v.marR, o), S = Z(v.indent, o), T = v.defFontSize == null ? s : v.defFontSize * h * o * r, E = v.defColor ? $(v.defColor) : P, D =
|
|
4617
|
+
let v = t.paragraphs[_], b = Z(v.marL, o), x = Z(v.marR, o), S = Z(v.indent, o), T = v.defFontSize == null ? s : v.defFontSize * h * o * r, E = v.defColor ? $(v.defColor) : P, D = Sa(v), { bulletLabel: F, bulletFont: I, bulletColor: L, bulletFollowsText: R, bulletImage: z } = Do(t, v, E, o, r, p, m), B = A > 1 ? (i - C - w - (A - 1) * j) / A : i - C - w, V = n + C + b, H = n + C + b + S, U = B - b - x, W = Ra(e, v, k ? U : Infinity, T, E, o, b, M, N, r, f, p, wa(D, S)), G = v.spaceBefore == null ? 0 : v.spaceBefore / 100 * h * o * r, ee = v.spaceAfter == null ? 0 : v.spaceAfter / 100 * h * o * r;
|
|
4668
4618
|
for (let n = 0; n < W.length; n++) {
|
|
4669
4619
|
let r = W[n], i = n === 0, s = n === W.length - 1, f = 0, p = [], m = 0;
|
|
4670
4620
|
for (let t of r.segments) {
|
|
@@ -4693,7 +4643,7 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4693
4643
|
n > f && (f = n);
|
|
4694
4644
|
}
|
|
4695
4645
|
i && z && z.sizePx > f && (f = z.sizePx), f > b && (d = !1);
|
|
4696
|
-
let x = f * 1.2, C = O && m > x, w =
|
|
4646
|
+
let x = f * 1.2, C = O && m > x, w = en(x, v.spaceLine, h * o);
|
|
4697
4647
|
g && !O && !y && (v.spaceLine || (w = f));
|
|
4698
4648
|
let E = v.spaceLine?.type === "pct" ? f * (v.spaceLine.val / 1e5) : w;
|
|
4699
4649
|
t.autoFit === "norm" && t.lnSpcReduction != null && v.spaceLine?.type !== "pts" && (w *= 1 - t.lnSpcReduction);
|
|
@@ -4701,12 +4651,12 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4701
4651
|
a && d && M && (p.length === 0 || p.some((e) => e.face.excel === void 0)) && (d = !1);
|
|
4702
4652
|
let N = v.fontAlgn, P;
|
|
4703
4653
|
if (a && d && N && p.length > 0) {
|
|
4704
|
-
let e =
|
|
4705
|
-
P =
|
|
4654
|
+
let e = wr * h * o;
|
|
4655
|
+
P = Er(N, p, M, e), P || (d = !1);
|
|
4706
4656
|
for (let t of r.segments) {
|
|
4707
4657
|
if (!P) break;
|
|
4708
4658
|
if (t.isTab || !t.text) continue;
|
|
4709
|
-
let n = t.lineMetric &&
|
|
4659
|
+
let n = t.lineMetric && Dr(N, {
|
|
4710
4660
|
sizePx: t.sizePx,
|
|
4711
4661
|
face: t.lineMetric
|
|
4712
4662
|
}, M, e);
|
|
@@ -4718,10 +4668,10 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4718
4668
|
}
|
|
4719
4669
|
}
|
|
4720
4670
|
if (a && d && !(g && !O && !y && !v.spaceLine)) {
|
|
4721
|
-
let e = P ?? (M ?
|
|
4671
|
+
let e = P ?? (M ? Cr(p.map((e) => ({
|
|
4722
4672
|
sizePx: e.sizePx,
|
|
4723
4673
|
box: e.face.excel
|
|
4724
|
-
}))) : p.length > 0 ?
|
|
4674
|
+
}))) : p.length > 0 ? xr(p.map((e) => ({
|
|
4725
4675
|
sizePx: e.sizePx,
|
|
4726
4676
|
share: e.face.share
|
|
4727
4677
|
}))) : {
|
|
@@ -4729,13 +4679,13 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4729
4679
|
descent: x * .2
|
|
4730
4680
|
});
|
|
4731
4681
|
M && (j = e.ascent + e.descent);
|
|
4732
|
-
let n =
|
|
4682
|
+
let n = Yt(e, v.spaceLine?.type === "pts" ? {
|
|
4733
4683
|
type: "pts",
|
|
4734
|
-
val:
|
|
4684
|
+
val: Sr(v.spaceLine.val)
|
|
4735
4685
|
} : v.spaceLine, h * o, t.autoFit === "norm" && t.lnSpcReduction != null ? t.lnSpcReduction : 0);
|
|
4736
4686
|
w = n.ascent + n.descent, k = n.ascent, A = e.descent;
|
|
4737
4687
|
}
|
|
4738
|
-
let B = s && v.spaceAfterPct != null ? j * (v.spaceAfterPct / 1e5) : ee, te = i && v.spaceBeforePct != null ? j * (v.spaceBeforePct / 1e5) : G, K = t.spcFirstLastPara === !0, ne = _ === t.paragraphs.length - 1, q = w + (s && (K || !ne) ? B : 0), re = i && (K || _ > 0) ? te : 0, ie = i ?
|
|
4688
|
+
let B = s && v.spaceAfterPct != null ? j * (v.spaceAfterPct / 1e5) : ee, te = i && v.spaceBeforePct != null ? j * (v.spaceBeforePct / 1e5) : G, K = t.spcFirstLastPara === !0, ne = _ === t.paragraphs.length - 1, q = w + (s && (K || !ne) ? B : 0), re = i && (K || _ > 0) ? te : 0, ie = i ? wa(D, S) : 0, ae = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), oe = i && ae ? z : null;
|
|
4739
4689
|
c.push({
|
|
4740
4690
|
line: r,
|
|
4741
4691
|
linePx: q,
|
|
@@ -4776,7 +4726,7 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4776
4726
|
let B = t.verticalAnchor ?? "t", V = r, H;
|
|
4777
4727
|
a === 0 && B === "b" ? (H = T + z + E, V = r - H) : H = t.autoFit === "sp" && a === 0 ? T + z + E : a;
|
|
4778
4728
|
let U = R[R.length - 1], W = U?.metricAscent !== void 0 && U.metricNaturalDescent !== void 0 ? z - (U.lineHeight - U.metricAscent) + U.metricNaturalDescent : z, G, ee = Math.max(0, H - T - E);
|
|
4779
|
-
G = B === "ctr" ? V +
|
|
4729
|
+
G = B === "ctr" ? V + rn("ctr", {
|
|
4780
4730
|
left: C,
|
|
4781
4731
|
top: T,
|
|
4782
4732
|
width: i - C - w,
|
|
@@ -4786,11 +4736,11 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4786
4736
|
for (let s of R) {
|
|
4787
4737
|
let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: h, bulletLabel: g, bulletFont: y, bulletColor: b, bulletFollowsText: x, bulletImage: S, alignment: C, isLastLine: w, useResolvedFontMetrics: T, metricAscent: E } = s;
|
|
4788
4738
|
A > 1 && ce < A - 1 && le >= se && (ce++, le = 0, G = te), G += f, le++;
|
|
4789
|
-
let D = (t.rtlCol ? A - 1 - ce : ce) * K, O = s.textX + D, k = s.bulletX + D, j = s.textMaxW, M = s.para.rtl === !0, N = M ||
|
|
4739
|
+
let D = (t.rtlCol ? A - 1 - ce : ce) * K, O = s.textX + D, k = s.bulletX + D, j = s.textMaxW, M = s.para.rtl === !0, N = M || Wr(l.segments), P = l.segments.some((e) => e.isTab);
|
|
4790
4740
|
if (P) {
|
|
4791
4741
|
let t = Z(s.para.marL, o), n = Z(s.para.marR, o), r = M ? n : t + h, i = j + t + n;
|
|
4792
4742
|
e.font = l.segments.find((e) => e.isTab).font;
|
|
4793
|
-
let a = e.measureText(" ").width, c =
|
|
4743
|
+
let a = e.measureText(" ").width, c = ti(l.segments.map((t) => {
|
|
4794
4744
|
if (t.isTab) return {
|
|
4795
4745
|
isTab: !0,
|
|
4796
4746
|
width: 0
|
|
@@ -4803,7 +4753,7 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4803
4753
|
let n = t.letterSpacingPx ?? 0;
|
|
4804
4754
|
return {
|
|
4805
4755
|
isTab: !1,
|
|
4806
|
-
width: t.text ? (t.leadingLetterSpacingPx ?? 0) +
|
|
4756
|
+
width: t.text ? (t.leadingLetterSpacingPx ?? 0) + ja(e, t.text, n) : 0
|
|
4807
4757
|
};
|
|
4808
4758
|
}), (s.para.tabStops ?? []).map((e) => ({
|
|
4809
4759
|
pos: Z(e.pos, o),
|
|
@@ -4823,12 +4773,12 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4823
4773
|
}
|
|
4824
4774
|
e.font = t.font;
|
|
4825
4775
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4826
|
-
if (F += t.leadingLetterSpacingPx ?? 0, F += t.text ?
|
|
4776
|
+
if (F += t.leadingLetterSpacingPx ?? 0, F += t.text ? ja(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (I = Math.max(I, n.actualBoundingBoxAscent)), T) {
|
|
4827
4777
|
let e = n.fontBoundingBoxAscent ?? 0, t = e + (n.fontBoundingBoxDescent ?? 0);
|
|
4828
4778
|
t > R && (R = t, L = e);
|
|
4829
4779
|
}
|
|
4830
4780
|
}
|
|
4831
|
-
let z = T && R > 0 ? B === "t" && I > 0 ? s.para.spaceLine?.type === "pct" ? Math.max(I, L + (s.baselineLineHeight - R) / 2) : I : Math.max(I, L + Math.max(0, d - R) / 2) : Math.max(d * .8, I), V = E === void 0 ? G + z : G + E, H = V + (l.segments.find((e) => !e.isTab && !e.math && !!e.text)?.fontAlgnOffsetPx ?? 0), U = O + j, W = S && _ ? p.pictureBulletImages?.has(S.imagePath) ? p.pictureBulletImages.get(S.imagePath) :
|
|
4781
|
+
let z = T && R > 0 ? B === "t" && I > 0 ? s.para.spaceLine?.type === "pct" ? Math.max(I, L + (s.baselineLineHeight - R) / 2) : I : Math.max(I, L + Math.max(0, d - R) / 2) : Math.max(d * .8, I), V = E === void 0 ? G + z : G + E, H = V + (l.segments.find((e) => !e.isTab && !e.math && !!e.text)?.fontAlgnOffsetPx ?? 0), U = O + j, W = S && _ ? p.pictureBulletImages?.has(S.imagePath) ? p.pictureBulletImages.get(S.imagePath) : Je(S.imagePath, _) : void 0, ee = 0;
|
|
4832
4782
|
if (N && M) {
|
|
4833
4783
|
if (g) e.font = y, ee = e.measureText(g).width;
|
|
4834
4784
|
else if (S && W) {
|
|
@@ -4839,7 +4789,7 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4839
4789
|
if (g) {
|
|
4840
4790
|
e.font = y;
|
|
4841
4791
|
let t = l.segments.find((e) => !e.isTab && !e.math && !!e.text);
|
|
4842
|
-
if (e.fillStyle = x && t?.patternFill ?
|
|
4792
|
+
if (e.fillStyle = x && t?.patternFill ? sa(e, t, k, H, o) : b, N && M) {
|
|
4843
4793
|
let t = e.direction;
|
|
4844
4794
|
e.direction = "rtl", e.fillText(g, U - ee, H), e.direction = t;
|
|
4845
4795
|
} else e.fillText(g, k, H);
|
|
@@ -4849,8 +4799,8 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4849
4799
|
N && M ? e.drawImage(W, U - n, r, n, t) : e.drawImage(W, k, r, n, t);
|
|
4850
4800
|
}
|
|
4851
4801
|
let ne = O + h, q;
|
|
4852
|
-
q = P ? M ? O + j - ee - F : ne : C === "ctr" ?
|
|
4853
|
-
let ie = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, ae = w || (l.endsWithBreak ?? !1), oe = (ie && !N && !P &&
|
|
4802
|
+
q = P ? M ? O + j - ee - F : ne : C === "ctr" ? sn("ctr", ne, j - h, F, !1, !0) : C === "r" ? sn("r", O - ee, j, F, !1, !0) : ne;
|
|
4803
|
+
let ie = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, ae = w || (l.endsWithBreak ?? !1), oe = (ie && !N && !P && $t(C, w, l.endsWithBreak ?? !1) ? qr(l.segments, j - h, F, ie, ae) : null) ?? l.segments, ue = N ? Gr(l.segments, M) : null, de = (e, t) => {
|
|
4854
4804
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4855
4805
|
let n = l.segments[Math.min(e, t)], r = l.segments[Math.max(e, t)];
|
|
4856
4806
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
@@ -4868,22 +4818,22 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4868
4818
|
let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, _ = h && h.length > 0 ? h.length * g : 0;
|
|
4869
4819
|
if (l.math) {
|
|
4870
4820
|
let t = l.math.width;
|
|
4871
|
-
|
|
4821
|
+
oa(e, l, q, H - l.math.ascent), q += t, q += f;
|
|
4872
4822
|
continue;
|
|
4873
4823
|
}
|
|
4874
4824
|
e.font = l.font;
|
|
4875
|
-
let y = l.drawSizePx ?? l.sizePx, b = l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0, x = V + (l.fontAlgnOffsetPx ?? 0) + b, S =
|
|
4825
|
+
let y = l.drawSizePx ?? l.sizePx, b = l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0, x = V + (l.fontAlgnOffsetPx ?? 0) + b, S = sa(e, l, q, x, o);
|
|
4876
4826
|
e.fillStyle = S;
|
|
4877
4827
|
let C = l.letterSpacingPx ?? 0;
|
|
4878
4828
|
if (l.highlight && l.text) {
|
|
4879
|
-
let t =
|
|
4880
|
-
|
|
4829
|
+
let t = ja(e, l.text, C) + _ + f;
|
|
4830
|
+
Xi(e, q, x, t, y, l.highlight, S, l.lineMetric);
|
|
4881
4831
|
}
|
|
4882
4832
|
let w = l.shadow, T = (e, t, n, r) => {
|
|
4883
4833
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4884
|
-
if (C !== 0 &&
|
|
4834
|
+
if (C !== 0 && Oa(t) > 1) {
|
|
4885
4835
|
let r = e, a = r.letterSpacing;
|
|
4886
|
-
if (
|
|
4836
|
+
if (Aa(e)) {
|
|
4887
4837
|
r.letterSpacing = `${C}px`, i(t, n, x);
|
|
4888
4838
|
try {
|
|
4889
4839
|
r.letterSpacing = a;
|
|
@@ -4896,15 +4846,15 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4896
4846
|
}
|
|
4897
4847
|
}
|
|
4898
4848
|
} else i(t, n, x);
|
|
4899
|
-
}, E = (t) =>
|
|
4849
|
+
}, E = (t) => ja(e, t, C), D = h && h.length > 0 ? lr([...l.text], h, g, E) : null, O = [...l.text], k = !!h && h.length === O.length - 1 && O.length > 1, A = (e, t) => {
|
|
4900
4850
|
if (v) {
|
|
4901
4851
|
let n = k ? C + g : C;
|
|
4902
|
-
|
|
4852
|
+
ii(e, l.text, q, x, y, n, t);
|
|
4903
4853
|
return;
|
|
4904
4854
|
}
|
|
4905
4855
|
if (k) {
|
|
4906
4856
|
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = C + g;
|
|
4907
|
-
if (
|
|
4857
|
+
if (Aa(e)) {
|
|
4908
4858
|
let t = e, i = t.letterSpacing;
|
|
4909
4859
|
t.letterSpacing = `${r}px`, n(l.text, q, x);
|
|
4910
4860
|
try {
|
|
@@ -4925,8 +4875,8 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4925
4875
|
if (t > 0 && n > 0) {
|
|
4926
4876
|
e.font = l.font;
|
|
4927
4877
|
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;
|
|
4928
|
-
|
|
4929
|
-
e.font = l.font, e.fillStyle =
|
|
4878
|
+
ga(e, (e) => {
|
|
4879
|
+
e.font = l.font, e.fillStyle = sa(e, l, q, x, o), A(e, "fill");
|
|
4930
4880
|
}, {
|
|
4931
4881
|
x: (q - s) * f,
|
|
4932
4882
|
y: (x - i) * f,
|
|
@@ -4940,7 +4890,7 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4940
4890
|
e.save(), e.shadowColor = $(w.color, w.alpha), e.shadowBlur = Z(w.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4941
4891
|
}
|
|
4942
4892
|
l.noFill || A(e, "fill"), w && !l.noFill && e.restore(), e.font = l.font;
|
|
4943
|
-
let M =
|
|
4893
|
+
let M = ja(e, l.text, C) + _, P = l.outline;
|
|
4944
4894
|
P && P.width > 0 && (e.save(), e.lineWidth = Math.max(.5, Z(P.width, o)), e.strokeStyle = P.fill ? re(P.fill, e, q, x - y, Math.max(1, M), y, 0, o * 12700) ?? "rgba(0,0,0,0)" : P.color ? `#${P.color}` : l.noFill ? "rgba(0,0,0,0)" : S, (!l.noFill || P.fill || P.color) && (e.lineJoin = "round", A(e, "stroke")), e.restore()), m && l.text && m({
|
|
4945
4895
|
text: l.text,
|
|
4946
4896
|
inShapeX: q - n,
|
|
@@ -4955,15 +4905,15 @@ function Eo(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4955
4905
|
shapeH: a,
|
|
4956
4906
|
rotation: c,
|
|
4957
4907
|
hyperlink: l.hyperlink
|
|
4958
|
-
}),
|
|
4908
|
+
}), ea(e, l, q, x, M + f, S, o, p.dpr), q += M, q += f;
|
|
4959
4909
|
}
|
|
4960
4910
|
N && (e.direction = "ltr"), G += u;
|
|
4961
4911
|
}
|
|
4962
4912
|
e.restore();
|
|
4963
4913
|
}
|
|
4964
|
-
function
|
|
4914
|
+
function Ao(e, t, n, r, i, a) {
|
|
4965
4915
|
if (!e) return [];
|
|
4966
|
-
let o =
|
|
4916
|
+
let o = rr(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), s = ir(n), c = r * i, l = [];
|
|
4967
4917
|
if (e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && l.push({
|
|
4968
4918
|
widthPx: e.bevelT.w * c,
|
|
4969
4919
|
heightPx: e.bevelT.h * c,
|
|
@@ -4995,9 +4945,9 @@ function Do(e, t, n, r, i, a) {
|
|
|
4995
4945
|
});
|
|
4996
4946
|
return l;
|
|
4997
4947
|
}
|
|
4998
|
-
function
|
|
4948
|
+
function jo(e, t, n, r, i, a) {
|
|
4999
4949
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
5000
|
-
let o = e.extrusionH * i * a, s =
|
|
4950
|
+
let o = e.extrusionH * i * a, s = jn({
|
|
5001
4951
|
...t,
|
|
5002
4952
|
unitsPerInch: (t.unitsPerInch ?? 96) * a,
|
|
5003
4953
|
sceneDepth: (t.sceneDepth ?? 0) * a
|
|
@@ -5022,7 +4972,7 @@ function Oo(e, t, n, r, i, a) {
|
|
|
5022
4972
|
rgb: c
|
|
5023
4973
|
};
|
|
5024
4974
|
}
|
|
5025
|
-
function
|
|
4975
|
+
function Mo(e, t, n, r, i, a = n) {
|
|
5026
4976
|
let o = e.a * e.d - e.b * e.c;
|
|
5027
4977
|
if (Math.abs(o) <= 1e-12) return;
|
|
5028
4978
|
let s = e.d / o, c = -e.b / o, l = -e.c / o, u = e.a / o, d = -(s * e.e + l * e.f), f = -(c * e.e + u * e.f);
|
|
@@ -5035,19 +4985,19 @@ function ko(e, t, n, r, i, a = n) {
|
|
|
5035
4985
|
f: a + t * (f - i)
|
|
5036
4986
|
};
|
|
5037
4987
|
}
|
|
5038
|
-
function
|
|
4988
|
+
function No(e, t, n, r, i, a, o, s = {}) {
|
|
5039
4989
|
if (i <= 0 || a <= 0) return !1;
|
|
5040
|
-
let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = s.backDepthCss ?? 0, { face: f, corners: p, backFacing: m, padDev: h } =
|
|
4990
|
+
let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = s.backDepthCss ?? 0, { face: f, corners: p, backFacing: m, padDev: h } = ho(t, i, a, d, s.edgePadCss, u), g = p, _ = h, v = h, y = Math.max(1, Math.ceil(i * u) + 2 * h), b = Math.max(1, Math.ceil(a * u) + 2 * h);
|
|
5041
4991
|
if (s.measureOverflow) {
|
|
5042
|
-
let t =
|
|
4992
|
+
let t = hn(e, (e) => o(e, 0, 0, i, a));
|
|
5043
4993
|
if (t) {
|
|
5044
4994
|
let e = Math.min(-h, Math.floor(t.x * u) - 1), n = Math.min(-h, Math.floor(t.y * u) - 1), r = Math.max(y - h, Math.ceil((t.x + t.w) * u) + 1), o = Math.max(b - h, Math.ceil((t.y + t.h) * u) + 1), s = [
|
|
5045
4995
|
[e, n],
|
|
5046
4996
|
[r, n],
|
|
5047
4997
|
[r, o],
|
|
5048
4998
|
[e, o]
|
|
5049
|
-
].map(([e, t]) =>
|
|
5050
|
-
if (s.some((e) => !e)) return
|
|
4999
|
+
].map(([e, t]) => Wt(f, e / u / i, t / u / a));
|
|
5000
|
+
if (s.some((e) => !e)) return Wt(f, .5, .5) === null;
|
|
5051
5001
|
g = s, _ = -e, v = -n, y = r - e, b = o - n;
|
|
5052
5002
|
}
|
|
5053
5003
|
}
|
|
@@ -5056,7 +5006,7 @@ function Ao(e, t, n, r, i, a, o, s = {}) {
|
|
|
5056
5006
|
if (!x) return !1;
|
|
5057
5007
|
let S = x.getContext("2d");
|
|
5058
5008
|
if (!S) return !1;
|
|
5059
|
-
S.save(), S.scale(u, u), S.translate(_ / u, v / u), s.preservePatternFrame ? U(e, S, () => o(S, 0, 0, i, a), void 0,
|
|
5009
|
+
S.save(), S.scale(u, u), S.translate(_ / u, v / u), s.preservePatternFrame ? U(e, S, () => o(S, 0, 0, i, a), void 0, Mo(c, u, _, n, r, v)) : o(S, 0, 0, i, a), S.restore();
|
|
5060
5010
|
let C = Math.ceil(i * u), w = Math.ceil(a * u), T = (e) => ({
|
|
5061
5011
|
x: _ - e,
|
|
5062
5012
|
y: v - e,
|
|
@@ -5067,14 +5017,14 @@ function Ao(e, t, n, r, i, a, o, s = {}) {
|
|
|
5067
5017
|
offsetX: -s.extrusion.offsetX,
|
|
5068
5018
|
offsetY: -s.extrusion.offsetY
|
|
5069
5019
|
} : s.extrusion, D = s.bevels?.some((e) => e.material === "legacyWireframe"), O = m && s.bevels?.some((e) => e.bottom), k = () => {
|
|
5070
|
-
!E || D ||
|
|
5020
|
+
!E || D || sr(S, E, T(Math.ceil(Math.hypot(E.offsetX, E.offsetY)) + 2));
|
|
5071
5021
|
};
|
|
5072
5022
|
if (O || k(), s.bevels && s.bevels.length > 0) for (let e of s.bevels) {
|
|
5073
5023
|
let t = D && E ? {
|
|
5074
5024
|
x: E.offsetX,
|
|
5075
5025
|
y: E.offsetY
|
|
5076
5026
|
} : void 0, n = e.widthPx + (t ? Math.hypot(t.x, t.y) : 0);
|
|
5077
|
-
|
|
5027
|
+
or(S, t ? {
|
|
5078
5028
|
...e,
|
|
5079
5029
|
wireframeDepth: t
|
|
5080
5030
|
} : e, T(Math.ceil(n) + 2));
|
|
@@ -5084,19 +5034,19 @@ function Ao(e, t, n, r, i, a, o, s = {}) {
|
|
|
5084
5034
|
x: n + e.x,
|
|
5085
5035
|
y: r + e.y
|
|
5086
5036
|
}));
|
|
5087
|
-
return
|
|
5037
|
+
return Kt(x, e, y, b, A), !0;
|
|
5088
5038
|
}
|
|
5089
|
-
function
|
|
5039
|
+
function Po(e, t, n, r, i, a, o, s, c = 0) {
|
|
5090
5040
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
5091
5041
|
let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = te(m, h);
|
|
5092
5042
|
if (!g) return !1;
|
|
5093
5043
|
let _ = g.getContext("2d");
|
|
5094
5044
|
if (!_) return !1;
|
|
5095
|
-
_.save(), _.scale(d, d), _.translate(p, p), U(e, _, () => o(_, 0, 0, r, i), void 0,
|
|
5045
|
+
_.save(), _.scale(d, d), _.translate(p, p), U(e, _, () => o(_, 0, 0, r, i), void 0, Mo(l, d, f, t, n)), _.restore();
|
|
5096
5046
|
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
5097
5047
|
for (let e of a) {
|
|
5098
5048
|
let t = Math.ceil(e.widthPx) + 2;
|
|
5099
|
-
|
|
5049
|
+
or(_, e, {
|
|
5100
5050
|
x: f - t,
|
|
5101
5051
|
y: f - t,
|
|
5102
5052
|
w: v + 2 * t,
|
|
@@ -5105,17 +5055,17 @@ function jo(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
5105
5055
|
}
|
|
5106
5056
|
return s && (_.save(), _.scale(d, d), _.translate(p, p), s(_, 0, 0, r, i), _.restore()), e.drawImage(g, t - p, n - p, m / d, h / d), !0;
|
|
5107
5057
|
}
|
|
5108
|
-
var
|
|
5109
|
-
function
|
|
5110
|
-
let t =
|
|
5058
|
+
var Fo = /* @__PURE__ */ new WeakMap();
|
|
5059
|
+
function Io(e) {
|
|
5060
|
+
let t = Fo.get(e);
|
|
5111
5061
|
return t || (t = async (t, n) => {
|
|
5112
5062
|
let r = await e(t);
|
|
5113
5063
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
5114
|
-
},
|
|
5064
|
+
}, Fo.set(e, t)), t;
|
|
5115
5065
|
}
|
|
5116
|
-
function
|
|
5117
|
-
let o =
|
|
5118
|
-
return
|
|
5066
|
+
function Lo(e, t, n = Io(t), r, i, a) {
|
|
5067
|
+
let o = Io(t);
|
|
5068
|
+
return at(e.posterPath, e.posterMimeType || "application/octet-stream", o, {
|
|
5119
5069
|
tiff: r,
|
|
5120
5070
|
svgDecoder: a,
|
|
5121
5071
|
...i ?? {}
|
|
@@ -5124,11 +5074,11 @@ function Po(e, t, n = No(t), r, i, a) {
|
|
|
5124
5074
|
return e;
|
|
5125
5075
|
});
|
|
5126
5076
|
}
|
|
5127
|
-
function
|
|
5077
|
+
function Ro(e, t, n, r = "tiff") {
|
|
5128
5078
|
let i = Z(t.x, n), a = Z(t.y, n), o = Z(t.width, n), s = Z(t.height, n);
|
|
5129
5079
|
e.save();
|
|
5130
5080
|
try {
|
|
5131
|
-
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(i + o / 2, a + s / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(i + o / 2), -(a + s / 2))),
|
|
5081
|
+
t.alpha != null && (e.globalAlpha *= t.alpha), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(i + o / 2, a + s / 2), e.rotate(t.rotation * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-(i + o / 2), -(a + s / 2))), Ft(e, r, {
|
|
5132
5082
|
x: i,
|
|
5133
5083
|
y: a,
|
|
5134
5084
|
width: o,
|
|
@@ -5138,13 +5088,13 @@ function Fo(e, t, n, r = "tiff") {
|
|
|
5138
5088
|
e.restore();
|
|
5139
5089
|
}
|
|
5140
5090
|
}
|
|
5141
|
-
async function
|
|
5142
|
-
if (e.mimeType === "image/x-pict") return { paint: (n) =>
|
|
5143
|
-
if (!n) return
|
|
5091
|
+
async function zo(e, t, n, i, a = 1, o, s) {
|
|
5092
|
+
if (e.mimeType === "image/x-pict") return { paint: (n) => Ro(n, e, t, "pict") };
|
|
5093
|
+
if (!n) return za;
|
|
5144
5094
|
try {
|
|
5145
5095
|
let c = e.mimeType === "image/svg+xml", l = pe(e.mimeType, e.srcRect, e.width / h, e.height / h);
|
|
5146
|
-
if (!l) return
|
|
5147
|
-
let { widthPt: u, heightPt: d } = l, f =
|
|
5096
|
+
if (!l) return za;
|
|
5097
|
+
let { widthPt: u, heightPt: d } = l, f = Ri(Z(e.width, t), Z(e.height, t), a, e.srcRect), p = ze(e) || c, m = p ? f : s && !Q(e) ? Ui(s, Hi(Wi(e), p ? void 0 : Q(e))) : void 0, g = m && "maxRetainedPixels" in m ? m.maxRetainedPixels : void 0, _ = {
|
|
5148
5098
|
...m ? {
|
|
5149
5099
|
targetWidthPx: m.targetWidthPx,
|
|
5150
5100
|
targetHeightPx: m.targetHeightPx,
|
|
@@ -5152,21 +5102,21 @@ async function Io(e, t, n, i, a = 1, o, s) {
|
|
|
5152
5102
|
} : {},
|
|
5153
5103
|
workerDecoder: o
|
|
5154
5104
|
}, v;
|
|
5155
|
-
if (!Q(e) &&
|
|
5156
|
-
v = await
|
|
5105
|
+
if (!Q(e) && ze(e)) try {
|
|
5106
|
+
v = await lt(e.svgImagePath, n, _);
|
|
5157
5107
|
} catch (t) {
|
|
5158
|
-
if (t instanceof J ||
|
|
5159
|
-
v = c ? await
|
|
5108
|
+
if (t instanceof J || Bi(t) || Mt(t)) throw t;
|
|
5109
|
+
v = c ? await lt(e.imagePath, n, _) : await Qe(e.imagePath, e.mimeType, Q(e), n, {
|
|
5160
5110
|
widthPt: u,
|
|
5161
5111
|
heightPt: d,
|
|
5162
5112
|
...m ?? {},
|
|
5163
5113
|
tiff: i
|
|
5164
5114
|
});
|
|
5165
5115
|
}
|
|
5166
|
-
else if (c && !Q(e)) v = await
|
|
5116
|
+
else if (c && !Q(e)) v = await lt(e.imagePath, n, _);
|
|
5167
5117
|
else {
|
|
5168
5118
|
let t = e.blipEffects?.length ? r(e.width / h, e.height / h, e.srcRect, null) : null;
|
|
5169
|
-
v = await
|
|
5119
|
+
v = await Qe(e.imagePath, e.mimeType, Q(e), n, {
|
|
5170
5120
|
widthPt: t?.width ?? u,
|
|
5171
5121
|
heightPt: t?.height ?? d,
|
|
5172
5122
|
...m ?? {},
|
|
@@ -5174,32 +5124,32 @@ async function Io(e, t, n, i, a = 1, o, s) {
|
|
|
5174
5124
|
svgDecoder: o
|
|
5175
5125
|
});
|
|
5176
5126
|
}
|
|
5177
|
-
if (!v) return
|
|
5127
|
+
if (!v) return za;
|
|
5178
5128
|
let y = v;
|
|
5179
|
-
return { paint: (n) =>
|
|
5129
|
+
return { paint: (n) => Vo(n, e, y, t) };
|
|
5180
5130
|
} catch (n) {
|
|
5181
|
-
return
|
|
5131
|
+
return Bo(e, t, n);
|
|
5182
5132
|
}
|
|
5183
5133
|
}
|
|
5184
|
-
function
|
|
5185
|
-
return
|
|
5186
|
-
...
|
|
5134
|
+
function Bo(e, t, n) {
|
|
5135
|
+
return zt(n, "tiff") ? { paint: (n) => Ro(n, e, t) } : n instanceof J || Bi(n) || Mt(n) || Ut(n) ? {
|
|
5136
|
+
...za,
|
|
5187
5137
|
failure: { error: n }
|
|
5188
|
-
} :
|
|
5138
|
+
} : za;
|
|
5189
5139
|
}
|
|
5190
|
-
function
|
|
5140
|
+
function Vo(e, t, n, r) {
|
|
5191
5141
|
try {
|
|
5192
5142
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5193
5143
|
let i = Z(t.x, r), a = Z(t.y, r), o = Z(t.width, r), s = Z(t.height, r);
|
|
5194
5144
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(i + o / 2, a + s / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(i + o / 2), -(a + s / 2)));
|
|
5195
5145
|
let c = (e, n, r, i, a) => {
|
|
5196
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
5146
|
+
t.custGeom && t.custGeom.length > 0 ? So(e, t.custGeom, n, r, i, a) : t.prstGeom && Ae(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
5197
5147
|
}, l = (e, t, n, r, i) => {
|
|
5198
5148
|
e.beginPath(), c(e, t, n, r, i);
|
|
5199
5149
|
}, u = (e, r, i, a, o) => {
|
|
5200
5150
|
!(t.prstGeom === "rect" && !t.custGeom?.length && B(n)) && (t.prstGeom || t.custGeom && t.custGeom.length > 0) && (l(e, r, i, a, o), e.clip());
|
|
5201
5151
|
}, d = (e, n, i, a, o) => {
|
|
5202
|
-
t.stroke && (A(t.stroke?.fill) && (e = ae(e)), e.save(), l(e, n, i, a, o),
|
|
5152
|
+
t.stroke && (A(t.stroke?.fill) && (e = ae(e)), e.save(), l(e, n, i, a, o), Wo(e, t.stroke, r, {
|
|
5203
5153
|
x: n,
|
|
5204
5154
|
y: i,
|
|
5205
5155
|
w: a,
|
|
@@ -5217,68 +5167,68 @@ function Ro(e, t, n, r) {
|
|
|
5217
5167
|
...t.scene3d.camera,
|
|
5218
5168
|
unitsPerInch: 914400 * r,
|
|
5219
5169
|
sceneDepth: (t.sp3d?.extrusionH ?? 0) * r
|
|
5220
|
-
}, m = p &&
|
|
5170
|
+
}, m = p && kn(p, o, s, (t.sp3d?.extrusionH ?? 0) * r) ? {
|
|
5221
5171
|
...t.scene3d,
|
|
5222
5172
|
camera: p
|
|
5223
5173
|
} : null, g = (e, i, a, o, s) => {
|
|
5224
|
-
let d = t.fill && t.fill.fillType !== "none" && t.fill.fillType !== "image" ?
|
|
5174
|
+
let d = t.fill && t.fill.fillType !== "none" && t.fill.fillType !== "image" ? Zi(t.fill, e, i, a, o, s, t.rotation, r * h, c) : null;
|
|
5225
5175
|
d && (e.save(), l(e, i, a, o, s), e.fillStyle = d, e.fill(), e.restore()), e.save(), u(e, i, a, o, s), he(e, n, t.srcRect, i, a, o, s), e.restore();
|
|
5226
5176
|
}, _ = (e, t, n, r, i) => {
|
|
5227
5177
|
g(e, t, n, r, i), d(e, t, n, r, i), f(e, t, n, r, i);
|
|
5228
5178
|
}, v = (e, t, n, r, i) => {
|
|
5229
5179
|
g(e, t, n, r, i), d(e, t, n, r, i);
|
|
5230
|
-
}, y = e.getTransform(), b = Math.abs(y.a * y.d - y.b * y.c), x = b > 0 ? Math.sqrt(b) : 1, S =
|
|
5180
|
+
}, y = e.getTransform(), b = Math.abs(y.a * y.d - y.b * y.c), x = b > 0 ? Math.sqrt(b) : 1, S = Ao(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, r, x, t.scene3d?.camera), C = (S.find((e) => e.bottom)?.depthPx ?? 0) / x, w = m ? jo(t.sp3d, m.camera, o, s, r, x) : null, T = t.stroke ? t.stroke.width * r / 2 : 0, E = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, D = w ? Math.hypot(w.offsetX, w.offsetY) / x : 0, O = T + E + D + 2, k = (e) => {
|
|
5231
5181
|
if (m) {
|
|
5232
|
-
if (
|
|
5182
|
+
if (No(e, m.camera, i, a, o, s, v, {
|
|
5233
5183
|
bevels: S,
|
|
5234
5184
|
backDepthCss: C,
|
|
5235
5185
|
extrusion: w ?? void 0,
|
|
5236
5186
|
paintEdges: f,
|
|
5237
5187
|
edgePadCss: O
|
|
5238
5188
|
})) return;
|
|
5239
|
-
} else if (S.length > 0 &&
|
|
5189
|
+
} else if (S.length > 0 && Po(e, i, a, o, s, S, v, f, O)) return;
|
|
5240
5190
|
_(e, i, a, o, s);
|
|
5241
5191
|
}, j = (e, t, n, r, i, a) => {
|
|
5242
5192
|
e.save(), u(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5243
|
-
}, M = e.getTransform(), N = Math.abs(M.a * M.d - M.b * M.c), P = N > 0 ? Math.sqrt(N) : 1, F = T + E, I = (t.custGeom && t.custGeom.length > 0 ?
|
|
5193
|
+
}, M = e.getTransform(), N = Math.abs(M.a * M.d - M.b * M.c), P = N > 0 ? Math.sqrt(N) : 1, F = T + E, I = (t.custGeom && t.custGeom.length > 0 ? ke(t.custGeom, i, a, o, s) : t.prstGeom && Pe(t.prstGeom.toLowerCase()) ? ve(t.prstGeom.toLowerCase(), i, a, o, s, t.prstAdjust ?? []) : null) ?? {
|
|
5244
5194
|
x: i,
|
|
5245
5195
|
y: a,
|
|
5246
5196
|
w: o,
|
|
5247
5197
|
h: s
|
|
5248
|
-
}, L = m ?
|
|
5249
|
-
bbox:
|
|
5250
|
-
anchor:
|
|
5251
|
-
}, R = r * P, z = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), V = (e) => j(e, "#000", i, a, o, s), H = m && z ?
|
|
5198
|
+
}, L = m ? go(m.camera, M, i, a, o, s, O, t.shadow?.algn, C) : {
|
|
5199
|
+
bbox: uo(M, I.x - F, I.y - F, I.w + F * 2, I.h + F * 2),
|
|
5200
|
+
anchor: mo(M, i, a, o, s, t.shadow?.algn)
|
|
5201
|
+
}, R = r * P, z = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), V = (e) => j(e, "#000", i, a, o, s), H = m && z ? _o(k, M, L.bbox, {
|
|
5252
5202
|
w: e.canvas.width || 0,
|
|
5253
5203
|
h: e.canvas.height || 0
|
|
5254
5204
|
}) : k, U = !!m || S.length > 0;
|
|
5255
|
-
|
|
5205
|
+
vo(e, t, H, U ? H : V, L.bbox, L.anchor, r, R, M, !0, U), e.restore();
|
|
5256
5206
|
} catch (n) {
|
|
5257
|
-
let i =
|
|
5207
|
+
let i = Bo(t, r, n);
|
|
5258
5208
|
if (i.paint(e), i.failure) throw i.failure.error;
|
|
5259
5209
|
}
|
|
5260
5210
|
}
|
|
5261
|
-
async function
|
|
5211
|
+
async function Ho(e, t, n, r, i, a, o = 1, s, c) {
|
|
5262
5212
|
let l = Z(e.x, t), u = Z(e.y, t), d = Z(e.width, t), f = Z(e.height, t), p, m = !1;
|
|
5263
5213
|
if (e.posterPath && n) try {
|
|
5264
|
-
p = await
|
|
5214
|
+
p = await Lo(e, n, i, a, e.posterMimeType === "image/svg+xml" ? Ri(d, f, o) : c ? Ui(c, Hi(e.posterPath)) : void 0, s);
|
|
5265
5215
|
} catch (e) {
|
|
5266
|
-
if (
|
|
5267
|
-
else if (e instanceof J ||
|
|
5268
|
-
...
|
|
5216
|
+
if (zt(e, "tiff")) m = !0;
|
|
5217
|
+
else if (e instanceof J || Bi(e) || Mt(e) || Ut(e)) return {
|
|
5218
|
+
...za,
|
|
5269
5219
|
failure: { error: e }
|
|
5270
5220
|
};
|
|
5271
5221
|
}
|
|
5272
5222
|
return { paint: (n) => {
|
|
5273
|
-
n.save(),
|
|
5223
|
+
n.save(), Go(n, e, t), p ? n.drawImage(p, l, u, d, f) : (n.fillStyle = e.mediaKind === "video" ? "#111" : "#f0f0f0", n.fillRect(l, u, d, f), m && Ft(n, "tiff", {
|
|
5274
5224
|
x: l,
|
|
5275
5225
|
y: u,
|
|
5276
5226
|
width: d,
|
|
5277
5227
|
height: f
|
|
5278
|
-
})), r ||
|
|
5228
|
+
})), r || Hr(n, l + d / 2, u + f / 2, d, f, "paused"), n.restore();
|
|
5279
5229
|
} };
|
|
5280
5230
|
}
|
|
5281
|
-
function
|
|
5231
|
+
function Uo(e, t, n, r, i, a, o) {
|
|
5282
5232
|
let s = Math.max(.5, Z(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5283
5233
|
if (u === 0) return;
|
|
5284
5234
|
let d = -l / u, f = c / u, p;
|
|
@@ -5328,34 +5278,34 @@ function Bo(e, t, n, r, i, a, o) {
|
|
|
5328
5278
|
break;
|
|
5329
5279
|
default: return;
|
|
5330
5280
|
}
|
|
5331
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ?
|
|
5281
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ? Zi(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o, a * 12700) : null) ?? $(r.color);
|
|
5332
5282
|
for (let i of p) {
|
|
5333
5283
|
let c = d * (s * i.offset), l = f * (s * i.offset);
|
|
5334
5284
|
if (e.lineWidth = Math.max(.5, s * i.widthFrac), e.beginPath(), e.moveTo(t.x + c, t.y + l), e.lineTo(n.x + c, n.y + l), r.fill && A(r.fill)) {
|
|
5335
|
-
let i =
|
|
5285
|
+
let i = Zi(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o, a * h, void 0, P(e));
|
|
5336
5286
|
i && (e.strokeStyle = i);
|
|
5337
5287
|
}
|
|
5338
5288
|
e.stroke();
|
|
5339
5289
|
}
|
|
5340
5290
|
e.restore();
|
|
5341
5291
|
}
|
|
5342
|
-
function
|
|
5292
|
+
function Wo(e, t, n, r, i = 0) {
|
|
5343
5293
|
if (K(e, t, n), t?.fill && r) {
|
|
5344
|
-
let a =
|
|
5294
|
+
let a = Zi(t.fill, e, r.x, r.y, r.w, r.h, i, n * h, void 0, P(e));
|
|
5345
5295
|
a && (e.strokeStyle = a);
|
|
5346
5296
|
}
|
|
5347
5297
|
}
|
|
5348
|
-
function
|
|
5298
|
+
function Go(e, t, n) {
|
|
5349
5299
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5350
5300
|
let r = Z(t.x, n), i = Z(t.y, n), a = Z(t.width, n), o = Z(t.height, n);
|
|
5351
5301
|
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));
|
|
5352
5302
|
}
|
|
5353
|
-
function
|
|
5303
|
+
function Ko(e, t, n, r, i = {
|
|
5354
5304
|
themeMajorFont: null,
|
|
5355
5305
|
themeMinorFont: null,
|
|
5356
5306
|
dpr: 1
|
|
5357
5307
|
}, a) {
|
|
5358
|
-
e.save(),
|
|
5308
|
+
e.save(), Go(e, t, n);
|
|
5359
5309
|
let o = Z(t.x, n), s = Z(t.y, n), c = (e) => e.spcFirstLastPara ? {
|
|
5360
5310
|
...e,
|
|
5361
5311
|
spcFirstLastPara: !1
|
|
@@ -5369,7 +5319,7 @@ function Uo(e, t, n, r, i = {
|
|
|
5369
5319
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5370
5320
|
let s = o.cells[t];
|
|
5371
5321
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody || o.height > 0 && !m) continue;
|
|
5372
|
-
let l = d(t, s.gridSpan || 1), u =
|
|
5322
|
+
let l = d(t, s.gridSpan || 1), u = ko(e, c(s.textBody), 0, 0, l, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, o.height === 0) || 0;
|
|
5373
5323
|
u > f[a] && (f[a] = u);
|
|
5374
5324
|
}
|
|
5375
5325
|
}
|
|
@@ -5382,7 +5332,7 @@ function Uo(e, t, n, r, i = {
|
|
|
5382
5332
|
if (u <= 1 || !l.textBody) continue;
|
|
5383
5333
|
let p = d(s, l.gridSpan || 1), h = t.rows.slice(a, Math.min(t.rows.length, a + u)).some((e) => e.height === 0);
|
|
5384
5334
|
if (!h && !m) continue;
|
|
5385
|
-
let g =
|
|
5335
|
+
let g = ko(e, c(l.textBody), 0, 0, p, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, h) || 0, _ = 0;
|
|
5386
5336
|
for (let e = 0; e < u && a + e < f.length; e++) _ += f[a + e];
|
|
5387
5337
|
if (g > _) {
|
|
5388
5338
|
let e = (g - _) / u;
|
|
@@ -5450,14 +5400,14 @@ function Uo(e, t, n, r, i = {
|
|
|
5450
5400
|
}
|
|
5451
5401
|
}
|
|
5452
5402
|
let E = f.reduce((e, t) => e + t, 0), D = (r, a, o, s, c, l, u) => {
|
|
5453
|
-
if (r?.fillType === "image") e.beginPath(), e.rect(a, o, s, c),
|
|
5403
|
+
if (r?.fillType === "image") e.beginPath(), e.rect(a, o, s, c), Ka(e, r, i.shapeFillImages?.get(Wa(r, l, u, t)), {
|
|
5454
5404
|
x: a,
|
|
5455
5405
|
y: o,
|
|
5456
5406
|
w: s,
|
|
5457
5407
|
h: c
|
|
5458
5408
|
}, n, !1, t);
|
|
5459
5409
|
else {
|
|
5460
|
-
let i =
|
|
5410
|
+
let i = Zi(r, e, a, o, s, c, t.rotation, n * h);
|
|
5461
5411
|
i && (e.fillStyle = i, e.fillRect(a, o, s, c));
|
|
5462
5412
|
}
|
|
5463
5413
|
}, O = [0], k = [0];
|
|
@@ -5475,7 +5425,7 @@ function Uo(e, t, n, r, i = {
|
|
|
5475
5425
|
let t = a.textColor ? $(a.textColor) : null, p = a.textBody.vert;
|
|
5476
5426
|
S = p === void 0 || typeof p == "string" && /^[ \t\r\n]*horz[ \t\r\n]*$/.test(p) ? a.horzOverflow === "overflow" ? "overflow" : "clip" : void 0, e.save();
|
|
5477
5427
|
try {
|
|
5478
|
-
S === "clip" &&
|
|
5428
|
+
S === "clip" && pn(e, o, l), ko(e, c(a.textBody), o, s, l, u, n, t, 0, !1, !1, "#000000", r, i, b);
|
|
5479
5429
|
} finally {
|
|
5480
5430
|
e.restore();
|
|
5481
5431
|
}
|
|
@@ -5486,13 +5436,13 @@ function Uo(e, t, n, r, i = {
|
|
|
5486
5436
|
let n = T[e][t];
|
|
5487
5437
|
return n < 0 ? null : w[n];
|
|
5488
5438
|
}, P = (r, i, a, o, s) => {
|
|
5489
|
-
if (
|
|
5439
|
+
if (Wo(e, r, n, {
|
|
5490
5440
|
x: Math.min(i, o),
|
|
5491
5441
|
y: Math.min(a, s),
|
|
5492
5442
|
w: Math.max(1, Math.abs(o - i)),
|
|
5493
5443
|
h: Math.max(1, Math.abs(s - a))
|
|
5494
5444
|
}, t.rotation), r.cmpd === "dbl" && !r.dashStyle && !r.customDash?.length && (i === o || a === s)) {
|
|
5495
|
-
e.fillStyle = e.strokeStyle,
|
|
5445
|
+
e.fillStyle = e.strokeStyle, vt(e, i, a, o, s, Math.max(.5, Z(r.width, n)), M);
|
|
5496
5446
|
return;
|
|
5497
5447
|
}
|
|
5498
5448
|
let c = i === o ? x(i, e.lineWidth, M) : 0, l = a === s ? x(a, e.lineWidth, M) : 0;
|
|
@@ -5510,7 +5460,7 @@ function Uo(e, t, n, r, i = {
|
|
|
5510
5460
|
for (; a < n;) {
|
|
5511
5461
|
let r = T[e][a], o = a + 1;
|
|
5512
5462
|
for (; o < n && T[e][o] === r;) o++;
|
|
5513
|
-
let s = N(e, a), c =
|
|
5463
|
+
let s = N(e, a), c = Xr(i.borderB, s ? s.cell.borderT : null);
|
|
5514
5464
|
if (c) {
|
|
5515
5465
|
let e = v(a, o - a);
|
|
5516
5466
|
P(c, e, t, e + d(a, o - a), t);
|
|
@@ -5526,16 +5476,16 @@ function Uo(e, t, n, r, i = {
|
|
|
5526
5476
|
for (; t <= r.lastRi;) {
|
|
5527
5477
|
let n = T[t][g], i = t;
|
|
5528
5478
|
for (; i + 1 <= r.lastRi && T[i + 1][g] === n;) i++;
|
|
5529
|
-
let a = N(t, g), o =
|
|
5479
|
+
let a = N(t, g), o = Xr(p, a ? _(a.cell) : null);
|
|
5530
5480
|
o && P(o, e, y[t], e, y[i] + f[i]), t = i + 1;
|
|
5531
5481
|
}
|
|
5532
5482
|
}
|
|
5533
|
-
i.diagonalTL && (
|
|
5483
|
+
i.diagonalTL && (Wo(e, i.diagonalTL, n, {
|
|
5534
5484
|
x: a,
|
|
5535
5485
|
y: o,
|
|
5536
5486
|
w: s,
|
|
5537
5487
|
h: c
|
|
5538
|
-
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && (
|
|
5488
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + c), e.stroke()), i.diagonalTR && (Wo(e, i.diagonalTR, n, {
|
|
5539
5489
|
x: a,
|
|
5540
5490
|
y: o,
|
|
5541
5491
|
w: s,
|
|
@@ -5544,14 +5494,14 @@ function Uo(e, t, n, r, i = {
|
|
|
5544
5494
|
}
|
|
5545
5495
|
e.restore();
|
|
5546
5496
|
}
|
|
5547
|
-
function
|
|
5497
|
+
function qo(e, t, n, r) {
|
|
5548
5498
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5549
5499
|
}
|
|
5550
|
-
var
|
|
5551
|
-
function
|
|
5552
|
-
|
|
5500
|
+
var Jo = /* @__PURE__ */ new WeakMap();
|
|
5501
|
+
function Yo(e) {
|
|
5502
|
+
Jo.set(e, (Jo.get(e) ?? 0) + 1);
|
|
5553
5503
|
}
|
|
5554
|
-
function
|
|
5504
|
+
function Xo(e, t, n, r, i) {
|
|
5555
5505
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5556
5506
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5557
5507
|
e.strokeStyle = "#c8ccd2", e.lineWidth = Math.max(1, Math.min(t, n) * .004), e.setLineDash([e.lineWidth * 6, e.lineWidth * 5]), e.strokeRect(a, a, t - a * 2, n - a * 2), e.setLineDash([]);
|
|
@@ -5571,24 +5521,24 @@ function qo(e, t, n, r, i) {
|
|
|
5571
5521
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5572
5522
|
e.restore();
|
|
5573
5523
|
}
|
|
5574
|
-
async function
|
|
5575
|
-
return
|
|
5524
|
+
async function Zo(e, t, n, r, i = {}, a) {
|
|
5525
|
+
return Qo(e, t, n, r, i, a);
|
|
5576
5526
|
}
|
|
5577
|
-
async function
|
|
5578
|
-
let o = i.fetchImage ?? (i.fetchMedia ?
|
|
5579
|
-
|
|
5580
|
-
let c = () =>
|
|
5581
|
-
return o &&
|
|
5527
|
+
async function Qo(e, t, n, r, i = {}, a) {
|
|
5528
|
+
let o = i.fetchImage ?? (i.fetchMedia ? Io(i.fetchMedia) : void 0), s = (Jo.get(e) ?? 0) + 1;
|
|
5529
|
+
Jo.set(e, s);
|
|
5530
|
+
let c = () => Jo.get(e) !== s, l = () => c() ? Promise.resolve(e) : $o(e, t, n, r, i, a, o, c);
|
|
5531
|
+
return o && Yi(t) ? gt(o, i.imageResources, l) : l();
|
|
5582
5532
|
}
|
|
5583
|
-
async function
|
|
5584
|
-
let l = a.svgDecoder ?? (typeof Image < "u" ?
|
|
5585
|
-
if (a.math && (await
|
|
5533
|
+
async function $o(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
5534
|
+
let l = a.svgDecoder ?? (typeof Image < "u" ? He : void 0), u = a.width ?? ((_e(e) ? e.offsetWidth : 0) || 960), d = u / n, f = Math.round(u), p = Math.round(i * d), m = a.dpr ?? Oe(), g = C(f * m, p * m), _ = g.clamped ? m * g.scale : m;
|
|
5535
|
+
if (a.math && (await aa(t, a.math), c())) return e;
|
|
5586
5536
|
let v, y = t;
|
|
5587
5537
|
if (a.math) {
|
|
5588
5538
|
let e = [0], n = /* @__PURE__ */ new Map();
|
|
5589
5539
|
for (let n of t.elements) {
|
|
5590
5540
|
let t = !1;
|
|
5591
|
-
for (let e of
|
|
5541
|
+
for (let e of ra(n)) if (e.paragraphs.some((e) => e.runs.some((e) => e.type === "math" && na.has(e.nodes)))) {
|
|
5592
5542
|
t = !0;
|
|
5593
5543
|
break;
|
|
5594
5544
|
}
|
|
@@ -5616,15 +5566,15 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5616
5566
|
elements: r
|
|
5617
5567
|
};
|
|
5618
5568
|
}
|
|
5619
|
-
let b = await
|
|
5569
|
+
let b = await Ki(t, f, p, d, _, a.imageResources, a.fetchImage, a.fetchMedia, s, a.tiff), x = () => {
|
|
5620
5570
|
e.width = g.width, e.height = g.height, _e(e) && (e.style.width = `${f}px`, e.style.display || (e.style.display = "block"));
|
|
5621
5571
|
let t = e.getContext("2d");
|
|
5622
5572
|
if (!t) throw Error("Could not get 2D context");
|
|
5623
5573
|
return t.scale(_, _), t;
|
|
5624
5574
|
};
|
|
5625
|
-
if (t.parseError) return
|
|
5575
|
+
if (t.parseError) return Xo(x(), f, p, t.slideNumber, t.parseError), e;
|
|
5626
5576
|
let S = t.theme ? t.theme.defaultTextColor : a.defaultTextColor, w = S ? `#${S}` : "#000000", E = a.parsedTextChain ? "#000000" : w, D = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), A = {
|
|
5627
|
-
cjkFallback: a.cjkFallback ?
|
|
5577
|
+
cjkFallback: a.cjkFallback ? Ir(t, t.theme ? t.theme.majorFont : a.majorFont ?? null, t.theme ? t.theme.minorFont : a.minorFont ?? null, a.cjkFallback) : void 0,
|
|
5628
5578
|
themeMajorFont: t.theme ? t.theme.majorFont : a.majorFont ?? null,
|
|
5629
5579
|
themeMinorFont: t.theme ? t.theme.minorFont : a.minorFont ?? null,
|
|
5630
5580
|
themeHlinkColor: t.theme ? t.theme.hlinkColor : a.hlinkColor ?? null,
|
|
@@ -5635,23 +5585,23 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5635
5585
|
officeInstalledFamilies: a.officeInstalledFamilies,
|
|
5636
5586
|
googleSubstitutes: a.googleSubstitutes,
|
|
5637
5587
|
dpr: _,
|
|
5638
|
-
smartArtFallbackTextColor:
|
|
5588
|
+
smartArtFallbackTextColor: ei(t.background, w) ?? w,
|
|
5639
5589
|
pictureBulletImages: D,
|
|
5640
5590
|
shapeFillImages: O
|
|
5641
5591
|
}, M = [], N = () => M.some((e) => e.failure);
|
|
5642
|
-
if (M.push(await
|
|
5643
|
-
let P = t.slideNumber, F = N() ? [] : t.elements.map((e) => e.type === "picture" ?
|
|
5644
|
-
...
|
|
5592
|
+
if (M.push(await Ba(t.background, f, p, d, a.fetchImage, a.tiff, l, b)), c()) return e;
|
|
5593
|
+
let P = t.slideNumber, F = N() ? [] : t.elements.map((e) => e.type === "picture" ? zo(e, d, a.fetchImage, a.tiff, _, l, b) : e.type === "media" ? Ho(e, d, a.fetchMedia, a.skipMediaControls, s, a.tiff, _, l, b) : Promise.resolve(null)).map((e) => e.catch((e) => ({
|
|
5594
|
+
...za,
|
|
5645
5595
|
failure: { error: e }
|
|
5646
5596
|
}))), I = /* @__PURE__ */ new Map();
|
|
5647
5597
|
if (!N() && a.fetchImage) {
|
|
5648
5598
|
let n = a.fetchImage, i = /* @__PURE__ */ new Map();
|
|
5649
|
-
for (let { fill: e, width: n, height: a, host: o } of
|
|
5599
|
+
for (let { fill: e, width: n, height: a, host: o } of Ji(t)) {
|
|
5650
5600
|
if (!(n > 0) || !(a >= 0)) continue;
|
|
5651
5601
|
let t = e.blipEffects?.length && !e.tile ? r(n, a, e.srcRect, e.fillRect) : {
|
|
5652
5602
|
width: n,
|
|
5653
5603
|
height: a
|
|
5654
|
-
}, s =
|
|
5604
|
+
}, s = Wa(e, n, a, o), c = i.get(s), l = t.width / h, u = t.height / h, f = e.fillRect ?? {}, p = Ri(Z(n, d) * (1 - (f.l ?? 0) - (f.r ?? 0)), Z(a, d) * (1 - (f.t ?? 0) - (f.b ?? 0)), _, e.srcRect);
|
|
5655
5605
|
i.set(s, c ? {
|
|
5656
5606
|
fill: c.fill,
|
|
5657
5607
|
host: c.host,
|
|
@@ -5716,10 +5666,10 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5716
5666
|
preserveNaturalSize: e.preserveNaturalSize,
|
|
5717
5667
|
hasSourceCrop: e.hasSourceCrop,
|
|
5718
5668
|
...t.blipEffects?.length ? { host: n } : {}
|
|
5719
|
-
}, o = a.preserveNaturalSize || e.preserveNaturalSize, s = a.hasSourceCrop || e.hasSourceCrop, c = !Q(t) && (t.mimeType === "image/svg+xml" ||
|
|
5669
|
+
}, o = a.preserveNaturalSize || e.preserveNaturalSize, s = a.hasSourceCrop || e.hasSourceCrop, c = !Q(t) && (t.mimeType === "image/svg+xml" || ze({
|
|
5720
5670
|
svgImagePath: t.svgImagePath,
|
|
5721
5671
|
srcRect: s ? !0 : null
|
|
5722
|
-
})), l = o || Q(t) || c ? void 0 :
|
|
5672
|
+
})), l = o || Q(t) || c ? void 0 : Ui(b, Hi(t.imagePath, Q(t)));
|
|
5723
5673
|
u.set(i, {
|
|
5724
5674
|
...a,
|
|
5725
5675
|
widthPt: Math.max(a.widthPt, r.widthPt),
|
|
@@ -5740,7 +5690,7 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5740
5690
|
flipH: n.flipH,
|
|
5741
5691
|
flipV: n.flipV
|
|
5742
5692
|
};
|
|
5743
|
-
for (let { fill: i, occurrence: o } of
|
|
5693
|
+
for (let { fill: i, occurrence: o } of Bt(n.chart, {
|
|
5744
5694
|
x: Z(n.x, d),
|
|
5745
5695
|
y: Z(n.y, d),
|
|
5746
5696
|
w: Z(n.width, d),
|
|
@@ -5759,13 +5709,13 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5759
5709
|
}), t.push(e));
|
|
5760
5710
|
}
|
|
5761
5711
|
}
|
|
5762
|
-
return
|
|
5712
|
+
return Ht(u.size), t;
|
|
5763
5713
|
};
|
|
5764
5714
|
p(!1);
|
|
5765
5715
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5766
|
-
let n =
|
|
5716
|
+
let n = Lr(t.bullet);
|
|
5767
5717
|
if (n.type === "blip") {
|
|
5768
|
-
let r =
|
|
5718
|
+
let r = Ca(e.textBody, t, n) * h * d * _, i = o.get(n.imagePath);
|
|
5769
5719
|
i ? Number.isFinite(r) && r > 0 && (i.targetHeightPx = Math.max(i.targetHeightPx ?? 0, r)) : o.set(n.imagePath, {
|
|
5770
5720
|
mimeType: n.mimeType,
|
|
5771
5721
|
...Number.isFinite(r) && r > 0 ? { targetHeightPx: r } : {}
|
|
@@ -5778,20 +5728,20 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5778
5728
|
let i = t === "image/svg+xml" ? r === void 0 ? {} : {
|
|
5779
5729
|
targetWidthPx: 1,
|
|
5780
5730
|
targetHeightPx: r
|
|
5781
|
-
} :
|
|
5731
|
+
} : Ui(b, Hi(e)) ?? {}, o = t === "image/svg+xml" ? await lt(e, n, {
|
|
5782
5732
|
...i,
|
|
5783
5733
|
workerDecoder: l
|
|
5784
|
-
}) : await
|
|
5734
|
+
}) : await at(e, t, n, {
|
|
5785
5735
|
tiff: a.tiff,
|
|
5786
5736
|
...i
|
|
5787
5737
|
});
|
|
5788
5738
|
D.set(e, o);
|
|
5789
5739
|
} catch (t) {
|
|
5790
|
-
if (
|
|
5740
|
+
if (zt(t, "tiff")) {
|
|
5791
5741
|
D.set(e, null);
|
|
5792
5742
|
return;
|
|
5793
5743
|
}
|
|
5794
|
-
if (t instanceof J ||
|
|
5744
|
+
if (t instanceof J || Bi(t) || Mt(t) || Ut(t)) throw t;
|
|
5795
5745
|
D.set(e, null);
|
|
5796
5746
|
}
|
|
5797
5747
|
}), r = async ([e, t]) => {
|
|
@@ -5801,10 +5751,10 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5801
5751
|
...u === void 0 ? {} : { maxRetainedPixels: u }
|
|
5802
5752
|
} : void 0;
|
|
5803
5753
|
try {
|
|
5804
|
-
let t = () => r.mimeType === "image/svg+xml" && !Q(r) ?
|
|
5754
|
+
let t = () => r.mimeType === "image/svg+xml" && !Q(r) ? lt(r.imagePath, n, {
|
|
5805
5755
|
...m ?? {},
|
|
5806
5756
|
workerDecoder: l
|
|
5807
|
-
}) :
|
|
5757
|
+
}) : Qe(r.imagePath, r.mimeType, k(r, f, p) ?? void 0, n, {
|
|
5808
5758
|
widthPt: p ? p.widthPt : r.blipEffects?.length ? 0 : i,
|
|
5809
5759
|
heightPt: p ? p.heightPt : r.blipEffects?.length ? 0 : o,
|
|
5810
5760
|
...m ?? {},
|
|
@@ -5815,23 +5765,23 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5815
5765
|
svgImagePath: r.svgImagePath,
|
|
5816
5766
|
srcRect: d ? !0 : null
|
|
5817
5767
|
};
|
|
5818
|
-
if (!Q(r) &&
|
|
5819
|
-
s = await
|
|
5768
|
+
if (!Q(r) && ze(c)) try {
|
|
5769
|
+
s = await lt(c.svgImagePath, n, {
|
|
5820
5770
|
...m ?? {},
|
|
5821
5771
|
workerDecoder: l
|
|
5822
5772
|
});
|
|
5823
5773
|
} catch (e) {
|
|
5824
|
-
if (e instanceof J ||
|
|
5774
|
+
if (e instanceof J || Bi(e) || Mt(e)) throw e;
|
|
5825
5775
|
s = await t();
|
|
5826
5776
|
}
|
|
5827
5777
|
else s = await t();
|
|
5828
5778
|
I.set(e, s);
|
|
5829
5779
|
} catch (t) {
|
|
5830
|
-
if (
|
|
5780
|
+
if (zt(t, "tiff")) {
|
|
5831
5781
|
I.set(e, null);
|
|
5832
5782
|
return;
|
|
5833
5783
|
}
|
|
5834
|
-
if (t instanceof J ||
|
|
5784
|
+
if (t instanceof J || Bi(t) || Mt(t) || Ut(t)) throw t;
|
|
5835
5785
|
I.set(e, null);
|
|
5836
5786
|
}
|
|
5837
5787
|
}, s = [(async () => {
|
|
@@ -5841,34 +5791,34 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5841
5791
|
await Promise.all(e.map((e) => r([e, u.get(e)])));
|
|
5842
5792
|
}
|
|
5843
5793
|
})()], d = [...i].map(async ([e, { fill: t, host: r, widthPt: i, heightPt: o, targetWidthPx: s, targetHeightPx: c, preserveNaturalSize: u, hasSourceCrop: d }]) => {
|
|
5844
|
-
let f = t.mimeType === "image/svg+xml" || !Q(t, r) &&
|
|
5794
|
+
let f = t.mimeType === "image/svg+xml" || !Q(t, r) && ze({
|
|
5845
5795
|
svgImagePath: t.svgImagePath,
|
|
5846
5796
|
srcRect: d ? !0 : null
|
|
5847
|
-
}), p = !u && !Q(t, r) ?
|
|
5797
|
+
}), p = !u && !Q(t, r) ? Ui(b, Hi(t.imagePath, Q(t, r))) : void 0, m = f ? !u && s && c ? {
|
|
5848
5798
|
targetWidthPx: s,
|
|
5849
5799
|
targetHeightPx: c
|
|
5850
5800
|
} : void 0 : p;
|
|
5851
5801
|
try {
|
|
5852
|
-
let s = u ? (await
|
|
5802
|
+
let s = u ? (await zi(t, Xe(t.imagePath, t.mimeType, n))).dimensions ?? void 0 : void 0, c = () => t.mimeType === "image/svg+xml" && !Q(t, r) ? lt(t.imagePath, n, {
|
|
5853
5803
|
...m ?? {},
|
|
5854
5804
|
workerDecoder: l
|
|
5855
|
-
}) :
|
|
5856
|
-
...
|
|
5805
|
+
}) : Qe(t.imagePath, t.mimeType, Q(t, r), n, {
|
|
5806
|
+
...Vi(t, i, o),
|
|
5857
5807
|
...m ?? {},
|
|
5858
5808
|
failClosedOnDuotoneFailure: !0,
|
|
5859
5809
|
tiff: a.tiff,
|
|
5860
5810
|
svgDecoder: l
|
|
5861
5811
|
}), f;
|
|
5862
|
-
if (!Q(t, r) &&
|
|
5812
|
+
if (!Q(t, r) && ze({
|
|
5863
5813
|
svgImagePath: t.svgImagePath,
|
|
5864
5814
|
srcRect: d ? !0 : null
|
|
5865
5815
|
})) try {
|
|
5866
|
-
f = await
|
|
5816
|
+
f = await lt(t.svgImagePath, n, {
|
|
5867
5817
|
...m ?? {},
|
|
5868
5818
|
workerDecoder: l
|
|
5869
5819
|
});
|
|
5870
5820
|
} catch (e) {
|
|
5871
|
-
if (e instanceof J ||
|
|
5821
|
+
if (e instanceof J || Bi(e) || Mt(e)) throw e;
|
|
5872
5822
|
f = await c();
|
|
5873
5823
|
}
|
|
5874
5824
|
else f = await c();
|
|
@@ -5877,11 +5827,11 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5877
5827
|
intrinsicSize: s
|
|
5878
5828
|
} : null);
|
|
5879
5829
|
} catch (t) {
|
|
5880
|
-
if (
|
|
5830
|
+
if (zt(t, "tiff")) {
|
|
5881
5831
|
O.set(e, null);
|
|
5882
5832
|
return;
|
|
5883
5833
|
}
|
|
5884
|
-
if (t instanceof J ||
|
|
5834
|
+
if (t instanceof J || Bi(t) || Mt(t) || Ut(t)) throw t;
|
|
5885
5835
|
O.set(e, null);
|
|
5886
5836
|
}
|
|
5887
5837
|
});
|
|
@@ -5893,7 +5843,7 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5893
5843
|
]);
|
|
5894
5844
|
} catch (e) {
|
|
5895
5845
|
M.push({
|
|
5896
|
-
...
|
|
5846
|
+
...za,
|
|
5897
5847
|
failure: { error: e }
|
|
5898
5848
|
});
|
|
5899
5849
|
}
|
|
@@ -5929,15 +5879,15 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5929
5879
|
origin: y.elementSources?.[t]?.origin ?? "slide"
|
|
5930
5880
|
});
|
|
5931
5881
|
} : void 0;
|
|
5932
|
-
if (r.type === "shape") de(B, V, () =>
|
|
5882
|
+
if (r.type === "shape") de(B, V, () => xo(B, r, d, E, P, A, i, a.fetchImage));
|
|
5933
5883
|
else if (r.type === "picture" || r.type === "media") {
|
|
5934
5884
|
let e = R[n];
|
|
5935
5885
|
if (e && (de(B, V, () => e.paint(B)), e.failure)) throw e.failure.error;
|
|
5936
|
-
} else if (r.type === "table") de(B, V, () =>
|
|
5886
|
+
} else if (r.type === "table") de(B, V, () => Ko(B, r, d, P, A, i));
|
|
5937
5887
|
else if (r.type === "chart") {
|
|
5938
5888
|
let e = h * d;
|
|
5939
5889
|
de(B, V, () => {
|
|
5940
|
-
B.save(),
|
|
5890
|
+
B.save(), Go(B, r, d), Vt(B, r.chart, {
|
|
5941
5891
|
x: Z(r.x, d),
|
|
5942
5892
|
y: Z(r.y, d),
|
|
5943
5893
|
w: Z(r.width, d),
|
|
@@ -5950,18 +5900,18 @@ async function Xo(e, t, n, i, a = {}, o, s, c = () => !1) {
|
|
|
5950
5900
|
});
|
|
5951
5901
|
}
|
|
5952
5902
|
}
|
|
5953
|
-
return c() || a.dim &&
|
|
5903
|
+
return c() || a.dim && qo(B, a.dim, f, p), e;
|
|
5954
5904
|
}
|
|
5955
|
-
var
|
|
5905
|
+
var es = Object.freeze({
|
|
5956
5906
|
archiveEntryCount: 0,
|
|
5957
5907
|
declaredInflatedBytes: 0,
|
|
5958
5908
|
distinctInflatedBytes: 0,
|
|
5959
5909
|
operationInflatedBytes: 0
|
|
5960
|
-
}),
|
|
5961
|
-
function
|
|
5910
|
+
}), ts = Ve;
|
|
5911
|
+
function ns(e, t) {
|
|
5962
5912
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5963
5913
|
}
|
|
5964
|
-
function
|
|
5914
|
+
function rs(e, t) {
|
|
5965
5915
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5966
5916
|
let n = e;
|
|
5967
5917
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5971,7 +5921,7 @@ function es(e, t) {
|
|
|
5971
5921
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5972
5922
|
});
|
|
5973
5923
|
}
|
|
5974
|
-
function
|
|
5924
|
+
function is(e, t) {
|
|
5975
5925
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap embedded font at ${t}`);
|
|
5976
5926
|
let n = e;
|
|
5977
5927
|
if (typeof n.fontName != "string" || n.fontName.length === 0 || ![
|
|
@@ -5987,11 +5937,11 @@ function ts(e, t) {
|
|
|
5987
5937
|
contentType: n.contentType
|
|
5988
5938
|
});
|
|
5989
5939
|
}
|
|
5990
|
-
function
|
|
5940
|
+
function as(e) {
|
|
5991
5941
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5992
5942
|
let t = e;
|
|
5993
5943
|
if (!Number.isSafeInteger(t.slideCount) || (t.slideCount ?? -1) < 0 || !Number.isSafeInteger(t.slideWidth) || (t.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(t.slideHeight) || (t.slideHeight ?? 0) <= 0 || !Array.isArray(t.embeddedFonts) || !Array.isArray(t.slides) || t.slides.length !== t.slideCount) throw Error("invalid PPTX presentation bootstrap dimensions or slide count");
|
|
5994
|
-
return
|
|
5944
|
+
return ns(t.defaultTextColor, "defaultTextColor"), ns(t.majorFont, "majorFont"), ns(t.minorFont, "minorFont"), ns(t.hlinkColor, "hlinkColor"), ns(t.folHlinkColor, "folHlinkColor"), Object.freeze({
|
|
5995
5945
|
slideCount: t.slideCount,
|
|
5996
5946
|
slideWidth: t.slideWidth,
|
|
5997
5947
|
slideHeight: t.slideHeight,
|
|
@@ -6000,11 +5950,11 @@ function ns(e) {
|
|
|
6000
5950
|
minorFont: t.minorFont,
|
|
6001
5951
|
hlinkColor: t.hlinkColor,
|
|
6002
5952
|
folHlinkColor: t.folHlinkColor,
|
|
6003
|
-
embeddedFonts: Object.freeze(t.embeddedFonts.map(
|
|
6004
|
-
slides: Object.freeze(t.slides.map(
|
|
5953
|
+
embeddedFonts: Object.freeze(t.embeddedFonts.map(is)),
|
|
5954
|
+
slides: Object.freeze(t.slides.map(rs))
|
|
6005
5955
|
});
|
|
6006
5956
|
}
|
|
6007
|
-
function
|
|
5957
|
+
function os(e) {
|
|
6008
5958
|
return Object.freeze({
|
|
6009
5959
|
type: "media",
|
|
6010
5960
|
x: e.x,
|
|
@@ -6021,7 +5971,7 @@ function rs(e) {
|
|
|
6021
5971
|
mimeType: e.mimeType
|
|
6022
5972
|
});
|
|
6023
5973
|
}
|
|
6024
|
-
function
|
|
5974
|
+
function ss(e) {
|
|
6025
5975
|
return Object.freeze({
|
|
6026
5976
|
...e.id === void 0 ? {} : { id: e.id },
|
|
6027
5977
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
@@ -6031,10 +5981,10 @@ function is(e) {
|
|
|
6031
5981
|
text: e.text
|
|
6032
5982
|
});
|
|
6033
5983
|
}
|
|
6034
|
-
function
|
|
5984
|
+
function cs(e) {
|
|
6035
5985
|
return Object.freeze({ ...e });
|
|
6036
5986
|
}
|
|
6037
|
-
function
|
|
5987
|
+
function ls(e) {
|
|
6038
5988
|
return Object.freeze({
|
|
6039
5989
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
6040
5990
|
...e.modernAuthorId === void 0 ? {} : { modernAuthorId: e.modernAuthorId },
|
|
@@ -6044,16 +5994,16 @@ function os(e) {
|
|
|
6044
5994
|
...e.date === void 0 ? {} : { date: e.date },
|
|
6045
5995
|
...e.x === void 0 ? {} : { x: e.x },
|
|
6046
5996
|
...e.y === void 0 ? {} : { y: e.y },
|
|
6047
|
-
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(
|
|
5997
|
+
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(cs)) } : {},
|
|
6048
5998
|
...e.status === void 0 ? {} : { status: e.status },
|
|
6049
5999
|
text: e.text,
|
|
6050
|
-
...e.replies?.length ? { replies: Object.freeze(e.replies.map(
|
|
6000
|
+
...e.replies?.length ? { replies: Object.freeze(e.replies.map(ss)) } : {}
|
|
6051
6001
|
});
|
|
6052
6002
|
}
|
|
6053
|
-
function
|
|
6003
|
+
function us(e, t, n) {
|
|
6054
6004
|
if (e !== void 0 && typeof e != "string") throw Error(`invalid PPTX presentation preflight comment ${t} at slide ${n}`);
|
|
6055
6005
|
}
|
|
6056
|
-
function
|
|
6006
|
+
function ds(e, t) {
|
|
6057
6007
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment reply at slide ${t}`);
|
|
6058
6008
|
let n = e;
|
|
6059
6009
|
for (let e of [
|
|
@@ -6062,16 +6012,16 @@ function cs(e, t) {
|
|
|
6062
6012
|
"author",
|
|
6063
6013
|
"date",
|
|
6064
6014
|
"status"
|
|
6065
|
-
])
|
|
6015
|
+
]) us(n[e], e, t);
|
|
6066
6016
|
if (typeof n.text != "string") throw Error(`invalid PPTX presentation preflight comment reply text at slide ${t}`);
|
|
6067
6017
|
if (n.status !== void 0 && ![
|
|
6068
6018
|
"active",
|
|
6069
6019
|
"resolved",
|
|
6070
6020
|
"closed"
|
|
6071
6021
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment reply status at slide ${t}`);
|
|
6072
|
-
return
|
|
6022
|
+
return ss(n);
|
|
6073
6023
|
}
|
|
6074
|
-
function
|
|
6024
|
+
function fs(e, t) {
|
|
6075
6025
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment at slide ${t}`);
|
|
6076
6026
|
let n = e;
|
|
6077
6027
|
for (let e of [
|
|
@@ -6080,7 +6030,7 @@ function ls(e, t) {
|
|
|
6080
6030
|
"author",
|
|
6081
6031
|
"date",
|
|
6082
6032
|
"status"
|
|
6083
|
-
])
|
|
6033
|
+
]) us(n[e], e, t);
|
|
6084
6034
|
for (let e of [
|
|
6085
6035
|
"authorId",
|
|
6086
6036
|
"index",
|
|
@@ -6096,23 +6046,23 @@ function ls(e, t) {
|
|
|
6096
6046
|
"resolved",
|
|
6097
6047
|
"closed"
|
|
6098
6048
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment status at slide ${t}`);
|
|
6099
|
-
return
|
|
6049
|
+
return ls({
|
|
6100
6050
|
...n,
|
|
6101
|
-
...n.anchors?.length ? { anchors: n.anchors.map((e) =>
|
|
6102
|
-
...n.replies?.length ? { replies: n.replies.map((e) =>
|
|
6051
|
+
...n.anchors?.length ? { anchors: n.anchors.map((e) => ps(e, t)) } : {},
|
|
6052
|
+
...n.replies?.length ? { replies: n.replies.map((e) => ds(e, t)) } : {}
|
|
6103
6053
|
});
|
|
6104
6054
|
}
|
|
6105
|
-
function
|
|
6055
|
+
function ps(e, t) {
|
|
6106
6056
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment anchor at slide ${t}`);
|
|
6107
6057
|
let n = e;
|
|
6108
6058
|
if (n.type === "slide" || n.type === "unknown") return Object.freeze({ type: n.type });
|
|
6109
|
-
if (n.type === "drawingElement") return
|
|
6059
|
+
if (n.type === "drawingElement") return us(n.elementId, "anchor.elementId", t), us(n.creationId, "anchor.creationId", t), Object.freeze({
|
|
6110
6060
|
type: "drawingElement",
|
|
6111
6061
|
...n.elementId === void 0 ? {} : { elementId: n.elementId },
|
|
6112
6062
|
...n.creationId === void 0 ? {} : { creationId: n.creationId }
|
|
6113
6063
|
});
|
|
6114
6064
|
if (n.type === "textRange") {
|
|
6115
|
-
|
|
6065
|
+
us(n.elementId, "anchor.elementId", t);
|
|
6116
6066
|
for (let e of ["start", "length"]) {
|
|
6117
6067
|
let r = n[e];
|
|
6118
6068
|
if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment anchor.${e} at slide ${t}`);
|
|
@@ -6126,7 +6076,7 @@ function us(e, t) {
|
|
|
6126
6076
|
}
|
|
6127
6077
|
throw Error(`invalid PPTX presentation preflight comment anchor type at slide ${t}`);
|
|
6128
6078
|
}
|
|
6129
|
-
function
|
|
6079
|
+
function ms(e, t) {
|
|
6130
6080
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
6131
6081
|
let n = e;
|
|
6132
6082
|
for (let e of [
|
|
@@ -6137,13 +6087,13 @@ function ds(e, t) {
|
|
|
6137
6087
|
"rotation"
|
|
6138
6088
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
6139
6089
|
if (n.type !== "media" || typeof n.flipH != "boolean" || typeof n.flipV != "boolean" || n.mediaKind !== "audio" && n.mediaKind !== "video" || typeof n.posterPath != "string" || typeof n.posterMimeType != "string" || typeof n.mediaPath != "string" || typeof n.mimeType != "string") throw Error(`invalid PPTX presentation preflight media fields at slide ${t}`);
|
|
6140
|
-
return
|
|
6090
|
+
return os(n);
|
|
6141
6091
|
}
|
|
6142
|
-
function
|
|
6092
|
+
function hs(e, t) {
|
|
6143
6093
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
6144
6094
|
let n = e;
|
|
6145
6095
|
if (!Number.isSafeInteger(n.slideCount) || (n.slideCount ?? -1) < 0 || !Number.isSafeInteger(n.slideWidth) || (n.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(n.slideHeight) || (n.slideHeight ?? 0) <= 0 || !Array.isArray(n.embeddedFonts) || !Array.isArray(n.slides) || (t ? n.slides.length > (n.slideCount ?? -1) : n.slides.length !== n.slideCount) || !Array.isArray(n.fontPreloadNames)) throw Error("invalid PPTX presentation preflight dimensions or slide count");
|
|
6146
|
-
|
|
6096
|
+
ns(n.defaultTextColor, "defaultTextColor"), ns(n.majorFont, "majorFont"), ns(n.minorFont, "minorFont"), ns(n.hlinkColor, "hlinkColor"), ns(n.folHlinkColor, "folHlinkColor");
|
|
6147
6097
|
let r = n.slides.map((e, t) => {
|
|
6148
6098
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight slide at ${t}`);
|
|
6149
6099
|
let n = e;
|
|
@@ -6153,8 +6103,8 @@ function fs(e, t) {
|
|
|
6153
6103
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
6154
6104
|
notes: n.notes,
|
|
6155
6105
|
hidden: n.hidden,
|
|
6156
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
6157
|
-
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) =>
|
|
6106
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => ms(e, t))),
|
|
6107
|
+
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => fs(e, t))) } : {}
|
|
6158
6108
|
});
|
|
6159
6109
|
}), i;
|
|
6160
6110
|
if (n.fontPreloadDemand !== void 0) {
|
|
@@ -6176,37 +6126,37 @@ function fs(e, t) {
|
|
|
6176
6126
|
minorFont: n.minorFont,
|
|
6177
6127
|
hlinkColor: n.hlinkColor,
|
|
6178
6128
|
folHlinkColor: n.folHlinkColor,
|
|
6179
|
-
embeddedFonts: Object.freeze(n.embeddedFonts.map(
|
|
6129
|
+
embeddedFonts: Object.freeze(n.embeddedFonts.map(is)),
|
|
6180
6130
|
slides: Object.freeze(r),
|
|
6181
6131
|
fontPreloadNames: Object.freeze(a),
|
|
6182
6132
|
...i === void 0 ? {} : { fontPreloadDemand: i }
|
|
6183
6133
|
});
|
|
6184
6134
|
}
|
|
6185
|
-
function
|
|
6186
|
-
return
|
|
6135
|
+
function gs(e) {
|
|
6136
|
+
return hs(e, !1);
|
|
6187
6137
|
}
|
|
6188
|
-
function
|
|
6189
|
-
return
|
|
6138
|
+
function _s(e) {
|
|
6139
|
+
return hs(e, !0);
|
|
6190
6140
|
}
|
|
6191
|
-
function
|
|
6141
|
+
function vs(e, t) {
|
|
6192
6142
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
6193
6143
|
if (e.mediaPath === t) return e.mimeType;
|
|
6194
6144
|
if (e.posterPath === t) return e.posterMimeType;
|
|
6195
6145
|
}
|
|
6196
6146
|
return "";
|
|
6197
6147
|
}
|
|
6198
|
-
function
|
|
6148
|
+
function ys(e, t) {
|
|
6199
6149
|
if (e.index !== t.index || e.partName !== t.partName) throw Error(`PPTX pulled slide identity does not match bootstrap index ${t.index}`);
|
|
6200
6150
|
return Object.freeze({
|
|
6201
6151
|
index: t.index,
|
|
6202
6152
|
...t.partName === void 0 ? {} : { partName: t.partName },
|
|
6203
6153
|
notes: e.notes ?? null,
|
|
6204
6154
|
hidden: e.hidden ?? !1,
|
|
6205
|
-
mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(
|
|
6206
|
-
...e.comments?.length ? { comments: Object.freeze(e.comments.map(
|
|
6155
|
+
mediaElements: Object.freeze(e.elements.filter((e) => e.type === "media").map(os)),
|
|
6156
|
+
...e.comments?.length ? { comments: Object.freeze(e.comments.map(ls)) } : {}
|
|
6207
6157
|
});
|
|
6208
6158
|
}
|
|
6209
|
-
function
|
|
6159
|
+
function bs(e, t, n) {
|
|
6210
6160
|
if (!(e <= t)) throw new J(`PPTX presentation preflight exceeded its hard limit of ${t} projected bytes`, {
|
|
6211
6161
|
stage: "parsing",
|
|
6212
6162
|
violation: {
|
|
@@ -6221,7 +6171,7 @@ function _s(e, t, n) {
|
|
|
6221
6171
|
}
|
|
6222
6172
|
});
|
|
6223
6173
|
}
|
|
6224
|
-
var
|
|
6174
|
+
var xs = class {
|
|
6225
6175
|
slideCountValue;
|
|
6226
6176
|
slideWidthValue;
|
|
6227
6177
|
slideHeightValue;
|
|
@@ -6248,9 +6198,9 @@ var vs = class {
|
|
|
6248
6198
|
collectFontDemand;
|
|
6249
6199
|
demandDelta;
|
|
6250
6200
|
constructor(e, t = {}) {
|
|
6251
|
-
let n =
|
|
6252
|
-
if (!Number.isSafeInteger(r) || r <= 0 || r >
|
|
6253
|
-
this.limit = r, this.collectFontDemand = t.collectFontDemand, this.demandPoints = this.collectFontDemand ? /* @__PURE__ */ new Set() : void 0, this.demandBytes = this.collectFontDemand ?
|
|
6201
|
+
let n = as(e), r = t.maxProjectionBytes ?? ts;
|
|
6202
|
+
if (!Number.isSafeInteger(r) || r <= 0 || r > ts) throw Error("invalid PPTX presentation preflight limit");
|
|
6203
|
+
this.limit = r, this.collectFontDemand = t.collectFontDemand, this.demandPoints = this.collectFontDemand ? /* @__PURE__ */ new Set() : void 0, this.demandBytes = this.collectFontDemand ? an({ fontPreloadDemand: [] }, this.limit).jsonBytes - 1 : 0, this.demandMembershipBytes = this.demandBytes, this.slideCountValue = n.slideCount, this.slideWidthValue = n.slideWidth, this.slideHeightValue = n.slideHeight, this.defaultTextColorValue = n.defaultTextColor, this.majorFontValue = n.majorFont, this.minorFontValue = n.minorFont, this.hlinkColorValue = n.hlinkColor, this.folHlinkColorValue = n.folHlinkColor, this.embeddedFontsValue = n.embeddedFonts, this.descriptors = [...n.slides], this.fonts = new Nr(this.majorFontValue, this.minorFontValue, void 0, void 0, t.cjkFallback), this.fontPreloadNames = Object.freeze(this.fonts.names()), this.fontProjectionBytes = an(this.fontPreloadNames, this.limit).jsonBytes, this.projectionBytesValue = an({
|
|
6254
6204
|
slideCount: this.slideCountValue,
|
|
6255
6205
|
slideWidth: this.slideWidthValue,
|
|
6256
6206
|
slideHeight: this.slideHeightValue,
|
|
@@ -6263,7 +6213,7 @@ var vs = class {
|
|
|
6263
6213
|
remainingSlides: this.descriptors,
|
|
6264
6214
|
slides: [],
|
|
6265
6215
|
fontPreloadNames: this.fontPreloadNames
|
|
6266
|
-
}, this.limit).jsonBytes, this.projectionBytesValue + this.demandBytes > this.limit && (this.demandAll = !0, this.demandBytes = 0, this.demandMembershipBytes = 0), this.projectionBytesValue =
|
|
6216
|
+
}, this.limit).jsonBytes, this.projectionBytesValue + this.demandBytes > this.limit && (this.demandAll = !0, this.demandBytes = 0, this.demandMembershipBytes = 0), this.projectionBytesValue = ln(this.projectionBytesValue, this.demandBytes, this.limit), bs(this.projectionBytesValue, this.limit, es);
|
|
6267
6217
|
}
|
|
6268
6218
|
get acceptedSlideCount() {
|
|
6269
6219
|
return this.finished?.slideCount ?? this.slides.length;
|
|
@@ -6300,35 +6250,35 @@ var vs = class {
|
|
|
6300
6250
|
fontPreloadNames: this.fontPreloadNames
|
|
6301
6251
|
});
|
|
6302
6252
|
}
|
|
6303
|
-
addSlide(e, t =
|
|
6253
|
+
addSlide(e, t = es) {
|
|
6304
6254
|
this.prepareSlide(e, t).commit();
|
|
6305
6255
|
}
|
|
6306
|
-
prepareSlide(e, t =
|
|
6256
|
+
prepareSlide(e, t = es) {
|
|
6307
6257
|
if (this.finished) throw Error("PPTX presentation preflight is already finished");
|
|
6308
6258
|
if (this.pending) throw Error("PPTX presentation preflight already has a prepared slide");
|
|
6309
6259
|
let n = this.slides.length, r = this.descriptors[n];
|
|
6310
6260
|
if (!r) throw Error("PPTX presentation preflight received an extra slide");
|
|
6311
|
-
let i =
|
|
6312
|
-
l =
|
|
6313
|
-
let u =
|
|
6261
|
+
let i = ys(e, r), a = this.fonts.withSlide(e), o = Object.freeze(a.names()), s = an(o, this.limit).jsonBytes, c = an(i, this.limit).jsonBytes, l = this.projectionBytesValue - this.demandBytes - this.fontProjectionBytes - an(r, this.limit).jsonBytes + 4;
|
|
6262
|
+
l = ln(l, s, this.limit), l = ln(l, c, this.limit), this.slides.length !== 0 && (l = ln(l, 1, this.limit));
|
|
6263
|
+
let u = an({
|
|
6314
6264
|
slide: i,
|
|
6315
6265
|
fontPreloadNames: o
|
|
6316
|
-
}, this.limit).jsonBytes, d =
|
|
6317
|
-
|
|
6266
|
+
}, this.limit).jsonBytes, d = ln(this.projectionBytesValue - this.demandBytes, u, this.limit), f = l;
|
|
6267
|
+
bs(Math.max(d, f), this.limit, t);
|
|
6318
6268
|
let p = d + this.demandBytes;
|
|
6319
6269
|
l += this.demandBytes, Math.max(p, l) > this.limit && this.demandBytes && (this.projectionBytesValue -= this.demandBytes, this.demandBytes = 0, this.demandMembershipBytes = 0, this.demandDeltaBytes = 0, this.demandPoints?.clear(), this.demandAll = !0, this.demandDelta = "all", p = d, l = f);
|
|
6320
6270
|
let m, h = this.demandBytes, g = this.demandMembershipBytes, _ = this.demandDeltaBytes;
|
|
6321
6271
|
if (this.collectFontDemand) {
|
|
6322
|
-
let t =
|
|
6272
|
+
let t = an([], this.limit).jsonBytes, n = this.limit - p, r = this.limit - f - this.demandMembershipBytes, i = Math.min(n, Math.floor((r + t - Number((this.demandPoints?.size ?? 0) > 0)) / 2));
|
|
6323
6273
|
if (m = this.demandAll ? "all" : this.collectFontDemand(e, this.demandPoints, Math.max(0, i)), m === "all") h = 0, g = 0, _ = 0;
|
|
6324
6274
|
else {
|
|
6325
|
-
_ =
|
|
6275
|
+
_ = an(m, this.limit).jsonBytes;
|
|
6326
6276
|
let e = m.length === 0 ? 0 : _ - t + Number((this.demandPoints?.size ?? 0) > 0);
|
|
6327
6277
|
g += e, h = g + _, p += _;
|
|
6328
6278
|
}
|
|
6329
6279
|
l = f + h;
|
|
6330
6280
|
}
|
|
6331
|
-
|
|
6281
|
+
bs(Math.max(p, l), this.limit, t);
|
|
6332
6282
|
let v = {
|
|
6333
6283
|
state: "prepared",
|
|
6334
6284
|
fact: i,
|
|
@@ -6378,9 +6328,9 @@ var vs = class {
|
|
|
6378
6328
|
slides: Object.freeze([...this.slides]),
|
|
6379
6329
|
fontPreloadNames: this.fontPreloadNames,
|
|
6380
6330
|
...this.collectFontDemand && !this.demandAll && this.demandBytes ? { fontPreloadDemand: Object.freeze([...this.demandPoints ?? []]) } : {}
|
|
6381
|
-
}), this.demandPoints?.clear(), this.demandDelta = void 0, this.descriptors = [], this.slides = [], this.projectionBytesValue =
|
|
6331
|
+
}), this.demandPoints?.clear(), this.demandDelta = void 0, this.descriptors = [], this.slides = [], this.projectionBytesValue = an(this.finished, this.limit).jsonBytes, this.finished;
|
|
6382
6332
|
}
|
|
6383
|
-
},
|
|
6333
|
+
}, Ss = 1024 * 1024, Cs = class {
|
|
6384
6334
|
options;
|
|
6385
6335
|
active = /* @__PURE__ */ new Set();
|
|
6386
6336
|
nextSessionId = 1;
|
|
@@ -6394,15 +6344,15 @@ var vs = class {
|
|
|
6394
6344
|
sessionId: r,
|
|
6395
6345
|
operationId: r,
|
|
6396
6346
|
generation: this.options.generation ?? 1
|
|
6397
|
-
}, a = new
|
|
6347
|
+
}, a = new et(this.options.transport, {
|
|
6398
6348
|
...i,
|
|
6399
|
-
maxByteCredit:
|
|
6349
|
+
maxByteCredit: pt,
|
|
6400
6350
|
timeoutMs: n
|
|
6401
6351
|
});
|
|
6402
6352
|
this.active.add(a);
|
|
6403
6353
|
try {
|
|
6404
6354
|
await this.options.open(e, i, n);
|
|
6405
|
-
let r = await
|
|
6355
|
+
let r = await Ie(a, Ss, pt);
|
|
6406
6356
|
try {
|
|
6407
6357
|
let e = r.usage ?? a.usageCheckpoint;
|
|
6408
6358
|
e && this.options.onUsage?.(e);
|
|
@@ -6425,7 +6375,7 @@ var vs = class {
|
|
|
6425
6375
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
6426
6376
|
}
|
|
6427
6377
|
};
|
|
6428
|
-
function
|
|
6378
|
+
function ws(e) {
|
|
6429
6379
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
6430
6380
|
}
|
|
6431
|
-
export {
|
|
6381
|
+
export { as as a, Yo as c, Hr as d, Or as f, vs as i, Zo as l, mn as m, ws as n, gs as o, Fr as p, xs as r, _s as s, Cs as t, Qo as u };
|