@xwadex/fesd 0.0.14-re.74 → 0.0.14-re.75
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 +181 -174
- package/dist/image-preview-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -7,7 +7,7 @@ var p = (n, i, t) => {
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
8
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
9
9
|
};
|
10
|
-
var
|
10
|
+
var u = (n, i, t) => (hs(n, i, "access private method"), t);
|
11
11
|
import { OverlayScrollbars as Ce } from "overlayscrollbars";
|
12
12
|
import g from "jquery";
|
13
13
|
import "./vendor-bundle.js";
|
@@ -112,21 +112,24 @@ const Y = {
|
|
112
112
|
"scrollbar-radius": "10px"
|
113
113
|
}
|
114
114
|
},
|
115
|
-
TEMPLATE(n, i) {
|
115
|
+
TEMPLATE(n, i, t) {
|
116
|
+
const e = `
|
117
|
+
<div class="filter-bar">
|
118
|
+
<input class="filter-input" type="text" placeholder="${i}" disabled>
|
119
|
+
</div>
|
120
|
+
`;
|
116
121
|
return `
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
<div class="dropdown-scroller">
|
125
|
-
<ul class="dropdown-list"></ul>
|
126
|
-
</div>
|
127
|
-
</div>
|
122
|
+
<div class="select-wrapper">
|
123
|
+
<div class="select-display"></div>
|
124
|
+
<i class="dropdown-icon"></i>
|
125
|
+
<div class="dropdown">
|
126
|
+
${(n ? e : t) ?? ""}
|
127
|
+
<div class="dropdown-scroller">
|
128
|
+
<ul class="dropdown-list"></ul>
|
128
129
|
</div>
|
129
|
-
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
`;
|
130
133
|
}
|
131
134
|
}, fs = {
|
132
135
|
SETTINGS: {
|
@@ -358,7 +361,7 @@ const Y = {
|
|
358
361
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
359
362
|
}
|
360
363
|
}, be = (n, i) => {
|
361
|
-
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal",
|
364
|
+
const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", d = c ? "scrollLeft" : "scrollTop", h = c ? "left" : "top", m = c ? "width" : "height", f = b(e) ? T(e) : document.scrollingElement, v = f[d], C = b(t) ? T(t).getBoundingClientRect()[h] : 0 - v, L = b(s) ? T(s).getBoundingClientRect()[m] : 0, H = C - a - L, G = 15;
|
362
365
|
let A = 0;
|
363
366
|
if (H === 0)
|
364
367
|
return;
|
@@ -370,7 +373,7 @@ const Y = {
|
|
370
373
|
const Ie = () => {
|
371
374
|
A += G;
|
372
375
|
const R = ws[r](A, v, H, o);
|
373
|
-
f[
|
376
|
+
f[d] = R, A < o && requestAnimationFrame(Ie), A >= o && X("afterScroll");
|
374
377
|
};
|
375
378
|
requestAnimationFrame(Ie);
|
376
379
|
};
|
@@ -383,7 +386,7 @@ class Je {
|
|
383
386
|
this.__storage__ = {
|
384
387
|
el: i,
|
385
388
|
options: t
|
386
|
-
}, this.active = "data-anchor-active",
|
389
|
+
}, this.active = "data-anchor-active", u(this, J, we).call(this);
|
387
390
|
}
|
388
391
|
destroy() {
|
389
392
|
const { elements: i } = this;
|
@@ -393,7 +396,7 @@ class Je {
|
|
393
396
|
}
|
394
397
|
update() {
|
395
398
|
var i;
|
396
|
-
return
|
399
|
+
return u(i = this.destroy(), J, we).call(i), this.emit("afterUpdate"), this;
|
397
400
|
}
|
398
401
|
static run(i) {
|
399
402
|
const { SETTINGS: t } = lt, e = Object.assign({}, t, i);
|
@@ -419,11 +422,11 @@ J = new WeakSet(), we = function() {
|
|
419
422
|
if (this.elements = t.state == "not active" ? E(i + `:not([${this.active}])`) : E(i), this.elements = E(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
420
423
|
for (const [o, a] of Object.entries(this.options.on))
|
421
424
|
this.__events__[o] = [a];
|
422
|
-
|
425
|
+
u(this, pt, Ze).call(this);
|
423
426
|
}, pt = new WeakSet(), Ze = function() {
|
424
427
|
const { elements: i, options: t } = this;
|
425
428
|
i.forEach((e) => {
|
426
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler =
|
429
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = u(this, mt, Qe), 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, "");
|
427
430
|
}), this.emit("afterInit");
|
428
431
|
}, mt = new WeakSet(), Qe = function() {
|
429
432
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
@@ -469,12 +472,12 @@ class Ve extends HTMLElement {
|
|
469
472
|
attributeChangedCallback(t, e, s) {
|
470
473
|
switch (t) {
|
471
474
|
case ":state":
|
472
|
-
|
475
|
+
u(this, yt, si).call(this, s);
|
473
476
|
break;
|
474
477
|
}
|
475
478
|
}
|
476
479
|
connectedCallback() {
|
477
|
-
this.initialize || (this.initialize = !0,
|
480
|
+
this.initialize || (this.initialize = !0, u(this, gt, Ke).call(this));
|
478
481
|
}
|
479
482
|
open() {
|
480
483
|
return this.setAttribute(":state", "open"), this;
|
@@ -490,28 +493,28 @@ gt = new WeakSet(), Ke = function() {
|
|
490
493
|
const { ATTRS: t } = I;
|
491
494
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
492
495
|
const e = this.getAttribute(t.id) || vs();
|
493
|
-
this.getAttribute(t.id) || (y(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && y(`the ${t.id} "${e}" is already be used.`), M[e] = this,
|
496
|
+
this.getAttribute(t.id) || (y(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && y(`the ${t.id} "${e}" is already be used.`), M[e] = this, u(this, ft, ti).call(this);
|
494
497
|
}, ft = new WeakSet(), ti = function() {
|
495
|
-
this.childDom = this.childNodes, this.template = Ts(this), this.innerHTML = "", this.append(this.template),
|
498
|
+
this.childDom = this.childNodes, this.template = Ts(this), this.innerHTML = "", this.append(this.template), u(this, vt, ei).call(this);
|
496
499
|
}, vt = new WeakSet(), ei = function() {
|
497
500
|
const t = this.querySelector(".modal-scroller");
|
498
501
|
this.__scroller__ = Ce(t, {
|
499
502
|
overflowBehavior: {
|
500
503
|
x: "hidden"
|
501
504
|
}
|
502
|
-
}),
|
505
|
+
}), u(this, bt, ii).call(this);
|
503
506
|
}, bt = new WeakSet(), ii = function() {
|
504
507
|
var a, r, l;
|
505
508
|
const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
|
506
509
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
507
510
|
c.addEventListener("click", function() {
|
508
|
-
const
|
509
|
-
(
|
511
|
+
const d = this.getAttribute(s);
|
512
|
+
(d && M[d] ? M[d] : t).close();
|
510
513
|
});
|
511
514
|
}), (r = t.querySelectorAll(`[${o}]`)) == null || r.forEach((c) => {
|
512
515
|
c.addEventListener("click", function() {
|
513
|
-
const
|
514
|
-
(
|
516
|
+
const d = this.getAttribute(o);
|
517
|
+
(d && M[d] ? M[d] : t).destroy();
|
515
518
|
});
|
516
519
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
517
520
|
c.stopPropagation();
|
@@ -587,9 +590,9 @@ const { MODALS: Me } = window, ni = (n, i, ...t) => {
|
|
587
590
|
i && (i.emit(l, ...c), ni(i, o[l], ...c)), i || oi(o[l], ...c);
|
588
591
|
};
|
589
592
|
fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
590
|
-
const c = bs(l),
|
593
|
+
const c = bs(l), d = T(s) || T(I.SETTINGS.container);
|
591
594
|
[...c].forEach((m) => {
|
592
|
-
|
595
|
+
d.append(m);
|
593
596
|
});
|
594
597
|
const h = Me[t] || T(n.target);
|
595
598
|
r("complete", h), ai(n, i);
|
@@ -606,7 +609,7 @@ const N = class N {
|
|
606
609
|
this.__storage__ = {
|
607
610
|
el: i,
|
608
611
|
options: t
|
609
|
-
}, this.active = "data-modal-active",
|
612
|
+
}, this.active = "data-modal-active", u(this, Z, Te).call(this);
|
610
613
|
}
|
611
614
|
destroy() {
|
612
615
|
const { elements: i } = this;
|
@@ -616,7 +619,7 @@ const N = class N {
|
|
616
619
|
}
|
617
620
|
update() {
|
618
621
|
var i;
|
619
|
-
return
|
622
|
+
return u(i = this.destroy(), Z, Te).call(i), this.emit("update"), this;
|
620
623
|
}
|
621
624
|
/** static method 'open' */
|
622
625
|
static open(i) {
|
@@ -640,11 +643,11 @@ Z = new WeakSet(), Te = function() {
|
|
640
643
|
if (this.elements = t.state == "not active" ? E(i + `:not([${this.active}])`) : E(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
641
644
|
for (const [o, a] of Object.entries(this.options.on))
|
642
645
|
this.__events__[o] = [a];
|
643
|
-
|
646
|
+
u(this, wt, ri).call(this);
|
644
647
|
}, wt = new WeakSet(), ri = function() {
|
645
648
|
const { elements: i, options: t } = this;
|
646
649
|
i.forEach((e) => {
|
647
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler =
|
650
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = u(this, Tt, li), 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, "");
|
648
651
|
}), this.emit("init");
|
649
652
|
}, Tt = new WeakSet(), li = function(i) {
|
650
653
|
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = ys(this.getAttribute("data-modal-on"));
|
@@ -667,7 +670,7 @@ customElements.define("modern-modal", Ve);
|
|
667
670
|
const Ls = (n, i) => {
|
668
671
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
669
672
|
i.forEach((s) => {
|
670
|
-
const { class: o, delay: a, start: r, end: l, repeat: c, instance:
|
673
|
+
const { class: o, delay: a, start: r, end: l, repeat: c, instance: d } = s.aost, { top: h, bottom: m } = s.getBoundingClientRect(), f = t * (r / 100), v = t * (l / 100);
|
671
674
|
if (h - e <= f && m - e >= v && s.offsetParent)
|
672
675
|
setTimeout(() => {
|
673
676
|
s.classList.add(o);
|
@@ -688,7 +691,7 @@ class ci {
|
|
688
691
|
this.__storage__ = {
|
689
692
|
el: i,
|
690
693
|
options: t
|
691
|
-
}, this.active = "data-aost-active",
|
694
|
+
}, this.active = "data-aost-active", u(this, Q, Ee).call(this);
|
692
695
|
}
|
693
696
|
destroy(i) {
|
694
697
|
const { elements: t, options: e } = this;
|
@@ -704,7 +707,7 @@ class ci {
|
|
704
707
|
}
|
705
708
|
update(i) {
|
706
709
|
var t;
|
707
|
-
|
710
|
+
u(t = this.destroy(i), Q, Ee).call(t);
|
708
711
|
}
|
709
712
|
}
|
710
713
|
Q = new WeakSet(), Ee = function() {
|
@@ -715,7 +718,7 @@ Q = new WeakSet(), Ee = function() {
|
|
715
718
|
if (this.elements = t.state == "not active" ? E(i + `:not([${this.active}])`) : E(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
716
719
|
for (const [o, a] of Object.entries(this.options.on))
|
717
720
|
this.__events__[o] = [a];
|
718
|
-
|
721
|
+
u(this, Et, di).call(this);
|
719
722
|
}, Et = new WeakSet(), di = function() {
|
720
723
|
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !b(e) ? window : T(e);
|
721
724
|
this.eventHandler = () => {
|
@@ -749,7 +752,7 @@ class Ds extends HTMLElement {
|
|
749
752
|
// youku iframe
|
750
753
|
p(this, xt);
|
751
754
|
p(this, $t);
|
752
|
-
|
755
|
+
u(this, Lt, ui).call(this);
|
753
756
|
}
|
754
757
|
play() {
|
755
758
|
const { videoType: t } = this;
|
@@ -791,9 +794,9 @@ Lt = new WeakSet(), ui = function() {
|
|
791
794
|
y("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
792
795
|
return;
|
793
796
|
}
|
794
|
-
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"),
|
797
|
+
this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), u(this, At, hi).call(this);
|
795
798
|
}, At = new WeakSet(), hi = function() {
|
796
|
-
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template),
|
799
|
+
this.childDom = this.childNodes, this.template = Ss(this), this.innerHTML = "", this.append(this.template), u(this, St, pi).call(this);
|
797
800
|
}, St = new WeakSet(), pi = function() {
|
798
801
|
const { videoType: t } = this;
|
799
802
|
let e = "";
|
@@ -801,18 +804,18 @@ Lt = new WeakSet(), ui = function() {
|
|
801
804
|
case "youtubeAPI":
|
802
805
|
break;
|
803
806
|
case "youtube":
|
804
|
-
e =
|
807
|
+
e = u(this, Dt, mi).call(this);
|
805
808
|
break;
|
806
809
|
case "youkuAPI":
|
807
810
|
break;
|
808
811
|
case "youku":
|
809
|
-
e =
|
812
|
+
e = u(this, xt, fi).call(this);
|
810
813
|
break;
|
811
814
|
case "vimeo":
|
812
|
-
e =
|
815
|
+
e = u(this, _t, gi).call(this);
|
813
816
|
break;
|
814
817
|
case "bilibili":
|
815
|
-
e =
|
818
|
+
e = u(this, $t, vi).call(this);
|
816
819
|
break;
|
817
820
|
}
|
818
821
|
this.querySelector(".player-wrapper").insertAdjacentHTML(w.prepend, e);
|
@@ -971,9 +974,9 @@ function An() {
|
|
971
974
|
function Sn(n, i, t, e, s) {
|
972
975
|
const o = this, r = g(n).html().split("<br>");
|
973
976
|
let l = "", c = 0;
|
974
|
-
r.forEach((
|
975
|
-
h !== 0 && (l += "<br>"),
|
976
|
-
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), f === " " ? 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;` : ""}"` : ""}>${f}</span>`, c++), v ===
|
977
|
+
r.forEach((d, h) => {
|
978
|
+
h !== 0 && (l += "<br>"), d.split("").forEach((f, v) => {
|
979
|
+
i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), f === " " ? 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;` : ""}"` : ""}>${f}</span>`, c++), v === d.length - 1 && (l += "</span>")) : f === " " ? 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;` : ""}"` : ""}>${f}</span>`, c++);
|
977
980
|
});
|
978
981
|
}), g(n).html(l);
|
979
982
|
}
|
@@ -1073,10 +1076,10 @@ class ks {
|
|
1073
1076
|
this.__storage__ = {
|
1074
1077
|
el: i,
|
1075
1078
|
options: t
|
1076
|
-
}, this.active = "data-video-active",
|
1079
|
+
}, this.active = "data-video-active", u(this, V, Le).call(this);
|
1077
1080
|
}
|
1078
1081
|
update() {
|
1079
|
-
|
1082
|
+
u(this, V, Le).call(this);
|
1080
1083
|
}
|
1081
1084
|
}
|
1082
1085
|
V = new WeakSet(), Le = function() {
|
@@ -1084,27 +1087,27 @@ V = new WeakSet(), Le = function() {
|
|
1084
1087
|
if (this.elements = t.state == "not active" ? E(i + `:not([${this.active}])`) : E(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
1085
1088
|
for (const [o, a] of Object.entries(this.options.on))
|
1086
1089
|
this.__events__[o] = [a];
|
1087
|
-
|
1090
|
+
u(this, kt, wi).call(this);
|
1088
1091
|
}, kt = new WeakSet(), wi = function() {
|
1089
1092
|
const { elements: i, options: t } = this;
|
1090
1093
|
i.forEach((e) => {
|
1091
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params =
|
1094
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = u(this, Ht, Ei).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), je(e.video.params) && !$s(e.video.params) && (e.setAttribute("video4-active", "on"), u(this, Ct, Ti).call(this, e)), je(e.video.params) || Ne("video4", "無法取得影片 ID");
|
1092
1095
|
}), this.emit("init");
|
1093
1096
|
}, Ct = new WeakSet(), Ti = function(i) {
|
1094
|
-
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover:
|
1097
|
+
const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: d } = e;
|
1095
1098
|
if (l === "onBox") {
|
1096
1099
|
let h = null;
|
1097
|
-
if (
|
1100
|
+
if (d === "on") {
|
1098
1101
|
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(w.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), y("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
1099
1102
|
const m = s.querySelector("img");
|
1100
1103
|
m.insertAdjacentHTML(w.after, t[o]);
|
1101
1104
|
const f = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
1102
1105
|
!f && r == "youtube" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !f && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : y("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
1103
1106
|
}
|
1104
|
-
c == "off" ? h = s : (h = s.querySelector(c) ?? s, s.querySelector(c) || y("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), h.video || (h.video = {}, h.video.params = e), h.video.eventHandler =
|
1107
|
+
c == "off" ? h = s : (h = s.querySelector(c) ?? s, s.querySelector(c) || y("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), h.video || (h.video = {}, h.video.params = e), h.video.eventHandler = u(this, K, Ae), h.addEventListener("click", h.video.eventHandler);
|
1105
1108
|
} else if (l === "onPage") {
|
1106
1109
|
let h = null;
|
1107
|
-
if (
|
1110
|
+
if (d == "on") {
|
1108
1111
|
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(w.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), y("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
1109
1112
|
const m = s.querySelector("img");
|
1110
1113
|
m.insertAdjacentHTML(w.after, t[o]);
|
@@ -1114,7 +1117,7 @@ V = new WeakSet(), Le = function() {
|
|
1114
1117
|
s.innerHTML = ye(e);
|
1115
1118
|
return;
|
1116
1119
|
}
|
1117
|
-
h.video || (h.video = {}, h.video.params = e), h.video.eventHandler =
|
1120
|
+
h.video || (h.video = {}, h.video.params = e), h.video.eventHandler = u(this, K, Ae), h.addEventListener("click", h.video.eventHandler);
|
1118
1121
|
}
|
1119
1122
|
}, K = new WeakSet(), Ae = function(i) {
|
1120
1123
|
const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoTargetRoute: r } = t.params, l = new Xe({ callback_loaded: (c) => {
|
@@ -1124,18 +1127,18 @@ V = new WeakSet(), Le = function() {
|
|
1124
1127
|
target: a,
|
1125
1128
|
route: r,
|
1126
1129
|
on: {
|
1127
|
-
complete(
|
1128
|
-
|
1130
|
+
complete(d) {
|
1131
|
+
d.querySelector(".modal-content").insertAdjacentHTML("beforeend", ye(t.params));
|
1129
1132
|
},
|
1130
|
-
open(
|
1131
|
-
const h =
|
1133
|
+
open(d) {
|
1134
|
+
const h = d.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1132
1135
|
l.update(), bi([...h]);
|
1133
1136
|
},
|
1134
|
-
close(
|
1135
|
-
const h =
|
1137
|
+
close(d) {
|
1138
|
+
const h = d.querySelectorAll("[data-overlayscrollbars-viewport]");
|
1136
1139
|
yi([...h]);
|
1137
1140
|
},
|
1138
|
-
destroy(
|
1141
|
+
destroy(d) {
|
1139
1142
|
}
|
1140
1143
|
}
|
1141
1144
|
};
|
@@ -1989,13 +1992,17 @@ const qe = {
|
|
1989
1992
|
]
|
1990
1993
|
}
|
1991
1994
|
}, Cs = (n) => {
|
1992
|
-
const { TEMPLATE: i } = He, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder");
|
1993
|
-
e.innerHTML = i(
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1995
|
+
const { TEMPLATE: i } = He, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("custom-template");
|
1996
|
+
e.innerHTML = i(
|
1997
|
+
s,
|
1998
|
+
o,
|
1999
|
+
a
|
2000
|
+
);
|
2001
|
+
const r = e.querySelector(".dropdown-list");
|
2002
|
+
return [...t].forEach((l) => {
|
2003
|
+
l.tagName === "LI" && (l.classList.contains("has-sublayer") ? [...l.querySelectorAll("li")].forEach((d) => {
|
2004
|
+
(!d.hasAttribute("data-option") || d.getAttribute("data-option").trim() === "") && d.setAttribute("data-option", d.textContent.trim());
|
2005
|
+
}) : (!l.hasAttribute("data-option") || l.getAttribute("data-option").trim() === "") && l.setAttribute("data-option", l.textContent.trim())), r.append(l);
|
1999
2006
|
}), e.children[0];
|
2000
2007
|
}, Hs = (n) => {
|
2001
2008
|
var t;
|
@@ -2044,8 +2051,8 @@ const qe = {
|
|
2044
2051
|
});
|
2045
2052
|
const o = n.querySelectorAll(".dropdown-list li.active");
|
2046
2053
|
o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
|
2047
|
-
const l = r.getAttribute("data-option"), c = r.textContent.trim(),
|
2048
|
-
n.s.selectDisplayEl.insertAdjacentHTML(w.append,
|
2054
|
+
const l = r.getAttribute("data-option"), c = r.textContent.trim(), d = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
|
2055
|
+
n.s.selectDisplayEl.insertAdjacentHTML(w.append, d);
|
2049
2056
|
})), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
|
2050
2057
|
index: [...e].indexOf(r),
|
2051
2058
|
id: r.getAttribute("data-option"),
|
@@ -2116,11 +2123,11 @@ class Ai extends HTMLElement {
|
|
2116
2123
|
break;
|
2117
2124
|
case "multiple":
|
2118
2125
|
const l = [];
|
2119
|
-
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((
|
2120
|
-
const h = o.querySelector(`.dropdown-list li[data-option="${
|
2126
|
+
o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((d) => {
|
2127
|
+
const h = o.querySelector(`.dropdown-list li[data-option="${d}"]`);
|
2121
2128
|
b(h) && (h.classList.add("active"), l.push(h));
|
2122
2129
|
});
|
2123
|
-
const c = l.map((
|
2130
|
+
const c = l.map((d) => [...o.s.allLi].indexOf(d));
|
2124
2131
|
$(o, c);
|
2125
2132
|
break;
|
2126
2133
|
}
|
@@ -2137,7 +2144,7 @@ class Ai extends HTMLElement {
|
|
2137
2144
|
}
|
2138
2145
|
connectedCallback() {
|
2139
2146
|
const t = this;
|
2140
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0,
|
2147
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, u(this, Mt, Si).call(this));
|
2141
2148
|
}
|
2142
2149
|
open() {
|
2143
2150
|
const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".filter-bar").clientHeight + e : e;
|
@@ -2164,9 +2171,9 @@ class Ai extends HTMLElement {
|
|
2164
2171
|
}
|
2165
2172
|
}
|
2166
2173
|
Mt = new WeakSet(), Si = function() {
|
2167
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""),
|
2174
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), u(this, qt, Di).call(this);
|
2168
2175
|
}, qt = new WeakSet(), Di = function() {
|
2169
|
-
this.s.childDom = this.childNodes, this.s.template = Cs(this), this.innerHTML = "", this.append(this.s.template),
|
2176
|
+
this.s.childDom = this.childNodes, this.s.template = Cs(this), this.innerHTML = "", this.append(this.s.template), u(this, It, _i).call(this);
|
2170
2177
|
}, It = new WeakSet(), _i = function() {
|
2171
2178
|
var s;
|
2172
2179
|
const t = this;
|
@@ -2180,8 +2187,8 @@ Mt = new WeakSet(), Si = function() {
|
|
2180
2187
|
if (r && l) {
|
2181
2188
|
const c = r.getAttribute("d4-value");
|
2182
2189
|
if (qs(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
2183
|
-
const
|
2184
|
-
o = t.querySelector(`.dropdown-list li[data-option="${
|
2190
|
+
const d = e.split(",")[1];
|
2191
|
+
o = t.querySelector(`.dropdown-list li[data-option="${d}"]`), t.setAttribute("d4-value", d);
|
2185
2192
|
}
|
2186
2193
|
}
|
2187
2194
|
} else
|
@@ -2212,7 +2219,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2212
2219
|
};
|
2213
2220
|
break;
|
2214
2221
|
}
|
2215
|
-
$(t, t.s.value.index),
|
2222
|
+
$(t, t.s.value.index), u(s = t, Ot, xi).call(s), t.classList.add("d4-initialize");
|
2216
2223
|
}, Ot = new WeakSet(), xi = function() {
|
2217
2224
|
const t = this;
|
2218
2225
|
t.__events__.dropdownToggle = () => {
|
@@ -2236,7 +2243,7 @@ Mt = new WeakSet(), Si = function() {
|
|
2236
2243
|
if (t.__scroller__) {
|
2237
2244
|
const { viewport: c } = t.__scroller__.elements();
|
2238
2245
|
if (b(t.s.activeLi)) {
|
2239
|
-
const
|
2246
|
+
const d = t.s.activeLi.clientHeight / 2, h = t.s.activeLi.offsetTop, m = h - r.clientHeight / 2 + d > 0 ? h - r.clientHeight / 2 + d : 0;
|
2240
2247
|
c.scrollTo({
|
2241
2248
|
top: m,
|
2242
2249
|
behavior: "smooth"
|
@@ -2270,15 +2277,15 @@ Mt = new WeakSet(), Si = function() {
|
|
2270
2277
|
e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
|
2271
2278
|
l.addEventListener("click", function(c) {
|
2272
2279
|
var f;
|
2273
|
-
const
|
2274
|
-
if (
|
2280
|
+
const d = this, h = [...e.s.allLi].indexOf(d), m = parseInt(e.getAttribute("d4-default-height"));
|
2281
|
+
if (d.classList.contains("has-sublayer")) {
|
2275
2282
|
c.stopPropagation();
|
2276
|
-
const v =
|
2283
|
+
const v = d.querySelector(".sub-dropdown"), C = v.querySelector(".sub-dropdown-list"), L = parseInt(getComputedStyle(C).marginTop) + parseInt(getComputedStyle(C).marginBottom);
|
2277
2284
|
v.style.cssText = `--height: ${C.offsetHeight + L}px`;
|
2278
2285
|
const H = parseInt(v.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), A = () => {
|
2279
2286
|
s = m + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
|
2280
2287
|
};
|
2281
|
-
|
2288
|
+
d.classList.contains("open") ? (d.classList.remove("open"), e.s.subDropdownTotalH -= H, A()) : (d.classList.add("open"), e.s.subDropdownTotalH += H, A());
|
2282
2289
|
const X = () => {
|
2283
2290
|
e.__scroller__.update(!0), v.removeEventListener("transitionend", X);
|
2284
2291
|
};
|
@@ -2286,17 +2293,17 @@ Mt = new WeakSet(), Si = function() {
|
|
2286
2293
|
} else
|
2287
2294
|
switch (Hs(e), e.s.selectType) {
|
2288
2295
|
case "single":
|
2289
|
-
if (e.setAttribute("d4-value",
|
2296
|
+
if (e.setAttribute("d4-value", d.getAttribute("data-option")), r) {
|
2290
2297
|
const v = e.s.cityLang, C = l.textContent.trim(), L = document.getElementById(e.getAttribute("dist-select"));
|
2291
2298
|
L && (L.querySelector(".dropdown-list").textContent = "", $(L, -1), qe[v][C].forEach((H, G) => {
|
2292
2299
|
const A = document.createElement("li");
|
2293
2300
|
A.textContent = H[0], A.setAttribute("data-option", H[0]), L.querySelector(".dropdown-list").append(A);
|
2294
2301
|
}), e.__events__.selectOption(L));
|
2295
2302
|
}
|
2296
|
-
(f =
|
2303
|
+
(f = d.parentNode.closest("li")) != null && f.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
|
2297
2304
|
break;
|
2298
2305
|
case "multiple":
|
2299
|
-
c.stopPropagation(),
|
2306
|
+
c.stopPropagation(), d.classList.toggle("active"), $(e, h);
|
2300
2307
|
break;
|
2301
2308
|
}
|
2302
2309
|
});
|
@@ -2367,7 +2374,7 @@ function Os(n) {
|
|
2367
2374
|
}
|
2368
2375
|
n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
|
2369
2376
|
}
|
2370
|
-
function
|
2377
|
+
function _(n) {
|
2371
2378
|
const { behavior: i, direction: t, continual: e } = n.s.options;
|
2372
2379
|
let s = {};
|
2373
2380
|
switch (i) {
|
@@ -2445,7 +2452,7 @@ class Ps extends HTMLElement {
|
|
2445
2452
|
attributeChangedCallback(t, e, s) {
|
2446
2453
|
}
|
2447
2454
|
connectedCallback() {
|
2448
|
-
this.initialize || (this.initialize = !0,
|
2455
|
+
this.initialize || (this.initialize = !0, u(this, Nt, $i).call(this));
|
2449
2456
|
}
|
2450
2457
|
play() {
|
2451
2458
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -2471,7 +2478,7 @@ Nt = new WeakSet(), $i = function() {
|
|
2471
2478
|
// true / false
|
2472
2479
|
gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
|
2473
2480
|
};
|
2474
|
-
this.s = {}, this.s.options = t, this.s.nowDuration = ze(this), Os(this),
|
2481
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = ze(this), Os(this), u(this, Pt, ki).call(this);
|
2475
2482
|
}, Pt = new WeakSet(), ki = function() {
|
2476
2483
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
2477
2484
|
switch (t) {
|
@@ -2484,17 +2491,17 @@ Nt = new WeakSet(), $i = function() {
|
|
2484
2491
|
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;`;
|
2485
2492
|
break;
|
2486
2493
|
}
|
2487
|
-
|
2494
|
+
u(this, jt, Ci).call(this), u(this, zt, Hi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
2488
2495
|
}, jt = new WeakSet(), Ci = function() {
|
2489
2496
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
2490
2497
|
let c;
|
2491
|
-
function
|
2498
|
+
function d() {
|
2492
2499
|
switch (s) {
|
2493
2500
|
case "normal":
|
2494
|
-
t.s.animateEl.style.transform = `${
|
2501
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2495
2502
|
duration: t.s.nowDuration,
|
2496
2503
|
iterations: 1 / 0
|
2497
|
-
}), l && (t.s.cloneAnimateEl.style.transform = `${
|
2504
|
+
}), l && (t.s.cloneAnimateEl.style.transform = `${_(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2498
2505
|
duration: t.s.nowDuration,
|
2499
2506
|
delay: -t.s.nowDuration / 2,
|
2500
2507
|
iterations: 1 / 0
|
@@ -2523,7 +2530,7 @@ Nt = new WeakSet(), $i = function() {
|
|
2523
2530
|
duration: m,
|
2524
2531
|
fill: "forwards"
|
2525
2532
|
}).finished.then(() => {
|
2526
|
-
t.s.animation = t.s.animateEl.animate(
|
2533
|
+
t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2527
2534
|
duration: t.s.nowDuration,
|
2528
2535
|
iterations: 1 / 0
|
2529
2536
|
});
|
@@ -2532,7 +2539,7 @@ Nt = new WeakSet(), $i = function() {
|
|
2532
2539
|
});
|
2533
2540
|
break;
|
2534
2541
|
case "endStop":
|
2535
|
-
t.s.animateEl.style.transform = `${
|
2542
|
+
t.s.animateEl.style.transform = `${_(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2536
2543
|
duration: t.s.nowDuration,
|
2537
2544
|
fill: "forwards"
|
2538
2545
|
});
|
@@ -2542,7 +2549,7 @@ Nt = new WeakSet(), $i = function() {
|
|
2542
2549
|
}
|
2543
2550
|
clearTimeout(c), c = setTimeout(
|
2544
2551
|
() => {
|
2545
|
-
|
2552
|
+
d();
|
2546
2553
|
},
|
2547
2554
|
a || 0
|
2548
2555
|
), t.addEventListener("mouseenter", function() {
|
@@ -2554,10 +2561,10 @@ Nt = new WeakSet(), $i = function() {
|
|
2554
2561
|
const t = this;
|
2555
2562
|
function e() {
|
2556
2563
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
2557
|
-
t.s.nowDuration = ze(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(
|
2564
|
+
t.s.nowDuration = ze(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(_(t).animate1, {
|
2558
2565
|
duration: t.s.nowDuration,
|
2559
2566
|
iterations: 1 / 0
|
2560
|
-
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(
|
2567
|
+
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(_(t).animate2, {
|
2561
2568
|
duration: t.s.nowDuration,
|
2562
2569
|
delay: -t.s.nowDuration / 2,
|
2563
2570
|
iterations: 1 / 0
|
@@ -2571,7 +2578,7 @@ const ht = function(n) {
|
|
2571
2578
|
return function(t) {
|
2572
2579
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
2573
2580
|
};
|
2574
|
-
},
|
2581
|
+
}, D = (n, i) => {
|
2575
2582
|
if (rt(n)) {
|
2576
2583
|
n.forEach((t) => {
|
2577
2584
|
t.classList.add(i);
|
@@ -2603,7 +2610,7 @@ class We {
|
|
2603
2610
|
p(this, W);
|
2604
2611
|
// 選項事件綁定
|
2605
2612
|
p(this, Xt);
|
2606
|
-
this.$element = i, this.option = i.s.option.drag,
|
2613
|
+
this.$element = i, this.option = i.s.option.drag, u(this, Wt, Mi).call(this);
|
2607
2614
|
}
|
2608
2615
|
// 更新 active 位置
|
2609
2616
|
update(i) {
|
@@ -2624,10 +2631,10 @@ Wt = new WeakSet(), Mi = function() {
|
|
2624
2631
|
return;
|
2625
2632
|
i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
|
2626
2633
|
const t = () => {
|
2627
|
-
var c,
|
2628
|
-
|
2634
|
+
var c, d;
|
2635
|
+
u(c = i, tt, Se).call(c), u(d = i, W, dt).call(d);
|
2629
2636
|
};
|
2630
|
-
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", ht(t)), window.addEventListener("resize", ht(t)), (i.option.draggable || i.$element.s.type == "collapse") &&
|
2637
|
+
i.$wrapper.removeEventListener("scroll", t), i.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", ht(t)), window.addEventListener("resize", ht(t)), (i.option.draggable || i.$element.s.type == "collapse") && u(e = i, Gt, Ii).call(e), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
2631
2638
|
w.prepend,
|
2632
2639
|
`<div class="navigation">
|
2633
2640
|
<div class="button prev">
|
@@ -2637,7 +2644,7 @@ Wt = new WeakSet(), Mi = function() {
|
|
2637
2644
|
<div></div>
|
2638
2645
|
</div>
|
2639
2646
|
</div>`
|
2640
|
-
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"),
|
2647
|
+
), i.$button = (s = i.$container) == null ? void 0 : s.querySelectorAll(".button"), u(o = i, Bt, qi).call(o)), u(a = i, tt, Se).call(a), u(r = i, W, dt).call(r), u(l = i, Xt, Oi).call(l);
|
2641
2648
|
}, Bt = new WeakSet(), qi = function() {
|
2642
2649
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
2643
2650
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
@@ -2646,7 +2653,7 @@ Wt = new WeakSet(), Mi = function() {
|
|
2646
2653
|
behavior: "smooth"
|
2647
2654
|
}), setTimeout(() => {
|
2648
2655
|
var r;
|
2649
|
-
|
2656
|
+
u(r = i, W, dt).call(r);
|
2650
2657
|
}, 100);
|
2651
2658
|
};
|
2652
2659
|
e.forEach((o) => {
|
@@ -2676,33 +2683,33 @@ Wt = new WeakSet(), Mi = function() {
|
|
2676
2683
|
});
|
2677
2684
|
};
|
2678
2685
|
i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
|
2679
|
-
const
|
2686
|
+
const d = function(h) {
|
2680
2687
|
e && (h.preventDefault(), h.stopPropagation());
|
2681
2688
|
};
|
2682
2689
|
i.querySelectorAll("a").forEach((h) => {
|
2683
|
-
h.removeEventListener("click",
|
2690
|
+
h.removeEventListener("click", d), h.addEventListener("click", d);
|
2684
2691
|
});
|
2685
2692
|
}, tt = new WeakSet(), Se = function() {
|
2686
2693
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = t.scrollLeft;
|
2687
|
-
e <= 0 || (
|
2694
|
+
e <= 0 || (D(i, "scrollable"), s == 0 ? (S(i, "scrollable"), D(t, "start"), S(t, "end")) : s >= e ? (S(i, "scrollable"), S(t, "start"), D(t, "end")) : (D(t, "center"), S(t, "start"), S(t, "end")));
|
2688
2695
|
}, W = new WeakSet(), dt = function() {
|
2689
2696
|
const { $wrapper: i, $button: t, $element: e } = this;
|
2690
2697
|
if (!t)
|
2691
2698
|
return;
|
2692
2699
|
const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
|
2693
2700
|
if (s <= 0) {
|
2694
|
-
|
2701
|
+
D(t, "hide"), S(t, "active"), D(e, "noScrollable");
|
2695
2702
|
return;
|
2696
2703
|
}
|
2697
|
-
s > 0 &&
|
2704
|
+
s > 0 && (D(t, "active"), D(e, "scrollable"), S(e, "noScrollable")), o == 0 ? t.forEach((a) => {
|
2698
2705
|
if (a.classList.contains("next")) {
|
2699
2706
|
S(a, "hide");
|
2700
2707
|
return;
|
2701
2708
|
}
|
2702
|
-
|
2709
|
+
D(a, "hide");
|
2703
2710
|
}) : o >= s ? t.forEach((a) => {
|
2704
2711
|
if (a.classList.contains("next")) {
|
2705
|
-
|
2712
|
+
D(a, "hide");
|
2706
2713
|
return;
|
2707
2714
|
}
|
2708
2715
|
S(a, "hide");
|
@@ -2732,11 +2739,11 @@ class js {
|
|
2732
2739
|
p(this, Yt);
|
2733
2740
|
// 選項事件綁定
|
2734
2741
|
p(this, Ut);
|
2735
|
-
this.$element = i, this.option = i.s.option.collapse,
|
2742
|
+
this.$element = i, this.option = i.s.option.collapse, u(this, Rt, Ni).call(this);
|
2736
2743
|
}
|
2737
2744
|
}
|
2738
2745
|
Rt = new WeakSet(), Ni = function() {
|
2739
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"),
|
2746
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), u(this, Ft, Pi).call(this) && u(this, Yt, ji).call(this), u(this, Ut, zi).call(this));
|
2740
2747
|
}, Ft = new WeakSet(), Pi = function() {
|
2741
2748
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
2742
2749
|
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(w.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), !0) : !1;
|
@@ -2784,7 +2791,7 @@ class Ws extends HTMLElement {
|
|
2784
2791
|
case "m4-type":
|
2785
2792
|
if (e === null || e === s)
|
2786
2793
|
return;
|
2787
|
-
this.s.type = s,
|
2794
|
+
this.s.type = s, u(this, B, ut).call(this);
|
2788
2795
|
break;
|
2789
2796
|
case "m4-status":
|
2790
2797
|
if (e === s)
|
@@ -2801,10 +2808,10 @@ class Ws extends HTMLElement {
|
|
2801
2808
|
}
|
2802
2809
|
}
|
2803
2810
|
connectedCallback() {
|
2804
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0,
|
2811
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, u(this, Jt, Wi).call(this));
|
2805
2812
|
}
|
2806
2813
|
update() {
|
2807
|
-
|
2814
|
+
u(this, et, De).call(this);
|
2808
2815
|
}
|
2809
2816
|
}
|
2810
2817
|
Jt = new WeakSet(), Wi = function() {
|
@@ -2818,18 +2825,18 @@ Jt = new WeakSet(), Wi = function() {
|
|
2818
2825
|
}
|
2819
2826
|
this.update();
|
2820
2827
|
};
|
2821
|
-
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, k.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, k.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, k.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, k.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint),
|
2828
|
+
window.removeEventListener("resize", ht(e)), window.addEventListener("resize", ht(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, k.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, k.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, k.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, k.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), u(this, Zt, Bi).call(this);
|
2822
2829
|
}, Zt = new WeakSet(), Bi = function() {
|
2823
|
-
this.classList.add("m4-init"),
|
2830
|
+
this.classList.add("m4-init"), u(this, et, De).call(this);
|
2824
2831
|
}, et = new WeakSet(), De = function() {
|
2825
2832
|
const t = Object.keys(this.s.option.breakpoint);
|
2826
2833
|
if (!t.length) {
|
2827
|
-
|
2834
|
+
u(this, B, ut).call(this);
|
2828
2835
|
return;
|
2829
2836
|
}
|
2830
2837
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
2831
2838
|
var s, o, a, r;
|
2832
|
-
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)),
|
2839
|
+
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)), u(this, B, ut).call(this), window.innerWidth >= e;
|
2833
2840
|
});
|
2834
2841
|
}, B = new WeakSet(), ut = function() {
|
2835
2842
|
var o;
|
@@ -2892,41 +2899,41 @@ class Gi extends HTMLElement {
|
|
2892
2899
|
return ["t4-active"];
|
2893
2900
|
}
|
2894
2901
|
attributeChangedCallback(t, e, s) {
|
2895
|
-
t === "t4-active" && e !== s &&
|
2902
|
+
t === "t4-active" && e !== s && u(this, de, ss).call(this, s);
|
2896
2903
|
}
|
2897
2904
|
connectedCallback() {
|
2898
|
-
this.classList.contains("t4-initialize") ||
|
2905
|
+
this.classList.contains("t4-initialize") || u(this, Qt, Xi).call(this);
|
2899
2906
|
}
|
2900
2907
|
// ------------- 我是分隔線呦 -------------
|
2901
2908
|
// 頁籤切換
|
2902
2909
|
tabClick(t) {
|
2903
2910
|
const { t: e } = this, s = e.tabs.indexOf(t) % e.tabPanels.length, o = e.tabGroup === "true" ? String(s) : t.getAttribute("t4-id");
|
2904
2911
|
this.setActiveTab(o), setTimeout(() => {
|
2905
|
-
|
2912
|
+
u(this, q, z).call(this, "eventAnchor");
|
2906
2913
|
}, e.transition.duration);
|
2907
2914
|
}
|
2908
2915
|
// 外部呼叫方法 $0.setActiveTab(0)
|
2909
2916
|
setActiveTab(t) {
|
2910
2917
|
const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
|
2911
2918
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
2912
|
-
const o =
|
2919
|
+
const o = u(this, P, F).call(this, s);
|
2913
2920
|
e.tabPanels.forEach((a, r) => {
|
2914
|
-
r === o ?
|
2921
|
+
r === o ? u(this, ce, is).call(this, r) : u(this, le, es).call(this, r);
|
2915
2922
|
});
|
2916
2923
|
}
|
2917
2924
|
// 外部呼叫方法 $0.goNext()
|
2918
2925
|
goNext() {
|
2919
|
-
const t =
|
2926
|
+
const t = u(this, P, F).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2920
2927
|
this.setActiveTab(s);
|
2921
2928
|
}
|
2922
2929
|
// 外部呼叫方法 $0.goPrev()
|
2923
2930
|
goPrev() {
|
2924
|
-
const t =
|
2931
|
+
const t = u(this, P, F).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
|
2925
2932
|
this.setActiveTab(s);
|
2926
2933
|
}
|
2927
2934
|
// 外部呼叫方法 $0.update()
|
2928
2935
|
update() {
|
2929
|
-
this.t.tabs =
|
2936
|
+
this.t.tabs = u(this, it, _e).call(this), os(), console.log("tab update!!!!");
|
2930
2937
|
}
|
2931
2938
|
}
|
2932
2939
|
Qt = new WeakSet(), Xi = function() {
|
@@ -2949,13 +2956,13 @@ Qt = new WeakSet(), Xi = function() {
|
|
2949
2956
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
2950
2957
|
},
|
2951
2958
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
2952
|
-
}, this.__events__ = {}, this.t.tabs =
|
2959
|
+
}, this.__events__ = {}, this.t.tabs = u(this, it, _e).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), u(this, Vt, Ri).call(this);
|
2953
2960
|
}, Vt = new WeakSet(), Ri = function() {
|
2954
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" &&
|
2961
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && u(this, Kt, Fi).call(this), this.t.recordUrl) {
|
2955
2962
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
2956
2963
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
2957
2964
|
}
|
2958
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"),
|
2965
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), u(this, ue, ns).call(this);
|
2959
2966
|
}, it = new WeakSet(), _e = function() {
|
2960
2967
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
2961
2968
|
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) => {
|
@@ -2972,7 +2979,7 @@ Qt = new WeakSet(), Xi = function() {
|
|
2972
2979
|
const e = document.createElement("div");
|
2973
2980
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
2974
2981
|
e.appendChild(s.cloneNode(!0));
|
2975
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t),
|
2982
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), u(this, te, Yi).call(this);
|
2976
2983
|
}, te = new WeakSet(), Yi = function() {
|
2977
2984
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
2978
2985
|
t.style.overflow = "hidden", e.style.display = "flex";
|
@@ -2988,7 +2995,7 @@ Qt = new WeakSet(), Xi = function() {
|
|
2988
2995
|
}
|
2989
2996
|
}, ie = new WeakSet(), Ji = function() {
|
2990
2997
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
2991
|
-
|
2998
|
+
u(this, se, Zi).call(this, o);
|
2992
2999
|
}, se = new WeakSet(), Zi = function(t) {
|
2993
3000
|
window.scrollTo({
|
2994
3001
|
top: t,
|
@@ -3016,19 +3023,19 @@ Qt = new WeakSet(), Xi = function() {
|
|
3016
3023
|
}, q = new WeakSet(), z = function(t, e, s) {
|
3017
3024
|
switch (t) {
|
3018
3025
|
case "step":
|
3019
|
-
ve(this.t.step) &&
|
3026
|
+
ve(this.t.step) && u(this, ne, Qi).call(this, e);
|
3020
3027
|
break;
|
3021
3028
|
case "eventAnchor":
|
3022
|
-
this.t.anchor &&
|
3029
|
+
this.t.anchor && u(this, ie, Ji).call(this);
|
3023
3030
|
break;
|
3024
3031
|
case "tabState":
|
3025
|
-
this.t.type == "normal" &&
|
3032
|
+
this.t.type == "normal" && u(this, re, ts).call(this, e, s);
|
3026
3033
|
break;
|
3027
3034
|
case "btnState":
|
3028
|
-
|
3035
|
+
u(this, oe, Vi).call(this, e), u(this, ae, Ki).call(this, e);
|
3029
3036
|
break;
|
3030
3037
|
case "tabUrl":
|
3031
|
-
this.t.recordUrl === "true" &&
|
3038
|
+
this.t.recordUrl === "true" && u(this, ee, Ui).call(this, e);
|
3032
3039
|
break;
|
3033
3040
|
default:
|
3034
3041
|
console.warn("請增加判斷,謝謝");
|
@@ -3069,7 +3076,7 @@ Qt = new WeakSet(), Xi = function() {
|
|
3069
3076
|
break;
|
3070
3077
|
case "swiper":
|
3071
3078
|
a.style.opacity = "1";
|
3072
|
-
const c = this.querySelector(".swiper-wrapper"),
|
3079
|
+
const c = this.querySelector(".swiper-wrapper"), d = this.t.tabPanels[0].offsetWidth, h = -t * d;
|
3073
3080
|
c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${h}px)`;
|
3074
3081
|
break;
|
3075
3082
|
default:
|
@@ -3077,8 +3084,8 @@ Qt = new WeakSet(), Xi = function() {
|
|
3077
3084
|
break;
|
3078
3085
|
}
|
3079
3086
|
}, de = new WeakSet(), ss = function(t) {
|
3080
|
-
const e =
|
3081
|
-
|
3087
|
+
const e = u(this, P, F).call(this, t);
|
3088
|
+
u(this, q, z).call(this, "step", e), u(this, q, z).call(this, "btnState", e), u(this, q, z).call(this, "tabState", e, t), u(this, q, z).call(this, "tabUrl", t), this.emit("change");
|
3082
3089
|
}, ue = new WeakSet(), ns = function() {
|
3083
3090
|
const t = this;
|
3084
3091
|
window.addEventListener(
|
@@ -3144,10 +3151,10 @@ class Xs {
|
|
3144
3151
|
!at(i) && !ve(i) && !rt(i) && !b(i) || (this.__storage__ = {
|
3145
3152
|
el: i,
|
3146
3153
|
options: t
|
3147
|
-
}, this.active = "data-collapse-active",
|
3154
|
+
}, this.active = "data-collapse-active", u(this, st, xe).call(this));
|
3148
3155
|
}
|
3149
3156
|
update() {
|
3150
|
-
|
3157
|
+
u(this, st, xe).call(this);
|
3151
3158
|
}
|
3152
3159
|
}
|
3153
3160
|
st = new WeakSet(), xe = function() {
|
@@ -3155,19 +3162,19 @@ st = new WeakSet(), xe = function() {
|
|
3155
3162
|
if (this.elements = t.state == "not active" ? E(i + `:not([${this.active}])`) : E(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
3156
3163
|
for (const [o, a] of Object.entries(this.options.on))
|
3157
3164
|
this.__events__[o] = [a];
|
3158
|
-
|
3165
|
+
u(this, he, as).call(this);
|
3159
3166
|
}, he = new WeakSet(), as = function() {
|
3160
3167
|
const { elements: i, options: t } = this;
|
3161
3168
|
i.forEach((e) => {
|
3162
|
-
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""),
|
3169
|
+
e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), u(this, pe, rs).call(this, e);
|
3163
3170
|
}), this.emit("init");
|
3164
3171
|
}, pe = new WeakSet(), rs = function(i) {
|
3165
|
-
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i,
|
3166
|
-
if (c.collapse.height =
|
3172
|
+
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, d = c.querySelector(o);
|
3173
|
+
if (c.collapse.height = d.children[0].offsetHeight, a ? (d.style.height = `${d.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), d.style.height = "0px", d.style.overflow = "hidden") : (d.style.height = `${d.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", u(this, nt, $e)), c.addEventListener("click", u(this, nt, $e)), r) {
|
3167
3174
|
const h = (m) => {
|
3168
3175
|
m.stopPropagation();
|
3169
3176
|
};
|
3170
|
-
|
3177
|
+
d.removeEventListener("click", h), d.addEventListener("click", h);
|
3171
3178
|
}
|
3172
3179
|
}, nt = new WeakSet(), $e = function() {
|
3173
3180
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
@@ -3201,10 +3208,10 @@ class Fs extends HTMLElement {
|
|
3201
3208
|
}
|
3202
3209
|
connectedCallback() {
|
3203
3210
|
const t = this;
|
3204
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0,
|
3211
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, u(this, ot, ke).call(this));
|
3205
3212
|
}
|
3206
3213
|
update() {
|
3207
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(),
|
3214
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), u(this, ot, ke).call(this);
|
3208
3215
|
}
|
3209
3216
|
}
|
3210
3217
|
ot = new WeakSet(), ke = function() {
|
@@ -3222,9 +3229,9 @@ ot = new WeakSet(), ke = function() {
|
|
3222
3229
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
3223
3230
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
3224
3231
|
};
|
3225
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"),
|
3232
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), u(this, me, cs).call(this);
|
3226
3233
|
}, me = new WeakSet(), cs = function() {
|
3227
|
-
|
3234
|
+
u(this, ge, ds).call(this), u(this, fe, us).call(this), this.classList.add("r4-initialize");
|
3228
3235
|
}, ge = new WeakSet(), ds = function() {
|
3229
3236
|
const t = this, e = document.createElement("i");
|
3230
3237
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
@@ -3236,7 +3243,7 @@ ot = new WeakSet(), ke = function() {
|
|
3236
3243
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
3237
3244
|
e.addEventListener(s, function(a) {
|
3238
3245
|
if (s === "touchstart" && ls(), e.s.options.hover) {
|
3239
|
-
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:
|
3246
|
+
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: d } = e, h = Math.ceil(Math.sqrt(c ** 2 + d ** 2) * 2);
|
3240
3247
|
e.style.setProperty("--r", h), t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
|
3241
3248
|
}
|
3242
3249
|
}), e.addEventListener(o, function(a) {
|
@@ -3253,12 +3260,12 @@ class Ys {
|
|
3253
3260
|
}
|
3254
3261
|
init() {
|
3255
3262
|
const i = document.querySelectorAll("*:not([video-id]) > img"), t = (o, a) => {
|
3256
|
-
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"),
|
3263
|
+
const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), d = Math.sqrt(o ** 2 + a ** 2), h = Math.asin(a / d) * 180 / Math.PI;
|
3257
3264
|
return r.className = "no-image", l.className = "slash1", l.style.cssText = `
|
3258
|
-
width: ${
|
3265
|
+
width: ${d}px;
|
3259
3266
|
transform: rotate(${h}deg);
|
3260
3267
|
`, c.className = "slash2", c.style.cssText = `
|
3261
|
-
width: ${
|
3268
|
+
width: ${d}px;
|
3262
3269
|
transform: rotate(${-h}deg);
|
3263
3270
|
`, r.appendChild(l), r.appendChild(c), r;
|
3264
3271
|
}, e = document.querySelectorAll(".error-image");
|
@@ -3268,8 +3275,8 @@ class Ys {
|
|
3268
3275
|
let a;
|
3269
3276
|
const r = o.parentElement.clientWidth, l = o.parentElement.clientHeight;
|
3270
3277
|
if (o.classList.contains("lazy") || o.classList.contains("swiper-lazy") ? a = o.getAttribute("data-src") : a = o.getAttribute("src"), a === "") {
|
3271
|
-
const c = document.createElement("div"),
|
3272
|
-
c.className = "error-image",
|
3278
|
+
const c = document.createElement("div"), d = getComputedStyle(o.parentElement).position;
|
3279
|
+
c.className = "error-image", d === "static" && (o.parentElement.style.position = "relative"), o.parentElement.appendChild(c), c.style.cssText = `
|
3273
3280
|
position: absolute;
|
3274
3281
|
top: 50%;
|
3275
3282
|
left: 50%;
|
@@ -3283,13 +3290,13 @@ class Ys {
|
|
3283
3290
|
function s() {
|
3284
3291
|
const o = document.querySelectorAll(".no-image");
|
3285
3292
|
o.length <= 0 || o.forEach((a) => {
|
3286
|
-
const r = a.parentElement.clientWidth, l = a.parentElement.clientHeight, c = Math.sqrt(r ** 2 + l ** 2),
|
3293
|
+
const r = a.parentElement.clientWidth, l = a.parentElement.clientHeight, c = Math.sqrt(r ** 2 + l ** 2), d = Math.asin(l / c) * 180 / Math.PI;
|
3287
3294
|
a.querySelector(".slash1").style.cssText = `
|
3288
3295
|
width: ${c}px;
|
3289
|
-
transform: rotate(${
|
3296
|
+
transform: rotate(${d}deg);
|
3290
3297
|
`, a.querySelector(".slash2").style.cssText = `
|
3291
3298
|
width: ${c}px;
|
3292
|
-
transform: rotate(${-
|
3299
|
+
transform: rotate(${-d}deg);
|
3293
3300
|
`;
|
3294
3301
|
});
|
3295
3302
|
}
|
@@ -3311,8 +3318,8 @@ function Us(n, i, t, e) {
|
|
3311
3318
|
if (s.compress) {
|
3312
3319
|
const l = t.name.substring(t.name.lastIndexOf(".")).replace("."), c = t.name.replace(`.${l}`, "");
|
3313
3320
|
e.originalCanvas.toBlob(
|
3314
|
-
function(
|
3315
|
-
const h = new File([
|
3321
|
+
function(d) {
|
3322
|
+
const h = new File([d], `${c}`, { type: t.type });
|
3316
3323
|
uploadImage[`${a}`][r] = {
|
3317
3324
|
file: h,
|
3318
3325
|
info: e
|
@@ -3329,17 +3336,17 @@ function Us(n, i, t, e) {
|
|
3329
3336
|
}
|
3330
3337
|
function Js(n, i, t, e) {
|
3331
3338
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
3332
|
-
let
|
3339
|
+
let d = 0, h = 0;
|
3333
3340
|
switch (s.width = t, s.height = e, n.previewSize) {
|
3334
3341
|
case "contain":
|
3335
|
-
l < c ? (
|
3342
|
+
l < c ? (d = s.width, h = t * l / 100) : l > c ? (d = e / l * 100, h = s.height) : (d = s.width, h = s.height);
|
3336
3343
|
break;
|
3337
3344
|
case "cover":
|
3338
|
-
l < c ? (
|
3345
|
+
l < c ? (d = e / l * 100, h = s.height) : l > c ? (d = s.width, h = t * l / 100) : l === c && (d = s.width, h = s.height);
|
3339
3346
|
break;
|
3340
3347
|
}
|
3341
|
-
const m = (s.width -
|
3342
|
-
return o.drawImage(i, m, f,
|
3348
|
+
const m = (s.width - d) * 0.5, f = (s.height - h) * 0.5;
|
3349
|
+
return o.drawImage(i, m, f, d, h), s;
|
3343
3350
|
}
|
3344
3351
|
function Zs(n, i) {
|
3345
3352
|
return new Promise((t, e) => {
|