@netless/app-slide 0.3.0-canary.6 → 0.3.0-canary.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SlideViewer.d.ts +14 -0
- package/dist/index.d.ts +4 -1
- 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 +358 -347
- package/dist/main.mjs.map +1 -1
- package/dist/typings.d.ts +7 -2
- package/package.json +3 -3
- package/src/SlideViewer.ts +16 -10
- package/src/index.ts +22 -8
- package/src/typings.ts +19 -2
package/dist/main.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Slide as
|
|
2
|
-
|
|
1
|
+
import { Slide as ae } from "@netless/slide";
|
|
2
|
+
import { Slide as Xs } from "@netless/slide";
|
|
3
|
+
var Ie = { exports: {} }, ht = {
|
|
3
4
|
aliceblue: [240, 248, 255],
|
|
4
5
|
antiquewhite: [250, 235, 215],
|
|
5
6
|
aqua: [0, 255, 255],
|
|
@@ -148,23 +149,23 @@ var Ie = { exports: {} }, ut = {
|
|
|
148
149
|
whitesmoke: [245, 245, 245],
|
|
149
150
|
yellow: [255, 255, 0],
|
|
150
151
|
yellowgreen: [154, 205, 50]
|
|
151
|
-
},
|
|
152
|
+
}, Ae = { exports: {} }, gt = function(t) {
|
|
152
153
|
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");
|
|
153
|
-
},
|
|
154
|
+
}, ft = gt, bt = Array.prototype.concat, vt = Array.prototype.slice, _e = Ae.exports = function(t) {
|
|
154
155
|
for (var s = [], r = 0, o = t.length; r < o; r++) {
|
|
155
156
|
var l = t[r];
|
|
156
|
-
|
|
157
|
+
ft(l) ? s = bt.call(s, vt.call(l)) : s.push(l);
|
|
157
158
|
}
|
|
158
159
|
return s;
|
|
159
160
|
};
|
|
160
|
-
|
|
161
|
+
_e.wrap = function(e) {
|
|
161
162
|
return function() {
|
|
162
|
-
return e(
|
|
163
|
+
return e(_e(arguments));
|
|
163
164
|
};
|
|
164
165
|
};
|
|
165
|
-
var
|
|
166
|
-
for (var ne in
|
|
167
|
-
|
|
166
|
+
var G = ht, Z = Ae.exports, Le = Object.hasOwnProperty, $e = /* @__PURE__ */ Object.create(null);
|
|
167
|
+
for (var ne in G)
|
|
168
|
+
Le.call(G, ne) && ($e[G[ne]] = ne);
|
|
168
169
|
var _ = Ie.exports = {
|
|
169
170
|
to: {},
|
|
170
171
|
get: {}
|
|
@@ -187,38 +188,38 @@ _.get = function(e) {
|
|
|
187
188
|
_.get.rgb = function(e) {
|
|
188
189
|
if (!e)
|
|
189
190
|
return null;
|
|
190
|
-
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*)?\)$/, l = /^(\w+)$/,
|
|
191
|
-
if (
|
|
192
|
-
for (d =
|
|
193
|
-
var u =
|
|
194
|
-
a
|
|
191
|
+
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*)?\)$/, l = /^(\w+)$/, i = [0, 0, 0, 1], n, a, d;
|
|
192
|
+
if (n = e.match(s)) {
|
|
193
|
+
for (d = n[2], n = n[1], a = 0; a < 3; a++) {
|
|
194
|
+
var u = a * 2;
|
|
195
|
+
i[a] = parseInt(n.slice(u, u + 2), 16);
|
|
195
196
|
}
|
|
196
|
-
d && (
|
|
197
|
-
} else if (
|
|
198
|
-
for (
|
|
199
|
-
a
|
|
200
|
-
d && (
|
|
201
|
-
} else if (
|
|
202
|
-
for (
|
|
203
|
-
a
|
|
204
|
-
|
|
205
|
-
} else if (
|
|
206
|
-
for (
|
|
207
|
-
a
|
|
208
|
-
|
|
197
|
+
d && (i[3] = parseInt(d, 16) / 255);
|
|
198
|
+
} else if (n = e.match(t)) {
|
|
199
|
+
for (n = n[1], d = n[3], a = 0; a < 3; a++)
|
|
200
|
+
i[a] = parseInt(n[a] + n[a], 16);
|
|
201
|
+
d && (i[3] = parseInt(d + d, 16) / 255);
|
|
202
|
+
} else if (n = e.match(r)) {
|
|
203
|
+
for (a = 0; a < 3; a++)
|
|
204
|
+
i[a] = parseInt(n[a + 1], 0);
|
|
205
|
+
n[4] && (n[5] ? i[3] = parseFloat(n[4]) * 0.01 : i[3] = parseFloat(n[4]));
|
|
206
|
+
} else if (n = e.match(o)) {
|
|
207
|
+
for (a = 0; a < 3; a++)
|
|
208
|
+
i[a] = Math.round(parseFloat(n[a + 1]) * 2.55);
|
|
209
|
+
n[4] && (n[5] ? i[3] = parseFloat(n[4]) * 0.01 : i[3] = parseFloat(n[4]));
|
|
209
210
|
} else
|
|
210
|
-
return (
|
|
211
|
-
for (
|
|
212
|
-
a
|
|
213
|
-
return
|
|
211
|
+
return (n = e.match(l)) ? n[1] === "transparent" ? [0, 0, 0, 0] : Le.call(G, n[1]) ? (i = G[n[1]], i[3] = 1, i) : null : null;
|
|
212
|
+
for (a = 0; a < 3; a++)
|
|
213
|
+
i[a] = $(i[a], 0, 255);
|
|
214
|
+
return i[3] = $(i[3], 0, 1), i;
|
|
214
215
|
};
|
|
215
216
|
_.get.hsl = function(e) {
|
|
216
217
|
if (!e)
|
|
217
218
|
return null;
|
|
218
219
|
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);
|
|
219
220
|
if (s) {
|
|
220
|
-
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, l = $(parseFloat(s[2]), 0, 100),
|
|
221
|
-
return [o, l,
|
|
221
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, l = $(parseFloat(s[2]), 0, 100), i = $(parseFloat(s[3]), 0, 100), n = $(isNaN(r) ? 1 : r, 0, 1);
|
|
222
|
+
return [o, l, i, n];
|
|
222
223
|
}
|
|
223
224
|
return null;
|
|
224
225
|
};
|
|
@@ -227,8 +228,8 @@ _.get.hwb = function(e) {
|
|
|
227
228
|
return null;
|
|
228
229
|
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);
|
|
229
230
|
if (s) {
|
|
230
|
-
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, l = $(parseFloat(s[2]), 0, 100),
|
|
231
|
-
return [o, l,
|
|
231
|
+
var r = parseFloat(s[4]), o = (parseFloat(s[1]) % 360 + 360) % 360, l = $(parseFloat(s[2]), 0, 100), i = $(parseFloat(s[3]), 0, 100), n = $(isNaN(r) ? 1 : r, 0, 1);
|
|
232
|
+
return [o, l, i, n];
|
|
232
233
|
}
|
|
233
234
|
return null;
|
|
234
235
|
};
|
|
@@ -253,7 +254,7 @@ _.to.hwb = function() {
|
|
|
253
254
|
return e.length >= 4 && e[3] !== 1 && (t = ", " + e[3]), "hwb(" + e[0] + ", " + e[1] + "%, " + e[2] + "%" + t + ")";
|
|
254
255
|
};
|
|
255
256
|
_.to.keyword = function(e) {
|
|
256
|
-
return
|
|
257
|
+
return $e[e.slice(0, 3)];
|
|
257
258
|
};
|
|
258
259
|
function $(e, t, s) {
|
|
259
260
|
return Math.min(Math.max(t, e), s);
|
|
@@ -262,24 +263,24 @@ function Y(e) {
|
|
|
262
263
|
var t = Math.round(e).toString(16).toUpperCase();
|
|
263
264
|
return t.length < 2 ? "0" + t : t;
|
|
264
265
|
}
|
|
265
|
-
const
|
|
266
|
-
for (let e = 0; e <
|
|
267
|
-
|
|
268
|
-
return
|
|
266
|
+
const ze = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", mt = ze.length, Ne = 20, we = Array(Ne), _t = () => {
|
|
267
|
+
for (let e = 0; e < Ne; e++)
|
|
268
|
+
we[e] = ze.charAt(Math.random() * mt);
|
|
269
|
+
return we.join("");
|
|
269
270
|
};
|
|
270
|
-
function
|
|
271
|
+
function ye(e) {
|
|
271
272
|
try {
|
|
272
273
|
return e();
|
|
273
274
|
} catch (t) {
|
|
274
275
|
console.error(t);
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
|
-
class
|
|
278
|
+
class Oe {
|
|
278
279
|
constructor() {
|
|
279
|
-
this.disposers = /* @__PURE__ */ new Map();
|
|
280
|
+
this.push = this.addDisposer, this.disposers = /* @__PURE__ */ new Map();
|
|
280
281
|
}
|
|
281
282
|
addDisposer(t, s = this.genUID()) {
|
|
282
|
-
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? () => t.forEach(
|
|
283
|
+
return this.flush(s), this.disposers.set(s, Array.isArray(t) ? () => t.forEach(ye) : t), s;
|
|
283
284
|
}
|
|
284
285
|
add(t, s = this.genUID()) {
|
|
285
286
|
const r = t();
|
|
@@ -312,19 +313,19 @@ class ze {
|
|
|
312
313
|
}
|
|
313
314
|
}
|
|
314
315
|
flushAll() {
|
|
315
|
-
this.disposers.forEach(
|
|
316
|
+
this.disposers.forEach(ye), this.disposers.clear();
|
|
316
317
|
}
|
|
317
318
|
genUID() {
|
|
318
319
|
let t;
|
|
319
320
|
do
|
|
320
|
-
t =
|
|
321
|
+
t = _t();
|
|
321
322
|
while (this.disposers.has(t));
|
|
322
323
|
return t;
|
|
323
324
|
}
|
|
324
325
|
}
|
|
325
|
-
const N = typeof window < "u",
|
|
326
|
+
const N = typeof window < "u", De = N && !("onscroll" in window) || typeof navigator < "u" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent), Me = N && "IntersectionObserver" in window, Te = N && "classList" in document.createElement("p"), Fe = N && window.devicePixelRatio > 1, wt = {
|
|
326
327
|
elements_selector: ".lazy",
|
|
327
|
-
container:
|
|
328
|
+
container: De || N ? document : null,
|
|
328
329
|
threshold: 300,
|
|
329
330
|
thresholds: null,
|
|
330
331
|
data_src: "src",
|
|
@@ -355,7 +356,7 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
355
356
|
callback_cancel: null,
|
|
356
357
|
use_native: !1,
|
|
357
358
|
restore_on_error: !1
|
|
358
|
-
},
|
|
359
|
+
}, Pe = (e) => Object.assign({}, wt, e), ke = function(e, t) {
|
|
359
360
|
let s;
|
|
360
361
|
const r = "LazyLoad::Initialized", o = new e(t);
|
|
361
362
|
try {
|
|
@@ -364,21 +365,21 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
364
365
|
s = document.createEvent("CustomEvent"), s.initCustomEvent(r, !1, !1, { instance: o });
|
|
365
366
|
}
|
|
366
367
|
window.dispatchEvent(s);
|
|
367
|
-
},
|
|
368
|
+
}, yt = (e, t) => {
|
|
368
369
|
if (!!t)
|
|
369
370
|
if (!t.length)
|
|
370
|
-
|
|
371
|
+
ke(e, t);
|
|
371
372
|
else
|
|
372
373
|
for (let s = 0, r; r = t[s]; s += 1)
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
var r =
|
|
374
|
+
ke(e, r);
|
|
375
|
+
}, C = "src", le = "srcset", ce = "sizes", Re = "poster", K = "llOriginalAttrs", Ve = "data", de = "loading", Ue = "loaded", qe = "applied", kt = "entered", ue = "error", Be = "native", He = "data-", je = "ll-status", v = (e, t) => e.getAttribute(He + t), St = (e, t, s) => {
|
|
376
|
+
var r = He + t;
|
|
376
377
|
if (s === null) {
|
|
377
378
|
e.removeAttribute(r);
|
|
378
379
|
return;
|
|
379
380
|
}
|
|
380
381
|
e.setAttribute(r, s);
|
|
381
|
-
}, Q = (e) => v(e,
|
|
382
|
+
}, Q = (e) => v(e, je), M = (e, t) => St(e, je, t), te = (e) => M(e, null), pe = (e) => Q(e) === null, xt = (e) => Q(e) === de, Et = (e) => Q(e) === ue, he = (e) => Q(e) === Be, Ct = [de, Ue, qe, ue], It = (e) => Ct.indexOf(Q(e)) >= 0, O = (e, t, s, r) => {
|
|
382
383
|
if (!!e) {
|
|
383
384
|
if (r !== void 0) {
|
|
384
385
|
e(t, s, r);
|
|
@@ -390,59 +391,59 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
390
391
|
}
|
|
391
392
|
e(t);
|
|
392
393
|
}
|
|
393
|
-
},
|
|
394
|
-
if (
|
|
394
|
+
}, H = (e, t) => {
|
|
395
|
+
if (Te) {
|
|
395
396
|
e.classList.add(t);
|
|
396
397
|
return;
|
|
397
398
|
}
|
|
398
399
|
e.className += (e.className ? " " : "") + t;
|
|
399
400
|
}, S = (e, t) => {
|
|
400
|
-
if (
|
|
401
|
+
if (Te) {
|
|
401
402
|
e.classList.remove(t);
|
|
402
403
|
return;
|
|
403
404
|
}
|
|
404
405
|
e.className = e.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
|
|
405
|
-
},
|
|
406
|
+
}, At = (e) => {
|
|
406
407
|
e.llTempImage = document.createElement("IMG");
|
|
407
|
-
},
|
|
408
|
+
}, Lt = (e) => {
|
|
408
409
|
delete e.llTempImage;
|
|
409
|
-
},
|
|
410
|
+
}, Ge = (e) => e.llTempImage, se = (e, t) => {
|
|
410
411
|
if (!t)
|
|
411
412
|
return;
|
|
412
413
|
const s = t._observer;
|
|
413
414
|
!s || s.unobserve(e);
|
|
414
|
-
},
|
|
415
|
+
}, $t = (e) => {
|
|
415
416
|
e.disconnect();
|
|
416
|
-
},
|
|
417
|
+
}, zt = (e, t, s) => {
|
|
417
418
|
t.unobserve_entered && se(e, s);
|
|
418
|
-
},
|
|
419
|
+
}, ge = (e, t) => {
|
|
419
420
|
!e || (e.loadingCount += t);
|
|
420
|
-
},
|
|
421
|
+
}, Nt = (e) => {
|
|
421
422
|
!e || (e.toLoadCount -= 1);
|
|
422
|
-
},
|
|
423
|
+
}, We = (e, t) => {
|
|
423
424
|
!e || (e.toLoadCount = t);
|
|
424
|
-
},
|
|
425
|
+
}, Ot = (e) => e.loadingCount > 0, Dt = (e) => e.toLoadCount > 0, Je = (e) => {
|
|
425
426
|
let t = [];
|
|
426
427
|
for (let s = 0, r; r = e.children[s]; s += 1)
|
|
427
428
|
r.tagName === "SOURCE" && t.push(r);
|
|
428
429
|
return t;
|
|
429
|
-
},
|
|
430
|
+
}, fe = (e, t) => {
|
|
430
431
|
const s = e.parentNode;
|
|
431
432
|
if (!s || s.tagName !== "PICTURE")
|
|
432
433
|
return;
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
}, re = [
|
|
434
|
+
Je(s).forEach(t);
|
|
435
|
+
}, Ze = (e, t) => {
|
|
436
|
+
Je(e).forEach(t);
|
|
437
|
+
}, re = [C], Ke = [C, Re], J = [C, le, ce], Qe = [Ve], oe = (e) => !!e[K], Xe = (e) => e[K], Ye = (e) => delete e[K], q = (e, t) => {
|
|
437
438
|
if (oe(e))
|
|
438
439
|
return;
|
|
439
440
|
const s = {};
|
|
440
441
|
t.forEach((r) => {
|
|
441
442
|
s[r] = e.getAttribute(r);
|
|
442
443
|
}), e[K] = s;
|
|
443
|
-
},
|
|
444
|
+
}, Mt = (e) => {
|
|
444
445
|
oe(e) || (e[K] = { backgroundImage: e.style.backgroundImage });
|
|
445
|
-
},
|
|
446
|
+
}, Tt = (e, t, s) => {
|
|
446
447
|
if (!s) {
|
|
447
448
|
e.removeAttribute(t);
|
|
448
449
|
return;
|
|
@@ -451,246 +452,246 @@ const N = typeof window < "u", Ne = N && !("onscroll" in window) || typeof navig
|
|
|
451
452
|
}, D = (e, t) => {
|
|
452
453
|
if (!oe(e))
|
|
453
454
|
return;
|
|
454
|
-
const s =
|
|
455
|
+
const s = Xe(e);
|
|
455
456
|
t.forEach((r) => {
|
|
456
|
-
|
|
457
|
+
Tt(e, r, s[r]);
|
|
457
458
|
});
|
|
458
|
-
},
|
|
459
|
+
}, Ft = (e) => {
|
|
459
460
|
if (!oe(e))
|
|
460
461
|
return;
|
|
461
|
-
const t =
|
|
462
|
+
const t = Xe(e);
|
|
462
463
|
e.style.backgroundImage = t.backgroundImage;
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
},
|
|
466
|
-
|
|
464
|
+
}, et = (e, t, s) => {
|
|
465
|
+
H(e, t.class_applied), M(e, qe), s && (t.unobserve_completed && se(e, t), O(t.callback_applied, e, s));
|
|
466
|
+
}, tt = (e, t, s) => {
|
|
467
|
+
H(e, t.class_loading), M(e, de), s && (ge(s, 1), O(t.callback_loading, e, s));
|
|
467
468
|
}, z = (e, t, s) => {
|
|
468
469
|
!s || e.setAttribute(t, s);
|
|
469
|
-
},
|
|
470
|
-
z(e,
|
|
471
|
-
}, Tt = (e, t) => {
|
|
472
|
-
ge(e, (s) => {
|
|
473
|
-
B(s, W), ke(s, t);
|
|
474
|
-
}), B(e, W), ke(e, t);
|
|
475
|
-
}, Ft = (e, t) => {
|
|
476
|
-
B(e, re), z(e, I, v(e, t.data_src));
|
|
470
|
+
}, Se = (e, t) => {
|
|
471
|
+
z(e, ce, v(e, t.data_sizes)), z(e, le, v(e, t.data_srcset)), z(e, C, v(e, t.data_src));
|
|
477
472
|
}, Pt = (e, t) => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}),
|
|
473
|
+
fe(e, (s) => {
|
|
474
|
+
q(s, J), Se(s, t);
|
|
475
|
+
}), q(e, J), Se(e, t);
|
|
481
476
|
}, Rt = (e, t) => {
|
|
482
|
-
|
|
483
|
-
}, Vt = (e, t
|
|
484
|
-
|
|
485
|
-
|
|
477
|
+
q(e, re), z(e, C, v(e, t.data_src));
|
|
478
|
+
}, Vt = (e, t) => {
|
|
479
|
+
Ze(e, (s) => {
|
|
480
|
+
q(s, re), z(s, C, v(s, t.data_src));
|
|
481
|
+
}), q(e, Ke), z(e, Re, v(e, t.data_poster)), z(e, C, v(e, t.data_src)), e.load();
|
|
482
|
+
}, Ut = (e, t) => {
|
|
483
|
+
q(e, Qe), z(e, Ve, v(e, t.data_src));
|
|
486
484
|
}, qt = (e, t, s) => {
|
|
487
|
-
const r = v(e, t.
|
|
488
|
-
!l || (e.style.backgroundImage = l,
|
|
485
|
+
const r = v(e, t.data_bg), o = v(e, t.data_bg_hidpi), l = Fe && o ? o : r;
|
|
486
|
+
!l || (e.style.backgroundImage = `url("${l}")`, Ge(e).setAttribute(C, l), tt(e, t, s));
|
|
489
487
|
}, Bt = (e, t, s) => {
|
|
488
|
+
const r = v(e, t.data_bg_multi), o = v(e, t.data_bg_multi_hidpi), l = Fe && o ? o : r;
|
|
489
|
+
!l || (e.style.backgroundImage = l, et(e, t, s));
|
|
490
|
+
}, Ht = (e, t, s) => {
|
|
490
491
|
const r = v(e, t.data_bg_set);
|
|
491
492
|
if (!r)
|
|
492
493
|
return;
|
|
493
494
|
const o = r.split("|");
|
|
494
|
-
let l = o.map((
|
|
495
|
-
e.style.backgroundImage = l.join(), e.style.backgroundImage === "" && (l = o.map((
|
|
496
|
-
},
|
|
497
|
-
IMG:
|
|
498
|
-
IFRAME:
|
|
499
|
-
VIDEO:
|
|
500
|
-
OBJECT:
|
|
501
|
-
},
|
|
502
|
-
const s =
|
|
495
|
+
let l = o.map((i) => `image-set(${i})`);
|
|
496
|
+
e.style.backgroundImage = l.join(), e.style.backgroundImage === "" && (l = o.map((i) => `-webkit-image-set(${i})`), e.style.backgroundImage = l.join()), et(e, t, s);
|
|
497
|
+
}, st = {
|
|
498
|
+
IMG: Pt,
|
|
499
|
+
IFRAME: Rt,
|
|
500
|
+
VIDEO: Vt,
|
|
501
|
+
OBJECT: Ut
|
|
502
|
+
}, jt = (e, t) => {
|
|
503
|
+
const s = st[e.tagName];
|
|
503
504
|
!s || s(e, t);
|
|
504
|
-
},
|
|
505
|
-
const r =
|
|
506
|
-
!r || (r(e, t),
|
|
507
|
-
},
|
|
508
|
-
t && !
|
|
509
|
-
},
|
|
505
|
+
}, Gt = (e, t, s) => {
|
|
506
|
+
const r = st[e.tagName];
|
|
507
|
+
!r || (r(e, t), tt(e, t, s));
|
|
508
|
+
}, Wt = ["IMG", "IFRAME", "VIDEO", "OBJECT"], Jt = (e) => Wt.indexOf(e.tagName) > -1, rt = (e, t) => {
|
|
509
|
+
t && !Ot(t) && !Dt(t) && O(e.callback_finish, t);
|
|
510
|
+
}, xe = (e, t, s) => {
|
|
510
511
|
e.addEventListener(t, s), e.llEvLisnrs[t] = s;
|
|
511
|
-
},
|
|
512
|
+
}, Zt = (e, t, s) => {
|
|
512
513
|
e.removeEventListener(t, s);
|
|
513
|
-
},
|
|
514
|
-
|
|
514
|
+
}, be = (e) => !!e.llEvLisnrs, Kt = (e, t, s) => {
|
|
515
|
+
be(e) || (e.llEvLisnrs = {});
|
|
515
516
|
const r = e.tagName === "VIDEO" ? "loadeddata" : "load";
|
|
516
|
-
|
|
517
|
-
},
|
|
518
|
-
if (!
|
|
517
|
+
xe(e, r, t), xe(e, "error", s);
|
|
518
|
+
}, ie = (e) => {
|
|
519
|
+
if (!be(e))
|
|
519
520
|
return;
|
|
520
521
|
const t = e.llEvLisnrs;
|
|
521
522
|
for (let s in t) {
|
|
522
523
|
const r = t[s];
|
|
523
|
-
|
|
524
|
+
Zt(e, s, r);
|
|
524
525
|
}
|
|
525
526
|
delete e.llEvLisnrs;
|
|
526
|
-
},
|
|
527
|
-
|
|
528
|
-
},
|
|
529
|
-
const o =
|
|
530
|
-
|
|
531
|
-
},
|
|
532
|
-
const o =
|
|
533
|
-
|
|
534
|
-
},
|
|
535
|
-
const r =
|
|
536
|
-
if (
|
|
527
|
+
}, ot = (e, t, s) => {
|
|
528
|
+
Lt(e), ge(s, -1), Nt(s), S(e, t.class_loading), t.unobserve_completed && se(e, s);
|
|
529
|
+
}, Qt = (e, t, s, r) => {
|
|
530
|
+
const o = he(t);
|
|
531
|
+
ot(t, s, r), H(t, s.class_loaded), M(t, Ue), O(s.callback_loaded, t, r), o || rt(s, r);
|
|
532
|
+
}, Xt = (e, t, s, r) => {
|
|
533
|
+
const o = he(t);
|
|
534
|
+
ot(t, s, r), H(t, s.class_error), M(t, ue), O(s.callback_error, t, r), s.restore_on_error && D(t, J), o || rt(s, r);
|
|
535
|
+
}, ve = (e, t, s) => {
|
|
536
|
+
const r = Ge(e) || e;
|
|
537
|
+
if (be(r))
|
|
537
538
|
return;
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}, (
|
|
541
|
-
|
|
539
|
+
Kt(r, (i) => {
|
|
540
|
+
Qt(i, e, t, s), ie(r);
|
|
541
|
+
}, (i) => {
|
|
542
|
+
Xt(i, e, t, s), ie(r);
|
|
542
543
|
});
|
|
543
|
-
}, Qt = (e, t, s) => {
|
|
544
|
-
It(e), be(e, t, s), Ot(e), Vt(e, t, s), qt(e, t, s), Bt(e, t, s);
|
|
545
|
-
}, Xt = (e, t, s) => {
|
|
546
|
-
be(e, t, s), Ht(e, t, s);
|
|
547
|
-
}, ve = (e, t, s) => {
|
|
548
|
-
Gt(e) ? Xt(e, t, s) : Qt(e, t, s);
|
|
549
544
|
}, Yt = (e, t, s) => {
|
|
550
|
-
e
|
|
551
|
-
},
|
|
552
|
-
e
|
|
553
|
-
},
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
},
|
|
558
|
-
|
|
559
|
-
D(t, W);
|
|
560
|
-
}), D(e, W);
|
|
561
|
-
}, ts = (e) => {
|
|
562
|
-
We(e, (t) => {
|
|
563
|
-
D(t, re);
|
|
564
|
-
}), D(e, Je), e.load();
|
|
545
|
+
At(e), ve(e, t, s), Mt(e), qt(e, t, s), Bt(e, t, s), Ht(e, t, s);
|
|
546
|
+
}, es = (e, t, s) => {
|
|
547
|
+
ve(e, t, s), Gt(e, t, s);
|
|
548
|
+
}, me = (e, t, s) => {
|
|
549
|
+
Jt(e) ? es(e, t, s) : Yt(e, t, s);
|
|
550
|
+
}, ts = (e, t, s) => {
|
|
551
|
+
e.setAttribute("loading", "lazy"), ve(e, t, s), jt(e, t), M(e, Be);
|
|
552
|
+
}, Ee = (e) => {
|
|
553
|
+
e.removeAttribute(C), e.removeAttribute(le), e.removeAttribute(ce);
|
|
565
554
|
}, ss = (e) => {
|
|
566
|
-
|
|
555
|
+
fe(e, (t) => {
|
|
556
|
+
Ee(t);
|
|
557
|
+
}), Ee(e);
|
|
558
|
+
}, nt = (e) => {
|
|
559
|
+
fe(e, (t) => {
|
|
560
|
+
D(t, J);
|
|
561
|
+
}), D(e, J);
|
|
567
562
|
}, rs = (e) => {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
OBJECT: rs
|
|
563
|
+
Ze(e, (t) => {
|
|
564
|
+
D(t, re);
|
|
565
|
+
}), D(e, Ke), e.load();
|
|
566
|
+
}, os = (e) => {
|
|
567
|
+
D(e, re);
|
|
574
568
|
}, ns = (e) => {
|
|
575
|
-
|
|
569
|
+
D(e, Qe);
|
|
570
|
+
}, as = {
|
|
571
|
+
IMG: nt,
|
|
572
|
+
IFRAME: os,
|
|
573
|
+
VIDEO: rs,
|
|
574
|
+
OBJECT: ns
|
|
575
|
+
}, is = (e) => {
|
|
576
|
+
const t = as[e.tagName];
|
|
576
577
|
if (!t) {
|
|
577
|
-
|
|
578
|
+
Ft(e);
|
|
578
579
|
return;
|
|
579
580
|
}
|
|
580
581
|
t(e);
|
|
581
|
-
},
|
|
582
|
-
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
}, ls = (e, t, s, r) => {
|
|
586
|
-
!s.cancel_on_exit || !kt(e) || e.tagName === "IMG" && (ae(e), es(e), rt(e), S(e, s.class_loading), he(r, -1), te(e), O(s.callback_cancel, e, t, r));
|
|
587
|
-
}, cs = (e, t, s, r) => {
|
|
588
|
-
const o = Et(e);
|
|
589
|
-
M(e, wt), U(e, s.class_entered), S(e, s.class_exited), Lt(e, s, r), O(s.callback_enter, e, t, r), !o && ve(e, s, r);
|
|
582
|
+
}, ls = (e, t) => {
|
|
583
|
+
pe(e) || he(e) || (S(e, t.class_entered), S(e, t.class_exited), S(e, t.class_applied), S(e, t.class_loading), S(e, t.class_loaded), S(e, t.class_error));
|
|
584
|
+
}, cs = (e, t) => {
|
|
585
|
+
is(e), ls(e, t), te(e), Ye(e);
|
|
590
586
|
}, ds = (e, t, s, r) => {
|
|
591
|
-
|
|
592
|
-
}, us =
|
|
587
|
+
!s.cancel_on_exit || !xt(e) || e.tagName === "IMG" && (ie(e), ss(e), nt(e), S(e, s.class_loading), ge(r, -1), te(e), O(s.callback_cancel, e, t, r));
|
|
588
|
+
}, us = (e, t, s, r) => {
|
|
589
|
+
const o = It(e);
|
|
590
|
+
M(e, kt), H(e, s.class_entered), S(e, s.class_exited), zt(e, s, r), O(s.callback_enter, e, t, r), !o && me(e, s, r);
|
|
591
|
+
}, ps = (e, t, s, r) => {
|
|
592
|
+
pe(e) || (H(e, s.class_exited), ds(e, t, s, r), O(s.callback_exit, e, t, r));
|
|
593
|
+
}, hs = ["IMG", "IFRAME", "VIDEO"], at = (e) => e.use_native && "loading" in HTMLImageElement.prototype, gs = (e, t, s) => {
|
|
593
594
|
e.forEach((r) => {
|
|
594
|
-
|
|
595
|
-
}),
|
|
596
|
-
},
|
|
595
|
+
hs.indexOf(r.tagName) !== -1 && ts(r, t, s);
|
|
596
|
+
}), We(s, 0);
|
|
597
|
+
}, fs = (e) => e.isIntersecting || e.intersectionRatio > 0, bs = (e) => ({
|
|
597
598
|
root: e.container === document ? null : e.container,
|
|
598
599
|
rootMargin: e.thresholds || e.threshold + "px"
|
|
599
|
-
}),
|
|
600
|
-
e.forEach((r) =>
|
|
601
|
-
},
|
|
600
|
+
}), vs = (e, t, s) => {
|
|
601
|
+
e.forEach((r) => fs(r) ? us(r.target, r, t, s) : ps(r.target, r, t, s));
|
|
602
|
+
}, ms = (e, t) => {
|
|
602
603
|
t.forEach((s) => {
|
|
603
604
|
e.observe(s);
|
|
604
605
|
});
|
|
605
|
-
},
|
|
606
|
-
|
|
607
|
-
},
|
|
608
|
-
!
|
|
609
|
-
|
|
610
|
-
},
|
|
611
|
-
},
|
|
612
|
-
|
|
606
|
+
}, _s = (e, t) => {
|
|
607
|
+
$t(e), ms(e, t);
|
|
608
|
+
}, ws = (e, t) => {
|
|
609
|
+
!Me || at(e) || (t._observer = new IntersectionObserver((s) => {
|
|
610
|
+
vs(s, e, t);
|
|
611
|
+
}, bs(e)));
|
|
612
|
+
}, it = (e) => Array.prototype.slice.call(e), ee = (e) => e.container.querySelectorAll(e.elements_selector), ys = (e) => it(e).filter(pe), ks = (e) => Et(e), Ss = (e) => it(e).filter(ks), Ce = (e, t) => ys(e || ee(t)), xs = (e, t) => {
|
|
613
|
+
Ss(ee(e)).forEach((r) => {
|
|
613
614
|
S(r, e.class_error), te(r);
|
|
614
615
|
}), t.update();
|
|
615
|
-
},
|
|
616
|
+
}, Es = (e, t) => {
|
|
616
617
|
!N || (t._onlineHandler = () => {
|
|
617
|
-
|
|
618
|
+
xs(e, t);
|
|
618
619
|
}, window.addEventListener("online", t._onlineHandler));
|
|
619
|
-
},
|
|
620
|
+
}, Cs = (e) => {
|
|
620
621
|
!N || window.removeEventListener("online", e._onlineHandler);
|
|
621
622
|
}, X = function(e, t) {
|
|
622
|
-
const s =
|
|
623
|
-
this._settings = s, this.loadingCount = 0,
|
|
623
|
+
const s = Pe(e);
|
|
624
|
+
this._settings = s, this.loadingCount = 0, ws(s, this), Es(s, this), this.update(t);
|
|
624
625
|
};
|
|
625
626
|
X.prototype = {
|
|
626
627
|
update: function(e) {
|
|
627
|
-
const t = this._settings, s =
|
|
628
|
-
if (
|
|
628
|
+
const t = this._settings, s = Ce(e, t);
|
|
629
|
+
if (We(this, s.length), De || !Me) {
|
|
629
630
|
this.loadAll(s);
|
|
630
631
|
return;
|
|
631
632
|
}
|
|
632
|
-
if (
|
|
633
|
-
|
|
633
|
+
if (at(t)) {
|
|
634
|
+
gs(s, t, this);
|
|
634
635
|
return;
|
|
635
636
|
}
|
|
636
|
-
|
|
637
|
+
_s(this._observer, s);
|
|
637
638
|
},
|
|
638
639
|
destroy: function() {
|
|
639
|
-
this._observer && this._observer.disconnect(),
|
|
640
|
-
|
|
640
|
+
this._observer && this._observer.disconnect(), Cs(this), ee(this._settings).forEach((e) => {
|
|
641
|
+
Ye(e);
|
|
641
642
|
}), delete this._observer, delete this._settings, delete this._onlineHandler, delete this.loadingCount, delete this.toLoadCount;
|
|
642
643
|
},
|
|
643
644
|
loadAll: function(e) {
|
|
644
645
|
const t = this._settings;
|
|
645
|
-
|
|
646
|
-
se(r, this),
|
|
646
|
+
Ce(e, t).forEach((r) => {
|
|
647
|
+
se(r, this), me(r, t, this);
|
|
647
648
|
});
|
|
648
649
|
},
|
|
649
650
|
restoreAll: function() {
|
|
650
651
|
const e = this._settings;
|
|
651
652
|
ee(e).forEach((t) => {
|
|
652
|
-
|
|
653
|
+
cs(t, e);
|
|
653
654
|
});
|
|
654
655
|
}
|
|
655
656
|
};
|
|
656
657
|
X.load = (e, t) => {
|
|
657
|
-
const s =
|
|
658
|
-
|
|
658
|
+
const s = Pe(t);
|
|
659
|
+
me(e, s);
|
|
659
660
|
};
|
|
660
661
|
X.resetStatus = (e) => {
|
|
661
662
|
te(e);
|
|
662
663
|
};
|
|
663
|
-
N &&
|
|
664
|
-
const V = "netless-app-slide",
|
|
665
|
-
function
|
|
664
|
+
N && yt(X, window.lazyLoadOptions);
|
|
665
|
+
const V = "netless-app-slide", lt = "https://convertcdn.netless.link/dynamicConvert";
|
|
666
|
+
function W() {
|
|
666
667
|
}
|
|
667
|
-
const
|
|
668
|
+
const Is = `.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-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)}
|
|
668
669
|
`;
|
|
669
|
-
function
|
|
670
|
+
function As(e) {
|
|
670
671
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
671
672
|
s.setAttribute("class", `${e}-footer-icon-sidebar`), s.setAttribute("viewBox", "0 0 64 64");
|
|
672
673
|
const r = document.createElementNS(t, "path");
|
|
673
674
|
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "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"), s.appendChild(r), s;
|
|
674
675
|
}
|
|
675
|
-
function
|
|
676
|
+
function Ls(e) {
|
|
676
677
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
677
678
|
s.setAttribute("class", `${e}-footer-icon-arrow-left`), s.setAttribute("viewBox", "0 0 500 500");
|
|
678
679
|
const r = document.createElementNS(t, "path");
|
|
679
680
|
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "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"), s.appendChild(r), s;
|
|
680
681
|
}
|
|
681
|
-
function
|
|
682
|
+
function $s(e) {
|
|
682
683
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
683
684
|
s.setAttribute("class", `${e}-footer-icon-play`), s.setAttribute("viewBox", "0 0 500 500");
|
|
684
685
|
const r = document.createElementNS(t, "path");
|
|
685
686
|
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "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"), s.appendChild(r), s;
|
|
686
687
|
}
|
|
687
|
-
function
|
|
688
|
+
function zs(e) {
|
|
688
689
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
689
690
|
s.setAttribute("class", `${e}-footer-icon-pause`), s.setAttribute("viewBox", "0 0 500 500");
|
|
690
691
|
const r = document.createElementNS(t, "path");
|
|
691
692
|
return r.setAttribute("fill", "currentColor"), r.setAttribute("d", "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"), s.appendChild(r), s;
|
|
692
693
|
}
|
|
693
|
-
function
|
|
694
|
+
function Ns(e) {
|
|
694
695
|
const t = "http://www.w3.org/2000/svg", s = document.createElementNS(t, "svg");
|
|
695
696
|
s.setAttribute("class", `${e}-footer-icon-arrow-right`), s.setAttribute("viewBox", "0 0 500 500");
|
|
696
697
|
const r = document.createElementNS(t, "path");
|
|
@@ -699,7 +700,7 @@ function $s(e) {
|
|
|
699
700
|
function g(e) {
|
|
700
701
|
return document.createElement(e);
|
|
701
702
|
}
|
|
702
|
-
function
|
|
703
|
+
function U(e, t) {
|
|
703
704
|
return e.appendChild(t);
|
|
704
705
|
}
|
|
705
706
|
function f(e) {
|
|
@@ -708,31 +709,31 @@ function f(e) {
|
|
|
708
709
|
function m(e, t) {
|
|
709
710
|
e.className = f(t);
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function Os(e) {
|
|
712
713
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
713
714
|
}
|
|
714
|
-
async function
|
|
715
|
-
const s =
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
}),
|
|
719
|
-
return { preview: await l, slide: await
|
|
715
|
+
async function ct({ taskId: e, url: t }) {
|
|
716
|
+
const s = dt(e, t), r = `${s}/preview/1.png`, o = `${s}/jsonOutput/slide-1.json`, l = new Promise((n) => {
|
|
717
|
+
const a = new Image();
|
|
718
|
+
a.onload = () => n(a), a.onerror = () => n(null), a.src = r;
|
|
719
|
+
}), i = fetch(o).then((n) => n.json());
|
|
720
|
+
return { preview: await l, slide: await i };
|
|
720
721
|
}
|
|
721
|
-
function
|
|
722
|
-
return `${
|
|
722
|
+
function dt(e, t) {
|
|
723
|
+
return `${Os(t || lt)}/${e}`;
|
|
723
724
|
}
|
|
724
|
-
function
|
|
725
|
-
let e =
|
|
725
|
+
function Ds() {
|
|
726
|
+
let e = W;
|
|
726
727
|
const t = (p) => {
|
|
727
728
|
e = p;
|
|
728
729
|
};
|
|
729
|
-
let s = !1, r = !1, o = !1, l = [],
|
|
730
|
-
const
|
|
730
|
+
let s = !1, r = !1, o = !1, l = [], i = 0;
|
|
731
|
+
const n = f("readonly"), a = f("preview-active"), d = g("div");
|
|
731
732
|
m(d, "content");
|
|
732
733
|
const u = g("div");
|
|
733
734
|
m(u, "preview-mask"), u.onclick = function(w) {
|
|
734
735
|
r || w.target === u && b(!1);
|
|
735
|
-
},
|
|
736
|
+
}, U(d, u);
|
|
736
737
|
const h = g("div");
|
|
737
738
|
m(h, "preview"), h.classList.add(f("tele-fancy-scrollbar")), h.onclick = function(w) {
|
|
738
739
|
var L;
|
|
@@ -740,35 +741,35 @@ function Os() {
|
|
|
740
741
|
return;
|
|
741
742
|
const E = (L = w.target.dataset) == null ? void 0 : L.pageIndex;
|
|
742
743
|
E && (w.preventDefault(), w.stopPropagation(), w.stopImmediatePropagation(), e(Number(E)), b(!1));
|
|
743
|
-
},
|
|
744
|
+
}, U(d, h);
|
|
744
745
|
const k = new X({
|
|
745
746
|
container: h,
|
|
746
747
|
elements_selector: `.${f("preview-page>img")}`
|
|
747
748
|
});
|
|
748
749
|
function x(p) {
|
|
749
|
-
r !== p && (r = p, d.classList.toggle(
|
|
750
|
+
r !== p && (r = p, d.classList.toggle(n, r));
|
|
750
751
|
}
|
|
751
752
|
function b(p) {
|
|
752
|
-
o !== p && (o = p, d.classList.toggle(
|
|
753
|
+
o !== p && (o = p, d.classList.toggle(a, o));
|
|
753
754
|
}
|
|
754
755
|
function T(p) {
|
|
755
756
|
if (l !== p) {
|
|
756
757
|
l = p;
|
|
757
758
|
const w = f("preview-page"), E = f("preview-page-name");
|
|
758
759
|
l.forEach((L, F) => {
|
|
759
|
-
const
|
|
760
|
-
c.className = w + " " + f(`preview-page-${F}`), c.href = "#", c.dataset.pageIndex =
|
|
760
|
+
const j = String(F), c = g("a");
|
|
761
|
+
c.className = w + " " + f(`preview-page-${F}`), c.href = "#", c.dataset.pageIndex = j;
|
|
761
762
|
const P = g("span");
|
|
762
|
-
P.className = E, P.textContent = String(F + 1), P.dataset.pageIndex =
|
|
763
|
+
P.className = E, P.textContent = String(F + 1), P.dataset.pageIndex = j;
|
|
763
764
|
const R = g("img");
|
|
764
|
-
R.width = L.width, R.height = L.height, R.src = L.thumbnail, R.alt = `page-${F}`, R.dataset.pageIndex =
|
|
765
|
+
R.width = L.width, R.height = L.height, R.src = L.thumbnail, R.alt = `page-${F}`, R.dataset.pageIndex = j, U(c, R), U(c, P), U(h, c);
|
|
765
766
|
}), s || k.update();
|
|
766
767
|
}
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
-
if (w ||
|
|
770
|
-
|
|
771
|
-
const E = h.querySelector(`.${f(`preview-page-${
|
|
769
|
+
function I(p, w = !1) {
|
|
770
|
+
if (w || i !== p) {
|
|
771
|
+
i = p;
|
|
772
|
+
const E = h.querySelector(`.${f(`preview-page-${i}`)}`);
|
|
772
773
|
E && h.scrollTo({ top: E.offsetTop - 16 });
|
|
773
774
|
}
|
|
774
775
|
}
|
|
@@ -786,67 +787,67 @@ function Os() {
|
|
|
786
787
|
get_active: y,
|
|
787
788
|
set_pages: T,
|
|
788
789
|
on_new_page_index: t,
|
|
789
|
-
set_page_index:
|
|
790
|
+
set_page_index: I,
|
|
790
791
|
destroy: A
|
|
791
792
|
};
|
|
792
793
|
}
|
|
793
|
-
function
|
|
794
|
-
let e =
|
|
794
|
+
function Ms() {
|
|
795
|
+
let e = W;
|
|
795
796
|
const t = (c) => {
|
|
796
797
|
e = c;
|
|
797
798
|
};
|
|
798
|
-
let s =
|
|
799
|
+
let s = W;
|
|
799
800
|
const r = (c) => {
|
|
800
801
|
s = c;
|
|
801
802
|
};
|
|
802
|
-
let o =
|
|
803
|
+
let o = W;
|
|
803
804
|
const l = (c) => {
|
|
804
805
|
o = c;
|
|
805
806
|
};
|
|
806
|
-
let
|
|
807
|
+
let i = !1, n = !1, a = 0, d = 0;
|
|
807
808
|
const u = g("div");
|
|
808
809
|
m(u, "footer");
|
|
809
810
|
const h = g("button");
|
|
810
|
-
m(h, "btn-sidebar"), h.classList.add(f("footer-btn")), h.appendChild(
|
|
811
|
-
|
|
811
|
+
m(h, "btn-sidebar"), h.classList.add(f("footer-btn")), h.appendChild(As(V)), h.onclick = function() {
|
|
812
|
+
i || s();
|
|
812
813
|
}, h.style.display = "none", u.appendChild(h);
|
|
813
814
|
const k = g("div");
|
|
814
815
|
m(k, "page-jumps");
|
|
815
816
|
const x = g("button");
|
|
816
|
-
m(x, "btn-page-back"), x.classList.add(f("footer-btn")), x.appendChild(
|
|
817
|
-
|
|
817
|
+
m(x, "btn-page-back"), x.classList.add(f("footer-btn")), x.appendChild(Ls(V)), x.onclick = function() {
|
|
818
|
+
i || e(a - 1);
|
|
818
819
|
}, k.appendChild(x);
|
|
819
820
|
const b = g("button");
|
|
820
|
-
m(b, "btn-page-play"), b.classList.add(f("footer-btn")), b.appendChild(
|
|
821
|
+
m(b, "btn-page-play"), b.classList.add(f("footer-btn")), b.appendChild($s(V)), b.appendChild(zs(V));
|
|
821
822
|
let T = 0;
|
|
822
823
|
b.onclick = function() {
|
|
823
|
-
|
|
824
|
+
i || (b.classList.add(f("footer-btn-playing")), o(), clearTimeout(T), T = setTimeout(() => {
|
|
824
825
|
b.classList.remove(f("footer-btn-playing"));
|
|
825
826
|
}, 500));
|
|
826
827
|
}, k.appendChild(b);
|
|
827
|
-
const
|
|
828
|
-
m(
|
|
829
|
-
|
|
830
|
-
}, k.appendChild(
|
|
828
|
+
const I = g("button");
|
|
829
|
+
m(I, "btn-page-next"), I.classList.add(f("footer-btn")), I.appendChild(Ns(V)), I.onclick = function() {
|
|
830
|
+
i || e(a + 1);
|
|
831
|
+
}, k.appendChild(I);
|
|
831
832
|
const A = g("div");
|
|
832
833
|
m(A, "page-number");
|
|
833
834
|
const y = g("input");
|
|
834
|
-
m(y, "page-number-input"), y.value = String(
|
|
835
|
-
|
|
835
|
+
m(y, "page-number-input"), y.value = String(a + 1), y.onchange = function() {
|
|
836
|
+
i || y.value && e(Number(y.value) - 1);
|
|
836
837
|
};
|
|
837
838
|
const p = g("span");
|
|
838
839
|
m(p, "total-page"), p.textContent = " / ", A.appendChild(y), A.appendChild(p), u.appendChild(k), u.appendChild(A);
|
|
839
840
|
const w = f("readonly");
|
|
840
841
|
function E(c) {
|
|
841
|
-
|
|
842
|
+
i !== c && (i = c, u.classList.toggle(w, i), y.disabled = i);
|
|
842
843
|
}
|
|
843
844
|
function L(c) {
|
|
844
|
-
|
|
845
|
+
n !== c && (n = c, h.style.display = n ? "" : "none");
|
|
845
846
|
}
|
|
846
847
|
function F(c, P = !1) {
|
|
847
|
-
(P ||
|
|
848
|
+
(P || a !== c) && (a = c, y.value = String(a + 1));
|
|
848
849
|
}
|
|
849
|
-
function
|
|
850
|
+
function j(c) {
|
|
850
851
|
d !== c && (d = c, p.textContent = ` / ${d}`);
|
|
851
852
|
}
|
|
852
853
|
return {
|
|
@@ -855,32 +856,32 @@ function Ds() {
|
|
|
855
856
|
set_readonly: E,
|
|
856
857
|
set_sidebar: L,
|
|
857
858
|
set_page_index: F,
|
|
858
|
-
set_page_count:
|
|
859
|
+
set_page_count: j,
|
|
859
860
|
on_new_page_index: t,
|
|
860
861
|
on_toggle_preview: r,
|
|
861
862
|
on_play: l
|
|
862
863
|
};
|
|
863
864
|
}
|
|
864
|
-
function
|
|
865
|
+
function Ts() {
|
|
865
866
|
const e = g("div");
|
|
866
867
|
return m(e, "slide"), e;
|
|
867
868
|
}
|
|
868
|
-
function
|
|
869
|
+
function Fs(e) {
|
|
869
870
|
if (typeof document < "u") {
|
|
870
871
|
const t = () => e(document.visibilityState === "visible");
|
|
871
872
|
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
872
873
|
}
|
|
873
|
-
return
|
|
874
|
+
return W;
|
|
874
875
|
}
|
|
875
|
-
class
|
|
876
|
+
class B {
|
|
876
877
|
constructor(t) {
|
|
877
|
-
this.sideEffect = new
|
|
878
|
+
this.sideEffect = new Oe(), this.$slide = Ts(), this.sidebar = Ds(), this.footer = Ms(), this._ready = !1, this._slideCount = 0, this._destroyed = !1, this._isFrozen = !1, this.$content = this.sidebar.$content, this.$footer = this.footer.$footer, U(this.$content, this.$slide);
|
|
878
879
|
let s;
|
|
879
|
-
this._readyPromise = new Promise((
|
|
880
|
-
s =
|
|
880
|
+
this._readyPromise = new Promise((n) => {
|
|
881
|
+
s = n;
|
|
881
882
|
});
|
|
882
|
-
const r = (
|
|
883
|
-
this._ready &&
|
|
883
|
+
const r = (n) => {
|
|
884
|
+
this._ready && n >= 0 && n < this._slideCount ? this.slide.renderSlide(n + 1) : this.setPage(this.slide.slideState.currentSlideIndex);
|
|
884
885
|
};
|
|
885
886
|
this.sidebar.on_new_page_index(r), this.footer.on_new_page_index(r), this.footer.on_toggle_preview(() => {
|
|
886
887
|
this.sidebar.set_active(!this.sidebar.get_active());
|
|
@@ -890,39 +891,39 @@ class J {
|
|
|
890
891
|
this.$content.parentElement && this.$content.remove(), this.$footer.parentElement && this.$footer.remove(), this.$slide.parentElement && this.$slide.remove();
|
|
891
892
|
});
|
|
892
893
|
let o = !1;
|
|
893
|
-
this.sideEffect.addDisposer(
|
|
894
|
-
this._destroyed || (
|
|
895
|
-
})), this.slide = new
|
|
894
|
+
this.sideEffect.addDisposer(Fs((n) => {
|
|
895
|
+
this._destroyed || (n ? o || this.unfreeze() : (o = this._isFrozen, this.freeze()));
|
|
896
|
+
})), this.slide = new ae({
|
|
896
897
|
anchor: this.$slide,
|
|
897
898
|
resize: !0,
|
|
898
899
|
mode: "local",
|
|
899
900
|
interactive: !0,
|
|
900
901
|
enableGlobalClick: !0,
|
|
901
902
|
...t
|
|
902
|
-
}), this.slide.setResource(t.taskId, t.url ||
|
|
903
|
+
}), this.slide.setResource(t.taskId, t.url || lt);
|
|
903
904
|
let l;
|
|
904
|
-
this._infoPromise = new Promise((
|
|
905
|
-
l =
|
|
906
|
-
}), this.slide.on("slideChange", (
|
|
907
|
-
this._destroyed || this.setPage(
|
|
905
|
+
this._infoPromise = new Promise((n) => {
|
|
906
|
+
l = n;
|
|
907
|
+
}), this.slide.on("slideChange", (n) => {
|
|
908
|
+
this._destroyed || this.setPage(n);
|
|
908
909
|
}), this.slide.on("renderEnd", () => {
|
|
909
910
|
this._ready || setTimeout(() => {
|
|
910
911
|
this._ready = !0, s();
|
|
911
912
|
}, 1e3);
|
|
912
|
-
}),
|
|
913
|
+
}), ct(t).then(({ preview: n, slide: a }) => {
|
|
913
914
|
if (!this._destroyed) {
|
|
914
|
-
if (this._slideCount =
|
|
915
|
-
const { taskId: d, url: u } = t, { slideCount: h } =
|
|
915
|
+
if (this._slideCount = a.slideCount, n) {
|
|
916
|
+
const { taskId: d, url: u } = t, { slideCount: h } = a, { width: k, height: x } = n, b = dt(d, u), T = Array.from({ length: h }, (I, A) => ({
|
|
916
917
|
width: k,
|
|
917
918
|
height: x,
|
|
918
919
|
thumbnail: `${b}/preview/${A + 1}.png`
|
|
919
920
|
}));
|
|
920
921
|
this.sidebar.set_pages(T), this.footer.set_sidebar(!0);
|
|
921
922
|
}
|
|
922
|
-
this.footer.set_page_count(
|
|
923
|
+
this.footer.set_page_count(a.slideCount), l(a);
|
|
923
924
|
}
|
|
924
|
-
}).catch((
|
|
925
|
-
console.log("[Slide] fetch slide info error"), console.error(
|
|
925
|
+
}).catch((n) => {
|
|
926
|
+
console.log("[Slide] fetch slide info error"), console.error(n);
|
|
926
927
|
}), this.ready(() => {
|
|
927
928
|
this._isFrozen && this.freeze();
|
|
928
929
|
});
|
|
@@ -949,8 +950,9 @@ class J {
|
|
|
949
950
|
this._destroyed || (this._isFrozen = !1, this._ready && this.slide.release());
|
|
950
951
|
}
|
|
951
952
|
}
|
|
952
|
-
|
|
953
|
-
|
|
953
|
+
B.styles = Is;
|
|
954
|
+
B.fetchSlideInfo = ct;
|
|
955
|
+
class Ps {
|
|
954
956
|
constructor() {
|
|
955
957
|
this.threshold = 2, this._map = /* @__PURE__ */ new Map(), this._queue = [];
|
|
956
958
|
}
|
|
@@ -973,67 +975,73 @@ class Fs {
|
|
|
973
975
|
});
|
|
974
976
|
}
|
|
975
977
|
}
|
|
976
|
-
const
|
|
978
|
+
const ut = new Ps(), js = function(t) {
|
|
977
979
|
t.on("focus", (s) => {
|
|
978
|
-
|
|
980
|
+
ut.focus(s.appId);
|
|
979
981
|
});
|
|
980
|
-
},
|
|
982
|
+
}, Gs = /* @__PURE__ */ ae.usePlugin.bind(ae), Ws = "0.3.0-canary.7", Js = {
|
|
981
983
|
kind: "Slide",
|
|
982
984
|
setup(e) {
|
|
983
|
-
var
|
|
984
|
-
if (console.log("[Slide] setup @ 0.3.0-canary.
|
|
985
|
+
var i, n;
|
|
986
|
+
if (console.log("[Slide] setup @ 0.3.0-canary.7"), !e.storage.state.taskId)
|
|
985
987
|
throw new Error("[Slide] no taskId");
|
|
986
|
-
const t = e.getAppOptions() || {}, s =
|
|
987
|
-
|
|
988
|
-
const
|
|
988
|
+
const t = e.getAppOptions() || {}, s = t.renderOptions || {}, r = Vs(e, t.debug);
|
|
989
|
+
r.info("[Slide] setup @ 0.3.0-canary.7");
|
|
990
|
+
const o = new Oe(), l = new B({
|
|
989
991
|
interactive: !0,
|
|
990
992
|
mode: "interactive",
|
|
991
993
|
resize: !0,
|
|
992
994
|
enableGlobalClick: !0,
|
|
993
|
-
timestamp:
|
|
994
|
-
logger:
|
|
995
|
+
timestamp: Rs(e),
|
|
996
|
+
logger: t.logger || r,
|
|
995
997
|
renderOptions: {
|
|
996
|
-
minFPS:
|
|
997
|
-
maxFPS:
|
|
998
|
-
autoFPS: (
|
|
999
|
-
autoResolution: (
|
|
1000
|
-
resolution:
|
|
1001
|
-
maxResolutionLevel:
|
|
1002
|
-
transactionBgColor:
|
|
998
|
+
minFPS: s.minFPS || 25,
|
|
999
|
+
maxFPS: s.maxFPS || 30,
|
|
1000
|
+
autoFPS: (i = s.autoFPS) != null ? i : !0,
|
|
1001
|
+
autoResolution: (n = s.autoResolution) != null ? n : !0,
|
|
1002
|
+
resolution: s.resolution,
|
|
1003
|
+
maxResolutionLevel: s.maxResolutionLevel,
|
|
1004
|
+
transactionBgColor: s.transactionBgColor || pt(e.box.$content)
|
|
1003
1005
|
},
|
|
1006
|
+
rtcAudio: t.rtcAudio,
|
|
1007
|
+
useLocalCache: t.useLocalCache,
|
|
1008
|
+
resourceTimeout: t.resourceTimeout,
|
|
1009
|
+
loaderDelegate: t.loaderDelegate,
|
|
1010
|
+
navigatorDelegate: t.navigatorDelegate,
|
|
1011
|
+
fixedFrameSize: t.fixedFrameSize,
|
|
1004
1012
|
taskId: e.storage.state.taskId,
|
|
1005
1013
|
url: e.storage.state.url
|
|
1006
1014
|
});
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
});
|
|
1015
|
+
return l.context = e, o.addDisposer(ut.set(e.appId, l)), e.box.mountStyles(B.styles), e.box.mountStage(l.$slide), e.box.mountFooter(l.$footer), e.box.mountContent(l.$content), o.addDisposer(() => l.destroy()), Bs({ context: e, viewer: l, sideEffect: o, logger: r }), qs(e, () => {
|
|
1016
|
+
r.info("[Slide] destroy"), o.flushAll();
|
|
1017
|
+
}), l;
|
|
1010
1018
|
}
|
|
1011
1019
|
};
|
|
1012
|
-
function
|
|
1013
|
-
const { container: t } = e;
|
|
1020
|
+
function Zs(e) {
|
|
1021
|
+
const { container: t, ...s } = e;
|
|
1014
1022
|
t.style.cssText = "display:flex;flex-direction:column";
|
|
1015
|
-
const
|
|
1016
|
-
return t.appendChild(document.createElement("style")).textContent =
|
|
1023
|
+
const r = new B(s);
|
|
1024
|
+
return t.appendChild(document.createElement("style")).textContent = B.styles, t.appendChild(r.$content), t.appendChild(r.$footer), r.prepare(() => r.slide.renderSlide(1)), r;
|
|
1017
1025
|
}
|
|
1018
|
-
function
|
|
1026
|
+
function Rs(e) {
|
|
1019
1027
|
const t = e.room, s = e.displayer;
|
|
1020
1028
|
return t ? () => t.calibrationTimestamp : s ? () => s.beginTimestamp + s.progressTime : () => Date.now();
|
|
1021
1029
|
}
|
|
1022
|
-
function
|
|
1030
|
+
function Vs(e, t) {
|
|
1023
1031
|
return e.displayer.logger;
|
|
1024
1032
|
}
|
|
1025
|
-
function
|
|
1033
|
+
function pt(e) {
|
|
1026
1034
|
try {
|
|
1027
1035
|
let t = window.getComputedStyle(e).backgroundColor;
|
|
1028
1036
|
if (t !== "rgba(0, 0, 0, 0)" && t !== "transparent")
|
|
1029
|
-
return t =
|
|
1037
|
+
return t = Us(t), console.log("[Slide] guess bg color:", t), t;
|
|
1030
1038
|
if (e.parentElement)
|
|
1031
|
-
return
|
|
1039
|
+
return pt(e.parentElement);
|
|
1032
1040
|
} catch {
|
|
1033
1041
|
}
|
|
1034
1042
|
return "#ffffff";
|
|
1035
1043
|
}
|
|
1036
|
-
function
|
|
1044
|
+
function Us(e) {
|
|
1037
1045
|
const t = Ie.exports.get(e);
|
|
1038
1046
|
if (t && t.model === "rgb") {
|
|
1039
1047
|
const s = t.value, o = (((Math.round(s[0]) & 255) << 16) + ((Math.round(s[1]) & 255) << 8) + (Math.round(s[2]) & 255)).toString(16);
|
|
@@ -1047,45 +1055,48 @@ function qs(e, t) {
|
|
|
1047
1055
|
function Bs({ context: e, viewer: t, sideEffect: s, logger: r }) {
|
|
1048
1056
|
const o = r.info.bind(r);
|
|
1049
1057
|
let l = null;
|
|
1050
|
-
t.prepare(({ width:
|
|
1051
|
-
e.destroyed || (
|
|
1058
|
+
t.prepare(({ width: a, height: d, slideCount: u }) => {
|
|
1059
|
+
e.destroyed || (a && e.box.setStageRatio(d / a), l = e.createWhiteBoardView({ size: u }), l.setBaseRect({ width: a, height: d }), n());
|
|
1052
1060
|
});
|
|
1053
|
-
const { slide:
|
|
1054
|
-
function
|
|
1061
|
+
const { slide: i } = t;
|
|
1062
|
+
function n() {
|
|
1055
1063
|
if (e.storage.state.state)
|
|
1056
|
-
o("[Slide] restore", { ...e.storage.state.state }),
|
|
1064
|
+
o("[Slide] restore", { ...e.storage.state.state }), i.setSlideState(e.storage.state.state);
|
|
1057
1065
|
else if (e.isAddApp)
|
|
1058
|
-
o("[Slide] kick start"),
|
|
1066
|
+
o("[Slide] kick start"), i.renderSlide(1);
|
|
1059
1067
|
else {
|
|
1060
1068
|
o("[Slide] wait for restore");
|
|
1061
|
-
const
|
|
1069
|
+
const a = s.add(() => {
|
|
1062
1070
|
const u = setInterval(() => {
|
|
1063
|
-
e.storage.state.state || (o("[Slide] timeout"),
|
|
1071
|
+
e.storage.state.state || (o("[Slide] timeout"), i.renderSlide(1));
|
|
1064
1072
|
}, 15e3);
|
|
1065
1073
|
return () => clearInterval(u);
|
|
1066
1074
|
}), d = s.addDisposer(e.storage.addStateChangedListener(() => {
|
|
1067
|
-
e.storage.state.state && (o("[Slide] restore", { ...e.storage.state.state }),
|
|
1075
|
+
e.storage.state.state && (o("[Slide] restore", { ...e.storage.state.state }), i.setSlideState(e.storage.state.state), s.flush(d), s.flush(a));
|
|
1068
1076
|
}));
|
|
1069
1077
|
}
|
|
1070
1078
|
}
|
|
1071
|
-
|
|
1072
|
-
e.isWritable && (o("[Slide] save state", { ...
|
|
1073
|
-
}),
|
|
1074
|
-
e.isWritable && (o("[Slide] dispatch", { ...
|
|
1075
|
-
}), s.addDisposer(e.addMagixEventListener("syncDispatch", ({ payload:
|
|
1076
|
-
o("[Slide] receive", { ...
|
|
1077
|
-
}, { fireSelfEventAfterCommit: !0 })),
|
|
1078
|
-
e.isWritable && l && (o("[Slide] page to",
|
|
1079
|
-
}), t.setReadonly(!e.isWritable), s.addDisposer(e.emitter.on("writableChange", (
|
|
1080
|
-
t.setReadonly(!
|
|
1079
|
+
i.on("stateChange", () => {
|
|
1080
|
+
e.isWritable && (o("[Slide] save state", { ...i.slideState }), e.storage.setState({ state: i.slideState }));
|
|
1081
|
+
}), i.on("syncDispatch", (a) => {
|
|
1082
|
+
e.isWritable && (o("[Slide] dispatch", { ...a }), e.dispatchMagixEvent("syncDispatch", a));
|
|
1083
|
+
}), s.addDisposer(e.addMagixEventListener("syncDispatch", ({ payload: a }) => {
|
|
1084
|
+
o("[Slide] receive", { ...a }), i.emit("syncReceive", a);
|
|
1085
|
+
}, { fireSelfEventAfterCommit: !0 })), i.on("slideChange", (a) => {
|
|
1086
|
+
e.isWritable && l && (o("[Slide] page to", a), l.jumpPage(a - 1));
|
|
1087
|
+
}), t.setReadonly(!e.isWritable), s.addDisposer(e.emitter.on("writableChange", (a) => {
|
|
1088
|
+
t.setReadonly(!a);
|
|
1081
1089
|
}));
|
|
1082
1090
|
}
|
|
1083
1091
|
export {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1092
|
+
lt as DefaultUrl,
|
|
1093
|
+
Xs as Slide,
|
|
1094
|
+
B as SlideViewer,
|
|
1095
|
+
js as addHooks,
|
|
1096
|
+
Js as default,
|
|
1097
|
+
Zs as previewSlide,
|
|
1098
|
+
ut as refrigerator,
|
|
1099
|
+
Gs as usePlugin,
|
|
1100
|
+
Ws as version
|
|
1090
1101
|
};
|
|
1091
1102
|
//# sourceMappingURL=main.mjs.map
|