@xwadex/fesd 0.0.1-4.7.rc → 0.0.1-4.8.rc

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