@xwadex/fesd 0.0.47 → 0.0.49
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/image-preview-bundle.js +588 -569
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +21 -20
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Ds = Object.defineProperty;
|
|
2
|
+
var ks = (n, i, t) => i in n ? Ds(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
+
var Xe = (n, i, t) => (ks(n, typeof i != "symbol" ? i + "" : i, t), t), xs = (n, i, t) => {
|
|
4
4
|
if (!i.has(n))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
@@ -9,15 +9,15 @@ var h = (n, i, t) => {
|
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
11
11
|
};
|
|
12
|
-
var d = (n, i, t) => (
|
|
13
|
-
import { OverlayScrollbars as
|
|
12
|
+
var d = (n, i, t) => (xs(n, i, "access private method"), t);
|
|
13
|
+
import { OverlayScrollbars as je } from "overlayscrollbars";
|
|
14
14
|
import f from "jquery";
|
|
15
15
|
import "./vendor-bundle.js";
|
|
16
16
|
import "validator";
|
|
17
17
|
import "flatpickr";
|
|
18
|
-
import
|
|
19
|
-
import { lock as
|
|
20
|
-
const
|
|
18
|
+
import ti from "vanilla-lazyload";
|
|
19
|
+
import { lock as $s, unlock as _s } from "tua-body-scroll-lock";
|
|
20
|
+
const ze = {
|
|
21
21
|
SETTINGS: {
|
|
22
22
|
videoId: null,
|
|
23
23
|
videoType: null,
|
|
@@ -60,7 +60,7 @@ const je = {
|
|
|
60
60
|
TEMPLATE() {
|
|
61
61
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, Cs = {
|
|
64
64
|
SETTINGS: {
|
|
65
65
|
success: null,
|
|
66
66
|
text: null,
|
|
@@ -117,7 +117,7 @@ const je = {
|
|
|
117
117
|
gap: 30
|
|
118
118
|
// 跑馬燈內容之間的距離 - Number
|
|
119
119
|
}
|
|
120
|
-
},
|
|
120
|
+
}, Be = {
|
|
121
121
|
SETTINGS: {
|
|
122
122
|
scrollbar: {
|
|
123
123
|
"scrollbar-track-color": "transparent",
|
|
@@ -145,7 +145,7 @@ const je = {
|
|
|
145
145
|
</div>`;
|
|
146
146
|
return t || r;
|
|
147
147
|
}
|
|
148
|
-
},
|
|
148
|
+
}, Hs = {
|
|
149
149
|
SETTINGS: {
|
|
150
150
|
basic_rwd: 900,
|
|
151
151
|
markdownLink: !1,
|
|
@@ -154,7 +154,7 @@ const je = {
|
|
|
154
154
|
navigation: !1,
|
|
155
155
|
scrollStep: !1
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, ei = {
|
|
158
158
|
SETTINGS: {
|
|
159
159
|
scroller: window,
|
|
160
160
|
class: "aost-show",
|
|
@@ -177,7 +177,7 @@ const je = {
|
|
|
177
177
|
enter: null,
|
|
178
178
|
leave: null
|
|
179
179
|
}
|
|
180
|
-
},
|
|
180
|
+
}, mt = {
|
|
181
181
|
SETTINGS: {
|
|
182
182
|
target: null,
|
|
183
183
|
container: null,
|
|
@@ -195,7 +195,7 @@ const je = {
|
|
|
195
195
|
beforeScroll: null,
|
|
196
196
|
afterScroll: null
|
|
197
197
|
}
|
|
198
|
-
},
|
|
198
|
+
}, q = {
|
|
199
199
|
SETTINGS: {
|
|
200
200
|
type: "drag",
|
|
201
201
|
drag: {
|
|
@@ -237,7 +237,7 @@ const je = {
|
|
|
237
237
|
return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
},
|
|
240
|
+
}, ii = {
|
|
241
241
|
SETTINGS: {
|
|
242
242
|
// 樣式 normal / process
|
|
243
243
|
type: "normal",
|
|
@@ -257,7 +257,7 @@ const je = {
|
|
|
257
257
|
// 步驟狀態綁定
|
|
258
258
|
stepOutput: ".step-show"
|
|
259
259
|
}
|
|
260
|
-
},
|
|
260
|
+
}, si = {
|
|
261
261
|
SETTINGS: {
|
|
262
262
|
collapseClass: "collapse",
|
|
263
263
|
block: "[collapse-block]",
|
|
@@ -290,7 +290,7 @@ const je = {
|
|
|
290
290
|
update: null,
|
|
291
291
|
afterUpdate: null
|
|
292
292
|
}
|
|
293
|
-
},
|
|
293
|
+
}, ni = {
|
|
294
294
|
SETTINGS: {
|
|
295
295
|
// 是否要加 hover 效果?
|
|
296
296
|
hover: !0,
|
|
@@ -305,29 +305,29 @@ const je = {
|
|
|
305
305
|
// hover 毫秒 ?
|
|
306
306
|
speed: 600
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
309
309
|
__proto__: null,
|
|
310
|
-
anchor4:
|
|
311
|
-
aost4:
|
|
312
|
-
article4:
|
|
313
|
-
collapse4:
|
|
314
|
-
dropdown4:
|
|
310
|
+
anchor4: mt,
|
|
311
|
+
aost4: ei,
|
|
312
|
+
article4: Hs,
|
|
313
|
+
collapse4: si,
|
|
314
|
+
dropdown4: Be,
|
|
315
315
|
marquee4: M,
|
|
316
316
|
modal4: P,
|
|
317
|
-
multipurpose4:
|
|
318
|
-
ripple4:
|
|
319
|
-
share4:
|
|
320
|
-
tab4:
|
|
321
|
-
video4:
|
|
322
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
317
|
+
multipurpose4: q,
|
|
318
|
+
ripple4: ni,
|
|
319
|
+
share4: Cs,
|
|
320
|
+
tab4: ii,
|
|
321
|
+
video4: ze
|
|
322
|
+
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
323
323
|
before: "beforebegin",
|
|
324
324
|
after: "afterend",
|
|
325
325
|
append: "beforeend",
|
|
326
326
|
prepend: "afterbegin"
|
|
327
|
-
},
|
|
327
|
+
}, dt = (n) => typeof n == "string" && n !== "", Se = (n) => n instanceof HTMLElement, ut = (n) => n instanceof NodeList, E = (n) => x(n) !== null, G = (n) => typeof n == "function", x = (n) => Se(n) ? n : document.querySelector(n), $ = (n) => ut(n) ? n : document.querySelectorAll(n), Ms = () => Math.random().toString(36).substr(2, 9), Is = (n) => {
|
|
328
328
|
const i = document.createElement("div");
|
|
329
329
|
return i.innerHTML = n, i.childNodes;
|
|
330
|
-
},
|
|
330
|
+
}, qs = (n) => {
|
|
331
331
|
try {
|
|
332
332
|
JSON.parse(n);
|
|
333
333
|
} catch {
|
|
@@ -336,7 +336,7 @@ const je = {
|
|
|
336
336
|
return JSON.parse(n);
|
|
337
337
|
}, A = (n, i) => {
|
|
338
338
|
console.warn(`[${n} warn]: ${i}`);
|
|
339
|
-
},
|
|
339
|
+
}, Ye = (n, i) => {
|
|
340
340
|
console.error(`[${n} error]: ${i}`);
|
|
341
341
|
}, j = {
|
|
342
342
|
on(n, i) {
|
|
@@ -369,7 +369,7 @@ const je = {
|
|
|
369
369
|
G(s) && s.apply(this, e);
|
|
370
370
|
}), this) : this;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, Os = {
|
|
373
373
|
easeInOutCirc(n, i, t, e) {
|
|
374
374
|
return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
|
|
375
375
|
},
|
|
@@ -379,33 +379,33 @@ const je = {
|
|
|
379
379
|
easeOutQuart(n, i, t, e) {
|
|
380
380
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
381
381
|
}
|
|
382
|
-
},
|
|
383
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m =
|
|
384
|
-
let
|
|
385
|
-
if (
|
|
382
|
+
}, De = (n, i) => {
|
|
383
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = E(e) ? x(e) : document.scrollingElement, v = m[u], w = E(t) ? x(t).getBoundingClientRect()[p] : 0 - v, b = E(s) ? x(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
384
|
+
let y = 0;
|
|
385
|
+
if (T === 0)
|
|
386
386
|
return;
|
|
387
|
-
const D = (
|
|
388
|
-
const z =
|
|
389
|
-
i && i.emit(
|
|
387
|
+
const D = (L) => {
|
|
388
|
+
const z = x(t);
|
|
389
|
+
i && i.emit(L, z), !i && n.on && G(n.on[L]) && n.on[L](z);
|
|
390
390
|
};
|
|
391
391
|
D("beforeScroll");
|
|
392
392
|
const U = () => {
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
m[u] =
|
|
393
|
+
y += C;
|
|
394
|
+
const L = Os[r](y, v, T, o);
|
|
395
|
+
m[u] = L, y < o && requestAnimationFrame(U), y >= o && D("afterScroll");
|
|
396
396
|
};
|
|
397
397
|
requestAnimationFrame(U);
|
|
398
398
|
};
|
|
399
|
-
var
|
|
400
|
-
class
|
|
399
|
+
var K, ke, bt, ai, yt, ri;
|
|
400
|
+
class oi {
|
|
401
401
|
constructor(i, t = {}) {
|
|
402
|
-
h(this,
|
|
403
|
-
h(this, vt);
|
|
402
|
+
h(this, K);
|
|
404
403
|
h(this, bt);
|
|
404
|
+
h(this, yt);
|
|
405
405
|
this.__storage__ = {
|
|
406
406
|
el: i,
|
|
407
407
|
options: t
|
|
408
|
-
}, this.active = "data-anchor-active", d(this,
|
|
408
|
+
}, this.active = "data-anchor-active", d(this, K, ke).call(this);
|
|
409
409
|
}
|
|
410
410
|
destroy() {
|
|
411
411
|
const { elements: i } = this;
|
|
@@ -415,39 +415,39 @@ class ni {
|
|
|
415
415
|
}
|
|
416
416
|
update() {
|
|
417
417
|
var i;
|
|
418
|
-
return d(i = this.destroy(),
|
|
418
|
+
return d(i = this.destroy(), K, ke).call(i), this.emit("afterUpdate"), this;
|
|
419
419
|
}
|
|
420
420
|
static run(i) {
|
|
421
|
-
const { SETTINGS: t } =
|
|
421
|
+
const { SETTINGS: t } = mt, e = Object.assign({}, t, i);
|
|
422
422
|
setTimeout(() => {
|
|
423
|
-
|
|
423
|
+
De(e);
|
|
424
424
|
}, e.delay);
|
|
425
425
|
}
|
|
426
426
|
static url(i) {
|
|
427
|
-
const { SETTINGS: t } =
|
|
427
|
+
const { SETTINGS: t } = mt, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
|
|
428
428
|
if (!a)
|
|
429
429
|
return;
|
|
430
430
|
const r = Object.assign({}, t, i, { target: a });
|
|
431
431
|
setTimeout(() => {
|
|
432
|
-
|
|
432
|
+
De(r);
|
|
433
433
|
}, r.delay);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
K = new WeakSet(), ke = function() {
|
|
437
437
|
const { el: i, options: t } = this.__storage__;
|
|
438
|
-
if (!
|
|
438
|
+
if (!dt(i) || !E(i))
|
|
439
439
|
return;
|
|
440
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
441
|
-
if (this.elements = t.state == "not active" ?
|
|
440
|
+
const { SETTINGS: e, EVENTS: s } = mt;
|
|
441
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.elements = $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
442
442
|
for (const [o, a] of Object.entries(this.options.on))
|
|
443
443
|
this.__events__[o] = [a];
|
|
444
|
-
d(this,
|
|
445
|
-
},
|
|
444
|
+
d(this, bt, ai).call(this);
|
|
445
|
+
}, bt = new WeakSet(), ai = function() {
|
|
446
446
|
const { elements: i, options: t } = this;
|
|
447
447
|
i.forEach((e) => {
|
|
448
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
|
448
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, yt, ri), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
|
|
449
449
|
}), this.emit("afterInit");
|
|
450
|
-
},
|
|
450
|
+
}, yt = new WeakSet(), ri = function() {
|
|
451
451
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
|
452
452
|
target: this.getAttribute("data-anchor-target") || i.target,
|
|
453
453
|
container: this.getAttribute("data-anchor-container") || i.container,
|
|
@@ -461,12 +461,12 @@ V = new WeakSet(), De = function() {
|
|
|
461
461
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
462
462
|
this.addEventListener("click", t);
|
|
463
463
|
}, s.speed), setTimeout(() => {
|
|
464
|
-
|
|
464
|
+
De(s, e);
|
|
465
465
|
}, s.delay);
|
|
466
466
|
};
|
|
467
|
-
Object.assign(
|
|
467
|
+
Object.assign(oi.prototype, j);
|
|
468
468
|
window.MODALS || (window.MODALS = {});
|
|
469
|
-
const { MODALS: O } = window,
|
|
469
|
+
const { MODALS: O } = window, Ns = (n) => {
|
|
470
470
|
const { TEMPLATE: i } = P, { childDom: t } = n, e = document.createElement("div");
|
|
471
471
|
e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
|
|
472
472
|
const s = e.querySelector(".modal-content");
|
|
@@ -474,14 +474,14 @@ const { MODALS: O } = window, Is = (n) => {
|
|
|
474
474
|
s.append(o);
|
|
475
475
|
}), e.children[0];
|
|
476
476
|
};
|
|
477
|
-
var
|
|
478
|
-
class
|
|
477
|
+
var wt, ci, Tt, di, Et, ui, Lt, hi, At, pi;
|
|
478
|
+
class li extends HTMLElement {
|
|
479
479
|
constructor() {
|
|
480
480
|
super();
|
|
481
|
-
h(this, yt);
|
|
482
481
|
h(this, wt);
|
|
483
482
|
h(this, Tt);
|
|
484
483
|
h(this, Et);
|
|
484
|
+
h(this, Lt);
|
|
485
485
|
h(this, At);
|
|
486
486
|
this.initialize = !1;
|
|
487
487
|
}
|
|
@@ -491,12 +491,12 @@ class ri extends HTMLElement {
|
|
|
491
491
|
attributeChangedCallback(t, e, s) {
|
|
492
492
|
switch (t) {
|
|
493
493
|
case ":state":
|
|
494
|
-
d(this, At,
|
|
494
|
+
d(this, At, pi).call(this, s);
|
|
495
495
|
break;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
connectedCallback() {
|
|
499
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
499
|
+
this.initialize || (this.initialize = !0, d(this, wt, ci).call(this));
|
|
500
500
|
}
|
|
501
501
|
open() {
|
|
502
502
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -508,22 +508,22 @@ class ri extends HTMLElement {
|
|
|
508
508
|
return this.setAttribute(":state", "destroy"), this;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
|
|
511
|
+
wt = new WeakSet(), ci = function() {
|
|
512
512
|
const { ATTRS: t } = P;
|
|
513
513
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
514
|
-
const e = this.getAttribute(t.id) ||
|
|
515
|
-
this.getAttribute(t.id) || (A(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && A(`the ${t.id} "${e}" is already be used.`), O[e] = this, d(this,
|
|
516
|
-
}, wt = new WeakSet(), ci = function() {
|
|
517
|
-
this.childDom = this.childNodes, this.template = Is(this), this.innerHTML = "", this.append(this.template), d(this, Tt, di).call(this);
|
|
514
|
+
const e = this.getAttribute(t.id) || Ms();
|
|
515
|
+
this.getAttribute(t.id) || (A(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && A(`the ${t.id} "${e}" is already be used.`), O[e] = this, d(this, Tt, di).call(this);
|
|
518
516
|
}, Tt = new WeakSet(), di = function() {
|
|
517
|
+
this.childDom = this.childNodes, this.template = Ns(this), this.innerHTML = "", this.append(this.template), d(this, Et, ui).call(this);
|
|
518
|
+
}, Et = new WeakSet(), ui = function() {
|
|
519
519
|
const t = this.querySelector(".modal-scroller");
|
|
520
|
-
this.__scroller__ =
|
|
520
|
+
this.__scroller__ = je(t, {
|
|
521
521
|
overflowBehavior: {
|
|
522
522
|
x: "hidden"
|
|
523
523
|
},
|
|
524
524
|
autoUpdate: !0
|
|
525
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
526
|
-
},
|
|
525
|
+
}), window.modalScroll = this.__scroller__, d(this, Lt, hi).call(this);
|
|
526
|
+
}, Lt = new WeakSet(), hi = function() {
|
|
527
527
|
var a, r, l;
|
|
528
528
|
const t = this, { ATTRS: e } = P, { close: s, destroy: o } = e;
|
|
529
529
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -539,7 +539,7 @@ yt = new WeakSet(), li = function() {
|
|
|
539
539
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
540
540
|
c.stopPropagation();
|
|
541
541
|
});
|
|
542
|
-
}, At = new WeakSet(),
|
|
542
|
+
}, At = new WeakSet(), pi = function(t) {
|
|
543
543
|
const { __scroller__: e } = this;
|
|
544
544
|
if (t === "open") {
|
|
545
545
|
if (this.style.display = "block", e) {
|
|
@@ -570,22 +570,22 @@ yt = new WeakSet(), li = function() {
|
|
|
570
570
|
this.addEventListener("transitionend", s);
|
|
571
571
|
}
|
|
572
572
|
};
|
|
573
|
-
Object.assign(
|
|
574
|
-
const { MODALS:
|
|
573
|
+
Object.assign(li.prototype, j);
|
|
574
|
+
const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
575
575
|
if (!i)
|
|
576
576
|
return;
|
|
577
577
|
const e = n[i];
|
|
578
578
|
e && G(e) && e.apply(n, t);
|
|
579
|
-
},
|
|
580
|
-
n && G(n) && n.apply(
|
|
581
|
-
},
|
|
582
|
-
const { target: t } = n, e =
|
|
583
|
-
e &&
|
|
584
|
-
},
|
|
585
|
-
const { target: t, action: e, on: s, e: o } = n, a =
|
|
579
|
+
}, gi = (n, ...i) => {
|
|
580
|
+
n && G(n) && n.apply(V, i);
|
|
581
|
+
}, Fe = (n, i) => {
|
|
582
|
+
const { target: t } = n, e = We[t] || x(n.target);
|
|
583
|
+
e && fi(n, i), e || Ps(n, i);
|
|
584
|
+
}, fi = (n, i) => {
|
|
585
|
+
const { target: t, action: e, on: s, e: o } = n, a = We[t] || x(n.target);
|
|
586
586
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
587
587
|
a.once(l, () => {
|
|
588
|
-
i && (i.emit(l, a, o),
|
|
588
|
+
i && (i.emit(l, a, o), mi(i, s[l], a, o)), i || gi(s[l], a);
|
|
589
589
|
});
|
|
590
590
|
}), e) {
|
|
591
591
|
case "open":
|
|
@@ -602,34 +602,34 @@ const { MODALS: Be } = window, ut = {}, pi = (n, i, ...t) => {
|
|
|
602
602
|
l === "close" && a.open(), l === "open" && a.close();
|
|
603
603
|
break;
|
|
604
604
|
}
|
|
605
|
-
},
|
|
605
|
+
}, Ps = async (n, i) => {
|
|
606
606
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
607
607
|
if (!e)
|
|
608
608
|
return A("modal4", "cannot find target or data-modal-route is not defined");
|
|
609
609
|
const r = (l, ...c) => {
|
|
610
|
-
i && (i.emit(l, ...c),
|
|
610
|
+
i && (i.emit(l, ...c), mi(i, o[l], ...c)), i || gi(o[l], ...c);
|
|
611
611
|
};
|
|
612
|
-
|
|
613
|
-
const c =
|
|
612
|
+
ht[t] || (ht[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
|
613
|
+
const c = Is(l), u = x(s) || x(P.SETTINGS.container);
|
|
614
614
|
[...c].forEach((g) => {
|
|
615
615
|
u.append(g);
|
|
616
616
|
});
|
|
617
|
-
const p =
|
|
618
|
-
r("complete", p),
|
|
617
|
+
const p = We[t] || x(n.target);
|
|
618
|
+
r("complete", p), fi(n, i), delete ht[t];
|
|
619
619
|
}).catch((l) => {
|
|
620
|
-
r("error", l), delete
|
|
620
|
+
r("error", l), delete ht[t];
|
|
621
621
|
}));
|
|
622
622
|
};
|
|
623
|
-
var
|
|
623
|
+
var tt, xe, St, vi, Dt, bi;
|
|
624
624
|
const B = class B {
|
|
625
625
|
constructor(i, t = {}) {
|
|
626
|
-
h(this,
|
|
627
|
-
h(this, Lt);
|
|
626
|
+
h(this, tt);
|
|
628
627
|
h(this, St);
|
|
628
|
+
h(this, Dt);
|
|
629
629
|
this.__storage__ = {
|
|
630
630
|
el: i,
|
|
631
631
|
options: t
|
|
632
|
-
}, this.active = "data-modal-active", d(this,
|
|
632
|
+
}, this.active = "data-modal-active", d(this, tt, xe).call(this);
|
|
633
633
|
}
|
|
634
634
|
destroy() {
|
|
635
635
|
const { elements: i } = this;
|
|
@@ -639,12 +639,12 @@ const B = class B {
|
|
|
639
639
|
}
|
|
640
640
|
update() {
|
|
641
641
|
var i;
|
|
642
|
-
return d(i = this.destroy(),
|
|
642
|
+
return d(i = this.destroy(), tt, xe).call(i), this.emit("update"), this;
|
|
643
643
|
}
|
|
644
644
|
/** static method 'open' */
|
|
645
645
|
static open(i) {
|
|
646
646
|
const { SETTINGS: t } = P, e = Object.assign({}, t, { on: {} }, i);
|
|
647
|
-
|
|
647
|
+
Fe(e);
|
|
648
648
|
}
|
|
649
649
|
/** static method 'defineMethods' */
|
|
650
650
|
static defineMethods(i) {
|
|
@@ -655,22 +655,22 @@ const B = class B {
|
|
|
655
655
|
Object.assign(B.prototype, B.prototype.__methods__);
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
|
-
|
|
658
|
+
tt = new WeakSet(), xe = function() {
|
|
659
659
|
const { el: i, options: t } = this.__storage__;
|
|
660
|
-
if (!
|
|
660
|
+
if (!dt(i) || !E(i))
|
|
661
661
|
return;
|
|
662
662
|
const { SETTINGS: e, EVENTS: s } = P;
|
|
663
|
-
if (this.elements = t.state == "not active" ?
|
|
663
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
664
664
|
for (const [o, a] of Object.entries(this.options.on))
|
|
665
665
|
this.__events__[o] = [a];
|
|
666
|
-
d(this,
|
|
667
|
-
},
|
|
666
|
+
d(this, St, vi).call(this);
|
|
667
|
+
}, St = new WeakSet(), vi = function() {
|
|
668
668
|
const { elements: i, options: t } = this;
|
|
669
669
|
i.forEach((e) => {
|
|
670
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
|
670
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Dt, bi), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
|
|
671
671
|
}), this.emit("init");
|
|
672
|
-
},
|
|
673
|
-
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o =
|
|
672
|
+
}, Dt = new WeakSet(), bi = function(i) {
|
|
673
|
+
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = qs(this.getAttribute("data-modal-on"));
|
|
674
674
|
o && typeof o != "object" && A("modal4", "data-modal-on must be a json string.");
|
|
675
675
|
const a = {
|
|
676
676
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
@@ -682,12 +682,12 @@ K = new WeakSet(), ke = function() {
|
|
|
682
682
|
};
|
|
683
683
|
this.removeEventListener("click", e), setTimeout(() => {
|
|
684
684
|
this.addEventListener("click", e);
|
|
685
|
-
}, 200),
|
|
685
|
+
}, 200), Fe(a, s);
|
|
686
686
|
};
|
|
687
|
-
let
|
|
688
|
-
Object.assign(
|
|
689
|
-
customElements.define("modern-modal",
|
|
690
|
-
const
|
|
687
|
+
let V = B;
|
|
688
|
+
Object.assign(V.prototype, j);
|
|
689
|
+
customElements.define("modern-modal", li);
|
|
690
|
+
const js = (n, i) => {
|
|
691
691
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
692
692
|
i.forEach((s) => {
|
|
693
693
|
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom: g } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
|
|
@@ -696,28 +696,28 @@ const Ns = (n, i) => {
|
|
|
696
696
|
s.classList.add(o);
|
|
697
697
|
}, a);
|
|
698
698
|
else {
|
|
699
|
-
const
|
|
699
|
+
const b = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <= v || c === !0;
|
|
700
700
|
setTimeout(() => {
|
|
701
|
-
|
|
701
|
+
b && s.classList.remove(o);
|
|
702
702
|
}, a);
|
|
703
703
|
}
|
|
704
704
|
});
|
|
705
|
-
},
|
|
706
|
-
var
|
|
707
|
-
class
|
|
705
|
+
}, zs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
706
|
+
var et, $e, kt, wi;
|
|
707
|
+
class yi {
|
|
708
708
|
constructor(i, t = {}) {
|
|
709
|
-
h(this,
|
|
710
|
-
h(this,
|
|
709
|
+
h(this, et);
|
|
710
|
+
h(this, kt);
|
|
711
711
|
this.__storage__ = {
|
|
712
712
|
el: i,
|
|
713
713
|
options: t
|
|
714
|
-
}, this.active = "data-aost-active", d(this,
|
|
714
|
+
}, this.active = "data-aost-active", d(this, et, $e).call(this);
|
|
715
715
|
}
|
|
716
716
|
destroy(i) {
|
|
717
717
|
const { elements: t, options: e } = this;
|
|
718
718
|
if (!t)
|
|
719
719
|
return this;
|
|
720
|
-
const { scroller: s } = e, o = s === window || !
|
|
720
|
+
const { scroller: s } = e, o = s === window || !E(s) ? window : x(s);
|
|
721
721
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
|
722
722
|
if (!a.aost)
|
|
723
723
|
return;
|
|
@@ -727,58 +727,58 @@ class bi {
|
|
|
727
727
|
}
|
|
728
728
|
update(i) {
|
|
729
729
|
var t;
|
|
730
|
-
d(t = this.destroy(i),
|
|
730
|
+
d(t = this.destroy(i), et, $e).call(t);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
|
|
733
|
+
et = new WeakSet(), $e = function() {
|
|
734
734
|
const { el: i, options: t } = this.__storage__;
|
|
735
|
-
if (!
|
|
735
|
+
if (!dt(i) || !E(i))
|
|
736
736
|
return;
|
|
737
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
738
|
-
if (this.elements = t.state == "not active" ?
|
|
737
|
+
const { SETTINGS: e, EVENTS: s } = ei;
|
|
738
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
739
739
|
for (const [o, a] of Object.entries(this.options.on))
|
|
740
740
|
this.__events__[o] = [a];
|
|
741
|
-
d(this,
|
|
742
|
-
},
|
|
743
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !
|
|
741
|
+
d(this, kt, wi).call(this);
|
|
742
|
+
}, kt = new WeakSet(), wi = function() {
|
|
743
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !E(e) ? window : x(e);
|
|
744
744
|
this.eventHandler = () => {
|
|
745
|
-
|
|
745
|
+
js(s, i);
|
|
746
746
|
}, i.forEach((a) => {
|
|
747
|
-
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat =
|
|
747
|
+
a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat = zs(a.getAttribute("data-aost-repeat"), t), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
|
|
748
748
|
});
|
|
749
749
|
const { eventHandler: o } = this;
|
|
750
750
|
o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
|
|
751
751
|
};
|
|
752
|
-
Object.assign(
|
|
753
|
-
const
|
|
754
|
-
const { TEMPLATE: i } =
|
|
752
|
+
Object.assign(yi.prototype, j);
|
|
753
|
+
const Bs = (n) => {
|
|
754
|
+
const { TEMPLATE: i } = ze, { childDom: t } = n, e = document.createElement("div");
|
|
755
755
|
e.innerHTML = i();
|
|
756
756
|
const s = e.querySelector(".player-wrapper");
|
|
757
757
|
return [...t].forEach((o) => {
|
|
758
758
|
s.append(o);
|
|
759
759
|
}), e.children[0];
|
|
760
760
|
};
|
|
761
|
-
var
|
|
762
|
-
class
|
|
761
|
+
var xt, Ti, $t, Ei, _t, Li, Ct, Ai, Ht, Si, Mt, Di, It, ki, qt, xi, Ot, $i, Nt, _i;
|
|
762
|
+
class Ws extends HTMLElement {
|
|
763
763
|
constructor() {
|
|
764
764
|
super();
|
|
765
|
-
h(this, kt);
|
|
766
|
-
h(this, $t);
|
|
767
765
|
h(this, xt);
|
|
768
|
-
|
|
766
|
+
h(this, $t);
|
|
769
767
|
h(this, _t);
|
|
770
|
-
//
|
|
768
|
+
// youtube iframe
|
|
771
769
|
h(this, Ct);
|
|
772
|
-
//
|
|
770
|
+
// vimeo iframe
|
|
773
771
|
h(this, Ht);
|
|
772
|
+
// youku iframe
|
|
774
773
|
h(this, Mt);
|
|
774
|
+
h(this, It);
|
|
775
775
|
// 2025.02.11 新增 ig
|
|
776
776
|
h(this, qt);
|
|
777
777
|
// 2025.02.11 新增 tiktok
|
|
778
|
-
h(this, It);
|
|
779
|
-
// 2026.01.15 新增 tiktok
|
|
780
778
|
h(this, Ot);
|
|
781
|
-
|
|
779
|
+
// 2026.01.15 新增 video
|
|
780
|
+
h(this, Nt);
|
|
781
|
+
d(this, xt, Ti).call(this);
|
|
782
782
|
}
|
|
783
783
|
play() {
|
|
784
784
|
const { videoType: t } = this;
|
|
@@ -815,15 +815,15 @@ class zs extends HTMLElement {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
|
|
818
|
+
xt = new WeakSet(), Ti = function() {
|
|
819
819
|
if (!this.getAttribute("video-id")) {
|
|
820
820
|
A("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
821
821
|
return;
|
|
822
822
|
}
|
|
823
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, $t,
|
|
824
|
-
}, $t = new WeakSet(),
|
|
825
|
-
this.childDom = this.childNodes, this.template =
|
|
826
|
-
},
|
|
823
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, $t, Ei).call(this);
|
|
824
|
+
}, $t = new WeakSet(), Ei = function() {
|
|
825
|
+
this.childDom = this.childNodes, this.template = Bs(this), this.innerHTML = "", this.append(this.template), d(this, _t, Li).call(this);
|
|
826
|
+
}, _t = new WeakSet(), Li = function() {
|
|
827
827
|
const { videoType: t, videoMode: e } = this;
|
|
828
828
|
let s = "";
|
|
829
829
|
function o(a) {
|
|
@@ -849,70 +849,75 @@ kt = new WeakSet(), wi = function() {
|
|
|
849
849
|
case "youtubeAPI":
|
|
850
850
|
break;
|
|
851
851
|
case "youtube":
|
|
852
|
-
document.body.wd_youtube == !1 ? o("video-player") : s = d(this,
|
|
852
|
+
document.body.wd_youtube == !1 ? o("video-player") : s = d(this, Ct, Ai).call(this);
|
|
853
853
|
break;
|
|
854
854
|
case "youkuAPI":
|
|
855
855
|
break;
|
|
856
856
|
case "youku":
|
|
857
|
-
document.body.wd_youku == !1 ? o("video-player") : s = d(this,
|
|
857
|
+
document.body.wd_youku == !1 ? o("video-player") : s = d(this, Mt, Di).call(this);
|
|
858
858
|
break;
|
|
859
859
|
case "vimeo":
|
|
860
|
-
document.body.wd_vimeo == !1 ? o("video-player") : s = d(this,
|
|
860
|
+
document.body.wd_vimeo == !1 ? o("video-player") : s = d(this, Ht, Si).call(this);
|
|
861
861
|
break;
|
|
862
862
|
case "bilibili":
|
|
863
|
-
document.body.wd_bilibili == !1 ? o("video-player") : s = d(this,
|
|
863
|
+
document.body.wd_bilibili == !1 ? o("video-player") : s = d(this, It, ki).call(this);
|
|
864
864
|
break;
|
|
865
865
|
case "instagram":
|
|
866
|
-
document.body.wd_instagram == !1 ? o(".instagram-media") : s = d(this, qt,
|
|
866
|
+
document.body.wd_instagram == !1 ? o(".instagram-media") : s = d(this, qt, xi).call(this);
|
|
867
867
|
break;
|
|
868
868
|
case "tiktok":
|
|
869
|
-
document.body.wd_tiktok == !1 ? o("video-player") : s = d(this,
|
|
869
|
+
document.body.wd_tiktok == !1 ? o("video-player") : s = d(this, Ot, $i).call(this);
|
|
870
870
|
break;
|
|
871
871
|
case "videojs":
|
|
872
872
|
break;
|
|
873
873
|
case "video":
|
|
874
|
-
s = d(this,
|
|
874
|
+
s = d(this, Nt, _i).call(this);
|
|
875
875
|
break;
|
|
876
876
|
}
|
|
877
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
|
878
|
-
},
|
|
877
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, s);
|
|
878
|
+
}, Ct = new WeakSet(), Ai = function() {
|
|
879
879
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
880
880
|
return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
|
|
881
|
-
},
|
|
881
|
+
}, Ht = new WeakSet(), Si = function() {
|
|
882
882
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
883
883
|
return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
|
|
884
|
-
},
|
|
884
|
+
}, Mt = new WeakSet(), Di = function() {
|
|
885
885
|
const { videoId: t, autoplay: e } = this;
|
|
886
886
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
887
|
-
},
|
|
887
|
+
}, It = new WeakSet(), ki = function() {
|
|
888
888
|
const { videoId: t, autoplay: e } = this;
|
|
889
889
|
return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
|
|
890
|
-
}, qt = new WeakSet(),
|
|
890
|
+
}, qt = new WeakSet(), xi = function() {
|
|
891
891
|
const { videoId: t, autoplay: e } = this;
|
|
892
892
|
return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
|
|
893
|
-
},
|
|
893
|
+
}, Ot = new WeakSet(), $i = function() {
|
|
894
894
|
const { videoId: t, autoplay: e } = this;
|
|
895
895
|
return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
|
|
896
|
-
},
|
|
896
|
+
}, Nt = new WeakSet(), _i = function() {
|
|
897
897
|
const { videoId: t, autoplay: e } = this;
|
|
898
|
-
return `<video src="${t}" autoplay muted playsinline controls></video>`;
|
|
898
|
+
return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
|
|
899
899
|
};
|
|
900
|
-
const
|
|
900
|
+
const kn = (n) => new Promise((i) => {
|
|
901
901
|
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
902
902
|
});
|
|
903
|
-
|
|
904
|
-
const i = [];
|
|
905
|
-
n && n.forEach((t) => {
|
|
906
|
-
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
|
907
|
-
}), f("html").addClass("scrollLock"), ks(i);
|
|
908
|
-
}
|
|
903
|
+
let J = 0;
|
|
909
904
|
function Ci(n) {
|
|
910
905
|
const i = [];
|
|
911
|
-
n
|
|
912
|
-
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(
|
|
913
|
-
}),
|
|
906
|
+
return (n || []).forEach((t) => {
|
|
907
|
+
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(t));
|
|
908
|
+
}), i;
|
|
909
|
+
}
|
|
910
|
+
function Hi(n) {
|
|
911
|
+
const i = Ci(n);
|
|
912
|
+
J += 1, J === 1 && (document.documentElement.classList.add("scrollLock"), $s(i));
|
|
913
|
+
}
|
|
914
|
+
function Mi(n) {
|
|
915
|
+
if (J = Math.max(0, J - 1), J === 0) {
|
|
916
|
+
const i = Ci(n);
|
|
917
|
+
_s(i), document.documentElement.classList.remove("scrollLock");
|
|
918
|
+
}
|
|
914
919
|
}
|
|
915
|
-
async function
|
|
920
|
+
async function xn(n = 0) {
|
|
916
921
|
if (f(".loading-wrapper").length)
|
|
917
922
|
return;
|
|
918
923
|
f("body").append(`
|
|
@@ -926,30 +931,30 @@ async function Dn(n = 0) {
|
|
|
926
931
|
</div>
|
|
927
932
|
</div>
|
|
928
933
|
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
|
929
|
-
|
|
934
|
+
Hi();
|
|
930
935
|
});
|
|
931
936
|
}
|
|
932
|
-
function
|
|
937
|
+
function $n() {
|
|
933
938
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
934
|
-
f(".loading-wrapper").remove(),
|
|
939
|
+
f(".loading-wrapper").remove(), Mi();
|
|
935
940
|
});
|
|
936
941
|
}
|
|
937
|
-
function
|
|
938
|
-
new
|
|
942
|
+
function _n(n, i) {
|
|
943
|
+
new vn(n, i);
|
|
939
944
|
}
|
|
940
|
-
function
|
|
941
|
-
const n = document.querySelector("[data-aost]") && new
|
|
942
|
-
} }), e = new
|
|
945
|
+
function Gs() {
|
|
946
|
+
const n = document.querySelector("[data-aost]") && new yi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new oi("[data-anchor-target]"), t = new ti({ callback_loaded: () => {
|
|
947
|
+
} }), e = new dn();
|
|
943
948
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
944
949
|
}
|
|
945
|
-
function
|
|
950
|
+
function Cn(n, i = () => {
|
|
946
951
|
}) {
|
|
947
952
|
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
948
953
|
typeof i == "function" && i();
|
|
949
|
-
}).siblings("[data-tab-content]").hide(),
|
|
954
|
+
}).siblings("[data-tab-content]").hide(), Gs();
|
|
950
955
|
}
|
|
951
|
-
function
|
|
952
|
-
|
|
956
|
+
function Hn() {
|
|
957
|
+
je(
|
|
953
958
|
{
|
|
954
959
|
target: document.body,
|
|
955
960
|
cancel: {
|
|
@@ -973,28 +978,28 @@ function _n() {
|
|
|
973
978
|
}
|
|
974
979
|
);
|
|
975
980
|
}
|
|
976
|
-
function
|
|
981
|
+
function Mn() {
|
|
977
982
|
window.onpageshow = function(n) {
|
|
978
983
|
n.persisted && window.location.reload();
|
|
979
984
|
};
|
|
980
985
|
}
|
|
981
|
-
function
|
|
986
|
+
function In() {
|
|
982
987
|
const n = navigator.userAgent;
|
|
983
988
|
return {
|
|
984
989
|
BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
|
|
985
990
|
};
|
|
986
991
|
}
|
|
987
|
-
function
|
|
992
|
+
function qn(n, i) {
|
|
988
993
|
f(n).on("click", function() {
|
|
989
994
|
f(this).toggleClass(i);
|
|
990
995
|
});
|
|
991
996
|
}
|
|
992
|
-
function
|
|
997
|
+
function On(n, i) {
|
|
993
998
|
f(n).on("click", function() {
|
|
994
999
|
f(n).not(this).removeClass(i), f(this).addClass(i);
|
|
995
1000
|
});
|
|
996
1001
|
}
|
|
997
|
-
function
|
|
1002
|
+
function Rs(n, i = 250) {
|
|
998
1003
|
let t = null;
|
|
999
1004
|
return function(...e) {
|
|
1000
1005
|
let s = this;
|
|
@@ -1003,7 +1008,7 @@ function Ws(n, i = 250) {
|
|
|
1003
1008
|
}, i);
|
|
1004
1009
|
};
|
|
1005
1010
|
}
|
|
1006
|
-
function
|
|
1011
|
+
function Nn(n, i = 250) {
|
|
1007
1012
|
let t, e;
|
|
1008
1013
|
return function() {
|
|
1009
1014
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -1012,7 +1017,7 @@ function In(n, i = 250) {
|
|
|
1012
1017
|
}, i)) : (t = a, n.apply(s, o));
|
|
1013
1018
|
};
|
|
1014
1019
|
}
|
|
1015
|
-
function
|
|
1020
|
+
function Pn() {
|
|
1016
1021
|
window._g.interval = [], f(".countdown").each((i, t) => {
|
|
1017
1022
|
const e = Number(f(t).attr("data-seconds")) + 1;
|
|
1018
1023
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
|
@@ -1022,21 +1027,21 @@ function On() {
|
|
|
1022
1027
|
}, 1e3);
|
|
1023
1028
|
});
|
|
1024
1029
|
}
|
|
1025
|
-
function
|
|
1030
|
+
function jn(n = 500) {
|
|
1026
1031
|
return new Promise((i, t) => {
|
|
1027
1032
|
let e = setTimeout(() => {
|
|
1028
1033
|
clearTimeout(e), i();
|
|
1029
1034
|
}, n);
|
|
1030
1035
|
});
|
|
1031
1036
|
}
|
|
1032
|
-
function
|
|
1037
|
+
function zn() {
|
|
1033
1038
|
const n = function() {
|
|
1034
1039
|
let i = window.innerHeight * 0.01;
|
|
1035
1040
|
document.documentElement.style.setProperty("--vh", i + "px");
|
|
1036
1041
|
};
|
|
1037
|
-
n(), window.addEventListener("resize",
|
|
1042
|
+
n(), window.addEventListener("resize", Rs(n));
|
|
1038
1043
|
}
|
|
1039
|
-
function
|
|
1044
|
+
function Bn(n, i, t, e, s) {
|
|
1040
1045
|
const o = this, r = f(n).html().split("<br>");
|
|
1041
1046
|
let l = "", c = 0;
|
|
1042
1047
|
r.forEach((u, p) => {
|
|
@@ -1045,11 +1050,11 @@ function jn(n, i, t, e, s) {
|
|
|
1045
1050
|
});
|
|
1046
1051
|
}), f(n).html(l);
|
|
1047
1052
|
}
|
|
1048
|
-
function
|
|
1053
|
+
function Wn(n, i) {
|
|
1049
1054
|
const t = Math.pow(10, i);
|
|
1050
1055
|
return Math.round(n * t) / t;
|
|
1051
1056
|
}
|
|
1052
|
-
function
|
|
1057
|
+
function Gn(n) {
|
|
1053
1058
|
let i = n.activeIndex, t = n.slides.length;
|
|
1054
1059
|
if (n.params.loop)
|
|
1055
1060
|
switch (n.activeIndex) {
|
|
@@ -1064,18 +1069,18 @@ function Bn(n) {
|
|
|
1064
1069
|
}
|
|
1065
1070
|
return i;
|
|
1066
1071
|
}
|
|
1067
|
-
function
|
|
1072
|
+
function Rn(n, i) {
|
|
1068
1073
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
|
1069
1074
|
(n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), f(n.params.navigation.nextEl).hide(), f(n.params.navigation.prevEl).hide(), f(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), f(n.params.navigation.nextEl).show(), f(n.params.navigation.prevEl).show(), f(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
|
|
1070
1075
|
}
|
|
1071
|
-
function
|
|
1076
|
+
function Xn(n) {
|
|
1072
1077
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
|
1073
1078
|
i.addEventListener("load", function() {
|
|
1074
1079
|
detectShade(i);
|
|
1075
1080
|
});
|
|
1076
1081
|
});
|
|
1077
1082
|
}
|
|
1078
|
-
function
|
|
1083
|
+
function Yn(n) {
|
|
1079
1084
|
const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
|
|
1080
1085
|
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
|
1081
1086
|
a.currentTime = 0;
|
|
@@ -1083,7 +1088,7 @@ function Rn(n) {
|
|
|
1083
1088
|
n.slideNext();
|
|
1084
1089
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1085
1090
|
}
|
|
1086
|
-
function
|
|
1091
|
+
function Fn() {
|
|
1087
1092
|
f(".number-grow").each(function(n, i) {
|
|
1088
1093
|
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1089
1094
|
let r = "";
|
|
@@ -1097,7 +1102,7 @@ function Xn() {
|
|
|
1097
1102
|
});
|
|
1098
1103
|
});
|
|
1099
1104
|
}
|
|
1100
|
-
function
|
|
1105
|
+
function Un() {
|
|
1101
1106
|
f(".letter-grow").each(function(n, i) {
|
|
1102
1107
|
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
|
1103
1108
|
let a = "";
|
|
@@ -1111,46 +1116,46 @@ function Yn() {
|
|
|
1111
1116
|
});
|
|
1112
1117
|
});
|
|
1113
1118
|
}
|
|
1114
|
-
function
|
|
1119
|
+
function Zn(n) {
|
|
1115
1120
|
const i = getComputedStyle(n).transform;
|
|
1116
1121
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1117
1122
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1118
1123
|
}
|
|
1119
|
-
function
|
|
1124
|
+
function Jn(n) {
|
|
1120
1125
|
const i = getComputedStyle(n).transform;
|
|
1121
1126
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1122
1127
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
1123
1128
|
}
|
|
1124
|
-
function
|
|
1129
|
+
function Qn(n) {
|
|
1125
1130
|
const i = document.createElement("div");
|
|
1126
1131
|
return i.innerHTML = n, i.childNodes[0];
|
|
1127
1132
|
}
|
|
1128
|
-
const
|
|
1129
|
-
var
|
|
1133
|
+
const Ue = (n) => n.videoId !== "" || typeof n.videoId < "u", Xs = (n) => n.$selector.getAttribute("video4-active") === "on", pt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
|
1134
|
+
var it, Ce, Pt, Ii, jt, qi, st, He, zt, Oi;
|
|
1130
1135
|
const X = class X {
|
|
1131
1136
|
//*-* 給Article4用的 **//
|
|
1132
1137
|
constructor(i, t = {}) {
|
|
1133
|
-
h(this, et);
|
|
1134
|
-
h(this, Nt);
|
|
1135
|
-
h(this, Pt);
|
|
1136
1138
|
h(this, it);
|
|
1139
|
+
h(this, Pt);
|
|
1137
1140
|
h(this, jt);
|
|
1138
|
-
|
|
1139
|
-
|
|
1141
|
+
h(this, st);
|
|
1142
|
+
h(this, zt);
|
|
1143
|
+
if (!dt(i) && !Se(i) && !ut(i)) {
|
|
1144
|
+
Ye("video4", `找不到該物件 -> ${i}`);
|
|
1140
1145
|
return;
|
|
1141
1146
|
}
|
|
1142
1147
|
this.__storage__ = {
|
|
1143
1148
|
el: i,
|
|
1144
1149
|
options: t
|
|
1145
|
-
}, this.active = "data-video-active", d(this,
|
|
1150
|
+
}, this.active = "data-video-active", d(this, it, Ce).call(this);
|
|
1146
1151
|
}
|
|
1147
1152
|
update() {
|
|
1148
|
-
d(this,
|
|
1153
|
+
d(this, it, Ce).call(this);
|
|
1149
1154
|
}
|
|
1150
1155
|
};
|
|
1151
|
-
|
|
1152
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } =
|
|
1153
|
-
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ?
|
|
1156
|
+
it = new WeakSet(), Ce = function() {
|
|
1157
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = ze;
|
|
1158
|
+
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign(
|
|
1154
1159
|
{},
|
|
1155
1160
|
{ LAYOUT: o },
|
|
1156
1161
|
// 原始 configs 的 LAYOUT
|
|
@@ -1163,47 +1168,60 @@ et = new WeakSet(), _e = function() {
|
|
|
1163
1168
|
), this.__events__ = Object.assign({}, s), this.options.on)
|
|
1164
1169
|
for (const [a, r] of Object.entries(this.options.on))
|
|
1165
1170
|
this.__events__[a] = [r];
|
|
1166
|
-
d(this,
|
|
1167
|
-
},
|
|
1171
|
+
d(this, Pt, Ii).call(this);
|
|
1172
|
+
}, Pt = new WeakSet(), Ii = function() {
|
|
1168
1173
|
const { elements: i, options: t } = this;
|
|
1169
1174
|
i.forEach((e) => {
|
|
1170
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
|
1175
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, zt, Oi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Ue(e.video.params) && !Xs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, jt, qi).call(this, e)), Ue(e.video.params) || Ye("video4", "無法取得影片 ID");
|
|
1171
1176
|
}), this.emit("init");
|
|
1172
|
-
},
|
|
1177
|
+
}, jt = new WeakSet(), qi = function(i) {
|
|
1173
1178
|
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
|
|
1174
1179
|
if (l === "onBox" || l === "inBox") {
|
|
1175
1180
|
let g = null;
|
|
1176
1181
|
if (u === "on") {
|
|
1177
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1182
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1178
1183
|
const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
|
|
1179
|
-
w ? m.insertAdjacentHTML(
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1184
|
+
if (w ? m.insertAdjacentHTML(S.after, w) : A("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube")
|
|
1185
|
+
p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1186
|
+
else if (!v && r == "vimeo")
|
|
1187
|
+
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
1188
|
+
else if (!v && r === "video") {
|
|
1189
|
+
const b = document.createElement("video");
|
|
1190
|
+
b.src = a, b.preload = "metadata", b.muted = !0, b.playsInline = !0, b.crossOrigin = "anonymous", b.onloadeddata = () => {
|
|
1191
|
+
b.currentTime = 0.5;
|
|
1192
|
+
}, b.onseeked = () => {
|
|
1193
|
+
const T = document.createElement("canvas");
|
|
1194
|
+
T.width = b.videoWidth, T.height = b.videoHeight, T.getContext("2d").drawImage(b, 0, 0), m.src = T.toDataURL("image/jpeg", 0.85);
|
|
1195
|
+
};
|
|
1196
|
+
} else
|
|
1197
|
+
!v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
|
|
1198
|
+
const T = b.thumbnail_url;
|
|
1199
|
+
m.setAttribute("src", `${T}`);
|
|
1200
|
+
}).catch(function(b) {
|
|
1201
|
+
console.log("error");
|
|
1202
|
+
}) : A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1185
1203
|
}
|
|
1186
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this,
|
|
1204
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st, He), g.addEventListener("click", g.video.eventHandler);
|
|
1187
1205
|
} else if (l === "onPage") {
|
|
1188
1206
|
let g = null;
|
|
1189
1207
|
if (u == "on") {
|
|
1190
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1208
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), A("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1191
1209
|
const m = s.querySelector("img");
|
|
1192
|
-
m.insertAdjacentHTML(
|
|
1210
|
+
m.insertAdjacentHTML(S.after, t[o]);
|
|
1193
1211
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1194
1212
|
!v && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((w) => w.json()).then((w) => {
|
|
1195
|
-
const
|
|
1196
|
-
m.setAttribute("src", `${
|
|
1213
|
+
const b = w.thumbnail_url;
|
|
1214
|
+
m.setAttribute("src", `${b}`);
|
|
1197
1215
|
}).catch(function(w) {
|
|
1198
1216
|
console.log("error");
|
|
1199
1217
|
}) : v || A("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || A("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1200
1218
|
} else {
|
|
1201
|
-
s.innerHTML =
|
|
1219
|
+
s.innerHTML = pt(e);
|
|
1202
1220
|
return;
|
|
1203
1221
|
}
|
|
1204
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this,
|
|
1222
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st, He), g.addEventListener("click", g.video.eventHandler);
|
|
1205
1223
|
}
|
|
1206
|
-
},
|
|
1224
|
+
}, st = new WeakSet(), He = function(i) {
|
|
1207
1225
|
const { video: t, emit: e } = this, {
|
|
1208
1226
|
$selector: s,
|
|
1209
1227
|
videoMode: o,
|
|
@@ -1217,8 +1235,8 @@ et = new WeakSet(), _e = function() {
|
|
|
1217
1235
|
videoButton: m,
|
|
1218
1236
|
videoLayoutNo: v,
|
|
1219
1237
|
videoStartTime: w
|
|
1220
|
-
} = t.params,
|
|
1221
|
-
} }),
|
|
1238
|
+
} = t.params, b = new ti({ callback_loaded: (C) => {
|
|
1239
|
+
} }), T = new URLSearchParams({
|
|
1222
1240
|
video_mode: o,
|
|
1223
1241
|
video_type: u,
|
|
1224
1242
|
video_id: l
|
|
@@ -1226,25 +1244,25 @@ et = new WeakSet(), _e = function() {
|
|
|
1226
1244
|
if (o == "onBox" || o == "inBox") {
|
|
1227
1245
|
const C = {
|
|
1228
1246
|
target: a,
|
|
1229
|
-
route: c + `?${
|
|
1247
|
+
route: c + `?${T.toString()}`,
|
|
1230
1248
|
on: {
|
|
1231
|
-
complete(
|
|
1249
|
+
complete(y) {
|
|
1232
1250
|
var D;
|
|
1233
|
-
o == "onBox" && (u == "instagram" ? (
|
|
1251
|
+
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", pt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && y.setAttribute("video-typeStyle", `${u}`);
|
|
1234
1252
|
},
|
|
1235
|
-
open(
|
|
1253
|
+
open(y) {
|
|
1236
1254
|
var U;
|
|
1237
|
-
const D =
|
|
1238
|
-
if (
|
|
1239
|
-
const
|
|
1240
|
-
new ResizeObserver((
|
|
1241
|
-
|
|
1242
|
-
}).observe(
|
|
1255
|
+
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1256
|
+
if (b.update(), Hi([...D]), o == "onBox" && u == "instagram") {
|
|
1257
|
+
const L = document.querySelector("[video-template] .modal-content");
|
|
1258
|
+
new ResizeObserver((Ge) => {
|
|
1259
|
+
Ge[0].contentRect.height > 50 && L.classList.add("active");
|
|
1260
|
+
}).observe(L);
|
|
1243
1261
|
}
|
|
1244
1262
|
if (o == "inBox") {
|
|
1245
|
-
const
|
|
1263
|
+
const L = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
|
|
1246
1264
|
let z;
|
|
1247
|
-
|
|
1265
|
+
L == null ? z = `
|
|
1248
1266
|
<div
|
|
1249
1267
|
class="photo-box"
|
|
1250
1268
|
video-target
|
|
@@ -1268,43 +1286,43 @@ et = new WeakSet(), _e = function() {
|
|
|
1268
1286
|
>
|
|
1269
1287
|
<picture>
|
|
1270
1288
|
<source
|
|
1271
|
-
srcset="${
|
|
1289
|
+
srcset="${L}"
|
|
1272
1290
|
type="image/webp"
|
|
1273
1291
|
/>
|
|
1274
1292
|
<source
|
|
1275
|
-
srcset="${
|
|
1293
|
+
srcset="${L}"
|
|
1276
1294
|
type="image/jpeg"
|
|
1277
1295
|
/>
|
|
1278
|
-
<img src="${
|
|
1296
|
+
<img src="${L}" alt="" />
|
|
1279
1297
|
</picture>
|
|
1280
|
-
</div>`,
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1298
|
+
</div>`, y.querySelector(".video-content").insertAdjacentHTML(S.prepend, z);
|
|
1299
|
+
const Re = y.querySelectorAll("[video-target]");
|
|
1300
|
+
Re.length > 0 && new X(Re, {
|
|
1283
1301
|
LAYOUT: t.params.LAYOUT,
|
|
1284
1302
|
videoLayoutNo: t.params.videoLayoutNo
|
|
1285
1303
|
});
|
|
1286
1304
|
}
|
|
1287
1305
|
},
|
|
1288
|
-
close(
|
|
1289
|
-
const D =
|
|
1290
|
-
|
|
1306
|
+
close(y) {
|
|
1307
|
+
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1308
|
+
Mi([...D]);
|
|
1291
1309
|
},
|
|
1292
|
-
destroy(
|
|
1310
|
+
destroy(y) {
|
|
1293
1311
|
}
|
|
1294
1312
|
}
|
|
1295
1313
|
};
|
|
1296
|
-
|
|
1314
|
+
V.open(C);
|
|
1297
1315
|
} else if (o == "onPage")
|
|
1298
1316
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1299
1317
|
if (s.querySelector("video-player"))
|
|
1300
1318
|
return;
|
|
1301
|
-
s.innerHTML =
|
|
1319
|
+
s.innerHTML = pt(t.params);
|
|
1302
1320
|
return;
|
|
1303
1321
|
} else {
|
|
1304
|
-
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend",
|
|
1322
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", pt(t.params));
|
|
1305
1323
|
return;
|
|
1306
1324
|
}
|
|
1307
|
-
},
|
|
1325
|
+
}, zt = new WeakSet(), Oi = function(i) {
|
|
1308
1326
|
const t = this.options;
|
|
1309
1327
|
return {
|
|
1310
1328
|
$selector: i,
|
|
@@ -1324,11 +1342,11 @@ et = new WeakSet(), _e = function() {
|
|
|
1324
1342
|
videoInboxImg: i.getAttribute("video-inbox-img") || t.videoInboxImgHtml,
|
|
1325
1343
|
LAYOUT: t.LAYOUT || []
|
|
1326
1344
|
};
|
|
1327
|
-
},
|
|
1328
|
-
let
|
|
1329
|
-
Object.assign(
|
|
1330
|
-
customElements.define("video-player",
|
|
1331
|
-
const
|
|
1345
|
+
}, Xe(X, "globalOptions", {});
|
|
1346
|
+
let _e = X;
|
|
1347
|
+
Object.assign(_e.prototype, j);
|
|
1348
|
+
customElements.define("video-player", Ws);
|
|
1349
|
+
const Ys = {
|
|
1332
1350
|
"zh-tw": {
|
|
1333
1351
|
臺北市: [
|
|
1334
1352
|
["中正區", "100"],
|
|
@@ -2158,9 +2176,9 @@ const Rs = {
|
|
|
2158
2176
|
]
|
|
2159
2177
|
}
|
|
2160
2178
|
};
|
|
2161
|
-
let
|
|
2162
|
-
const
|
|
2163
|
-
const { TEMPLATE: i } =
|
|
2179
|
+
let Q;
|
|
2180
|
+
const Fs = (n) => {
|
|
2181
|
+
const { TEMPLATE: i } = Be, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
|
|
2164
2182
|
e.innerHTML = i(
|
|
2165
2183
|
s,
|
|
2166
2184
|
o,
|
|
@@ -2173,14 +2191,14 @@ const Xs = (n) => {
|
|
|
2173
2191
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
|
2174
2192
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2175
2193
|
}), e.children[0];
|
|
2176
|
-
},
|
|
2194
|
+
}, Us = (n) => {
|
|
2177
2195
|
var t;
|
|
2178
2196
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2179
2197
|
i && i.forEach((e) => {
|
|
2180
2198
|
const s = document.querySelector(e);
|
|
2181
|
-
s || A("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi &&
|
|
2199
|
+
s || A("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2182
2200
|
});
|
|
2183
|
-
},
|
|
2201
|
+
}, I = (n, i) => {
|
|
2184
2202
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
|
2185
2203
|
if (i < 0 || i.length === 0) {
|
|
2186
2204
|
switch (e.forEach((s) => {
|
|
@@ -2221,7 +2239,7 @@ const Xs = (n) => {
|
|
|
2221
2239
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
|
2222
2240
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
|
2223
2241
|
const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
|
2224
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
|
2242
|
+
n.s.selectDisplayEl.insertAdjacentHTML(S.append, u);
|
|
2225
2243
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
|
2226
2244
|
index: [...e].indexOf(r),
|
|
2227
2245
|
id: r.getAttribute("data-option"),
|
|
@@ -2232,42 +2250,42 @@ const Xs = (n) => {
|
|
|
2232
2250
|
break;
|
|
2233
2251
|
}
|
|
2234
2252
|
}
|
|
2235
|
-
},
|
|
2253
|
+
}, Zs = (n) => {
|
|
2236
2254
|
const i = n.s.cityLang;
|
|
2237
|
-
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (
|
|
2255
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (Q = JSON.parse(f("#newCityData").val())[0], console.log([0])) : Q = Ys, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Q[i]).forEach((t) => {
|
|
2238
2256
|
const e = document.createElement("li");
|
|
2239
2257
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2240
2258
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
2241
|
-
},
|
|
2259
|
+
}, Js = (n, i) => {
|
|
2242
2260
|
const t = n.s.cityLang;
|
|
2243
|
-
|
|
2261
|
+
Q[t][i].forEach((e, s) => {
|
|
2244
2262
|
const o = document.createElement("li");
|
|
2245
2263
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
|
2246
2264
|
});
|
|
2247
|
-
},
|
|
2248
|
-
|
|
2265
|
+
}, Ni = () => {
|
|
2266
|
+
$('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2249
2267
|
i.close();
|
|
2250
2268
|
});
|
|
2251
|
-
},
|
|
2252
|
-
const { SETTINGS: n } =
|
|
2269
|
+
}, Qs = () => {
|
|
2270
|
+
const { SETTINGS: n } = Be;
|
|
2253
2271
|
((t, e) => {
|
|
2254
2272
|
Object.keys(e).forEach((s) => {
|
|
2255
2273
|
t.style.setProperty(`--${s}`, e[s]);
|
|
2256
2274
|
});
|
|
2257
2275
|
})(document.documentElement, n.scrollbar);
|
|
2258
2276
|
};
|
|
2259
|
-
|
|
2277
|
+
Qs();
|
|
2260
2278
|
document.addEventListener("click", function() {
|
|
2261
|
-
|
|
2279
|
+
Ni();
|
|
2262
2280
|
});
|
|
2263
|
-
var
|
|
2264
|
-
class
|
|
2281
|
+
var Bt, ji, Wt, zi, Gt, Bi, Rt, Wi;
|
|
2282
|
+
class Pi extends HTMLElement {
|
|
2265
2283
|
constructor() {
|
|
2266
2284
|
super();
|
|
2267
|
-
h(this, zt);
|
|
2268
2285
|
h(this, Bt);
|
|
2269
2286
|
h(this, Wt);
|
|
2270
2287
|
h(this, Gt);
|
|
2288
|
+
h(this, Rt);
|
|
2271
2289
|
this.initialize = !1;
|
|
2272
2290
|
}
|
|
2273
2291
|
static get observedAttributes() {
|
|
@@ -2288,36 +2306,36 @@ class Oi extends HTMLElement {
|
|
|
2288
2306
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
|
2289
2307
|
case "single":
|
|
2290
2308
|
const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
|
2291
|
-
|
|
2309
|
+
E(r) ? I(o, [...o.s.allLi].indexOf(r)) : I(o, -1);
|
|
2292
2310
|
break;
|
|
2293
2311
|
case "multiple":
|
|
2294
2312
|
const l = [];
|
|
2295
2313
|
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
|
2296
2314
|
const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
|
2297
|
-
|
|
2315
|
+
E(p) && (p.classList.add("active"), l.push(p));
|
|
2298
2316
|
});
|
|
2299
2317
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
|
2300
|
-
|
|
2318
|
+
I(o, c);
|
|
2301
2319
|
break;
|
|
2302
2320
|
}
|
|
2303
2321
|
else
|
|
2304
|
-
|
|
2322
|
+
I(o, -1);
|
|
2305
2323
|
o.emit("change");
|
|
2306
2324
|
break;
|
|
2307
2325
|
case "d4-placeholder":
|
|
2308
2326
|
if (e === null)
|
|
2309
2327
|
return;
|
|
2310
|
-
e !== s && o.s.value.index < 0 &&
|
|
2328
|
+
e !== s && o.s.value.index < 0 && I(o, o.s.value.index);
|
|
2311
2329
|
break;
|
|
2312
2330
|
}
|
|
2313
2331
|
}
|
|
2314
2332
|
connectedCallback() {
|
|
2315
2333
|
const t = this;
|
|
2316
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
|
2334
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Bt, ji).call(this));
|
|
2317
2335
|
}
|
|
2318
2336
|
open() {
|
|
2319
2337
|
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e : e;
|
|
2320
|
-
return
|
|
2338
|
+
return Ni(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
|
|
2321
2339
|
height: ${o()}px;
|
|
2322
2340
|
z-index: 2;
|
|
2323
2341
|
`, this;
|
|
@@ -2339,14 +2357,14 @@ class Oi extends HTMLElement {
|
|
|
2339
2357
|
this.__events__.selectOption();
|
|
2340
2358
|
}
|
|
2341
2359
|
}
|
|
2342
|
-
|
|
2343
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
|
2344
|
-
},
|
|
2345
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2346
|
-
},
|
|
2360
|
+
Bt = new WeakSet(), ji = function() {
|
|
2361
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Wt, zi).call(this);
|
|
2362
|
+
}, Wt = new WeakSet(), zi = function() {
|
|
2363
|
+
this.s.childDom = this.childNodes, this.s.template = Fs(this), this.innerHTML = "", this.append(this.s.template), d(this, Gt, Bi).call(this);
|
|
2364
|
+
}, Gt = new WeakSet(), Bi = function() {
|
|
2347
2365
|
var s;
|
|
2348
2366
|
const t = this;
|
|
2349
|
-
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw",
|
|
2367
|
+
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Zs(t), t.s.subDropdownTotalH = 0;
|
|
2350
2368
|
const e = t.getAttribute("d4-value");
|
|
2351
2369
|
switch (t.s.selectType) {
|
|
2352
2370
|
case "single":
|
|
@@ -2355,14 +2373,14 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2355
2373
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2356
2374
|
if (r && l) {
|
|
2357
2375
|
const c = r.getAttribute("d4-value");
|
|
2358
|
-
if (
|
|
2376
|
+
if (Js(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2359
2377
|
const u = e.split(",")[1];
|
|
2360
2378
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2361
2379
|
}
|
|
2362
2380
|
}
|
|
2363
2381
|
} else
|
|
2364
2382
|
o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
|
|
2365
|
-
|
|
2383
|
+
E(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
|
|
2366
2384
|
index: [...t.s.allLi].indexOf(o),
|
|
2367
2385
|
id: e,
|
|
2368
2386
|
el: o
|
|
@@ -2376,7 +2394,7 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2376
2394
|
const a = [];
|
|
2377
2395
|
e.split(",").forEach((r) => {
|
|
2378
2396
|
const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
|
|
2379
|
-
|
|
2397
|
+
E(l) && a.push(l);
|
|
2380
2398
|
}), a.length > 0 ? t.s.value = {
|
|
2381
2399
|
index: a.map((r) => [...t.s.allLi].indexOf(r)),
|
|
2382
2400
|
id: a.map((r) => r.getAttribute("data-option")),
|
|
@@ -2388,8 +2406,8 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2388
2406
|
};
|
|
2389
2407
|
break;
|
|
2390
2408
|
}
|
|
2391
|
-
|
|
2392
|
-
},
|
|
2409
|
+
I(t, t.s.value.index), d(s = t, Rt, Wi).call(s), t.classList.add("d4-initialize");
|
|
2410
|
+
}, Rt = new WeakSet(), Wi = function() {
|
|
2393
2411
|
const t = this;
|
|
2394
2412
|
t.__events__.dropdownToggle = () => {
|
|
2395
2413
|
t.addEventListener("click", function(e) {
|
|
@@ -2411,7 +2429,7 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2411
2429
|
const r = t.querySelector(".dropdown-scroller"), l = () => {
|
|
2412
2430
|
if (t.__scroller__) {
|
|
2413
2431
|
const { viewport: c } = t.__scroller__.elements();
|
|
2414
|
-
if (
|
|
2432
|
+
if (E(t.s.activeLi)) {
|
|
2415
2433
|
const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, g = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
|
|
2416
2434
|
c.scrollTo({
|
|
2417
2435
|
top: g,
|
|
@@ -2435,7 +2453,7 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2435
2453
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2436
2454
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2437
2455
|
const s = e.querySelector(".dropdown-scroller");
|
|
2438
|
-
e.__scroller__ =
|
|
2456
|
+
e.__scroller__ = je(s, {
|
|
2439
2457
|
overflowBehavior: {
|
|
2440
2458
|
x: "hidden"
|
|
2441
2459
|
}
|
|
@@ -2449,30 +2467,30 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2449
2467
|
const u = this, p = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
|
|
2450
2468
|
if (u.classList.contains("has-sublayer")) {
|
|
2451
2469
|
c.stopPropagation();
|
|
2452
|
-
const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"),
|
|
2453
|
-
v.style.cssText = `--height: ${w.offsetHeight +
|
|
2454
|
-
const
|
|
2470
|
+
const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
|
|
2471
|
+
v.style.cssText = `--height: ${w.offsetHeight + b}px`;
|
|
2472
|
+
const T = parseInt(v.style.cssText.replace("--height:", "").trim()), C = parseInt(getComputedStyle(a).maxHeight), y = () => {
|
|
2455
2473
|
s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
|
2456
2474
|
};
|
|
2457
|
-
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -=
|
|
2475
|
+
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
|
|
2458
2476
|
const D = () => {
|
|
2459
2477
|
e.__scroller__.update(!0), v.removeEventListener("transitionend", D);
|
|
2460
2478
|
};
|
|
2461
2479
|
v.addEventListener("transitionend", D);
|
|
2462
2480
|
} else
|
|
2463
|
-
switch (
|
|
2481
|
+
switch (Us(e), e.s.selectType) {
|
|
2464
2482
|
case "single":
|
|
2465
2483
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2466
|
-
const v = e.s.cityLang, w = l.textContent.trim(),
|
|
2467
|
-
|
|
2468
|
-
const
|
|
2469
|
-
|
|
2470
|
-
}), e.__events__.selectOption(
|
|
2484
|
+
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
2485
|
+
b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1), Q[v][w].forEach((T, C) => {
|
|
2486
|
+
const y = document.createElement("li");
|
|
2487
|
+
y.textContent = T[0], y.setAttribute("data-option", T[0]), b.querySelector(".dropdown-list").append(y);
|
|
2488
|
+
}), e.__events__.selectOption(b));
|
|
2471
2489
|
}
|
|
2472
2490
|
(m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
|
2473
2491
|
break;
|
|
2474
2492
|
case "multiple":
|
|
2475
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
|
2493
|
+
c.stopPropagation(), u.classList.toggle("active"), I(e, p);
|
|
2476
2494
|
break;
|
|
2477
2495
|
}
|
|
2478
2496
|
});
|
|
@@ -2505,9 +2523,9 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2505
2523
|
});
|
|
2506
2524
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
|
2507
2525
|
};
|
|
2508
|
-
Object.assign(
|
|
2509
|
-
customElements.define("dropdown-el",
|
|
2510
|
-
function
|
|
2526
|
+
Object.assign(Pi.prototype, j);
|
|
2527
|
+
customElements.define("dropdown-el", Pi);
|
|
2528
|
+
function gt(n) {
|
|
2511
2529
|
const i = {};
|
|
2512
2530
|
return [...n.attributes].forEach((t) => {
|
|
2513
2531
|
if (t.name.includes("duration-")) {
|
|
@@ -2516,10 +2534,10 @@ function mt(n) {
|
|
|
2516
2534
|
}
|
|
2517
2535
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2518
2536
|
}
|
|
2519
|
-
function
|
|
2520
|
-
if (
|
|
2537
|
+
function Ze(n) {
|
|
2538
|
+
if (gt(n)) {
|
|
2521
2539
|
let i;
|
|
2522
|
-
const t = Object.keys(
|
|
2540
|
+
const t = Object.keys(gt(n)).map((e) => ({
|
|
2523
2541
|
value: e,
|
|
2524
2542
|
point: e
|
|
2525
2543
|
}));
|
|
@@ -2528,11 +2546,11 @@ function Ue(n) {
|
|
|
2528
2546
|
const { point: s, value: o } = t[e];
|
|
2529
2547
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
|
2530
2548
|
}
|
|
2531
|
-
return i ? Number(
|
|
2549
|
+
return i ? Number(gt(n)[i]) : n.s.options.duration;
|
|
2532
2550
|
} else
|
|
2533
2551
|
return n.s.options.duration;
|
|
2534
2552
|
}
|
|
2535
|
-
function
|
|
2553
|
+
function Vs(n) {
|
|
2536
2554
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
|
2537
2555
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
|
2538
2556
|
a.append(l);
|
|
@@ -2599,20 +2617,20 @@ function H(n) {
|
|
|
2599
2617
|
}
|
|
2600
2618
|
return s;
|
|
2601
2619
|
}
|
|
2602
|
-
function
|
|
2620
|
+
function Ks(n) {
|
|
2603
2621
|
let i;
|
|
2604
2622
|
return function(t) {
|
|
2605
2623
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2606
2624
|
};
|
|
2607
2625
|
}
|
|
2608
|
-
var
|
|
2609
|
-
class
|
|
2626
|
+
var Xt, Gi, Yt, Ri, Ft, Xi, Ut, Yi;
|
|
2627
|
+
class tn extends HTMLElement {
|
|
2610
2628
|
constructor() {
|
|
2611
2629
|
super();
|
|
2612
|
-
h(this, Rt);
|
|
2613
2630
|
h(this, Xt);
|
|
2614
2631
|
h(this, Yt);
|
|
2615
2632
|
h(this, Ft);
|
|
2633
|
+
h(this, Ut);
|
|
2616
2634
|
this.initialize = !1;
|
|
2617
2635
|
}
|
|
2618
2636
|
static get observedAttributes() {
|
|
@@ -2621,7 +2639,7 @@ class Vs extends HTMLElement {
|
|
|
2621
2639
|
attributeChangedCallback(t, e, s) {
|
|
2622
2640
|
}
|
|
2623
2641
|
connectedCallback() {
|
|
2624
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
2642
|
+
this.initialize || (this.initialize = !0, d(this, Xt, Gi).call(this));
|
|
2625
2643
|
}
|
|
2626
2644
|
play() {
|
|
2627
2645
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2630,7 +2648,7 @@ class Vs extends HTMLElement {
|
|
|
2630
2648
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2631
2649
|
}
|
|
2632
2650
|
}
|
|
2633
|
-
|
|
2651
|
+
Xt = new WeakSet(), Gi = function() {
|
|
2634
2652
|
const t = {
|
|
2635
2653
|
direction: this.getAttribute("direction") || M.SETTINGS.direction,
|
|
2636
2654
|
// up / down / left / right
|
|
@@ -2638,7 +2656,7 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2638
2656
|
// normal / alternate / endStop
|
|
2639
2657
|
duration: Number(this.getAttribute("duration")) || M.SETTINGS.duration,
|
|
2640
2658
|
// ms
|
|
2641
|
-
durationBreakpoints:
|
|
2659
|
+
durationBreakpoints: gt(this) || M.SETTINGS.durationBreakpoints,
|
|
2642
2660
|
autoplay: this.getAttribute("autoplay") || M.SETTINGS.autoplay,
|
|
2643
2661
|
// normal / alternate / endStop
|
|
2644
2662
|
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : M.SETTINGS.pauseOnMouseenter,
|
|
@@ -2647,8 +2665,8 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2647
2665
|
// true / false
|
|
2648
2666
|
gap: Number(this.getAttribute("gap")) || M.SETTINGS.gap
|
|
2649
2667
|
};
|
|
2650
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
|
2651
|
-
},
|
|
2668
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Ze(this), Vs(this), d(this, Yt, Ri).call(this);
|
|
2669
|
+
}, Yt = new WeakSet(), Ri = function() {
|
|
2652
2670
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2653
2671
|
switch (t) {
|
|
2654
2672
|
case "left":
|
|
@@ -2660,8 +2678,8 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2660
2678
|
e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;`;
|
|
2661
2679
|
break;
|
|
2662
2680
|
}
|
|
2663
|
-
d(this,
|
|
2664
|
-
},
|
|
2681
|
+
d(this, Ft, Xi).call(this), d(this, Ut, Yi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2682
|
+
}, Ft = new WeakSet(), Xi = function() {
|
|
2665
2683
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2666
2684
|
let c;
|
|
2667
2685
|
function u() {
|
|
@@ -2726,11 +2744,11 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2726
2744
|
}), t.addEventListener("mouseleave", function() {
|
|
2727
2745
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2728
2746
|
});
|
|
2729
|
-
},
|
|
2747
|
+
}, Ut = new WeakSet(), Yi = function() {
|
|
2730
2748
|
const t = this;
|
|
2731
2749
|
function e() {
|
|
2732
2750
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
2733
|
-
t.s.nowDuration =
|
|
2751
|
+
t.s.nowDuration = Ze(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
|
|
2734
2752
|
duration: t.s.nowDuration,
|
|
2735
2753
|
iterations: 1 / 0
|
|
2736
2754
|
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
|
|
@@ -2739,16 +2757,16 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2739
2757
|
iterations: 1 / 0
|
|
2740
2758
|
}), t.s.cloneAnimation.startTime = o);
|
|
2741
2759
|
}
|
|
2742
|
-
window.addEventListener("resize",
|
|
2760
|
+
window.addEventListener("resize", Ks(e));
|
|
2743
2761
|
};
|
|
2744
|
-
customElements.define("marquee-el",
|
|
2762
|
+
customElements.define("marquee-el", tn);
|
|
2745
2763
|
const Je = function(n, i) {
|
|
2746
2764
|
let t;
|
|
2747
2765
|
return function(e) {
|
|
2748
2766
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
2749
2767
|
};
|
|
2750
2768
|
}, _ = (n, i) => {
|
|
2751
|
-
if (
|
|
2769
|
+
if (ut(n)) {
|
|
2752
2770
|
n.forEach((t) => {
|
|
2753
2771
|
t.classList.add(i);
|
|
2754
2772
|
});
|
|
@@ -2756,7 +2774,7 @@ const Je = function(n, i) {
|
|
|
2756
2774
|
}
|
|
2757
2775
|
n.classList.add(i);
|
|
2758
2776
|
}, k = (n, i) => {
|
|
2759
|
-
if (
|
|
2777
|
+
if (ut(n)) {
|
|
2760
2778
|
n.forEach((t) => {
|
|
2761
2779
|
t.classList.remove(i);
|
|
2762
2780
|
});
|
|
@@ -2764,22 +2782,22 @@ const Je = function(n, i) {
|
|
|
2764
2782
|
}
|
|
2765
2783
|
n.classList.remove(i);
|
|
2766
2784
|
};
|
|
2767
|
-
var
|
|
2768
|
-
class
|
|
2785
|
+
var Zt, Fi, Jt, Ui, Qt, Zi, nt, Me, Y, ft, Vt, Ji;
|
|
2786
|
+
class Qe {
|
|
2769
2787
|
constructor(i) {
|
|
2770
2788
|
// 初始化
|
|
2771
|
-
h(this,
|
|
2789
|
+
h(this, Zt);
|
|
2772
2790
|
// 左右箭頭事件綁定
|
|
2773
2791
|
h(this, Jt);
|
|
2774
2792
|
// 左右拖拉事件綁定
|
|
2775
|
-
h(this,
|
|
2793
|
+
h(this, Qt);
|
|
2776
2794
|
// 卷軸位置判斷
|
|
2777
|
-
h(this,
|
|
2795
|
+
h(this, nt);
|
|
2778
2796
|
// 隱藏按鈕判斷
|
|
2779
2797
|
h(this, Y);
|
|
2780
2798
|
// 選項事件綁定
|
|
2781
|
-
h(this,
|
|
2782
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
|
2799
|
+
h(this, Vt);
|
|
2800
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Zt, Fi).call(this);
|
|
2783
2801
|
}
|
|
2784
2802
|
// 更新 active 位置
|
|
2785
2803
|
update(i) {
|
|
@@ -2793,7 +2811,7 @@ class Ze {
|
|
|
2793
2811
|
}
|
|
2794
2812
|
}
|
|
2795
2813
|
}
|
|
2796
|
-
|
|
2814
|
+
Zt = new WeakSet(), Fi = function() {
|
|
2797
2815
|
var s, o, a, r;
|
|
2798
2816
|
const i = this;
|
|
2799
2817
|
if (!i.$element)
|
|
@@ -2802,11 +2820,11 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2802
2820
|
let t = !1;
|
|
2803
2821
|
const e = () => {
|
|
2804
2822
|
t || (requestAnimationFrame(() => {
|
|
2805
|
-
d(this,
|
|
2823
|
+
d(this, nt, Me).call(this), d(this, Y, ft).call(this), t = !1;
|
|
2806
2824
|
}), t = !0);
|
|
2807
2825
|
};
|
|
2808
|
-
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i,
|
|
2809
|
-
|
|
2826
|
+
i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, Qt, Zi).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2827
|
+
S.prepend,
|
|
2810
2828
|
`<div class="navigation">
|
|
2811
2829
|
<div class="button prev">
|
|
2812
2830
|
<div></div>
|
|
@@ -2815,10 +2833,10 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2815
2833
|
<div></div>
|
|
2816
2834
|
</div>
|
|
2817
2835
|
</div>`
|
|
2818
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Jt,
|
|
2819
|
-
d(this,
|
|
2836
|
+
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Jt, Ui).call(a)), d(r = i, Vt, Ji).call(r), i.update(), requestAnimationFrame(() => {
|
|
2837
|
+
d(this, nt, Me).call(this), d(this, Y, ft).call(this);
|
|
2820
2838
|
});
|
|
2821
|
-
}, Jt = new WeakSet(),
|
|
2839
|
+
}, Jt = new WeakSet(), Ui = function() {
|
|
2822
2840
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2823
2841
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2824
2842
|
t.scrollTo({
|
|
@@ -2826,13 +2844,13 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2826
2844
|
behavior: "smooth"
|
|
2827
2845
|
}), setTimeout(() => {
|
|
2828
2846
|
var r;
|
|
2829
|
-
d(r = i, Y,
|
|
2847
|
+
d(r = i, Y, ft).call(r);
|
|
2830
2848
|
}, 100);
|
|
2831
2849
|
};
|
|
2832
2850
|
e.forEach((o) => {
|
|
2833
2851
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2834
2852
|
});
|
|
2835
|
-
},
|
|
2853
|
+
}, Qt = new WeakSet(), Zi = function() {
|
|
2836
2854
|
const { $wrapper: i } = this;
|
|
2837
2855
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2838
2856
|
const a = function(p) {
|
|
@@ -2862,10 +2880,10 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2862
2880
|
i.querySelectorAll("a").forEach((p) => {
|
|
2863
2881
|
p.removeEventListener("click", u), p.addEventListener("click", u);
|
|
2864
2882
|
});
|
|
2865
|
-
},
|
|
2883
|
+
}, nt = new WeakSet(), Me = function() {
|
|
2866
2884
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2867
2885
|
e <= 0 || (_(i, "scrollable"), s == 0 ? (k(i, "scrollable"), _(t, "start"), k(t, "end")) : s + 1 >= e ? (k(i, "scrollable"), k(t, "start"), _(t, "end")) : (_(t, "center"), k(t, "start"), k(t, "end")));
|
|
2868
|
-
}, Y = new WeakSet(),
|
|
2886
|
+
}, Y = new WeakSet(), ft = function() {
|
|
2869
2887
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2870
2888
|
if (!t)
|
|
2871
2889
|
return;
|
|
@@ -2887,7 +2905,7 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2887
2905
|
}
|
|
2888
2906
|
k(a, "hide");
|
|
2889
2907
|
}) : k(t, "hide");
|
|
2890
|
-
},
|
|
2908
|
+
}, Vt = new WeakSet(), Ji = function() {
|
|
2891
2909
|
const { $element: i } = this, t = (s) => {
|
|
2892
2910
|
if (this.option.selected) {
|
|
2893
2911
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2901,31 +2919,31 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2901
2919
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2902
2920
|
});
|
|
2903
2921
|
};
|
|
2904
|
-
var
|
|
2905
|
-
class
|
|
2922
|
+
var Kt, Qi, te, Vi, ee, Ki, ie, ts;
|
|
2923
|
+
class en {
|
|
2906
2924
|
constructor(i) {
|
|
2907
2925
|
// 初始化
|
|
2908
|
-
h(this, Vt);
|
|
2909
|
-
// 隱藏按鈕判斷
|
|
2910
2926
|
h(this, Kt);
|
|
2911
|
-
//
|
|
2927
|
+
// 隱藏按鈕判斷
|
|
2912
2928
|
h(this, te);
|
|
2913
|
-
//
|
|
2929
|
+
// 展開箭頭事件綁定
|
|
2914
2930
|
h(this, ee);
|
|
2915
|
-
|
|
2931
|
+
// 選項事件綁定
|
|
2932
|
+
h(this, ie);
|
|
2933
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Kt, Qi).call(this);
|
|
2916
2934
|
}
|
|
2917
2935
|
}
|
|
2918
|
-
|
|
2919
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
|
2920
|
-
},
|
|
2936
|
+
Kt = new WeakSet(), Qi = function() {
|
|
2937
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, te, Vi).call(this) && d(this, ee, Ki).call(this), d(this, ie, ts).call(this));
|
|
2938
|
+
}, te = new WeakSet(), Vi = function() {
|
|
2921
2939
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2922
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
|
2923
|
-
},
|
|
2940
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), k(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
|
|
2941
|
+
}, ee = new WeakSet(), Ki = function() {
|
|
2924
2942
|
const { $element: i, $button: t } = this, e = function() {
|
|
2925
2943
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
2926
2944
|
};
|
|
2927
2945
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
|
2928
|
-
},
|
|
2946
|
+
}, ie = new WeakSet(), ts = function() {
|
|
2929
2947
|
const { $element: i } = this, t = (s, o) => {
|
|
2930
2948
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
|
2931
2949
|
const a = s.getAttribute("data-option").trim();
|
|
@@ -2939,18 +2957,18 @@ Vt = new WeakSet(), Ji = function() {
|
|
|
2939
2957
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2940
2958
|
});
|
|
2941
2959
|
};
|
|
2942
|
-
const
|
|
2960
|
+
const sn = (n) => {
|
|
2943
2961
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2944
|
-
return i == "drag" && (s.innerHTML =
|
|
2962
|
+
return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
|
|
2945
2963
|
};
|
|
2946
|
-
var
|
|
2947
|
-
class
|
|
2964
|
+
var se, es, ne, is, ot, Ie, F, vt;
|
|
2965
|
+
class nn extends HTMLElement {
|
|
2948
2966
|
constructor() {
|
|
2949
2967
|
super();
|
|
2950
|
-
h(this, ie);
|
|
2951
2968
|
h(this, se);
|
|
2969
|
+
h(this, ne);
|
|
2952
2970
|
// 斷點設定
|
|
2953
|
-
h(this,
|
|
2971
|
+
h(this, ot);
|
|
2954
2972
|
// check type
|
|
2955
2973
|
h(this, F);
|
|
2956
2974
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
@@ -2964,7 +2982,7 @@ class en extends HTMLElement {
|
|
|
2964
2982
|
case "m4-type":
|
|
2965
2983
|
if (e === null || e === s)
|
|
2966
2984
|
return;
|
|
2967
|
-
this.s.type = s, d(this, F,
|
|
2985
|
+
this.s.type = s, d(this, F, vt).call(this);
|
|
2968
2986
|
break;
|
|
2969
2987
|
case "m4-status":
|
|
2970
2988
|
if (e === s)
|
|
@@ -2981,15 +2999,15 @@ class en extends HTMLElement {
|
|
|
2981
2999
|
}
|
|
2982
3000
|
}
|
|
2983
3001
|
connectedCallback() {
|
|
2984
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
|
3002
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, se, es).call(this));
|
|
2985
3003
|
}
|
|
2986
3004
|
update() {
|
|
2987
|
-
d(this,
|
|
3005
|
+
d(this, ot, Ie).call(this);
|
|
2988
3006
|
}
|
|
2989
3007
|
}
|
|
2990
|
-
|
|
3008
|
+
se = new WeakSet(), es = function() {
|
|
2991
3009
|
let t = {};
|
|
2992
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
|
3010
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? q.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
2993
3011
|
const e = (s) => {
|
|
2994
3012
|
if (s.type === "resize") {
|
|
2995
3013
|
if (window.innerWidth === this.previousWidth)
|
|
@@ -2998,84 +3016,84 @@ ie = new WeakSet(), Ki = function() {
|
|
|
2998
3016
|
}
|
|
2999
3017
|
this.update();
|
|
3000
3018
|
};
|
|
3001
|
-
window.removeEventListener("resize", Je(e)), window.addEventListener("resize", Je(e)), this.s.option = {}, this.s.option.drag = Object.assign({},
|
|
3002
|
-
},
|
|
3003
|
-
this.classList.add("m4-init"), d(this,
|
|
3004
|
-
},
|
|
3019
|
+
window.removeEventListener("resize", Je(e)), window.addEventListener("resize", Je(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, ne, is).call(this);
|
|
3020
|
+
}, ne = new WeakSet(), is = function() {
|
|
3021
|
+
this.classList.add("m4-init"), d(this, ot, Ie).call(this);
|
|
3022
|
+
}, ot = new WeakSet(), Ie = function() {
|
|
3005
3023
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3006
3024
|
if (!t.length) {
|
|
3007
|
-
d(this, F,
|
|
3025
|
+
d(this, F, vt).call(this);
|
|
3008
3026
|
return;
|
|
3009
3027
|
}
|
|
3010
3028
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
3011
3029
|
var s, o, a, r;
|
|
3012
|
-
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, F,
|
|
3030
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, F, vt).call(this), window.innerWidth >= e;
|
|
3013
3031
|
});
|
|
3014
|
-
}, F = new WeakSet(),
|
|
3032
|
+
}, F = new WeakSet(), vt = function() {
|
|
3015
3033
|
var o;
|
|
3016
3034
|
const { type: t } = this.s;
|
|
3017
|
-
this.innerHTML = "", [...
|
|
3035
|
+
this.innerHTML = "", [...sn(this)].forEach((a) => {
|
|
3018
3036
|
this.append(a);
|
|
3019
3037
|
});
|
|
3020
3038
|
const e = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), s = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
|
|
3021
3039
|
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
|
3022
3040
|
case "drag":
|
|
3023
|
-
this.drag = new
|
|
3041
|
+
this.drag = new Qe(this);
|
|
3024
3042
|
break;
|
|
3025
3043
|
case "collapse":
|
|
3026
|
-
this.drag = new
|
|
3044
|
+
this.drag = new Qe(this), this.collapse = new en(this);
|
|
3027
3045
|
break;
|
|
3028
3046
|
}
|
|
3029
3047
|
(o = this.drag) == null || o.update();
|
|
3030
3048
|
};
|
|
3031
|
-
customElements.define("multipurpose-nav",
|
|
3032
|
-
var
|
|
3033
|
-
class
|
|
3049
|
+
customElements.define("multipurpose-nav", nn);
|
|
3050
|
+
var oe, ns, ae, os, at, qe, W, Z, re, as, le, rs, ce, ls, de, cs, ue, ds, he, us, pe, hs, me, ps, ge, ms, N, R, fe, gs, ve, fs, be, vs, ye, bs;
|
|
3051
|
+
class ss extends HTMLElement {
|
|
3034
3052
|
// 定義組件的初始狀態
|
|
3035
3053
|
constructor(t, e) {
|
|
3036
3054
|
super();
|
|
3037
|
-
h(this, ne);
|
|
3038
3055
|
h(this, oe);
|
|
3056
|
+
h(this, ae);
|
|
3039
3057
|
// 第一關 判斷數量以及id設定
|
|
3040
|
-
h(this,
|
|
3058
|
+
h(this, at);
|
|
3041
3059
|
// 第二關 id命名提醒
|
|
3042
3060
|
h(this, W);
|
|
3043
|
-
h(this, ae);
|
|
3044
3061
|
h(this, re);
|
|
3045
3062
|
h(this, le);
|
|
3063
|
+
h(this, ce);
|
|
3046
3064
|
// 執行函式
|
|
3047
3065
|
// 移動至指定位置
|
|
3048
|
-
h(this, ce);
|
|
3049
|
-
// 移動
|
|
3050
3066
|
h(this, de);
|
|
3051
|
-
//
|
|
3067
|
+
// 移動
|
|
3052
3068
|
h(this, ue);
|
|
3053
|
-
//
|
|
3069
|
+
// 步驟狀態
|
|
3054
3070
|
h(this, he);
|
|
3055
|
-
//
|
|
3071
|
+
// next 按鈕狀態
|
|
3056
3072
|
h(this, pe);
|
|
3057
|
-
//
|
|
3073
|
+
// prev 按鈕狀態
|
|
3058
3074
|
h(this, me);
|
|
3075
|
+
// 頁籤狀態
|
|
3076
|
+
h(this, ge);
|
|
3059
3077
|
// 第三關各種元件判斷 及 執行
|
|
3060
3078
|
h(this, N);
|
|
3061
3079
|
// 消失動畫
|
|
3062
|
-
h(this, ge);
|
|
3063
|
-
// 出現動畫
|
|
3064
3080
|
h(this, fe);
|
|
3065
|
-
//
|
|
3081
|
+
// 出現動畫
|
|
3066
3082
|
h(this, ve);
|
|
3067
|
-
//
|
|
3083
|
+
// 狀態
|
|
3068
3084
|
h(this, be);
|
|
3085
|
+
// resize
|
|
3086
|
+
h(this, ye);
|
|
3069
3087
|
}
|
|
3070
3088
|
// 當組件的屬性被更改時會被呼叫
|
|
3071
3089
|
static get observedAttributes() {
|
|
3072
3090
|
return ["t4-active"];
|
|
3073
3091
|
}
|
|
3074
3092
|
attributeChangedCallback(t, e, s) {
|
|
3075
|
-
t === "t4-active" && e !== s && d(this,
|
|
3093
|
+
t === "t4-active" && e !== s && d(this, be, vs).call(this, s);
|
|
3076
3094
|
}
|
|
3077
3095
|
connectedCallback() {
|
|
3078
|
-
this.classList.contains("t4-initialize") || d(this,
|
|
3096
|
+
this.classList.contains("t4-initialize") || d(this, oe, ns).call(this);
|
|
3079
3097
|
}
|
|
3080
3098
|
// ------------- 我是分隔線呦 -------------
|
|
3081
3099
|
// 頁籤切換
|
|
@@ -3089,28 +3107,28 @@ class es extends HTMLElement {
|
|
|
3089
3107
|
setActiveTab(t) {
|
|
3090
3108
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
|
3091
3109
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
3092
|
-
const o = d(this, W,
|
|
3110
|
+
const o = d(this, W, Z).call(this, s);
|
|
3093
3111
|
e.tabPanels.forEach((a, r) => {
|
|
3094
|
-
r === o ? d(this,
|
|
3112
|
+
r === o ? d(this, ve, fs).call(this, r) : d(this, fe, gs).call(this, r);
|
|
3095
3113
|
});
|
|
3096
3114
|
}
|
|
3097
3115
|
// 外部呼叫方法 $0.goNext()
|
|
3098
3116
|
goNext() {
|
|
3099
|
-
const t = d(this, W,
|
|
3117
|
+
const t = d(this, W, Z).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3100
3118
|
this.setActiveTab(s);
|
|
3101
3119
|
}
|
|
3102
3120
|
// 外部呼叫方法 $0.goPrev()
|
|
3103
3121
|
goPrev() {
|
|
3104
|
-
const t = d(this, W,
|
|
3122
|
+
const t = d(this, W, Z).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
|
3105
3123
|
this.setActiveTab(s);
|
|
3106
3124
|
}
|
|
3107
3125
|
// 外部呼叫方法 $0.update()
|
|
3108
3126
|
update() {
|
|
3109
|
-
this.t.tabs = d(this,
|
|
3127
|
+
this.t.tabs = d(this, at, qe).call(this), ys(), console.log("tab update!!!!");
|
|
3110
3128
|
}
|
|
3111
3129
|
}
|
|
3112
|
-
|
|
3113
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
|
3130
|
+
oe = new WeakSet(), ns = function() {
|
|
3131
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = ii;
|
|
3114
3132
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
3115
3133
|
tabs: [],
|
|
3116
3134
|
name: t,
|
|
@@ -3129,36 +3147,36 @@ ne = new WeakSet(), is = function() {
|
|
|
3129
3147
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3130
3148
|
},
|
|
3131
3149
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3132
|
-
}, this.__events__ = {}, this.t.tabs = d(this,
|
|
3133
|
-
},
|
|
3134
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
|
3150
|
+
}, this.__events__ = {}, this.t.tabs = d(this, at, qe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ae, os).call(this);
|
|
3151
|
+
}, ae = new WeakSet(), os = function() {
|
|
3152
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, re, as).call(this), this.t.recordUrl) {
|
|
3135
3153
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3136
3154
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3137
3155
|
}
|
|
3138
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
|
3139
|
-
},
|
|
3156
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ye, bs).call(this);
|
|
3157
|
+
}, at = new WeakSet(), qe = function() {
|
|
3140
3158
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3141
3159
|
return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
|
|
3142
3160
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
3143
3161
|
}), e;
|
|
3144
|
-
}, W = new WeakSet(),
|
|
3162
|
+
}, W = new WeakSet(), Z = function(t) {
|
|
3145
3163
|
const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
|
|
3146
3164
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3147
3165
|
const o = s[0];
|
|
3148
3166
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3149
|
-
},
|
|
3167
|
+
}, re = new WeakSet(), as = function() {
|
|
3150
3168
|
const t = document.createElement("div");
|
|
3151
3169
|
t.classList.add("swiper-container");
|
|
3152
3170
|
const e = document.createElement("div");
|
|
3153
3171
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3154
3172
|
e.appendChild(s.cloneNode(!0));
|
|
3155
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3156
|
-
},
|
|
3173
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, le, rs).call(this);
|
|
3174
|
+
}, le = new WeakSet(), rs = function() {
|
|
3157
3175
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3158
3176
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3159
3177
|
const o = s.length * 100 + "%";
|
|
3160
3178
|
e.style.width = o;
|
|
3161
|
-
},
|
|
3179
|
+
}, ce = new WeakSet(), ls = function(t) {
|
|
3162
3180
|
const { t: e } = this;
|
|
3163
3181
|
if (e.recordUrl === "true") {
|
|
3164
3182
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3166,28 +3184,28 @@ ne = new WeakSet(), is = function() {
|
|
|
3166
3184
|
const o = `${window.location.pathname}?${s.toString()}`;
|
|
3167
3185
|
history.replaceState({ t4Id: t }, "", o);
|
|
3168
3186
|
}
|
|
3169
|
-
},
|
|
3187
|
+
}, de = new WeakSet(), cs = function() {
|
|
3170
3188
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
|
3171
|
-
d(this,
|
|
3172
|
-
},
|
|
3189
|
+
d(this, ue, ds).call(this, o);
|
|
3190
|
+
}, ue = new WeakSet(), ds = function(t) {
|
|
3173
3191
|
window.scrollTo({
|
|
3174
3192
|
top: t,
|
|
3175
3193
|
behavior: "smooth"
|
|
3176
3194
|
});
|
|
3177
|
-
},
|
|
3195
|
+
}, he = new WeakSet(), us = function(t) {
|
|
3178
3196
|
let e = parseInt(t, 10) + 1;
|
|
3179
3197
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
|
3180
|
-
},
|
|
3198
|
+
}, pe = new WeakSet(), hs = function(t) {
|
|
3181
3199
|
const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === this.t.tabPanels.length - 1;
|
|
3182
3200
|
e.forEach((a) => {
|
|
3183
3201
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3184
3202
|
});
|
|
3185
|
-
},
|
|
3203
|
+
}, me = new WeakSet(), ps = function(t) {
|
|
3186
3204
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
|
3187
3205
|
e.forEach((a) => {
|
|
3188
3206
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3189
3207
|
});
|
|
3190
|
-
},
|
|
3208
|
+
}, ge = new WeakSet(), ms = function(t, e) {
|
|
3191
3209
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
|
3192
3210
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
|
3193
3211
|
}) : this.t.tabs.forEach((s, o) => {
|
|
@@ -3196,25 +3214,25 @@ ne = new WeakSet(), is = function() {
|
|
|
3196
3214
|
}, N = new WeakSet(), R = function(t, e, s) {
|
|
3197
3215
|
switch (t) {
|
|
3198
3216
|
case "step":
|
|
3199
|
-
|
|
3217
|
+
Se(this.t.step) && d(this, he, us).call(this, e);
|
|
3200
3218
|
break;
|
|
3201
3219
|
case "eventAnchor":
|
|
3202
|
-
this.t.anchor && d(this,
|
|
3220
|
+
this.t.anchor && d(this, de, cs).call(this);
|
|
3203
3221
|
break;
|
|
3204
3222
|
case "tabState":
|
|
3205
|
-
this.t.type == "normal" && d(this,
|
|
3223
|
+
this.t.type == "normal" && d(this, ge, ms).call(this, e, s);
|
|
3206
3224
|
break;
|
|
3207
3225
|
case "btnState":
|
|
3208
|
-
d(this,
|
|
3226
|
+
d(this, pe, hs).call(this, e), d(this, me, ps).call(this, e);
|
|
3209
3227
|
break;
|
|
3210
3228
|
case "tabUrl":
|
|
3211
|
-
this.t.recordUrl === "true" && d(this,
|
|
3229
|
+
this.t.recordUrl === "true" && d(this, ce, ls).call(this, e);
|
|
3212
3230
|
break;
|
|
3213
3231
|
default:
|
|
3214
3232
|
console.warn("請增加判斷,謝謝");
|
|
3215
3233
|
break;
|
|
3216
3234
|
}
|
|
3217
|
-
},
|
|
3235
|
+
}, fe = new WeakSet(), gs = function(t) {
|
|
3218
3236
|
const { t: e } = this;
|
|
3219
3237
|
this.t.transition;
|
|
3220
3238
|
const s = e.tabPanels[t];
|
|
@@ -3231,7 +3249,7 @@ ne = new WeakSet(), is = function() {
|
|
|
3231
3249
|
s.style.display = "none";
|
|
3232
3250
|
break;
|
|
3233
3251
|
}
|
|
3234
|
-
},
|
|
3252
|
+
}, ve = new WeakSet(), fs = function(t) {
|
|
3235
3253
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
|
3236
3254
|
let r;
|
|
3237
3255
|
switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
|
|
@@ -3256,25 +3274,25 @@ ne = new WeakSet(), is = function() {
|
|
|
3256
3274
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3257
3275
|
break;
|
|
3258
3276
|
}
|
|
3259
|
-
},
|
|
3260
|
-
const e = d(this, W,
|
|
3277
|
+
}, be = new WeakSet(), vs = function(t) {
|
|
3278
|
+
const e = d(this, W, Z).call(this, t);
|
|
3261
3279
|
d(this, N, R).call(this, "step", e), d(this, N, R).call(this, "btnState", e), d(this, N, R).call(this, "tabState", e, t), d(this, N, R).call(this, "tabUrl", t), this.emit("change");
|
|
3262
|
-
},
|
|
3280
|
+
}, ye = new WeakSet(), bs = function() {
|
|
3263
3281
|
const t = this;
|
|
3264
3282
|
window.addEventListener(
|
|
3265
3283
|
"resize",
|
|
3266
|
-
|
|
3284
|
+
on(() => {
|
|
3267
3285
|
t.update();
|
|
3268
3286
|
}, 1e3)
|
|
3269
3287
|
);
|
|
3270
3288
|
};
|
|
3271
|
-
function
|
|
3289
|
+
function on(n, i = 1e3) {
|
|
3272
3290
|
let t;
|
|
3273
3291
|
return function(e) {
|
|
3274
3292
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
3275
3293
|
};
|
|
3276
3294
|
}
|
|
3277
|
-
function
|
|
3295
|
+
function ys() {
|
|
3278
3296
|
const n = document.querySelectorAll("[t4-control]");
|
|
3279
3297
|
document.addEventListener("click", function(i) {
|
|
3280
3298
|
let t = !1;
|
|
@@ -3304,91 +3322,91 @@ function vs() {
|
|
|
3304
3322
|
}
|
|
3305
3323
|
});
|
|
3306
3324
|
}
|
|
3307
|
-
|
|
3308
|
-
Object.assign(
|
|
3309
|
-
customElements.define("tab-el",
|
|
3310
|
-
const
|
|
3325
|
+
ys();
|
|
3326
|
+
Object.assign(ss.prototype, j);
|
|
3327
|
+
customElements.define("tab-el", ss);
|
|
3328
|
+
const Ve = (n) => {
|
|
3311
3329
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3312
3330
|
n.classList.add(t), o.style.height = 0, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
|
3313
|
-
},
|
|
3331
|
+
}, an = (n) => {
|
|
3314
3332
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3315
3333
|
n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
|
|
3316
3334
|
};
|
|
3317
|
-
var
|
|
3318
|
-
class
|
|
3335
|
+
var rt, Oe, we, ws, Te, Ts, lt, Ne;
|
|
3336
|
+
class rn {
|
|
3319
3337
|
constructor(i, t = {}) {
|
|
3320
|
-
h(this, at);
|
|
3321
|
-
h(this, ye);
|
|
3322
|
-
h(this, we);
|
|
3323
3338
|
h(this, rt);
|
|
3324
|
-
|
|
3339
|
+
h(this, we);
|
|
3340
|
+
h(this, Te);
|
|
3341
|
+
h(this, lt);
|
|
3342
|
+
!dt(i) && !Se(i) && !ut(i) && !E(i) || (this.__storage__ = {
|
|
3325
3343
|
el: i,
|
|
3326
3344
|
options: t
|
|
3327
|
-
}, this.active = "data-collapse-active", d(this,
|
|
3345
|
+
}, this.active = "data-collapse-active", d(this, rt, Oe).call(this));
|
|
3328
3346
|
}
|
|
3329
3347
|
update() {
|
|
3330
|
-
d(this,
|
|
3348
|
+
d(this, rt, Oe).call(this);
|
|
3331
3349
|
}
|
|
3332
3350
|
}
|
|
3333
|
-
|
|
3334
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } =
|
|
3335
|
-
if (this.elements = t.state == "not active" ?
|
|
3351
|
+
rt = new WeakSet(), Oe = function() {
|
|
3352
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = si;
|
|
3353
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3336
3354
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3337
3355
|
this.__events__[o] = [a];
|
|
3338
|
-
d(this,
|
|
3339
|
-
},
|
|
3356
|
+
d(this, we, ws).call(this);
|
|
3357
|
+
}, we = new WeakSet(), ws = function() {
|
|
3340
3358
|
const { elements: i, options: t } = this;
|
|
3341
3359
|
i.forEach((e) => {
|
|
3342
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this,
|
|
3360
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, Te, Ts).call(this, e);
|
|
3343
3361
|
}), this.emit("init");
|
|
3344
|
-
},
|
|
3362
|
+
}, Te = new WeakSet(), Ts = function(i) {
|
|
3345
3363
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3346
|
-
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this,
|
|
3364
|
+
if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, lt, Ne)), c.addEventListener("click", d(this, lt, Ne)), r) {
|
|
3347
3365
|
const p = (g) => {
|
|
3348
3366
|
g.stopPropagation();
|
|
3349
3367
|
};
|
|
3350
3368
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
|
3351
3369
|
}
|
|
3352
|
-
},
|
|
3370
|
+
}, lt = new WeakSet(), Ne = function() {
|
|
3353
3371
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3354
3372
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3355
|
-
|
|
3356
|
-
}),
|
|
3373
|
+
Ve(l);
|
|
3374
|
+
}), an(r)) : Ve(r), i.emit("afterCollapse");
|
|
3357
3375
|
};
|
|
3358
|
-
Object.assign(
|
|
3359
|
-
function
|
|
3376
|
+
Object.assign(rn.prototype, j);
|
|
3377
|
+
function ln(n, i) {
|
|
3360
3378
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
|
3361
3379
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
|
3362
3380
|
a.style.cssText = `background: ${e};left: ${r}px;top: ${l}px;opacity: ${s};animation-duration: ${o}ms`, a.classList.add("circle"), t.appendChild(a), setTimeout(function() {
|
|
3363
3381
|
a.remove();
|
|
3364
3382
|
}, `${o}`);
|
|
3365
3383
|
}
|
|
3366
|
-
function
|
|
3384
|
+
function Es() {
|
|
3367
3385
|
document.querySelectorAll("ripple-btn").forEach((n) => {
|
|
3368
3386
|
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
|
3369
3387
|
});
|
|
3370
3388
|
}
|
|
3371
|
-
document.addEventListener("click",
|
|
3372
|
-
var
|
|
3373
|
-
class
|
|
3389
|
+
document.addEventListener("click", Es);
|
|
3390
|
+
var ct, Pe, Ee, Ls, Le, As, Ae, Ss;
|
|
3391
|
+
class cn extends HTMLElement {
|
|
3374
3392
|
constructor() {
|
|
3375
3393
|
super();
|
|
3376
|
-
h(this,
|
|
3377
|
-
h(this, Te);
|
|
3394
|
+
h(this, ct);
|
|
3378
3395
|
h(this, Ee);
|
|
3396
|
+
h(this, Le);
|
|
3379
3397
|
h(this, Ae);
|
|
3380
3398
|
this.initialize = !1;
|
|
3381
3399
|
}
|
|
3382
3400
|
connectedCallback() {
|
|
3383
3401
|
const t = this;
|
|
3384
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this,
|
|
3402
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ct, Pe).call(this));
|
|
3385
3403
|
}
|
|
3386
3404
|
update() {
|
|
3387
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this,
|
|
3405
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ct, Pe).call(this);
|
|
3388
3406
|
}
|
|
3389
3407
|
}
|
|
3390
|
-
|
|
3391
|
-
const { SETTINGS: t } =
|
|
3408
|
+
ct = new WeakSet(), Pe = function() {
|
|
3409
|
+
const { SETTINGS: t } = ni;
|
|
3392
3410
|
this.s = {};
|
|
3393
3411
|
function e(o) {
|
|
3394
3412
|
let a = !!o;
|
|
@@ -3402,20 +3420,20 @@ lt = new WeakSet(), Ne = function() {
|
|
|
3402
3420
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3403
3421
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3404
3422
|
};
|
|
3405
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
|
3406
|
-
},
|
|
3407
|
-
d(this,
|
|
3408
|
-
},
|
|
3423
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee, Ls).call(this);
|
|
3424
|
+
}, Ee = new WeakSet(), Ls = function() {
|
|
3425
|
+
d(this, Le, As).call(this), d(this, Ae, Ss).call(this), this.classList.add("r4-initialize");
|
|
3426
|
+
}, Le = new WeakSet(), As = function() {
|
|
3409
3427
|
const t = this, e = document.createElement("i");
|
|
3410
3428
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3411
|
-
}, Ae = new WeakSet(),
|
|
3429
|
+
}, Ae = new WeakSet(), Ss = function() {
|
|
3412
3430
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3413
3431
|
e.addEventListener("click", function(a) {
|
|
3414
|
-
a.stopPropagation(), e.s.options.click &&
|
|
3432
|
+
a.stopPropagation(), e.s.options.click && ln(a, e);
|
|
3415
3433
|
});
|
|
3416
3434
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3417
3435
|
e.addEventListener(s, function(a) {
|
|
3418
|
-
if (s === "touchstart" &&
|
|
3436
|
+
if (s === "touchstart" && Es(), e.s.options.hover) {
|
|
3419
3437
|
const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e, p = Math.max(c, u);
|
|
3420
3438
|
t.style.width = p * 2 + "px", t.style.height = p * 2 + "px", t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
|
3421
3439
|
}
|
|
@@ -3426,8 +3444,8 @@ lt = new WeakSet(), Ne = function() {
|
|
|
3426
3444
|
}
|
|
3427
3445
|
});
|
|
3428
3446
|
};
|
|
3429
|
-
customElements.define("ripple-btn",
|
|
3430
|
-
class
|
|
3447
|
+
customElements.define("ripple-btn", cn);
|
|
3448
|
+
class dn {
|
|
3431
3449
|
constructor() {
|
|
3432
3450
|
this.init();
|
|
3433
3451
|
}
|
|
@@ -3479,12 +3497,12 @@ class ln {
|
|
|
3479
3497
|
this.init();
|
|
3480
3498
|
}
|
|
3481
3499
|
}
|
|
3482
|
-
function
|
|
3500
|
+
function Ke(n, i) {
|
|
3483
3501
|
return n ? function(t, e) {
|
|
3484
3502
|
Function(n)(t, e);
|
|
3485
3503
|
} : i;
|
|
3486
3504
|
}
|
|
3487
|
-
function
|
|
3505
|
+
function un(n, i, t, e) {
|
|
3488
3506
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3489
3507
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
|
3490
3508
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
|
@@ -3507,7 +3525,7 @@ function cn(n, i, t, e) {
|
|
|
3507
3525
|
info: e
|
|
3508
3526
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3509
3527
|
}
|
|
3510
|
-
function
|
|
3528
|
+
function hn(n, i, t, e) {
|
|
3511
3529
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3512
3530
|
let u = 0, p = 0;
|
|
3513
3531
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
@@ -3521,14 +3539,14 @@ function dn(n, i, t, e) {
|
|
|
3521
3539
|
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
|
3522
3540
|
return o.drawImage(i, g, m, u, p), s;
|
|
3523
3541
|
}
|
|
3524
|
-
function
|
|
3542
|
+
function pn(n, i) {
|
|
3525
3543
|
return new Promise((t, e) => {
|
|
3526
3544
|
if (i) {
|
|
3527
3545
|
const s = new Image();
|
|
3528
3546
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
|
3529
3547
|
let o = {
|
|
3530
3548
|
imgElement: s,
|
|
3531
|
-
originalCanvas:
|
|
3549
|
+
originalCanvas: hn(n, s, s.width, s.height),
|
|
3532
3550
|
info: {
|
|
3533
3551
|
originalWidth: s.width,
|
|
3534
3552
|
originalHeight: s.height,
|
|
@@ -3541,31 +3559,31 @@ function un(n, i) {
|
|
|
3541
3559
|
t();
|
|
3542
3560
|
});
|
|
3543
3561
|
}
|
|
3544
|
-
function
|
|
3562
|
+
function mn(n, i) {
|
|
3545
3563
|
const t = Math.pow(10, i);
|
|
3546
3564
|
return Math.round(n * t) / t;
|
|
3547
3565
|
}
|
|
3548
|
-
function
|
|
3566
|
+
function gn(n, i) {
|
|
3549
3567
|
let t = n.size / 1024 / 1024;
|
|
3550
|
-
return `${
|
|
3568
|
+
return `${mn(t, 2)}` <= i;
|
|
3551
3569
|
}
|
|
3552
|
-
function
|
|
3570
|
+
function fn(n, i, t) {
|
|
3553
3571
|
if (n.target.files.length <= 0)
|
|
3554
3572
|
return;
|
|
3555
3573
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
|
3556
3574
|
let o = new FileReader();
|
|
3557
3575
|
o.onload = (a) => {
|
|
3558
3576
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3559
|
-
if (t.params.sizeLimit && !
|
|
3577
|
+
if (t.params.sizeLimit && !gn(e, t.params.sizeLimit)) {
|
|
3560
3578
|
i.value = "", s.classList.add("over-limit"), t.params.on.overLimit && typeof t.params.on.overLimit == "function" && t.params.on.overLimit(i, t.params.sizeLimit);
|
|
3561
3579
|
return;
|
|
3562
3580
|
} else
|
|
3563
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
|
3564
|
-
|
|
3581
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), pn(t.params, r).then((l) => {
|
|
3582
|
+
un(i, t, e, l);
|
|
3565
3583
|
});
|
|
3566
3584
|
}, o.readAsDataURL(e);
|
|
3567
3585
|
}
|
|
3568
|
-
class
|
|
3586
|
+
class vn {
|
|
3569
3587
|
constructor(i, t) {
|
|
3570
3588
|
const e = this;
|
|
3571
3589
|
e.el = i, e.params = {
|
|
@@ -3593,67 +3611,68 @@ class gn {
|
|
|
3593
3611
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
|
3594
3612
|
compress: e.dataset.compress || i.params.compress,
|
|
3595
3613
|
on: {
|
|
3596
|
-
changeAfter:
|
|
3597
|
-
overLimit:
|
|
3614
|
+
changeAfter: Ke(e.dataset.changeAfter, i.params.on.changeAfter),
|
|
3615
|
+
overLimit: Ke(e.dataset.overLimit, i.params.on.overLimit)
|
|
3598
3616
|
}
|
|
3599
3617
|
};
|
|
3600
3618
|
i.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), e.dataset.group || (e.dataset.group = o.group), e.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, e.addEventListener("change", function(a) {
|
|
3601
|
-
|
|
3619
|
+
fn(a, e, i);
|
|
3602
3620
|
});
|
|
3603
3621
|
}));
|
|
3604
3622
|
}
|
|
3605
3623
|
}
|
|
3606
3624
|
export {
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3625
|
+
oi as A,
|
|
3626
|
+
Hn as B,
|
|
3627
|
+
rn as C,
|
|
3628
|
+
Pi as D,
|
|
3629
|
+
Mn as E,
|
|
3630
|
+
In as F,
|
|
3613
3631
|
qn as G,
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
Ci as
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3632
|
+
On as H,
|
|
3633
|
+
dn as I,
|
|
3634
|
+
Nn as J,
|
|
3635
|
+
Pn as K,
|
|
3636
|
+
jn as L,
|
|
3637
|
+
V as M,
|
|
3638
|
+
zn as N,
|
|
3639
|
+
Bn as O,
|
|
3640
|
+
Wn as P,
|
|
3641
|
+
Gn as Q,
|
|
3642
|
+
cn as R,
|
|
3643
|
+
Rn as S,
|
|
3644
|
+
ss as T,
|
|
3645
|
+
Xn as U,
|
|
3646
|
+
Yn as V,
|
|
3647
|
+
Fn as W,
|
|
3648
|
+
Un as X,
|
|
3649
|
+
Zn as Y,
|
|
3650
|
+
Jn as Z,
|
|
3651
|
+
E as a,
|
|
3652
|
+
ut as b,
|
|
3653
|
+
Ms as c,
|
|
3654
|
+
Hs as d,
|
|
3655
|
+
ze as e,
|
|
3656
|
+
S as f,
|
|
3657
|
+
$ as g,
|
|
3658
|
+
Dn as h,
|
|
3659
|
+
dt as i,
|
|
3660
|
+
yi as j,
|
|
3661
|
+
tn as k,
|
|
3662
|
+
nn as l,
|
|
3663
|
+
vn as m,
|
|
3664
|
+
Rs as n,
|
|
3665
|
+
Qn as o,
|
|
3666
|
+
kn as p,
|
|
3667
|
+
Ci as q,
|
|
3668
|
+
Hi as r,
|
|
3669
|
+
Cs as s,
|
|
3670
|
+
Mi as t,
|
|
3671
|
+
xn as u,
|
|
3672
|
+
_e as v,
|
|
3654
3673
|
$n as w,
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3674
|
+
_n as x,
|
|
3675
|
+
Gs as y,
|
|
3676
|
+
Cn as z
|
|
3658
3677
|
};
|
|
3659
3678
|
//# sourceMappingURL=image-preview-bundle.js.map
|