@silurus/ooxml 0.74.3 → 0.74.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -5
- package/dist/{docx-Dmx7JPe8.js → docx-DftZMp7R.js} +1967 -1904
- package/dist/docx.mjs +1 -1
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{pptx-9C5JKbFv.js → pptx-BxU0Lb3J.js} +645 -434
- package/dist/pptx.mjs +1 -1
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-worker-host-B-Y1DmN9.js → render-worker-host-Bcm9j4-H.js} +1 -1
- package/dist/{render-worker-host-B5otq5TA.js → render-worker-host-BqSTDaYt.js} +1 -1
- package/dist/{render-worker-host-GGVmi0tj.js → render-worker-host-C523QxVw.js} +1 -1
- package/dist/types/docx.d.ts +50 -11
- package/dist/types/index.d.ts +139 -26
- package/dist/types/pptx.d.ts +101 -14
- package/dist/types/xlsx.d.ts +21 -4
- package/dist/{xlsx-D-UFFxVs.js → xlsx-BqMHvfsE.js} +377 -369
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
|
@@ -3358,7 +3358,7 @@ function bn(e, t, n) {
|
|
|
3358
3358
|
}
|
|
3359
3359
|
//#endregion
|
|
3360
3360
|
//#region packages/pptx/src/text-layer.ts
|
|
3361
|
-
function
|
|
3361
|
+
function Y(e, t, n, r, i) {
|
|
3362
3362
|
e.innerHTML = "";
|
|
3363
3363
|
let a = /* @__PURE__ */ new Map();
|
|
3364
3364
|
for (let o of t) {
|
|
@@ -3382,7 +3382,7 @@ function xn(e, t, n, r, i) {
|
|
|
3382
3382
|
})), c.div.appendChild(l);
|
|
3383
3383
|
}
|
|
3384
3384
|
}
|
|
3385
|
-
function
|
|
3385
|
+
function xn(e, t, n, r, i, a, o = {}) {
|
|
3386
3386
|
e.innerHTML = "";
|
|
3387
3387
|
let s = o.match ?? "rgba(255, 214, 0, 0.42)", c = o.active ?? "rgba(255, 140, 0, 0.55)", l = /* @__PURE__ */ new Map(), u = (t) => {
|
|
3388
3388
|
let n = t.rotation + (t.textBodyRotation ?? 0), a = `${t.shapeX},${t.shapeY},${t.shapeW},${t.shapeH},${n}`, o = l.get(a);
|
|
@@ -3410,21 +3410,23 @@ function Sn(e, t, n, r, i, a, o = {}) {
|
|
|
3410
3410
|
}
|
|
3411
3411
|
//#endregion
|
|
3412
3412
|
//#region packages/pptx/src/find.ts
|
|
3413
|
-
var
|
|
3413
|
+
var Sn = class {
|
|
3414
3414
|
_slideRuns = /* @__PURE__ */ new Map();
|
|
3415
3415
|
_matches = [];
|
|
3416
3416
|
_active = -1;
|
|
3417
|
+
_generation = 0;
|
|
3418
|
+
_runsRevision = 0;
|
|
3417
3419
|
constructor(e, t) {
|
|
3418
3420
|
this._slideCount = e, this._collectSlideRuns = t;
|
|
3419
3421
|
}
|
|
3420
3422
|
invalidate() {
|
|
3421
|
-
this._slideRuns.clear(), this._matches = [], this._active = -1;
|
|
3423
|
+
this._generation++, this._runsRevision++, this._slideRuns.clear(), this._matches = [], this._active = -1;
|
|
3422
3424
|
}
|
|
3423
3425
|
slideRuns(e) {
|
|
3424
3426
|
return this._slideRuns.get(e);
|
|
3425
3427
|
}
|
|
3426
3428
|
setSlideRuns(e, t) {
|
|
3427
|
-
this._slideRuns.set(e, t);
|
|
3429
|
+
this._runsRevision++, this._slideRuns.set(e, t);
|
|
3428
3430
|
}
|
|
3429
3431
|
slideHighlights(e) {
|
|
3430
3432
|
let t = [];
|
|
@@ -3449,20 +3451,30 @@ var Cn = class {
|
|
|
3449
3451
|
}));
|
|
3450
3452
|
}
|
|
3451
3453
|
async find(e, t = {}) {
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3454
|
+
let n = ++this._generation;
|
|
3455
|
+
if (e.length === 0) return this._runsRevision++, this._slideRuns.clear(), this._matches = [], this._active = -1, [];
|
|
3456
|
+
let r = this._runsRevision, i = new Map(this._slideRuns), a = this._slideCount();
|
|
3457
|
+
for (let e = 0; e < a; e++) {
|
|
3458
|
+
let t = i.get(e);
|
|
3459
|
+
if (!t) {
|
|
3460
|
+
if (t = await this._collectSlideRuns(e), n !== this._generation) return [];
|
|
3461
|
+
i.set(e, t);
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
if (n !== this._generation) return [];
|
|
3465
|
+
let o = r === this._runsRevision ? i : new Map([...i, ...this._slideRuns]), s = [];
|
|
3466
|
+
for (let n = 0; n < a; n++) {
|
|
3467
|
+
let r = o.get(n) ?? [], i = ve(r);
|
|
3456
3468
|
for (let a of ie(i, e, t)) {
|
|
3457
|
-
let e = a.slices.map((e) =>
|
|
3458
|
-
|
|
3459
|
-
slide:
|
|
3469
|
+
let e = a.slices.map((e) => r[e.runIndex].text.slice(e.start, e.end)).join("");
|
|
3470
|
+
s.push({
|
|
3471
|
+
slide: n,
|
|
3460
3472
|
text: e,
|
|
3461
3473
|
slices: a.slices
|
|
3462
3474
|
});
|
|
3463
3475
|
}
|
|
3464
3476
|
}
|
|
3465
|
-
return this.matches();
|
|
3477
|
+
return this._runsRevision++, this._slideRuns = o, this._matches = s, this._active = -1, this.matches();
|
|
3466
3478
|
}
|
|
3467
3479
|
next() {
|
|
3468
3480
|
return this._active = Se(this._active, this._matches.length), this._activePublic();
|
|
@@ -3478,21 +3490,15 @@ var Cn = class {
|
|
|
3478
3490
|
location: { slide: e.slide }
|
|
3479
3491
|
} : null;
|
|
3480
3492
|
}
|
|
3481
|
-
async _ensureSlideRuns(e) {
|
|
3482
|
-
let t = this._slideRuns.get(e);
|
|
3483
|
-
if (t) return t;
|
|
3484
|
-
let n = await this._collectSlideRuns(e);
|
|
3485
|
-
return this._slideRuns.set(e, n), n;
|
|
3486
|
-
}
|
|
3487
3493
|
};
|
|
3488
3494
|
//#endregion
|
|
3489
3495
|
//#region packages/pptx/src/types.ts
|
|
3490
|
-
function
|
|
3496
|
+
function Cn(e) {
|
|
3491
3497
|
return e;
|
|
3492
3498
|
}
|
|
3493
3499
|
//#endregion
|
|
3494
3500
|
//#region packages/pptx/src/hyperlink.ts
|
|
3495
|
-
function
|
|
3501
|
+
function wn(e, t) {
|
|
3496
3502
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3497
3503
|
if (n === void 0 && r === void 0) return;
|
|
3498
3504
|
if (r !== void 0) return {
|
|
@@ -3510,7 +3516,7 @@ function Tn(e, t) {
|
|
|
3510
3516
|
}
|
|
3511
3517
|
//#endregion
|
|
3512
3518
|
//#region packages/pptx/src/media-chrome.ts
|
|
3513
|
-
function
|
|
3519
|
+
function Tn(e, t, n, r, i, a) {
|
|
3514
3520
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3515
3521
|
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") {
|
|
3516
3522
|
e.beginPath();
|
|
@@ -3524,18 +3530,18 @@ function En(e, t, n, r, i, a) {
|
|
|
3524
3530
|
}
|
|
3525
3531
|
//#endregion
|
|
3526
3532
|
//#region packages/pptx/src/bidi-line.ts
|
|
3527
|
-
var
|
|
3533
|
+
var En = (e) => {
|
|
3528
3534
|
let t = e.text;
|
|
3529
3535
|
return typeof t == "string" ? t : void 0;
|
|
3530
|
-
},
|
|
3531
|
-
function
|
|
3536
|
+
}, Dn = (e) => "isTab" in e;
|
|
3537
|
+
function On(e) {
|
|
3532
3538
|
for (let t of e) {
|
|
3533
|
-
let e =
|
|
3539
|
+
let e = En(t);
|
|
3534
3540
|
if (e !== void 0 && M(e)) return !0;
|
|
3535
3541
|
}
|
|
3536
3542
|
return !1;
|
|
3537
3543
|
}
|
|
3538
|
-
function
|
|
3544
|
+
function kn(e, t) {
|
|
3539
3545
|
let n = e.length;
|
|
3540
3546
|
if (n === 0) return {
|
|
3541
3547
|
order: [],
|
|
@@ -3544,8 +3550,8 @@ function An(e, t) {
|
|
|
3544
3550
|
let i = "", a = Array(n), o;
|
|
3545
3551
|
for (let t = 0; t < n; t++) {
|
|
3546
3552
|
a[t] = i.length;
|
|
3547
|
-
let n =
|
|
3548
|
-
if (i += n.length > 0 ? n : "",
|
|
3553
|
+
let n = En(e[t]) ?? "";
|
|
3554
|
+
if (i += n.length > 0 ? n : "", Dn(e[t])) {
|
|
3549
3555
|
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3550
3556
|
o[a[t]] = "S";
|
|
3551
3557
|
}
|
|
@@ -3560,7 +3566,7 @@ function An(e, t) {
|
|
|
3560
3566
|
}
|
|
3561
3567
|
//#endregion
|
|
3562
3568
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3563
|
-
function
|
|
3569
|
+
function An(e, t, n, r) {
|
|
3564
3570
|
if (e.length === 0) return 0;
|
|
3565
3571
|
let i = t === 0, a = 0, o = t;
|
|
3566
3572
|
for (let t of e) {
|
|
@@ -3575,8 +3581,8 @@ function jn(e, t, n, r) {
|
|
|
3575
3581
|
}
|
|
3576
3582
|
//#endregion
|
|
3577
3583
|
//#region packages/pptx/src/text-justify.ts
|
|
3578
|
-
var
|
|
3579
|
-
function
|
|
3584
|
+
var jn = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3585
|
+
function Mn(e, t, n, r, i) {
|
|
3580
3586
|
if (r === "just" && i) return null;
|
|
3581
3587
|
let a = t - n;
|
|
3582
3588
|
if (a <= .5) return null;
|
|
@@ -3584,7 +3590,7 @@ function Nn(e, t, n, r, i) {
|
|
|
3584
3590
|
firstContentSi: 0,
|
|
3585
3591
|
lastDrawnSi: e.length,
|
|
3586
3592
|
isGapChar: S,
|
|
3587
|
-
isWhitespace:
|
|
3593
|
+
isWhitespace: jn,
|
|
3588
3594
|
seaClusterGaps: r === "thaiDist"
|
|
3589
3595
|
});
|
|
3590
3596
|
if (!o) return null;
|
|
@@ -3605,7 +3611,7 @@ function Nn(e, t, n, r, i) {
|
|
|
3605
3611
|
}
|
|
3606
3612
|
//#endregion
|
|
3607
3613
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3608
|
-
function
|
|
3614
|
+
function Nn(e) {
|
|
3609
3615
|
if (!e) return {
|
|
3610
3616
|
r: 0,
|
|
3611
3617
|
g: 0,
|
|
@@ -3622,21 +3628,21 @@ function Pn(e) {
|
|
|
3622
3628
|
b: parseInt(t.slice(4, 6), 16)
|
|
3623
3629
|
};
|
|
3624
3630
|
}
|
|
3625
|
-
function
|
|
3626
|
-
let t =
|
|
3631
|
+
function Pn(e) {
|
|
3632
|
+
let t = Nn(e);
|
|
3627
3633
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3628
3634
|
}
|
|
3629
|
-
function
|
|
3635
|
+
function Fn(e, t) {
|
|
3630
3636
|
if (!e && !t) return null;
|
|
3631
3637
|
if (!e) return t;
|
|
3632
3638
|
if (!t) return e;
|
|
3633
3639
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3634
|
-
let n =
|
|
3640
|
+
let n = Pn(e.color), r = Pn(t.color);
|
|
3635
3641
|
return n === r || n < r ? e : t;
|
|
3636
3642
|
}
|
|
3637
3643
|
//#endregion
|
|
3638
3644
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3639
|
-
function
|
|
3645
|
+
function In(e) {
|
|
3640
3646
|
let t = I(e.length === 8 ? e.slice(0, 6) : e);
|
|
3641
3647
|
if (!t) return null;
|
|
3642
3648
|
let n = w(t[0], t[1], t[2]);
|
|
@@ -3646,13 +3652,13 @@ function Ln(e) {
|
|
|
3646
3652
|
let i = r / 255;
|
|
3647
3653
|
return i * n + (1 - i);
|
|
3648
3654
|
}
|
|
3649
|
-
function
|
|
3655
|
+
function Ln(e) {
|
|
3650
3656
|
if (!e) return null;
|
|
3651
|
-
if (e.fillType === "solid") return
|
|
3657
|
+
if (e.fillType === "solid") return In(e.color);
|
|
3652
3658
|
if (e.fillType === "gradient") {
|
|
3653
3659
|
let t = e.stops.map((e) => ({
|
|
3654
3660
|
p: Math.min(1, Math.max(0, e.position)),
|
|
3655
|
-
l:
|
|
3661
|
+
l: In(e.color)
|
|
3656
3662
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3657
3663
|
if (t.length === 0) return null;
|
|
3658
3664
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -3661,18 +3667,18 @@ function Rn(e) {
|
|
|
3661
3667
|
}
|
|
3662
3668
|
return null;
|
|
3663
3669
|
}
|
|
3664
|
-
function
|
|
3670
|
+
function Rn(e) {
|
|
3665
3671
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3666
3672
|
}
|
|
3667
|
-
function
|
|
3668
|
-
let n =
|
|
3673
|
+
function zn(e, t) {
|
|
3674
|
+
let n = Ln(e);
|
|
3669
3675
|
if (n === null || n >= .5) return null;
|
|
3670
|
-
let r =
|
|
3676
|
+
let r = In(t.replace(/^#/, ""));
|
|
3671
3677
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3672
3678
|
}
|
|
3673
3679
|
//#endregion
|
|
3674
3680
|
//#region packages/pptx/src/tab-layout.ts
|
|
3675
|
-
function
|
|
3681
|
+
function Bn(e, t, n, r, i, a = 0) {
|
|
3676
3682
|
let o = e.map((e) => e.width), s = (t) => {
|
|
3677
3683
|
let n = 0;
|
|
3678
3684
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -3700,8 +3706,8 @@ function Vn(e, t, n, r, i, a = 0) {
|
|
|
3700
3706
|
}
|
|
3701
3707
|
//#endregion
|
|
3702
3708
|
//#region packages/pptx/src/vertical-text.ts
|
|
3703
|
-
var
|
|
3704
|
-
function
|
|
3709
|
+
var Vn = () => !1;
|
|
3710
|
+
function Hn(e, t, n) {
|
|
3705
3711
|
let r = e.textBaseline;
|
|
3706
3712
|
e.textBaseline = "alphabetic";
|
|
3707
3713
|
let i = e.measureText(t);
|
|
@@ -3709,7 +3715,7 @@ function Un(e, t, n) {
|
|
|
3709
3715
|
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3710
3716
|
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3711
3717
|
}
|
|
3712
|
-
function
|
|
3718
|
+
function Un(e, t) {
|
|
3713
3719
|
let n = e.textAlign, r = e.textBaseline;
|
|
3714
3720
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
3715
3721
|
let i = e.measureText(t);
|
|
@@ -3717,15 +3723,15 @@ function Wn(e, t) {
|
|
|
3717
3723
|
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3718
3724
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3719
3725
|
}
|
|
3720
|
-
function
|
|
3721
|
-
let l = e.textAlign, u = e.textBaseline, d = s === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), f = r -
|
|
3726
|
+
function Wn(e, t, n, r, i, o, s = "fill", c = Vn) {
|
|
3727
|
+
let l = e.textAlign, u = e.textBaseline, d = s === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), f = r - Hn(e, t, i), p = 0;
|
|
3722
3728
|
for (let s of t) {
|
|
3723
3729
|
let t = s.codePointAt(0) ?? 0, u = D(t), m = e.measureText(s).width + o, h = u === "Tr" ? B(t) : null, g = u === "Tr" && h === null && De(t), _ = u === "U" || u === "Tu" || h !== null || g;
|
|
3724
3730
|
if (a(t) && c(t)) {
|
|
3725
3731
|
let t = n + p + m / 2;
|
|
3726
3732
|
e.save(), e.translate(t, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", Te(e, () => d(s, 0, 0)), e.restore();
|
|
3727
3733
|
} else if (_) {
|
|
3728
|
-
let r = h === null && u === "Tu" ? ke(t) : null, a = h === null ? r : h, o = a === null ? s : String.fromCodePoint(a), c = n + p + m / 2, l = r === null ?
|
|
3734
|
+
let r = h === null && u === "Tu" ? ke(t) : null, a = h === null ? r : h, o = a === null ? s : String.fromCodePoint(a), c = n + p + m / 2, l = r === null ? Un(e, o) / i : 0;
|
|
3729
3735
|
e.save(), e.translate(c, f), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", d(o, 0, l * i), e.restore();
|
|
3730
3736
|
} else if (u === "Tr") {
|
|
3731
3737
|
let t = n + p + m / 2;
|
|
@@ -3735,27 +3741,27 @@ function Gn(e, t, n, r, i, o, s = "fill", c = Hn) {
|
|
|
3735
3741
|
}
|
|
3736
3742
|
e.textAlign = l, e.textBaseline = u;
|
|
3737
3743
|
}
|
|
3738
|
-
function
|
|
3739
|
-
|
|
3744
|
+
function Gn(e, t, n, r, i, a, o = "fill") {
|
|
3745
|
+
Wn(e, t, n, r, i, a, o, (t) => L(e, t));
|
|
3740
3746
|
}
|
|
3741
3747
|
//#endregion
|
|
3742
3748
|
//#region packages/pptx/src/renderer.ts
|
|
3743
|
-
function
|
|
3749
|
+
function X(e, t) {
|
|
3744
3750
|
return e * t;
|
|
3745
3751
|
}
|
|
3746
|
-
var
|
|
3747
|
-
function
|
|
3752
|
+
var Z = Ae;
|
|
3753
|
+
function Kn(e, t, n, r, i, a, o) {
|
|
3748
3754
|
let { top: s, height: c } = gn(n, i);
|
|
3749
3755
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3750
3756
|
}
|
|
3751
|
-
function
|
|
3752
|
-
return !e || e.fillType === "none" ? null : e.fillType === "solid" ?
|
|
3757
|
+
function qn(e) {
|
|
3758
|
+
return !e || e.fillType === "none" ? null : e.fillType === "solid" ? Z(e.color) : e.fillType === "gradient" ? e.stops.length > 0 ? Z(e.stops[0].color) : null : e.fillType === "pattern" ? Z(e.fg) : null;
|
|
3753
3759
|
}
|
|
3754
|
-
function
|
|
3760
|
+
function Jn(e, t, n, r, i, a) {
|
|
3755
3761
|
return O(e, t, n, r, i, a);
|
|
3756
3762
|
}
|
|
3757
|
-
var
|
|
3758
|
-
function
|
|
3763
|
+
var Yn = /* @__PURE__ */ new WeakMap();
|
|
3764
|
+
function Xn(e, t) {
|
|
3759
3765
|
let n = e.tinted.get(t);
|
|
3760
3766
|
if (n) return n;
|
|
3761
3767
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -3763,18 +3769,18 @@ function Zn(e, t) {
|
|
|
3763
3769
|
let o = a.getContext("2d");
|
|
3764
3770
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
3765
3771
|
}
|
|
3766
|
-
function
|
|
3772
|
+
function Zn(e) {
|
|
3767
3773
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3768
3774
|
return new Promise((e, r) => {
|
|
3769
3775
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3770
3776
|
});
|
|
3771
3777
|
}
|
|
3772
|
-
var
|
|
3773
|
-
function
|
|
3774
|
-
let r = Math.max(1, Math.round(t *
|
|
3778
|
+
var Qn = 256;
|
|
3779
|
+
function $n(e, t, n) {
|
|
3780
|
+
let r = Math.max(1, Math.round(t * Qn)), i = Math.max(1, Math.round(n * Qn));
|
|
3775
3781
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3776
3782
|
}
|
|
3777
|
-
function
|
|
3783
|
+
function er(e) {
|
|
3778
3784
|
let t = [], n = (e) => {
|
|
3779
3785
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3780
3786
|
nodes: e.nodes,
|
|
@@ -3785,13 +3791,13 @@ function tr(e) {
|
|
|
3785
3791
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3786
3792
|
return t;
|
|
3787
3793
|
}
|
|
3788
|
-
async function
|
|
3789
|
-
let n =
|
|
3794
|
+
async function tr(e, t) {
|
|
3795
|
+
let n = er(e);
|
|
3790
3796
|
if (n.length !== 0) {
|
|
3791
3797
|
await t.loadMathJax();
|
|
3792
|
-
for (let e of n) if (!
|
|
3793
|
-
let n = await t.mathMLToSvg(m(e.nodes, e.display)), r = await
|
|
3794
|
-
|
|
3798
|
+
for (let e of n) if (!Yn.has(e.nodes)) try {
|
|
3799
|
+
let n = await t.mathMLToSvg(m(e.nodes, e.display)), r = await Zn($n(Ye(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3800
|
+
Yn.set(e.nodes, {
|
|
3795
3801
|
img: r,
|
|
3796
3802
|
widthEm: n.widthEm,
|
|
3797
3803
|
ascentEm: n.ascentEm,
|
|
@@ -3801,10 +3807,10 @@ async function nr(e, t) {
|
|
|
3801
3807
|
} catch {}
|
|
3802
3808
|
}
|
|
3803
3809
|
}
|
|
3804
|
-
function
|
|
3810
|
+
function nr(e, t) {
|
|
3805
3811
|
return e ? e.startsWith("+") ? e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif" : e.split(",")[0].trim() || (t.themeMinorFont ?? "sans-serif") : t.themeMinorFont ?? "sans-serif";
|
|
3806
3812
|
}
|
|
3807
|
-
var
|
|
3813
|
+
var rr = new Set([
|
|
3808
3814
|
"serif",
|
|
3809
3815
|
"sans-serif",
|
|
3810
3816
|
"monospace",
|
|
@@ -3812,11 +3818,11 @@ var ir = new Set([
|
|
|
3812
3818
|
"fantasy",
|
|
3813
3819
|
"system-ui"
|
|
3814
3820
|
]);
|
|
3815
|
-
function
|
|
3821
|
+
function ir(e) {
|
|
3816
3822
|
let t = E(e);
|
|
3817
3823
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3818
3824
|
}
|
|
3819
|
-
var
|
|
3825
|
+
var ar = {
|
|
3820
3826
|
calibri: "Carlito",
|
|
3821
3827
|
"calibri light": "Carlito",
|
|
3822
3828
|
cambria: "Caladea",
|
|
@@ -3826,65 +3832,65 @@ var or = {
|
|
|
3826
3832
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3827
3833
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3828
3834
|
"univers next arabic": "Noto Sans Arabic"
|
|
3829
|
-
},
|
|
3830
|
-
function
|
|
3831
|
-
if (
|
|
3835
|
+
}, or = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3836
|
+
function sr(e) {
|
|
3837
|
+
if (ar[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3832
3838
|
let t = e.toLowerCase();
|
|
3833
3839
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3834
3840
|
}
|
|
3835
|
-
function
|
|
3841
|
+
function cr(e) {
|
|
3836
3842
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3837
3843
|
}
|
|
3838
|
-
function
|
|
3839
|
-
let t =
|
|
3840
|
-
if (
|
|
3844
|
+
function lr(e) {
|
|
3845
|
+
let t = ir(e), n = ar[e.toLowerCase()], r = n ? `"${n}", ` : "";
|
|
3846
|
+
if (sr(e)) return `"${e}", ${r}${or}, ${t}`;
|
|
3841
3847
|
let i = t === "serif" ? "serif" : "sans", a = v(e);
|
|
3842
|
-
return `"${e}", ${r}${a ? `${
|
|
3848
|
+
return `"${e}", ${r}${a ? `${cr(p(a, i))}, ` : ""}${`${cr(i === "serif" ? C : x)}, `}${t}`;
|
|
3843
3849
|
}
|
|
3844
|
-
function
|
|
3850
|
+
function ur(e) {
|
|
3845
3851
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3846
3852
|
}
|
|
3847
|
-
function
|
|
3848
|
-
let a = t ? "italic " : "", o = e ? "bold " : "", s =
|
|
3849
|
-
return
|
|
3853
|
+
function Q(e, t, n, r, i) {
|
|
3854
|
+
let a = t ? "italic " : "", o = e ? "bold " : "", s = nr(r, i);
|
|
3855
|
+
return rr.has(s) ? `${a}${o}${n}px ${s}` : `${a}${o}${n}px ${lr(s)}`;
|
|
3850
3856
|
}
|
|
3851
|
-
function
|
|
3852
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3857
|
+
function dr(e) {
|
|
3858
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || Cn(e.bullet).type === "blip";
|
|
3853
3859
|
}
|
|
3854
|
-
function
|
|
3860
|
+
function fr(e, t) {
|
|
3855
3861
|
return e ? 0 : Math.max(0, t);
|
|
3856
3862
|
}
|
|
3857
|
-
function
|
|
3863
|
+
function pr(e, t, r, i, a, o, s) {
|
|
3858
3864
|
let c = (t.defaultFontSize ?? 18) * n * o;
|
|
3859
3865
|
for (let l of t.paragraphs) {
|
|
3860
|
-
let u =
|
|
3866
|
+
let u = X(l.marL, o), d = X(l.marR, o), f = X(l.indent, o), p = fr(dr(l), f), m = r - i - a - u - d - p, h = 0;
|
|
3861
3867
|
for (let r of l.runs) {
|
|
3862
3868
|
if (r.type !== "text") continue;
|
|
3863
|
-
let i = r.fontSize == null ? l.defFontSize == null ? c : l.defFontSize * n * o : r.fontSize * n * o, a =
|
|
3864
|
-
if (e.font =
|
|
3869
|
+
let i = r.fontSize == null ? l.defFontSize == null ? c : l.defFontSize * n * o : r.fontSize * n * o, a = nr(r.fontFamily ?? l.defFontFamily ?? null, s);
|
|
3870
|
+
if (e.font = Q(r.bold ?? l.defBold ?? t.defaultBold ?? !1, r.italic ?? l.defItalic ?? t.defaultItalic ?? !1, i, a, s), h += e.measureText(r.text).width, h > m) return !0;
|
|
3865
3871
|
}
|
|
3866
3872
|
}
|
|
3867
3873
|
return !1;
|
|
3868
3874
|
}
|
|
3869
|
-
function
|
|
3875
|
+
function mr(e) {
|
|
3870
3876
|
for (let t of e) if (S(t.codePointAt(0) ?? 0)) return !0;
|
|
3871
3877
|
return !1;
|
|
3872
3878
|
}
|
|
3873
|
-
function
|
|
3879
|
+
function $(e) {
|
|
3874
3880
|
let t = 0;
|
|
3875
3881
|
for (let n of e) t++;
|
|
3876
3882
|
return t;
|
|
3877
3883
|
}
|
|
3878
|
-
function
|
|
3884
|
+
function hr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
3879
3885
|
themeMajorFont: null,
|
|
3880
3886
|
themeMinorFont: null,
|
|
3881
3887
|
dpr: 1
|
|
3882
3888
|
}, h = 0) {
|
|
3883
|
-
let g = [], _ = () => r - (g.length === 0 ? h : 0), v = { segments: [] }, x = 0, C = !1, w = t.rtl === !0, E =
|
|
3884
|
-
pos:
|
|
3889
|
+
let g = [], _ = () => r - (g.length === 0 ? h : 0), v = { segments: [] }, x = 0, C = !1, w = t.rtl === !0, E = X(t.marR, c), D = (t.tabStops ?? []).map((e) => ({
|
|
3890
|
+
pos: X(e.pos, c),
|
|
3885
3891
|
algn: e.algn
|
|
3886
|
-
})), O =
|
|
3887
|
-
let t =
|
|
3892
|
+
})), O = X(t.defTabSz ?? 914400, c), A = !1, j = [], M = 0, N = () => w ? E : l + (g.length === 0 ? h : 0), P = (e = 0) => {
|
|
3893
|
+
let t = Bn(e > 0 ? [...j, {
|
|
3888
3894
|
isTab: !1,
|
|
3889
3895
|
width: e
|
|
3890
3896
|
}] : j, D, N(), Infinity, M, O), n = 0;
|
|
@@ -3909,7 +3915,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
3909
3915
|
}, R = (t, n, r, i, a, o, s, c) => {
|
|
3910
3916
|
if (!t) return;
|
|
3911
3917
|
e.font = n;
|
|
3912
|
-
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l *
|
|
3918
|
+
let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l * $(t), d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.outline, g = c?.highlight, _ = c?.fontFamily, y = c?.hyperlink, b = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.outline === h && (e.highlight ?? "") === (g ?? "") && (e.fontFamily ?? "") === (_ ?? "") && ur(e.hyperlink) === ur(y);
|
|
3913
3919
|
x += u, j.push({
|
|
3914
3920
|
isTab: !1,
|
|
3915
3921
|
width: u
|
|
@@ -3957,7 +3963,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
3957
3963
|
continue;
|
|
3958
3964
|
}
|
|
3959
3965
|
if (r.type === "math") {
|
|
3960
|
-
let e =
|
|
3966
|
+
let e = Yn.get(r.nodes), t = r.fontSize == null ? i : r.fontSize * n * c * f, o = e ? e.widthEm * t : 0, s = e ? e.ascentEm * t : 0, l = e ? e.descentEm * t : 0;
|
|
3961
3967
|
(r.display && x > 0 || !F(o) && x > 0) && L(), j.push({
|
|
3962
3968
|
isTab: !1,
|
|
3963
3969
|
width: o
|
|
@@ -3965,7 +3971,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
3965
3971
|
text: "",
|
|
3966
3972
|
font: `${t}px sans-serif`,
|
|
3967
3973
|
sizePx: t,
|
|
3968
|
-
color: r.color ?
|
|
3974
|
+
color: r.color ? Z(r.color) : a,
|
|
3969
3975
|
underline: !1,
|
|
3970
3976
|
strikethrough: !1,
|
|
3971
3977
|
math: {
|
|
@@ -3978,9 +3984,9 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
3978
3984
|
}), x += o, r.display && L();
|
|
3979
3985
|
continue;
|
|
3980
3986
|
}
|
|
3981
|
-
let l = r.fontSize == null ? i : r.fontSize * n * c * f, h =
|
|
3982
|
-
E = r.color ?
|
|
3983
|
-
let D = r.bold ?? t.defBold ?? u, O = r.italic ?? t.defItalic ?? d, N =
|
|
3987
|
+
let l = r.fontSize == null ? i : r.fontSize * n * c * f, h = nr(r.fontFamily ?? t.defFontFamily ?? null, m), g = r.fontFamilyEa ? nr(r.fontFamilyEa, m) : null, w = r.fontFamilySym ? nr(r.fontFamilySym, m) : null, E;
|
|
3988
|
+
E = r.color ? Z(r.color) : r.hyperlink && m.themeHlinkColor ? Z(m.themeHlinkColor) : a;
|
|
3989
|
+
let D = r.bold ?? t.defBold ?? u, O = r.italic ?? t.defItalic ?? d, N = Q(D, O, l, h, m), P = g ? Q(D, O, l, g, m) : N;
|
|
3984
3990
|
e.font = N;
|
|
3985
3991
|
let B = r.caps, V = r.text;
|
|
3986
3992
|
(B === "all" || B === "small") && (V = V.toUpperCase());
|
|
@@ -3988,12 +3994,12 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
3988
3994
|
strikeDouble: ee,
|
|
3989
3995
|
letterSpacingPx: W,
|
|
3990
3996
|
underlineStyle: r.underlineStyle,
|
|
3991
|
-
underlineColor: r.underlineColor ?
|
|
3997
|
+
underlineColor: r.underlineColor ? Z(r.underlineColor) : void 0,
|
|
3992
3998
|
shadow: r.shadow,
|
|
3993
3999
|
outline: r.outline,
|
|
3994
4000
|
fontFamily: h,
|
|
3995
|
-
highlight: r.highlight ?
|
|
3996
|
-
hyperlink:
|
|
4001
|
+
highlight: r.highlight ? Z(r.highlight) : void 0,
|
|
4002
|
+
hyperlink: wn(r.hyperlink)
|
|
3997
4003
|
}, te = H.split(/(\s+)/);
|
|
3998
4004
|
for (let n of te) {
|
|
3999
4005
|
if (!n) continue;
|
|
@@ -4023,7 +4029,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
4023
4029
|
let n = i, a = N;
|
|
4024
4030
|
if (c.test(i)) {
|
|
4025
4031
|
let e = Ie(i, t);
|
|
4026
|
-
e === i ? a =
|
|
4032
|
+
e === i ? a = Q(D, O, l, t, m) : (n = e, a = Q(D, O, l, "sans-serif", m));
|
|
4027
4033
|
}
|
|
4028
4034
|
e.font = a;
|
|
4029
4035
|
let o = e.measureText(n).width;
|
|
@@ -4031,7 +4037,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
4031
4037
|
}
|
|
4032
4038
|
continue;
|
|
4033
4039
|
}
|
|
4034
|
-
if (
|
|
4040
|
+
if (mr(n) && (!k(n) || t.eaLnBrk === !1)) {
|
|
4035
4041
|
let i = [];
|
|
4036
4042
|
for (let t of n) {
|
|
4037
4043
|
let n = S(t.codePointAt(0) ?? 0) && g != null, r = n ? P : N, a = n ? g : h;
|
|
@@ -4053,7 +4059,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
4053
4059
|
}
|
|
4054
4060
|
let a = i;
|
|
4055
4061
|
for (; a.length > 0;) {
|
|
4056
|
-
let e = Number.isFinite(_()) ? _() - I() : x, t =
|
|
4062
|
+
let e = Number.isFinite(_()) ? _() - I() : x, t = An(a, e, _(), T);
|
|
4057
4063
|
if (t === 0) {
|
|
4058
4064
|
if (x > 0) {
|
|
4059
4065
|
L();
|
|
@@ -4077,7 +4083,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
4077
4083
|
cjk: !0,
|
|
4078
4084
|
kinsoku: T
|
|
4079
4085
|
}), i = g != null && P !== N, a = (e) => i && S(e.codePointAt(0) ?? 0), c = (t) => {
|
|
4080
|
-
let n = W *
|
|
4086
|
+
let n = W * $(t), r = "", i = null, o = () => {
|
|
4081
4087
|
r !== "" && (e.font = i ? P : N, n += e.measureText(r).width, r = "");
|
|
4082
4088
|
};
|
|
4083
4089
|
for (let e of t) {
|
|
@@ -4132,7 +4138,7 @@ function gr(e, t, r, i, a, c, l, u = !1, d = !1, f = 1, p, m = {
|
|
|
4132
4138
|
}
|
|
4133
4139
|
return g.push(v), g;
|
|
4134
4140
|
}
|
|
4135
|
-
async function
|
|
4141
|
+
async function gr(e, t, r, i, a, o) {
|
|
4136
4142
|
if (t && t.fillType === "image") {
|
|
4137
4143
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, r, i), !t.imagePath || !t.mimeType || !o) return;
|
|
4138
4144
|
try {
|
|
@@ -4141,7 +4147,7 @@ async function _r(e, t, r, i, a, o) {
|
|
|
4141
4147
|
heightPt: i / a / n
|
|
4142
4148
|
});
|
|
4143
4149
|
if (!s) return;
|
|
4144
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, r, i), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
4150
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, r, i), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) yr(e, s, t.tile, r, i, a);
|
|
4145
4151
|
else {
|
|
4146
4152
|
let n = t.fillRect ?? {}, a = n.l ?? 0, o = n.t ?? 0, c = n.r ?? 0, l = n.b ?? 0, u = a * r, d = o * i, f = r * (1 - a - c), p = i * (1 - o - l);
|
|
4147
4153
|
e.drawImage(s, u, d, f, p);
|
|
@@ -4150,10 +4156,10 @@ async function _r(e, t, r, i, a, o) {
|
|
|
4150
4156
|
} catch {}
|
|
4151
4157
|
return;
|
|
4152
4158
|
}
|
|
4153
|
-
e.fillStyle =
|
|
4159
|
+
e.fillStyle = Jn(t, e, 0, 0, r, i) ?? "#FFFFFF", e.fillRect(0, 0, r, i);
|
|
4154
4160
|
}
|
|
4155
|
-
var
|
|
4156
|
-
function
|
|
4161
|
+
var _r = 9525;
|
|
4162
|
+
function vr(e, t, n, r, i) {
|
|
4157
4163
|
let a;
|
|
4158
4164
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4159
4165
|
let o;
|
|
@@ -4162,8 +4168,8 @@ function yr(e, t, n, r, i) {
|
|
|
4162
4168
|
ay: o
|
|
4163
4169
|
};
|
|
4164
4170
|
}
|
|
4165
|
-
function
|
|
4166
|
-
let o = t.width *
|
|
4171
|
+
function yr(e, t, n, r, i, a) {
|
|
4172
|
+
let o = t.width * _r * n.sx * a, s = t.height * _r * n.sy * a;
|
|
4167
4173
|
if (!(o > 0) || !(s > 0)) return;
|
|
4168
4174
|
let l = n.flip === "x" || n.flip === "xy", u = n.flip === "y" || n.flip === "xy", d = c(o * (l ? 2 : 1), s * (u ? 2 : 1));
|
|
4169
4175
|
if (!d) return;
|
|
@@ -4175,33 +4181,33 @@ function br(e, t, n, r, i, a) {
|
|
|
4175
4181
|
p(0, 0, !1, !1), l && p(o, 0, !0, !1), u && p(0, s, !1, !0), l && u && p(o, s, !0, !0);
|
|
4176
4182
|
let m = e.createPattern(d, "repeat");
|
|
4177
4183
|
if (!m) return;
|
|
4178
|
-
let { ax: h, ay: g } =
|
|
4184
|
+
let { ax: h, ay: g } = vr(n.algn, r, i, o, s), _ = h + X(n.tx, a), v = g + X(n.ty, a);
|
|
4179
4185
|
typeof m.setTransform == "function" && typeof DOMMatrix < "u" ? (m.setTransform(new DOMMatrix().translateSelf(_, v)), e.fillStyle = m, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(_, v), e.fillStyle = m, e.fillRect(-_, -v, r, i), e.restore());
|
|
4180
4186
|
}
|
|
4181
|
-
function
|
|
4187
|
+
function br(e, t, n) {
|
|
4182
4188
|
if (!t) return;
|
|
4183
|
-
let r = t.dir * Math.PI / 180, i =
|
|
4184
|
-
e.shadowColor =
|
|
4189
|
+
let r = t.dir * Math.PI / 180, i = X(t.dist, n);
|
|
4190
|
+
e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = X(t.blur, n), e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4185
4191
|
}
|
|
4186
|
-
function
|
|
4187
|
-
t && (e.shadowColor =
|
|
4192
|
+
function xr(e, t, n) {
|
|
4193
|
+
t && (e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4188
4194
|
}
|
|
4189
|
-
function
|
|
4195
|
+
function Sr(e) {
|
|
4190
4196
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4191
4197
|
}
|
|
4192
|
-
var
|
|
4193
|
-
function
|
|
4198
|
+
var Cr = 8, wr = 1, Tr = 1, Er = 256;
|
|
4199
|
+
function Dr(e, t, n, r, i, a, o, s, l, u, d, f, p, m, h) {
|
|
4194
4200
|
if (r <= 0) return;
|
|
4195
|
-
let g = e.measureText(t), _ = g.actualBoundingBoxAscent > 0 ? g.actualBoundingBoxAscent : r, v = g.actualBoundingBoxDescent > 0 ? g.actualBoundingBoxDescent : r * .25, y = g.actualBoundingBoxLeft > 0 ? g.actualBoundingBoxLeft : 0, b = g.actualBoundingBoxRight > 0 ? g.actualBoundingBoxRight : r, x = r * u * i, S = Math.min(
|
|
4196
|
-
for (; T >
|
|
4197
|
-
let e = Math.min(
|
|
4201
|
+
let g = e.measureText(t), _ = g.actualBoundingBoxAscent > 0 ? g.actualBoundingBoxAscent : r, v = g.actualBoundingBoxDescent > 0 ? g.actualBoundingBoxDescent : r * .25, y = g.actualBoundingBoxLeft > 0 ? g.actualBoundingBoxLeft : 0, b = g.actualBoundingBoxRight > 0 ? g.actualBoundingBoxRight : r, x = r * u * i, S = Math.min(Er, Math.max(1, Math.round(x / Cr))), C = (e) => Ar(e, a, r, o, s, l, d, f), w = C(S), T = Mr(w, a, o, s, l, d, f, u, i, -_, v);
|
|
4202
|
+
for (; T > Tr && S < Er;) {
|
|
4203
|
+
let e = Math.min(Er, S * 2), t = C(e), n = Mr(t, a, o, s, l, d, f, u, i, -_, v);
|
|
4198
4204
|
if (n >= T * .75) {
|
|
4199
4205
|
w = t;
|
|
4200
4206
|
break;
|
|
4201
4207
|
}
|
|
4202
4208
|
S = e, w = t, T = n;
|
|
4203
4209
|
}
|
|
4204
|
-
let E = 1e4, D =
|
|
4210
|
+
let E = 1e4, D = wr / (u * i), O = w.length - 1, k = (e, t, n) => e === 0 ? -E : t - n - D, A = (e, t, n) => e === O ? E : t - n + D, j = (e, r) => {
|
|
4205
4211
|
e.fillStyle = r;
|
|
4206
4212
|
for (let r = 0; r <= O; r++) {
|
|
4207
4213
|
let { s0: i, s1: a, g: o } = w[r], s = (i + a) / 2;
|
|
@@ -4209,7 +4215,7 @@ function Or(e, t, n, r, i, a, o, s, l, u, d, f, p, m, h) {
|
|
|
4209
4215
|
let c = k(r, i, s), l = A(r, a, s);
|
|
4210
4216
|
e.rect(c, -E, l - c, 2 * E), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
4211
4217
|
}
|
|
4212
|
-
}, M =
|
|
4218
|
+
}, M = Or(h), N = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
4213
4219
|
if (M >= 1 && N >= 1) {
|
|
4214
4220
|
j(e, h);
|
|
4215
4221
|
return;
|
|
@@ -4229,7 +4235,7 @@ function Or(e, t, n, r, i, a, o, s, l, u, d, f, p, m, h) {
|
|
|
4229
4235
|
[s, v],
|
|
4230
4236
|
[c, v]
|
|
4231
4237
|
]) {
|
|
4232
|
-
let n =
|
|
4238
|
+
let n = jr(i, u, e, t), r = p + n.x, a = m + n.y, o = P.a * r + P.c * a + P.e, s = P.b * r + P.d * a + P.f;
|
|
4233
4239
|
o < F && (F = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
|
|
4234
4240
|
}
|
|
4235
4241
|
}
|
|
@@ -4239,19 +4245,19 @@ function Or(e, t, n, r, i, a, o, s, l, u, d, f, p, m, h) {
|
|
|
4239
4245
|
j(e, h);
|
|
4240
4246
|
return;
|
|
4241
4247
|
}
|
|
4242
|
-
H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H,
|
|
4248
|
+
H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H, kr(h)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = N * M, e.drawImage(V, z, B), e.restore();
|
|
4243
4249
|
}
|
|
4244
|
-
function
|
|
4250
|
+
function Or(e) {
|
|
4245
4251
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4246
4252
|
if (!t) return 1;
|
|
4247
4253
|
let n = parseFloat(t[1]);
|
|
4248
4254
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4249
4255
|
}
|
|
4250
|
-
function
|
|
4256
|
+
function kr(e) {
|
|
4251
4257
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4252
4258
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4253
4259
|
}
|
|
4254
|
-
function
|
|
4260
|
+
function Ar(e, t, n, r, i, a, o, s) {
|
|
4255
4261
|
let c = Array(e);
|
|
4256
4262
|
for (let l = 0; l < e; l++) {
|
|
4257
4263
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
@@ -4263,33 +4269,33 @@ function jr(e, t, n, r, i, a, o, s) {
|
|
|
4263
4269
|
}
|
|
4264
4270
|
return c;
|
|
4265
4271
|
}
|
|
4266
|
-
function
|
|
4272
|
+
function jr(e, t, n, r) {
|
|
4267
4273
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4268
4274
|
return {
|
|
4269
4275
|
x: e.x + s * o - c * a,
|
|
4270
4276
|
y: e.y + c * o + s * a
|
|
4271
4277
|
};
|
|
4272
4278
|
}
|
|
4273
|
-
function
|
|
4279
|
+
function Mr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4274
4280
|
let d = 0;
|
|
4275
4281
|
for (let f of e) {
|
|
4276
4282
|
let e = (f.s0 + f.s1) / 2;
|
|
4277
4283
|
for (let p of [f.s0, f.s1]) {
|
|
4278
4284
|
let m = lt(t, (n + p) / r * i, a, o);
|
|
4279
4285
|
for (let t of [l, u]) {
|
|
4280
|
-
let n =
|
|
4286
|
+
let n = jr(m, s, 0, t), r = jr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4281
4287
|
i > d && (d = i);
|
|
4282
4288
|
}
|
|
4283
4289
|
}
|
|
4284
4290
|
}
|
|
4285
4291
|
return d;
|
|
4286
4292
|
}
|
|
4287
|
-
function
|
|
4293
|
+
function Nr(e, t, r, i, a, o, s, c, l, u, d) {
|
|
4288
4294
|
let f = a, p = o, m = Math.max(1, s), h = Math.max(1, c), g = at(r, i, m, h);
|
|
4289
4295
|
if (!g) return;
|
|
4290
4296
|
let _ = t.defaultBold ?? !1, v = t.defaultItalic ?? !1, y = (t.defaultFontSize ?? 18) * n * l, b = [];
|
|
4291
4297
|
for (let r of t.paragraphs) {
|
|
4292
|
-
let t =
|
|
4298
|
+
let t = hr(e, r, Infinity, r.defFontSize == null ? y : r.defFontSize * n * l, r.defColor ? Z(r.defColor) : u, l, 0, _, v, 1, void 0, d, 0);
|
|
4293
4299
|
for (let e of t) b.push(e);
|
|
4294
4300
|
}
|
|
4295
4301
|
if (b.length === 0) return;
|
|
@@ -4308,7 +4314,7 @@ function Pr(e, t, r, i, a, o, s, c, l, u, d) {
|
|
|
4308
4314
|
}
|
|
4309
4315
|
e.font = t.font;
|
|
4310
4316
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4311
|
-
a += r.width + n *
|
|
4317
|
+
a += r.width + n * $(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
|
|
4312
4318
|
}
|
|
4313
4319
|
if (a <= 0) continue;
|
|
4314
4320
|
let l = s + c > 0 ? s + c : o, u = g.singleEdge ? .8 : l > 0 ? s / l : .8, d = g.singleEdge ? 1 : m / a, _ = g.singleEdge ? h : l / (i - r), v = ct(g, a), y = 0;
|
|
@@ -4322,7 +4328,7 @@ function Pr(e, t, r, i, a, o, s, c, l, u, d) {
|
|
|
4322
4328
|
for (let s of o) {
|
|
4323
4329
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4324
4330
|
if (!g.singleEdge && o > 0) {
|
|
4325
|
-
|
|
4331
|
+
Dr(e, s, n, o, S(), g, y, a, v, d, _, c, f, p, t.color), y += o;
|
|
4326
4332
|
continue;
|
|
4327
4333
|
}
|
|
4328
4334
|
let l = lt(g, (y + o / 2) / a * v, _, c);
|
|
@@ -4332,7 +4338,7 @@ function Pr(e, t, r, i, a, o, s, c, l, u, d) {
|
|
|
4332
4338
|
}
|
|
4333
4339
|
e.restore();
|
|
4334
4340
|
}
|
|
4335
|
-
function
|
|
4341
|
+
function Pr(e, t, n, r, i, a, o) {
|
|
4336
4342
|
let s = Math.min(r, i);
|
|
4337
4343
|
switch (e) {
|
|
4338
4344
|
case "rightarrow":
|
|
@@ -4362,35 +4368,35 @@ function Fr(e, t, n, r, i, a, o) {
|
|
|
4362
4368
|
default: return null;
|
|
4363
4369
|
}
|
|
4364
4370
|
}
|
|
4365
|
-
function
|
|
4366
|
-
return e.defaultTextColor ?
|
|
4371
|
+
function Fr(e, t) {
|
|
4372
|
+
return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null && Rn(e) ? t.smartArtFallbackTextColor : null;
|
|
4367
4373
|
}
|
|
4368
|
-
function
|
|
4374
|
+
function Ir(e, t, n) {
|
|
4369
4375
|
return {
|
|
4370
4376
|
outerRotation: e,
|
|
4371
4377
|
localFlipH: t,
|
|
4372
4378
|
localFlipV: n
|
|
4373
4379
|
};
|
|
4374
4380
|
}
|
|
4375
|
-
function
|
|
4381
|
+
function Lr(e, t, n, r = "#000000", i, a = {
|
|
4376
4382
|
themeMajorFont: null,
|
|
4377
4383
|
themeMinorFont: null,
|
|
4378
4384
|
dpr: 1
|
|
4379
4385
|
}, o, s) {
|
|
4380
|
-
let c =
|
|
4386
|
+
let c = X(t.x, n), l = X(t.y, n), u = X(t.width, n), d = X(t.height, n), f = o && t.id !== void 0 ? (e) => o({
|
|
4381
4387
|
...e,
|
|
4382
4388
|
shapeId: t.id
|
|
4383
4389
|
}) : o;
|
|
4384
4390
|
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4385
|
-
if (t.stroke && (e.save(), $(e, t.stroke, n), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
4386
|
-
let o =
|
|
4387
|
-
|
|
4391
|
+
if (t.stroke && (e.save(), $r(e, t.stroke, n), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
4392
|
+
let o = Fr(t, a);
|
|
4393
|
+
Ur(e, t.textBody, c, l, u, d, n, o, t.rotation, t.flipH, t.flipV, r, i, a, f, !1, s);
|
|
4388
4394
|
}
|
|
4389
4395
|
return;
|
|
4390
4396
|
}
|
|
4391
4397
|
let p = t.scene3d && Dt(t.scene3d.camera) ? t.scene3d : null;
|
|
4392
4398
|
if (p && u > 0 && d > 0) {
|
|
4393
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, m =
|
|
4399
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), f = s > 0 ? Math.sqrt(s) : 1, m = Wr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, f), h = Gr(t.sp3d, p.camera, u, d, n, f), g = Ir(t.rotation, t.flipH, t.flipV);
|
|
4394
4400
|
e.save(), g.outerRotation !== 0 && (e.translate(c + u / 2, l + d / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
4395
4401
|
let _ = {
|
|
4396
4402
|
...t,
|
|
@@ -4401,8 +4407,8 @@ function Rr(e, t, n, r = "#000000", i, a = {
|
|
|
4401
4407
|
flipV: g.localFlipV,
|
|
4402
4408
|
scene3d: void 0
|
|
4403
4409
|
};
|
|
4404
|
-
if (
|
|
4405
|
-
|
|
4410
|
+
if (Kr(e, p.camera, c, l, u, d, (e) => {
|
|
4411
|
+
Lr(e, _, n, r, i, a, void 0);
|
|
4406
4412
|
}, {
|
|
4407
4413
|
bevels: m,
|
|
4408
4414
|
extrusion: h ?? void 0,
|
|
@@ -4414,8 +4420,8 @@ function Rr(e, t, n, r = "#000000", i, a = {
|
|
|
4414
4420
|
e.restore();
|
|
4415
4421
|
}
|
|
4416
4422
|
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)));
|
|
4417
|
-
let m = t.geometry.toLowerCase(), h =
|
|
4418
|
-
|
|
4423
|
+
let m = t.geometry.toLowerCase(), h = Jn(t.fill, e, c, l, u, d);
|
|
4424
|
+
br(e, t.shadow ?? null, n), t.shadow || xr(e, t.glow ?? null, n);
|
|
4419
4425
|
let g = new Set([
|
|
4420
4426
|
"line",
|
|
4421
4427
|
"straightconnector1",
|
|
@@ -4442,8 +4448,8 @@ function Rr(e, t, n, r = "#000000", i, a = {
|
|
|
4442
4448
|
"accentbordercallout3"
|
|
4443
4449
|
]), v = (e) => _.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), y = !t.custGeom && he(m), b = (e, r) => {
|
|
4444
4450
|
let i = r ?? h, a = r ? null : t.stroke ? () => {
|
|
4445
|
-
$(e, t.stroke, n), e.stroke();
|
|
4446
|
-
} : null, o = () =>
|
|
4451
|
+
$r(e, t.stroke, n), e.stroke();
|
|
4452
|
+
} : null, o = () => Sr(e);
|
|
4447
4453
|
if (y && !r) {
|
|
4448
4454
|
le(e, m, c, l, u, d, [
|
|
4449
4455
|
t.adj,
|
|
@@ -4457,7 +4463,7 @@ function Rr(e, t, n, r = "#000000", i, a = {
|
|
|
4457
4463
|
], i, a, o, v(m) ? { skipTrailingStroke: !0 } : void 0);
|
|
4458
4464
|
return;
|
|
4459
4465
|
}
|
|
4460
|
-
e.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4466
|
+
e.beginPath(), t.custGeom && t.custGeom.length > 0 ? Rr(e, t.custGeom, c, l, u, d) : Pe(e, m, c, l, u, d, t.adj, t.adj2, t.adj3, t.adj4), i && m !== "arc" && (e.fillStyle = i, m === "donut" || m === "smileyface" || m === "frame" ? e.fill("evenodd") : e.fill(), r || o()), a && a();
|
|
4461
4467
|
}, x = e.canvas.width || 0, S = e.canvas.height || 0, C = e.getTransform(), w = Math.abs(C.a * C.d - C.b * C.c), T = w > 0 ? Math.sqrt(w) : 1, E = {
|
|
4462
4468
|
x: c * T,
|
|
4463
4469
|
y: l * T,
|
|
@@ -4500,38 +4506,38 @@ function Rr(e, t, n, r = "#000000", i, a = {
|
|
|
4500
4506
|
let e = Be(t.stroke.headEnd, t.stroke, n);
|
|
4501
4507
|
i[0] = He(i[0], i[1], e);
|
|
4502
4508
|
}
|
|
4503
|
-
$(e, t.stroke, n), e.beginPath(), e.moveTo(i[0].x, i[0].y);
|
|
4509
|
+
$r(e, t.stroke, n), e.beginPath(), e.moveTo(i[0].x, i[0].y);
|
|
4504
4510
|
for (let t = 1; t < i.length; t++) e.lineTo(i[t].x, i[t].y);
|
|
4505
4511
|
e.stroke();
|
|
4506
4512
|
}
|
|
4507
|
-
i && a &&
|
|
4513
|
+
i && a && Qr(e, r.start, r.end, t.stroke, i, n), t.stroke.tailEnd && Ne(e, r.end.x, r.end.y, r.end.angle, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && Ne(e, r.start.x, r.start.y, r.start.angle, t.stroke.headEnd, t.stroke, n);
|
|
4508
4514
|
}
|
|
4509
4515
|
} else if (t.stroke && t.custGeom && t.custGeom.length > 0 && (t.stroke.headEnd && t.stroke.headEnd.type !== "none" || t.stroke.tailEnd && t.stroke.tailEnd.type !== "none")) {
|
|
4510
4516
|
let { start: r, end: i } = Re(t.custGeom);
|
|
4511
4517
|
r && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && Ne(e, c + r.x * u, l + r.y * d, Math.atan2(r.dy * d, r.dx * u), t.stroke.headEnd, t.stroke, n), i && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && Ne(e, c + i.x * u, l + i.y * d, Math.atan2(i.dy * d, i.dx * u), t.stroke.tailEnd, t.stroke, n);
|
|
4512
4518
|
}
|
|
4513
4519
|
if (t.textBody) {
|
|
4514
|
-
let o =
|
|
4520
|
+
let o = Fr(t, a);
|
|
4515
4521
|
if (e.save(), t.flipH || t.flipV) {
|
|
4516
4522
|
let n = c + u / 2, r = l + d / 2;
|
|
4517
4523
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4518
4524
|
}
|
|
4519
4525
|
let p = c, h = l, g = u, _ = d;
|
|
4520
|
-
if (t.textRect) p =
|
|
4526
|
+
if (t.textRect) p = X(t.textRect.x, n), h = X(t.textRect.y, n), g = X(t.textRect.width, n), _ = X(t.textRect.height, n);
|
|
4521
4527
|
else if (m === "ellipse") {
|
|
4522
4528
|
let e = u * (1 - 1 / Math.SQRT2) / 2, t = d * (1 - 1 / Math.SQRT2) / 2;
|
|
4523
4529
|
p = c + e, h = l + t, g = u / Math.SQRT2, _ = d / Math.SQRT2;
|
|
4524
4530
|
} else {
|
|
4525
|
-
let e =
|
|
4531
|
+
let e = Pr(m, c, l, u, d, t.adj, t.adj2);
|
|
4526
4532
|
e && (p = e.tx, h = e.ty, g = e.tw, _ = e.th);
|
|
4527
4533
|
}
|
|
4528
|
-
|
|
4534
|
+
Ur(e, t.textBody, p, h, g, _, n, o, t.rotation, !1, !1, r, i, a, f, !1, s), e.restore();
|
|
4529
4535
|
}
|
|
4530
4536
|
e.restore();
|
|
4531
4537
|
}
|
|
4532
|
-
var
|
|
4533
|
-
function
|
|
4534
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4538
|
+
var Rr = Ue;
|
|
4539
|
+
function zr(e, t) {
|
|
4540
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Br(e).toLowerCase(), o = Br(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4535
4541
|
switch (t) {
|
|
4536
4542
|
case "arabicPlain": return n;
|
|
4537
4543
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4558,7 +4564,7 @@ function Br(e, t) {
|
|
|
4558
4564
|
default: return `${n}.`;
|
|
4559
4565
|
}
|
|
4560
4566
|
}
|
|
4561
|
-
function
|
|
4567
|
+
function Br(e) {
|
|
4562
4568
|
let t = [
|
|
4563
4569
|
1e3,
|
|
4564
4570
|
900,
|
|
@@ -4591,21 +4597,21 @@ function Vr(e) {
|
|
|
4591
4597
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4592
4598
|
return r;
|
|
4593
4599
|
}
|
|
4594
|
-
function
|
|
4600
|
+
function Vr(e) {
|
|
4595
4601
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4596
4602
|
return !1;
|
|
4597
4603
|
}
|
|
4598
|
-
function
|
|
4599
|
-
let n =
|
|
4604
|
+
function Hr(e, t) {
|
|
4605
|
+
let n = Vr(e);
|
|
4600
4606
|
if (e.bullet.type === "char") return t.clear(), n ? Ie(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4601
4607
|
if (e.bullet.type === "autoNum") {
|
|
4602
4608
|
if (!n) return "";
|
|
4603
4609
|
let r = e.lvl;
|
|
4604
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4610
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), zr(t.get(r), e.bullet.numType);
|
|
4605
4611
|
}
|
|
4606
4612
|
return t.clear(), "";
|
|
4607
4613
|
}
|
|
4608
|
-
function
|
|
4614
|
+
function Ur(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000", m, h = {
|
|
4609
4615
|
themeMajorFont: null,
|
|
4610
4616
|
themeMinorFont: null,
|
|
4611
4617
|
dpr: 1
|
|
@@ -4624,7 +4630,7 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4624
4630
|
textBodyRotation: d
|
|
4625
4631
|
}) : void 0;
|
|
4626
4632
|
if (_) return a;
|
|
4627
|
-
e.save(), e.translate(n, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4633
|
+
e.save(), e.translate(n, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), Ur(e, {
|
|
4628
4634
|
...t,
|
|
4629
4635
|
vert: "horz"
|
|
4630
4636
|
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, p, m, h, f, !1, v, t.vert === "eaVert"), e.restore();
|
|
@@ -4632,25 +4638,25 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4632
4638
|
}
|
|
4633
4639
|
let S = t.textWarp;
|
|
4634
4640
|
if (!_ && S && et(S.preset)) {
|
|
4635
|
-
|
|
4641
|
+
Nr(e, t, S.preset, S.adj ?? [], r, i, a, o, s, c ?? p, h);
|
|
4636
4642
|
return;
|
|
4637
4643
|
}
|
|
4638
|
-
let C =
|
|
4644
|
+
let C = X(t.lIns, s), w = X(t.rIns, s), T = X(t.tIns, s), E = X(t.bIns, s), D = t.wrap !== "none", O = t.autoFit === "sp" ? D && pr(e, t, a, C, w, s, h) : D, k = Math.max(1, t.numCol ?? 1), A = X(t.spcCol ?? 0, s), j = t.defaultBold ?? !1, M = t.defaultItalic ?? !1, N = c ?? p, P = (i) => {
|
|
4639
4645
|
let o = (t.defaultFontSize ?? 18) * n * s * i, c = [], l = 0, u = /* @__PURE__ */ new Map();
|
|
4640
4646
|
for (let d = 0; d < t.paragraphs.length; d++) {
|
|
4641
|
-
let f = t.paragraphs[d], p =
|
|
4647
|
+
let f = t.paragraphs[d], p = X(f.marL, s), g = X(f.marR, s), _ = X(f.indent, s), v = f.defFontSize == null ? o : f.defFontSize * n * s * i, y = f.defColor ? Z(f.defColor) : N, b = dr(f), x = (() => {
|
|
4642
4648
|
for (let e of f.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4643
4649
|
return null;
|
|
4644
4650
|
})(), S = x == null ? v : x * n * s * i, T = (() => {
|
|
4645
4651
|
for (let e of f.runs) if (e.type === "text" && e.color) return e.color;
|
|
4646
4652
|
return null;
|
|
4647
|
-
})(), E = T ?
|
|
4648
|
-
D =
|
|
4649
|
-
let L =
|
|
4653
|
+
})(), E = T ? Z(T) : y, D = "", P = Q(!1, !1, S, "sans-serif", h), F = E, I = null;
|
|
4654
|
+
D = Hr(f, u);
|
|
4655
|
+
let L = Cn(f.bullet);
|
|
4650
4656
|
if (L.type === "char") {
|
|
4651
4657
|
let e = L;
|
|
4652
|
-
P =
|
|
4653
|
-
} else if (L.type === "autoNum") P =
|
|
4658
|
+
P = Q(!1, !1, e.sizePts == null ? e.sizePct == null ? S : S * (e.sizePct / 100) : e.sizePts * n * s * i, D === e.char ? nr(e.fontFamily ?? null, h) : "sans-serif", h), F = e.color ? Z(e.color) : E;
|
|
4659
|
+
} else if (L.type === "autoNum") P = Q(!1, !1, S, "sans-serif", h), F = L.color ? Z(L.color) : E;
|
|
4654
4660
|
else if (L.type === "blip") {
|
|
4655
4661
|
let e = L, t = e.sizePts == null ? e.sizePct == null ? S : S * (e.sizePct / 100) : e.sizePts * n * s * i;
|
|
4656
4662
|
I = {
|
|
@@ -4659,7 +4665,7 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4659
4665
|
sizePx: t
|
|
4660
4666
|
};
|
|
4661
4667
|
}
|
|
4662
|
-
let R = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, z = r + C + p, B = r + C + p + _, V = R - p - g, H =
|
|
4668
|
+
let R = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, z = r + C + p, B = r + C + p + _, V = R - p - g, H = hr(e, f, O ? V : Infinity, v, y, s, p, j, M, i, m, h, fr(b, _)), U = f.spaceBefore == null ? 0 : f.spaceBefore / 100 * n * s * i, ee = f.spaceAfter == null ? 0 : f.spaceAfter / 100 * n * s * i;
|
|
4663
4669
|
for (let r = 0; r < H.length; r++) {
|
|
4664
4670
|
let i = H[r], a = r === 0, o = r === H.length - 1, u = 0, p = 0;
|
|
4665
4671
|
for (let e of i.segments) {
|
|
@@ -4675,26 +4681,26 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4675
4681
|
n > u && (u = n);
|
|
4676
4682
|
}
|
|
4677
4683
|
a && I && I.sizePx > u && (u = I.sizePx);
|
|
4678
|
-
let m =
|
|
4679
|
-
|
|
4680
|
-
let
|
|
4684
|
+
let m = u * 1.2, h = Math.max(m, p), g;
|
|
4685
|
+
g = f.spaceLine ? f.spaceLine.type === "pct" ? m * (f.spaceLine.val / 1e5) : f.spaceLine.val * n * s : h, t.autoFit === "norm" && t.lnSpcReduction != null && f.spaceLine?.type !== "pts" && (g *= 1 - t.lnSpcReduction);
|
|
4686
|
+
let y = g + (o ? ee : 0), x = a && d > 0 ? U : 0, S = a ? fr(b, _) : 0, C = i.segments.some((e) => e.text && e.text.length > 0 || e.math != null), w = a && C ? I : null;
|
|
4681
4687
|
c.push({
|
|
4682
4688
|
line: i,
|
|
4683
|
-
linePx:
|
|
4684
|
-
lineHeight:
|
|
4685
|
-
topGapPx:
|
|
4686
|
-
textXOffset:
|
|
4689
|
+
linePx: y,
|
|
4690
|
+
lineHeight: g,
|
|
4691
|
+
topGapPx: x,
|
|
4692
|
+
textXOffset: S,
|
|
4687
4693
|
bulletLabel: a ? D : "",
|
|
4688
4694
|
bulletFont: P,
|
|
4689
4695
|
bulletColor: F,
|
|
4690
4696
|
bulletX: B,
|
|
4691
|
-
bulletImage:
|
|
4697
|
+
bulletImage: w,
|
|
4692
4698
|
textX: z,
|
|
4693
4699
|
textMaxW: V,
|
|
4694
4700
|
alignment: f.alignment,
|
|
4695
4701
|
isLastLine: o,
|
|
4696
4702
|
para: f
|
|
4697
|
-
}), l +=
|
|
4703
|
+
}), l += y + x;
|
|
4698
4704
|
}
|
|
4699
4705
|
}
|
|
4700
4706
|
return {
|
|
@@ -4723,11 +4729,11 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4723
4729
|
for (let n of F) {
|
|
4724
4730
|
let { line: c, linePx: d, lineHeight: f, topGapPx: p, textXOffset: m, bulletLabel: _, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = n;
|
|
4725
4731
|
k > 1 && te < k - 1 && ne >= G && (te++, ne = 0, B = H), B += p, ne++;
|
|
4726
|
-
let T = (t.rtlCol ? k - 1 - te : te) * U, E = n.textX + T, D = n.bulletX + T, O = n.textMaxW, A = n.para.rtl === !0, j = A ||
|
|
4732
|
+
let T = (t.rtlCol ? k - 1 - te : te) * U, E = n.textX + T, D = n.bulletX + T, O = n.textMaxW, A = n.para.rtl === !0, j = A || On(c.segments), M = c.segments.some((e) => e.isTab);
|
|
4727
4733
|
if (M) {
|
|
4728
|
-
let t =
|
|
4734
|
+
let t = X(n.para.marL, s), r = X(n.para.marR, s), i = A ? r : t + m, a = O + t + r;
|
|
4729
4735
|
e.font = c.segments.find((e) => e.isTab).font;
|
|
4730
|
-
let o = e.measureText(" ").width, l =
|
|
4736
|
+
let o = e.measureText(" ").width, l = Bn(c.segments.map((t) => {
|
|
4731
4737
|
if (t.isTab) return {
|
|
4732
4738
|
isTab: !0,
|
|
4733
4739
|
width: 0
|
|
@@ -4740,12 +4746,12 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4740
4746
|
let n = t.letterSpacingPx ?? 0;
|
|
4741
4747
|
return {
|
|
4742
4748
|
isTab: !1,
|
|
4743
|
-
width: t.text ? e.measureText(t.text).width + n *
|
|
4749
|
+
width: t.text ? e.measureText(t.text).width + n * $(t.text) : 0
|
|
4744
4750
|
};
|
|
4745
4751
|
}), (n.para.tabStops ?? []).map((e) => ({
|
|
4746
|
-
pos:
|
|
4752
|
+
pos: X(e.pos, s),
|
|
4747
4753
|
algn: e.algn
|
|
4748
|
-
})), i, a, o,
|
|
4754
|
+
})), i, a, o, X(n.para.defTabSz ?? 914400, s));
|
|
4749
4755
|
for (let e = 0; e < c.segments.length; e++) c.segments[e].isTab && (c.segments[e].tabWidthPx = l[e]);
|
|
4750
4756
|
}
|
|
4751
4757
|
let N = 0, P = f * .8;
|
|
@@ -4760,7 +4766,7 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4760
4766
|
}
|
|
4761
4767
|
e.font = t.font;
|
|
4762
4768
|
let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
|
|
4763
|
-
N += t.text ? n.width + r *
|
|
4769
|
+
N += t.text ? n.width + r * $(t.text) : 0, n.actualBoundingBoxAscent > 0 && (P = Math.max(P, n.actualBoundingBoxAscent));
|
|
4764
4770
|
}
|
|
4765
4771
|
let F = B + P, I = E + O, L = 0, R = null;
|
|
4766
4772
|
if (j && A) {
|
|
@@ -4783,7 +4789,7 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4783
4789
|
}
|
|
4784
4790
|
let z = E + m, V;
|
|
4785
4791
|
V = M ? A ? E + O - L - N : z : C === "ctr" ? z + (O - m - N) / 2 : C === "r" ? E + O - L - N : z;
|
|
4786
|
-
let ee = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, W = w || (c.endsWithBreak ?? !1), re = (ee && !j && !M ?
|
|
4792
|
+
let ee = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, W = w || (c.endsWithBreak ?? !1), re = (ee && !j && !M ? Mn(c.segments, O - m, N, ee, W) : null) ?? c.segments, ie = j ? kn(c.segments, A) : null, K = re.length;
|
|
4787
4793
|
for (let t = 0; t < K; t++) {
|
|
4788
4794
|
let n = ie ? ie.order[t] : t, c = re[n], d = ie ? ie.rtl[n] : !1;
|
|
4789
4795
|
if (j && (e.direction = d ? "rtl" : "ltr"), c.isTab) {
|
|
@@ -4792,9 +4798,9 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4792
4798
|
}
|
|
4793
4799
|
let p = c.jext ?? 0, m = c.splitBefore, _ = c.perGap ?? 0, v = m && m.length > 0 ? m.length * _ : 0;
|
|
4794
4800
|
if (c.math) {
|
|
4795
|
-
let t =
|
|
4801
|
+
let t = Yn.get(c.math.nodes), n = c.math.width, r = c.math.ascent + c.math.descent;
|
|
4796
4802
|
if (t && n > 0 && r > 0) {
|
|
4797
|
-
let i = F - c.math.ascent, a =
|
|
4803
|
+
let i = F - c.math.ascent, a = Xn(t, c.color);
|
|
4798
4804
|
e.drawImage(a, V, i, n, r);
|
|
4799
4805
|
}
|
|
4800
4806
|
V += n, V += p;
|
|
@@ -4803,13 +4809,13 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4803
4809
|
e.font = c.font, e.fillStyle = c.color;
|
|
4804
4810
|
let b = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0), x = c.letterSpacingPx ?? 0;
|
|
4805
4811
|
if (c.highlight && c.text) {
|
|
4806
|
-
let t = e.measureText(c.text).width + (x > 0 ? x *
|
|
4807
|
-
|
|
4812
|
+
let t = e.measureText(c.text).width + (x > 0 ? x * $(c.text) : 0) + v + p;
|
|
4813
|
+
Kn(e, V, b, t, c.sizePx, c.highlight, c.color);
|
|
4808
4814
|
}
|
|
4809
4815
|
let S = c.shadow;
|
|
4810
4816
|
if (S) {
|
|
4811
|
-
let t = S.dir * Math.PI / 180, n =
|
|
4812
|
-
e.save(), e.shadowColor =
|
|
4817
|
+
let t = S.dir * Math.PI / 180, n = X(S.dist, s);
|
|
4818
|
+
e.save(), e.shadowColor = Z(S.color, S.alpha), e.shadowBlur = X(S.blur, s), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4813
4819
|
}
|
|
4814
4820
|
let C = (t, n, r) => {
|
|
4815
4821
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
@@ -4826,7 +4832,7 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4826
4832
|
}, w = (t) => e.measureText(t).width, T = m && m.length > 0 ? _n([...c.text], m, _, w, x) : null, E = [...c.text], D = !!m && m.length === E.length - 1 && E.length > 1, O = (t) => {
|
|
4827
4833
|
if (y) {
|
|
4828
4834
|
let n = D ? x + _ : x;
|
|
4829
|
-
|
|
4835
|
+
Gn(e, c.text, V, b, c.sizePx, n, t);
|
|
4830
4836
|
return;
|
|
4831
4837
|
}
|
|
4832
4838
|
if (D) {
|
|
@@ -4843,8 +4849,8 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4843
4849
|
};
|
|
4844
4850
|
O("fill"), S && e.restore();
|
|
4845
4851
|
let k = c.outline;
|
|
4846
|
-
k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5,
|
|
4847
|
-
let A = e.measureText(c.text).width + (x > 0 ? x *
|
|
4852
|
+
k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(k.width, s)), e.strokeStyle = k.color ? `#${k.color}` : c.color, e.lineJoin = "round", O("stroke"), e.restore()), e.font = c.font;
|
|
4853
|
+
let A = e.measureText(c.text).width + (x > 0 ? x * $(c.text) : 0) + v;
|
|
4848
4854
|
if (g && c.text && g({
|
|
4849
4855
|
text: c.text,
|
|
4850
4856
|
inShapeX: V - r,
|
|
@@ -4877,7 +4883,7 @@ function Wr(e, t, r, i, a, o, s, c = null, l = 0, d = !1, f = !1, p = "#000000",
|
|
|
4877
4883
|
}
|
|
4878
4884
|
e.restore();
|
|
4879
4885
|
}
|
|
4880
|
-
function
|
|
4886
|
+
function Wr(e, t, n, r, i) {
|
|
4881
4887
|
if (!e) return [];
|
|
4882
4888
|
let a = nn(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = ln(n), s = r * i, c = [];
|
|
4883
4889
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
@@ -4895,7 +4901,7 @@ function Gr(e, t, n, r, i) {
|
|
|
4895
4901
|
bottom: !0
|
|
4896
4902
|
}), c;
|
|
4897
4903
|
}
|
|
4898
|
-
function
|
|
4904
|
+
function Gr(e, t, n, r, i, a) {
|
|
4899
4905
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4900
4906
|
let o = e.extrusionH * i * a, s = Ot(t, n * a, r * a, o);
|
|
4901
4907
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
@@ -4918,7 +4924,7 @@ function Kr(e, t, n, r, i, a) {
|
|
|
4918
4924
|
rgb: c
|
|
4919
4925
|
};
|
|
4920
4926
|
}
|
|
4921
|
-
function
|
|
4927
|
+
function Kr(e, t, n, r, i, a, o, s = {}) {
|
|
4922
4928
|
if (i <= 0 || a <= 0) return !1;
|
|
4923
4929
|
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((s.edgePadCss ?? 0) * d)), p = Et(t, i, a), m = p.corners;
|
|
4924
4930
|
if (f > 0) {
|
|
@@ -4946,7 +4952,7 @@ function qr(e, t, n, r, i, a, o, s = {}) {
|
|
|
4946
4952
|
y: r + e.y
|
|
4947
4953
|
}))), !0;
|
|
4948
4954
|
}
|
|
4949
|
-
function
|
|
4955
|
+
function qr(e, t, n, r, i, a, o, s, l = 0) {
|
|
4950
4956
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
4951
4957
|
let u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1, p = Math.max(0, Math.ceil(l * f)), m = p / f, h = Math.max(1, Math.ceil(r * f) + 2 * p), g = Math.max(1, Math.ceil(i * f) + 2 * p), _ = c(h, g);
|
|
4952
4958
|
if (!_) return !1;
|
|
@@ -4965,18 +4971,18 @@ function Jr(e, t, n, r, i, a, o, s, l = 0) {
|
|
|
4965
4971
|
}
|
|
4966
4972
|
return s && (v.save(), v.scale(f, f), v.translate(m, m), s(v, 0, 0, r, i), v.restore()), e.drawImage(_, t - m, n - m, h / f, g / f), !0;
|
|
4967
4973
|
}
|
|
4968
|
-
var
|
|
4969
|
-
function
|
|
4970
|
-
let n =
|
|
4974
|
+
var Jr = /* @__PURE__ */ new WeakMap();
|
|
4975
|
+
function Yr(e, t) {
|
|
4976
|
+
let n = Jr.get(e);
|
|
4971
4977
|
if (n) return n;
|
|
4972
4978
|
let r = (async () => {
|
|
4973
4979
|
let n = await t(e.posterPath), r = e.posterMimeType ? new Blob([n], { type: e.posterMimeType }) : n;
|
|
4974
4980
|
if (H(new Uint8Array(await r.slice(0, 64 * 1024).arrayBuffer()))) throw Error("poster raster exceeds the pixel budget");
|
|
4975
4981
|
return createImageBitmap(r);
|
|
4976
4982
|
})();
|
|
4977
|
-
return
|
|
4983
|
+
return Jr.set(e, r), r;
|
|
4978
4984
|
}
|
|
4979
|
-
async function
|
|
4985
|
+
async function Xr(e, r, i, a) {
|
|
4980
4986
|
if (a) try {
|
|
4981
4987
|
let o = r.mimeType === "image/svg+xml", { widthPt: s, heightPt: c } = de(r.mimeType, r.srcRect, r.width / n, r.height / n), l;
|
|
4982
4988
|
if (P(r)) try {
|
|
@@ -4993,23 +4999,23 @@ async function Zr(e, r, i, a) {
|
|
|
4993
4999
|
});
|
|
4994
5000
|
if (!l) return;
|
|
4995
5001
|
e.save(), r.alpha != null && (e.globalAlpha *= r.alpha);
|
|
4996
|
-
let u =
|
|
5002
|
+
let u = X(r.x, i), d = X(r.y, i), f = X(r.width, i), p = X(r.height, i);
|
|
4997
5003
|
(r.rotation !== 0 || r.flipH || r.flipV) && (e.translate(u + f / 2, d + p / 2), e.rotate(r.rotation * Math.PI / 180), r.flipH && e.scale(-1, 1), r.flipV && e.scale(1, -1), e.translate(-(u + f / 2), -(d + p / 2)));
|
|
4998
5004
|
let m = t(l, r.srcRect), h = (e, t, n, i, a) => {
|
|
4999
|
-
r.custGeom && r.custGeom.length > 0 ?
|
|
5005
|
+
r.custGeom && r.custGeom.length > 0 ? Rr(e, r.custGeom, t, n, i, a) : r.prstGeom && ee(e, r.prstGeom, t, n, i, a, r.prstAdjust ?? []) || e.rect(t, n, i, a);
|
|
5000
5006
|
}, g = (e, t, n, r, i) => {
|
|
5001
5007
|
e.beginPath(), h(e, t, n, r, i);
|
|
5002
5008
|
}, _ = (e, t, n, i, a) => {
|
|
5003
5009
|
(r.prstGeom || r.custGeom && r.custGeom.length > 0) && (g(e, t, n, i, a), e.clip());
|
|
5004
5010
|
}, v = (e, t, n, a, o) => {
|
|
5005
|
-
r.stroke && (e.save(), $(e, r.stroke, i), g(e, t, n, a, o), e.stroke(), e.restore());
|
|
5011
|
+
r.stroke && (e.save(), $r(e, r.stroke, i), g(e, t, n, a, o), e.stroke(), e.restore());
|
|
5006
5012
|
}, y = (e, t, n, a, o) => {
|
|
5007
5013
|
let s = r.sp3d;
|
|
5008
5014
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
5009
5015
|
let r = Math.max(.5, s.contourW * i);
|
|
5010
5016
|
e.save(), e.beginPath();
|
|
5011
5017
|
let c = r * 2 + Math.max(a, o);
|
|
5012
|
-
e.rect(t - c, n - c, a + 2 * c, o + 2 * c), h(e, t, n, a, o), e.clip("evenodd"), e.beginPath(), g(e, t, n, a, o), e.strokeStyle =
|
|
5018
|
+
e.rect(t - c, n - c, a + 2 * c, o + 2 * c), h(e, t, n, a, o), e.clip("evenodd"), e.beginPath(), g(e, t, n, a, o), e.strokeStyle = Z(s.contourClr), e.lineWidth = r * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5013
5019
|
}
|
|
5014
5020
|
}, b = r.scene3d && Dt(r.scene3d.camera) ? r.scene3d : null, x = (e, t, n, r, i) => {
|
|
5015
5021
|
e.save(), _(e, t, n, r, i), m ? e.drawImage(l, m.sx, m.sy, m.sw, m.sh, t, n, r, i) : e.drawImage(l, t, n, r, i), e.restore();
|
|
@@ -5017,20 +5023,20 @@ async function Zr(e, r, i, a) {
|
|
|
5017
5023
|
x(e, t, n, r, i), v(e, t, n, r, i), y(e, t, n, r, i);
|
|
5018
5024
|
}, C = (e, t, n, r, i) => {
|
|
5019
5025
|
x(e, t, n, r, i), v(e, t, n, r, i);
|
|
5020
|
-
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D =
|
|
5026
|
+
}, w = e.getTransform(), T = Math.abs(w.a * w.d - w.b * w.c), E = T > 0 ? Math.sqrt(T) : 1, D = Wr(r.sp3d, r.scene3d?.lightRig, r.sp3d ? r.sp3d.prstMaterial : void 0, i, E), O = b ? Gr(r.sp3d, b.camera, f, p, i, E) : null, k = r.stroke ? r.stroke.width * i / 2 : 0, A = r.sp3d?.contourW ? r.sp3d.contourW * i : 0, j = O ? Math.hypot(O.offsetX, O.offsetY) / E : 0, M = k + A + j + 2, N = (e) => {
|
|
5021
5027
|
if (b) {
|
|
5022
|
-
if (
|
|
5028
|
+
if (Kr(e, b.camera, u, d, f, p, C, {
|
|
5023
5029
|
bevels: D,
|
|
5024
5030
|
extrusion: O ?? void 0,
|
|
5025
5031
|
paintEdges: y,
|
|
5026
5032
|
edgePadCss: M
|
|
5027
5033
|
})) return;
|
|
5028
|
-
} else if (D.length > 0 &&
|
|
5034
|
+
} else if (D.length > 0 && qr(e, u, d, f, p, D, C, y, M)) return;
|
|
5029
5035
|
S(e, u, d, f, p);
|
|
5030
5036
|
}, F = (e, t, n, r, i, a) => {
|
|
5031
5037
|
e.save(), _(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5032
5038
|
}, I = (e, t) => {
|
|
5033
|
-
b &&
|
|
5039
|
+
b && Kr(e, b.camera, u, d, f, p, (e, n, r, i, a) => F(e, t, n, r, i, a)) || F(e, t, u, d, f, p);
|
|
5034
5040
|
}, L = e.canvas.width || 0, R = e.canvas.height || 0, z = e.getTransform(), B = Math.abs(z.a * z.d - z.b * z.c), V = B > 0 ? Math.sqrt(B) : 1, H = {
|
|
5035
5041
|
x: u * V,
|
|
5036
5042
|
y: d * V,
|
|
@@ -5039,24 +5045,24 @@ async function Zr(e, r, i, a) {
|
|
|
5039
5045
|
}, U = i * V, W = (e) => e.setTransform(z), G = L > 0 && R > 0;
|
|
5040
5046
|
r.reflection && G && (e.save(), e.setTransform(new DOMMatrix()), gt(e, (e) => {
|
|
5041
5047
|
W(e), N(e);
|
|
5042
|
-
}, H, r.reflection, U, L, R), e.restore()), r.shadow ?
|
|
5048
|
+
}, H, r.reflection, U, L, R), e.restore()), r.shadow ? br(e, r.shadow, i) : r.glow && xr(e, r.glow, i), r.softEdge && G ? (e.save(), e.setTransform(new DOMMatrix()), ht(e, (e) => {
|
|
5043
5049
|
W(e), N(e);
|
|
5044
5050
|
}, H, r.softEdge, U, L, R, (e) => {
|
|
5045
5051
|
W(e), I(e, "#000");
|
|
5046
|
-
}), e.restore()) : N(e), (r.shadow || r.glow) &&
|
|
5052
|
+
}), e.restore()) : N(e), (r.shadow || r.glow) && Sr(e), r.innerShadow && G && (e.save(), e.setTransform(new DOMMatrix()), mt(e, (e) => {
|
|
5047
5053
|
W(e), I(e, "#000");
|
|
5048
5054
|
}, H, r.innerShadow, U, L, R), e.restore()), e.restore();
|
|
5049
5055
|
} catch {}
|
|
5050
5056
|
}
|
|
5051
|
-
async function
|
|
5052
|
-
let a =
|
|
5057
|
+
async function Zr(e, t, n, r, i) {
|
|
5058
|
+
let a = X(t.x, n), o = X(t.y, n), s = X(t.width, n), c = X(t.height, n), l;
|
|
5053
5059
|
if (t.posterPath && r) try {
|
|
5054
|
-
l = await
|
|
5060
|
+
l = await Yr(t, r);
|
|
5055
5061
|
} catch {}
|
|
5056
|
-
e.save(), ei(e, t, n), l ? e.drawImage(l, a, o, s, c) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), i ||
|
|
5062
|
+
e.save(), ei(e, t, n), l ? e.drawImage(l, a, o, s, c) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), i || Tn(e, a + s / 2, o + c / 2, s, c, "paused"), e.restore();
|
|
5057
5063
|
}
|
|
5058
|
-
function
|
|
5059
|
-
let o = Math.max(.5,
|
|
5064
|
+
function Qr(e, t, n, r, i, a) {
|
|
5065
|
+
let o = Math.max(.5, X(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
|
|
5060
5066
|
if (l === 0) return;
|
|
5061
5067
|
let u = -c / l, d = s / l, f;
|
|
5062
5068
|
switch (i) {
|
|
@@ -5105,19 +5111,19 @@ function $r(e, t, n, r, i, a) {
|
|
|
5105
5111
|
break;
|
|
5106
5112
|
default: return;
|
|
5107
5113
|
}
|
|
5108
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = o + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle =
|
|
5114
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = o + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = Z(r.color);
|
|
5109
5115
|
for (let r of f) {
|
|
5110
5116
|
let i = u * (o * r.offset), a = d * (o * r.offset);
|
|
5111
5117
|
e.lineWidth = Math.max(.5, o * r.widthFrac), e.beginPath(), e.moveTo(t.x + i, t.y + a), e.lineTo(n.x + i, n.y + a), e.stroke();
|
|
5112
5118
|
}
|
|
5113
5119
|
e.restore();
|
|
5114
5120
|
}
|
|
5115
|
-
function $(e, t, n) {
|
|
5121
|
+
function $r(e, t, n) {
|
|
5116
5122
|
je(e, t, n);
|
|
5117
5123
|
}
|
|
5118
5124
|
function ei(e, t, n) {
|
|
5119
5125
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5120
|
-
let r =
|
|
5126
|
+
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5121
5127
|
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));
|
|
5122
5128
|
}
|
|
5123
5129
|
function ti(e, t, n, r, i = {
|
|
@@ -5126,17 +5132,17 @@ function ti(e, t, n, r, i = {
|
|
|
5126
5132
|
dpr: 1
|
|
5127
5133
|
}) {
|
|
5128
5134
|
e.save(), ei(e, t, n);
|
|
5129
|
-
let a =
|
|
5135
|
+
let a = X(t.x, n), o = X(t.y, n), s = t.cols.map((e) => X(e, n)), c = s.length, l = (e, t) => {
|
|
5130
5136
|
let n = 0;
|
|
5131
5137
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
5132
5138
|
return n;
|
|
5133
|
-
}, d = t.rows.map((e) =>
|
|
5139
|
+
}, d = t.rows.map((e) => X(e.height, n));
|
|
5134
5140
|
for (let a = 0; a < t.rows.length; a++) {
|
|
5135
5141
|
let o = t.rows[a];
|
|
5136
5142
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5137
5143
|
let s = o.cells[t];
|
|
5138
5144
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5139
|
-
let c = l(t, s.gridSpan || 1), u =
|
|
5145
|
+
let c = l(t, s.gridSpan || 1), u = Ur(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
5140
5146
|
u > d[a] && (d[a] = u);
|
|
5141
5147
|
}
|
|
5142
5148
|
}
|
|
@@ -5147,7 +5153,7 @@ function ti(e, t, n, r, i = {
|
|
|
5147
5153
|
if (s.hMerge || s.vMerge) continue;
|
|
5148
5154
|
let c = s.rowSpan || 1;
|
|
5149
5155
|
if (c <= 1 || !s.textBody) continue;
|
|
5150
|
-
let u = l(t, s.gridSpan || 1), f =
|
|
5156
|
+
let u = l(t, s.gridSpan || 1), f = Ur(e, s.textBody, 0, 0, u, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
5151
5157
|
for (let e = 0; e < c && a + e < d.length; e++) p += d[a + e];
|
|
5152
5158
|
if (f > p) {
|
|
5153
5159
|
let e = (f - p) / c;
|
|
@@ -5192,10 +5198,10 @@ function ti(e, t, n, r, i = {
|
|
|
5192
5198
|
}
|
|
5193
5199
|
}
|
|
5194
5200
|
for (let { cell: t, colX: a, rowY: o, cellW: s, cellH: c } of g) {
|
|
5195
|
-
let l =
|
|
5201
|
+
let l = qn(t.fill);
|
|
5196
5202
|
if (l && (e.fillStyle = l, e.fillRect(a, o, s, c)), t.textBody) {
|
|
5197
|
-
let l = t.textColor ?
|
|
5198
|
-
|
|
5203
|
+
let l = t.textColor ? Z(t.textColor) : null;
|
|
5204
|
+
Ur(e, t.textBody, a, o, s, c, n, l, 0, !1, !1, "#000000", r, i);
|
|
5199
5205
|
}
|
|
5200
5206
|
}
|
|
5201
5207
|
let v = i.dpr, y = (e, t) => {
|
|
@@ -5203,7 +5209,7 @@ function ti(e, t, n, r, i = {
|
|
|
5203
5209
|
let n = _[e][t];
|
|
5204
5210
|
return n < 0 ? null : g[n];
|
|
5205
5211
|
}, b = (t, r, i, a, o) => {
|
|
5206
|
-
$(e, t, n);
|
|
5212
|
+
$r(e, t, n);
|
|
5207
5213
|
let s = r === a ? u(r, e.lineWidth, v) : 0, c = i === o ? u(i, e.lineWidth, v) : 0;
|
|
5208
5214
|
e.beginPath(), e.moveTo(r + s, i + c), e.lineTo(a + s, o + c), e.stroke();
|
|
5209
5215
|
};
|
|
@@ -5219,7 +5225,7 @@ function ti(e, t, n, r, i = {
|
|
|
5219
5225
|
for (; a < n;) {
|
|
5220
5226
|
let r = _[e][a], o = a + 1;
|
|
5221
5227
|
for (; o < n && _[e][o] === r;) o++;
|
|
5222
|
-
let s = y(e, a), c =
|
|
5228
|
+
let s = y(e, a), c = Fn(i.borderB, s ? s.cell.borderT : null);
|
|
5223
5229
|
if (c) {
|
|
5224
5230
|
let e = m(a, o - a);
|
|
5225
5231
|
b(c, e, t, e + l(a, o - a), t);
|
|
@@ -5235,11 +5241,11 @@ function ti(e, t, n, r, i = {
|
|
|
5235
5241
|
for (; t <= r.lastRi;) {
|
|
5236
5242
|
let n = _[t][x], i = t;
|
|
5237
5243
|
for (; i + 1 <= r.lastRi && _[i + 1][x] === n;) i++;
|
|
5238
|
-
let a = y(t, x), o =
|
|
5244
|
+
let a = y(t, x), o = Fn(p, a ? S(a.cell) : null);
|
|
5239
5245
|
o && b(o, e, h[t], e, h[i] + d[i]), t = i + 1;
|
|
5240
5246
|
}
|
|
5241
5247
|
}
|
|
5242
|
-
i.diagonalTL && ($(e, i.diagonalTL, n), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + u), e.stroke()), i.diagonalTR && ($(e, i.diagonalTR, n), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + u), e.stroke()), e.restore();
|
|
5248
|
+
i.diagonalTL && ($r(e, i.diagonalTL, n), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + u), e.stroke()), i.diagonalTR && ($r(e, i.diagonalTR, n), e.beginPath(), e.moveTo(a + s, o), e.lineTo(a, o + u), e.stroke()), e.restore();
|
|
5243
5249
|
}
|
|
5244
5250
|
e.restore();
|
|
5245
5251
|
}
|
|
@@ -5288,9 +5294,9 @@ async function oi(e, t, r, i, a = {}, o) {
|
|
|
5288
5294
|
themeMinorFont: a.minorFont ?? null,
|
|
5289
5295
|
themeHlinkColor: a.hlinkColor ?? null,
|
|
5290
5296
|
dpr: h,
|
|
5291
|
-
smartArtFallbackTextColor:
|
|
5297
|
+
smartArtFallbackTextColor: zn(t.background, v)
|
|
5292
5298
|
};
|
|
5293
|
-
if (await
|
|
5299
|
+
if (await gr(_, t.background, d, f, u, a.fetchImage), c() || (a.math && await tr(t, a.math), c())) return e;
|
|
5294
5300
|
let b = t.slideNumber;
|
|
5295
5301
|
for (let e of t.elements) if (e.type === "picture" && a.fetchImage) {
|
|
5296
5302
|
let t = e, r = t.mimeType === "image/svg+xml";
|
|
@@ -5305,12 +5311,12 @@ async function oi(e, t, r, i, a = {}, o) {
|
|
|
5305
5311
|
}
|
|
5306
5312
|
} else if (e.type === "media") {
|
|
5307
5313
|
let t = e;
|
|
5308
|
-
t.posterPath && a.fetchMedia &&
|
|
5314
|
+
t.posterPath && a.fetchMedia && Yr(t, a.fetchMedia).catch(() => void 0);
|
|
5309
5315
|
}
|
|
5310
5316
|
if (a.fetchImage) {
|
|
5311
5317
|
let n = a.fetchImage, r = /* @__PURE__ */ new Set();
|
|
5312
5318
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5313
|
-
let e =
|
|
5319
|
+
let e = Cn(t.bullet);
|
|
5314
5320
|
e.type === "blip" && r.add(`${e.imagePath} ${e.mimeType}`);
|
|
5315
5321
|
}
|
|
5316
5322
|
if (r.size > 0 && (await Promise.all([...r].map((e) => {
|
|
@@ -5320,17 +5326,17 @@ async function oi(e, t, r, i, a = {}, o) {
|
|
|
5320
5326
|
}
|
|
5321
5327
|
for (let r of t.elements) {
|
|
5322
5328
|
if (c()) return e;
|
|
5323
|
-
if (r.type === "shape")
|
|
5324
|
-
else if (r.type === "picture") await
|
|
5329
|
+
if (r.type === "shape") Lr(_, r, u, v, b, y, o, a.fetchImage);
|
|
5330
|
+
else if (r.type === "picture") await Xr(_, r, u, a.fetchImage);
|
|
5325
5331
|
else if (r.type === "table") ti(_, r, u, b, y);
|
|
5326
|
-
else if (r.type === "media") await
|
|
5332
|
+
else if (r.type === "media") await Zr(_, r, u, a.fetchMedia, a.skipMediaControls);
|
|
5327
5333
|
else if (r.type === "chart") {
|
|
5328
5334
|
let e = n * u;
|
|
5329
5335
|
_.save(), ei(_, r, u), Ee(_, r.chart, {
|
|
5330
|
-
x:
|
|
5331
|
-
y:
|
|
5332
|
-
w:
|
|
5333
|
-
h:
|
|
5336
|
+
x: X(r.x, u),
|
|
5337
|
+
y: X(r.y, u),
|
|
5338
|
+
w: X(r.width, u),
|
|
5339
|
+
h: X(r.height, u)
|
|
5334
5340
|
}, e), _.restore();
|
|
5335
5341
|
}
|
|
5336
5342
|
}
|
|
@@ -5372,64 +5378,91 @@ async function fi(e, t, n) {
|
|
|
5372
5378
|
let o = a.getContext("2d");
|
|
5373
5379
|
if (!o) throw Error("base 2D context not available");
|
|
5374
5380
|
o.drawImage(e, 0, 0);
|
|
5375
|
-
let s = []
|
|
5381
|
+
let s = [], c = [], l = !1, u = (e) => {
|
|
5382
|
+
l || (n.onError ? n.onError(e) : console.error("[ooxml] PPTX embedded media failed:", e));
|
|
5383
|
+
};
|
|
5384
|
+
if (t.length > 0) {
|
|
5385
|
+
r.save(), r.setTransform(n.dpr, 0, 0, n.dpr, 0, 0);
|
|
5386
|
+
for (let e of t) mi(r, pi(e, i), "Loading media…");
|
|
5387
|
+
r.restore();
|
|
5388
|
+
}
|
|
5376
5389
|
for (let e of t) {
|
|
5377
5390
|
let t;
|
|
5378
5391
|
try {
|
|
5379
5392
|
t = await n.fetchMedia(e.mediaPath);
|
|
5380
|
-
} catch {
|
|
5393
|
+
} catch (t) {
|
|
5394
|
+
u(hi(e, t)), c.push(pi(e, i));
|
|
5381
5395
|
continue;
|
|
5382
5396
|
}
|
|
5383
|
-
let r = e.mimeType || t.type, a = t.type === r ? t : new Blob([t], { type: r }), o = URL.createObjectURL(a),
|
|
5384
|
-
|
|
5385
|
-
let
|
|
5386
|
-
x: di(e.x, i),
|
|
5387
|
-
y: di(e.y, i),
|
|
5388
|
-
w: di(e.width, i),
|
|
5389
|
-
h: di(e.height, i)
|
|
5390
|
-
}, u = e.mediaKind === "audio" ? {
|
|
5391
|
-
x: l.x + l.w / 2 - Math.max(l.w, 260) / 2,
|
|
5392
|
-
y: l.y,
|
|
5393
|
-
w: Math.max(l.w, 260),
|
|
5394
|
-
h: l.h + 36
|
|
5395
|
-
} : l;
|
|
5396
|
-
s.push({
|
|
5397
|
+
let r = e.mimeType || t.type, a = t.type === r ? t : new Blob([t], { type: r }), o = URL.createObjectURL(a), d = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
|
|
5398
|
+
d.src = o, d.preload = "metadata", e.mediaKind === "video" && (d.playsInline = !0);
|
|
5399
|
+
let f = pi(e, i), p = {
|
|
5397
5400
|
el: e,
|
|
5398
|
-
rect:
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5401
|
+
rect: e.mediaKind === "audio" ? {
|
|
5402
|
+
x: f.x + f.w / 2 - Math.max(f.w, 260) / 2,
|
|
5403
|
+
y: f.y,
|
|
5404
|
+
w: Math.max(f.w, 260),
|
|
5405
|
+
h: f.h + 36
|
|
5406
|
+
} : f,
|
|
5407
|
+
posterRect: f,
|
|
5408
|
+
media: d,
|
|
5409
|
+
objectUrl: o,
|
|
5410
|
+
loadState: "loading",
|
|
5411
|
+
detachListeners: () => {}
|
|
5412
|
+
}, m = () => {
|
|
5413
|
+
l || (p.loadState = "metadata");
|
|
5414
|
+
}, h = () => {
|
|
5415
|
+
l || (p.loadState = "ready");
|
|
5416
|
+
}, g = () => {
|
|
5417
|
+
l || (p.loadState = "error", u(gi(e, d, "decode")));
|
|
5418
|
+
};
|
|
5419
|
+
d.addEventListener("loadedmetadata", m), d.addEventListener("canplay", h), d.addEventListener("error", g), p.detachListeners = () => {
|
|
5420
|
+
d.removeEventListener("loadedmetadata", m), d.removeEventListener("canplay", h), d.removeEventListener("error", g);
|
|
5421
|
+
}, s.push(p);
|
|
5422
|
+
try {
|
|
5423
|
+
d.load();
|
|
5424
|
+
} catch (t) {
|
|
5425
|
+
p.loadState = "error", u(gi(e, d, "load", t));
|
|
5426
|
+
}
|
|
5403
5427
|
}
|
|
5404
|
-
let
|
|
5428
|
+
let d = null, f = null, p = () => {
|
|
5405
5429
|
r.setTransform(n.dpr, 0, 0, n.dpr, 0, 0);
|
|
5406
5430
|
let t = e.width / n.dpr, i = e.height / n.dpr;
|
|
5407
5431
|
r.drawImage(a, 0, 0, e.width, e.height, 0, 0, t, i);
|
|
5432
|
+
for (let e of c) mi(r, e, "Media unavailable");
|
|
5408
5433
|
for (let e of s) {
|
|
5409
5434
|
let t = e.media;
|
|
5435
|
+
if (e.loadState === "loading") {
|
|
5436
|
+
mi(r, e.posterRect, "Loading media…");
|
|
5437
|
+
continue;
|
|
5438
|
+
}
|
|
5439
|
+
if (e.loadState === "error") {
|
|
5440
|
+
mi(r, e.posterRect, "Media unavailable");
|
|
5441
|
+
continue;
|
|
5442
|
+
}
|
|
5410
5443
|
if (e.el.mediaKind === "video" && t.readyState >= 2) {
|
|
5411
5444
|
let { x: n, y: i, w: a, h: o } = e.posterRect;
|
|
5412
5445
|
r.drawImage(t, n, i, a, o);
|
|
5413
5446
|
}
|
|
5414
|
-
if (e ===
|
|
5447
|
+
if (e === f || _?.state === e) Ci(r, e, t);
|
|
5415
5448
|
else if (t.paused) {
|
|
5416
5449
|
let { x: t, y: n, w: i, h: a } = e.posterRect;
|
|
5417
|
-
|
|
5450
|
+
Tn(r, t + i / 2, n + a / 2, i, a, "paused");
|
|
5418
5451
|
}
|
|
5419
5452
|
}
|
|
5420
|
-
},
|
|
5421
|
-
l || (
|
|
5422
|
-
},
|
|
5453
|
+
}, m = () => {
|
|
5454
|
+
l || (p(), d = requestAnimationFrame(m));
|
|
5455
|
+
}, h = (t, r) => {
|
|
5423
5456
|
let i = e.getBoundingClientRect(), a = e.width / n.dpr, o = e.height / n.dpr;
|
|
5424
5457
|
return {
|
|
5425
5458
|
x: (t - i.left) / i.width * a,
|
|
5426
5459
|
y: (r - i.top) / i.height * o
|
|
5427
5460
|
};
|
|
5428
|
-
},
|
|
5461
|
+
}, g = (e, t) => {
|
|
5429
5462
|
for (let n of s) {
|
|
5430
5463
|
let { x: r, y: i, w: a, h: o } = n.rect;
|
|
5431
5464
|
if (e < r || e > r + a || t < i || t > i + o) continue;
|
|
5432
|
-
let s =
|
|
5465
|
+
let s = ki(n), c = s.y - 12, l = s.y + s.h + 8;
|
|
5433
5466
|
return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
|
|
5434
5467
|
kind: "seek",
|
|
5435
5468
|
state: n,
|
|
@@ -5440,131 +5473,174 @@ async function fi(e, t, n) {
|
|
|
5440
5473
|
};
|
|
5441
5474
|
}
|
|
5442
5475
|
return null;
|
|
5443
|
-
},
|
|
5476
|
+
}, _ = null, v = (e, t) => {
|
|
5444
5477
|
let n = Number.isFinite(e.media.duration) ? e.media.duration : 0;
|
|
5445
5478
|
n <= 0 || (e.media.currentTime = n * t);
|
|
5446
|
-
},
|
|
5447
|
-
|
|
5448
|
-
|
|
5479
|
+
}, y = (e) => {
|
|
5480
|
+
try {
|
|
5481
|
+
e.media.play().catch((t) => {
|
|
5482
|
+
u(gi(e.el, e.media, "play", t));
|
|
5483
|
+
});
|
|
5484
|
+
} catch (t) {
|
|
5485
|
+
u(gi(e.el, e.media, "play", t));
|
|
5486
|
+
}
|
|
5487
|
+
}, b = (t) => {
|
|
5488
|
+
let { x: n, y: r } = h(t.clientX, t.clientY), i = g(n, r);
|
|
5489
|
+
i && (i.kind === "seek" ? (_ = {
|
|
5449
5490
|
state: i.state,
|
|
5450
5491
|
wasPlaying: !i.state.media.paused
|
|
5451
|
-
}, i.state.media.pause(),
|
|
5452
|
-
},
|
|
5453
|
-
let { x: t, y: n } =
|
|
5454
|
-
|
|
5492
|
+
}, i.state.media.pause(), v(i.state, i.fraction), e.setPointerCapture(t.pointerId), t.preventDefault()) : i.state.media.paused ? y(i.state) : i.state.media.pause());
|
|
5493
|
+
}, x = (e) => {
|
|
5494
|
+
let { x: t, y: n } = h(e.clientX, e.clientY);
|
|
5495
|
+
f = null;
|
|
5455
5496
|
for (let e of s) {
|
|
5456
5497
|
let { x: r, y: i, w: a, h: o } = e.rect;
|
|
5457
5498
|
if (t >= r && t <= r + a && n >= i && n <= i + o) {
|
|
5458
|
-
|
|
5499
|
+
f = e;
|
|
5459
5500
|
break;
|
|
5460
5501
|
}
|
|
5461
5502
|
}
|
|
5462
|
-
if (
|
|
5463
|
-
let e =
|
|
5464
|
-
|
|
5503
|
+
if (_) {
|
|
5504
|
+
let e = ki(_.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
|
|
5505
|
+
v(_.state, n);
|
|
5465
5506
|
}
|
|
5466
|
-
},
|
|
5467
|
-
|
|
5468
|
-
},
|
|
5469
|
-
if (!
|
|
5470
|
-
let { wasPlaying: n, state: r } =
|
|
5471
|
-
|
|
5507
|
+
}, S = () => {
|
|
5508
|
+
f = null;
|
|
5509
|
+
}, C = (t) => {
|
|
5510
|
+
if (!_) return;
|
|
5511
|
+
let { wasPlaying: n, state: r } = _;
|
|
5512
|
+
_ = null, e.releasePointerCapture(t.pointerId), n && y(r);
|
|
5472
5513
|
};
|
|
5473
|
-
return s.length > 0
|
|
5514
|
+
return s.length > 0 ? (e.addEventListener("pointerdown", b), e.addEventListener("pointermove", x), e.addEventListener("pointerleave", S), e.addEventListener("pointerup", C), e.addEventListener("pointercancel", C), e.style.cursor = "pointer", m()) : c.length > 0 && p(), {
|
|
5474
5515
|
play(e) {
|
|
5475
|
-
for (let t of s) (!e || t.el.mediaPath === e) && t
|
|
5516
|
+
for (let t of s) (!e || t.el.mediaPath === e) && y(t);
|
|
5476
5517
|
},
|
|
5477
5518
|
pause(e) {
|
|
5478
5519
|
for (let t of s) (!e || t.el.mediaPath === e) && t.media.pause();
|
|
5479
5520
|
},
|
|
5480
5521
|
destroy() {
|
|
5481
5522
|
if (!l) {
|
|
5482
|
-
l = !0,
|
|
5483
|
-
for (let e of s) e.media.pause(), e.media.removeAttribute("src"), e.media.load(), URL.revokeObjectURL(e.objectUrl);
|
|
5523
|
+
l = !0, d !== null && cancelAnimationFrame(d), e.removeEventListener("pointerdown", b), e.removeEventListener("pointermove", x), e.removeEventListener("pointerleave", S), e.removeEventListener("pointerup", C), e.removeEventListener("pointercancel", C), e.style.cursor = "";
|
|
5524
|
+
for (let e of s) e.detachListeners(), e.media.pause(), e.media.removeAttribute("src"), e.media.load(), URL.revokeObjectURL(e.objectUrl);
|
|
5484
5525
|
}
|
|
5485
5526
|
}
|
|
5486
5527
|
};
|
|
5487
5528
|
}
|
|
5488
|
-
|
|
5489
|
-
|
|
5529
|
+
function pi(e, t) {
|
|
5530
|
+
return {
|
|
5531
|
+
x: di(e.x, t),
|
|
5532
|
+
y: di(e.y, t),
|
|
5533
|
+
w: di(e.width, t),
|
|
5534
|
+
h: di(e.height, t)
|
|
5535
|
+
};
|
|
5536
|
+
}
|
|
5537
|
+
function mi(e, t, n) {
|
|
5538
|
+
let r = Math.max(10, Math.min(14, t.h * .12));
|
|
5539
|
+
e.save(), e.font = `500 ${r}px system-ui, -apple-system, sans-serif`, e.textAlign = "center", e.textBaseline = "middle";
|
|
5540
|
+
let i = r + 12, a = Math.min(t.w, Math.max(100, e.measureText(n).width + 24));
|
|
5541
|
+
Ai(e, t.x + (t.w - a) / 2, t.y + (t.h - i) / 2, a, i, i / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.fillStyle = "rgba(255, 255, 255, 0.95)", e.fillText(n, t.x + t.w / 2, t.y + t.h / 2), e.restore();
|
|
5542
|
+
}
|
|
5543
|
+
function hi(e, t) {
|
|
5544
|
+
return /* @__PURE__ */ Error(`Embedded ${e.mediaKind} fetch failed for "${e.mediaPath}" (mime=${e.mimeType || "unknown"}): ${_i(t)}`);
|
|
5545
|
+
}
|
|
5546
|
+
function gi(e, t, n, r) {
|
|
5547
|
+
let i = "";
|
|
5548
|
+
try {
|
|
5549
|
+
i = e.mimeType ? t.canPlayType(e.mimeType) : "";
|
|
5550
|
+
} catch {}
|
|
5551
|
+
let a = t.error, o = [
|
|
5552
|
+
`mime=${e.mimeType || "unknown"}`,
|
|
5553
|
+
`canPlayType=${i || "no"}`,
|
|
5554
|
+
`readyState=${t.readyState}`,
|
|
5555
|
+
`networkState=${t.networkState}`
|
|
5556
|
+
];
|
|
5557
|
+
a && o.push(`mediaError=${a.code}${a.message ? ` ${a.message}` : ""}`);
|
|
5558
|
+
let s = r === void 0 ? "" : `: ${_i(r)}`;
|
|
5559
|
+
return /* @__PURE__ */ Error(`Embedded ${e.mediaKind} ${n} failed for "${e.mediaPath}" (${o.join("; ")})${s}`);
|
|
5560
|
+
}
|
|
5561
|
+
function _i(e) {
|
|
5562
|
+
return e instanceof Error ? `${e.name || "Error"}${e.message ? `: ${e.message}` : ""}` : String(e);
|
|
5563
|
+
}
|
|
5564
|
+
var vi = 28, yi = 14, bi = 72, xi = 10, Si = 3;
|
|
5565
|
+
function Ci(e, t, n) {
|
|
5490
5566
|
let r = Number.isFinite(n.duration) ? n.duration : 0, i = r > 0 ? Math.min(1, n.currentTime / r) : 0, a = t.posterRect;
|
|
5491
|
-
|
|
5567
|
+
Tn(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? Ti(e, t, n, r, i) : wi(e, t, n, r, i);
|
|
5492
5568
|
}
|
|
5493
|
-
function
|
|
5569
|
+
function wi(e, t, n, r, i) {
|
|
5494
5570
|
let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
|
|
5495
5571
|
e.save();
|
|
5496
5572
|
let d = e.createLinearGradient(0, u, 0, o + c);
|
|
5497
5573
|
d.addColorStop(0, "rgba(0, 0, 0, 0)"), d.addColorStop(1, "rgba(0, 0, 0, 0.55)"), e.fillStyle = d, e.fillRect(a, u, s, l), e.restore();
|
|
5498
|
-
let f =
|
|
5499
|
-
|
|
5574
|
+
let f = ki(t);
|
|
5575
|
+
Di(e, f, i, r > 0), e.save(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.shadowColor = "rgba(0, 0, 0, 0.75)", e.shadowBlur = 3, e.fillStyle = "rgba(255, 255, 255, 0.95)", Ei(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
|
|
5500
5576
|
}
|
|
5501
|
-
function
|
|
5502
|
-
let a =
|
|
5503
|
-
e.save(),
|
|
5577
|
+
function Ti(e, t, n, r, i) {
|
|
5578
|
+
let a = Oi(t.rect);
|
|
5579
|
+
e.save(), Ai(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)", Ei(e, n.currentTime, r, a.x + yi, a.y + a.h / 2, "middle"), e.restore(), Di(e, ki(t), i, r > 0);
|
|
5504
5580
|
}
|
|
5505
|
-
function
|
|
5506
|
-
let o =
|
|
5581
|
+
function Ei(e, t, n, r, i, a) {
|
|
5582
|
+
let o = ji(t), s = ji(n), c = ci(e), l = li(e, o, c), u = li(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
|
|
5507
5583
|
ui(e, o, r + f - l, i, c);
|
|
5508
5584
|
let p = e.textAlign;
|
|
5509
5585
|
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, ui(e, s, r + f + d, i, c);
|
|
5510
5586
|
}
|
|
5511
|
-
function
|
|
5587
|
+
function Di(e, t, n, r) {
|
|
5512
5588
|
let i = t.h / 2;
|
|
5513
|
-
if (e.save(),
|
|
5589
|
+
if (e.save(), Ai(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (Ai(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
|
|
5514
5590
|
let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
|
|
5515
5591
|
e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = 3, e.fillStyle = "#fff", e.beginPath(), e.arc(r, t.y + t.h / 2, 5, 0, Math.PI * 2), e.fill();
|
|
5516
5592
|
}
|
|
5517
5593
|
e.restore();
|
|
5518
5594
|
}
|
|
5519
|
-
function
|
|
5595
|
+
function Oi(e) {
|
|
5520
5596
|
let t = Math.max(220, e.w - 24);
|
|
5521
5597
|
return {
|
|
5522
5598
|
x: e.x + e.w / 2 - t / 2,
|
|
5523
|
-
y: e.y + e.h -
|
|
5599
|
+
y: e.y + e.h - vi - 4,
|
|
5524
5600
|
w: t,
|
|
5525
|
-
h:
|
|
5601
|
+
h: vi
|
|
5526
5602
|
};
|
|
5527
5603
|
}
|
|
5528
|
-
function
|
|
5604
|
+
function ki(e) {
|
|
5529
5605
|
if (e.el.mediaKind === "audio") {
|
|
5530
|
-
let t =
|
|
5606
|
+
let t = Oi(e.rect), n = t.x + yi + bi + xi, r = Math.max(40, t.x + t.w - yi - n);
|
|
5531
5607
|
return {
|
|
5532
5608
|
x: n,
|
|
5533
|
-
y: t.y + (t.h -
|
|
5609
|
+
y: t.y + (t.h - Si) / 2,
|
|
5534
5610
|
w: r,
|
|
5535
|
-
h:
|
|
5611
|
+
h: Si
|
|
5536
5612
|
};
|
|
5537
5613
|
}
|
|
5538
5614
|
let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
|
|
5539
5615
|
return {
|
|
5540
5616
|
x: t.x + n,
|
|
5541
|
-
y: t.y + t.h -
|
|
5617
|
+
y: t.y + t.h - Si - r,
|
|
5542
5618
|
w: t.w - n * 2,
|
|
5543
|
-
h:
|
|
5619
|
+
h: Si
|
|
5544
5620
|
};
|
|
5545
5621
|
}
|
|
5546
|
-
function
|
|
5622
|
+
function Ai(e, t, n, r, i, a) {
|
|
5547
5623
|
let o = Math.min(a, i / 2, r / 2);
|
|
5548
5624
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
|
|
5549
5625
|
}
|
|
5550
|
-
function
|
|
5626
|
+
function ji(e) {
|
|
5551
5627
|
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
5552
5628
|
let t = Math.floor(e);
|
|
5553
5629
|
return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
|
|
5554
5630
|
}
|
|
5555
5631
|
//#endregion
|
|
5556
5632
|
//#region packages/pptx/src/notes.ts
|
|
5557
|
-
function
|
|
5633
|
+
function Mi(e, t) {
|
|
5558
5634
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? null : e[t].notes ?? null;
|
|
5559
5635
|
}
|
|
5560
5636
|
//#endregion
|
|
5561
5637
|
//#region packages/pptx/src/hidden.ts
|
|
5562
|
-
function
|
|
5638
|
+
function Ni(e, t) {
|
|
5563
5639
|
return !Number.isInteger(t) || t < 0 || t >= e.length ? !1 : e[t].hidden ?? !1;
|
|
5564
5640
|
}
|
|
5565
5641
|
//#endregion
|
|
5566
5642
|
//#region packages/pptx/src/slide-nav.ts
|
|
5567
|
-
function
|
|
5643
|
+
function Pi(e) {
|
|
5568
5644
|
let t = /* @__PURE__ */ new Map();
|
|
5569
5645
|
for (let n = 0; n < e.length; n++) {
|
|
5570
5646
|
let r = e[n];
|
|
@@ -5572,44 +5648,44 @@ function ki(e) {
|
|
|
5572
5648
|
}
|
|
5573
5649
|
return t;
|
|
5574
5650
|
}
|
|
5575
|
-
function
|
|
5651
|
+
function Fi(e, t) {
|
|
5576
5652
|
if (e === "") return;
|
|
5577
5653
|
let n = vn("ppt/slides", e);
|
|
5578
5654
|
return t.get(n);
|
|
5579
5655
|
}
|
|
5580
|
-
function
|
|
5656
|
+
function Ii(e, t, n) {
|
|
5581
5657
|
let r = yn(e);
|
|
5582
|
-
return r === null ?
|
|
5658
|
+
return r === null ? Fi(e, t) : bn(r, n, t.size);
|
|
5583
5659
|
}
|
|
5584
5660
|
//#endregion
|
|
5585
5661
|
//#region packages/pptx/src/google-fonts.ts
|
|
5586
|
-
var
|
|
5662
|
+
var Li = {
|
|
5587
5663
|
...i,
|
|
5588
5664
|
...l
|
|
5589
5665
|
};
|
|
5590
|
-
function*
|
|
5666
|
+
function* Ri(e) {
|
|
5591
5667
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
5592
5668
|
}
|
|
5593
|
-
function*
|
|
5594
|
-
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield*
|
|
5595
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield*
|
|
5669
|
+
function* zi(e) {
|
|
5670
|
+
for (let t of e.slides) for (let e of t.elements) if (e.type === "shape") yield* Ri(e.textBody);
|
|
5671
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t.cells) yield* Ri(e.textBody);
|
|
5596
5672
|
else if (e.type === "chart") {
|
|
5597
5673
|
e.chart.title && (yield e.chart.title);
|
|
5598
5674
|
for (let t of e.chart.categories) yield t;
|
|
5599
5675
|
for (let t of e.chart.series) t.name && (yield t.name);
|
|
5600
5676
|
}
|
|
5601
5677
|
}
|
|
5602
|
-
function
|
|
5678
|
+
function Bi(e) {
|
|
5603
5679
|
let t = v(e.majorFont) ?? v(e.minorFont) ?? null;
|
|
5604
5680
|
return [
|
|
5605
5681
|
e.majorFont,
|
|
5606
5682
|
e.minorFont,
|
|
5607
|
-
...Me(
|
|
5683
|
+
...Me(zi(e), t)
|
|
5608
5684
|
];
|
|
5609
5685
|
}
|
|
5610
5686
|
//#endregion
|
|
5611
5687
|
//#region packages/pptx/src/media-mime.ts
|
|
5612
|
-
function
|
|
5688
|
+
function Vi(e, t) {
|
|
5613
5689
|
for (let n of e.slides) for (let e of n.elements) {
|
|
5614
5690
|
if (e.type !== "media") continue;
|
|
5615
5691
|
let n = e;
|
|
@@ -5620,11 +5696,11 @@ function Ii(e, t) {
|
|
|
5620
5696
|
}
|
|
5621
5697
|
//#endregion
|
|
5622
5698
|
//#region packages/pptx/src/worker.ts?worker&inline
|
|
5623
|
-
var
|
|
5624
|
-
function
|
|
5699
|
+
var Hi = "function e(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var t=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function n(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}var r=class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw n(e)?(this._poison(),new t(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}},i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,o.unregister(this),e}free(){let e=this.__destroy_into_raw();S.__wbg_pptxarchive_free(e,0)}extract_image(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}extract_media(e){let t=h(e,S.__wbindgen_malloc,S.__wbindgen_realloc),n=x,r=S.pptxarchive_extract_media(this.__wbg_ptr,t,n);if(r[3])throw g(r[2]);var i=s(r[0],r[1]).slice();return S.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t){let n=m(e,S.__wbindgen_malloc),r=x,i=S.pptxarchive_new(n,r,!p(t),p(t)?BigInt(0):t);if(i[2])throw g(i[1]);return this.__wbg_ptr=i[0]>>>0,o.register(this,this.__wbg_ptr,this),this}parse(){let e=S.pptxarchive_parse(this.__wbg_ptr);if(e[3])throw g(e[2]);var t=s(e[0],e[1]).slice();return S.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=S.pptxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,g(i[2]);return e=n,t=r,u(n,r)}finally{S.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);function a(){return{__proto__:null,\"./pptx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(u(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(u(e,t))}finally{S.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=h(n,S.__wbindgen_malloc,S.__wbindgen_realloc),i=x;l().setInt32(e+4,i,!0),l().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return u(e,t)},__wbindgen_init_externref_table:function(){let e=S.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const o=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>S.__wbg_pptxarchive_free(e>>>0,1));function s(e,t){return e>>>=0,f().subarray(e/1,e/1+t)}let c=null;function l(){return(c===null||c.buffer.detached===!0||c.buffer.detached===void 0&&c.buffer!==S.memory.buffer)&&(c=new DataView(S.memory.buffer)),c}function u(e,t){return e>>>=0,y(e,t)}let d=null;function f(){return(d===null||d.byteLength===0)&&(d=new Uint8Array(S.memory.buffer)),d}function p(e){return e==null}function m(e,t){let n=t(e.length*1,1)>>>0;return f().set(e,n/1),x=e.length,n}function h(e,t,n){if(n===void 0){let n=b.encode(e),r=t(n.length,1)>>>0;return f().subarray(r,r+n.length).set(n),x=n.length,r}let r=e.length,i=t(r,1)>>>0,a=f(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=f().subarray(i+o,i+r),a=b.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return x=o,i}function g(e){let t=S.__wbindgen_externrefs.get(e);return S.__externref_table_dealloc(e),t}let _=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});_.decode();let v=0;function y(e,t){return v+=t,v>=2146435072&&(_=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),_.decode(),v=t),_.decode(f().subarray(e,e+t))}const b=new TextEncoder;`encodeInto`in b||(b.encodeInto=function(e,t){let n=b.encode(e);return t.set(n),{read:e.length,written:n.length}});let x=0,S;function C(e,t){return S=e.exports,c=null,d=null,S.__wbindgen_start(),S}async function w(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function T(e){if(S!==void 0)return S;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=a();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await w(await e,t);return C(n,r)}async function E(e){return S=void 0,c=null,d=null,T(e)}const D=new r(T,{freeArchive:e=>e.free(),reinit:E});self.onmessage=async t=>{let n=t.data;if(n.kind===`init`){D.setWasmUrl(e(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await D.ensureReady(),n.kind===`parse`){let e=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,t=new Uint8Array(n.buffer),a=D.run(()=>{let n=new i(t,e);return D.setArchive(n),n.parse()}).buffer,o={kind:`parsed`,id:r,presentationJson:a};self.postMessage(o,[a]);return}let e=D.archive;if(n.kind===`extractMedia`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_media(n.path).buffer),i={kind:`mediaExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`extractImage`){if(!e)throw Error(`No pptx loaded`);let t=D.run(()=>e.extract_image(n.path).buffer),i={kind:`imageExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.kind===`toMarkdown`){if(!e)throw Error(`No pptx loaded`);let t={kind:`markdownRendered`,id:r,markdown:D.run(()=>e.to_markdown())};self.postMessage(t);return}}catch(e){let t={kind:`error`,id:r,message:e instanceof Error?e.message:String(e)};self.postMessage(t)}};", Ui = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Hi], { type: "text/javascript;charset=utf-8" });
|
|
5700
|
+
function Wi(e) {
|
|
5625
5701
|
let t;
|
|
5626
5702
|
try {
|
|
5627
|
-
if (t =
|
|
5703
|
+
if (t = Ui && (self.URL || self.webkitURL).createObjectURL(Ui), !t) throw "";
|
|
5628
5704
|
let n = new Worker(t, {
|
|
5629
5705
|
type: "module",
|
|
5630
5706
|
name: e?.name
|
|
@@ -5633,7 +5709,7 @@ function zi(e) {
|
|
|
5633
5709
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
5634
5710
|
}), n;
|
|
5635
5711
|
} catch {
|
|
5636
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
5712
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Hi), {
|
|
5637
5713
|
type: "module",
|
|
5638
5714
|
name: e?.name
|
|
5639
5715
|
});
|
|
@@ -5641,7 +5717,7 @@ function zi(e) {
|
|
|
5641
5717
|
}
|
|
5642
5718
|
//#endregion
|
|
5643
5719
|
//#region packages/pptx/src/wasm/pptx_parser_bg.wasm?url
|
|
5644
|
-
var
|
|
5720
|
+
var Gi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Ki = class e {
|
|
5645
5721
|
_worker;
|
|
5646
5722
|
_bridge;
|
|
5647
5723
|
_mode = "main";
|
|
@@ -5658,7 +5734,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5658
5734
|
correlate: (e) => e.id,
|
|
5659
5735
|
toError: (e) => e.kind === "error" ? e.message : void 0
|
|
5660
5736
|
});
|
|
5661
|
-
let r = new URL(n ??
|
|
5737
|
+
let r = new URL(n ?? Gi, location.href).href;
|
|
5662
5738
|
this._bridge.post({
|
|
5663
5739
|
kind: "init",
|
|
5664
5740
|
wasmUrl: r
|
|
@@ -5674,8 +5750,8 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5674
5750
|
i = await e.arrayBuffer();
|
|
5675
5751
|
} else i = t;
|
|
5676
5752
|
i = h(await _e(i, n.password));
|
|
5677
|
-
let a = new e(r === "worker" ? (await import("./render-worker-host-
|
|
5678
|
-
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await f(
|
|
5753
|
+
let a = new e(r === "worker" ? (await import("./render-worker-host-BqSTDaYt.js")).createRenderWorker() : new Wi(), r, n.wasmUrl);
|
|
5754
|
+
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), a._math = r === "worker" ? void 0 : n.math, await a._parse(i, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1, n.workerTimeoutMs), r === "main" && n.useGoogleFonts && a._presentation && (a._googleFontFaces = await f(Bi(a._presentation), Li)), a;
|
|
5679
5755
|
}
|
|
5680
5756
|
async _parse(e, t, n = !1, r) {
|
|
5681
5757
|
let i = await this._bridge.request((r) => this._mode === "worker" ? {
|
|
@@ -5709,22 +5785,22 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5709
5785
|
return this._mode;
|
|
5710
5786
|
}
|
|
5711
5787
|
getNotes(e) {
|
|
5712
|
-
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null :
|
|
5788
|
+
return this._meta ? Number.isInteger(e) ? this._meta.notes[e] ?? null : null : Mi(this._presentation?.slides ?? [], e);
|
|
5713
5789
|
}
|
|
5714
5790
|
isHidden(e) {
|
|
5715
|
-
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 :
|
|
5791
|
+
return this._meta ? Number.isInteger(e) ? this._meta.hidden[e] ?? !1 : !1 : Ni(this._presentation?.slides ?? [], e);
|
|
5716
5792
|
}
|
|
5717
5793
|
_partNames() {
|
|
5718
5794
|
return this._meta ? this._meta.partNames : (this._presentation?.slides ?? []).map((e) => e.partName);
|
|
5719
5795
|
}
|
|
5720
5796
|
_partIndex() {
|
|
5721
|
-
return this._slidePartIndex ||=
|
|
5797
|
+
return this._slidePartIndex ||= Pi(this._partNames()), this._slidePartIndex;
|
|
5722
5798
|
}
|
|
5723
5799
|
getSlideIndexByPartName(e) {
|
|
5724
5800
|
return this._partIndex().get(e);
|
|
5725
5801
|
}
|
|
5726
5802
|
resolveInternalTarget(e, t = 0) {
|
|
5727
|
-
return
|
|
5803
|
+
return Ii(e, this._partIndex(), t);
|
|
5728
5804
|
}
|
|
5729
5805
|
async renderSlide(e, t, n = {}) {
|
|
5730
5806
|
if (this._mode === "worker") throw Error("renderSlide(canvas) is unavailable in mode: 'worker'; use renderSlideToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
@@ -5801,7 +5877,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5801
5877
|
return this._mediaCache.set(e, r), r;
|
|
5802
5878
|
}
|
|
5803
5879
|
_findMimeTypeForPath(e) {
|
|
5804
|
-
return this._presentation ?
|
|
5880
|
+
return this._presentation ? Vi(this._presentation, e) : "";
|
|
5805
5881
|
}
|
|
5806
5882
|
async getImage(e, t) {
|
|
5807
5883
|
let n = this._imageCache.get(e);
|
|
@@ -5850,16 +5926,17 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5850
5926
|
slideWidthEmu: this.slideWidth,
|
|
5851
5927
|
fetchMedia: (e) => this.getMedia(e),
|
|
5852
5928
|
fetchImage: this._fetchImage,
|
|
5853
|
-
drawBase: a
|
|
5929
|
+
drawBase: a,
|
|
5930
|
+
onError: n.onError
|
|
5854
5931
|
});
|
|
5855
5932
|
}
|
|
5856
5933
|
destroy() {
|
|
5857
5934
|
this._bridge.terminate(), this._presentation = null, this._meta = null, this._slidePartIndex = null, this._mediaCache.clear(), this._imageCache.clear(), this._googleFontFaces.length > 0 && (j(this._googleFontFaces), this._googleFontFaces = []), z(this._fetchImage), Ge(this._fetchImage), se(this._fetchImage);
|
|
5858
5935
|
}
|
|
5859
|
-
},
|
|
5936
|
+
}, qi = {
|
|
5860
5937
|
color: "#ffffff",
|
|
5861
5938
|
opacity: .6
|
|
5862
|
-
},
|
|
5939
|
+
}, Ji = class {
|
|
5863
5940
|
canvas;
|
|
5864
5941
|
wrapper;
|
|
5865
5942
|
_scale = null;
|
|
@@ -5882,12 +5959,12 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5882
5959
|
constructor(e, t = {}) {
|
|
5883
5960
|
this.opts = t, this.canvas = e, this._mode = t.mode ?? "main", this._hiddenMode = t.hiddenSlideMode ?? "show";
|
|
5884
5961
|
let n = e.parentElement;
|
|
5885
|
-
this._originalParent = n, this._originalNextSibling = e.nextSibling, this._originalDisplay = e.style.display, this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;display:inline-block;vertical-align:top;", e.style.display || (e.style.display = "block"), n && n.insertBefore(this.wrapper, e), this.wrapper.appendChild(e), this._mode === "worker" && !t.enableMediaPlayback && (this._bitmapCtx = e.getContext("bitmaprenderer")), t.enableTextSelection && (this.textLayer = document.createElement("div"), this.textLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", this.wrapper.appendChild(this.textLayer)), this.highlightLayer = document.createElement("div"), this.highlightLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", this.wrapper.appendChild(this.highlightLayer), this._find = new
|
|
5962
|
+
this._originalParent = n, this._originalNextSibling = e.nextSibling, this._originalDisplay = e.style.display, this.wrapper = document.createElement("div"), this.wrapper.style.cssText = "position:relative;display:inline-block;vertical-align:top;", e.style.display || (e.style.display = "block"), n && n.insertBefore(this.wrapper, e), this.wrapper.appendChild(e), this._mode === "worker" && !t.enableMediaPlayback && (this._bitmapCtx = e.getContext("bitmaprenderer")), t.enableTextSelection && (this.textLayer = document.createElement("div"), this.textLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", this.wrapper.appendChild(this.textLayer)), this.highlightLayer = document.createElement("div"), this.highlightLayer.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", this.wrapper.appendChild(this.highlightLayer), this._find = new Sn(() => this.slideCount, (e) => this._collectSlideRuns(e));
|
|
5886
5963
|
}
|
|
5887
5964
|
async load(e) {
|
|
5888
5965
|
let t = ++this._loadGen, n = this.engine;
|
|
5889
5966
|
try {
|
|
5890
|
-
let r = await
|
|
5967
|
+
let r = await Ki.load(e, {
|
|
5891
5968
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
5892
5969
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
5893
5970
|
workerTimeoutMs: this.opts.workerTimeoutMs,
|
|
@@ -5927,8 +6004,8 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
5927
6004
|
}
|
|
5928
6005
|
_dim() {
|
|
5929
6006
|
return {
|
|
5930
|
-
color: this.opts.hiddenSlideDim?.color ??
|
|
5931
|
-
opacity: this.opts.hiddenSlideDim?.opacity ??
|
|
6007
|
+
color: this.opts.hiddenSlideDim?.color ?? qi.color,
|
|
6008
|
+
opacity: this.opts.hiddenSlideDim?.opacity ?? qi.opacity
|
|
5932
6009
|
};
|
|
5933
6010
|
}
|
|
5934
6011
|
async setHiddenSlideMode(e) {
|
|
@@ -6012,7 +6089,8 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6012
6089
|
width: t,
|
|
6013
6090
|
dpr: n,
|
|
6014
6091
|
dim: e,
|
|
6015
|
-
onTextRun: s
|
|
6092
|
+
onTextRun: s,
|
|
6093
|
+
onError: (e) => this._reportRenderError(e)
|
|
6016
6094
|
});
|
|
6017
6095
|
else if (a) {
|
|
6018
6096
|
let r = await this.engine.renderSlideToBitmap(this.currentSlide, {
|
|
@@ -6036,7 +6114,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6036
6114
|
}
|
|
6037
6115
|
_buildHighlightLayer(e, t, n) {
|
|
6038
6116
|
let r = this.highlightLayer;
|
|
6039
|
-
r &&
|
|
6117
|
+
r && xn(r, e, this._find.slideHighlights(this.currentSlide), t, n, (e) => this._measureForFont(e), this.opts.findHighlightColors);
|
|
6040
6118
|
}
|
|
6041
6119
|
_measureForFont(e) {
|
|
6042
6120
|
this._measureCtx ||= document.createElement("canvas").getContext("2d");
|
|
@@ -6068,7 +6146,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6068
6146
|
this._buildHighlightLayer(e, t, n);
|
|
6069
6147
|
}
|
|
6070
6148
|
_buildTextLayer(e, t, n, r) {
|
|
6071
|
-
|
|
6149
|
+
Y(e, t, n, r, this._hyperlinkHandler());
|
|
6072
6150
|
}
|
|
6073
6151
|
_hyperlinkHandler() {
|
|
6074
6152
|
if (this.opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
|
|
@@ -6105,7 +6183,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6105
6183
|
} else this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
|
|
6106
6184
|
this.canvas.style.display = this._originalDisplay, this.wrapper.remove();
|
|
6107
6185
|
}
|
|
6108
|
-
},
|
|
6186
|
+
}, Yi = 150, Xi = "0 1px 3px rgba(0,0,0,0.2)", Zi = class {
|
|
6109
6187
|
_pres = null;
|
|
6110
6188
|
_injected;
|
|
6111
6189
|
_opts;
|
|
@@ -6134,9 +6212,12 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6134
6212
|
_prevBase = 0;
|
|
6135
6213
|
_lastFitWidth = 0;
|
|
6136
6214
|
_pageShadow;
|
|
6215
|
+
_find = new Sn(() => this.slideCount, (e) => this._collectSlideRuns(e));
|
|
6216
|
+
_findActive = !1;
|
|
6217
|
+
_findMeasureCtx;
|
|
6137
6218
|
constructor(e, t = {}) {
|
|
6138
6219
|
if (e.tagName === "CANVAS") throw Error("PptxScrollViewer takes a container element (e.g. a <div>), not a <canvas> — the viewer creates and manages its own canvases. Pass a block container; for the single-slide canvas API use PptxViewer.");
|
|
6139
|
-
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ??
|
|
6220
|
+
if (this._container = e, this._opts = t, this._pageShadow = t.pageShadow ?? Xi, this._injected = !!t.presentation, this._injected) {
|
|
6140
6221
|
let e = t.presentation;
|
|
6141
6222
|
if (t.mode !== void 0 && t.mode !== e.mode) throw Error(`PptxScrollViewer: opts.mode='${t.mode}' conflicts with the injected engine's mode='${e.mode}'. Omit opts.mode when injecting an engine — the engine owns its render mode.`);
|
|
6142
6223
|
this._pres = e, this._mode = e.mode;
|
|
@@ -6154,7 +6235,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6154
6235
|
if (this._injected) throw Error("PptxScrollViewer.load() is unsupported when an engine is injected via opts.presentation; the injected engine is already loaded.");
|
|
6155
6236
|
let t = ++this._loadGen, n = this._pres;
|
|
6156
6237
|
try {
|
|
6157
|
-
let r = await
|
|
6238
|
+
let r = await Ki.load(e, {
|
|
6158
6239
|
useGoogleFonts: this._opts.useGoogleFonts,
|
|
6159
6240
|
maxZipEntryBytes: this._opts.maxZipEntryBytes,
|
|
6160
6241
|
workerTimeoutMs: this._opts.workerTimeoutMs,
|
|
@@ -6166,7 +6247,7 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6166
6247
|
r.destroy();
|
|
6167
6248
|
return;
|
|
6168
6249
|
}
|
|
6169
|
-
if (this._pres = r, n?.destroy(), n) {
|
|
6250
|
+
if (this._pres = r, n?.destroy(), this._find.invalidate(), this._findActive = !1, n) {
|
|
6170
6251
|
for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
|
|
6171
6252
|
this._lastTopIndex = -1;
|
|
6172
6253
|
}
|
|
@@ -6226,6 +6307,9 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6226
6307
|
_overscan() {
|
|
6227
6308
|
return this._opts.overscan ?? 1;
|
|
6228
6309
|
}
|
|
6310
|
+
_mediaOverscan() {
|
|
6311
|
+
return this._opts.mediaOverscan ?? 1;
|
|
6312
|
+
}
|
|
6229
6313
|
_pad() {
|
|
6230
6314
|
let e = this._gap();
|
|
6231
6315
|
return {
|
|
@@ -6251,6 +6335,12 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6251
6335
|
_range() {
|
|
6252
6336
|
return Ve(this._heights, this._gap(), this._scrollHost.scrollTop, this._scrollHost.clientHeight, this._overscan(), this._pad());
|
|
6253
6337
|
}
|
|
6338
|
+
_mediaRange() {
|
|
6339
|
+
return Ve(this._heights, this._gap(), this._scrollHost.scrollTop, this._scrollHost.clientHeight, this._mediaOverscan(), this._pad());
|
|
6340
|
+
}
|
|
6341
|
+
_rangeContains(e, t) {
|
|
6342
|
+
return t >= e.start && t <= e.end;
|
|
6343
|
+
}
|
|
6254
6344
|
_syncSpacer() {
|
|
6255
6345
|
let e = this._range();
|
|
6256
6346
|
this._lastRange = e, this._spacer.style.height = `${e.totalHeight}px`, this._syncSpacerWidth();
|
|
@@ -6264,15 +6354,15 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6264
6354
|
}
|
|
6265
6355
|
_mountVisible() {
|
|
6266
6356
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
6267
|
-
let e = this._range();
|
|
6357
|
+
let e = this._range(), t = this._opts.enableMediaPlayback ? this._mediaRange() : null;
|
|
6268
6358
|
this._lastRange = e;
|
|
6269
6359
|
for (let [t, n] of [...this._slots]) (t < e.start || t > e.end) && this._recycleSlot(t, n);
|
|
6270
|
-
for (let
|
|
6360
|
+
for (let n = e.start; n <= e.end; n++) if (this._slots.has(n)) this._positionSlot(this._slots.get(n), n, e);
|
|
6271
6361
|
else {
|
|
6272
|
-
let
|
|
6273
|
-
this._positionSlot(
|
|
6362
|
+
let r = this._acquireSlot();
|
|
6363
|
+
this._positionSlot(r, n, e), this._slots.set(n, r), this._renderSlot(n, r, !!t && this._rangeContains(t, n));
|
|
6274
6364
|
}
|
|
6275
|
-
e.topIndex !== this._lastTopIndex && (this._lastTopIndex = e.topIndex, this._opts.onVisibleSlideChange?.(e.topIndex, this._pres.slideCount));
|
|
6365
|
+
t && this._syncMediaPlayback(t), e.topIndex !== this._lastTopIndex && (this._lastTopIndex = e.topIndex, this._opts.onVisibleSlideChange?.(e.topIndex, this._pres.slideCount));
|
|
6276
6366
|
}
|
|
6277
6367
|
_applyPageShadow(e) {
|
|
6278
6368
|
this._pageShadow !== !1 && (e.style.boxShadow = this._pageShadow);
|
|
@@ -6285,18 +6375,25 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6285
6375
|
let n = document.createElement("canvas");
|
|
6286
6376
|
n.style.cssText = "display:block;background:#fff;", this._applyPageShadow(n), t.appendChild(n);
|
|
6287
6377
|
let r = null;
|
|
6288
|
-
|
|
6378
|
+
this._opts.enableTextSelection && (r = document.createElement("div"), r.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", t.appendChild(r));
|
|
6379
|
+
let i = document.createElement("div");
|
|
6380
|
+
return i.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", t.appendChild(i), this._scrollHost.appendChild(t), {
|
|
6289
6381
|
wrapper: t,
|
|
6290
6382
|
canvas: n,
|
|
6291
6383
|
textLayer: r,
|
|
6384
|
+
highlightLayer: i,
|
|
6292
6385
|
renderedSlide: -1,
|
|
6293
6386
|
renderedScale: -1,
|
|
6294
6387
|
bitmap: null,
|
|
6295
|
-
bitmapCtx: null
|
|
6388
|
+
bitmapCtx: null,
|
|
6389
|
+
presentationHandle: null,
|
|
6390
|
+
mediaInteractive: !1,
|
|
6391
|
+
renderGeneration: 0,
|
|
6392
|
+
presentationGeneration: 0
|
|
6296
6393
|
};
|
|
6297
6394
|
}
|
|
6298
6395
|
_recycleSlot(e, t) {
|
|
6299
|
-
this._slots.delete(e), t.bitmap &&= (t.bitmap.close(), null), t.textLayer && (t.textLayer.innerHTML = "", t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = ""), t.renderedSlide = -1, t.renderedScale = -1, t.wrapper.remove(), this._free.push(t);
|
|
6396
|
+
this._slots.delete(e), t.renderGeneration++, t.presentationGeneration++, t.presentationHandle?.destroy(), t.presentationHandle = null, t.mediaInteractive = !1, t.bitmap &&= (t.bitmap.close(), null), t.textLayer && (t.textLayer.innerHTML = "", t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = ""), t.highlightLayer.innerHTML = "", t.highlightLayer.style.transform = "", t.highlightLayer.style.transformOrigin = "", t.renderedSlide = -1, t.renderedScale = -1, t.wrapper.remove(), this._free.push(t);
|
|
6300
6397
|
}
|
|
6301
6398
|
_positionSlot(e, t, n) {
|
|
6302
6399
|
e.wrapper.style.top = `${n.offsets[t]}px`;
|
|
@@ -6308,54 +6405,87 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6308
6405
|
_dpr() {
|
|
6309
6406
|
return this._opts.dpr ?? (typeof window < "u" && window.devicePixelRatio || 1);
|
|
6310
6407
|
}
|
|
6311
|
-
_renderSlot(e, t) {
|
|
6408
|
+
_renderSlot(e, t, n = !1) {
|
|
6312
6409
|
if (!this._pres || t.renderedSlide === e) return;
|
|
6313
6410
|
t.renderedSlide = e;
|
|
6314
|
-
let
|
|
6315
|
-
if (this.
|
|
6316
|
-
this.
|
|
6411
|
+
let r = ++t.renderGeneration, i = this._dpr(), a = this._slideWidthPx(), o = this._renderEpoch, s = this._scale;
|
|
6412
|
+
if (this._opts.enableMediaPlayback && n) {
|
|
6413
|
+
t.mediaInteractive = !0, this._renderInteractiveSlot(e, t, a, i, s, o);
|
|
6317
6414
|
return;
|
|
6318
6415
|
}
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6416
|
+
if (t.mediaInteractive = !1, this._mode === "worker") {
|
|
6417
|
+
this._renderSlotBitmap(e, t, a, i, s, r);
|
|
6418
|
+
return;
|
|
6419
|
+
}
|
|
6420
|
+
let c = [], l = !!this._opts.enableTextSelection && !!t.textLayer, u = l || this._findActive, d = u ? (e) => c.push(e) : void 0, f = t.canvas;
|
|
6421
|
+
this._pres.renderSlide(f, e, {
|
|
6422
|
+
width: a,
|
|
6423
|
+
dpr: i,
|
|
6424
|
+
onTextRun: d
|
|
6324
6425
|
}).then(() => {
|
|
6325
|
-
|
|
6426
|
+
r !== t.renderGeneration || f !== t.canvas || o !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e || (t.renderedScale = s, l && t.textLayer && Y(t.textLayer, c, Math.round(a), Math.round(this._slideHeightPx()), this._hyperlinkHandler()), u && this._refreshFindRuns(e, c), this._redrawSlotHighlights(e, t));
|
|
6326
6427
|
}).catch((e) => {
|
|
6327
6428
|
this._reportRenderError(e);
|
|
6328
6429
|
});
|
|
6329
6430
|
}
|
|
6431
|
+
_renderInteractiveSlot(e, t, n, r, i, a) {
|
|
6432
|
+
if (!this._pres) return;
|
|
6433
|
+
let o = ++t.presentationGeneration;
|
|
6434
|
+
t.presentationHandle?.destroy(), t.presentationHandle = null;
|
|
6435
|
+
let s = [], c = !!this._opts.enableTextSelection && !!t.textLayer, l = c || this._findActive, u = l ? (e) => s.push(e) : void 0;
|
|
6436
|
+
this._pres.presentSlide(t.canvas, e, {
|
|
6437
|
+
width: n,
|
|
6438
|
+
dpr: r,
|
|
6439
|
+
onTextRun: u,
|
|
6440
|
+
onError: (e) => {
|
|
6441
|
+
o === t.presentationGeneration && this._reportRenderError(e);
|
|
6442
|
+
}
|
|
6443
|
+
}).then((r) => {
|
|
6444
|
+
if (o !== t.presentationGeneration || !t.mediaInteractive || a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) {
|
|
6445
|
+
r.destroy();
|
|
6446
|
+
return;
|
|
6447
|
+
}
|
|
6448
|
+
t.presentationHandle = r, t.renderedScale = i, c && t.textLayer && Y(t.textLayer, s, Math.round(n), Math.round(this._slideHeightPx()), this._hyperlinkHandler()), l && this._refreshFindRuns(e, s), this._redrawSlotHighlights(e, t);
|
|
6449
|
+
}).catch((e) => {
|
|
6450
|
+
o === t.presentationGeneration && this._reportRenderError(e);
|
|
6451
|
+
});
|
|
6452
|
+
}
|
|
6453
|
+
_syncMediaPlayback(e = this._mediaRange()) {
|
|
6454
|
+
if (this._opts.enableMediaPlayback) for (let [t, n] of this._slots) {
|
|
6455
|
+
let r = this._rangeContains(e, t);
|
|
6456
|
+
r !== n.mediaInteractive && (r ? (n.mediaInteractive = !0, this._settleInteractiveSlot(t, n, this._slideWidthPx(), this._dpr(), this._scale, this._renderEpoch)) : (n.mediaInteractive = !1, n.presentationGeneration++, n.presentationHandle?.destroy(), n.presentationHandle = null));
|
|
6457
|
+
}
|
|
6458
|
+
}
|
|
6330
6459
|
_reportRenderError(e) {
|
|
6331
6460
|
if (this._destroyed) return;
|
|
6332
6461
|
let t = e instanceof Error ? e : Error(String(e));
|
|
6333
6462
|
this._opts.onError ? this._opts.onError(t) : console.error("[ooxml] PptxScrollViewer render failed:", t);
|
|
6334
6463
|
}
|
|
6335
|
-
async _renderSlotBitmap(e, t, n, r, i) {
|
|
6464
|
+
async _renderSlotBitmap(e, t, n, r, i, a = ++t.renderGeneration) {
|
|
6336
6465
|
if (this._slideInFlight.has(e) || this._slots.get(e) !== t) return;
|
|
6337
|
-
let
|
|
6466
|
+
let o = this._renderEpoch;
|
|
6338
6467
|
this._slideInFlight.add(e);
|
|
6339
|
-
let
|
|
6340
|
-
t.bitmapCtx ||=
|
|
6341
|
-
let
|
|
6468
|
+
let s = t.canvas, c = !1;
|
|
6469
|
+
t.bitmapCtx ||= s.getContext("bitmaprenderer");
|
|
6470
|
+
let l = t.bitmapCtx, u = !!this._opts.enableTextSelection && !!t.textLayer, d = u || this._findActive, f = [];
|
|
6342
6471
|
try {
|
|
6343
|
-
let
|
|
6472
|
+
let p = await this._pres.renderSlideToBitmap(e, {
|
|
6344
6473
|
width: n,
|
|
6345
6474
|
dpr: r,
|
|
6346
|
-
onTextRun:
|
|
6475
|
+
onTextRun: d ? (e) => f.push(e) : void 0
|
|
6347
6476
|
});
|
|
6348
|
-
if (a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) {
|
|
6349
|
-
|
|
6477
|
+
if (a !== t.renderGeneration || s !== t.canvas || o !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) {
|
|
6478
|
+
p.close();
|
|
6350
6479
|
return;
|
|
6351
6480
|
}
|
|
6352
|
-
|
|
6481
|
+
if (!l) throw p.close(), Error("bitmaprenderer context not available");
|
|
6482
|
+
t.bitmap && t.bitmap.close(), t.bitmap = p, s.width = p.width, s.height = p.height, s.style.width = `${Math.round(p.width / r)}px`, s.style.height = `${Math.round(p.height / r)}px`, l.transferFromImageBitmap(p), t.bitmap = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", u && Y(t.textLayer, f, Math.round(n), Math.round(this._slideHeightPx()), this._hyperlinkHandler())), d && this._refreshFindRuns(e, f), this._redrawSlotHighlights(e, t), c = !0;
|
|
6353
6483
|
} catch (e) {
|
|
6354
6484
|
this._reportRenderError(e);
|
|
6355
6485
|
} finally {
|
|
6356
6486
|
this._slideInFlight.delete(e);
|
|
6357
6487
|
let n = this._slots.get(e);
|
|
6358
|
-
!
|
|
6488
|
+
!c && n && (n !== t || o !== this._renderEpoch || a !== n.renderGeneration) && !this._slideInFlight.has(e) && !this._destroyed && !(this._opts.enableMediaPlayback && n.mediaInteractive) && this._renderSlotBitmap(e, n, this._slideWidthPx(), this._dpr(), this._scale);
|
|
6359
6489
|
}
|
|
6360
6490
|
}
|
|
6361
6491
|
setScale(e) {
|
|
@@ -6405,18 +6535,18 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6405
6535
|
}
|
|
6406
6536
|
_previewVisible() {
|
|
6407
6537
|
if (!this._pres || this._pres.slideCount === 0) return;
|
|
6408
|
-
let e = this._range();
|
|
6538
|
+
let e = this._range(), t = this._opts.enableMediaPlayback ? this._mediaRange() : null;
|
|
6409
6539
|
this._lastRange = e;
|
|
6410
6540
|
for (let [t, n] of [...this._slots]) (t < e.start || t > e.end) && this._recycleSlot(t, n);
|
|
6411
|
-
for (let
|
|
6412
|
-
let
|
|
6413
|
-
if (
|
|
6541
|
+
for (let n = e.start; n <= e.end; n++) {
|
|
6542
|
+
let r = this._slots.get(n);
|
|
6543
|
+
if (r) this._previewSlot(r, n, e);
|
|
6414
6544
|
else {
|
|
6415
|
-
let
|
|
6416
|
-
this._positionSlot(
|
|
6545
|
+
let r = this._acquireSlot();
|
|
6546
|
+
this._positionSlot(r, n, e), this._slots.set(n, r), this._renderSlot(n, r, !!t && this._rangeContains(t, n));
|
|
6417
6547
|
}
|
|
6418
6548
|
}
|
|
6419
|
-
e.topIndex !== this._lastTopIndex && (this._lastTopIndex = e.topIndex, this._opts.onVisibleSlideChange?.(e.topIndex, this._pres.slideCount));
|
|
6549
|
+
t && this._syncMediaPlayback(t), e.topIndex !== this._lastTopIndex && (this._lastTopIndex = e.topIndex, this._opts.onVisibleSlideChange?.(e.topIndex, this._pres.slideCount));
|
|
6420
6550
|
}
|
|
6421
6551
|
_previewSlot(e, t, n) {
|
|
6422
6552
|
if (this._positionSlot(e, t, n), e.canvas.style.width = `${this._slideWidthPx()}px`, e.canvas.style.height = `${this._slideHeightPx()}px`, e.textLayer && e.renderedScale > 0) {
|
|
@@ -6427,33 +6557,63 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6427
6557
|
_scheduleSettle() {
|
|
6428
6558
|
this._settleTimer !== null && clearTimeout(this._settleTimer), this._settleTimer = setTimeout(() => {
|
|
6429
6559
|
this._settleTimer = null, this._settleRender();
|
|
6430
|
-
},
|
|
6560
|
+
}, Yi);
|
|
6431
6561
|
}
|
|
6432
6562
|
_settleRender() {
|
|
6433
|
-
if (
|
|
6563
|
+
if (this._destroyed || !this._pres || this._pres.slideCount === 0) return;
|
|
6564
|
+
let e = this._opts.enableMediaPlayback ? this._mediaRange() : null;
|
|
6565
|
+
for (let [t, n] of [...this._slots]) e && !this._rangeContains(e, t) || n.renderedScale !== this._scale && this._settleSlot(t, n);
|
|
6434
6566
|
}
|
|
6435
6567
|
_settleSlot(e, t) {
|
|
6436
6568
|
if (!this._pres) return;
|
|
6437
6569
|
let n = this._dpr(), r = this._slideWidthPx(), i = this._scale, a = this._renderEpoch;
|
|
6570
|
+
if (this._opts.enableMediaPlayback && t.mediaInteractive) {
|
|
6571
|
+
this._settleInteractiveSlot(e, t, r, n, i, a);
|
|
6572
|
+
return;
|
|
6573
|
+
}
|
|
6574
|
+
if (this._opts.enableMediaPlayback) return;
|
|
6438
6575
|
if (this._mode === "worker") {
|
|
6439
6576
|
this._renderSlotBitmap(e, t, r, n, i);
|
|
6440
6577
|
return;
|
|
6441
6578
|
}
|
|
6442
|
-
let o = document.createElement("canvas");
|
|
6579
|
+
let o = document.createElement("canvas"), s = ++t.renderGeneration;
|
|
6443
6580
|
o.style.cssText = "display:block;background:#fff;", this._applyPageShadow(o);
|
|
6444
|
-
let
|
|
6581
|
+
let c = [], l = !!this._opts.enableTextSelection && !!t.textLayer, u = l || this._findActive, d = u ? (e) => c.push(e) : void 0;
|
|
6445
6582
|
this._pres.renderSlide(o, e, {
|
|
6446
6583
|
width: r,
|
|
6447
6584
|
dpr: n,
|
|
6448
|
-
onTextRun:
|
|
6585
|
+
onTextRun: d
|
|
6449
6586
|
}).then(() => {
|
|
6450
|
-
if (a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) return;
|
|
6587
|
+
if (s !== t.renderGeneration || a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) return;
|
|
6451
6588
|
let n = t.canvas;
|
|
6452
|
-
t.wrapper.insertBefore(o, n), n.remove(), t.canvas = o, t.bitmapCtx = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "",
|
|
6589
|
+
t.wrapper.insertBefore(o, n), n.remove(), t.canvas = o, t.bitmapCtx = null, t.renderedScale = i, t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", l && Y(t.textLayer, c, Math.round(r), Math.round(this._slideHeightPx()), this._hyperlinkHandler())), u && this._refreshFindRuns(e, c), this._redrawSlotHighlights(e, t);
|
|
6453
6590
|
}).catch((e) => {
|
|
6454
6591
|
this._reportRenderError(e);
|
|
6455
6592
|
});
|
|
6456
6593
|
}
|
|
6594
|
+
_settleInteractiveSlot(e, t, n, r, i, a) {
|
|
6595
|
+
if (!this._pres) return;
|
|
6596
|
+
let o = ++t.presentationGeneration, s = document.createElement("canvas");
|
|
6597
|
+
s.style.cssText = "display:block;background:#fff;", this._applyPageShadow(s);
|
|
6598
|
+
let c = [], l = !!this._opts.enableTextSelection && !!t.textLayer, u = l || this._findActive, d = u ? (e) => c.push(e) : void 0;
|
|
6599
|
+
this._pres.presentSlide(s, e, {
|
|
6600
|
+
width: n,
|
|
6601
|
+
dpr: r,
|
|
6602
|
+
onTextRun: d,
|
|
6603
|
+
onError: (e) => {
|
|
6604
|
+
o === t.presentationGeneration && this._reportRenderError(e);
|
|
6605
|
+
}
|
|
6606
|
+
}).then((r) => {
|
|
6607
|
+
if (o !== t.presentationGeneration || !t.mediaInteractive || a !== this._renderEpoch || this._slots.get(e) !== t || t.renderedSlide !== e) {
|
|
6608
|
+
r.destroy();
|
|
6609
|
+
return;
|
|
6610
|
+
}
|
|
6611
|
+
let d = t.canvas, f = t.presentationHandle;
|
|
6612
|
+
t.wrapper.insertBefore(s, d), d.remove(), t.canvas = s, t.bitmapCtx = null, t.presentationHandle = r, t.renderedScale = i, f?.destroy(), t.textLayer && (t.textLayer.style.transform = "", t.textLayer.style.transformOrigin = "", l && Y(t.textLayer, c, Math.round(n), Math.round(this._slideHeightPx()), this._hyperlinkHandler())), u && this._refreshFindRuns(e, c), this._redrawSlotHighlights(e, t);
|
|
6613
|
+
}).catch((e) => {
|
|
6614
|
+
o === t.presentationGeneration && this._reportRenderError(e);
|
|
6615
|
+
});
|
|
6616
|
+
}
|
|
6457
6617
|
scrollToSlide(e, t) {
|
|
6458
6618
|
if (!this._pres || this._pres.slideCount === 0 || !this._scaleEstablished) return;
|
|
6459
6619
|
let n = Math.max(0, Math.min(e, this._pres.slideCount - 1)), r = Ve(this._heights, this._gap(), 0, this._scrollHost.clientHeight, this._overscan(), this._pad()), i = r.offsets[n] ?? 0, a = Math.max(0, r.totalHeight - this._scrollHost.clientHeight), o = Math.min(a, Math.max(0, i)), s = this._scrollHost;
|
|
@@ -6462,6 +6622,50 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6462
6622
|
behavior: t?.behavior ?? "auto"
|
|
6463
6623
|
}) : this._scrollHost.scrollTop = o, this._mountVisible();
|
|
6464
6624
|
}
|
|
6625
|
+
async findText(e, t = {}) {
|
|
6626
|
+
if (!this._pres) return [];
|
|
6627
|
+
this._findActive = e.length > 0;
|
|
6628
|
+
let n = await this._find.find(e, t);
|
|
6629
|
+
return this._redrawHighlights(), n;
|
|
6630
|
+
}
|
|
6631
|
+
async findNext() {
|
|
6632
|
+
return this._activateMatch(this._find.next());
|
|
6633
|
+
}
|
|
6634
|
+
async findPrev() {
|
|
6635
|
+
return this._activateMatch(this._find.prev());
|
|
6636
|
+
}
|
|
6637
|
+
clearFind() {
|
|
6638
|
+
this._findActive = !1, this._find.invalidate(), this._redrawHighlights();
|
|
6639
|
+
}
|
|
6640
|
+
async _activateMatch(e) {
|
|
6641
|
+
return e && this.scrollToSlide(e.location.slide), this._redrawHighlights(), e;
|
|
6642
|
+
}
|
|
6643
|
+
async _collectSlideRuns(e) {
|
|
6644
|
+
return this._pres ? this._pres.collectSlideRuns(e, this._slideWidthPx()) : [];
|
|
6645
|
+
}
|
|
6646
|
+
_redrawHighlights() {
|
|
6647
|
+
for (let [e, t] of this._slots) this._redrawSlotHighlights(e, t);
|
|
6648
|
+
}
|
|
6649
|
+
_refreshFindRuns(e, t) {
|
|
6650
|
+
this._findActive && this._find.setSlideRuns(e, t);
|
|
6651
|
+
}
|
|
6652
|
+
_redrawSlotHighlights(e, t) {
|
|
6653
|
+
if (!this._findActive) {
|
|
6654
|
+
t.highlightLayer.innerHTML = "";
|
|
6655
|
+
return;
|
|
6656
|
+
}
|
|
6657
|
+
let n = this._find.slideRuns(e);
|
|
6658
|
+
if (!n) {
|
|
6659
|
+
t.highlightLayer.innerHTML = "";
|
|
6660
|
+
return;
|
|
6661
|
+
}
|
|
6662
|
+
xn(t.highlightLayer, n, this._find.slideHighlights(e), this._slideWidthPx(), this._slideHeightPx(), (e) => this._measureForFind(e), this._opts.findHighlightColors);
|
|
6663
|
+
}
|
|
6664
|
+
_measureForFind(e) {
|
|
6665
|
+
this._findMeasureCtx === void 0 && (this._findMeasureCtx = document.createElement("canvas").getContext("2d"));
|
|
6666
|
+
let t = this._findMeasureCtx;
|
|
6667
|
+
return !t || typeof t.measureText != "function" ? (e) => e.length : (t.font = e, (e) => t.measureText(e).width);
|
|
6668
|
+
}
|
|
6465
6669
|
_hyperlinkHandler() {
|
|
6466
6670
|
if (this._opts.enableHyperlinks !== !1) return (e) => this._onHyperlinkClick(e);
|
|
6467
6671
|
}
|
|
@@ -6491,6 +6695,10 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6491
6695
|
this.relayout();
|
|
6492
6696
|
return;
|
|
6493
6697
|
}
|
|
6698
|
+
if (this._opts.refitOnResize === !1) {
|
|
6699
|
+
this._lastFitWidth = this._fitWidthPx(), this._mountVisible();
|
|
6700
|
+
return;
|
|
6701
|
+
}
|
|
6494
6702
|
let e = this._baseScale();
|
|
6495
6703
|
if (e <= 0) return;
|
|
6496
6704
|
let t = this._fitWidthPx();
|
|
@@ -6508,6 +6716,9 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6508
6716
|
mountedSlideIndicesForTest() {
|
|
6509
6717
|
return [...this._slots.keys()];
|
|
6510
6718
|
}
|
|
6719
|
+
interactiveSlideIndicesForTest() {
|
|
6720
|
+
return [...this._slots].filter(([, e]) => e.mediaInteractive).map(([e]) => e);
|
|
6721
|
+
}
|
|
6511
6722
|
scaleForTest() {
|
|
6512
6723
|
return this._scale;
|
|
6513
6724
|
}
|
|
@@ -6531,20 +6742,20 @@ var Bi = new URL("pptx_parser_bg.wasm", import.meta.url).href, Vi = class e {
|
|
|
6531
6742
|
return (this._range().offsets[e] ?? 0) + t * (this._heights[e] || 0) - this._scrollHost.scrollTop;
|
|
6532
6743
|
}
|
|
6533
6744
|
destroy() {
|
|
6534
|
-
this._destroyed = !0, this._loadGen++, this._scrollListener &&= (this._scrollHost.removeEventListener("scroll", this._scrollListener), null), this._wheelListener &&= (this._scrollHost.removeEventListener("wheel", this._wheelListener), null), this._resizeObserver?.disconnect(), this._resizeObserver = null, this._settleTimer !== null && (clearTimeout(this._settleTimer), this._settleTimer = null);
|
|
6745
|
+
this._destroyed = !0, this._loadGen++, this._find.invalidate(), this._findActive = !1, this._scrollListener &&= (this._scrollHost.removeEventListener("scroll", this._scrollListener), null), this._wheelListener &&= (this._scrollHost.removeEventListener("wheel", this._wheelListener), null), this._resizeObserver?.disconnect(), this._resizeObserver = null, this._settleTimer !== null && (clearTimeout(this._settleTimer), this._settleTimer = null);
|
|
6535
6746
|
for (let [e, t] of [...this._slots]) this._recycleSlot(e, t);
|
|
6536
6747
|
this._free.length = 0, this._injected || this._pres?.destroy(), this._pres = null, this._wrapper.remove();
|
|
6537
6748
|
}
|
|
6538
|
-
},
|
|
6749
|
+
}, Qi = /* @__PURE__ */ e({
|
|
6539
6750
|
OoxmlError: () => F,
|
|
6540
|
-
PptxPresentation: () =>
|
|
6541
|
-
PptxScrollViewer: () =>
|
|
6542
|
-
PptxViewer: () =>
|
|
6751
|
+
PptxPresentation: () => Ki,
|
|
6752
|
+
PptxScrollViewer: () => Zi,
|
|
6753
|
+
PptxViewer: () => Ji,
|
|
6543
6754
|
autoResize: () => R,
|
|
6544
|
-
buildPptxHighlightLayer: () =>
|
|
6545
|
-
buildPptxTextLayer: () =>
|
|
6755
|
+
buildPptxHighlightLayer: () => xn,
|
|
6756
|
+
buildPptxTextLayer: () => Y,
|
|
6546
6757
|
openExternalHyperlink: () => oe,
|
|
6547
6758
|
renderSlide: () => ai
|
|
6548
6759
|
});
|
|
6549
6760
|
//#endregion
|
|
6550
|
-
export { ai as a,
|
|
6761
|
+
export { ai as a, Ki as i, Zi as n, xn as o, Ji as r, Y as s, Qi as t };
|