@xwadex/fesd 0.0.62 → 0.0.63
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 +275 -265
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ke = (n, i, t) => (
|
|
1
|
+
var Is = Object.defineProperty;
|
|
2
|
+
var qs = (n, i, t) => i in n ? Is(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
+
var Ke = (n, i, t) => (qs(n, typeof i != "symbol" ? i + "" : i, t), t), Ms = (n, i, t) => {
|
|
4
4
|
if (!i.has(n))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var p = (n, i, t) => {
|
|
8
8
|
if (i.has(n))
|
|
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) => (
|
|
12
|
+
var d = (n, i, t) => (Ms(n, i, "access private method"), t);
|
|
13
13
|
import f from "jquery";
|
|
14
14
|
import { OverlayScrollbars as Fe } from "overlayscrollbars";
|
|
15
15
|
import "./vendor-bundle.js";
|
|
@@ -116,7 +116,7 @@ const xe = {
|
|
|
116
116
|
</div>
|
|
117
117
|
`;
|
|
118
118
|
}
|
|
119
|
-
},
|
|
119
|
+
}, I = {
|
|
120
120
|
SETTINGS: {
|
|
121
121
|
direction: "left",
|
|
122
122
|
// 方向 - top || right || bottom || left
|
|
@@ -213,7 +213,7 @@ const xe = {
|
|
|
213
213
|
beforeScroll: null,
|
|
214
214
|
afterScroll: null
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, M = {
|
|
217
217
|
SETTINGS: {
|
|
218
218
|
type: "drag",
|
|
219
219
|
drag: {
|
|
@@ -308,7 +308,7 @@ const xe = {
|
|
|
308
308
|
update: null,
|
|
309
309
|
afterUpdate: null
|
|
310
310
|
}
|
|
311
|
-
},
|
|
311
|
+
}, pi = {
|
|
312
312
|
SETTINGS: {
|
|
313
313
|
// 是否要加 hover 效果?
|
|
314
314
|
hover: !0,
|
|
@@ -323,21 +323,21 @@ const xe = {
|
|
|
323
323
|
// hover 毫秒 ?
|
|
324
324
|
speed: 600
|
|
325
325
|
}
|
|
326
|
-
},
|
|
326
|
+
}, In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
327
327
|
__proto__: null,
|
|
328
328
|
anchor4: bt,
|
|
329
329
|
aost4: ci,
|
|
330
330
|
article4: js,
|
|
331
331
|
collapse4: ui,
|
|
332
332
|
dropdown4: Je,
|
|
333
|
-
marquee4:
|
|
333
|
+
marquee4: I,
|
|
334
334
|
modal4: j,
|
|
335
|
-
multipurpose4:
|
|
336
|
-
ripple4:
|
|
335
|
+
multipurpose4: M,
|
|
336
|
+
ripple4: pi,
|
|
337
337
|
share4: Ns,
|
|
338
338
|
tab4: di,
|
|
339
339
|
video4: xe
|
|
340
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
340
|
+
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
341
341
|
before: "beforebegin",
|
|
342
342
|
after: "afterend",
|
|
343
343
|
append: "beforeend",
|
|
@@ -398,28 +398,28 @@ const xe = {
|
|
|
398
398
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
399
399
|
}
|
|
400
400
|
}, Ce = (n, i) => {
|
|
401
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop",
|
|
401
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", h = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? _(e) : document.scrollingElement, v = m[u], w = A(t) ? _(t).getBoundingClientRect()[h] : 0 - v, b = A(s) ? _(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
402
402
|
let y = 0;
|
|
403
403
|
if (T === 0)
|
|
404
404
|
return;
|
|
405
|
-
const
|
|
405
|
+
const L = (k) => {
|
|
406
406
|
const F = _(t);
|
|
407
407
|
i && i.emit(k, F), !i && n.on && G(n.on[k]) && n.on[k](F);
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
L("beforeScroll");
|
|
410
410
|
const O = () => {
|
|
411
411
|
y += C;
|
|
412
412
|
const k = Gs[r](y, v, T, o);
|
|
413
|
-
m[u] = k, y < o && requestAnimationFrame(O), y >= o &&
|
|
413
|
+
m[u] = k, y < o && requestAnimationFrame(O), y >= o && L("afterScroll");
|
|
414
414
|
};
|
|
415
415
|
requestAnimationFrame(O);
|
|
416
416
|
};
|
|
417
417
|
var tt, He, Et, mi, At, gi;
|
|
418
|
-
class
|
|
418
|
+
class hi {
|
|
419
419
|
constructor(i, t = {}) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
p(this, tt);
|
|
421
|
+
p(this, Et);
|
|
422
|
+
p(this, At);
|
|
423
423
|
this.__storage__ = {
|
|
424
424
|
el: i,
|
|
425
425
|
options: t
|
|
@@ -482,7 +482,7 @@ tt = new WeakSet(), He = function() {
|
|
|
482
482
|
Ce(s, e);
|
|
483
483
|
}, s.delay);
|
|
484
484
|
};
|
|
485
|
-
Object.assign(
|
|
485
|
+
Object.assign(hi.prototype, z);
|
|
486
486
|
window.MODALS || (window.MODALS = {});
|
|
487
487
|
const { MODALS: P } = window, Rs = (n) => {
|
|
488
488
|
const { TEMPLATE: i } = j, { childDom: t } = n, e = document.createElement("div");
|
|
@@ -492,15 +492,15 @@ const { MODALS: P } = window, Rs = (n) => {
|
|
|
492
492
|
s.append(o);
|
|
493
493
|
}), e.children[0];
|
|
494
494
|
};
|
|
495
|
-
var
|
|
495
|
+
var St, vi, Lt, bi, _t, yi, Dt, wi, kt, Ti;
|
|
496
496
|
class fi extends HTMLElement {
|
|
497
497
|
constructor() {
|
|
498
498
|
super();
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
499
|
+
p(this, St);
|
|
500
|
+
p(this, Lt);
|
|
501
|
+
p(this, _t);
|
|
502
|
+
p(this, Dt);
|
|
503
|
+
p(this, kt);
|
|
504
504
|
this.initialize = !1;
|
|
505
505
|
}
|
|
506
506
|
static get observedAttributes() {
|
|
@@ -514,7 +514,7 @@ class fi extends HTMLElement {
|
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
connectedCallback() {
|
|
517
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
517
|
+
this.initialize || (this.initialize = !0, d(this, St, vi).call(this));
|
|
518
518
|
}
|
|
519
519
|
open() {
|
|
520
520
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -526,12 +526,12 @@ class fi extends HTMLElement {
|
|
|
526
526
|
return this.setAttribute(":state", "destroy"), this;
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
St = new WeakSet(), vi = function() {
|
|
530
530
|
const { ATTRS: t } = j;
|
|
531
531
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
532
532
|
const e = this.getAttribute(t.id) || zs();
|
|
533
|
-
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this,
|
|
534
|
-
},
|
|
533
|
+
this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this, Lt, bi).call(this);
|
|
534
|
+
}, Lt = new WeakSet(), bi = function() {
|
|
535
535
|
this.childDom = this.childNodes, this.template = Rs(this), this.innerHTML = "", this.append(this.template), d(this, _t, yi).call(this);
|
|
536
536
|
}, _t = new WeakSet(), yi = function() {
|
|
537
537
|
const t = this.querySelector(".modal-scroller");
|
|
@@ -598,8 +598,8 @@ const { MODALS: Ze } = window, ft = {}, Ei = (n, i, ...t) => {
|
|
|
598
598
|
n && G(n) && n.apply(V, i);
|
|
599
599
|
}, ti = (n, i) => {
|
|
600
600
|
const { target: t } = n, e = Ze[t] || _(n.target);
|
|
601
|
-
e &&
|
|
602
|
-
},
|
|
601
|
+
e && Si(n, i), e || Xs(n, i);
|
|
602
|
+
}, Si = (n, i) => {
|
|
603
603
|
const { target: t, action: e, on: s, e: o } = n, a = Ze[t] || _(n.target);
|
|
604
604
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
605
605
|
a.once(l, () => {
|
|
@@ -632,22 +632,22 @@ const { MODALS: Ze } = window, ft = {}, Ei = (n, i, ...t) => {
|
|
|
632
632
|
[...c].forEach((g) => {
|
|
633
633
|
u.append(g);
|
|
634
634
|
});
|
|
635
|
-
const
|
|
636
|
-
r("complete",
|
|
635
|
+
const h = Ze[t] || _(n.target);
|
|
636
|
+
r("complete", h), Si(n, i), delete ft[t];
|
|
637
637
|
}).catch((l) => {
|
|
638
638
|
r("error", l), delete ft[t];
|
|
639
639
|
}));
|
|
640
640
|
};
|
|
641
|
-
var et,
|
|
641
|
+
var et, Ie, xt, Li, $t, _i;
|
|
642
642
|
const B = class B {
|
|
643
643
|
constructor(i, t = {}) {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
p(this, et);
|
|
645
|
+
p(this, xt);
|
|
646
|
+
p(this, $t);
|
|
647
647
|
this.__storage__ = {
|
|
648
648
|
el: i,
|
|
649
649
|
options: t
|
|
650
|
-
}, this.active = "data-modal-active", d(this, et,
|
|
650
|
+
}, this.active = "data-modal-active", d(this, et, Ie).call(this);
|
|
651
651
|
}
|
|
652
652
|
destroy() {
|
|
653
653
|
const { elements: i } = this;
|
|
@@ -657,7 +657,7 @@ const B = class B {
|
|
|
657
657
|
}
|
|
658
658
|
update() {
|
|
659
659
|
var i;
|
|
660
|
-
return d(i = this.destroy(), et,
|
|
660
|
+
return d(i = this.destroy(), et, Ie).call(i), this.emit("update"), this;
|
|
661
661
|
}
|
|
662
662
|
/** static method 'open' */
|
|
663
663
|
static open(i) {
|
|
@@ -673,7 +673,7 @@ const B = class B {
|
|
|
673
673
|
Object.assign(B.prototype, B.prototype.__methods__);
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
|
-
et = new WeakSet(),
|
|
676
|
+
et = new WeakSet(), Ie = function() {
|
|
677
677
|
const { el: i, options: t } = this.__storage__;
|
|
678
678
|
if (!mt(i) || !A(i))
|
|
679
679
|
return;
|
|
@@ -681,8 +681,8 @@ et = new WeakSet(), Me = function() {
|
|
|
681
681
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
682
682
|
for (const [o, a] of Object.entries(this.options.on))
|
|
683
683
|
this.__events__[o] = [a];
|
|
684
|
-
d(this, xt,
|
|
685
|
-
}, xt = new WeakSet(),
|
|
684
|
+
d(this, xt, Li).call(this);
|
|
685
|
+
}, xt = new WeakSet(), Li = function() {
|
|
686
686
|
const { elements: i, options: t } = this;
|
|
687
687
|
i.forEach((e) => {
|
|
688
688
|
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, $t, _i), 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, "");
|
|
@@ -708,28 +708,28 @@ customElements.define("modern-modal", fi);
|
|
|
708
708
|
const Us = (n, i) => {
|
|
709
709
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
710
710
|
i.forEach((s) => {
|
|
711
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top:
|
|
712
|
-
if (
|
|
711
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: h, bottom: g } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
|
|
712
|
+
if (h - e <= m && g - e >= v && s.offsetParent)
|
|
713
713
|
setTimeout(() => {
|
|
714
714
|
s.classList.add(o);
|
|
715
715
|
}, a);
|
|
716
716
|
else {
|
|
717
|
-
const b = s.classList.contains(o) && c === "down" &&
|
|
717
|
+
const b = s.classList.contains(o) && c === "down" && h - e >= m || c === "up" && g - e <= v || c === !0;
|
|
718
718
|
setTimeout(() => {
|
|
719
719
|
b && s.classList.remove(o);
|
|
720
720
|
}, a);
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
723
|
}, Ys = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
724
|
-
var it,
|
|
724
|
+
var it, qe, Ct, ki;
|
|
725
725
|
class Di {
|
|
726
726
|
constructor(i, t = {}) {
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
p(this, it);
|
|
728
|
+
p(this, Ct);
|
|
729
729
|
this.__storage__ = {
|
|
730
730
|
el: i,
|
|
731
731
|
options: t
|
|
732
|
-
}, this.active = "data-aost-active", d(this, it,
|
|
732
|
+
}, this.active = "data-aost-active", d(this, it, qe).call(this);
|
|
733
733
|
}
|
|
734
734
|
destroy(i) {
|
|
735
735
|
const { elements: t, options: e } = this;
|
|
@@ -745,10 +745,10 @@ class Di {
|
|
|
745
745
|
}
|
|
746
746
|
update(i) {
|
|
747
747
|
var t;
|
|
748
|
-
d(t = this.destroy(i), it,
|
|
748
|
+
d(t = this.destroy(i), it, qe).call(t);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
it = new WeakSet(),
|
|
751
|
+
it = new WeakSet(), qe = function() {
|
|
752
752
|
const { el: i, options: t } = this.__storage__;
|
|
753
753
|
if (!mt(i) || !A(i))
|
|
754
754
|
return;
|
|
@@ -776,26 +776,26 @@ const Fs = (n) => {
|
|
|
776
776
|
s.append(o);
|
|
777
777
|
}), e.children[0];
|
|
778
778
|
};
|
|
779
|
-
var Ht, xi,
|
|
779
|
+
var Ht, xi, It, $i, qt, Ci, Mt, Hi, Ot, Ii, Pt, qi, Nt, Mi, jt, Oi, zt, Pi, Bt, Ni;
|
|
780
780
|
class Js extends HTMLElement {
|
|
781
781
|
constructor() {
|
|
782
782
|
super();
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
783
|
+
p(this, Ht);
|
|
784
|
+
p(this, It);
|
|
785
|
+
p(this, qt);
|
|
786
786
|
// youtube iframe
|
|
787
|
-
|
|
787
|
+
p(this, Mt);
|
|
788
788
|
// vimeo iframe
|
|
789
|
-
|
|
789
|
+
p(this, Ot);
|
|
790
790
|
// youku iframe
|
|
791
|
-
|
|
792
|
-
|
|
791
|
+
p(this, Pt);
|
|
792
|
+
p(this, Nt);
|
|
793
793
|
// 2025.02.11 新增 ig
|
|
794
|
-
|
|
794
|
+
p(this, jt);
|
|
795
795
|
// 2025.02.11 新增 tiktok
|
|
796
|
-
|
|
796
|
+
p(this, zt);
|
|
797
797
|
// 2026.01.15 新增 video
|
|
798
|
-
|
|
798
|
+
p(this, Bt);
|
|
799
799
|
d(this, Ht, xi).call(this);
|
|
800
800
|
}
|
|
801
801
|
play() {
|
|
@@ -838,10 +838,10 @@ Ht = new WeakSet(), xi = function() {
|
|
|
838
838
|
E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
841
|
-
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,
|
|
842
|
-
},
|
|
843
|
-
this.childDom = this.childNodes, this.template = Fs(this), this.innerHTML = "", this.append(this.template), d(this,
|
|
844
|
-
},
|
|
841
|
+
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, It, $i).call(this);
|
|
842
|
+
}, It = new WeakSet(), $i = function() {
|
|
843
|
+
this.childDom = this.childNodes, this.template = Fs(this), this.innerHTML = "", this.append(this.template), d(this, qt, Ci).call(this);
|
|
844
|
+
}, qt = new WeakSet(), Ci = function() {
|
|
845
845
|
const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = xe;
|
|
846
846
|
let o = "";
|
|
847
847
|
function a(r) {
|
|
@@ -851,18 +851,18 @@ Ht = new WeakSet(), xi = function() {
|
|
|
851
851
|
case "youtubeAPI":
|
|
852
852
|
break;
|
|
853
853
|
case "youtube":
|
|
854
|
-
document.body.wd_youtube == !1 ? a("video-player") : o = d(this,
|
|
854
|
+
document.body.wd_youtube == !1 ? a("video-player") : o = d(this, Mt, Hi).call(this);
|
|
855
855
|
break;
|
|
856
856
|
case "youkuAPI":
|
|
857
857
|
break;
|
|
858
858
|
case "youku":
|
|
859
|
-
document.body.wd_youku == !1 ? a("video-player") : o = d(this, Pt,
|
|
859
|
+
document.body.wd_youku == !1 ? a("video-player") : o = d(this, Pt, qi).call(this);
|
|
860
860
|
break;
|
|
861
861
|
case "vimeo":
|
|
862
|
-
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, Ot,
|
|
862
|
+
document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, Ot, Ii).call(this);
|
|
863
863
|
break;
|
|
864
864
|
case "bilibili":
|
|
865
|
-
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Nt,
|
|
865
|
+
document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Nt, Mi).call(this);
|
|
866
866
|
break;
|
|
867
867
|
case "instagram":
|
|
868
868
|
document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, jt, Oi).call(this);
|
|
@@ -876,17 +876,17 @@ Ht = new WeakSet(), xi = function() {
|
|
|
876
876
|
o = d(this, Bt, Ni).call(this);
|
|
877
877
|
break;
|
|
878
878
|
}
|
|
879
|
-
this.querySelector(".player-wrapper").insertAdjacentHTML(
|
|
880
|
-
},
|
|
879
|
+
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, o);
|
|
880
|
+
}, Mt = new WeakSet(), Hi = function() {
|
|
881
881
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
882
882
|
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>`;
|
|
883
|
-
}, Ot = new WeakSet(),
|
|
883
|
+
}, Ot = new WeakSet(), Ii = function() {
|
|
884
884
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
885
885
|
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>`;
|
|
886
|
-
}, Pt = new WeakSet(),
|
|
886
|
+
}, Pt = new WeakSet(), qi = function() {
|
|
887
887
|
const { videoId: t, autoplay: e } = this;
|
|
888
888
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
889
|
-
}, Nt = new WeakSet(),
|
|
889
|
+
}, Nt = new WeakSet(), Mi = function() {
|
|
890
890
|
const { videoId: t, autoplay: e } = this;
|
|
891
891
|
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>`;
|
|
892
892
|
}, jt = new WeakSet(), Oi = function() {
|
|
@@ -915,7 +915,7 @@ function Bi(n) {
|
|
|
915
915
|
const i = ji(n);
|
|
916
916
|
Ps(i), Q === 0 && document.documentElement.classList.remove("scrollLock");
|
|
917
917
|
}
|
|
918
|
-
async function
|
|
918
|
+
async function qn(n = 0) {
|
|
919
919
|
if (f(".loading-wrapper").length)
|
|
920
920
|
return;
|
|
921
921
|
f("body").append(`
|
|
@@ -932,16 +932,16 @@ async function In(n = 0) {
|
|
|
932
932
|
zi();
|
|
933
933
|
});
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function Mn() {
|
|
936
936
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
937
937
|
f(".loading-wrapper").remove(), Bi();
|
|
938
938
|
});
|
|
939
939
|
}
|
|
940
940
|
function On(n, i) {
|
|
941
|
-
new
|
|
941
|
+
new Sn(n, i);
|
|
942
942
|
}
|
|
943
943
|
function Zs() {
|
|
944
|
-
const n = document.querySelector("[data-aost]") && new Di("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new
|
|
944
|
+
const n = document.querySelector("[data-aost]") && new Di("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new hi("[data-anchor-target]"), t = new li({ callback_loaded: () => {
|
|
945
945
|
} }), e = new vn();
|
|
946
946
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
947
947
|
}
|
|
@@ -1045,8 +1045,8 @@ function Yn() {
|
|
|
1045
1045
|
function Fn(n, i, t, e, s) {
|
|
1046
1046
|
const o = this, r = f(n).html().split("<br>");
|
|
1047
1047
|
let l = "", c = 0;
|
|
1048
|
-
r.forEach((u,
|
|
1049
|
-
|
|
1048
|
+
r.forEach((u, h) => {
|
|
1049
|
+
h !== 0 && (l += "<br>"), u.split("").forEach((m, v) => {
|
|
1050
1050
|
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), m === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++), v === u.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++);
|
|
1051
1051
|
});
|
|
1052
1052
|
}), f(n).html(l);
|
|
@@ -1136,13 +1136,13 @@ var st, Oe, Wt, Wi, nt, Pe, ot, Ne, Gt, Gi, at, je, Rt, Ri;
|
|
|
1136
1136
|
const X = class X {
|
|
1137
1137
|
//*-* 給Article4用的 **//
|
|
1138
1138
|
constructor(i, t = {}) {
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1139
|
+
p(this, st);
|
|
1140
|
+
p(this, Wt);
|
|
1141
|
+
p(this, nt);
|
|
1142
|
+
p(this, ot);
|
|
1143
|
+
p(this, Gt);
|
|
1144
|
+
p(this, at);
|
|
1145
|
+
p(this, Rt);
|
|
1146
1146
|
if (!mt(i) && !$e(i) && !gt(i)) {
|
|
1147
1147
|
Ve("video4", `找不到該物件 -> ${i}`);
|
|
1148
1148
|
return;
|
|
@@ -1200,16 +1200,16 @@ st = new WeakSet(), Oe = function() {
|
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
1202
|
}, Gt = new WeakSet(), Gi = function(i) {
|
|
1203
|
-
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic:
|
|
1203
|
+
const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: h } = e;
|
|
1204
1204
|
if (l === "onBox" || l === "inBox") {
|
|
1205
1205
|
let g = null;
|
|
1206
1206
|
if (u === "on") {
|
|
1207
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1207
|
+
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>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1208
1208
|
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] || "";
|
|
1209
|
-
if (w ? m.insertAdjacentHTML(
|
|
1209
|
+
if (w ? m.insertAdjacentHTML(S.after, w) : E("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v)
|
|
1210
1210
|
d(this, ot, Ne).call(this, m, e);
|
|
1211
1211
|
else if (!v && r == "youtube")
|
|
1212
|
-
|
|
1212
|
+
h == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1213
1213
|
else if (!v && r == "vimeo")
|
|
1214
1214
|
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
1215
1215
|
else if (!v && r === "video") {
|
|
@@ -1232,11 +1232,11 @@ st = new WeakSet(), Oe = function() {
|
|
|
1232
1232
|
} else if (l === "onPage") {
|
|
1233
1233
|
let g = null;
|
|
1234
1234
|
if (u == "on") {
|
|
1235
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(
|
|
1235
|
+
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>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1236
1236
|
const m = s.querySelector("img");
|
|
1237
|
-
m.insertAdjacentHTML(
|
|
1237
|
+
m.insertAdjacentHTML(S.after, t[o]);
|
|
1238
1238
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
1239
|
-
v ? !v && r == "youtube" ?
|
|
1239
|
+
v ? !v && r == "youtube" ? h == "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) => {
|
|
1240
1240
|
const b = w.thumbnail_url;
|
|
1241
1241
|
m.setAttribute("src", `${b}`);
|
|
1242
1242
|
}).catch(function(w) {
|
|
@@ -1257,7 +1257,7 @@ st = new WeakSet(), Oe = function() {
|
|
|
1257
1257
|
videoId: l,
|
|
1258
1258
|
videoTargetRoute: c,
|
|
1259
1259
|
videoType: u,
|
|
1260
|
-
videoIgHtml:
|
|
1260
|
+
videoIgHtml: h,
|
|
1261
1261
|
videoInboxImg: g,
|
|
1262
1262
|
videoButton: m,
|
|
1263
1263
|
videoLayoutNo: v,
|
|
@@ -1274,13 +1274,13 @@ st = new WeakSet(), Oe = function() {
|
|
|
1274
1274
|
route: c + `?${T.toString()}`,
|
|
1275
1275
|
on: {
|
|
1276
1276
|
complete(y) {
|
|
1277
|
-
var
|
|
1278
|
-
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (
|
|
1277
|
+
var L, O;
|
|
1278
|
+
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (L = window.instgrm) != null && L.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ii(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", vt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${u}`), u == "instagram" && ((O = window.instgrm) != null && O.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ii(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
|
|
1279
1279
|
},
|
|
1280
1280
|
open(y) {
|
|
1281
1281
|
var O;
|
|
1282
|
-
const
|
|
1283
|
-
if (b.update(), zi([...
|
|
1282
|
+
const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1283
|
+
if (b.update(), zi([...L]), u == "instagram") {
|
|
1284
1284
|
const k = document.querySelector("[video-template] .modal-content");
|
|
1285
1285
|
new ResizeObserver((J) => {
|
|
1286
1286
|
J[0].contentRect.height > 50 && k.classList.add("active");
|
|
@@ -1315,7 +1315,7 @@ st = new WeakSet(), Oe = function() {
|
|
|
1315
1315
|
/>
|
|
1316
1316
|
<img src="${J || ""}" alt="" />
|
|
1317
1317
|
</picture>
|
|
1318
|
-
</div>`, F.insertAdjacentHTML(
|
|
1318
|
+
</div>`, F.insertAdjacentHTML(S.prepend, k);
|
|
1319
1319
|
const Qe = y.querySelectorAll("[video-target]");
|
|
1320
1320
|
Qe.length > 0 && new X(Qe, {
|
|
1321
1321
|
LAYOUT: t.params.LAYOUT,
|
|
@@ -1326,8 +1326,8 @@ st = new WeakSet(), Oe = function() {
|
|
|
1326
1326
|
e == null || e.emit("openModal");
|
|
1327
1327
|
},
|
|
1328
1328
|
close(y) {
|
|
1329
|
-
const
|
|
1330
|
-
Bi([...
|
|
1329
|
+
const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1330
|
+
Bi([...L]), e == null || e.emit("closeModal");
|
|
1331
1331
|
},
|
|
1332
1332
|
destroy(y) {
|
|
1333
1333
|
}
|
|
@@ -1365,8 +1365,8 @@ st = new WeakSet(), Oe = function() {
|
|
|
1365
1365
|
LAYOUT: t.LAYOUT || []
|
|
1366
1366
|
};
|
|
1367
1367
|
}, Ke(X, "globalOptions", {});
|
|
1368
|
-
let
|
|
1369
|
-
Object.assign(
|
|
1368
|
+
let Me = X;
|
|
1369
|
+
Object.assign(Me.prototype, z);
|
|
1370
1370
|
customElements.define("video-player", Js);
|
|
1371
1371
|
const Vs = {
|
|
1372
1372
|
"zh-tw": {
|
|
@@ -2209,8 +2209,8 @@ const tn = (n) => {
|
|
|
2209
2209
|
);
|
|
2210
2210
|
const l = e.querySelector(".dropdown-list");
|
|
2211
2211
|
return [...t].forEach((c) => {
|
|
2212
|
-
c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((
|
|
2213
|
-
(!
|
|
2212
|
+
c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((h) => {
|
|
2213
|
+
(!h.hasAttribute("data-option") || h.getAttribute("data-option").trim() === "") && h.setAttribute("data-option", h.textContent.trim());
|
|
2214
2214
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2215
2215
|
}), e.children[0];
|
|
2216
2216
|
}, en = (n) => {
|
|
@@ -2218,9 +2218,9 @@ const tn = (n) => {
|
|
|
2218
2218
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2219
2219
|
i && i.forEach((e) => {
|
|
2220
2220
|
const s = document.querySelector(e);
|
|
2221
|
-
s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi &&
|
|
2221
|
+
s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && q(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2222
2222
|
});
|
|
2223
|
-
},
|
|
2223
|
+
}, q = (n, i) => {
|
|
2224
2224
|
const t = n.getAttribute("d4-placeholder"), e = n.s.dropdownEl.querySelectorAll(".dropdown-list li");
|
|
2225
2225
|
if (i < 0 || i.length === 0) {
|
|
2226
2226
|
switch (e.forEach((s) => {
|
|
@@ -2261,7 +2261,7 @@ const tn = (n) => {
|
|
|
2261
2261
|
const o = n.s.dropdownEl.querySelectorAll(".dropdown-list li.active");
|
|
2262
2262
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
|
2263
2263
|
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>`;
|
|
2264
|
-
n.s.selectDisplayEl.insertAdjacentHTML(
|
|
2264
|
+
n.s.selectDisplayEl.insertAdjacentHTML(S.append, u);
|
|
2265
2265
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
|
2266
2266
|
index: [...e].indexOf(r),
|
|
2267
2267
|
id: r.getAttribute("data-option"),
|
|
@@ -2304,12 +2304,12 @@ var Xt, Ui, Ut, Yi, rt, Be, Yt, Fi, Ft, Ji;
|
|
|
2304
2304
|
class Xi extends HTMLElement {
|
|
2305
2305
|
constructor() {
|
|
2306
2306
|
super();
|
|
2307
|
-
|
|
2308
|
-
|
|
2307
|
+
p(this, Xt);
|
|
2308
|
+
p(this, Ut);
|
|
2309
2309
|
// -** 獨立 dropdown 出 body 更新
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2310
|
+
p(this, rt);
|
|
2311
|
+
p(this, Yt);
|
|
2312
|
+
p(this, Ft);
|
|
2313
2313
|
this.initialize = !1;
|
|
2314
2314
|
}
|
|
2315
2315
|
static get observedAttributes() {
|
|
@@ -2330,26 +2330,26 @@ class Xi extends HTMLElement {
|
|
|
2330
2330
|
switch (o.hasAttribute("multiple") ? "multiple" : "single") {
|
|
2331
2331
|
case "single":
|
|
2332
2332
|
const r = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${s}"]`);
|
|
2333
|
-
A(r) ?
|
|
2333
|
+
A(r) ? q(o, [...o.s.allLi].indexOf(r)) : q(o, -1);
|
|
2334
2334
|
break;
|
|
2335
2335
|
case "multiple":
|
|
2336
2336
|
const l = [];
|
|
2337
2337
|
o.s.dropdownEl.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
|
|
2338
|
-
const
|
|
2339
|
-
A(
|
|
2338
|
+
const h = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${u}"]`);
|
|
2339
|
+
A(h) && (h.classList.add("active"), l.push(h));
|
|
2340
2340
|
});
|
|
2341
2341
|
const c = l.map((u) => [...o.s.allLi].indexOf(u));
|
|
2342
|
-
|
|
2342
|
+
q(o, c);
|
|
2343
2343
|
break;
|
|
2344
2344
|
}
|
|
2345
2345
|
else
|
|
2346
|
-
|
|
2346
|
+
q(o, -1);
|
|
2347
2347
|
o.emit("change");
|
|
2348
2348
|
break;
|
|
2349
2349
|
case "d4-placeholder":
|
|
2350
2350
|
if (e === null)
|
|
2351
2351
|
return;
|
|
2352
|
-
e !== s && o.s.value.index < 0 &&
|
|
2352
|
+
e !== s && o.s.value.index < 0 && q(o, o.s.value.index);
|
|
2353
2353
|
break;
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
@@ -2372,12 +2372,22 @@ class Xi extends HTMLElement {
|
|
|
2372
2372
|
return t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e;
|
|
2373
2373
|
return e;
|
|
2374
2374
|
};
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2375
|
+
t.s.subDropdownTotalH = 0;
|
|
2376
|
+
const a = t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.querySelector(".dropdown-scroller") : t.querySelector(".dropdown-scroller"), r = parseInt(getComputedStyle(a).maxHeight);
|
|
2377
|
+
t.s.dropdownEl.querySelectorAll('.has-sublayer[data-open="true"]').forEach((c) => {
|
|
2378
|
+
const u = c.querySelector(".sub-dropdown"), h = u.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(h).marginTop) + parseInt(getComputedStyle(h).marginBottom);
|
|
2379
|
+
u.style.cssText = `--height: ${h.offsetHeight + g}px`, t.s.subDropdownTotalH += parseInt(u.style.cssText.replace("--height:", "").trim()), c.classList.add("open");
|
|
2380
|
+
});
|
|
2381
|
+
const l = () => {
|
|
2382
|
+
const c = o() + t.s.subDropdownTotalH;
|
|
2383
|
+
return c > r ? r : c;
|
|
2384
|
+
};
|
|
2385
|
+
return t.getAttribute("d4-portal") !== "true" && ze(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${l()}px`), t.s.dropdownEl.style.zIndex = "9999", d(this, rt, Be).call(this), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${l()}px`, t.__events__._scrollUpdate = () => {
|
|
2386
|
+
var u;
|
|
2387
|
+
const c = t.getBoundingClientRect();
|
|
2388
|
+
c.bottom < 0 || c.top > window.innerHeight ? t.close() : d(u = t, rt, Be).call(u);
|
|
2389
|
+
}, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${l()}px;`, t.s.dropdownEl.style.cssText = `
|
|
2390
|
+
height: ${l()}px;
|
|
2381
2391
|
z-index: 2;
|
|
2382
2392
|
`), this;
|
|
2383
2393
|
}
|
|
@@ -2452,7 +2462,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2452
2462
|
};
|
|
2453
2463
|
break;
|
|
2454
2464
|
}
|
|
2455
|
-
|
|
2465
|
+
q(t, t.s.value.index), d(s = t, Ft, Ji).call(s), t.classList.add("d4-initialize");
|
|
2456
2466
|
}, Ft = new WeakSet(), Ji = function() {
|
|
2457
2467
|
const t = this;
|
|
2458
2468
|
t.__events__.dropdownToggle = () => {
|
|
@@ -2476,7 +2486,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2476
2486
|
if (t.__scroller__) {
|
|
2477
2487
|
const { viewport: c } = t.__scroller__.elements();
|
|
2478
2488
|
if (A(t.s.activeLi)) {
|
|
2479
|
-
const u = t.s.activeLi.clientHeight / 2,
|
|
2489
|
+
const u = t.s.activeLi.clientHeight / 2, h = t.s.activeLi.offsetTop, g = h - r.clientHeight / 2 + u > 0 ? h - r.clientHeight / 2 + u : 0;
|
|
2480
2490
|
c.scrollTo({
|
|
2481
2491
|
top: g,
|
|
2482
2492
|
behavior: "smooth"
|
|
@@ -2488,7 +2498,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2488
2498
|
});
|
|
2489
2499
|
}
|
|
2490
2500
|
};
|
|
2491
|
-
a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
|
|
2501
|
+
t.s.subDropdownTotalH > 0 && t.__scroller__ && t.__scroller__.update(!0), a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
|
|
2492
2502
|
break;
|
|
2493
2503
|
case "close":
|
|
2494
2504
|
t.getAttribute("d4-portal") == "true" ? (t.__scroller__ && t.__scroller__.update(!0), t.s.dropdownEl.style.height = "", t.s.dropdownEl.style.zIndex = "", a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !0), t.s.dropdownEl.parentNode === document.body && document.body.removeChild(t.s.dropdownEl)) : (t.__scroller__.update(!0), t.s.dropdownEl.removeAttribute("style"), a && (t.querySelector(".filter-bar input").disabled = !0));
|
|
@@ -2510,7 +2520,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2510
2520
|
e.s.allLi = e.s.dropdownEl.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
|
2511
2521
|
l.addEventListener("click", function(c) {
|
|
2512
2522
|
var m;
|
|
2513
|
-
const u = this,
|
|
2523
|
+
const u = this, h = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
|
|
2514
2524
|
if (u.classList.contains("has-sublayer")) {
|
|
2515
2525
|
c.stopPropagation();
|
|
2516
2526
|
const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
|
|
@@ -2519,16 +2529,16 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2519
2529
|
s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.getAttribute("d4-portal") == "true" ? e.s.dropdownEl.style.setProperty("--maxHeight", `${o}px`) : e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
|
2520
2530
|
};
|
|
2521
2531
|
u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
|
|
2522
|
-
const
|
|
2523
|
-
e.__scroller__.update(!0), v.removeEventListener("transitionend",
|
|
2532
|
+
const L = () => {
|
|
2533
|
+
e.__scroller__.update(!0), v.removeEventListener("transitionend", L);
|
|
2524
2534
|
};
|
|
2525
|
-
v.addEventListener("transitionend",
|
|
2535
|
+
v.addEventListener("transitionend", L);
|
|
2526
2536
|
} else
|
|
2527
2537
|
switch (en(e), e.s.selectType) {
|
|
2528
2538
|
case "single":
|
|
2529
2539
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2530
2540
|
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
2531
|
-
b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "",
|
|
2541
|
+
b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "", q(b, -1), K[v][w].forEach((T, C) => {
|
|
2532
2542
|
const y = document.createElement("li");
|
|
2533
2543
|
y.textContent = T[0], y.setAttribute("data-option", T[0]), e.getAttribute("d4-portal") == "true" ? b.s.dropdownEl.querySelector(".dropdown-list").append(y) : b.querySelector(".dropdown-list").append(y);
|
|
2534
2544
|
}), e.__events__.selectOption(b));
|
|
@@ -2536,7 +2546,7 @@ Xt = new WeakSet(), Ui = function() {
|
|
|
2536
2546
|
(e.getAttribute("d4-portal") == "true" || (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer")) && (c.stopPropagation(), e.close());
|
|
2537
2547
|
break;
|
|
2538
2548
|
case "multiple":
|
|
2539
|
-
c.stopPropagation(), u.classList.toggle("active"),
|
|
2549
|
+
c.stopPropagation(), u.classList.toggle("active"), q(e, h);
|
|
2540
2550
|
break;
|
|
2541
2551
|
}
|
|
2542
2552
|
});
|
|
@@ -2673,10 +2683,10 @@ var Jt, Zi, Zt, Qi, Qt, Ki, Kt, Vi;
|
|
|
2673
2683
|
class ln extends HTMLElement {
|
|
2674
2684
|
constructor() {
|
|
2675
2685
|
super();
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2686
|
+
p(this, Jt);
|
|
2687
|
+
p(this, Zt);
|
|
2688
|
+
p(this, Qt);
|
|
2689
|
+
p(this, Kt);
|
|
2680
2690
|
this.initialize = !1;
|
|
2681
2691
|
}
|
|
2682
2692
|
static get observedAttributes() {
|
|
@@ -2696,20 +2706,20 @@ class ln extends HTMLElement {
|
|
|
2696
2706
|
}
|
|
2697
2707
|
Jt = new WeakSet(), Zi = function() {
|
|
2698
2708
|
const t = {
|
|
2699
|
-
direction: this.getAttribute("direction") ||
|
|
2709
|
+
direction: this.getAttribute("direction") || I.SETTINGS.direction,
|
|
2700
2710
|
// up / down / left / right
|
|
2701
|
-
behavior: this.getAttribute("behavior") ||
|
|
2711
|
+
behavior: this.getAttribute("behavior") || I.SETTINGS.behavior,
|
|
2702
2712
|
// normal / alternate / endStop
|
|
2703
|
-
duration: Number(this.getAttribute("duration")) ||
|
|
2713
|
+
duration: Number(this.getAttribute("duration")) || I.SETTINGS.duration,
|
|
2704
2714
|
// ms
|
|
2705
|
-
durationBreakpoints: yt(this) ||
|
|
2706
|
-
autoplay: this.getAttribute("autoplay") ||
|
|
2715
|
+
durationBreakpoints: yt(this) || I.SETTINGS.durationBreakpoints,
|
|
2716
|
+
autoplay: this.getAttribute("autoplay") || I.SETTINGS.autoplay,
|
|
2707
2717
|
// normal / alternate / endStop
|
|
2708
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
|
2718
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : I.SETTINGS.pauseOnMouseenter,
|
|
2709
2719
|
// true / false
|
|
2710
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
|
2720
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : I.SETTINGS.continual,
|
|
2711
2721
|
// true / false
|
|
2712
|
-
gap: Number(this.getAttribute("gap")) ||
|
|
2722
|
+
gap: Number(this.getAttribute("gap")) || I.SETTINGS.gap
|
|
2713
2723
|
};
|
|
2714
2724
|
this.s = {}, this.s.options = t, this.s.nowDuration = si(this), an(this), d(this, Zt, Qi).call(this);
|
|
2715
2725
|
}, Zt = new WeakSet(), Qi = function() {
|
|
@@ -2745,20 +2755,20 @@ Jt = new WeakSet(), Zi = function() {
|
|
|
2745
2755
|
let v = [];
|
|
2746
2756
|
switch (e) {
|
|
2747
2757
|
case "top":
|
|
2748
|
-
|
|
2758
|
+
h = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (h * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
|
2749
2759
|
break;
|
|
2750
2760
|
case "right":
|
|
2751
|
-
|
|
2761
|
+
h = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (h * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
2752
2762
|
break;
|
|
2753
2763
|
case "bottom":
|
|
2754
|
-
|
|
2764
|
+
h = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (h * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
|
2755
2765
|
break;
|
|
2756
2766
|
case "left":
|
|
2757
|
-
|
|
2767
|
+
h = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (h * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
|
2758
2768
|
break;
|
|
2759
2769
|
}
|
|
2760
2770
|
return v;
|
|
2761
|
-
},
|
|
2771
|
+
}, h, g;
|
|
2762
2772
|
(t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${m()[0].transform}`, t.s.animateEl.animate(m(), {
|
|
2763
2773
|
duration: g,
|
|
2764
2774
|
fill: "forwards"
|
|
@@ -2832,17 +2842,17 @@ var Vt, ts, te, es, ee, is, lt, We, U, wt, ie, ss;
|
|
|
2832
2842
|
class oi {
|
|
2833
2843
|
constructor(i) {
|
|
2834
2844
|
// 初始化
|
|
2835
|
-
|
|
2845
|
+
p(this, Vt);
|
|
2836
2846
|
// 左右箭頭事件綁定
|
|
2837
|
-
|
|
2847
|
+
p(this, te);
|
|
2838
2848
|
// 左右拖拉事件綁定
|
|
2839
|
-
|
|
2849
|
+
p(this, ee);
|
|
2840
2850
|
// 卷軸位置判斷
|
|
2841
|
-
|
|
2851
|
+
p(this, lt);
|
|
2842
2852
|
// 隱藏按鈕判斷
|
|
2843
|
-
|
|
2853
|
+
p(this, U);
|
|
2844
2854
|
// 選項事件綁定
|
|
2845
|
-
|
|
2855
|
+
p(this, ie);
|
|
2846
2856
|
this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Vt, ts).call(this);
|
|
2847
2857
|
}
|
|
2848
2858
|
// 更新 active 位置
|
|
@@ -2877,7 +2887,7 @@ Vt = new WeakSet(), ts = function() {
|
|
|
2877
2887
|
}), t = !0);
|
|
2878
2888
|
};
|
|
2879
2889
|
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, ee, is).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2880
|
-
|
|
2890
|
+
S.prepend,
|
|
2881
2891
|
`<div class="navigation">
|
|
2882
2892
|
<div class="button prev">
|
|
2883
2893
|
<div></div>
|
|
@@ -2906,32 +2916,32 @@ Vt = new WeakSet(), ts = function() {
|
|
|
2906
2916
|
}, ee = new WeakSet(), is = function() {
|
|
2907
2917
|
const { $wrapper: i } = this;
|
|
2908
2918
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2909
|
-
const a = function(
|
|
2910
|
-
|
|
2919
|
+
const a = function(h) {
|
|
2920
|
+
h.preventDefault(), e = !1, t = !0, s = h.pageX - i.offsetLeft, o = i.scrollLeft;
|
|
2911
2921
|
};
|
|
2912
2922
|
i.removeEventListener("mousedown", a), i.addEventListener("mousedown", a);
|
|
2913
2923
|
const r = function() {
|
|
2914
2924
|
e = !1, t = !1;
|
|
2915
2925
|
};
|
|
2916
2926
|
i.removeEventListener("mouseleave", r), i.addEventListener("mouseleave", r);
|
|
2917
|
-
const l = function(
|
|
2918
|
-
|
|
2927
|
+
const l = function(h) {
|
|
2928
|
+
h.preventDefault(), t = !1;
|
|
2919
2929
|
};
|
|
2920
2930
|
i.removeEventListener("mouseup", l), i.addEventListener("mouseup", l);
|
|
2921
|
-
const c = function(
|
|
2922
|
-
if (
|
|
2931
|
+
const c = function(h) {
|
|
2932
|
+
if (h.preventDefault(), e = !0, !t)
|
|
2923
2933
|
return;
|
|
2924
|
-
const m =
|
|
2934
|
+
const m = h.pageX - i.offsetLeft - s;
|
|
2925
2935
|
i.scrollTo({
|
|
2926
2936
|
left: o - m
|
|
2927
2937
|
});
|
|
2928
2938
|
};
|
|
2929
2939
|
i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
|
|
2930
|
-
const u = function(
|
|
2931
|
-
e && (
|
|
2940
|
+
const u = function(h) {
|
|
2941
|
+
e && (h.preventDefault(), h.stopPropagation());
|
|
2932
2942
|
};
|
|
2933
|
-
i.querySelectorAll("a").forEach((
|
|
2934
|
-
|
|
2943
|
+
i.querySelectorAll("a").forEach((h) => {
|
|
2944
|
+
h.removeEventListener("click", u), h.addEventListener("click", u);
|
|
2935
2945
|
});
|
|
2936
2946
|
}, lt = new WeakSet(), We = function() {
|
|
2937
2947
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
@@ -2976,13 +2986,13 @@ var se, ns, ne, os, oe, as, ae, rs;
|
|
|
2976
2986
|
class cn {
|
|
2977
2987
|
constructor(i) {
|
|
2978
2988
|
// 初始化
|
|
2979
|
-
|
|
2989
|
+
p(this, se);
|
|
2980
2990
|
// 隱藏按鈕判斷
|
|
2981
|
-
|
|
2991
|
+
p(this, ne);
|
|
2982
2992
|
// 展開箭頭事件綁定
|
|
2983
|
-
|
|
2993
|
+
p(this, oe);
|
|
2984
2994
|
// 選項事件綁定
|
|
2985
|
-
|
|
2995
|
+
p(this, ae);
|
|
2986
2996
|
this.$element = i, this.option = i.s.option.collapse, d(this, se, ns).call(this);
|
|
2987
2997
|
}
|
|
2988
2998
|
}
|
|
@@ -2990,7 +3000,7 @@ se = new WeakSet(), ns = function() {
|
|
|
2990
3000
|
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, ne, os).call(this) && d(this, oe, as).call(this), d(this, ae, rs).call(this));
|
|
2991
3001
|
}, ne = new WeakSet(), os = function() {
|
|
2992
3002
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2993
|
-
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(
|
|
3003
|
+
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), $(this.$element, "noScrollable"), !0) : (x(this.$element, "noScrollable"), !1);
|
|
2994
3004
|
}, oe = new WeakSet(), as = function() {
|
|
2995
3005
|
const { $element: i, $button: t } = this, e = function() {
|
|
2996
3006
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
@@ -3012,18 +3022,18 @@ se = new WeakSet(), ns = function() {
|
|
|
3012
3022
|
};
|
|
3013
3023
|
const dn = (n) => {
|
|
3014
3024
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
3015
|
-
return i == "drag" && (s.innerHTML =
|
|
3025
|
+
return i == "drag" && (s.innerHTML = M.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = M.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 = M.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
|
|
3016
3026
|
};
|
|
3017
3027
|
var re, ls, le, cs, ct, Ge, Y, Tt;
|
|
3018
3028
|
class un extends HTMLElement {
|
|
3019
3029
|
constructor() {
|
|
3020
3030
|
super();
|
|
3021
|
-
|
|
3022
|
-
|
|
3031
|
+
p(this, re);
|
|
3032
|
+
p(this, le);
|
|
3023
3033
|
// 斷點設定
|
|
3024
|
-
|
|
3034
|
+
p(this, ct);
|
|
3025
3035
|
// check type
|
|
3026
|
-
|
|
3036
|
+
p(this, Y);
|
|
3027
3037
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
3028
3038
|
}
|
|
3029
3039
|
static get observedAttributes() {
|
|
@@ -3060,7 +3070,7 @@ class un extends HTMLElement {
|
|
|
3060
3070
|
}
|
|
3061
3071
|
re = new WeakSet(), ls = function() {
|
|
3062
3072
|
let t = {};
|
|
3063
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
|
3073
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? M.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
3064
3074
|
const e = (s) => {
|
|
3065
3075
|
if (s.type === "resize") {
|
|
3066
3076
|
if (window.innerWidth === this.previousWidth)
|
|
@@ -3069,7 +3079,7 @@ re = new WeakSet(), ls = function() {
|
|
|
3069
3079
|
}
|
|
3070
3080
|
this.update();
|
|
3071
3081
|
};
|
|
3072
|
-
window.removeEventListener("resize", ni(e)), window.addEventListener("resize", ni(e)), this.s.option = {}, this.s.option.drag = Object.assign({},
|
|
3082
|
+
window.removeEventListener("resize", ni(e)), window.addEventListener("resize", ni(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, M.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, M.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, M.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, M.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, le, cs).call(this);
|
|
3073
3083
|
}, le = new WeakSet(), cs = function() {
|
|
3074
3084
|
this.classList.add("m4-init"), d(this, ct, Ge).call(this);
|
|
3075
3085
|
}, ct = new WeakSet(), Ge = function() {
|
|
@@ -3100,50 +3110,50 @@ re = new WeakSet(), ls = function() {
|
|
|
3100
3110
|
(o = this.drag) == null || o.update();
|
|
3101
3111
|
};
|
|
3102
3112
|
customElements.define("multipurpose-nav", un);
|
|
3103
|
-
var ce, us, de,
|
|
3113
|
+
var ce, us, de, ps, dt, Re, W, Z, ue, hs, pe, ms, he, gs, me, fs, ge, vs, fe, bs, ve, ys, be, ws, ye, Ts, N, R, we, Es, Te, As, Ee, Ss, Ae, Ls;
|
|
3104
3114
|
class ds extends HTMLElement {
|
|
3105
3115
|
// 定義組件的初始狀態
|
|
3106
3116
|
constructor(t, e) {
|
|
3107
3117
|
super();
|
|
3108
|
-
|
|
3109
|
-
|
|
3118
|
+
p(this, ce);
|
|
3119
|
+
p(this, de);
|
|
3110
3120
|
// 第一關 判斷數量以及id設定
|
|
3111
|
-
|
|
3121
|
+
p(this, dt);
|
|
3112
3122
|
// 第二關 id命名提醒
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3123
|
+
p(this, W);
|
|
3124
|
+
p(this, ue);
|
|
3125
|
+
p(this, pe);
|
|
3126
|
+
p(this, he);
|
|
3117
3127
|
// 執行函式
|
|
3118
3128
|
// 移動至指定位置
|
|
3119
|
-
|
|
3129
|
+
p(this, me);
|
|
3120
3130
|
// 移動
|
|
3121
|
-
|
|
3131
|
+
p(this, ge);
|
|
3122
3132
|
// 步驟狀態
|
|
3123
|
-
|
|
3133
|
+
p(this, fe);
|
|
3124
3134
|
// next 按鈕狀態
|
|
3125
|
-
|
|
3135
|
+
p(this, ve);
|
|
3126
3136
|
// prev 按鈕狀態
|
|
3127
|
-
|
|
3137
|
+
p(this, be);
|
|
3128
3138
|
// 頁籤狀態
|
|
3129
|
-
|
|
3139
|
+
p(this, ye);
|
|
3130
3140
|
// 第三關各種元件判斷 及 執行
|
|
3131
|
-
|
|
3141
|
+
p(this, N);
|
|
3132
3142
|
// 消失動畫
|
|
3133
|
-
|
|
3143
|
+
p(this, we);
|
|
3134
3144
|
// 出現動畫
|
|
3135
|
-
|
|
3145
|
+
p(this, Te);
|
|
3136
3146
|
// 狀態
|
|
3137
|
-
|
|
3147
|
+
p(this, Ee);
|
|
3138
3148
|
// resize
|
|
3139
|
-
|
|
3149
|
+
p(this, Ae);
|
|
3140
3150
|
}
|
|
3141
3151
|
// 當組件的屬性被更改時會被呼叫
|
|
3142
3152
|
static get observedAttributes() {
|
|
3143
3153
|
return ["t4-active"];
|
|
3144
3154
|
}
|
|
3145
3155
|
attributeChangedCallback(t, e, s) {
|
|
3146
|
-
t === "t4-active" && e !== s && d(this, Ee,
|
|
3156
|
+
t === "t4-active" && e !== s && d(this, Ee, Ss).call(this, s);
|
|
3147
3157
|
}
|
|
3148
3158
|
connectedCallback() {
|
|
3149
3159
|
this.classList.contains("t4-initialize") || d(this, ce, us).call(this);
|
|
@@ -3200,13 +3210,13 @@ ce = new WeakSet(), us = function() {
|
|
|
3200
3210
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3201
3211
|
},
|
|
3202
3212
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3203
|
-
}, this.__events__ = {}, this.t.tabs = d(this, dt, Re).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, de,
|
|
3204
|
-
}, de = new WeakSet(),
|
|
3205
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ue,
|
|
3213
|
+
}, this.__events__ = {}, this.t.tabs = d(this, dt, Re).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, de, ps).call(this);
|
|
3214
|
+
}, de = new WeakSet(), ps = function() {
|
|
3215
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ue, hs).call(this), this.t.recordUrl) {
|
|
3206
3216
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3207
3217
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3208
3218
|
}
|
|
3209
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ae,
|
|
3219
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ae, Ls).call(this);
|
|
3210
3220
|
}, dt = new WeakSet(), Re = function() {
|
|
3211
3221
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3212
3222
|
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) => {
|
|
@@ -3217,19 +3227,19 @@ ce = new WeakSet(), us = function() {
|
|
|
3217
3227
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3218
3228
|
const o = s[0];
|
|
3219
3229
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3220
|
-
}, ue = new WeakSet(),
|
|
3230
|
+
}, ue = new WeakSet(), hs = function() {
|
|
3221
3231
|
const t = document.createElement("div");
|
|
3222
3232
|
t.classList.add("swiper-container");
|
|
3223
3233
|
const e = document.createElement("div");
|
|
3224
3234
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3225
3235
|
e.appendChild(s.cloneNode(!0));
|
|
3226
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3227
|
-
},
|
|
3236
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, pe, ms).call(this);
|
|
3237
|
+
}, pe = new WeakSet(), ms = function() {
|
|
3228
3238
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3229
3239
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3230
3240
|
const o = s.length * 100 + "%";
|
|
3231
3241
|
e.style.width = o;
|
|
3232
|
-
},
|
|
3242
|
+
}, he = new WeakSet(), gs = function(t) {
|
|
3233
3243
|
const { t: e } = this;
|
|
3234
3244
|
if (e.recordUrl === "true") {
|
|
3235
3245
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3279,7 +3289,7 @@ ce = new WeakSet(), us = function() {
|
|
|
3279
3289
|
d(this, ve, ys).call(this, e), d(this, be, ws).call(this, e);
|
|
3280
3290
|
break;
|
|
3281
3291
|
case "tabUrl":
|
|
3282
|
-
this.t.recordUrl === "true" && d(this,
|
|
3292
|
+
this.t.recordUrl === "true" && d(this, he, gs).call(this, e);
|
|
3283
3293
|
break;
|
|
3284
3294
|
default:
|
|
3285
3295
|
console.warn("請增加判斷,謝謝");
|
|
@@ -3320,26 +3330,26 @@ ce = new WeakSet(), us = function() {
|
|
|
3320
3330
|
break;
|
|
3321
3331
|
case "swiper":
|
|
3322
3332
|
a.style.opacity = "1";
|
|
3323
|
-
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth,
|
|
3324
|
-
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${
|
|
3333
|
+
const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth, h = -t * u;
|
|
3334
|
+
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${h}px)`;
|
|
3325
3335
|
break;
|
|
3326
3336
|
default:
|
|
3327
3337
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3328
3338
|
break;
|
|
3329
3339
|
}
|
|
3330
|
-
}, Ee = new WeakSet(),
|
|
3340
|
+
}, Ee = new WeakSet(), Ss = function(t) {
|
|
3331
3341
|
const e = d(this, W, Z).call(this, t);
|
|
3332
3342
|
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");
|
|
3333
|
-
}, Ae = new WeakSet(),
|
|
3343
|
+
}, Ae = new WeakSet(), Ls = function() {
|
|
3334
3344
|
const t = this;
|
|
3335
3345
|
window.addEventListener(
|
|
3336
3346
|
"resize",
|
|
3337
|
-
|
|
3347
|
+
pn(() => {
|
|
3338
3348
|
t.update();
|
|
3339
3349
|
}, 1e3)
|
|
3340
3350
|
);
|
|
3341
3351
|
};
|
|
3342
|
-
function
|
|
3352
|
+
function pn(n, i = 1e3) {
|
|
3343
3353
|
let t;
|
|
3344
3354
|
return function(e) {
|
|
3345
3355
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
@@ -3381,17 +3391,17 @@ customElements.define("tab-el", ds);
|
|
|
3381
3391
|
const ai = (n) => {
|
|
3382
3392
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3383
3393
|
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";
|
|
3384
|
-
},
|
|
3394
|
+
}, hn = (n) => {
|
|
3385
3395
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3386
3396
|
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";
|
|
3387
3397
|
};
|
|
3388
|
-
var ut, Xe,
|
|
3398
|
+
var ut, Xe, Se, Ds, Le, ks, pt, Ue;
|
|
3389
3399
|
class mn {
|
|
3390
3400
|
constructor(i, t = {}) {
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3401
|
+
p(this, ut);
|
|
3402
|
+
p(this, Se);
|
|
3403
|
+
p(this, Le);
|
|
3404
|
+
p(this, pt);
|
|
3395
3405
|
!mt(i) && !$e(i) && !gt(i) && !A(i) || (this.__storage__ = {
|
|
3396
3406
|
el: i,
|
|
3397
3407
|
options: t
|
|
@@ -3406,25 +3416,25 @@ ut = new WeakSet(), Xe = function() {
|
|
|
3406
3416
|
if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3407
3417
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3408
3418
|
this.__events__[o] = [a];
|
|
3409
|
-
d(this,
|
|
3410
|
-
},
|
|
3419
|
+
d(this, Se, Ds).call(this);
|
|
3420
|
+
}, Se = new WeakSet(), Ds = function() {
|
|
3411
3421
|
const { elements: i, options: t } = this;
|
|
3412
3422
|
i.forEach((e) => {
|
|
3413
|
-
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,
|
|
3423
|
+
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, Le, ks).call(this, e);
|
|
3414
3424
|
}), this.emit("init");
|
|
3415
|
-
},
|
|
3425
|
+
}, Le = new WeakSet(), ks = function(i) {
|
|
3416
3426
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3417
|
-
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,
|
|
3418
|
-
const
|
|
3427
|
+
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, pt, Ue)), c.addEventListener("click", d(this, pt, Ue)), r) {
|
|
3428
|
+
const h = (g) => {
|
|
3419
3429
|
g.stopPropagation();
|
|
3420
3430
|
};
|
|
3421
|
-
u.removeEventListener("click",
|
|
3431
|
+
u.removeEventListener("click", h), u.addEventListener("click", h);
|
|
3422
3432
|
}
|
|
3423
|
-
},
|
|
3433
|
+
}, pt = new WeakSet(), Ue = function() {
|
|
3424
3434
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3425
3435
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3426
3436
|
ai(l);
|
|
3427
|
-
}),
|
|
3437
|
+
}), hn(r)) : ai(r), i.emit("afterCollapse");
|
|
3428
3438
|
};
|
|
3429
3439
|
Object.assign(mn.prototype, z);
|
|
3430
3440
|
function gn(n, i) {
|
|
@@ -3440,26 +3450,26 @@ function xs() {
|
|
|
3440
3450
|
});
|
|
3441
3451
|
}
|
|
3442
3452
|
document.addEventListener("click", xs);
|
|
3443
|
-
var
|
|
3453
|
+
var ht, Ye, _e, $s, De, Cs, ke, Hs;
|
|
3444
3454
|
class fn extends HTMLElement {
|
|
3445
3455
|
constructor() {
|
|
3446
3456
|
super();
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3457
|
+
p(this, ht);
|
|
3458
|
+
p(this, _e);
|
|
3459
|
+
p(this, De);
|
|
3460
|
+
p(this, ke);
|
|
3451
3461
|
this.initialize = !1;
|
|
3452
3462
|
}
|
|
3453
3463
|
connectedCallback() {
|
|
3454
3464
|
const t = this;
|
|
3455
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this,
|
|
3465
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ht, Ye).call(this));
|
|
3456
3466
|
}
|
|
3457
3467
|
update() {
|
|
3458
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this,
|
|
3468
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ht, Ye).call(this);
|
|
3459
3469
|
}
|
|
3460
3470
|
}
|
|
3461
|
-
|
|
3462
|
-
const { SETTINGS: t } =
|
|
3471
|
+
ht = new WeakSet(), Ye = function() {
|
|
3472
|
+
const { SETTINGS: t } = pi;
|
|
3463
3473
|
this.s = {};
|
|
3464
3474
|
function e(o) {
|
|
3465
3475
|
let a = !!o;
|
|
@@ -3487,8 +3497,8 @@ pt = new WeakSet(), Ye = function() {
|
|
|
3487
3497
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3488
3498
|
e.addEventListener(s, function(a) {
|
|
3489
3499
|
if (s === "touchstart" && xs(), e.s.options.hover) {
|
|
3490
|
-
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,
|
|
3491
|
-
t.style.width =
|
|
3500
|
+
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, h = Math.max(c, u);
|
|
3501
|
+
t.style.width = h * 2 + "px", t.style.height = h * 2 + "px", t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
|
3492
3502
|
}
|
|
3493
3503
|
}), e.addEventListener(o, function(a) {
|
|
3494
3504
|
if (o !== "touchend" && e.s.options.hover) {
|
|
@@ -3504,13 +3514,13 @@ class vn {
|
|
|
3504
3514
|
}
|
|
3505
3515
|
init() {
|
|
3506
3516
|
const i = document.querySelectorAll("*:not([video-id]) > img"), t = (o, a) => {
|
|
3507
|
-
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2),
|
|
3517
|
+
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2), h = Math.asin(a / u) * 180 / Math.PI;
|
|
3508
3518
|
return r.className = "no-image", l.className = "slash1", l.style.cssText = `
|
|
3509
3519
|
width: ${u}px;
|
|
3510
|
-
transform: rotate(${
|
|
3520
|
+
transform: rotate(${h}deg);
|
|
3511
3521
|
`, c.className = "slash2", c.style.cssText = `
|
|
3512
3522
|
width: ${u}px;
|
|
3513
|
-
transform: rotate(${-
|
|
3523
|
+
transform: rotate(${-h}deg);
|
|
3514
3524
|
`, r.appendChild(l), r.appendChild(c), r;
|
|
3515
3525
|
}, e = document.querySelectorAll(".error-image");
|
|
3516
3526
|
for (let o = 0; o < e.length; o++)
|
|
@@ -3563,9 +3573,9 @@ function bn(n, i, t, e) {
|
|
|
3563
3573
|
const l = t.name.substring(t.name.lastIndexOf(".")).replace("."), c = t.name.replace(`.${l}`, "");
|
|
3564
3574
|
e.originalCanvas.toBlob(
|
|
3565
3575
|
function(u) {
|
|
3566
|
-
const
|
|
3576
|
+
const h = new File([u], `${c}`, { type: t.type });
|
|
3567
3577
|
uploadImage[`${a}`][r] = {
|
|
3568
|
-
file:
|
|
3578
|
+
file: h,
|
|
3569
3579
|
info: e
|
|
3570
3580
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3571
3581
|
},
|
|
@@ -3580,17 +3590,17 @@ function bn(n, i, t, e) {
|
|
|
3580
3590
|
}
|
|
3581
3591
|
function yn(n, i, t, e) {
|
|
3582
3592
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3583
|
-
let u = 0,
|
|
3593
|
+
let u = 0, h = 0;
|
|
3584
3594
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
3585
3595
|
case "contain":
|
|
3586
|
-
l < c ? (u = s.width,
|
|
3596
|
+
l < c ? (u = s.width, h = t * l / 100) : l > c ? (u = e / l * 100, h = s.height) : (u = s.width, h = s.height);
|
|
3587
3597
|
break;
|
|
3588
3598
|
case "cover":
|
|
3589
|
-
l < c ? (u = e / l * 100,
|
|
3599
|
+
l < c ? (u = e / l * 100, h = s.height) : l > c ? (u = s.width, h = t * l / 100) : l === c && (u = s.width, h = s.height);
|
|
3590
3600
|
break;
|
|
3591
3601
|
}
|
|
3592
|
-
const g = (s.width - u) * 0.5, m = (s.height -
|
|
3593
|
-
return o.drawImage(i, g, m, u,
|
|
3602
|
+
const g = (s.width - u) * 0.5, m = (s.height - h) * 0.5;
|
|
3603
|
+
return o.drawImage(i, g, m, u, h), s;
|
|
3594
3604
|
}
|
|
3595
3605
|
function wn(n, i) {
|
|
3596
3606
|
return new Promise((t, e) => {
|
|
@@ -3636,7 +3646,7 @@ function An(n, i, t) {
|
|
|
3636
3646
|
});
|
|
3637
3647
|
}, o.readAsDataURL(e);
|
|
3638
3648
|
}
|
|
3639
|
-
class
|
|
3649
|
+
class Sn {
|
|
3640
3650
|
constructor(i, t) {
|
|
3641
3651
|
const e = this;
|
|
3642
3652
|
e.el = i, e.params = {
|
|
@@ -3675,7 +3685,7 @@ class Ln {
|
|
|
3675
3685
|
}
|
|
3676
3686
|
}
|
|
3677
3687
|
export {
|
|
3678
|
-
|
|
3688
|
+
hi as A,
|
|
3679
3689
|
zn as B,
|
|
3680
3690
|
mn as C,
|
|
3681
3691
|
Xi as D,
|
|
@@ -3705,23 +3715,23 @@ export {
|
|
|
3705
3715
|
zs as c,
|
|
3706
3716
|
js as d,
|
|
3707
3717
|
xe as e,
|
|
3708
|
-
|
|
3718
|
+
S as f,
|
|
3709
3719
|
D as g,
|
|
3710
|
-
|
|
3720
|
+
In as h,
|
|
3711
3721
|
mt as i,
|
|
3712
3722
|
Di as j,
|
|
3713
3723
|
ln as k,
|
|
3714
3724
|
un as l,
|
|
3715
|
-
|
|
3725
|
+
Sn as m,
|
|
3716
3726
|
Qs as n,
|
|
3717
3727
|
no as o,
|
|
3718
3728
|
zi as p,
|
|
3719
3729
|
Bi as q,
|
|
3720
|
-
|
|
3730
|
+
qn as r,
|
|
3721
3731
|
Ns as s,
|
|
3722
|
-
|
|
3732
|
+
Mn as t,
|
|
3723
3733
|
On as u,
|
|
3724
|
-
|
|
3734
|
+
Me as v,
|
|
3725
3735
|
Zs as w,
|
|
3726
3736
|
Pn as x,
|
|
3727
3737
|
Nn as y,
|