@netless/app-slide 0.3.0-canary.13 → 0.3.0-canary.14
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-zh.md +17 -7
- package/README.md +4 -7
- package/dist/Refrigerator.d.ts +3 -1
- package/dist/SlideViewer/footer.d.ts +1 -0
- package/dist/SlideViewer/index.d.ts +8 -2
- package/dist/icons/save.d.ts +1 -0
- package/dist/icons/spinner.d.ts +1 -0
- package/dist/main.iife.js +2 -2
- package/dist/main.iife.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/main.mjs +589 -497
- package/dist/main.mjs.map +1 -1
- package/dist/typings.d.ts +2 -2
- package/package.json +3 -2
- package/src/Refrigerator.ts +11 -1
- package/src/SlideViewer/footer.ts +42 -19
- package/src/SlideViewer/index.ts +91 -0
- package/src/SlideViewer/sidebar.ts +15 -14
- package/src/connect.ts +24 -0
- package/src/icons/save.ts +18 -0
- package/src/icons/spinner.ts +37 -0
- package/src/index.ts +1 -1
- package/src/preview.ts +2 -2
package/dist/main.mjs
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (e, t, s) => (
|
|
4
|
-
import { Slide as
|
|
5
|
-
import { Slide as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var yt = Object.defineProperty;
|
|
2
|
+
var kt = (e, t, s) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var u = (e, t, s) => (kt(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
import { Slide as ue } from "@netless/slide";
|
|
5
|
+
import { Slide as mr } from "@netless/slide";
|
|
6
|
+
import { jsPDF as St } from "jspdf";
|
|
7
|
+
const xt = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", Ct = 87, Et = 20, Ce = [], At = () => {
|
|
8
|
+
for (let e = 0; e < Et; e++)
|
|
9
|
+
Ce[e] = xt.charAt(Math.random() * Ct);
|
|
10
|
+
return Ce.join("");
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
+
function Oe(e) {
|
|
12
13
|
try {
|
|
13
14
|
return e();
|
|
14
15
|
} catch (t) {
|
|
15
16
|
console.error(t);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
class
|
|
19
|
+
class Pe {
|
|
19
20
|
constructor() {
|
|
20
21
|
this.push = this.addDisposer, this.disposers = /* @__PURE__ */ new Map();
|
|
21
22
|
}
|
|
22
23
|
addDisposer(t, s = this.genUID()) {
|
|
23
|
-
return this.flush(s), this.disposers.set(s, Array.isArray(t) ?
|
|
24
|
+
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? It(t) : t), s;
|
|
24
25
|
}
|
|
25
26
|
add(t, s = this.genUID()) {
|
|
26
27
|
const r = t();
|
|
@@ -48,33 +49,34 @@ class Me {
|
|
|
48
49
|
s && s();
|
|
49
50
|
}
|
|
50
51
|
flushAll() {
|
|
51
|
-
this.disposers.forEach(
|
|
52
|
+
this.disposers.forEach(Oe), this.disposers.clear();
|
|
52
53
|
}
|
|
53
54
|
genUID() {
|
|
54
55
|
let t;
|
|
55
56
|
do
|
|
56
|
-
t =
|
|
57
|
+
t = At();
|
|
57
58
|
while (this.disposers.has(t));
|
|
58
59
|
return t;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
-
return () => e.forEach(
|
|
62
|
+
function It(e) {
|
|
63
|
+
return () => e.forEach(Oe);
|
|
63
64
|
}
|
|
64
|
-
const
|
|
65
|
-
class
|
|
65
|
+
const T = "netless-app-slide", Te = "https://convertcdn.netless.link/dynamicConvert";
|
|
66
|
+
class zt {
|
|
66
67
|
constructor() {
|
|
67
68
|
u(this, "threshold", 2);
|
|
68
69
|
u(this, "_map", /* @__PURE__ */ new Map());
|
|
70
|
+
u(this, "_box", /* @__PURE__ */ new Map());
|
|
69
71
|
u(this, "_queue", []);
|
|
70
72
|
}
|
|
71
|
-
set(t, s) {
|
|
72
|
-
return this._map.set(t, s), this._queue.includes(t) || this._queue.unshift(t), this._refresh(), () => {
|
|
73
|
+
set(t, s, r) {
|
|
74
|
+
return this._map.set(t, s), this._box.set(t, r), this._queue.includes(t) || this._queue.unshift(t), this._refresh(), () => {
|
|
73
75
|
this.delete(t);
|
|
74
76
|
};
|
|
75
77
|
}
|
|
76
78
|
delete(t) {
|
|
77
|
-
this._map.delete(t), this._queue = this._queue.filter((s) => s !== t), this._refresh();
|
|
79
|
+
this._map.delete(t), this._box.delete(t), this._queue = this._queue.filter((s) => s !== t), this._refresh();
|
|
78
80
|
}
|
|
79
81
|
focus(t) {
|
|
80
82
|
const s = this._queue.indexOf(t);
|
|
@@ -82,17 +84,21 @@ class xt {
|
|
|
82
84
|
}
|
|
83
85
|
_refresh() {
|
|
84
86
|
let t;
|
|
85
|
-
this._queue.
|
|
87
|
+
this._queue.sort((s, r) => {
|
|
88
|
+
var n, a, l, d;
|
|
89
|
+
const o = (a = (n = this._box.get(s)) == null ? void 0 : n.zIndex) != null ? a : 0, i = (d = (l = this._box.get(r)) == null ? void 0 : l.zIndex) != null ? d : 0;
|
|
90
|
+
return -(o - i);
|
|
91
|
+
}), this._queue.forEach((s, r) => {
|
|
86
92
|
!(t = this._map.get(s)) || (r < this.threshold ? t.unfreeze() : t.freeze());
|
|
87
93
|
});
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
|
-
const
|
|
96
|
+
const De = new zt(), dr = function(t) {
|
|
91
97
|
t.on("focus", (s) => {
|
|
92
|
-
|
|
98
|
+
De.focus(s.appId);
|
|
93
99
|
});
|
|
94
100
|
};
|
|
95
|
-
class
|
|
101
|
+
class $t {
|
|
96
102
|
constructor() {
|
|
97
103
|
this.a = /* @__PURE__ */ new Map(), this.b = /* @__PURE__ */ new Set();
|
|
98
104
|
}
|
|
@@ -128,8 +134,8 @@ class Et {
|
|
|
128
134
|
);
|
|
129
135
|
if (o.size <= 0) {
|
|
130
136
|
this.a.delete(t);
|
|
131
|
-
for (const
|
|
132
|
-
|
|
137
|
+
for (const n of this.b)
|
|
138
|
+
n.d(t);
|
|
133
139
|
}
|
|
134
140
|
return i;
|
|
135
141
|
}
|
|
@@ -154,20 +160,20 @@ class Et {
|
|
|
154
160
|
var r;
|
|
155
161
|
let o;
|
|
156
162
|
const i = {
|
|
157
|
-
e: (
|
|
158
|
-
if (
|
|
163
|
+
e: (n) => {
|
|
164
|
+
if (n === t)
|
|
159
165
|
try {
|
|
160
166
|
o = s(this);
|
|
161
|
-
} catch (
|
|
162
|
-
console.error(
|
|
167
|
+
} catch (a) {
|
|
168
|
+
console.error(a);
|
|
163
169
|
}
|
|
164
170
|
},
|
|
165
|
-
d: (
|
|
166
|
-
if (o && (!
|
|
171
|
+
d: (n) => {
|
|
172
|
+
if (o && (!n || n === t))
|
|
167
173
|
try {
|
|
168
174
|
o();
|
|
169
|
-
} catch (
|
|
170
|
-
console.error(
|
|
175
|
+
} catch (a) {
|
|
176
|
+
console.error(a);
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
};
|
|
@@ -182,7 +188,7 @@ class Et {
|
|
|
182
188
|
this.b.clear();
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
|
-
var Fe = { exports: {} },
|
|
191
|
+
var Fe = { exports: {} }, Lt = {
|
|
186
192
|
aliceblue: [240, 248, 255],
|
|
187
193
|
antiquewhite: [250, 235, 215],
|
|
188
194
|
aqua: [0, 255, 255],
|
|
@@ -331,167 +337,167 @@ var Fe = { exports: {} }, It = {
|
|
|
331
337
|
whitesmoke: [245, 245, 245],
|
|
332
338
|
yellow: [255, 255, 0],
|
|
333
339
|
yellowgreen: [154, 205, 50]
|
|
334
|
-
},
|
|
340
|
+
}, Re = { exports: {} }, Mt = function(t) {
|
|
335
341
|
return !t || typeof t == "string" ? !1 : t instanceof Array || Array.isArray(t) || t.length >= 0 && (t.splice instanceof Function || Object.getOwnPropertyDescriptor(t, t.length - 1) && t.constructor.name !== "String");
|
|
336
|
-
},
|
|
342
|
+
}, Nt = Mt, Ot = Array.prototype.concat, Pt = Array.prototype.slice, Ee = Re.exports = function(t) {
|
|
337
343
|
for (var s = [], r = 0, o = t.length; r < o; r++) {
|
|
338
344
|
var i = t[r];
|
|
339
|
-
|
|
345
|
+
Nt(i) ? s = Ot.call(s, Pt.call(i)) : s.push(i);
|
|
340
346
|
}
|
|
341
347
|
return s;
|
|
342
348
|
};
|
|
343
|
-
|
|
349
|
+
Ee.wrap = function(e) {
|
|
344
350
|
return function() {
|
|
345
|
-
return e(
|
|
351
|
+
return e(Ee(arguments));
|
|
346
352
|
};
|
|
347
353
|
};
|
|
348
|
-
var
|
|
349
|
-
for (var
|
|
350
|
-
|
|
351
|
-
var
|
|
354
|
+
var Y = Lt, K = Re.exports, Ve = Object.hasOwnProperty, Ue = /* @__PURE__ */ Object.create(null);
|
|
355
|
+
for (var de in Y)
|
|
356
|
+
Ve.call(Y, de) && (Ue[Y[de]] = de);
|
|
357
|
+
var E = Fe.exports = {
|
|
352
358
|
to: {},
|
|
353
359
|
get: {}
|
|
354
360
|
};
|
|
355
|
-
|
|
361
|
+
E.get = function(e) {
|
|
356
362
|
var t = e.substring(0, 3).toLowerCase(), s, r;
|
|
357
363
|
switch (t) {
|
|
358
364
|
case "hsl":
|
|
359
|
-
s =
|
|
365
|
+
s = E.get.hsl(e), r = "hsl";
|
|
360
366
|
break;
|
|
361
367
|
case "hwb":
|
|
362
|
-
s =
|
|
368
|
+
s = E.get.hwb(e), r = "hwb";
|
|
363
369
|
break;
|
|
364
370
|
default:
|
|
365
|
-
s =
|
|
371
|
+
s = E.get.rgb(e), r = "rgb";
|
|
366
372
|
break;
|
|
367
373
|
}
|
|
368
374
|
return s ? { model: r, value: s } : null;
|
|
369
375
|
};
|
|
370
|
-
|
|
376
|
+
E.get.rgb = function(e) {
|
|
371
377
|
if (!e)
|
|
372
378
|
return null;
|
|
373
|
-
var t = /^#([a-f0-9]{3,4})$/i, s = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, r = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, i = /^(\w+)$/,
|
|
374
|
-
if (
|
|
375
|
-
for (
|
|
379
|
+
var t = /^#([a-f0-9]{3,4})$/i, s = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i, r = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, i = /^(\w+)$/, n = [0, 0, 0, 1], a, l, d;
|
|
380
|
+
if (a = e.match(s)) {
|
|
381
|
+
for (d = a[2], a = a[1], l = 0; l < 3; l++) {
|
|
376
382
|
var c = l * 2;
|
|
377
|
-
|
|
383
|
+
n[l] = parseInt(a.slice(c, c + 2), 16);
|
|
378
384
|
}
|
|
379
|
-
|
|
380
|
-
} else if (
|
|
381
|
-
for (
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
} else if (
|
|
385
|
+
d && (n[3] = parseInt(d, 16) / 255);
|
|
386
|
+
} else if (a = e.match(t)) {
|
|
387
|
+
for (a = a[1], d = a[3], l = 0; l < 3; l++)
|
|
388
|
+
n[l] = parseInt(a[l] + a[l], 16);
|
|
389
|
+
d && (n[3] = parseInt(d + d, 16) / 255);
|
|
390
|
+
} else if (a = e.match(r)) {
|
|
385
391
|
for (l = 0; l < 3; l++)
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
} else if (
|
|
392
|
+
n[l] = parseInt(a[l + 1], 0);
|
|
393
|
+
a[4] && (a[5] ? n[3] = parseFloat(a[4]) * 0.01 : n[3] = parseFloat(a[4]));
|
|
394
|
+
} else if (a = e.match(o)) {
|
|
389
395
|
for (l = 0; l < 3; l++)
|
|
390
|
-
|
|
391
|
-
|
|
396
|
+
n[l] = Math.round(parseFloat(a[l + 1]) * 2.55);
|
|
397
|
+
a[4] && (a[5] ? n[3] = parseFloat(a[4]) * 0.01 : n[3] = parseFloat(a[4]));
|
|
392
398
|
} else
|
|
393
|
-
return (
|
|
399
|
+
return (a = e.match(i)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Ve.call(Y, a[1]) ? (n = Y[a[1]], n[3] = 1, n) : null : null;
|
|
394
400
|
for (l = 0; l < 3; l++)
|
|
395
|
-
|
|
396
|
-
return
|
|
401
|
+
n[l] = F(n[l], 0, 255);
|
|
402
|
+
return n[3] = F(n[3], 0, 1), n;
|
|
397
403
|
};
|
|
398
|
-
|
|
404
|
+
E.get.hsl = function(e) {
|
|
399
405
|
if (!e)
|
|
400
406
|
return null;
|
|
401
407
|
var t = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, s = e.match(t);
|
|
402
408
|
if (s) {
|
|
403
|
-
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i =
|
|
404
|
-
return [o, i,
|
|
409
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i = F(parseFloat(s[2]), 0, 100), n = F(parseFloat(s[3]), 0, 100), a = F(isNaN(r) ? 1 : r, 0, 1);
|
|
410
|
+
return [o, i, n, a];
|
|
405
411
|
}
|
|
406
412
|
return null;
|
|
407
413
|
};
|
|
408
|
-
|
|
414
|
+
E.get.hwb = function(e) {
|
|
409
415
|
if (!e)
|
|
410
416
|
return null;
|
|
411
417
|
var t = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, s = e.match(t);
|
|
412
418
|
if (s) {
|
|
413
|
-
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i =
|
|
414
|
-
return [o, i,
|
|
419
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, i = F(parseFloat(s[2]), 0, 100), n = F(parseFloat(s[3]), 0, 100), a = F(isNaN(r) ? 1 : r, 0, 1);
|
|
420
|
+
return [o, i, n, a];
|
|
415
421
|
}
|
|
416
422
|
return null;
|
|
417
423
|
};
|
|
418
|
-
|
|
419
|
-
var e =
|
|
420
|
-
return "#" +
|
|
424
|
+
E.to.hex = function() {
|
|
425
|
+
var e = K(arguments);
|
|
426
|
+
return "#" + re(e[0]) + re(e[1]) + re(e[2]) + (e[3] < 1 ? re(Math.round(e[3] * 255)) : "");
|
|
421
427
|
};
|
|
422
|
-
|
|
423
|
-
var e =
|
|
428
|
+
E.to.rgb = function() {
|
|
429
|
+
var e = K(arguments);
|
|
424
430
|
return e.length < 4 || e[3] === 1 ? "rgb(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ")" : "rgba(" + Math.round(e[0]) + ", " + Math.round(e[1]) + ", " + Math.round(e[2]) + ", " + e[3] + ")";
|
|
425
431
|
};
|
|
426
|
-
|
|
427
|
-
var e =
|
|
432
|
+
E.to.rgb.percent = function() {
|
|
433
|
+
var e = K(arguments), t = Math.round(e[0] / 255 * 100), s = Math.round(e[1] / 255 * 100), r = Math.round(e[2] / 255 * 100);
|
|
428
434
|
return e.length < 4 || e[3] === 1 ? "rgb(" + t + "%, " + s + "%, " + r + "%)" : "rgba(" + t + "%, " + s + "%, " + r + "%, " + e[3] + ")";
|
|
429
435
|
};
|
|
430
|
-
|
|
431
|
-
var e =
|
|
436
|
+
E.to.hsl = function() {
|
|
437
|
+
var e = K(arguments);
|
|
432
438
|
return e.length < 4 || e[3] === 1 ? "hsl(" + e[0] + ", " + e[1] + "%, " + e[2] + "%)" : "hsla(" + e[0] + ", " + e[1] + "%, " + e[2] + "%, " + e[3] + ")";
|
|
433
439
|
};
|
|
434
|
-
|
|
435
|
-
var e =
|
|
440
|
+
E.to.hwb = function() {
|
|
441
|
+
var e = K(arguments), t = "";
|
|
436
442
|
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
437
443
|
};
|
|
438
|
-
|
|
439
|
-
return
|
|
444
|
+
E.to.keyword = function(e) {
|
|
445
|
+
return Ue[e.slice(0, 3)];
|
|
440
446
|
};
|
|
441
|
-
function
|
|
447
|
+
function F(e, t, s) {
|
|
442
448
|
return Math.min(Math.max(t, e), s);
|
|
443
449
|
}
|
|
444
|
-
function
|
|
450
|
+
function re(e) {
|
|
445
451
|
var t = Math.round(e).toString(16).toUpperCase();
|
|
446
452
|
return t.length < 2 ? "0" + t : t;
|
|
447
453
|
}
|
|
448
|
-
function
|
|
454
|
+
function G() {
|
|
449
455
|
}
|
|
450
|
-
function
|
|
456
|
+
function oe(e) {
|
|
451
457
|
return document.createElement(e);
|
|
452
458
|
}
|
|
453
|
-
function
|
|
454
|
-
const s =
|
|
455
|
-
return
|
|
459
|
+
function w(e, t) {
|
|
460
|
+
const s = oe(e);
|
|
461
|
+
return Tt(s, t), s;
|
|
456
462
|
}
|
|
457
|
-
function
|
|
463
|
+
function H(e, t) {
|
|
458
464
|
return e.appendChild(t);
|
|
459
465
|
}
|
|
460
|
-
function
|
|
461
|
-
return `${
|
|
466
|
+
function _(e) {
|
|
467
|
+
return `${T}-${e}`;
|
|
462
468
|
}
|
|
463
|
-
function
|
|
464
|
-
e.className =
|
|
469
|
+
function Tt(e, t) {
|
|
470
|
+
e.className = _(t);
|
|
465
471
|
}
|
|
466
|
-
function
|
|
472
|
+
function Dt(e) {
|
|
467
473
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
468
474
|
}
|
|
469
|
-
function
|
|
475
|
+
function Ae(e, t) {
|
|
470
476
|
if (typeof e == "object" && e !== null)
|
|
471
477
|
return e[t];
|
|
472
478
|
}
|
|
473
|
-
function
|
|
479
|
+
function Ie() {
|
|
474
480
|
let e;
|
|
475
481
|
return [new Promise((s) => {
|
|
476
482
|
e = s;
|
|
477
483
|
}), e];
|
|
478
484
|
}
|
|
479
|
-
function
|
|
485
|
+
function Ft(e) {
|
|
480
486
|
const t = e.room, s = e.displayer;
|
|
481
487
|
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
482
488
|
}
|
|
483
|
-
function
|
|
489
|
+
function Be(e) {
|
|
484
490
|
try {
|
|
485
491
|
let t = window.getComputedStyle(e).backgroundColor;
|
|
486
492
|
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
487
|
-
return t =
|
|
493
|
+
return t = Rt(t), console.log("[Slide] guess bg color:", t), t;
|
|
488
494
|
if (e.parentElement)
|
|
489
|
-
return
|
|
495
|
+
return Be(e.parentElement);
|
|
490
496
|
} catch {
|
|
491
497
|
}
|
|
492
498
|
return "#ffffff";
|
|
493
499
|
}
|
|
494
|
-
function
|
|
500
|
+
function Rt(e) {
|
|
495
501
|
const t = Fe.exports.get(e);
|
|
496
502
|
if (t && t.model === "rgb") {
|
|
497
503
|
const s = t.value, o = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
@@ -499,26 +505,26 @@ function Nt(e) {
|
|
|
499
505
|
} else
|
|
500
506
|
return e;
|
|
501
507
|
}
|
|
502
|
-
function
|
|
503
|
-
return `${
|
|
508
|
+
function He(e, t) {
|
|
509
|
+
return `${Dt(t || Te)}/${e}`;
|
|
504
510
|
}
|
|
505
|
-
async function
|
|
506
|
-
const s =
|
|
511
|
+
async function Vt({ taskId: e, url: t }) {
|
|
512
|
+
const s = He(e, t), r = `${s}/preview/1.png`, o = `${s}/jsonOutput/slide-1.json`, i = new Promise((a) => {
|
|
507
513
|
const l = new Image();
|
|
508
|
-
l.onload = () =>
|
|
509
|
-
}),
|
|
510
|
-
return { preview: await i, slide: await
|
|
514
|
+
l.onload = () => a(l), l.onerror = () => a(null), l.src = r;
|
|
515
|
+
}), n = fetch(o).then((a) => a.json());
|
|
516
|
+
return { preview: await i, slide: await n };
|
|
511
517
|
}
|
|
512
|
-
function
|
|
518
|
+
function Ut(e) {
|
|
513
519
|
if (typeof document < "u") {
|
|
514
520
|
const t = () => e(document.visibilityState === "visible");
|
|
515
521
|
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
516
522
|
}
|
|
517
|
-
return
|
|
523
|
+
return G;
|
|
518
524
|
}
|
|
519
|
-
const
|
|
525
|
+
const Bt = `.netless-app-slide-tele-fancy-scrollbar{overscroll-behavior:contain;overflow:auto;overflow-y:scroll;overflow-y:overlay;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;scrollbar-width:auto}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar{height:8px;width:8px}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-track{background-color:transparent}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb{background-color:#444e601a;background-color:transparent;border-radius:4px;transition:background-color .4s}.netless-app-slide-tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb{background-color:#444e601a}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#444e6033}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:active{background-color:#444e6033}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical{min-height:50px}.netless-app-slide-tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal{min-width:50px}.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-slide{width:100%;height:100%;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:10200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:10300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:10100;top:0;left:0;width:100%;height:100%;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{display:flex;align-items:center;height:26px;margin-left:auto;font-size:13px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;word-break:keep-all;font-variant-numeric:tabular-nums}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 .5em 0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background:transparent;transition:background .4s;font-variant-numeric:tabular-nums;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{user-select:text;background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly .netless-app-slide-footer-btn{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-footer-btn:hover{background:transparent}.netless-app-slide-readonly .netless-app-slide-page-number-input{cursor:not-allowed}.netless-app-slide-readonly .netless-app-slide-page-number-input:hover,.netless-app-slide-readonly .netless-app-slide-page-number-input:focus,.netless-app-slide-readonly .netless-app-slide-page-number-input:active{background:transparent;box-shadow:none}.netless-app-slide-readonly .netless-app-slide-page-number-input:disabled{color:inherit}.netless-app-slide-readonly.netless-app-slide-float-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:currentColor;background:#25282e}.telebox-color-scheme-dark .netless-app-slide-footer{border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-preview-wrapper{width:100%;height:100%;overflow:hidden;display:flex;flex-flow:column nowrap}.netless-app-slide-preview-wrapper .netless-app-slide-content{flex:1}.netless-app-slide-preview-wrapper .netless-app-slide-footer{flex-shrink:0}
|
|
520
526
|
`;
|
|
521
|
-
function
|
|
527
|
+
function Ht(e) {
|
|
522
528
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
523
529
|
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
524
530
|
const r = document.createElementNS(t, "path");
|
|
@@ -527,7 +533,7 @@ function Ft(e) {
|
|
|
527
533
|
"M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"
|
|
528
534
|
), s.appendChild(r), s;
|
|
529
535
|
}
|
|
530
|
-
function
|
|
536
|
+
function qt(e) {
|
|
531
537
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
532
538
|
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
533
539
|
const r = document.createElementNS(t, "path");
|
|
@@ -536,7 +542,7 @@ function Dt(e) {
|
|
|
536
542
|
"M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"
|
|
537
543
|
), s.appendChild(r), s;
|
|
538
544
|
}
|
|
539
|
-
function
|
|
545
|
+
function jt(e) {
|
|
540
546
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
541
547
|
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
542
548
|
const r = document.createElementNS(t, "path");
|
|
@@ -545,7 +551,7 @@ function Rt(e) {
|
|
|
545
551
|
"M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"
|
|
546
552
|
), s.appendChild(r), s;
|
|
547
553
|
}
|
|
548
|
-
function
|
|
554
|
+
function Gt(e) {
|
|
549
555
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
550
556
|
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
551
557
|
const r = document.createElementNS(t, "path");
|
|
@@ -554,7 +560,7 @@ function Vt(e) {
|
|
|
554
560
|
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
|
555
561
|
), s.appendChild(r), s;
|
|
556
562
|
}
|
|
557
|
-
function
|
|
563
|
+
function Wt(e) {
|
|
558
564
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
559
565
|
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
560
566
|
const r = document.createElementNS(t, "path");
|
|
@@ -563,80 +569,113 @@ function Ut(e) {
|
|
|
563
569
|
"M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"
|
|
564
570
|
), s.appendChild(r), s;
|
|
565
571
|
}
|
|
566
|
-
function
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
572
|
+
function Jt(e) {
|
|
573
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
574
|
+
s.setAttribute("class", `${e}-footer-icon-save`), s.setAttribute("viewBox", "0 0 448 512");
|
|
575
|
+
const r = document.createElementNS(t, "path");
|
|
576
|
+
return r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
577
|
+
"d",
|
|
578
|
+
"M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z"
|
|
579
|
+
), s.appendChild(r), s;
|
|
580
|
+
}
|
|
581
|
+
function Xt(e) {
|
|
582
|
+
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
583
|
+
s.setAttribute("class", `${e}-footer-icon-spinner`), s.setAttribute("viewBox", "0 0 512 512");
|
|
584
|
+
const r = document.createElementNS(t, "path");
|
|
585
|
+
r.setAttribute("fill", "currentColor"), r.setAttribute(
|
|
586
|
+
"d",
|
|
587
|
+
"M304 48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zm0 416c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM48 304c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm464-48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48zM142.9 437c18.7-18.7 18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zm0-294.2c18.7-18.7 18.7-49.1 0-67.9S93.7 56.2 75 75s-18.7 49.1 0 67.9s49.1 18.7 67.9 0zM369.1 437c18.7 18.7 49.1 18.7 67.9 0s18.7-49.1 0-67.9s-49.1-18.7-67.9 0s-18.7 49.1 0 67.9z"
|
|
588
|
+
);
|
|
589
|
+
const o = document.createElementNS(t, "animateTransform");
|
|
590
|
+
o.setAttribute("attributeName", "transform"), o.setAttribute("attributeType", "xml"), o.setAttribute("type", "rotate"), o.setAttribute("from", "0 256 256"), o.setAttribute("to", "360 256 256"), o.setAttribute("begin", "0s"), o.setAttribute("dur", "2s"), o.setAttribute("fill", "freeze"), o.setAttribute("repeatCount", "indefinite"), r.appendChild(o);
|
|
591
|
+
const i = document.createElementNS(t, "text");
|
|
592
|
+
return i.setAttribute("x", "125"), i.setAttribute("y", "345"), i.setAttribute("data-id", "progress"), i.style.fontSize = "246px", i.textContent = "20", s.appendChild(i), s.appendChild(r), s;
|
|
593
|
+
}
|
|
594
|
+
function Yt() {
|
|
595
|
+
let e = G;
|
|
596
|
+
const t = (p) => {
|
|
597
|
+
e = p;
|
|
570
598
|
};
|
|
571
|
-
let s =
|
|
572
|
-
const r = (
|
|
573
|
-
s =
|
|
599
|
+
let s = G;
|
|
600
|
+
const r = (p) => {
|
|
601
|
+
s = p;
|
|
574
602
|
};
|
|
575
|
-
let o =
|
|
576
|
-
const i = (
|
|
577
|
-
o =
|
|
603
|
+
let o = G;
|
|
604
|
+
const i = (p) => {
|
|
605
|
+
o = p;
|
|
578
606
|
};
|
|
579
|
-
let
|
|
580
|
-
const c =
|
|
581
|
-
_(
|
|
582
|
-
|
|
583
|
-
_(h, "btn-sidebar"), h.classList.add(b("footer-btn")), h.appendChild(Ft(H)), h.onclick = function() {
|
|
584
|
-
a || s();
|
|
607
|
+
let n = !1, a = !1, l = 0, d = 0;
|
|
608
|
+
const c = w("div", "footer"), h = w("button", "btn-sidebar");
|
|
609
|
+
h.classList.add(_("footer-btn")), h.appendChild(Ht(T)), h.onclick = function() {
|
|
610
|
+
n || s();
|
|
585
611
|
}, h.style.display = "none", c.appendChild(h);
|
|
586
|
-
const
|
|
587
|
-
_(
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
a || (m.classList.add(b("footer-btn-playing")), o(), clearTimeout(V), V = setTimeout(() => {
|
|
597
|
-
m.classList.remove(b("footer-btn-playing"));
|
|
612
|
+
const g = w("div", "page-jumps"), y = w("button", "btn-page-back");
|
|
613
|
+
y.classList.add(_("footer-btn")), y.appendChild(qt(T)), y.onclick = function() {
|
|
614
|
+
n || e(l - 1);
|
|
615
|
+
}, g.appendChild(y);
|
|
616
|
+
const b = w("button", "btn-page-play");
|
|
617
|
+
b.classList.add(_("footer-btn")), b.appendChild(jt(T)), b.appendChild(Gt(T));
|
|
618
|
+
let z = 0;
|
|
619
|
+
b.onclick = function() {
|
|
620
|
+
n || (b.classList.add(_("footer-btn-playing")), o(), clearTimeout(z), z = setTimeout(() => {
|
|
621
|
+
b.classList.remove(_("footer-btn-playing"));
|
|
598
622
|
}, 500));
|
|
599
|
-
},
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
},
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
_(S, "page-number-input"), S.value = String(l + 1), S.onchange = function() {
|
|
608
|
-
a || S.value && e(Number(S.value) - 1);
|
|
623
|
+
}, g.appendChild(b);
|
|
624
|
+
const I = w("button", "btn-page-next");
|
|
625
|
+
I.classList.add(_("footer-btn")), I.appendChild(Wt(T)), I.onclick = function() {
|
|
626
|
+
n || e(l + 1);
|
|
627
|
+
}, g.appendChild(I);
|
|
628
|
+
const k = w("div", "page-number"), m = w("input", "page-number-input");
|
|
629
|
+
m.value = String(l + 1), m.onchange = function() {
|
|
630
|
+
n || m.value && e(Number(m.value) - 1);
|
|
609
631
|
};
|
|
610
|
-
const f =
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
|
|
632
|
+
const f = w("span", "total-page");
|
|
633
|
+
f.textContent = " / ", k.appendChild(m), k.appendChild(f), c.appendChild(g), c.appendChild(k);
|
|
634
|
+
const S = _("readonly");
|
|
635
|
+
let v = G;
|
|
636
|
+
const x = (p) => {
|
|
637
|
+
v = p;
|
|
638
|
+
}, O = (p) => {
|
|
639
|
+
if (p < 99) {
|
|
640
|
+
A.style.display = "block", B.style.display = "none";
|
|
641
|
+
const se = A.querySelector("[data-id]");
|
|
642
|
+
se && (se.textContent = p.toString().padStart(2, "0"));
|
|
643
|
+
} else
|
|
644
|
+
A.style.display = "none", B.style.display = "block";
|
|
645
|
+
}, B = Jt(T), A = Xt(T);
|
|
646
|
+
A.style.display = "none";
|
|
647
|
+
const L = w("button", "footer-btn");
|
|
648
|
+
L.appendChild(B), L.onclick = function() {
|
|
649
|
+
v(O);
|
|
650
|
+
}, L.appendChild(A), c.appendChild(L);
|
|
651
|
+
function P(p) {
|
|
652
|
+
n !== p && (n = p, c.classList.toggle(S, n), m.disabled = n);
|
|
615
653
|
}
|
|
616
|
-
function
|
|
617
|
-
|
|
654
|
+
function vt(p) {
|
|
655
|
+
a !== p && (a = p, h.style.display = a ? "" : "none");
|
|
618
656
|
}
|
|
619
|
-
function
|
|
620
|
-
(
|
|
657
|
+
function wt(p, se = !1) {
|
|
658
|
+
(se || l !== p) && (l = p, m.value = String(l + 1));
|
|
621
659
|
}
|
|
622
|
-
function
|
|
623
|
-
|
|
660
|
+
function _t(p) {
|
|
661
|
+
d !== p && (d = p, f.textContent = ` / ${d}`);
|
|
624
662
|
}
|
|
625
663
|
return {
|
|
626
664
|
$footer: c,
|
|
627
|
-
$pageNumberInput:
|
|
628
|
-
set_readonly:
|
|
629
|
-
set_sidebar:
|
|
630
|
-
set_page_index:
|
|
631
|
-
set_page_count:
|
|
665
|
+
$pageNumberInput: m,
|
|
666
|
+
set_readonly: P,
|
|
667
|
+
set_sidebar: vt,
|
|
668
|
+
set_page_index: wt,
|
|
669
|
+
set_page_count: _t,
|
|
632
670
|
on_new_page_index: t,
|
|
633
671
|
on_toggle_preview: r,
|
|
634
|
-
on_play: i
|
|
672
|
+
on_play: i,
|
|
673
|
+
on_save_to_pdf: x
|
|
635
674
|
};
|
|
636
675
|
}
|
|
637
|
-
const
|
|
676
|
+
const V = typeof window < "u", qe = V && !("onscroll" in window) || typeof navigator < "u" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent), je = V && "IntersectionObserver" in window, Ge = V && "classList" in document.createElement("p"), We = V && window.devicePixelRatio > 1, Zt = {
|
|
638
677
|
elements_selector: ".lazy",
|
|
639
|
-
container:
|
|
678
|
+
container: qe || V ? document : null,
|
|
640
679
|
threshold: 300,
|
|
641
680
|
thresholds: null,
|
|
642
681
|
data_src: "src",
|
|
@@ -667,7 +706,7 @@ const P = typeof window < "u", Be = P && !("onscroll" in window) || typeof navig
|
|
|
667
706
|
callback_cancel: null,
|
|
668
707
|
use_native: !1,
|
|
669
708
|
restore_on_error: !1
|
|
670
|
-
},
|
|
709
|
+
}, Je = (e) => Object.assign({}, Zt, e), ze = function(e, t) {
|
|
671
710
|
let s;
|
|
672
711
|
const r = "LazyLoad::Initialized", o = new e(t);
|
|
673
712
|
try {
|
|
@@ -676,21 +715,21 @@ const P = typeof window < "u", Be = P && !("onscroll" in window) || typeof navig
|
|
|
676
715
|
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance: o });
|
|
677
716
|
}
|
|
678
717
|
window.dispatchEvent(s);
|
|
679
|
-
},
|
|
718
|
+
}, Kt = (e, t) => {
|
|
680
719
|
if (!!t)
|
|
681
720
|
if (!t.length)
|
|
682
|
-
|
|
721
|
+
ze(e, t);
|
|
683
722
|
else
|
|
684
723
|
for (let s = 0, r; r = t[s]; s += 1)
|
|
685
|
-
|
|
686
|
-
},
|
|
687
|
-
var r =
|
|
724
|
+
ze(e, r);
|
|
725
|
+
}, N = "src", he = "srcset", fe = "sizes", Xe = "poster", Q = "llOriginalAttrs", Ye = "data", ge = "loading", Ze = "loaded", Ke = "applied", Qt = "entered", be = "error", Qe = "native", et = "data-", tt = "ll-status", C = (e, t) => e.getAttribute(et + t), es = (e, t, s) => {
|
|
726
|
+
var r = et + t;
|
|
688
727
|
if (s === null) {
|
|
689
728
|
e.removeAttribute(r);
|
|
690
729
|
return;
|
|
691
730
|
}
|
|
692
731
|
e.setAttribute(r, s);
|
|
693
|
-
}, ee = (e) =>
|
|
732
|
+
}, ee = (e) => C(e, tt), j = (e, t) => es(e, tt, t), ae = (e) => j(e, null), me = (e) => ee(e) === null, ts = (e) => ee(e) === ge, ss = (e) => ee(e) === be, ve = (e) => ee(e) === Qe, rs = [ge, Ze, Ke, be], os = (e) => rs.indexOf(ee(e)) >= 0, U = (e, t, s, r) => {
|
|
694
733
|
if (!!e) {
|
|
695
734
|
if (r !== void 0) {
|
|
696
735
|
e(t, s, r);
|
|
@@ -702,361 +741,361 @@ const P = typeof window < "u", Be = P && !("onscroll" in window) || typeof navig
|
|
|
702
741
|
}
|
|
703
742
|
e(t);
|
|
704
743
|
}
|
|
705
|
-
},
|
|
706
|
-
if (
|
|
744
|
+
}, J = (e, t) => {
|
|
745
|
+
if (Ge) {
|
|
707
746
|
e.classList.add(t);
|
|
708
747
|
return;
|
|
709
748
|
}
|
|
710
749
|
e.className += (e.className ? " " : "") + t;
|
|
711
|
-
},
|
|
712
|
-
if (
|
|
750
|
+
}, $ = (e, t) => {
|
|
751
|
+
if (Ge) {
|
|
713
752
|
e.classList.remove(t);
|
|
714
753
|
return;
|
|
715
754
|
}
|
|
716
755
|
e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
|
717
|
-
},
|
|
756
|
+
}, ns = (e) => {
|
|
718
757
|
e.llTempImage = document.createElement("IMG");
|
|
719
|
-
},
|
|
758
|
+
}, as = (e) => {
|
|
720
759
|
delete e.llTempImage;
|
|
721
|
-
},
|
|
760
|
+
}, st = (e) => e.llTempImage, ie = (e, t) => {
|
|
722
761
|
if (!t)
|
|
723
762
|
return;
|
|
724
763
|
const s = t._observer;
|
|
725
764
|
!s || s.unobserve(e);
|
|
726
|
-
},
|
|
765
|
+
}, is = (e) => {
|
|
727
766
|
e.disconnect();
|
|
728
|
-
},
|
|
729
|
-
t.unobserve_entered &&
|
|
730
|
-
},
|
|
767
|
+
}, ls = (e, t, s) => {
|
|
768
|
+
t.unobserve_entered && ie(e, s);
|
|
769
|
+
}, we = (e, t) => {
|
|
731
770
|
!e || (e.loadingCount += t);
|
|
732
|
-
},
|
|
771
|
+
}, cs = (e) => {
|
|
733
772
|
!e || (e.toLoadCount -= 1);
|
|
734
|
-
},
|
|
773
|
+
}, rt = (e, t) => {
|
|
735
774
|
!e || (e.toLoadCount = t);
|
|
736
|
-
},
|
|
775
|
+
}, ds = (e) => e.loadingCount > 0, us = (e) => e.toLoadCount > 0, ot = (e) => {
|
|
737
776
|
let t = [];
|
|
738
777
|
for (let s = 0, r; r = e.children[s]; s += 1)
|
|
739
778
|
r.tagName === "SOURCE" && t.push(r);
|
|
740
779
|
return t;
|
|
741
|
-
},
|
|
780
|
+
}, _e = (e, t) => {
|
|
742
781
|
const s = e.parentNode;
|
|
743
782
|
if (!s || s.tagName !== "PICTURE")
|
|
744
783
|
return;
|
|
745
|
-
|
|
746
|
-
},
|
|
747
|
-
|
|
748
|
-
},
|
|
749
|
-
if (
|
|
784
|
+
ot(s).forEach(t);
|
|
785
|
+
}, nt = (e, t) => {
|
|
786
|
+
ot(e).forEach(t);
|
|
787
|
+
}, le = [N], at = [N, Xe], Z = [N, he, fe], it = [Ye], ce = (e) => !!e[Q], lt = (e) => e[Q], ct = (e) => delete e[Q], W = (e, t) => {
|
|
788
|
+
if (ce(e))
|
|
750
789
|
return;
|
|
751
790
|
const s = {};
|
|
752
791
|
t.forEach((r) => {
|
|
753
792
|
s[r] = e.getAttribute(r);
|
|
754
|
-
}), e[
|
|
755
|
-
},
|
|
756
|
-
|
|
757
|
-
},
|
|
793
|
+
}), e[Q] = s;
|
|
794
|
+
}, ps = (e) => {
|
|
795
|
+
ce(e) || (e[Q] = { backgroundImage: e.style.backgroundImage });
|
|
796
|
+
}, hs = (e, t, s) => {
|
|
758
797
|
if (!s) {
|
|
759
798
|
e.removeAttribute(t);
|
|
760
799
|
return;
|
|
761
800
|
}
|
|
762
801
|
e.setAttribute(t, s);
|
|
763
|
-
},
|
|
764
|
-
if (!
|
|
802
|
+
}, q = (e, t) => {
|
|
803
|
+
if (!ce(e))
|
|
765
804
|
return;
|
|
766
|
-
const s =
|
|
805
|
+
const s = lt(e);
|
|
767
806
|
t.forEach((r) => {
|
|
768
|
-
|
|
807
|
+
hs(e, r, s[r]);
|
|
769
808
|
});
|
|
770
|
-
},
|
|
771
|
-
if (!
|
|
809
|
+
}, fs = (e) => {
|
|
810
|
+
if (!ce(e))
|
|
772
811
|
return;
|
|
773
|
-
const t =
|
|
812
|
+
const t = lt(e);
|
|
774
813
|
e.style.backgroundImage = t.backgroundImage;
|
|
775
|
-
}, ct = (e, t, s) => {
|
|
776
|
-
G(e, t.class_applied), R(e, Qe), s && (t.unobserve_completed && ne(e, t), T(t.callback_applied, e, s));
|
|
777
814
|
}, dt = (e, t, s) => {
|
|
778
|
-
|
|
779
|
-
},
|
|
815
|
+
J(e, t.class_applied), j(e, Ke), s && (t.unobserve_completed && ie(e, t), U(t.callback_applied, e, s));
|
|
816
|
+
}, ut = (e, t, s) => {
|
|
817
|
+
J(e, t.class_loading), j(e, ge), s && (we(s, 1), U(t.callback_loading, e, s));
|
|
818
|
+
}, R = (e, t, s) => {
|
|
780
819
|
!s || e.setAttribute(t, s);
|
|
781
|
-
},
|
|
782
|
-
|
|
783
|
-
},
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}),
|
|
787
|
-
},
|
|
788
|
-
|
|
789
|
-
},
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}),
|
|
793
|
-
},
|
|
794
|
-
|
|
795
|
-
},
|
|
796
|
-
const r =
|
|
797
|
-
!i || (e.style.backgroundImage = `url("${i}")`,
|
|
798
|
-
},
|
|
799
|
-
const r =
|
|
800
|
-
!i || (e.style.backgroundImage = i,
|
|
801
|
-
},
|
|
802
|
-
const r =
|
|
820
|
+
}, $e = (e, t) => {
|
|
821
|
+
R(e, fe, C(e, t.data_sizes)), R(e, he, C(e, t.data_srcset)), R(e, N, C(e, t.data_src));
|
|
822
|
+
}, gs = (e, t) => {
|
|
823
|
+
_e(e, (s) => {
|
|
824
|
+
W(s, Z), $e(s, t);
|
|
825
|
+
}), W(e, Z), $e(e, t);
|
|
826
|
+
}, bs = (e, t) => {
|
|
827
|
+
W(e, le), R(e, N, C(e, t.data_src));
|
|
828
|
+
}, ms = (e, t) => {
|
|
829
|
+
nt(e, (s) => {
|
|
830
|
+
W(s, le), R(s, N, C(s, t.data_src));
|
|
831
|
+
}), W(e, at), R(e, Xe, C(e, t.data_poster)), R(e, N, C(e, t.data_src)), e.load();
|
|
832
|
+
}, vs = (e, t) => {
|
|
833
|
+
W(e, it), R(e, Ye, C(e, t.data_src));
|
|
834
|
+
}, ws = (e, t, s) => {
|
|
835
|
+
const r = C(e, t.data_bg), o = C(e, t.data_bg_hidpi), i = We && o ? o : r;
|
|
836
|
+
!i || (e.style.backgroundImage = `url("${i}")`, st(e).setAttribute(N, i), ut(e, t, s));
|
|
837
|
+
}, _s = (e, t, s) => {
|
|
838
|
+
const r = C(e, t.data_bg_multi), o = C(e, t.data_bg_multi_hidpi), i = We && o ? o : r;
|
|
839
|
+
!i || (e.style.backgroundImage = i, dt(e, t, s));
|
|
840
|
+
}, ys = (e, t, s) => {
|
|
841
|
+
const r = C(e, t.data_bg_set);
|
|
803
842
|
if (!r)
|
|
804
843
|
return;
|
|
805
844
|
const o = r.split("|");
|
|
806
|
-
let i = o.map((
|
|
807
|
-
e.style.backgroundImage = i.join(), e.style.backgroundImage === "" && (i = o.map((
|
|
808
|
-
},
|
|
809
|
-
IMG:
|
|
810
|
-
IFRAME:
|
|
811
|
-
VIDEO:
|
|
812
|
-
OBJECT:
|
|
813
|
-
},
|
|
814
|
-
const s =
|
|
845
|
+
let i = o.map((n) => `image-set(${n})`);
|
|
846
|
+
e.style.backgroundImage = i.join(), e.style.backgroundImage === "" && (i = o.map((n) => `-webkit-image-set(${n})`), e.style.backgroundImage = i.join()), dt(e, t, s);
|
|
847
|
+
}, pt = {
|
|
848
|
+
IMG: gs,
|
|
849
|
+
IFRAME: bs,
|
|
850
|
+
VIDEO: ms,
|
|
851
|
+
OBJECT: vs
|
|
852
|
+
}, ks = (e, t) => {
|
|
853
|
+
const s = pt[e.tagName];
|
|
815
854
|
!s || s(e, t);
|
|
816
|
-
},
|
|
817
|
-
const r =
|
|
818
|
-
!r || (r(e, t),
|
|
819
|
-
},
|
|
820
|
-
t && !
|
|
821
|
-
},
|
|
855
|
+
}, Ss = (e, t, s) => {
|
|
856
|
+
const r = pt[e.tagName];
|
|
857
|
+
!r || (r(e, t), ut(e, t, s));
|
|
858
|
+
}, xs = ["IMG", "IFRAME", "VIDEO", "OBJECT"], Cs = (e) => xs.indexOf(e.tagName) > -1, ht = (e, t) => {
|
|
859
|
+
t && !ds(t) && !us(t) && U(e.callback_finish, t);
|
|
860
|
+
}, Le = (e, t, s) => {
|
|
822
861
|
e.addEventListener(t, s), e.llEvLisnrs[t] = s;
|
|
823
|
-
},
|
|
862
|
+
}, Es = (e, t, s) => {
|
|
824
863
|
e.removeEventListener(t, s);
|
|
825
|
-
},
|
|
826
|
-
|
|
864
|
+
}, ye = (e) => !!e.llEvLisnrs, As = (e, t, s) => {
|
|
865
|
+
ye(e) || (e.llEvLisnrs = {});
|
|
827
866
|
const r = e.tagName === "VIDEO" ? "loadeddata" : "load";
|
|
828
|
-
|
|
829
|
-
},
|
|
830
|
-
if (!
|
|
867
|
+
Le(e, r, t), Le(e, "error", s);
|
|
868
|
+
}, pe = (e) => {
|
|
869
|
+
if (!ye(e))
|
|
831
870
|
return;
|
|
832
871
|
const t = e.llEvLisnrs;
|
|
833
872
|
for (let s in t) {
|
|
834
873
|
const r = t[s];
|
|
835
|
-
|
|
874
|
+
Es(e, s, r);
|
|
836
875
|
}
|
|
837
876
|
delete e.llEvLisnrs;
|
|
838
|
-
},
|
|
839
|
-
|
|
840
|
-
},
|
|
841
|
-
const o =
|
|
842
|
-
|
|
843
|
-
},
|
|
844
|
-
const o =
|
|
845
|
-
|
|
846
|
-
},
|
|
847
|
-
const r =
|
|
848
|
-
if (
|
|
877
|
+
}, ft = (e, t, s) => {
|
|
878
|
+
as(e), we(s, -1), cs(s), $(e, t.class_loading), t.unobserve_completed && ie(e, s);
|
|
879
|
+
}, Is = (e, t, s, r) => {
|
|
880
|
+
const o = ve(t);
|
|
881
|
+
ft(t, s, r), J(t, s.class_loaded), j(t, Ze), U(s.callback_loaded, t, r), o || ht(s, r);
|
|
882
|
+
}, zs = (e, t, s, r) => {
|
|
883
|
+
const o = ve(t);
|
|
884
|
+
ft(t, s, r), J(t, s.class_error), j(t, be), U(s.callback_error, t, r), s.restore_on_error && q(t, Z), o || ht(s, r);
|
|
885
|
+
}, ke = (e, t, s) => {
|
|
886
|
+
const r = st(e) || e;
|
|
887
|
+
if (ye(r))
|
|
849
888
|
return;
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
}, (
|
|
853
|
-
|
|
889
|
+
As(r, (n) => {
|
|
890
|
+
Is(n, e, t, s), pe(r);
|
|
891
|
+
}, (n) => {
|
|
892
|
+
zs(n, e, t, s), pe(r);
|
|
854
893
|
});
|
|
855
|
-
},
|
|
856
|
-
|
|
857
|
-
},
|
|
858
|
-
|
|
859
|
-
},
|
|
860
|
-
|
|
861
|
-
},
|
|
862
|
-
e.setAttribute("loading", "lazy"),
|
|
863
|
-
},
|
|
864
|
-
e.removeAttribute(
|
|
865
|
-
},
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}),
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}),
|
|
873
|
-
},
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}),
|
|
877
|
-
},
|
|
878
|
-
|
|
879
|
-
},
|
|
880
|
-
|
|
881
|
-
},
|
|
882
|
-
IMG:
|
|
883
|
-
IFRAME:
|
|
884
|
-
VIDEO:
|
|
885
|
-
OBJECT:
|
|
886
|
-
},
|
|
887
|
-
const t =
|
|
894
|
+
}, $s = (e, t, s) => {
|
|
895
|
+
ns(e), ke(e, t, s), ps(e), ws(e, t, s), _s(e, t, s), ys(e, t, s);
|
|
896
|
+
}, Ls = (e, t, s) => {
|
|
897
|
+
ke(e, t, s), Ss(e, t, s);
|
|
898
|
+
}, Se = (e, t, s) => {
|
|
899
|
+
Cs(e) ? Ls(e, t, s) : $s(e, t, s);
|
|
900
|
+
}, Ms = (e, t, s) => {
|
|
901
|
+
e.setAttribute("loading", "lazy"), ke(e, t, s), ks(e, t), j(e, Qe);
|
|
902
|
+
}, Me = (e) => {
|
|
903
|
+
e.removeAttribute(N), e.removeAttribute(he), e.removeAttribute(fe);
|
|
904
|
+
}, Ns = (e) => {
|
|
905
|
+
_e(e, (t) => {
|
|
906
|
+
Me(t);
|
|
907
|
+
}), Me(e);
|
|
908
|
+
}, gt = (e) => {
|
|
909
|
+
_e(e, (t) => {
|
|
910
|
+
q(t, Z);
|
|
911
|
+
}), q(e, Z);
|
|
912
|
+
}, Os = (e) => {
|
|
913
|
+
nt(e, (t) => {
|
|
914
|
+
q(t, le);
|
|
915
|
+
}), q(e, at), e.load();
|
|
916
|
+
}, Ps = (e) => {
|
|
917
|
+
q(e, le);
|
|
918
|
+
}, Ts = (e) => {
|
|
919
|
+
q(e, it);
|
|
920
|
+
}, Ds = {
|
|
921
|
+
IMG: gt,
|
|
922
|
+
IFRAME: Ps,
|
|
923
|
+
VIDEO: Os,
|
|
924
|
+
OBJECT: Ts
|
|
925
|
+
}, Fs = (e) => {
|
|
926
|
+
const t = Ds[e.tagName];
|
|
888
927
|
if (!t) {
|
|
889
|
-
|
|
928
|
+
fs(e);
|
|
890
929
|
return;
|
|
891
930
|
}
|
|
892
931
|
t(e);
|
|
893
|
-
},
|
|
894
|
-
|
|
895
|
-
},
|
|
896
|
-
|
|
897
|
-
},
|
|
898
|
-
!s.cancel_on_exit || !
|
|
899
|
-
},
|
|
900
|
-
const o =
|
|
901
|
-
|
|
902
|
-
},
|
|
903
|
-
|
|
904
|
-
},
|
|
932
|
+
}, Rs = (e, t) => {
|
|
933
|
+
me(e) || ve(e) || ($(e, t.class_entered), $(e, t.class_exited), $(e, t.class_applied), $(e, t.class_loading), $(e, t.class_loaded), $(e, t.class_error));
|
|
934
|
+
}, Vs = (e, t) => {
|
|
935
|
+
Fs(e), Rs(e, t), ae(e), ct(e);
|
|
936
|
+
}, Us = (e, t, s, r) => {
|
|
937
|
+
!s.cancel_on_exit || !ts(e) || e.tagName === "IMG" && (pe(e), Ns(e), gt(e), $(e, s.class_loading), we(r, -1), ae(e), U(s.callback_cancel, e, t, r));
|
|
938
|
+
}, Bs = (e, t, s, r) => {
|
|
939
|
+
const o = os(e);
|
|
940
|
+
j(e, Qt), J(e, s.class_entered), $(e, s.class_exited), ls(e, s, r), U(s.callback_enter, e, t, r), !o && Se(e, s, r);
|
|
941
|
+
}, Hs = (e, t, s, r) => {
|
|
942
|
+
me(e) || (J(e, s.class_exited), Us(e, t, s, r), U(s.callback_exit, e, t, r));
|
|
943
|
+
}, qs = ["IMG", "IFRAME", "VIDEO"], bt = (e) => e.use_native && "loading" in HTMLImageElement.prototype, js = (e, t, s) => {
|
|
905
944
|
e.forEach((r) => {
|
|
906
|
-
|
|
907
|
-
}),
|
|
908
|
-
},
|
|
945
|
+
qs.indexOf(r.tagName) !== -1 && Ms(r, t, s);
|
|
946
|
+
}), rt(s, 0);
|
|
947
|
+
}, Gs = (e) => e.isIntersecting || e.intersectionRatio > 0, Ws = (e) => ({
|
|
909
948
|
root: e.container === document ? null : e.container,
|
|
910
949
|
rootMargin: e.thresholds || e.threshold + "px"
|
|
911
|
-
}),
|
|
950
|
+
}), Js = (e, t, s) => {
|
|
912
951
|
e.forEach(
|
|
913
|
-
(r) =>
|
|
952
|
+
(r) => Gs(r) ? Bs(r.target, r, t, s) : Hs(r.target, r, t, s)
|
|
914
953
|
);
|
|
915
|
-
},
|
|
954
|
+
}, Xs = (e, t) => {
|
|
916
955
|
t.forEach((s) => {
|
|
917
956
|
e.observe(s);
|
|
918
957
|
});
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
},
|
|
922
|
-
!
|
|
923
|
-
|
|
924
|
-
},
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
|
|
958
|
+
}, Ys = (e, t) => {
|
|
959
|
+
is(e), Xs(e, t);
|
|
960
|
+
}, Zs = (e, t) => {
|
|
961
|
+
!je || bt(e) || (t._observer = new IntersectionObserver((s) => {
|
|
962
|
+
Js(s, e, t);
|
|
963
|
+
}, Ws(e)));
|
|
964
|
+
}, mt = (e) => Array.prototype.slice.call(e), ne = (e) => e.container.querySelectorAll(e.elements_selector), Ks = (e) => mt(e).filter(me), Qs = (e) => ss(e), er = (e) => mt(e).filter(Qs), Ne = (e, t) => Ks(e || ne(t)), tr = (e, t) => {
|
|
965
|
+
er(ne(e)).forEach((r) => {
|
|
966
|
+
$(r, e.class_error), ae(r);
|
|
928
967
|
}), t.update();
|
|
929
|
-
},
|
|
930
|
-
!
|
|
931
|
-
|
|
968
|
+
}, sr = (e, t) => {
|
|
969
|
+
!V || (t._onlineHandler = () => {
|
|
970
|
+
tr(e, t);
|
|
932
971
|
}, window.addEventListener("online", t._onlineHandler));
|
|
933
|
-
},
|
|
934
|
-
!
|
|
972
|
+
}, rr = (e) => {
|
|
973
|
+
!V || window.removeEventListener("online", e._onlineHandler);
|
|
935
974
|
}, te = function(e, t) {
|
|
936
|
-
const s =
|
|
937
|
-
this._settings = s, this.loadingCount = 0,
|
|
975
|
+
const s = Je(e);
|
|
976
|
+
this._settings = s, this.loadingCount = 0, Zs(s, this), sr(s, this), this.update(t);
|
|
938
977
|
};
|
|
939
978
|
te.prototype = {
|
|
940
979
|
update: function(e) {
|
|
941
|
-
const t = this._settings, s =
|
|
942
|
-
if (
|
|
980
|
+
const t = this._settings, s = Ne(e, t);
|
|
981
|
+
if (rt(this, s.length), qe || !je) {
|
|
943
982
|
this.loadAll(s);
|
|
944
983
|
return;
|
|
945
984
|
}
|
|
946
|
-
if (
|
|
947
|
-
|
|
985
|
+
if (bt(t)) {
|
|
986
|
+
js(s, t, this);
|
|
948
987
|
return;
|
|
949
988
|
}
|
|
950
|
-
|
|
989
|
+
Ys(this._observer, s);
|
|
951
990
|
},
|
|
952
991
|
destroy: function() {
|
|
953
|
-
this._observer && this._observer.disconnect(),
|
|
954
|
-
|
|
992
|
+
this._observer && this._observer.disconnect(), rr(this), ne(this._settings).forEach((e) => {
|
|
993
|
+
ct(e);
|
|
955
994
|
}), delete this._observer, delete this._settings, delete this._onlineHandler, delete this.loadingCount, delete this.toLoadCount;
|
|
956
995
|
},
|
|
957
996
|
loadAll: function(e) {
|
|
958
997
|
const t = this._settings;
|
|
959
|
-
|
|
960
|
-
|
|
998
|
+
Ne(e, t).forEach((r) => {
|
|
999
|
+
ie(r, this), Se(r, t, this);
|
|
961
1000
|
});
|
|
962
1001
|
},
|
|
963
1002
|
restoreAll: function() {
|
|
964
1003
|
const e = this._settings;
|
|
965
|
-
|
|
966
|
-
|
|
1004
|
+
ne(e).forEach((t) => {
|
|
1005
|
+
Vs(t, e);
|
|
967
1006
|
});
|
|
968
1007
|
}
|
|
969
1008
|
};
|
|
970
1009
|
te.load = (e, t) => {
|
|
971
|
-
const s =
|
|
972
|
-
|
|
1010
|
+
const s = Je(t);
|
|
1011
|
+
Se(e, s);
|
|
973
1012
|
};
|
|
974
1013
|
te.resetStatus = (e) => {
|
|
975
|
-
|
|
1014
|
+
ae(e);
|
|
976
1015
|
};
|
|
977
|
-
|
|
978
|
-
function
|
|
979
|
-
let e =
|
|
1016
|
+
V && Kt(te, window.lazyLoadOptions);
|
|
1017
|
+
function or() {
|
|
1018
|
+
let e = G;
|
|
980
1019
|
const t = (f) => {
|
|
981
1020
|
e = f;
|
|
982
1021
|
};
|
|
983
|
-
let s = !1, r = !1, o = !1, i = [],
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
_(h, "preview"), h.classList.add(b("tele-fancy-scrollbar")), h.onclick = function(k) {
|
|
992
|
-
var z;
|
|
1022
|
+
let s = !1, r = !1, o = !1, i = [], n = 0;
|
|
1023
|
+
const a = _("readonly"), l = _("preview-active"), d = w("div", "content"), c = w("div", "preview-mask");
|
|
1024
|
+
c.onclick = function(S) {
|
|
1025
|
+
r || S.target === c && b(!1);
|
|
1026
|
+
}, H(d, c);
|
|
1027
|
+
const h = w("div", "preview");
|
|
1028
|
+
h.classList.add(_("tele-fancy-scrollbar")), h.onclick = function(S) {
|
|
1029
|
+
var x;
|
|
993
1030
|
if (r)
|
|
994
1031
|
return;
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
},
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
});
|
|
1002
|
-
function E(f) {
|
|
1003
|
-
r !== f && (r = f, p.classList.toggle(n, r));
|
|
1032
|
+
const v = (x = S.target.dataset) == null ? void 0 : x.pageIndex;
|
|
1033
|
+
v && (S.preventDefault(), S.stopPropagation(), S.stopImmediatePropagation(), e(Number(v)), b(!1));
|
|
1034
|
+
}, H(d, h);
|
|
1035
|
+
let g;
|
|
1036
|
+
function y(f) {
|
|
1037
|
+
r !== f && (r = f, d.classList.toggle(a, r));
|
|
1004
1038
|
}
|
|
1005
|
-
function
|
|
1006
|
-
o !== f && (o = f,
|
|
1039
|
+
function b(f) {
|
|
1040
|
+
o !== f && (o = f, d.classList.toggle(l, o), o && !g && (g = new te({
|
|
1041
|
+
container: h,
|
|
1042
|
+
elements_selector: `.${_("preview-page>img")}`
|
|
1043
|
+
})));
|
|
1007
1044
|
}
|
|
1008
|
-
function
|
|
1045
|
+
function z(f) {
|
|
1009
1046
|
if (i !== f) {
|
|
1010
1047
|
i = f;
|
|
1011
|
-
const
|
|
1012
|
-
i.forEach((
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
-
}), s ||
|
|
1048
|
+
const S = _("preview-page"), v = _("preview-page-name");
|
|
1049
|
+
i.forEach((x, O) => {
|
|
1050
|
+
const B = String(O), A = oe("a");
|
|
1051
|
+
A.className = S + " " + _(`preview-page-${O}`), A.href = "#", A.dataset.pageIndex = B;
|
|
1052
|
+
const L = oe("span");
|
|
1053
|
+
L.className = v, L.textContent = String(O + 1), L.dataset.pageIndex = B;
|
|
1054
|
+
const P = oe("img");
|
|
1055
|
+
P.width = x.width, P.height = x.height, P.alt = `page-${O}`, P.dataset.src = x.thumbnail, P.dataset.pageIndex = B, H(A, P), H(A, L), H(h, A);
|
|
1056
|
+
}), s || g == null || g.update();
|
|
1020
1057
|
}
|
|
1021
1058
|
}
|
|
1022
|
-
function
|
|
1023
|
-
if (
|
|
1024
|
-
|
|
1025
|
-
const
|
|
1026
|
-
`.${
|
|
1059
|
+
function I(f, S = !1) {
|
|
1060
|
+
if (S || n !== f) {
|
|
1061
|
+
n = f;
|
|
1062
|
+
const v = h.querySelector(
|
|
1063
|
+
`.${_(`preview-page-${n}`)}`
|
|
1027
1064
|
);
|
|
1028
|
-
|
|
1065
|
+
v && h.scrollTo({ top: v.offsetTop - 16 });
|
|
1029
1066
|
}
|
|
1030
1067
|
}
|
|
1031
|
-
function
|
|
1032
|
-
s = !0,
|
|
1068
|
+
function k() {
|
|
1069
|
+
s = !0, g == null || g.destroy();
|
|
1033
1070
|
}
|
|
1034
|
-
function
|
|
1071
|
+
function m() {
|
|
1035
1072
|
return o;
|
|
1036
1073
|
}
|
|
1037
1074
|
return {
|
|
1038
|
-
$content:
|
|
1075
|
+
$content: d,
|
|
1039
1076
|
$preview: h,
|
|
1040
|
-
set_readonly:
|
|
1041
|
-
set_active:
|
|
1042
|
-
get_active:
|
|
1043
|
-
set_pages:
|
|
1077
|
+
set_readonly: y,
|
|
1078
|
+
set_active: b,
|
|
1079
|
+
get_active: m,
|
|
1080
|
+
set_pages: z,
|
|
1044
1081
|
on_new_page_index: t,
|
|
1045
|
-
set_page_index:
|
|
1046
|
-
destroy:
|
|
1082
|
+
set_page_index: I,
|
|
1083
|
+
destroy: k
|
|
1047
1084
|
};
|
|
1048
1085
|
}
|
|
1049
|
-
const
|
|
1086
|
+
const xe = class {
|
|
1050
1087
|
constructor(t) {
|
|
1051
|
-
u(this, "sideEffect", new
|
|
1052
|
-
u(this, "events", new
|
|
1053
|
-
u(this, "$slide",
|
|
1054
|
-
u(this, "$overlay",
|
|
1055
|
-
u(this, "sidebar",
|
|
1056
|
-
u(this, "footer",
|
|
1088
|
+
u(this, "sideEffect", new Pe());
|
|
1089
|
+
u(this, "events", new $t());
|
|
1090
|
+
u(this, "$slide", w("div", "slide"));
|
|
1091
|
+
u(this, "$overlay", w("div", "overlay"));
|
|
1092
|
+
u(this, "sidebar", or());
|
|
1093
|
+
u(this, "footer", Yt());
|
|
1057
1094
|
u(this, "$content");
|
|
1058
1095
|
u(this, "$footer");
|
|
1059
1096
|
u(this, "slide");
|
|
1097
|
+
u(this, "_getWhiteSnapshot", null);
|
|
1098
|
+
u(this, "_slideTitle", "");
|
|
1060
1099
|
u(this, "_readyPromise");
|
|
1061
1100
|
u(this, "_infoPromise");
|
|
1062
1101
|
u(this, "_ready", !1);
|
|
@@ -1073,45 +1112,77 @@ const ke = class {
|
|
|
1073
1112
|
u(this, "onTogglePreview", () => {
|
|
1074
1113
|
this.sidebar.set_active(!this.sidebar.get_active());
|
|
1075
1114
|
});
|
|
1076
|
-
|
|
1115
|
+
u(this, "toPdf", async (t) => {
|
|
1116
|
+
const r = document.createElement("canvas"), o = r.getContext("2d"), { slideCount: i, width: n, height: a } = this.slide;
|
|
1117
|
+
let l = Math.floor(n), d = Math.floor(a);
|
|
1118
|
+
l > 1920 && (l = 1920, d = Math.floor(a * l / n)), d > 1920 && (d = 1920, l = Math.floor(n * d / a)), r.width = l, r.height = d;
|
|
1119
|
+
const c = document.createElement("canvas");
|
|
1120
|
+
c.width = n, c.height = a;
|
|
1121
|
+
const h = c.getContext("2d");
|
|
1122
|
+
if (!h || !this._getWhiteSnapshot || !o)
|
|
1123
|
+
return null;
|
|
1124
|
+
const g = l > d ? "l" : "p", y = new St({
|
|
1125
|
+
format: [l, d],
|
|
1126
|
+
orientation: g,
|
|
1127
|
+
compress: !0
|
|
1128
|
+
});
|
|
1129
|
+
for (let m = 1; m <= i; m++) {
|
|
1130
|
+
const f = await this.slide.snapshotWithTimingEnd(m);
|
|
1131
|
+
if (f) {
|
|
1132
|
+
const v = document.createElement("img");
|
|
1133
|
+
v.src = f, await new Promise((x) => v.onload = x), o.drawImage(v, 0, 0, l, d);
|
|
1134
|
+
}
|
|
1135
|
+
h.clearRect(0, 0, n, a), this._getWhiteSnapshot(m, c, h);
|
|
1136
|
+
try {
|
|
1137
|
+
const v = c.toDataURL("image/png"), x = document.createElement("img");
|
|
1138
|
+
x.src = v, await new Promise((O) => x.onload = O), o.drawImage(x, 0, 0, l, d);
|
|
1139
|
+
} catch {
|
|
1140
|
+
}
|
|
1141
|
+
const S = r.toDataURL("image/jpeg", 0.6);
|
|
1142
|
+
m > 1 && y.addPage(), y.addImage(S, "JPEG", 0, 0, l, d, "", "FAST"), o.clearRect(0, 0, l, d), t(Math.ceil(m / i * 100));
|
|
1143
|
+
}
|
|
1144
|
+
const b = y.output("arraybuffer"), z = new Blob([b]), I = URL.createObjectURL(z), k = document.createElement("a");
|
|
1145
|
+
k.setAttribute("href", I), k.setAttribute("download", `${this._slideTitle || "snapshot"}.pdf`), k.style.display = "none", document.body.appendChild(k), k.click(), document.body.removeChild(k), window.postMessage({ type: "@app-slide/_download_pdf_", buf: b });
|
|
1146
|
+
});
|
|
1147
|
+
this.$content = this.sidebar.$content, this.$footer = this.footer.$footer, H(this.$content, this.$slide), H(this.$content, this.$overlay), this.sidebar.on_new_page_index(this.onNewPageIndex), this.footer.on_new_page_index(this.onNewPageIndex), this.footer.on_toggle_preview(this.onTogglePreview), this.footer.on_play(this.onPlay), this.footer.on_save_to_pdf(this.toPdf), this.sideEffect.push(this.sidebar.destroy), this.sideEffect.push(() => this.slide.destroy()), this.sideEffect.push(() => {
|
|
1077
1148
|
this.$content.parentElement && this.$content.remove(), this.$footer.parentElement && this.$footer.remove(), this.$slide.parentElement && this.$slide.remove();
|
|
1078
1149
|
}), this.sideEffect.push(
|
|
1079
|
-
|
|
1080
|
-
this._destroyed || (
|
|
1150
|
+
Ut((a) => {
|
|
1151
|
+
this._destroyed || (a ? this._cachedIsFrozen || this.unfreeze() : (this._cachedIsFrozen = this._isFrozen, this.freeze()));
|
|
1081
1152
|
})
|
|
1082
1153
|
);
|
|
1083
|
-
const [s, r] =
|
|
1084
|
-
this._infoPromise = s,
|
|
1154
|
+
const [s, r] = Ie();
|
|
1155
|
+
this._infoPromise = s, xe.fetchSlideInfo(t).then(({ preview: a, slide: l }) => {
|
|
1085
1156
|
if (!this._destroyed) {
|
|
1086
|
-
if (this._slideCount = l.slideCount,
|
|
1087
|
-
const { taskId:
|
|
1088
|
-
width:
|
|
1089
|
-
height:
|
|
1090
|
-
thumbnail: `${
|
|
1157
|
+
if (this._slideCount = l.slideCount, a) {
|
|
1158
|
+
const { taskId: d, url: c } = t, { slideCount: h } = l, { width: g, height: y } = a, b = He(d, c), z = Array.from({ length: h }, (I, k) => ({
|
|
1159
|
+
width: g,
|
|
1160
|
+
height: y,
|
|
1161
|
+
thumbnail: `${b}/preview/${k + 1}.png`
|
|
1091
1162
|
}));
|
|
1092
|
-
this.sidebar.set_pages(
|
|
1163
|
+
this.sidebar.set_pages(z), this.footer.set_sidebar(!0);
|
|
1093
1164
|
}
|
|
1094
1165
|
this.footer.set_page_count(l.slideCount), r(l);
|
|
1095
1166
|
}
|
|
1096
|
-
}).catch((
|
|
1097
|
-
console.log("[Slide] fetch slide info error"), console.error(
|
|
1167
|
+
}).catch((a) => {
|
|
1168
|
+
console.log("[Slide] fetch slide info error"), console.error(a), this.events.emit("prepareError", a);
|
|
1098
1169
|
});
|
|
1099
|
-
const [i,
|
|
1100
|
-
this._readyPromise = i, this.slide = new
|
|
1170
|
+
const [i, n] = Ie();
|
|
1171
|
+
this._readyPromise = i, this.slide = new ue({
|
|
1101
1172
|
anchor: this.$slide,
|
|
1102
1173
|
mode: "local",
|
|
1103
1174
|
interactive: !0,
|
|
1104
1175
|
enableGlobalClick: !0,
|
|
1105
1176
|
useLocalCache: !0,
|
|
1106
1177
|
...t
|
|
1107
|
-
}), this.slide.setResource(t.taskId, t.url ||
|
|
1108
|
-
this._destroyed || this.setPage(
|
|
1178
|
+
}), this.slide.setResource(t.taskId, t.url || Te), this.slide.on("slideChange", (a) => {
|
|
1179
|
+
this._destroyed || this.setPage(a);
|
|
1109
1180
|
}), this.slide.on("renderEnd", () => {
|
|
1110
1181
|
this._ready ? this.$overlay.style.opacity = "" : setTimeout(() => {
|
|
1111
|
-
this._ready = !0,
|
|
1182
|
+
this._ready = !0, n();
|
|
1112
1183
|
}, 1e3);
|
|
1113
|
-
}), this.slide.on("renderError", (
|
|
1114
|
-
this._destroyed ||
|
|
1184
|
+
}), this.slide.on("renderError", (a) => {
|
|
1185
|
+
this._destroyed || a.error && (console.error(a.error), this.$overlay.textContent = `Error on slide.index=${a.index}: ${a.error.message}`, this.$overlay.style.opacity = "1", this.events.emit("renderError", a));
|
|
1115
1186
|
}), this.ready(() => {
|
|
1116
1187
|
this._isFrozen && this.freeze();
|
|
1117
1188
|
});
|
|
@@ -1119,6 +1190,12 @@ const ke = class {
|
|
|
1119
1190
|
prepare(t) {
|
|
1120
1191
|
return this._infoPromise.then(t);
|
|
1121
1192
|
}
|
|
1193
|
+
attachWhiteSnapshot(t) {
|
|
1194
|
+
this._getWhiteSnapshot = t;
|
|
1195
|
+
}
|
|
1196
|
+
setSlideTitle(t) {
|
|
1197
|
+
this._slideTitle = t;
|
|
1198
|
+
}
|
|
1122
1199
|
ready(t) {
|
|
1123
1200
|
return this._readyPromise.then(t);
|
|
1124
1201
|
}
|
|
@@ -1138,67 +1215,84 @@ const ke = class {
|
|
|
1138
1215
|
this._destroyed || (this._isFrozen = !1, this._ready && (this.slide.release(), this.events.emit("unfreeze")));
|
|
1139
1216
|
}
|
|
1140
1217
|
};
|
|
1141
|
-
let
|
|
1142
|
-
u(
|
|
1143
|
-
function
|
|
1218
|
+
let D = xe;
|
|
1219
|
+
u(D, "styles", Bt), u(D, "fetchSlideInfo", Vt);
|
|
1220
|
+
function nr(e) {
|
|
1144
1221
|
return e.displayer.logger;
|
|
1145
1222
|
}
|
|
1146
|
-
const
|
|
1223
|
+
const M = class {
|
|
1147
1224
|
constructor(t) {
|
|
1148
1225
|
u(this, "info", (t) => {
|
|
1149
|
-
|
|
1226
|
+
M.roomLogger && this.context ? M.roomLogger.info(t + ` (${this.context.appId})`) : this.context ? console.debug(t + ` (${this.context.appId})`) : console.debug(t);
|
|
1150
1227
|
});
|
|
1151
|
-
this.context = t, t && (
|
|
1228
|
+
this.context = t, t && (M.active.add(t.appId), M.roomLogger = nr(t));
|
|
1152
1229
|
}
|
|
1153
1230
|
destroy() {
|
|
1154
|
-
this.context &&
|
|
1231
|
+
this.context && M.active.delete(this.context.appId), M.active.size === 0 && (M.roomLogger = null);
|
|
1155
1232
|
}
|
|
1156
1233
|
};
|
|
1157
|
-
let
|
|
1158
|
-
u(
|
|
1159
|
-
function
|
|
1234
|
+
let X = M;
|
|
1235
|
+
u(X, "active", /* @__PURE__ */ new Set()), u(X, "roomLogger", null);
|
|
1236
|
+
function ar({ context: e, storage: t, viewer: s, sideEffect: r, logger: o }) {
|
|
1160
1237
|
const i = o.info.bind(o);
|
|
1161
|
-
let
|
|
1162
|
-
s.prepare(({ width: c, height: h, slideCount:
|
|
1163
|
-
e.destroyed || (c && e.box.setStageRatio(h / c),
|
|
1238
|
+
let n = null;
|
|
1239
|
+
s.prepare(({ width: c, height: h, slideCount: g }) => {
|
|
1240
|
+
e.destroyed || (c && e.box.setStageRatio(h / c), n = e.createWhiteBoardView({ size: g }), n.setBaseRect({ width: c, height: h }), s.setSlideTitle(e.box.title), s.attachWhiteSnapshot(
|
|
1241
|
+
(y, b, z) => {
|
|
1242
|
+
if (!n)
|
|
1243
|
+
return null;
|
|
1244
|
+
const I = n.pageState.pages[y - 1];
|
|
1245
|
+
b.width = n.view.size.width, b.height = n.view.size.height, n.view.screenshotToCanvas(
|
|
1246
|
+
z,
|
|
1247
|
+
I,
|
|
1248
|
+
n.view.size.width,
|
|
1249
|
+
n.view.size.height,
|
|
1250
|
+
{
|
|
1251
|
+
centerX: 0,
|
|
1252
|
+
centerY: 0,
|
|
1253
|
+
scale: n.view.camera.scale
|
|
1254
|
+
}
|
|
1255
|
+
);
|
|
1256
|
+
}
|
|
1257
|
+
), d());
|
|
1164
1258
|
});
|
|
1165
|
-
const { slide:
|
|
1259
|
+
const { slide: a } = s;
|
|
1166
1260
|
function l(c = t.state.state) {
|
|
1167
1261
|
return JSON.stringify(c);
|
|
1168
1262
|
}
|
|
1169
|
-
function
|
|
1263
|
+
function d() {
|
|
1170
1264
|
if (t.state.state)
|
|
1171
|
-
i("[Slide] restore " + l()),
|
|
1265
|
+
i("[Slide] restore " + l()), a.setSlideState(t.state.state);
|
|
1172
1266
|
else if (e.isAddApp)
|
|
1173
|
-
i("[Slide] kick start"),
|
|
1267
|
+
i("[Slide] kick start"), a.renderSlide(1);
|
|
1174
1268
|
else {
|
|
1175
1269
|
i("[Slide] wait for restore");
|
|
1176
1270
|
const c = r.add(() => {
|
|
1177
|
-
const
|
|
1178
|
-
t.state.state || (i("[Slide] timeout"),
|
|
1271
|
+
const g = setInterval(() => {
|
|
1272
|
+
t.state.state || (i("[Slide] timeout"), a.renderSlide(1));
|
|
1179
1273
|
}, 15e3);
|
|
1180
|
-
return () => clearInterval(
|
|
1274
|
+
return () => clearInterval(g);
|
|
1181
1275
|
}), h = r.push(
|
|
1182
1276
|
t.on("stateChanged", () => {
|
|
1183
|
-
t.state.state && (i("[Slide] restore " + l()),
|
|
1277
|
+
t.state.state && (i("[Slide] restore " + l()), a.setSlideState(t.state.state), r.flush(h), r.flush(c));
|
|
1184
1278
|
})
|
|
1185
1279
|
);
|
|
1186
1280
|
}
|
|
1187
1281
|
}
|
|
1188
|
-
|
|
1189
|
-
e.isWritable && t.setState({ state:
|
|
1190
|
-
}),
|
|
1191
|
-
e.isWritable && (i("[Slide] dispatch " + l(
|
|
1282
|
+
a.on("stateChange", () => {
|
|
1283
|
+
e.isWritable && t.setState({ state: a.slideState });
|
|
1284
|
+
}), a.on("syncDispatch", (c) => {
|
|
1285
|
+
e.isWritable && (i("[Slide] dispatch " + l(Ae(c, "uuid"))), e.dispatchMagixEvent("syncDispatch", c));
|
|
1192
1286
|
}), r.push(
|
|
1193
1287
|
e.addMagixEventListener(
|
|
1194
1288
|
"syncDispatch",
|
|
1195
1289
|
({ payload: c }) => {
|
|
1196
|
-
i("[Slide] receive " + l(
|
|
1290
|
+
i("[Slide] receive " + l(Ae(c, "uuid"))), a.emit("syncReceive", c);
|
|
1197
1291
|
},
|
|
1198
1292
|
{ fireSelfEventAfterCommit: !0 }
|
|
1199
1293
|
)
|
|
1200
|
-
),
|
|
1201
|
-
e.isWritable &&
|
|
1294
|
+
), a.on("slideChange", (c) => {
|
|
1295
|
+
e.isWritable && n && (i("[Slide] page to " + c), n.jumpPage(c - 1));
|
|
1202
1296
|
}), s.setReadonly(!e.isWritable), r.push(
|
|
1203
1297
|
e.emitter.on("writableChange", (c) => {
|
|
1204
1298
|
s.setReadonly(!c);
|
|
@@ -1207,34 +1301,32 @@ function Xs({ context: e, storage: t, viewer: s, sideEffect: r, logger: o }) {
|
|
|
1207
1301
|
e.box.focus && ((c.key === "ArrowUp" || c.key === "ArrowLeft") && s.slide.prevStep(), (c.key === "ArrowRight" || c.key === "ArrowDown") && s.slide.nextStep());
|
|
1208
1302
|
});
|
|
1209
1303
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const { container: t, ...s } = e, r =
|
|
1212
|
-
r.
|
|
1213
|
-
const o = new O(s);
|
|
1214
|
-
return r.appendChild(document.createElement("style")).textContent = O.styles, r.appendChild(o.$content), r.appendChild(o.$footer), t.appendChild(r), o.prepare(() => o.slide.renderSlide(1)), o;
|
|
1304
|
+
function ur(e) {
|
|
1305
|
+
const { container: t, ...s } = e, r = w("div", "preview-wrapper"), o = new D(s);
|
|
1306
|
+
return r.appendChild(document.createElement("style")).textContent = D.styles, r.appendChild(o.$content), r.appendChild(o.$footer), t.appendChild(r), o.prepare(() => o.slide.renderSlide(1)), o;
|
|
1215
1307
|
}
|
|
1216
|
-
const
|
|
1308
|
+
const pr = /* @__PURE__ */ ue.usePlugin.bind(ue), hr = "0.3.0-canary.14", fr = {
|
|
1217
1309
|
kind: "Slide",
|
|
1218
1310
|
setup(e) {
|
|
1219
|
-
var
|
|
1220
|
-
console.log("[Slide] setup @ 0.3.0-canary.
|
|
1221
|
-
const t = new
|
|
1222
|
-
if (t.info("[Slide] setup @ 0.3.0-canary.
|
|
1311
|
+
var a, l;
|
|
1312
|
+
console.log("[Slide] setup @ 0.3.0-canary.14 (" + e.appId + ")");
|
|
1313
|
+
const t = new X(e);
|
|
1314
|
+
if (t.info("[Slide] setup @ 0.3.0-canary.14"), !e.attributes.taskId)
|
|
1223
1315
|
throw new Error("[Slide] no taskId");
|
|
1224
|
-
const s = e.createStorage("slide", e.attributes), r = e.getAppOptions() || {}, o = r.renderOptions || {}, i = new
|
|
1316
|
+
const s = e.createStorage("slide", e.attributes), r = e.getAppOptions() || {}, o = r.renderOptions || {}, i = new Pe(), n = new D({
|
|
1225
1317
|
interactive: !0,
|
|
1226
1318
|
mode: "interactive",
|
|
1227
1319
|
enableGlobalClick: !0,
|
|
1228
|
-
timestamp:
|
|
1320
|
+
timestamp: Ft(e),
|
|
1229
1321
|
logger: r.logger || t,
|
|
1230
1322
|
renderOptions: {
|
|
1231
1323
|
minFPS: o.minFPS || 25,
|
|
1232
1324
|
maxFPS: o.maxFPS || 30,
|
|
1233
|
-
autoFPS: (
|
|
1325
|
+
autoFPS: (a = o.autoFPS) != null ? a : !0,
|
|
1234
1326
|
autoResolution: (l = o.autoResolution) != null ? l : !0,
|
|
1235
1327
|
resolution: o.resolution,
|
|
1236
1328
|
maxResolutionLevel: o.maxResolutionLevel,
|
|
1237
|
-
transactionBgColor: o.transactionBgColor ||
|
|
1329
|
+
transactionBgColor: o.transactionBgColor || Be(e.box.$content)
|
|
1238
1330
|
},
|
|
1239
1331
|
rtcAudio: r.rtcAudio,
|
|
1240
1332
|
useLocalCache: r.useLocalCache,
|
|
@@ -1245,30 +1337,30 @@ const rr = /* @__PURE__ */ ce.usePlugin.bind(ce), or = "0.3.0-canary.13", nr = {
|
|
|
1245
1337
|
taskId: s.state.taskId,
|
|
1246
1338
|
url: s.state.url
|
|
1247
1339
|
});
|
|
1248
|
-
return Object.assign(
|
|
1249
|
-
|
|
1340
|
+
return Object.assign(n, { context: e, logger: t }), i.push(De.set(e.appId, n, e.box)), i.push(n.events.on("freeze", () => t.info("[Slide] freeze"))), i.push(n.events.on("unfreeze", () => t.info("[Slide] unfreeze"))), i.push(
|
|
1341
|
+
n.events.on(
|
|
1250
1342
|
"prepareError",
|
|
1251
|
-
(
|
|
1343
|
+
(d) => t.info("[Slide] fetch slide info failed: " + d.message)
|
|
1252
1344
|
)
|
|
1253
1345
|
), i.push(
|
|
1254
|
-
|
|
1346
|
+
n.events.on(
|
|
1255
1347
|
"renderError",
|
|
1256
|
-
({ error:
|
|
1348
|
+
({ error: d, index: c }) => t.info(`[Slide] render failed [${c}]: ${d.message}`)
|
|
1257
1349
|
)
|
|
1258
|
-
), e.box.mountStyles(
|
|
1350
|
+
), e.box.mountStyles(D.styles), e.box.mountStage(n.$slide), e.box.mountFooter(n.$footer), e.box.mountContent(n.$content), i.push(() => n.destroy()), ar({ context: e, storage: s, viewer: n, sideEffect: i, logger: t }), e.emitter.on("destroy", () => {
|
|
1259
1351
|
t.info("[Slide] destroy"), t.destroy(), i.flushAll();
|
|
1260
|
-
}),
|
|
1352
|
+
}), n;
|
|
1261
1353
|
}
|
|
1262
1354
|
};
|
|
1263
1355
|
export {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1356
|
+
Te as DefaultUrl,
|
|
1357
|
+
mr as Slide,
|
|
1358
|
+
D as SlideViewer,
|
|
1359
|
+
dr as addHooks,
|
|
1360
|
+
fr as default,
|
|
1361
|
+
ur as previewSlide,
|
|
1362
|
+
De as refrigerator,
|
|
1363
|
+
pr as usePlugin,
|
|
1364
|
+
hr as version
|
|
1273
1365
|
};
|
|
1274
1366
|
//# sourceMappingURL=main.mjs.map
|