@xwadex/fesd 0.0.14-re.17 → 0.0.14-re.18
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/assets/fesd-bundle.js +602 -451
- package/dist/assets/fesd-bundle.js.map +1 -1
- package/dist/assets/image-preview-bundle.js +5408 -5559
- package/dist/assets/image-preview-bundle.js.map +1 -1
- package/dist/assets/tools-bundle.js +177 -188
- package/dist/assets/tools-bundle.js.map +1 -1
- package/package.json +1 -1
@@ -1,21 +1,21 @@
|
|
1
|
-
var
|
2
|
-
if (!e.has(
|
1
|
+
var be = (a, e, t) => {
|
2
|
+
if (!e.has(a))
|
3
3
|
throw TypeError("Cannot " + t);
|
4
4
|
};
|
5
|
-
var
|
6
|
-
if (e.has(
|
5
|
+
var h = (a, e, t) => {
|
6
|
+
if (e.has(a))
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
8
|
-
e instanceof WeakSet ? e.add(
|
8
|
+
e instanceof WeakSet ? e.add(a) : e.set(a, t);
|
9
9
|
};
|
10
|
-
var o = (
|
11
|
-
import { i as
|
12
|
-
import { A as
|
13
|
-
const
|
14
|
-
const
|
10
|
+
var o = (a, e, t) => (be(a, e, "access private method"), t);
|
11
|
+
import { E as Pt, i as wt, a as Gt, b as j, e as It, g as Et, c as g, w as x, d as ye, M as we, v as X, s as Ee, f as $e, h as U, j as Ae, S as Le, k as Se, l as Te, m as E, n as A, o as xe } from "./image-preview-bundle.js";
|
12
|
+
import { A as Qe, q as Ze, p as ts, D as es, r as ss, I as is, R as as, T as rs } from "./image-preview-bundle.js";
|
13
|
+
const D = () => {
|
14
|
+
const a = navigator.userAgent, e = {
|
15
15
|
// Firefox 1.0+
|
16
16
|
isFirefox: typeof InstallTrigger < "u",
|
17
17
|
// Opera 8.0+
|
18
|
-
isOpera: !!window.opr && !!opr.addons || !!window.opera ||
|
18
|
+
isOpera: !!window.opr && !!opr.addons || !!window.opera || a.indexOf(" OPR/") >= 0,
|
19
19
|
// Internet Explorer 6-11
|
20
20
|
isIE: (
|
21
21
|
/*@cc_on!@*/
|
@@ -24,95 +24,196 @@ const I = () => {
|
|
24
24
|
// Edge 20+
|
25
25
|
isEdge: !document.documentMode && !!window.StyleMedia,
|
26
26
|
// Edge (based on chromium) detection
|
27
|
-
isEdgeChromium: /\sedg\//i.test(
|
27
|
+
isEdgeChromium: /\sedg\//i.test(a) || /edg([ea]|ios)/i.test(a),
|
28
28
|
// Safari 3.0+ "[object HTMLElementConstructor]"
|
29
|
-
isSafari: !/chrome|crios|crmo/i.test(
|
29
|
+
isSafari: !/chrome|crios|crmo/i.test(a) && /safari/i.test(a),
|
30
30
|
// Chrome 1 - 79
|
31
|
-
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(
|
31
|
+
isChrome: !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime) || /chrome|crios|crmo/i.test(a)
|
32
32
|
}, t = {
|
33
33
|
// Android
|
34
|
-
isAndroid:
|
34
|
+
isAndroid: a.indexOf("Android") > -1 || a.indexOf("Adr") > -1,
|
35
35
|
// iOS | ipad
|
36
|
-
isiOS:
|
36
|
+
isiOS: a.indexOf("Mac") > -1 && "ontouchend" in document
|
37
37
|
}, s = {
|
38
38
|
// window
|
39
|
-
isWindows:
|
39
|
+
isWindows: a.indexOf("Win") > -1,
|
40
40
|
// macos
|
41
|
-
isMacOS:
|
41
|
+
isMacOS: a.indexOf("Mac") > -1,
|
42
42
|
// UNIX
|
43
|
-
isUNIX:
|
43
|
+
isUNIX: a.indexOf("X11") > -1,
|
44
44
|
// Linux
|
45
|
-
isLinux:
|
45
|
+
isLinux: a.indexOf("Linux") > -1
|
46
46
|
};
|
47
47
|
return { browser: e, mobile: t, os: s };
|
48
|
-
},
|
49
|
-
const { browser:
|
50
|
-
return Object.keys(
|
51
|
-
if (
|
52
|
-
return
|
48
|
+
}, ke = () => {
|
49
|
+
const { browser: a } = D();
|
50
|
+
return Object.keys(a).find((e) => {
|
51
|
+
if (a[e])
|
52
|
+
return a[e];
|
53
53
|
});
|
54
|
-
},
|
55
|
-
const { mobile:
|
56
|
-
return Object.keys(
|
57
|
-
if (
|
58
|
-
return
|
54
|
+
}, qe = () => {
|
55
|
+
const { mobile: a } = D();
|
56
|
+
return Object.keys(a).some((e) => {
|
57
|
+
if (a[e])
|
58
|
+
return a[e];
|
59
59
|
});
|
60
|
-
},
|
61
|
-
const { os:
|
62
|
-
return Object.keys(
|
63
|
-
if (
|
64
|
-
return
|
60
|
+
}, _e = () => {
|
61
|
+
const { os: a } = D();
|
62
|
+
return Object.keys(a).find((e) => {
|
63
|
+
if (a[e])
|
64
|
+
return a[e];
|
65
65
|
});
|
66
|
-
},
|
67
|
-
function
|
66
|
+
}, Ce = () => console.dir(D());
|
67
|
+
function Pe() {
|
68
68
|
return {
|
69
|
-
init:
|
70
|
-
isBrowser4:
|
71
|
-
isMobile4:
|
72
|
-
isOs4:
|
73
|
-
logs:
|
69
|
+
init: D,
|
70
|
+
isBrowser4: ke,
|
71
|
+
isMobile4: qe,
|
72
|
+
isOs4: _e,
|
73
|
+
logs: Ce
|
74
74
|
};
|
75
75
|
}
|
76
|
-
const
|
77
|
-
|
76
|
+
const Ot = (a) => a.videoId !== "" || typeof a.videoId < "u", We = (a) => a.$selector.getAttribute("video4-active") === "on", Lt = (a) => `<video-player video-id="${a.videoId}" video-type="${a.videoType}" video-autoplay="${a.videoAutoplay}"></video-player>`;
|
77
|
+
var _, xt, V, zt, Y, Ut, C, kt, J, Ft;
|
78
|
+
class Me extends Pt {
|
79
|
+
constructor(t, s = {}) {
|
80
|
+
super();
|
81
|
+
h(this, _);
|
82
|
+
h(this, V);
|
83
|
+
h(this, Y);
|
84
|
+
h(this, C);
|
85
|
+
h(this, J);
|
86
|
+
if (!wt(t) && !Gt(t) && !j(t)) {
|
87
|
+
It("video4", `找不到該物件 -> ${t}`);
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
this.__storage__ = {
|
91
|
+
el: t,
|
92
|
+
options: s
|
93
|
+
}, o(this, _, xt).call(this);
|
94
|
+
}
|
95
|
+
update() {
|
96
|
+
o(this, _, xt).call(this);
|
97
|
+
}
|
98
|
+
}
|
99
|
+
_ = new WeakSet(), xt = function() {
|
100
|
+
const { el: t, options: s } = this.__storage__, { SETTINGS: i, EVENTS: r } = X;
|
101
|
+
if (this.elements = Et(t), this.options = Object.assign({}, i, s), this.__events__ = Object.assign({}, r), this.options.on)
|
102
|
+
for (const [n, l] of Object.entries(this.options.on))
|
103
|
+
this.__events__[n] = [l];
|
104
|
+
o(this, V, zt).call(this);
|
105
|
+
}, V = new WeakSet(), zt = function() {
|
106
|
+
const { elements: t, options: s } = this;
|
107
|
+
t.forEach((i) => {
|
108
|
+
i.video = {}, i.video.instance = this, i.video.defaultOptions = s, i.video.params = o(this, J, Ft).call(this, i), i.video.methods = {}, i.video.methods.update = this.update, Ot(i.video.params) && !We(i.video.params) && (i.setAttribute("video4-active", "on"), o(this, Y, Ut).call(this, i)), Ot(i.video.params) || It("video4", "無法取得影片 ID");
|
109
|
+
}), this.emit("init");
|
110
|
+
}, Y = new WeakSet(), Ut = function(t) {
|
111
|
+
const { LAYOUT: s } = X, i = t.video.params, { $selector: r, videoLayoutNo: n, videoId: l, videoType: u, videoMode: p, videoButton: d, videoCover: c } = i;
|
112
|
+
if (p === "onBox") {
|
113
|
+
let m = null;
|
114
|
+
if (c === "on") {
|
115
|
+
t.classList.add("video4-cover"), r.querySelector("img") || (r.insertAdjacentHTML(g.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), x("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
116
|
+
const f = r.querySelector("img");
|
117
|
+
f.insertAdjacentHTML(g.after, s[n]);
|
118
|
+
const v = (f == null ? void 0 : f.getAttribute("src")) || (f == null ? void 0 : f.getAttribute("data-src"));
|
119
|
+
!v && u == "youtube" ? f.setAttribute("src", `https://img.youtube.com/vi/${l}/0.jpg`) : !v && u == "vimeo" ? f.setAttribute("src", `https://vumbnail.com/${l}_large.jpg`) : x("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
120
|
+
}
|
121
|
+
d == "off" ? m = r : (m = r.querySelector(d) ?? r, r.querySelector(d) || x("video4", `找不到 videoButton 設定的 element -> '${d}' , 點擊物件轉移至 '${this.__storage__.el}'`)), m.video || (m.video = {}, m.video.params = i), m.video.eventHandler = o(this, C, kt), m.addEventListener("click", m.video.eventHandler);
|
122
|
+
} else if (p === "onPage") {
|
123
|
+
let m = null;
|
124
|
+
if (c == "on") {
|
125
|
+
t.classList.add("video4-cover"), r.querySelector("img") || (r.insertAdjacentHTML(g.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), x("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
126
|
+
const f = r.querySelector("img");
|
127
|
+
f.insertAdjacentHTML(g.after, s[n]);
|
128
|
+
const v = (f == null ? void 0 : f.getAttribute("src")) || (f == null ? void 0 : f.getAttribute("data-src"));
|
129
|
+
!v && u == "youtube" ? f.setAttribute("src", `https://img.youtube.com/vi/${l}/0.jpg`) : !v && u == "vimeo" ? f.setAttribute("src", `https://vumbnail.com/${l}_large.jpg`) : v || x("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), d == "off" ? m = r : (m = r.querySelector(d) ?? r, r.querySelector(d) || x("video4", `找不到 videoButton 設定的 element -> '${d}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
130
|
+
} else {
|
131
|
+
r.innerHTML = Lt(i);
|
132
|
+
return;
|
133
|
+
}
|
134
|
+
m.video || (m.video = {}, m.video.params = i), m.video.eventHandler = o(this, C, kt), m.addEventListener("click", m.video.eventHandler);
|
135
|
+
}
|
136
|
+
}, C = new WeakSet(), kt = function(t) {
|
137
|
+
const { video: s } = this, { $selector: i, videoMode: r, videoTarget: n, videoTargetRoute: l } = s.params, u = new ye({ callback_loaded: (p) => {
|
138
|
+
} });
|
139
|
+
if (r == "onBox") {
|
140
|
+
const p = {
|
141
|
+
target: n,
|
142
|
+
route: l,
|
143
|
+
on: {
|
144
|
+
complete(d) {
|
145
|
+
d.querySelector(".modal-content").insertAdjacentHTML("beforeend", Lt(s.params));
|
146
|
+
},
|
147
|
+
open(d) {
|
148
|
+
const c = d.querySelectorAll("[data-overlayscrollbars-viewport]");
|
149
|
+
u.update(), Ee([...c]);
|
150
|
+
},
|
151
|
+
close(d) {
|
152
|
+
const c = d.querySelectorAll("[data-overlayscrollbars-viewport]");
|
153
|
+
$e([...c]);
|
154
|
+
},
|
155
|
+
destroy(d) {
|
156
|
+
}
|
157
|
+
}
|
158
|
+
};
|
159
|
+
we.open(p);
|
160
|
+
} else
|
161
|
+
r == "onPage" && (s.params.videoAutoplay = "on", i.innerHTML = Lt(s.params));
|
162
|
+
}, J = new WeakSet(), Ft = function(t) {
|
163
|
+
const { SETTINGS: s } = X;
|
164
|
+
return {
|
165
|
+
$selector: t,
|
166
|
+
videoId: t.getAttribute("video-id"),
|
167
|
+
videoType: t.getAttribute("video-type"),
|
168
|
+
videoAutoplay: t.getAttribute("video-autoplay") || s.videoAutoplay,
|
169
|
+
videoMode: t.getAttribute("video-mode") || s.videoMode,
|
170
|
+
videoButton: t.getAttribute("video-button") || s.videoButton,
|
171
|
+
videoCover: t.getAttribute("video-cover") || s.videoCover,
|
172
|
+
videoLayoutNo: t.getAttribute("video-layout-no") || s.videoLayoutNo,
|
173
|
+
videoTarget: t.getAttribute("video-target") || s.videoTarget,
|
174
|
+
videoTargetRoute: t.getAttribute("video-target-route") || s.videoTargetRoute
|
175
|
+
};
|
78
176
|
};
|
79
|
-
|
80
|
-
|
177
|
+
const b = (a, e, t) => {
|
178
|
+
a && (j(a) ? a.forEach((s) => s.style[e] = t) : a.style[e] = t);
|
179
|
+
};
|
180
|
+
var K, Vt, Q, Yt, W, qt, Z, Jt, M, _t, tt, Kt;
|
181
|
+
class Ge {
|
81
182
|
constructor(e, t = {}) {
|
82
|
-
|
83
|
-
|
183
|
+
h(this, K);
|
184
|
+
h(this, Q);
|
84
185
|
// 取得元件上的設定值
|
85
|
-
|
186
|
+
h(this, W);
|
86
187
|
// 設置設定值的 CSS 樣式
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
188
|
+
h(this, Z);
|
189
|
+
h(this, M);
|
190
|
+
h(this, tt);
|
191
|
+
!wt(e) || !U(e) || (this.__storage__ = {
|
91
192
|
el: e,
|
92
193
|
options: t
|
93
|
-
}, o(this,
|
194
|
+
}, o(this, K, Vt).call(this));
|
94
195
|
}
|
95
196
|
update() {
|
96
197
|
const { elements: e } = this;
|
97
198
|
e.forEach((t) => {
|
98
199
|
t.querySelectorAll("._article").forEach((s) => {
|
99
|
-
s.article = {}, s.article.parent = t, s.article.params = o(this, W,
|
200
|
+
s.article = {}, s.article.parent = t, s.article.params = o(this, W, qt).call(this, s), o(this, M, _t).call(this, s);
|
100
201
|
});
|
101
202
|
});
|
102
203
|
}
|
103
204
|
}
|
104
|
-
|
105
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS: s } =
|
106
|
-
this.elements =
|
107
|
-
},
|
205
|
+
K = new WeakSet(), Vt = function() {
|
206
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Se;
|
207
|
+
this.elements = Et(e), this.options = Object.assign({}, s, t), o(this, Q, Yt).call(this);
|
208
|
+
}, Q = new WeakSet(), Yt = function() {
|
108
209
|
const { elements: e } = this;
|
109
210
|
e.forEach((t) => {
|
110
211
|
t.querySelectorAll("._article").forEach((s) => {
|
111
|
-
var
|
112
|
-
s.article = {}, s.article.parent = t, s.article.params = o(this, W,
|
212
|
+
var i, r;
|
213
|
+
s.article = {}, s.article.parent = t, s.article.params = o(this, W, qt).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, o(r = o(i = o(this, Z, Jt).call(this, s), M, _t).call(i, s), tt, Kt).call(r, s);
|
113
214
|
});
|
114
215
|
});
|
115
|
-
}, W = new WeakSet(),
|
216
|
+
}, W = new WeakSet(), qt = function(e) {
|
116
217
|
return {
|
117
218
|
// 元件本身
|
118
219
|
$selector: e,
|
@@ -144,171 +245,171 @@ B = new WeakSet(), At = function() {
|
|
144
245
|
buttonTextColor: e.getAttribute("button-textcolor"),
|
145
246
|
descriptionColor: e.getAttribute("description-color")
|
146
247
|
};
|
147
|
-
},
|
248
|
+
}, Z = new WeakSet(), Jt = function(e) {
|
148
249
|
const { params: t } = e.article;
|
149
|
-
return
|
150
|
-
},
|
250
|
+
return b(t.$h, "color", t.hColor), b(t.$subH, "color", t.subHColor), b(t.$p, "color", t.pColor), b(t.$description, "color", t.descriptionColor), b(t.$button, "backgroundColor", t.buttonColor), b(t.$button, "color", t.buttonTextColor), t.buttonColorHover && t.$button && (t.$button.appendChild(document.createElement("span")), b(t.$button.querySelector("span"), "backgroundColor", t.buttonColorHover)), b(t.$backgroundWrap, "backgroundColor", t.typeFullColor), b(t.$contentWrap, "backgroundColor", t.typeFullBoxColor), this;
|
251
|
+
}, M = new WeakSet(), _t = function(e) {
|
151
252
|
const { params: t } = e.article;
|
152
|
-
return t.$video.length && new
|
153
|
-
},
|
253
|
+
return t.$video.length && new Me(t.$video), this;
|
254
|
+
}, tt = new WeakSet(), Kt = function(e) {
|
154
255
|
const { basic_rwd: t } = this.options, { params: s } = e.article;
|
155
256
|
if (!s.$swiper)
|
156
257
|
return;
|
157
|
-
const
|
158
|
-
let
|
258
|
+
const i = Ae(), r = this;
|
259
|
+
let n = {
|
159
260
|
on: {
|
160
|
-
init(
|
161
|
-
const
|
162
|
-
s.$video.length && ([...
|
163
|
-
var
|
164
|
-
(
|
165
|
-
}),
|
261
|
+
init(p) {
|
262
|
+
const d = p.$el[0];
|
263
|
+
s.$video.length && ([...d.querySelectorAll("[video4-active]")].forEach((m) => {
|
264
|
+
var f, v;
|
265
|
+
(f = m.querySelector(X.SETTINGS.videoButton)) == null || f.remove(), (v = m.querySelector(".overlay")) == null || v.remove(), m.removeAttribute("video4-active");
|
266
|
+
}), r.update());
|
166
267
|
},
|
167
|
-
observerUpdate(
|
168
|
-
|
268
|
+
observerUpdate(p) {
|
269
|
+
p.params.autoplay.enabled && (p.autoplay.start(), p.update());
|
169
270
|
}
|
170
271
|
},
|
171
272
|
observer: !0,
|
172
273
|
breakpoints: {}
|
173
274
|
};
|
174
|
-
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${
|
175
|
-
const
|
176
|
-
|
177
|
-
const
|
178
|
-
|
179
|
-
nextEl: `.swiper-button-next.swiper-${
|
180
|
-
prevEl: `.swiper-button-prev.swiper-${
|
275
|
+
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${i}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
276
|
+
const p = document.createElement("div");
|
277
|
+
p.className = `swiper-button-next swiper-${i}`, s.$swiperButtonCover.appendChild(p);
|
278
|
+
const d = document.createElement("div");
|
279
|
+
d.className = `swiper-button-prev swiper-${i}`, s.$swiperButtonCover.appendChild(d), n.navigation = {
|
280
|
+
nextEl: `.swiper-button-next.swiper-${i}`,
|
281
|
+
prevEl: `.swiper-button-prev.swiper-${i}`
|
181
282
|
};
|
182
283
|
}
|
183
284
|
if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
|
184
|
-
const
|
185
|
-
|
186
|
-
el: `.swiper-pagination.swiper-${
|
285
|
+
const p = document.createElement("div");
|
286
|
+
p.className = `swiper-pagination swiper-${i}`, s.$swiper.appendChild(p), n.pagination = {
|
287
|
+
el: `.swiper-pagination.swiper-${i}`,
|
187
288
|
clickable: !0
|
188
289
|
};
|
189
290
|
}
|
190
|
-
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (
|
291
|
+
Number.parseInt(s.$selector.getAttribute("swiper-num")) && (n.breakpoints[t] = {
|
191
292
|
slidesPerView: s.$selector.getAttribute("swiper-num") ? Number.parseInt(s.$selector.getAttribute("swiper-num")) > 5 ? 5 : Number.parseInt(s.$selector.getAttribute("swiper-num")) : 1
|
192
|
-
}), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (
|
293
|
+
}), (s.$selector.getAttribute("swiper-autoplay") !== "off" || !s.$selector.getAttribute("swiper-autoplay")) && (n.autoplay = {
|
193
294
|
delay: 3e3,
|
194
295
|
disableOnInteraction: !1
|
195
|
-
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (
|
296
|
+
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (n.loop = !0), s.$selector.getAttribute("swiper-speed") && (n.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (n.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (n.pagination.dynamicBullets = !0);
|
196
297
|
let l = () => window.innerWidth > this.basic_rwd && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
197
|
-
s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (
|
198
|
-
const
|
199
|
-
return e.article.swiperList = [], e.article.swiperList.push(
|
298
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= l() && (n.navigation = !1, n.pagination = !1, n.autoplay = !1, n.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
|
299
|
+
const u = new Le(s.$swiper, n);
|
300
|
+
return e.article.swiperList = [], e.article.swiperList.push(u), this;
|
200
301
|
};
|
201
|
-
let
|
202
|
-
function L(
|
203
|
-
const e = window.getComputedStyle(
|
302
|
+
let Nt = "ontouchstart" in document.documentElement ? "touchstart" : "mousedown", jt = "ontouchend" in document.documentElement ? "touchend" : "mouseup", St = "ontouchmove" in document.documentElement ? "touchmove" : "mousemove";
|
303
|
+
function L(a) {
|
304
|
+
const e = window.getComputedStyle(a), t = e.transform || e.mozTransform;
|
204
305
|
if (t === "none")
|
205
306
|
return {
|
206
307
|
x: 0,
|
207
308
|
y: 0,
|
208
309
|
z: 0
|
209
310
|
};
|
210
|
-
const s = t.includes("3d") ? "3d" : "2d",
|
311
|
+
const s = t.includes("3d") ? "3d" : "2d", i = t.match(/matrix.*\((.+)\)/)[1].split(", ");
|
211
312
|
if (s === "2d")
|
212
313
|
return {
|
213
|
-
x: Number(
|
214
|
-
y: Number(
|
314
|
+
x: Number(i[4]),
|
315
|
+
y: Number(i[5]),
|
215
316
|
z: 0
|
216
317
|
};
|
217
318
|
if (s === "3d")
|
218
319
|
return {
|
219
|
-
x: Number(
|
220
|
-
y: Number(
|
221
|
-
z: Number(
|
320
|
+
x: Number(i[12]),
|
321
|
+
y: Number(i[13]),
|
322
|
+
z: Number(i[14])
|
222
323
|
};
|
223
324
|
}
|
224
|
-
function
|
225
|
-
const t =
|
325
|
+
function R(a) {
|
326
|
+
const t = a.querySelector(".wrapper").querySelectorAll(".item");
|
226
327
|
let s = 0;
|
227
|
-
return t.forEach((
|
228
|
-
const
|
229
|
-
s +=
|
328
|
+
return t.forEach((i) => {
|
329
|
+
const r = getComputedStyle(i), n = parseInt(r.marginLeft), l = parseInt(r.marginRight);
|
330
|
+
s += i.getBoundingClientRect().width + n + l;
|
230
331
|
}), s;
|
231
332
|
}
|
232
|
-
function
|
233
|
-
if (L(
|
333
|
+
function Tt(a) {
|
334
|
+
if (L(a.slideWrapEl).x >= a.translateMin)
|
234
335
|
return "is-start";
|
235
|
-
if (L(
|
336
|
+
if (L(a.slideWrapEl).x <= a.translateMax)
|
236
337
|
return "is-end";
|
237
|
-
if (L(
|
338
|
+
if (L(a.slideWrapEl).x < a.translateMin && L(a.slideWrapEl).x > a.translateMax)
|
238
339
|
return "is-middle";
|
239
340
|
}
|
240
|
-
function
|
241
|
-
const e =
|
242
|
-
t.addEventListener(
|
243
|
-
switch (
|
341
|
+
function He(a) {
|
342
|
+
const e = a.el, t = e.querySelector(".wrapper");
|
343
|
+
t.addEventListener(Nt, function(s) {
|
344
|
+
switch (a.isDown = !0, a.slidable && t.classList.add("dragging"), Nt) {
|
244
345
|
case "mousedown":
|
245
|
-
|
346
|
+
a.startX = s.pageX;
|
246
347
|
break;
|
247
348
|
case "touchstart":
|
248
|
-
|
349
|
+
a.startX = s.changedTouches[0].pageX;
|
249
350
|
break;
|
250
351
|
}
|
251
|
-
|
252
|
-
}), t.addEventListener(
|
253
|
-
|
254
|
-
let
|
255
|
-
switch (
|
352
|
+
a.nowTranslateX = L(t).x;
|
353
|
+
}), t.addEventListener(jt, function(s) {
|
354
|
+
a.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving");
|
355
|
+
let i;
|
356
|
+
switch (St) {
|
256
357
|
case "mousemove":
|
257
|
-
|
358
|
+
i = s.pageX - a.startX;
|
258
359
|
break;
|
259
360
|
case "touchmove":
|
260
|
-
|
361
|
+
i = s.changedTouches[0].pageX - a.startX;
|
261
362
|
break;
|
262
363
|
}
|
263
|
-
if (
|
264
|
-
if (
|
364
|
+
if (i === 0 && s.target.closest(".item")) {
|
365
|
+
if (jt === "mouseup" && s.button !== 0)
|
265
366
|
return;
|
266
|
-
t.querySelectorAll(".item").forEach((
|
267
|
-
|
268
|
-
}), s.target.closest(".item").classList.add("active"),
|
367
|
+
t.querySelectorAll(".item").forEach((n) => {
|
368
|
+
n.classList.remove("active");
|
369
|
+
}), s.target.closest(".item").classList.add("active"), a.moveActive(a.params.speed);
|
269
370
|
} else
|
270
|
-
|
371
|
+
a.slidable && a.resetPos(e);
|
271
372
|
}), t.addEventListener("mouseleave", function() {
|
272
|
-
|
273
|
-
}), t.addEventListener(
|
274
|
-
if (
|
275
|
-
if (!
|
373
|
+
a.isDown && a.slidable && (a.isDown = !1, t.classList.remove("dragging"), t.classList.remove("moving"), a.resetPos(e));
|
374
|
+
}), t.addEventListener(St, function(s) {
|
375
|
+
if (a.draggable && a.slidable) {
|
376
|
+
if (!a.isDown)
|
276
377
|
return;
|
277
378
|
s.preventDefault();
|
278
|
-
let
|
279
|
-
switch (
|
379
|
+
let i;
|
380
|
+
switch (St) {
|
280
381
|
case "mousemove":
|
281
|
-
|
382
|
+
i = s.pageX - a.startX;
|
282
383
|
break;
|
283
384
|
case "touchmove":
|
284
|
-
|
385
|
+
i = s.changedTouches[0].pageX - a.startX;
|
285
386
|
break;
|
286
387
|
}
|
287
|
-
if (
|
388
|
+
if (i !== 0) {
|
288
389
|
t.classList.add("moving");
|
289
|
-
const
|
390
|
+
const r = {
|
290
391
|
transition: "all 0ms ease 0s",
|
291
|
-
transform: `translate3d(${
|
392
|
+
transform: `translate3d(${a.nowTranslateX + i}px,0,0)`
|
292
393
|
};
|
293
|
-
Object.assign(t.style,
|
394
|
+
Object.assign(t.style, r);
|
294
395
|
}
|
295
396
|
}
|
296
397
|
});
|
297
398
|
}
|
298
|
-
function
|
299
|
-
const e =
|
399
|
+
function Ie(a) {
|
400
|
+
const e = a.querySelectorAll("a");
|
300
401
|
for (var t = 0, s = e.length; t < s; t++)
|
301
402
|
e[t].draggable = !1;
|
302
403
|
}
|
303
|
-
class
|
404
|
+
class ze {
|
304
405
|
constructor(e, t) {
|
305
406
|
this.el = typeof e == "string" ? document.querySelector(e) : e, this.slideWrapEl = this.el.querySelector(".wrapper"), this.params = {
|
306
407
|
speed: 300,
|
307
408
|
clickSwitch: !0,
|
308
409
|
breakpoint: !1
|
309
|
-
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = L(this.slideWrapEl).x, this.slideTotalWidth =
|
410
|
+
}, Object.assign(this.params, t), this.draggable = !0, this.isDown = !1, this.startX = 0, this.nowTranslateX = L(this.slideWrapEl).x, this.slideTotalWidth = R(this.el), this.translateMin = 0, this.translateMax = -Math.floor(
|
310
411
|
Math.abs(
|
311
|
-
|
412
|
+
R(this.el) - this.el.querySelector(".wrapper").getBoundingClientRect().width
|
312
413
|
)
|
313
414
|
), this.slidable = this.slideTotalWidth > Math.round(this.el.getBoundingClientRect().width) && (!this.params.breakpoint || window.innerWidth <= this.params.breakpoint), this.init();
|
314
415
|
}
|
@@ -316,35 +417,35 @@ class me {
|
|
316
417
|
const e = this;
|
317
418
|
e.slidable && (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()), window.addEventListener("resize", function() {
|
318
419
|
e.update();
|
319
|
-
}),
|
420
|
+
}), He(e), Ie(e.el);
|
320
421
|
}
|
321
422
|
moveActive(e) {
|
322
|
-
const t = this, s = t.slideWrapEl.querySelector(".item.active"),
|
423
|
+
const t = this, s = t.slideWrapEl.querySelector(".item.active"), r = s.previousElementSibling ? s.offsetLeft - t.el.clientWidth / 2 + s.clientWidth / 2 : 0;
|
323
424
|
if (t.slidable) {
|
324
|
-
if (-
|
325
|
-
const
|
425
|
+
if (-r < 0 && -r > t.translateMax) {
|
426
|
+
const n = {
|
326
427
|
transition: `all ${e || 0}ms ease 0s`,
|
327
|
-
transform: `translate3d(-${
|
428
|
+
transform: `translate3d(-${r}px,0,0)`
|
328
429
|
};
|
329
|
-
Object.assign(t.slideWrapEl.style,
|
330
|
-
} else if (-
|
331
|
-
const
|
430
|
+
Object.assign(t.slideWrapEl.style, n);
|
431
|
+
} else if (-r >= 0) {
|
432
|
+
const n = {
|
332
433
|
transition: `all ${e || 0}ms ease 0s`,
|
333
434
|
transform: "translate3d(0,0,0)"
|
334
435
|
};
|
335
|
-
Object.assign(t.slideWrapEl.style,
|
436
|
+
Object.assign(t.slideWrapEl.style, n);
|
336
437
|
} else {
|
337
|
-
const
|
438
|
+
const n = {
|
338
439
|
transition: `all ${e || 0}ms ease 0s`,
|
339
440
|
transform: `translate3d(${t.translateMax}px,0,0)`
|
340
441
|
};
|
341
|
-
Object.assign(t.slideWrapEl.style,
|
442
|
+
Object.assign(t.slideWrapEl.style, n);
|
342
443
|
}
|
343
444
|
if (e)
|
344
445
|
t.slideWrapEl.addEventListener(
|
345
446
|
"transitionend",
|
346
447
|
function() {
|
347
|
-
switch (t.nowTranslateX = L(t.slideWrapEl).x,
|
448
|
+
switch (t.nowTranslateX = L(t.slideWrapEl).x, Tt(t)) {
|
348
449
|
case "is-start":
|
349
450
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
350
451
|
break;
|
@@ -359,7 +460,7 @@ class me {
|
|
359
460
|
!1
|
360
461
|
);
|
361
462
|
else
|
362
|
-
switch (t.nowTranslateX = L(t.slideWrapEl).x,
|
463
|
+
switch (t.nowTranslateX = L(t.slideWrapEl).x, Tt(t)) {
|
363
464
|
case "is-start":
|
364
465
|
t.el.classList.add("is-start"), t.el.classList.remove("is-end");
|
365
466
|
break;
|
@@ -374,7 +475,7 @@ class me {
|
|
374
475
|
}
|
375
476
|
resetPos() {
|
376
477
|
const e = this;
|
377
|
-
switch (
|
478
|
+
switch (Tt(e)) {
|
378
479
|
case "is-start":
|
379
480
|
e.el.classList.add("is-start"), e.el.classList.remove("is-end"), Object.assign(e.slideWrapEl.style, {
|
380
481
|
transition: `all ${e.params.speed}ms ease 0s`,
|
@@ -394,212 +495,212 @@ class me {
|
|
394
495
|
}
|
395
496
|
update() {
|
396
497
|
const e = this;
|
397
|
-
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth =
|
498
|
+
e.el.querySelector(".wrapper").removeAttribute("style"), e.slideTotalWidth = R(e.el), e.translateMax = -Math.floor(
|
398
499
|
Math.abs(
|
399
|
-
|
500
|
+
R(e.el) - e.el.querySelector(".wrapper").getBoundingClientRect().width
|
400
501
|
)
|
401
502
|
), e.slidable = e.slideTotalWidth > Math.round(e.el.getBoundingClientRect().width) && (!e.params.breakpoint || window.innerWidth <= e.params.breakpoint), e.slidable ? (e.slideWrapEl.style.width = `${e.slideTotalWidth}px`, e.el.classList.add("slidable"), e.slideWrapEl.querySelector(".item.active") && e.moveActive()) : (e.el.classList.remove("slidable"), e.el.classList.remove("is-start"), e.el.classList.remove("is-end"), e.slideWrapEl.removeAttribute("style"));
|
402
503
|
}
|
403
504
|
}
|
404
|
-
const
|
405
|
-
if (
|
505
|
+
const Dt = (a) => {
|
506
|
+
if (a == "facebook")
|
406
507
|
return "https://www.facebook.com/sharer/sharer.php?u=";
|
407
|
-
if (
|
508
|
+
if (a == "line")
|
408
509
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "http://line.naver.jp/R/msg/text/?" : "https://lineit.line.me/share/ui?url=";
|
409
|
-
if (
|
510
|
+
if (a == "twitter")
|
410
511
|
return "https://twitter.com/intent/tweet?url=";
|
411
|
-
if (
|
512
|
+
if (a == "linkedin")
|
412
513
|
return `http://www.linkedin.com/shareArticle?mini=true&title=${document.title}&source=${document.title}&url=`;
|
413
|
-
if (
|
514
|
+
if (a == "telegram")
|
414
515
|
return "https://telegram.me/share/url?url=";
|
415
516
|
};
|
416
|
-
var
|
417
|
-
class
|
517
|
+
var et, Qt, st, Zt, it, te;
|
518
|
+
class Ue {
|
418
519
|
constructor(e, t = {}) {
|
419
|
-
|
420
|
-
|
421
|
-
|
520
|
+
h(this, et);
|
521
|
+
h(this, st);
|
522
|
+
h(this, it);
|
422
523
|
this.__storage__ = {
|
423
524
|
el: e,
|
424
525
|
options: t
|
425
|
-
}, o(this,
|
526
|
+
}, o(this, et, Qt).call(this);
|
426
527
|
}
|
427
528
|
}
|
428
|
-
|
429
|
-
const { el: e, options: t } = this.__storage__, { SETTINGS: s } =
|
430
|
-
|
431
|
-
},
|
529
|
+
et = new WeakSet(), Qt = function() {
|
530
|
+
const { el: e, options: t } = this.__storage__, { SETTINGS: s } = Te;
|
531
|
+
!wt(e) || !U(e) || (this.elements = Et(e), this.options = Object.assign({}, s, t), o(this, st, Zt).call(this));
|
532
|
+
}, st = new WeakSet(), Zt = function() {
|
432
533
|
const { elements: e, options: t } = this;
|
433
534
|
e.forEach((s) => {
|
434
|
-
s.querySelectorAll("[share-target]").forEach((
|
435
|
-
|
535
|
+
s.querySelectorAll("[share-target]").forEach((i) => {
|
536
|
+
i.share = {}, i.share.instance = this, i.share.params = t, i.share.eventHandler = o(this, it, te), i.addEventListener("click", i.share.eventHandler);
|
436
537
|
});
|
437
538
|
});
|
438
|
-
},
|
439
|
-
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"),
|
539
|
+
}, it = new WeakSet(), te = function() {
|
540
|
+
const { eventHandler: e, params: t } = this.share, s = this.getAttribute("share-target"), i = {
|
440
541
|
source: this.getAttribute("utm-source"),
|
441
542
|
medium: this.getAttribute("utm-medium"),
|
442
543
|
campaign: this.getAttribute("utm-campaign")
|
443
|
-
},
|
544
|
+
}, r = {
|
444
545
|
success: this.getAttribute("copy-success") || t.success,
|
445
546
|
text: this.getAttribute("copy-text") || t.text,
|
446
547
|
className: this.getAttribute("copy-class") || t.className,
|
447
548
|
duration: this.getAttribute("copy-duration") || t.duration
|
448
|
-
},
|
449
|
-
let l =
|
549
|
+
}, n = encodeURIComponent(document.URL);
|
550
|
+
let l = n;
|
450
551
|
if (s == "wechat") {
|
451
|
-
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${
|
552
|
+
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${n}&size=250x250`, "share to wechat", "width=300,height=300");
|
452
553
|
return;
|
453
554
|
}
|
454
555
|
if (s == "url") {
|
455
|
-
if (
|
556
|
+
if (U(".copied-wrapper"))
|
456
557
|
return;
|
457
|
-
document.querySelector("body").insertAdjacentHTML(
|
458
|
-
const
|
459
|
-
|
460
|
-
const
|
461
|
-
if (
|
558
|
+
document.querySelector("body").insertAdjacentHTML(g.append, `<div class='copied-wrapper'><div class='text'>${r.success ? r.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
559
|
+
const u = document.querySelector(".copied-wrapper");
|
560
|
+
r.className && u.classList.add(r.className), u.style.top = this.getBoundingClientRect().top + window.scrollY + "px", u.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", u.style.display = "block";
|
561
|
+
const p = document.querySelector("#clipboard");
|
562
|
+
if (p.value = r.text ?? window.location.href, p.setSelectionRange(0, 9999), p.select(), document.execCommand("copy")) {
|
462
563
|
document.execCommand("copy");
|
463
|
-
const
|
464
|
-
|
465
|
-
const
|
564
|
+
const d = document.querySelector(".copied-wrapper"), c = document.querySelector(".copied-wrapper .text");
|
565
|
+
c.style.display = "block", c.style.opacity = 0;
|
566
|
+
const m = (v, $t) => {
|
466
567
|
let S = 0;
|
467
|
-
const
|
468
|
-
S +=
|
469
|
-
|
470
|
-
|
568
|
+
const T = 50, B = T / $t, At = setInterval(function() {
|
569
|
+
S += B, v.style.opacity = S, S >= 1 && (clearInterval(At), setTimeout(function() {
|
570
|
+
f(v, 300, function() {
|
571
|
+
d.remove();
|
471
572
|
});
|
472
|
-
},
|
473
|
-
},
|
474
|
-
},
|
475
|
-
let
|
476
|
-
const
|
477
|
-
|
478
|
-
},
|
573
|
+
}, r.duration));
|
574
|
+
}, T);
|
575
|
+
}, f = (v, $t, S) => {
|
576
|
+
let T = 1;
|
577
|
+
const B = 50, At = B / $t, ge = setInterval(() => {
|
578
|
+
T -= At, v.style.opacity = T, T <= 0 && (clearInterval(ge), v.style.display = "none", S && S());
|
579
|
+
}, B);
|
479
580
|
};
|
480
|
-
|
581
|
+
m(c, 300);
|
481
582
|
}
|
482
583
|
return;
|
483
584
|
}
|
484
|
-
l = `${l}${
|
585
|
+
l = `${l}${i.source ? `?utm_source=${i.source}` : ""}${i.medium ? `&utm_medium${i.medium}` : ""}${i.campaign ? `&utm_campaign${i.campaign}` : ""}`, l = l.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${Dt(s)}${n}`) : window.open(`${Dt(s)}${l}"e=${l}`), this.removeEventListener("click", e), setTimeout(() => {
|
485
586
|
this.addEventListener("click", e);
|
486
587
|
}, 100);
|
487
588
|
};
|
488
|
-
function
|
589
|
+
function P(a) {
|
489
590
|
const e = {};
|
490
|
-
return [...
|
591
|
+
return [...a.attributes].forEach((t) => {
|
491
592
|
if (t.name.includes("duration-")) {
|
492
|
-
const s = t.name.replace("duration-", ""),
|
493
|
-
e[s] = Number(
|
593
|
+
const s = t.name.replace("duration-", ""), i = t.nodeValue;
|
594
|
+
e[s] = Number(i);
|
494
595
|
}
|
495
596
|
}), Object.keys(e).length === 0 ? null : e;
|
496
597
|
}
|
497
|
-
function
|
498
|
-
if (
|
598
|
+
function Bt(a) {
|
599
|
+
if (P(a)) {
|
499
600
|
let e;
|
500
|
-
const t = Object.keys(
|
601
|
+
const t = Object.keys(P(a)).map((s) => ({
|
501
602
|
value: s,
|
502
603
|
point: s
|
503
604
|
}));
|
504
|
-
t.sort((s,
|
605
|
+
t.sort((s, i) => parseInt(i.value, 10) - parseInt(s.value, 10));
|
505
606
|
for (let s = 0; s < t.length; s += 1) {
|
506
|
-
const { point:
|
507
|
-
window.matchMedia(`(max-width: ${
|
607
|
+
const { point: i, value: r } = t[s];
|
608
|
+
window.matchMedia(`(max-width: ${r}px)`).matches && (e = i);
|
508
609
|
}
|
509
|
-
return e ? Number(
|
610
|
+
return e ? Number(P(a)[e]) : a.s.options.duration;
|
510
611
|
} else
|
511
|
-
return
|
612
|
+
return a.s.options.duration;
|
512
613
|
}
|
513
|
-
function
|
514
|
-
const { behavior: e, continual: t, gap: s } =
|
515
|
-
|
516
|
-
|
614
|
+
function Oe(a) {
|
615
|
+
const { behavior: e, continual: t, gap: s } = a.s.options, i = a.childNodes, r = document.createElement("div"), n = document.createElement("div");
|
616
|
+
r.className = "animate-container", n.className = "animate-item", [...i].forEach((u) => {
|
617
|
+
n.append(u);
|
517
618
|
});
|
518
619
|
function l() {
|
519
|
-
const
|
520
|
-
return
|
620
|
+
const u = n.cloneNode(!0);
|
621
|
+
return u.classList.add("clone"), a.s.cloneAnimation = null, a.s.cloneAnimateEl = u, u;
|
521
622
|
}
|
522
|
-
|
623
|
+
a.s.animation = null, a.s.animateEl = n, a.textContent = "", r.append(n), a.append(r), n.clientWidth * 2 + s >= a.clientWidth ? e === "normal" && t && r.append(l()) : a.s.options.continual = !1;
|
523
624
|
}
|
524
|
-
function
|
525
|
-
const { behavior: e, direction: t, continual: s } =
|
526
|
-
let
|
625
|
+
function y(a) {
|
626
|
+
const { behavior: e, direction: t, continual: s } = a.s.options;
|
627
|
+
let i = {};
|
527
628
|
switch (e) {
|
528
629
|
case "normal":
|
529
|
-
let
|
630
|
+
let r, n;
|
530
631
|
switch (t) {
|
531
632
|
case "top":
|
532
|
-
|
633
|
+
r = s ? "translate3d(0,100%,0)" : `translate3d(0,${a.clientHeight}px,0)`, n = "translate3d(0,-100%,0)", i.animate1 = [{ transform: r }, { transform: n }], s && (i.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
|
533
634
|
break;
|
534
635
|
case "right":
|
535
|
-
|
636
|
+
r = s ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", n = s ? "translate3d(200%,0,0)" : `translate3d(${a.clientWidth}px,0,0)`, i.animate1 = [{ transform: r }, { transform: n }], s && (i.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
|
536
637
|
break;
|
537
638
|
case "bottom":
|
538
|
-
|
639
|
+
r = "translate3d(0,-100%,0)", n = s ? "translate3d(0,100%,0)" : `translate3d(0,${a.clientHeight}px,0)`, i.animate1 = [{ transform: r }, { transform: n }], s && (i.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
|
539
640
|
break;
|
540
641
|
case "left":
|
541
|
-
|
642
|
+
r = s ? "translate3d(100%,0,0)" : `translate3d(${a.clientWidth}px,0,0)`, n = "translate3d(-100%,0,0)", i.animate1 = [{ transform: r }, { transform: n }], s && (i.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
|
542
643
|
break;
|
543
644
|
}
|
544
645
|
break;
|
545
646
|
case "alternate":
|
546
647
|
switch (t) {
|
547
648
|
case "top":
|
548
|
-
|
649
|
+
i.animate1 = [{ transform: `translate3d(0,calc(${a.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${a.clientHeight}px - 100%),0)` }];
|
549
650
|
break;
|
550
651
|
case "right":
|
551
|
-
|
652
|
+
i.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${a.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
|
552
653
|
break;
|
553
654
|
case "bottom":
|
554
|
-
|
655
|
+
i.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${a.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
|
555
656
|
break;
|
556
657
|
case "left":
|
557
|
-
|
658
|
+
i.animate1 = [{ transform: `translate3d(calc(-100% + ${a.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${a.clientWidth}px),0,0)` }];
|
558
659
|
break;
|
559
660
|
}
|
560
661
|
break;
|
561
662
|
case "endStop":
|
562
663
|
switch (t) {
|
563
664
|
case "top":
|
564
|
-
|
665
|
+
i.animate1 = [{ transform: `translate3d(0,${a.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
|
565
666
|
break;
|
566
667
|
case "right":
|
567
|
-
|
668
|
+
i.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
568
669
|
break;
|
569
670
|
case "bottom":
|
570
|
-
|
671
|
+
i.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${a.clientHeight}px - 100%),0)` }];
|
571
672
|
break;
|
572
673
|
case "left":
|
573
|
-
|
674
|
+
i.animate1 = [{ transform: `translate3d(${a.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${a.clientWidth}px - 100%),0,0)` }];
|
574
675
|
break;
|
575
676
|
}
|
576
677
|
break;
|
577
678
|
}
|
578
|
-
return
|
679
|
+
return i;
|
579
680
|
}
|
580
|
-
function
|
681
|
+
function Ne(a) {
|
581
682
|
let e;
|
582
683
|
return function(t) {
|
583
|
-
e && clearTimeout(e), e = setTimeout(
|
684
|
+
e && clearTimeout(e), e = setTimeout(a, 200, t);
|
584
685
|
};
|
585
686
|
}
|
586
|
-
var
|
587
|
-
class
|
687
|
+
var at, ee, rt, se, nt, ie, ot, ae;
|
688
|
+
class Fe extends HTMLElement {
|
588
689
|
constructor() {
|
589
690
|
super();
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
691
|
+
h(this, at);
|
692
|
+
h(this, rt);
|
693
|
+
h(this, nt);
|
694
|
+
h(this, ot);
|
594
695
|
this.initialize = !1;
|
595
696
|
}
|
596
697
|
static get observedAttributes() {
|
597
698
|
return [];
|
598
699
|
}
|
599
|
-
attributeChangedCallback(t, s,
|
700
|
+
attributeChangedCallback(t, s, i) {
|
600
701
|
}
|
601
702
|
connectedCallback() {
|
602
|
-
this.initialize || (this.initialize = !0, o(this,
|
703
|
+
this.initialize || (this.initialize = !0, o(this, at, ee).call(this));
|
603
704
|
}
|
604
705
|
play() {
|
605
706
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
@@ -608,76 +709,76 @@ class fe extends HTMLElement {
|
|
608
709
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
609
710
|
}
|
610
711
|
}
|
611
|
-
|
712
|
+
at = new WeakSet(), ee = function() {
|
612
713
|
const t = {
|
613
|
-
direction: this.getAttribute("direction") ||
|
714
|
+
direction: this.getAttribute("direction") || E.SETTINGS.direction,
|
614
715
|
// up / down / left / right
|
615
|
-
behavior: this.getAttribute("behavior") ||
|
716
|
+
behavior: this.getAttribute("behavior") || E.SETTINGS.behavior,
|
616
717
|
// normal / alternate / endStop
|
617
|
-
duration: Number(this.getAttribute("duration")) ||
|
718
|
+
duration: Number(this.getAttribute("duration")) || E.SETTINGS.duration,
|
618
719
|
// ms
|
619
|
-
durationBreakpoints:
|
620
|
-
autoplay: this.getAttribute("autoplay") ||
|
720
|
+
durationBreakpoints: P(this) || E.SETTINGS.durationBreakpoints,
|
721
|
+
autoplay: this.getAttribute("autoplay") || E.SETTINGS.autoplay,
|
621
722
|
// normal / alternate / endStop
|
622
|
-
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" :
|
723
|
+
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : E.SETTINGS.pauseOnMouseenter,
|
623
724
|
// true / false
|
624
|
-
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" :
|
725
|
+
continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : E.SETTINGS.continual,
|
625
726
|
// true / false
|
626
|
-
gap: Number(this.getAttribute("gap")) ||
|
727
|
+
gap: Number(this.getAttribute("gap")) || E.SETTINGS.gap
|
627
728
|
};
|
628
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
629
|
-
},
|
630
|
-
const { direction: t, continual: s, gap:
|
729
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Bt(this), Oe(this), o(this, rt, se).call(this);
|
730
|
+
}, rt = new WeakSet(), se = function() {
|
731
|
+
const { direction: t, continual: s, gap: i } = this.s.options;
|
631
732
|
switch (t) {
|
632
733
|
case "left":
|
633
734
|
case "right":
|
634
|
-
this.style.cssText = `--continual-gap: ${
|
735
|
+
this.style.cssText = `--continual-gap: ${i}px;`;
|
635
736
|
break;
|
636
737
|
case "top":
|
637
738
|
case "bottom":
|
638
|
-
s ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${
|
739
|
+
s ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${i}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${i}px;`;
|
639
740
|
break;
|
640
741
|
}
|
641
|
-
o(this,
|
642
|
-
},
|
643
|
-
const t = this, { direction: s, behavior:
|
644
|
-
let
|
645
|
-
function
|
646
|
-
switch (
|
742
|
+
o(this, nt, ie).call(this), o(this, ot, ae).call(this), s && this.classList.add("continual"), this.classList.add("m4-initialize");
|
743
|
+
}, nt = new WeakSet(), ie = function() {
|
744
|
+
const t = this, { direction: s, behavior: i, duration: r, autoplay: n, pauseOnMouseenter: l, continual: u } = t.s.options;
|
745
|
+
let p;
|
746
|
+
function d() {
|
747
|
+
switch (i) {
|
647
748
|
case "normal":
|
648
|
-
t.s.animateEl.style.transform = `${
|
749
|
+
t.s.animateEl.style.transform = `${y(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(y(t).animate1, {
|
649
750
|
duration: t.s.nowDuration,
|
650
751
|
iterations: 1 / 0
|
651
|
-
}),
|
752
|
+
}), u && (t.s.cloneAnimateEl.style.transform = `${y(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(y(t).animate2, {
|
652
753
|
duration: t.s.nowDuration,
|
653
754
|
delay: -t.s.nowDuration / 2,
|
654
755
|
iterations: 1 / 0
|
655
756
|
}));
|
656
757
|
break;
|
657
758
|
case "alternate":
|
658
|
-
let
|
659
|
-
let
|
759
|
+
let f = function() {
|
760
|
+
let v = [];
|
660
761
|
switch (s) {
|
661
762
|
case "top":
|
662
|
-
|
763
|
+
c = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), m = parseInt(t.s.nowDuration / (c * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
|
663
764
|
break;
|
664
765
|
case "right":
|
665
|
-
|
766
|
+
c = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), m = parseInt(t.s.nowDuration / (c * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
|
666
767
|
break;
|
667
768
|
case "bottom":
|
668
|
-
|
769
|
+
c = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), m = parseInt(r / (c * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
|
669
770
|
break;
|
670
771
|
case "left":
|
671
|
-
|
772
|
+
c = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), m = parseInt(r / (c * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
|
672
773
|
break;
|
673
774
|
}
|
674
|
-
return
|
675
|
-
},
|
676
|
-
(t.clientHeight > t.s.animateEl.scrollHeight || s === "left" || s === "right") && (t.s.animateEl.style.transform = `${
|
677
|
-
duration:
|
775
|
+
return v;
|
776
|
+
}, c, m;
|
777
|
+
(t.clientHeight > t.s.animateEl.scrollHeight || s === "left" || s === "right") && (t.s.animateEl.style.transform = `${f()[0].transform}`, t.s.animateEl.animate(f(), {
|
778
|
+
duration: m,
|
678
779
|
fill: "forwards"
|
679
780
|
}).finished.then(() => {
|
680
|
-
t.s.animation = t.s.animateEl.animate(
|
781
|
+
t.s.animation = t.s.animateEl.animate(y(t).animate1, {
|
681
782
|
duration: t.s.nowDuration,
|
682
783
|
iterations: 1 / 0
|
683
784
|
});
|
@@ -686,102 +787,102 @@ U = new WeakSet(), Ct = function() {
|
|
686
787
|
});
|
687
788
|
break;
|
688
789
|
case "endStop":
|
689
|
-
t.s.animateEl.style.transform = `${
|
790
|
+
t.s.animateEl.style.transform = `${y(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(y(t).animate1, {
|
690
791
|
duration: t.s.nowDuration,
|
691
792
|
fill: "forwards"
|
692
793
|
});
|
693
794
|
break;
|
694
795
|
}
|
695
|
-
t.s.animateEl.classList.add("start"),
|
796
|
+
t.s.animateEl.classList.add("start"), n === !1 && (t.s.animateEl.classList.remove("start"), t.s.animation.cancel());
|
696
797
|
}
|
697
|
-
clearTimeout(
|
798
|
+
clearTimeout(p), p = setTimeout(
|
698
799
|
() => {
|
699
|
-
|
800
|
+
d();
|
700
801
|
},
|
701
|
-
|
802
|
+
n || 0
|
702
803
|
), t.addEventListener("mouseenter", function() {
|
703
804
|
t.s.animation && l && t.s.animation.playState === "running" && t.pause();
|
704
805
|
}), t.addEventListener("mouseleave", function() {
|
705
806
|
t.s.animation && l && t.s.animation.playState === "paused" && t.play();
|
706
807
|
});
|
707
|
-
},
|
808
|
+
}, ot = new WeakSet(), ae = function() {
|
708
809
|
const t = this;
|
709
810
|
function s() {
|
710
|
-
const
|
711
|
-
t.s.nowDuration =
|
811
|
+
const i = t.s.animation.startTime, r = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
812
|
+
t.s.nowDuration = Bt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(y(t).animate1, {
|
712
813
|
duration: t.s.nowDuration,
|
713
814
|
iterations: 1 / 0
|
714
|
-
}), t.s.animation.startTime =
|
815
|
+
}), t.s.animation.startTime = i, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(y(t).animate2, {
|
715
816
|
duration: t.s.nowDuration,
|
716
817
|
delay: -t.s.nowDuration / 2,
|
717
818
|
iterations: 1 / 0
|
718
|
-
}), t.s.cloneAnimation.startTime =
|
819
|
+
}), t.s.cloneAnimation.startTime = r);
|
719
820
|
}
|
720
|
-
window.addEventListener("resize",
|
821
|
+
window.addEventListener("resize", Ne(s));
|
721
822
|
};
|
722
|
-
const
|
823
|
+
const F = function(a) {
|
723
824
|
let e;
|
724
825
|
return function(t) {
|
725
|
-
e && clearTimeout(e), e = setTimeout(
|
826
|
+
e && clearTimeout(e), e = setTimeout(a, 200, t);
|
726
827
|
};
|
727
|
-
},
|
728
|
-
if (
|
729
|
-
|
828
|
+
}, $ = (a, e) => {
|
829
|
+
if (j(a)) {
|
830
|
+
a.forEach((t) => {
|
730
831
|
t.classList.add(e);
|
731
832
|
});
|
732
833
|
return;
|
733
834
|
}
|
734
|
-
|
735
|
-
}, w = (
|
736
|
-
if (
|
737
|
-
|
835
|
+
a.classList.add(e);
|
836
|
+
}, w = (a, e) => {
|
837
|
+
if (j(a)) {
|
838
|
+
a.forEach((t) => {
|
738
839
|
t.classList.remove(e);
|
739
840
|
});
|
740
841
|
return;
|
741
842
|
}
|
742
|
-
|
843
|
+
a.classList.remove(e);
|
743
844
|
};
|
744
|
-
var
|
745
|
-
class
|
845
|
+
var lt, re, ct, ne, dt, oe, H, Ct, k, G, ut, le;
|
846
|
+
class Rt {
|
746
847
|
constructor(e) {
|
747
848
|
// 初始化
|
748
|
-
|
849
|
+
h(this, lt);
|
749
850
|
// 左右箭頭事件綁定
|
750
|
-
|
851
|
+
h(this, ct);
|
751
852
|
// 左右拖拉事件綁定
|
752
|
-
|
853
|
+
h(this, dt);
|
753
854
|
// 卷軸位置判斷
|
754
|
-
|
855
|
+
h(this, H);
|
755
856
|
// 隱藏按鈕判斷
|
756
|
-
|
857
|
+
h(this, k);
|
757
858
|
// 選項事件綁定
|
758
|
-
|
759
|
-
this.$element = e, this.option = e.s.option.drag, o(this,
|
859
|
+
h(this, ut);
|
860
|
+
this.$element = e, this.option = e.s.option.drag, o(this, lt, re).call(this);
|
760
861
|
}
|
761
862
|
// 更新 active 位置
|
762
863
|
update(e) {
|
763
864
|
const t = e.querySelector(".wrapper"), s = t == null ? void 0 : t.querySelector(".active");
|
764
865
|
if (s) {
|
765
|
-
const
|
866
|
+
const i = s.offsetLeft + s.getBoundingClientRect().width / 2 - t.getBoundingClientRect().width / 2;
|
766
867
|
t.scrollTo({
|
767
|
-
left:
|
868
|
+
left: i,
|
768
869
|
behavior: "smooth"
|
769
870
|
});
|
770
871
|
}
|
771
872
|
}
|
772
873
|
}
|
773
|
-
|
774
|
-
var s,
|
874
|
+
lt = new WeakSet(), re = function() {
|
875
|
+
var s, i, r, n, l, u;
|
775
876
|
const e = this;
|
776
877
|
if (!e.$element)
|
777
878
|
return;
|
778
879
|
e.$container = e.$element.querySelector(".drag-container"), e.$wrapper = e.$container.querySelector(".wrapper");
|
779
880
|
const t = () => {
|
780
|
-
var
|
781
|
-
o(
|
881
|
+
var p, d;
|
882
|
+
o(p = e, H, Ct).call(p), o(d = e, k, G).call(d);
|
782
883
|
};
|
783
|
-
e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize",
|
784
|
-
|
884
|
+
e.$wrapper.removeEventListener("scroll", t), e.$wrapper.addEventListener("scroll", t), window.removeEventListener("resize", F(t)), window.addEventListener("resize", F(t)), (e.option.draggable || e.$element.s.type == "collapse") && o(s = e, dt, oe).call(s), e.option.navigation && e.$element.s.type !== "collapse" && (e.$container.insertAdjacentHTML(
|
885
|
+
g.prepend,
|
785
886
|
`<div class="navigation">
|
786
887
|
<div class="button prev">
|
787
888
|
<div></div>
|
@@ -790,234 +891,284 @@ Y = new WeakSet(), Ht = function() {
|
|
790
891
|
<div></div>
|
791
892
|
</div>
|
792
893
|
</div>`
|
793
|
-
), e.$button = (
|
794
|
-
},
|
795
|
-
const e = this, { $wrapper: t, $button: s } = e,
|
796
|
-
const
|
894
|
+
), e.$button = (i = e.$container) == null ? void 0 : i.querySelectorAll(".button"), o(r = e, ct, ne).call(r)), o(n = e, H, Ct).call(n), o(l = e, k, G).call(l), o(u = e, ut, le).call(u);
|
895
|
+
}, ct = new WeakSet(), ne = function() {
|
896
|
+
const e = this, { $wrapper: t, $button: s } = e, i = function() {
|
897
|
+
const r = this.classList.contains("next"), n = parseInt(t.getBoundingClientRect().width * 0.7);
|
797
898
|
t.scrollTo({
|
798
|
-
left:
|
899
|
+
left: r ? t.scrollLeft + n : t.scrollLeft - n,
|
799
900
|
behavior: "smooth"
|
800
901
|
}), setTimeout(() => {
|
801
902
|
var l;
|
802
|
-
o(l = e, k,
|
903
|
+
o(l = e, k, G).call(l);
|
803
904
|
}, 100);
|
804
905
|
};
|
805
|
-
s.forEach((
|
806
|
-
|
906
|
+
s.forEach((r) => {
|
907
|
+
r.removeEventListener("click", i), r.addEventListener("click", i);
|
807
908
|
});
|
808
|
-
},
|
909
|
+
}, dt = new WeakSet(), oe = function() {
|
809
910
|
const { $wrapper: e } = this;
|
810
|
-
let t = !1, s = !1,
|
811
|
-
const
|
812
|
-
|
911
|
+
let t = !1, s = !1, i = 0, r = 0;
|
912
|
+
const n = function(c) {
|
913
|
+
c.preventDefault(), s = !1, t = !0, i = c.pageX - e.offsetLeft, r = e.scrollLeft;
|
813
914
|
};
|
814
|
-
e.removeEventListener("mousedown",
|
915
|
+
e.removeEventListener("mousedown", n), e.addEventListener("mousedown", n);
|
815
916
|
const l = function() {
|
816
917
|
s = !1, t = !1;
|
817
918
|
};
|
818
919
|
e.removeEventListener("mouseleave", l), e.addEventListener("mouseleave", l);
|
819
|
-
const
|
820
|
-
|
920
|
+
const u = function(c) {
|
921
|
+
c.preventDefault(), t = !1;
|
821
922
|
};
|
822
|
-
e.removeEventListener("mouseup",
|
823
|
-
const
|
824
|
-
if (
|
923
|
+
e.removeEventListener("mouseup", u), e.addEventListener("mouseup", u);
|
924
|
+
const p = function(c) {
|
925
|
+
if (c.preventDefault(), s = !0, !t)
|
825
926
|
return;
|
826
|
-
const
|
927
|
+
const f = c.pageX - e.offsetLeft - i;
|
827
928
|
e.scrollTo({
|
828
|
-
left:
|
929
|
+
left: r - f
|
829
930
|
});
|
830
931
|
};
|
831
|
-
e.removeEventListener("mousemove",
|
832
|
-
const
|
833
|
-
s && (
|
932
|
+
e.removeEventListener("mousemove", p), e.addEventListener("mousemove", p);
|
933
|
+
const d = function(c) {
|
934
|
+
s && (c.preventDefault(), c.stopPropagation());
|
834
935
|
};
|
835
|
-
e.querySelectorAll("a").forEach((
|
836
|
-
|
936
|
+
e.querySelectorAll("a").forEach((c) => {
|
937
|
+
c.removeEventListener("click", d), c.addEventListener("click", d);
|
837
938
|
});
|
838
|
-
},
|
839
|
-
const { $container: e, $wrapper: t } = this, s = t.scrollWidth - t.clientWidth,
|
840
|
-
s <= 0 || (
|
841
|
-
}, k = new WeakSet(),
|
939
|
+
}, H = new WeakSet(), Ct = function() {
|
940
|
+
const { $container: e, $wrapper: t } = this, s = t.scrollWidth - t.clientWidth, i = t.scrollLeft;
|
941
|
+
s <= 0 || ($(e, "scrollable"), i == 0 ? (w(e, "scrollable"), $(t, "start"), w(t, "end")) : i >= s ? (w(e, "scrollable"), w(t, "start"), $(t, "end")) : ($(t, "center"), w(t, "start"), w(t, "end")));
|
942
|
+
}, k = new WeakSet(), G = function() {
|
842
943
|
const { $wrapper: e, $button: t, $element: s } = this;
|
843
944
|
if (!t)
|
844
945
|
return;
|
845
|
-
const
|
846
|
-
if (
|
847
|
-
|
946
|
+
const i = e.scrollWidth - e.clientWidth, r = e.scrollLeft;
|
947
|
+
if (i <= 0) {
|
948
|
+
$(t, "hide"), $(s, "noScrollable");
|
848
949
|
return;
|
849
950
|
}
|
850
|
-
|
851
|
-
if (
|
852
|
-
w(
|
951
|
+
r == 0 ? t.forEach((n) => {
|
952
|
+
if (n.classList.contains("next")) {
|
953
|
+
w(n, "hide");
|
853
954
|
return;
|
854
955
|
}
|
855
|
-
|
856
|
-
}) :
|
857
|
-
if (
|
858
|
-
|
956
|
+
$(n, "hide");
|
957
|
+
}) : r >= i ? t.forEach((n) => {
|
958
|
+
if (n.classList.contains("next")) {
|
959
|
+
$(n, "hide");
|
859
960
|
return;
|
860
961
|
}
|
861
|
-
w(
|
962
|
+
w(n, "hide");
|
862
963
|
}) : w(t, "hide");
|
863
|
-
},
|
864
|
-
const { $element: e } = this, t = (
|
964
|
+
}, ut = new WeakSet(), le = function() {
|
965
|
+
const { $element: e } = this, t = (i) => {
|
865
966
|
if (this.option.selected) {
|
866
|
-
const
|
867
|
-
e.setAttribute("m4-status",
|
967
|
+
const r = i.getAttribute("data-option").trim();
|
968
|
+
e.setAttribute("m4-status", r);
|
868
969
|
}
|
869
970
|
};
|
870
971
|
function s() {
|
871
972
|
t(this);
|
872
973
|
}
|
873
|
-
this.$container.querySelectorAll(".item").forEach((
|
874
|
-
|
974
|
+
this.$container.querySelectorAll(".item").forEach((i) => {
|
975
|
+
i.removeEventListener("click", s), i.addEventListener("click", s);
|
875
976
|
});
|
876
977
|
};
|
877
|
-
var
|
878
|
-
class
|
978
|
+
var pt, ce, ht, de, mt, ue, ft, pe;
|
979
|
+
class je {
|
879
980
|
constructor(e) {
|
880
981
|
// 初始化
|
881
|
-
|
982
|
+
h(this, pt);
|
882
983
|
// 隱藏按鈕判斷
|
883
|
-
|
984
|
+
h(this, ht);
|
884
985
|
// 展開箭頭事件綁定
|
885
|
-
|
986
|
+
h(this, mt);
|
886
987
|
// 選項事件綁定
|
887
|
-
|
888
|
-
this.$element = e, this.option = e.s.option.collapse, o(this,
|
988
|
+
h(this, ft);
|
989
|
+
this.$element = e, this.option = e.s.option.collapse, o(this, pt, ce).call(this);
|
889
990
|
}
|
890
991
|
}
|
891
|
-
|
892
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this,
|
893
|
-
},
|
992
|
+
pt = new WeakSet(), ce = function() {
|
993
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), o(this, ht, de).call(this) && o(this, mt, ue).call(this), o(this, ft, pe).call(this));
|
994
|
+
}, ht = new WeakSet(), de = function() {
|
894
995
|
const e = this.$element.querySelector(".drag-container"), t = e.querySelector(".wrapper");
|
895
|
-
return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(
|
896
|
-
},
|
996
|
+
return t.scrollWidth - t.clientWidth > 0 ? (e.insertAdjacentHTML(g.append, '<div class="open-collapse"></div>'), this.$button = e.querySelector(".open-collapse"), !0) : !1;
|
997
|
+
}, mt = new WeakSet(), ue = function() {
|
897
998
|
const { $element: e, $button: t } = this, s = function() {
|
898
999
|
e.classList.contains("expand") ? e.classList.remove("expand") : e.classList.add("expand");
|
899
1000
|
};
|
900
1001
|
t.removeEventListener("click", s), t.addEventListener("click", s);
|
901
|
-
},
|
902
|
-
const { $element: e } = this, t = (
|
1002
|
+
}, ft = new WeakSet(), pe = function() {
|
1003
|
+
const { $element: e } = this, t = (i, r) => {
|
903
1004
|
if (e != null && e.classList.contains("expand") ? e == null || e.classList.remove("expand") : e == null || e.classList.add("expand"), this.option.selected) {
|
904
|
-
const
|
905
|
-
e.setAttribute("m4-status",
|
1005
|
+
const n = i.getAttribute("data-option").trim();
|
1006
|
+
e.setAttribute("m4-status", n);
|
906
1007
|
}
|
907
1008
|
};
|
908
1009
|
function s() {
|
909
1010
|
t(this);
|
910
1011
|
}
|
911
|
-
this.$container.querySelectorAll(".item").forEach((
|
912
|
-
|
1012
|
+
this.$container.querySelectorAll(".item").forEach((i) => {
|
1013
|
+
i.removeEventListener("click", s), i.addEventListener("click", s);
|
913
1014
|
});
|
914
1015
|
};
|
915
|
-
const
|
916
|
-
const { type: e, option: t, originalDomString: s } =
|
917
|
-
return e == "drag" && (
|
1016
|
+
const De = (a) => {
|
1017
|
+
const { type: e, option: t, originalDomString: s } = a.s, i = document.createElement("div");
|
1018
|
+
return e == "drag" && (i.innerHTML = A.TEMPLATE[e]().trim(), i.querySelector(".drag-container .wrapper").insertAdjacentHTML(g.append, s)), e == "collapse" && (i.innerHTML = A.TEMPLATE[e](t == null ? void 0 : t.collapse).trim(), i.querySelector(".drag-container .wrapper").insertAdjacentHTML(g.append, s), i.querySelector(".collapse-container .wrapper").insertAdjacentHTML(g.append, s)), e == "dropdown" && (i.innerHTML = A.TEMPLATE[e](t == null ? void 0 : t.dropdown).trim(), i.querySelector("dropdown-el").insertAdjacentHTML(g.append, s)), i.children;
|
918
1019
|
};
|
919
|
-
var
|
920
|
-
class
|
1020
|
+
var vt, he, gt, me, I, Wt, q, z;
|
1021
|
+
class Ve extends HTMLElement {
|
921
1022
|
constructor() {
|
922
1023
|
super();
|
923
|
-
|
924
|
-
|
1024
|
+
h(this, vt);
|
1025
|
+
h(this, gt);
|
925
1026
|
// 斷點設定
|
926
|
-
|
1027
|
+
h(this, I);
|
927
1028
|
// check type
|
928
|
-
|
1029
|
+
h(this, q);
|
929
1030
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
930
1031
|
}
|
931
1032
|
static get observedAttributes() {
|
932
1033
|
return ["m4-type", "m4-status"];
|
933
1034
|
}
|
934
|
-
attributeChangedCallback(t, s,
|
935
|
-
var
|
1035
|
+
attributeChangedCallback(t, s, i) {
|
1036
|
+
var r, n, l;
|
936
1037
|
switch (t) {
|
937
1038
|
case "m4-type":
|
938
|
-
if (s === null || s ===
|
1039
|
+
if (s === null || s === i)
|
939
1040
|
return;
|
940
|
-
this.s.type =
|
1041
|
+
this.s.type = i, o(this, q, z).call(this);
|
941
1042
|
break;
|
942
1043
|
case "m4-status":
|
943
|
-
if (s ===
|
1044
|
+
if (s === i)
|
944
1045
|
return;
|
945
|
-
const
|
946
|
-
if (
|
1046
|
+
const u = this.getAttribute("m4-type");
|
1047
|
+
if (u !== "drag" && u !== "collapse")
|
947
1048
|
return;
|
948
|
-
this.querySelectorAll(".drag-container .item").forEach((
|
949
|
-
|
950
|
-
}), (
|
951
|
-
|
952
|
-
}), (
|
1049
|
+
this.querySelectorAll(".drag-container .item").forEach((p) => {
|
1050
|
+
p.classList.remove("active");
|
1051
|
+
}), (r = this.querySelector(`.drag-container .item[data-option="${i}"]`)) == null || r.classList.add("active"), u === "collapse" && (this.querySelectorAll(".collapse-container .item").forEach((p) => {
|
1052
|
+
p.classList.remove("active");
|
1053
|
+
}), (n = this.querySelector(`.collapse-container .item[data-option="${i}"]`)) == null || n.classList.add("active")), (l = this.constructor.drag) == null || l.update(this);
|
953
1054
|
break;
|
954
1055
|
}
|
955
1056
|
}
|
956
1057
|
connectedCallback() {
|
957
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this,
|
1058
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, o(this, vt, he).call(this));
|
958
1059
|
}
|
959
1060
|
update() {
|
960
|
-
o(this,
|
1061
|
+
o(this, I, Wt).call(this);
|
961
1062
|
}
|
962
1063
|
}
|
963
|
-
|
1064
|
+
vt = new WeakSet(), he = function() {
|
964
1065
|
let t = {};
|
965
|
-
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ??
|
966
|
-
const s = (
|
967
|
-
if (
|
1066
|
+
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? A.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
1067
|
+
const s = (i) => {
|
1068
|
+
if (i.type === "resize") {
|
968
1069
|
if (window.innerWidth === this.previousWidth)
|
969
1070
|
return;
|
970
1071
|
this.previousWidth = window.innerWidth;
|
971
1072
|
}
|
972
1073
|
this.update();
|
973
1074
|
};
|
974
|
-
window.removeEventListener("resize",
|
975
|
-
},
|
976
|
-
this.classList.add("m4-init"), o(this,
|
977
|
-
},
|
1075
|
+
window.removeEventListener("resize", F(s)), window.addEventListener("resize", F(s)), this.s.option = {}, this.s.option.drag = Object.assign({}, A.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, A.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, A.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, A.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), o(this, gt, me).call(this);
|
1076
|
+
}, gt = new WeakSet(), me = function() {
|
1077
|
+
this.classList.add("m4-init"), o(this, I, Wt).call(this);
|
1078
|
+
}, I = new WeakSet(), Wt = function() {
|
978
1079
|
const t = Object.keys(this.s.option.breakpoint);
|
979
1080
|
if (!t.length) {
|
980
|
-
o(this,
|
1081
|
+
o(this, q, z).call(this);
|
981
1082
|
return;
|
982
1083
|
}
|
983
|
-
t.map((s) => Number(s)).sort((s,
|
984
|
-
var
|
985
|
-
return window.innerWidth >= s && (this.s.type = (
|
1084
|
+
t.map((s) => Number(s)).sort((s, i) => i - s).some((s) => {
|
1085
|
+
var i, r, n, l;
|
1086
|
+
return window.innerWidth >= s && (this.s.type = (i = this.s.option.breakpoint[s]) == null ? void 0 : i.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (r = this.s.option.breakpoint[s]) == null ? void 0 : r.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (n = this.s.option.breakpoint[s]) == null ? void 0 : n.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (l = this.s.option.breakpoint[s]) == null ? void 0 : l.dropdown)), o(this, q, z).call(this), window.innerWidth >= s;
|
986
1087
|
});
|
987
|
-
},
|
988
|
-
var
|
1088
|
+
}, q = new WeakSet(), z = function() {
|
1089
|
+
var r;
|
989
1090
|
const { type: t } = this.s;
|
990
|
-
this.innerHTML = "", [...
|
991
|
-
this.append(
|
1091
|
+
this.innerHTML = "", [...De(this)].forEach((n) => {
|
1092
|
+
this.append(n);
|
992
1093
|
});
|
993
|
-
const s = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`),
|
994
|
-
switch (s == null || s.classList.add("active"),
|
1094
|
+
const s = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), i = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
|
1095
|
+
switch (s == null || s.classList.add("active"), i == null || i.classList.add("active"), t) {
|
995
1096
|
case "drag":
|
996
|
-
this.constructor.drag = new
|
1097
|
+
this.constructor.drag = new Rt(this);
|
997
1098
|
break;
|
998
1099
|
case "collapse":
|
999
|
-
this.constructor.drag = new
|
1100
|
+
this.constructor.drag = new Rt(this), this.constructor.collapse = new je(this);
|
1000
1101
|
break;
|
1001
1102
|
}
|
1002
|
-
(
|
1103
|
+
(r = this.constructor.drag) == null || r.update(this);
|
1104
|
+
};
|
1105
|
+
const Xt = (a) => {
|
1106
|
+
const { defaultOptions: e } = a.collapse, { collapseClass: t, target: s, transition: i } = e, r = a.querySelector(s);
|
1107
|
+
a.classList.add(t), r.style.height = 0, r.style["transition-property"] = i.property, r.style["transition-duration"] = i.duration, r.style["transition-timing-function"] = i.function, r.style["transition-delay"] = i.delay, r.style.overflow = "hidden";
|
1108
|
+
}, Be = (a) => {
|
1109
|
+
const { defaultOptions: e } = a.collapse, { collapseClass: t, target: s, transition: i } = e, r = a.querySelector(s), n = r.children[0].offsetHeight;
|
1110
|
+
a.collapse.height = n, a.classList.remove(t), r.style.display = "block", r.style.height = `${n}px`, r.style["transition-property"] = i.property, r.style["transition-duration"] = i.duration, r.style["transition-timing-function"] = i.function, r.style["transition-delay"] = i.delay, r.style.overflow = "hidden";
|
1111
|
+
};
|
1112
|
+
var O, Mt, bt, fe, yt, ve, N, Ht;
|
1113
|
+
class Ye extends Pt {
|
1114
|
+
constructor(t, s = {}) {
|
1115
|
+
super();
|
1116
|
+
h(this, O);
|
1117
|
+
h(this, bt);
|
1118
|
+
h(this, yt);
|
1119
|
+
h(this, N);
|
1120
|
+
!(!wt(t) && !Gt(t) && !j(t) && !U(t)) && (this.__storage__ = {
|
1121
|
+
el: t,
|
1122
|
+
options: s
|
1123
|
+
}, o(this, O, Mt).call(this));
|
1124
|
+
}
|
1125
|
+
update() {
|
1126
|
+
o(this, O, Mt).call(this);
|
1127
|
+
}
|
1128
|
+
}
|
1129
|
+
O = new WeakSet(), Mt = function() {
|
1130
|
+
const { el: t, options: s } = this.__storage__, { SETTINGS: i, EVENTS: r } = xe;
|
1131
|
+
if (this.elements = Et(t), this.options = Object.assign({}, i, s), this.__events__ = Object.assign({}, r), this.options.on)
|
1132
|
+
for (const [n, l] of Object.entries(this.options.on))
|
1133
|
+
this.__events__[n] = [l];
|
1134
|
+
o(this, bt, fe).call(this);
|
1135
|
+
}, bt = new WeakSet(), fe = function() {
|
1136
|
+
const { elements: t, options: s } = this;
|
1137
|
+
t.forEach((i) => {
|
1138
|
+
i.collapse = {}, i.collapse.instance = this, i.collapse.defaultOptions = s, i.collapse.methods = {}, i.collapse.methods.update = this.update, o(this, yt, ve).call(this, i);
|
1139
|
+
}), this.emit("init");
|
1140
|
+
}, yt = new WeakSet(), ve = function(t) {
|
1141
|
+
const { options: s } = this, { collapseClass: i, block: r, target: n, defaultOpen: l, targetStopPropagation: u, defaultActiveMark: p } = s, d = t, c = d.querySelector(n);
|
1142
|
+
if (d.collapse.height = c.children[0].offsetHeight, l ? (c.style.height = `${c.children[0].offsetHeight}px`, d.classList.remove(i)) : !d.classList.contains(p) && !d.hasAttribute(p) ? (d.classList.add(i), c.style.height = "0px", c.style.overflow = "hidden") : (c.style.height = `${c.children[0].offsetHeight}px`, d.classList.remove(i)), d.removeEventListener("click", o(this, N, Ht)), d.addEventListener("click", o(this, N, Ht)), u) {
|
1143
|
+
const m = (f) => {
|
1144
|
+
f.stopPropagation();
|
1145
|
+
};
|
1146
|
+
c.removeEventListener("click", m), c.addEventListener("click", m);
|
1147
|
+
}
|
1148
|
+
}, N = new WeakSet(), Ht = function() {
|
1149
|
+
const { instance: t, defaultOptions: s } = this.collapse, { collapseClass: i, block: r, target: n, single: l } = s, u = this;
|
1150
|
+
u.classList.contains(i) ? (l && u.parentNode.querySelectorAll(`.${u.classList[0]}`).forEach((p) => {
|
1151
|
+
Xt(p);
|
1152
|
+
}), Be(u)) : Xt(u), t.emit("afterCollapse");
|
1003
1153
|
};
|
1004
1154
|
export {
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1155
|
+
Qe as Anchor4,
|
1156
|
+
Ze as Aost4,
|
1157
|
+
Ge as Article4,
|
1158
|
+
ze as CategorySlider,
|
1159
|
+
Ye as Collapse4,
|
1160
|
+
ts as Configs,
|
1161
|
+
Pe as Detect4,
|
1162
|
+
es as Dropdown4,
|
1163
|
+
Pt as Events4,
|
1164
|
+
ss as ImagePreview,
|
1165
|
+
is as ImageValidate,
|
1166
|
+
Fe as Marquee4,
|
1167
|
+
we as Modal4,
|
1168
|
+
Ve as Multipurpose4,
|
1169
|
+
as as Ripple4,
|
1170
|
+
Ue as Share4,
|
1171
|
+
rs as Tab4,
|
1172
|
+
Me as Video4
|
1022
1173
|
};
|
1023
1174
|
//# sourceMappingURL=fesd-bundle.js.map
|