@xwadex/fesd 0.0.42 → 0.0.44

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,4 +1,6 @@
1
- var vs = (n, i, t) => {
1
+ var Es = Object.defineProperty;
2
+ var Ls = (n, i, t) => i in n ? Es(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
+ var We = (n, i, t) => (Ls(n, typeof i != "symbol" ? i + "" : i, t), t), As = (n, i, t) => {
2
4
  if (!i.has(n))
3
5
  throw TypeError("Cannot " + t);
4
6
  };
@@ -7,15 +9,15 @@ var h = (n, i, t) => {
7
9
  throw TypeError("Cannot add the same private member more than once");
8
10
  i instanceof WeakSet ? i.add(n) : i.set(n, t);
9
11
  };
10
- var d = (n, i, t) => (vs(n, i, "access private method"), t);
11
- import { OverlayScrollbars as qe } from "overlayscrollbars";
12
- import f from "jquery";
12
+ var d = (n, i, t) => (As(n, i, "access private method"), t);
13
+ import { OverlayScrollbars as Ie } from "overlayscrollbars";
14
+ import g from "jquery";
13
15
  import "./vendor-bundle.js";
14
16
  import "validator";
15
17
  import "flatpickr";
16
- import Ye from "vanilla-lazyload";
17
- import { lock as bs, unlock as ys } from "tua-body-scroll-lock";
18
- const Y = {
18
+ import Qe from "vanilla-lazyload";
19
+ import { lock as Ss, unlock as Ds } from "tua-body-scroll-lock";
20
+ const Ne = {
19
21
  SETTINGS: {
20
22
  videoId: null,
21
23
  videoType: null,
@@ -51,14 +53,14 @@ const Y = {
51
53
  TEMPLATE() {
52
54
  return '<div class="player-container"><div class="player-wrapper"></div></div>';
53
55
  }
54
- }, ws = {
56
+ }, ks = {
55
57
  SETTINGS: {
56
58
  success: null,
57
59
  text: null,
58
60
  className: null,
59
61
  duration: 1500
60
62
  }
61
- }, I = {
63
+ }, O = {
62
64
  SETTINGS: {
63
65
  target: null,
64
66
  route: null,
@@ -89,7 +91,7 @@ const Y = {
89
91
  </div>
90
92
  `;
91
93
  }
92
- }, x = {
94
+ }, $ = {
93
95
  SETTINGS: {
94
96
  direction: "left",
95
97
  // 方向 - top || right || bottom || left
@@ -108,7 +110,7 @@ const Y = {
108
110
  gap: 30
109
111
  // 跑馬燈內容之間的距離 - Number
110
112
  }
111
- }, Ie = {
113
+ }, Pe = {
112
114
  SETTINGS: {
113
115
  scrollbar: {
114
116
  "scrollbar-track-color": "transparent",
@@ -136,15 +138,16 @@ const Y = {
136
138
  </div>`;
137
139
  return t || r;
138
140
  }
139
- }, Ts = {
141
+ }, _s = {
140
142
  SETTINGS: {
141
143
  basic_rwd: 900,
142
144
  markdownLink: !1,
145
+ markdownLinkBlank: !1,
143
146
  markdownImg: !1,
144
147
  navigation: !1,
145
148
  scrollStep: !1
146
149
  }
147
- }, Ue = {
150
+ }, Ve = {
148
151
  SETTINGS: {
149
152
  scroller: window,
150
153
  class: "aost-show",
@@ -227,7 +230,7 @@ const Y = {
227
230
  return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
228
231
  }
229
232
  }
230
- }, Je = {
233
+ }, Ke = {
231
234
  SETTINGS: {
232
235
  // 樣式 normal / process
233
236
  type: "normal",
@@ -247,7 +250,7 @@ const Y = {
247
250
  // 步驟狀態綁定
248
251
  stepOutput: ".step-show"
249
252
  }
250
- }, Ze = {
253
+ }, ti = {
251
254
  SETTINGS: {
252
255
  collapseClass: "collapse",
253
256
  block: "[collapse-block]",
@@ -280,7 +283,7 @@ const Y = {
280
283
  update: null,
281
284
  afterUpdate: null
282
285
  }
283
- }, Qe = {
286
+ }, ei = {
284
287
  SETTINGS: {
285
288
  // 是否要加 hover 效果?
286
289
  hover: !0,
@@ -295,40 +298,40 @@ const Y = {
295
298
  // hover 毫秒 ?
296
299
  speed: 600
297
300
  }
298
- }, fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
301
+ }, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
299
302
  __proto__: null,
300
303
  anchor4: ut,
301
- aost4: Ue,
302
- article4: Ts,
303
- collapse4: Ze,
304
- dropdown4: Ie,
305
- marquee4: x,
306
- modal4: I,
304
+ aost4: Ve,
305
+ article4: _s,
306
+ collapse4: ti,
307
+ dropdown4: Pe,
308
+ marquee4: $,
309
+ modal4: O,
307
310
  multipurpose4: H,
308
- ripple4: Qe,
309
- share4: ws,
310
- tab4: Je,
311
- video4: Y
312
- }, Symbol.toStringTag, { value: "Module" })), A = {
311
+ ripple4: ei,
312
+ share4: ks,
313
+ tab4: Ke,
314
+ video4: Ne
315
+ }, Symbol.toStringTag, { value: "Module" })), S = {
313
316
  before: "beforebegin",
314
317
  after: "afterend",
315
318
  append: "beforeend",
316
319
  prepend: "afterbegin"
317
- }, rt = (n) => typeof n == "string" && n !== "", Te = (n) => n instanceof HTMLElement, lt = (n) => n instanceof NodeList, w = (n) => L(n) !== null, j = (n) => typeof n == "function", L = (n) => Te(n) ? n : document.querySelector(n), S = (n) => lt(n) ? n : document.querySelectorAll(n), Es = () => Math.random().toString(36).substr(2, 9), As = (n) => {
320
+ }, rt = (n) => typeof n == "string" && n !== "", Ee = (n) => n instanceof HTMLElement, lt = (n) => n instanceof NodeList, T = (n) => D(n) !== null, j = (n) => typeof n == "function", D = (n) => Ee(n) ? n : document.querySelector(n), k = (n) => lt(n) ? n : document.querySelectorAll(n), xs = () => Math.random().toString(36).substr(2, 9), $s = (n) => {
318
321
  const i = document.createElement("div");
319
322
  return i.innerHTML = n, i.childNodes;
320
- }, Ls = (n) => {
323
+ }, Cs = (n) => {
321
324
  try {
322
325
  JSON.parse(n);
323
326
  } catch {
324
327
  return n;
325
328
  }
326
329
  return JSON.parse(n);
327
- }, E = (n, i) => {
330
+ }, L = (n, i) => {
328
331
  console.warn(`[${n} warn]: ${i}`);
329
- }, je = (n, i) => {
332
+ }, Ge = (n, i) => {
330
333
  console.error(`[${n} error]: ${i}`);
331
- }, O = {
334
+ }, I = {
332
335
  on(n, i) {
333
336
  if (!j(i))
334
337
  return this;
@@ -359,7 +362,7 @@ const Y = {
359
362
  j(s) && s.apply(this, e);
360
363
  }), this) : this;
361
364
  }
362
- }, Ss = {
365
+ }, Hs = {
363
366
  easeInOutCirc(n, i, t, e) {
364
367
  return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
365
368
  },
@@ -369,29 +372,29 @@ const Y = {
369
372
  easeOutQuart(n, i, t, e) {
370
373
  return -t * ((n = n / e - 1) * n * n * n - 1) + i;
371
374
  }
372
- }, Ee = (n, i) => {
373
- const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = w(e) ? L(e) : document.scrollingElement, v = m[u], b = w(t) ? L(t).getBoundingClientRect()[p] : 0 - v, y = w(s) ? L(s).getBoundingClientRect()[g] : 0, k = b - a - y, G = 15;
374
- let D = 0;
375
- if (k === 0)
375
+ }, Le = (n, i) => {
376
+ const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", f = c ? "width" : "height", m = T(e) ? D(e) : document.scrollingElement, v = m[u], b = T(t) ? D(t).getBoundingClientRect()[p] : 0 - v, y = T(s) ? D(s).getBoundingClientRect()[f] : 0, w = b - a - y, z = 15;
377
+ let E = 0;
378
+ if (w === 0)
376
379
  return;
377
- const R = (X) => {
378
- const Pe = L(t);
379
- i && i.emit(X, Pe), !i && n.on && j(n.on[X]) && n.on[X](Pe);
380
+ const X = (Y) => {
381
+ const Be = D(t);
382
+ i && i.emit(Y, Be), !i && n.on && j(n.on[Y]) && n.on[Y](Be);
380
383
  };
381
- R("beforeScroll");
382
- const Ne = () => {
383
- D += G;
384
- const X = Ss[r](D, v, k, o);
385
- m[u] = X, D < o && requestAnimationFrame(Ne), D >= o && R("afterScroll");
384
+ X("beforeScroll");
385
+ const ze = () => {
386
+ E += z;
387
+ const Y = Hs[r](E, v, w, o);
388
+ m[u] = Y, E < o && requestAnimationFrame(ze), E >= o && X("afterScroll");
386
389
  };
387
- requestAnimationFrame(Ne);
390
+ requestAnimationFrame(ze);
388
391
  };
389
- var Z, Ae, gt, Ke, ft, ti;
390
- class Ve {
392
+ var Z, Ae, ft, si, gt, ni;
393
+ class ii {
391
394
  constructor(i, t = {}) {
392
395
  h(this, Z);
393
- h(this, gt);
394
396
  h(this, ft);
397
+ h(this, gt);
395
398
  this.__storage__ = {
396
399
  el: i,
397
400
  options: t
@@ -410,7 +413,7 @@ class Ve {
410
413
  static run(i) {
411
414
  const { SETTINGS: t } = ut, e = Object.assign({}, t, i);
412
415
  setTimeout(() => {
413
- Ee(e);
416
+ Le(e);
414
417
  }, e.delay);
415
418
  }
416
419
  static url(i) {
@@ -419,25 +422,25 @@ class Ve {
419
422
  return;
420
423
  const r = Object.assign({}, t, i, { target: a });
421
424
  setTimeout(() => {
422
- Ee(r);
425
+ Le(r);
423
426
  }, r.delay);
424
427
  }
425
428
  }
426
429
  Z = new WeakSet(), Ae = function() {
427
430
  const { el: i, options: t } = this.__storage__;
428
- if (!rt(i) || !w(i))
431
+ if (!rt(i) || !T(i))
429
432
  return;
430
433
  const { SETTINGS: e, EVENTS: s } = ut;
431
- if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.elements = S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
434
+ if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.elements = k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
432
435
  for (const [o, a] of Object.entries(this.options.on))
433
436
  this.__events__[o] = [a];
434
- d(this, gt, Ke).call(this);
435
- }, gt = new WeakSet(), Ke = function() {
437
+ d(this, ft, si).call(this);
438
+ }, ft = new WeakSet(), si = function() {
436
439
  const { elements: i, options: t } = this;
437
440
  i.forEach((e) => {
438
- e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, ft, ti), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
441
+ e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, gt, ni), e.anchor.defaultOptions = t, e.anchor.methods = {}, e.anchor.methods.destroy = this.destroy, e.anchor.methods.update = this.update, e.addEventListener("click", e.anchor.eventHandler), e.setAttribute(this.active, "");
439
442
  }), this.emit("afterInit");
440
- }, ft = new WeakSet(), ti = function() {
443
+ }, gt = new WeakSet(), ni = function() {
441
444
  const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
442
445
  target: this.getAttribute("data-anchor-target") || i.target,
443
446
  container: this.getAttribute("data-anchor-container") || i.container,
@@ -451,21 +454,21 @@ Z = new WeakSet(), Ae = function() {
451
454
  this.removeEventListener("click", t), setTimeout(() => {
452
455
  this.addEventListener("click", t);
453
456
  }, s.speed), setTimeout(() => {
454
- Ee(s, e);
457
+ Le(s, e);
455
458
  }, s.delay);
456
459
  };
457
- Object.assign(Ve.prototype, O);
460
+ Object.assign(ii.prototype, I);
458
461
  window.MODALS || (window.MODALS = {});
459
- const { MODALS: M } = window, Ds = (n) => {
460
- const { TEMPLATE: i } = I, { childDom: t } = n, e = document.createElement("div");
462
+ const { MODALS: M } = window, Ms = (n) => {
463
+ const { TEMPLATE: i } = O, { childDom: t } = n, e = document.createElement("div");
461
464
  e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
462
465
  const s = e.querySelector(".modal-content");
463
466
  return [...t].forEach((o) => {
464
467
  s.append(o);
465
468
  }), e.children[0];
466
469
  };
467
- var vt, ii, bt, si, yt, ni, wt, oi, Tt, ai;
468
- class ei extends HTMLElement {
470
+ var vt, ai, bt, ri, yt, li, wt, ci, Tt, di;
471
+ class oi extends HTMLElement {
469
472
  constructor() {
470
473
  super();
471
474
  h(this, vt);
@@ -481,12 +484,12 @@ class ei extends HTMLElement {
481
484
  attributeChangedCallback(t, e, s) {
482
485
  switch (t) {
483
486
  case ":state":
484
- d(this, Tt, ai).call(this, s);
487
+ d(this, Tt, di).call(this, s);
485
488
  break;
486
489
  }
487
490
  }
488
491
  connectedCallback() {
489
- this.initialize || (this.initialize = !0, d(this, vt, ii).call(this));
492
+ this.initialize || (this.initialize = !0, d(this, vt, ai).call(this));
490
493
  }
491
494
  open() {
492
495
  return this.setAttribute(":state", "open"), this;
@@ -498,24 +501,24 @@ class ei extends HTMLElement {
498
501
  return this.setAttribute(":state", "destroy"), this;
499
502
  }
500
503
  }
501
- vt = new WeakSet(), ii = function() {
502
- const { ATTRS: t } = I;
504
+ vt = new WeakSet(), ai = function() {
505
+ const { ATTRS: t } = O;
503
506
  this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
504
- const e = this.getAttribute(t.id) || Es();
505
- this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && E(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, bt, si).call(this);
506
- }, bt = new WeakSet(), si = function() {
507
- this.childDom = this.childNodes, this.template = Ds(this), this.innerHTML = "", this.append(this.template), d(this, yt, ni).call(this);
508
- }, yt = new WeakSet(), ni = function() {
507
+ const e = this.getAttribute(t.id) || xs();
508
+ this.getAttribute(t.id) || (L(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), M[e] && L(`the ${t.id} "${e}" is already be used.`), M[e] = this, d(this, bt, ri).call(this);
509
+ }, bt = new WeakSet(), ri = function() {
510
+ this.childDom = this.childNodes, this.template = Ms(this), this.innerHTML = "", this.append(this.template), d(this, yt, li).call(this);
511
+ }, yt = new WeakSet(), li = function() {
509
512
  const t = this.querySelector(".modal-scroller");
510
- this.__scroller__ = qe(t, {
513
+ this.__scroller__ = Ie(t, {
511
514
  overflowBehavior: {
512
515
  x: "hidden"
513
516
  },
514
517
  autoUpdate: !0
515
- }), window.modalScroll = this.__scroller__, d(this, wt, oi).call(this);
516
- }, wt = new WeakSet(), oi = function() {
518
+ }), window.modalScroll = this.__scroller__, d(this, wt, ci).call(this);
519
+ }, wt = new WeakSet(), ci = function() {
517
520
  var a, r, l;
518
- const t = this, { ATTRS: e } = I, { close: s, destroy: o } = e;
521
+ const t = this, { ATTRS: e } = O, { close: s, destroy: o } = e;
519
522
  (a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
520
523
  c.addEventListener("click", function() {
521
524
  const u = this.getAttribute(s);
@@ -529,7 +532,7 @@ vt = new WeakSet(), ii = function() {
529
532
  }), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
530
533
  c.stopPropagation();
531
534
  });
532
- }, Tt = new WeakSet(), ai = function(t) {
535
+ }, Tt = new WeakSet(), di = function(t) {
533
536
  const { __scroller__: e } = this;
534
537
  if (t === "open") {
535
538
  if (this.style.display = "block", e) {
@@ -554,28 +557,28 @@ vt = new WeakSet(), ii = function() {
554
557
  if (t === "destroy") {
555
558
  this.classList.remove("show");
556
559
  const s = () => {
557
- const { ATTRS: o } = I, a = this.getAttribute(o.id);
560
+ const { ATTRS: o } = O, a = this.getAttribute(o.id);
558
561
  this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"), M[a] && delete M[a];
559
562
  };
560
563
  this.addEventListener("transitionend", s);
561
564
  }
562
565
  };
563
- Object.assign(ei.prototype, O);
564
- const { MODALS: Oe } = window, ct = {}, ri = (n, i, ...t) => {
566
+ Object.assign(oi.prototype, I);
567
+ const { MODALS: je } = window, ct = {}, ui = (n, i, ...t) => {
565
568
  if (!i)
566
569
  return;
567
570
  const e = n[i];
568
571
  e && j(e) && e.apply(n, t);
569
- }, li = (n, ...i) => {
572
+ }, hi = (n, ...i) => {
570
573
  n && j(n) && n.apply(J, i);
571
- }, ze = (n, i) => {
572
- const { target: t } = n, e = Oe[t] || L(n.target);
573
- e && ci(n, i), e || ks(n, i);
574
- }, ci = (n, i) => {
575
- const { target: t, action: e, on: s, e: o } = n, a = Oe[t] || L(n.target);
574
+ }, Re = (n, i) => {
575
+ const { target: t } = n, e = je[t] || D(n.target);
576
+ e && pi(n, i), e || qs(n, i);
577
+ }, pi = (n, i) => {
578
+ const { target: t, action: e, on: s, e: o } = n, a = je[t] || D(n.target);
576
579
  switch (["open", "close", "destroy"].forEach((l) => {
577
580
  a.once(l, () => {
578
- i && (i.emit(l, a, o), ri(i, s[l], a, o)), i || li(s[l], a);
581
+ i && (i.emit(l, a, o), ui(i, s[l], a, o)), i || hi(s[l], a);
579
582
  });
580
583
  }), e) {
581
584
  case "open":
@@ -592,34 +595,34 @@ const { MODALS: Oe } = window, ct = {}, ri = (n, i, ...t) => {
592
595
  l === "close" && a.open(), l === "open" && a.close();
593
596
  break;
594
597
  }
595
- }, ks = async (n, i) => {
598
+ }, qs = async (n, i) => {
596
599
  const { target: t, route: e, container: s, on: o, e: a } = n;
597
600
  if (!e)
598
- return E("modal4", "cannot find target or data-modal-route is not defined");
601
+ return L("modal4", "cannot find target or data-modal-route is not defined");
599
602
  const r = (l, ...c) => {
600
- i && (i.emit(l, ...c), ri(i, o[l], ...c)), i || li(o[l], ...c);
603
+ i && (i.emit(l, ...c), ui(i, o[l], ...c)), i || hi(o[l], ...c);
601
604
  };
602
605
  ct[t] || (ct[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
603
- const c = As(l), u = L(s) || L(I.SETTINGS.container);
604
- [...c].forEach((g) => {
605
- u.append(g);
606
+ const c = $s(l), u = D(s) || D(O.SETTINGS.container);
607
+ [...c].forEach((f) => {
608
+ u.append(f);
606
609
  });
607
- const p = Oe[t] || L(n.target);
608
- r("complete", p), ci(n, i), delete ct[t];
610
+ const p = je[t] || D(n.target);
611
+ r("complete", p), pi(n, i), delete ct[t];
609
612
  }).catch((l) => {
610
613
  r("error", l), delete ct[t];
611
614
  }));
612
615
  };
613
- var Q, Le, Et, di, At, ui;
616
+ var Q, Se, Et, mi, Lt, fi;
614
617
  const N = class N {
615
618
  constructor(i, t = {}) {
616
619
  h(this, Q);
617
620
  h(this, Et);
618
- h(this, At);
621
+ h(this, Lt);
619
622
  this.__storage__ = {
620
623
  el: i,
621
624
  options: t
622
- }, this.active = "data-modal-active", d(this, Q, Le).call(this);
625
+ }, this.active = "data-modal-active", d(this, Q, Se).call(this);
623
626
  }
624
627
  destroy() {
625
628
  const { elements: i } = this;
@@ -629,12 +632,12 @@ const N = class N {
629
632
  }
630
633
  update() {
631
634
  var i;
632
- return d(i = this.destroy(), Q, Le).call(i), this.emit("update"), this;
635
+ return d(i = this.destroy(), Q, Se).call(i), this.emit("update"), this;
633
636
  }
634
637
  /** static method 'open' */
635
638
  static open(i) {
636
- const { SETTINGS: t } = I, e = Object.assign({}, t, { on: {} }, i);
637
- ze(e);
639
+ const { SETTINGS: t } = O, e = Object.assign({}, t, { on: {} }, i);
640
+ Re(e);
638
641
  }
639
642
  /** static method 'defineMethods' */
640
643
  static defineMethods(i) {
@@ -645,23 +648,23 @@ const N = class N {
645
648
  Object.assign(N.prototype, N.prototype.__methods__);
646
649
  }
647
650
  };
648
- Q = new WeakSet(), Le = function() {
651
+ Q = new WeakSet(), Se = function() {
649
652
  const { el: i, options: t } = this.__storage__;
650
- if (!rt(i) || !w(i))
653
+ if (!rt(i) || !T(i))
651
654
  return;
652
- const { SETTINGS: e, EVENTS: s } = I;
653
- if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
655
+ const { SETTINGS: e, EVENTS: s } = O;
656
+ if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
654
657
  for (const [o, a] of Object.entries(this.options.on))
655
658
  this.__events__[o] = [a];
656
- d(this, Et, di).call(this);
657
- }, Et = new WeakSet(), di = function() {
659
+ d(this, Et, mi).call(this);
660
+ }, Et = new WeakSet(), mi = function() {
658
661
  const { elements: i, options: t } = this;
659
662
  i.forEach((e) => {
660
- e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, At, ui), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
663
+ e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Lt, fi), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
661
664
  }), this.emit("init");
662
- }, At = new WeakSet(), ui = function(i) {
663
- const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = Ls(this.getAttribute("data-modal-on"));
664
- o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
665
+ }, Lt = new WeakSet(), fi = function(i) {
666
+ const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = Cs(this.getAttribute("data-modal-on"));
667
+ o && typeof o != "object" && L("modal4", "data-modal-on must be a json string.");
665
668
  const a = {
666
669
  target: this.getAttribute("data-modal-target") || t.target,
667
670
  action: this.getAttribute("data-modal-action") || t.action,
@@ -672,42 +675,42 @@ Q = new WeakSet(), Le = function() {
672
675
  };
673
676
  this.removeEventListener("click", e), setTimeout(() => {
674
677
  this.addEventListener("click", e);
675
- }, 200), ze(a, s);
678
+ }, 200), Re(a, s);
676
679
  };
677
680
  let J = N;
678
- Object.assign(J.prototype, O);
679
- customElements.define("modern-modal", ei);
680
- const _s = (n, i) => {
681
+ Object.assign(J.prototype, I);
682
+ customElements.define("modern-modal", oi);
683
+ const Os = (n, i) => {
681
684
  const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
682
685
  i.forEach((s) => {
683
- const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom: g } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
684
- if (p - e <= m && g - e >= v && s.offsetParent)
686
+ const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: p, bottom: f } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
687
+ if (p - e <= m && f - e >= v && s.offsetParent)
685
688
  setTimeout(() => {
686
689
  s.classList.add(o);
687
690
  }, a);
688
691
  else {
689
- const y = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && g - e <= v || c === !0;
692
+ const y = s.classList.contains(o) && c === "down" && p - e >= m || c === "up" && f - e <= v || c === !0;
690
693
  setTimeout(() => {
691
694
  y && s.classList.remove(o);
692
695
  }, a);
693
696
  }
694
697
  });
695
- }, $s = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
696
- var V, Se, Lt, pi;
697
- class hi {
698
+ }, Is = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
699
+ var V, De, At, vi;
700
+ class gi {
698
701
  constructor(i, t = {}) {
699
702
  h(this, V);
700
- h(this, Lt);
703
+ h(this, At);
701
704
  this.__storage__ = {
702
705
  el: i,
703
706
  options: t
704
- }, this.active = "data-aost-active", d(this, V, Se).call(this);
707
+ }, this.active = "data-aost-active", d(this, V, De).call(this);
705
708
  }
706
709
  destroy(i) {
707
710
  const { elements: t, options: e } = this;
708
711
  if (!t)
709
712
  return this;
710
- const { scroller: s } = e, o = s === window || !w(s) ? window : L(s);
713
+ const { scroller: s } = e, o = s === window || !T(s) ? window : D(s);
711
714
  return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
712
715
  if (!a.aost)
713
716
  return;
@@ -717,39 +720,39 @@ class hi {
717
720
  }
718
721
  update(i) {
719
722
  var t;
720
- d(t = this.destroy(i), V, Se).call(t);
723
+ d(t = this.destroy(i), V, De).call(t);
721
724
  }
722
725
  }
723
- V = new WeakSet(), Se = function() {
726
+ V = new WeakSet(), De = function() {
724
727
  const { el: i, options: t } = this.__storage__;
725
- if (!rt(i) || !w(i))
728
+ if (!rt(i) || !T(i))
726
729
  return;
727
- const { SETTINGS: e, EVENTS: s } = Ue;
728
- if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
730
+ const { SETTINGS: e, EVENTS: s } = Ve;
731
+ if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
729
732
  for (const [o, a] of Object.entries(this.options.on))
730
733
  this.__events__[o] = [a];
731
- d(this, Lt, pi).call(this);
732
- }, Lt = new WeakSet(), pi = function() {
733
- const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !w(e) ? window : L(e);
734
+ d(this, At, vi).call(this);
735
+ }, At = new WeakSet(), vi = function() {
736
+ const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !T(e) ? window : D(e);
734
737
  this.eventHandler = () => {
735
- _s(s, i);
738
+ Os(s, i);
736
739
  }, i.forEach((a) => {
737
- a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat = $s(a.getAttribute("data-aost-repeat"), t), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
740
+ a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || t.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || t.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || t.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || t.end, a.aost.repeat = Is(a.getAttribute("data-aost-repeat"), t), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
738
741
  });
739
742
  const { eventHandler: o } = this;
740
743
  o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
741
744
  };
742
- Object.assign(hi.prototype, O);
743
- const xs = (n) => {
744
- const { TEMPLATE: i } = Y, { childDom: t } = n, e = document.createElement("div");
745
+ Object.assign(gi.prototype, I);
746
+ const Ns = (n) => {
747
+ const { TEMPLATE: i } = Ne, { childDom: t } = n, e = document.createElement("div");
745
748
  e.innerHTML = i();
746
749
  const s = e.querySelector(".player-wrapper");
747
750
  return [...t].forEach((o) => {
748
751
  s.append(o);
749
752
  }), e.children[0];
750
753
  };
751
- var St, mi, Dt, gi, kt, fi, _t, vi, $t, bi, xt, yi, Ct, wi, Ht, Ti, Mt, Ei;
752
- class Cs extends HTMLElement {
754
+ var St, bi, Dt, yi, kt, wi, _t, Ti, xt, Ei, $t, Li, Ct, Ai, Ht, Si, Mt, Di, qt, ki;
755
+ class Ps extends HTMLElement {
753
756
  constructor() {
754
757
  super();
755
758
  h(this, St);
@@ -758,15 +761,17 @@ class Cs extends HTMLElement {
758
761
  // youtube iframe
759
762
  h(this, _t);
760
763
  // vimeo iframe
761
- h(this, $t);
762
- // youku iframe
763
764
  h(this, xt);
765
+ // youku iframe
766
+ h(this, $t);
764
767
  h(this, Ct);
765
768
  // 2025.02.11 新增 ig
766
769
  h(this, Ht);
767
770
  // 2025.02.11 新增 tiktok
768
771
  h(this, Mt);
769
- d(this, St, mi).call(this);
772
+ // 2026.01.15 新增 tiktok
773
+ h(this, qt);
774
+ d(this, St, bi).call(this);
770
775
  }
771
776
  play() {
772
777
  const { videoType: t } = this;
@@ -803,19 +808,19 @@ class Cs extends HTMLElement {
803
808
  }
804
809
  }
805
810
  }
806
- St = new WeakSet(), mi = function() {
811
+ St = new WeakSet(), bi = function() {
807
812
  if (!this.getAttribute("video-id")) {
808
- E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
813
+ L("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
809
814
  return;
810
815
  }
811
- this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, Dt, gi).call(this);
812
- }, Dt = new WeakSet(), gi = function() {
813
- this.childDom = this.childNodes, this.template = xs(this), this.innerHTML = "", this.append(this.template), d(this, kt, fi).call(this);
814
- }, kt = new WeakSet(), fi = function() {
816
+ this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), d(this, Dt, yi).call(this);
817
+ }, Dt = new WeakSet(), yi = function() {
818
+ this.childDom = this.childNodes, this.template = Ns(this), this.innerHTML = "", this.append(this.template), d(this, kt, wi).call(this);
819
+ }, kt = new WeakSet(), wi = function() {
815
820
  const { videoType: t } = this;
816
821
  let e = "";
817
822
  function s(o) {
818
- f(o).addClass("cookie-disagree"), f(".cookie-disagree").append(`
823
+ g(o).addClass("cookie-disagree"), g(".cookie-disagree").append(`
819
824
  <div class="disagree-inner">
820
825
  <div class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="7" height="25" viewBox="0 0 7 25"
821
826
  fill="none">
@@ -835,65 +840,73 @@ St = new WeakSet(), mi = function() {
835
840
  case "youtubeAPI":
836
841
  break;
837
842
  case "youtube":
838
- document.body.wd_youtube == !1 ? s("video-player") : e = d(this, _t, vi).call(this);
843
+ document.body.wd_youtube == !1 ? s("video-player") : e = d(this, _t, Ti).call(this);
839
844
  break;
840
845
  case "youkuAPI":
841
846
  break;
842
847
  case "youku":
843
- document.body.wd_youku == !1 ? s("video-player") : e = d(this, xt, yi).call(this);
848
+ document.body.wd_youku == !1 ? s("video-player") : e = d(this, $t, Li).call(this);
844
849
  break;
845
850
  case "vimeo":
846
- document.body.wd_vimeo == !1 ? s("video-player") : e = d(this, $t, bi).call(this);
851
+ document.body.wd_vimeo == !1 ? s("video-player") : e = d(this, xt, Ei).call(this);
847
852
  break;
848
853
  case "bilibili":
849
- document.body.wd_bilibili == !1 ? s("video-player") : e = d(this, Ct, wi).call(this);
854
+ document.body.wd_bilibili == !1 ? s("video-player") : e = d(this, Ct, Ai).call(this);
850
855
  break;
851
856
  case "instagram":
852
- document.body.wd_instagram == !1 ? s(".instagram-media") : e = d(this, Ht, Ti).call(this);
857
+ document.body.wd_instagram == !1 ? s(".instagram-media") : e = d(this, Ht, Si).call(this);
853
858
  break;
854
859
  case "tiktok":
855
- document.body.wd_tiktok == !1 ? s("video-player") : e = d(this, Mt, Ei).call(this);
860
+ document.body.wd_tiktok == !1 ? s("video-player") : e = d(this, Mt, Di).call(this);
861
+ break;
862
+ case "videojs":
863
+ break;
864
+ case "video":
865
+ e = d(this, qt, ki).call(this);
856
866
  break;
857
867
  }
858
- this.querySelector(".player-wrapper").insertAdjacentHTML(A.prepend, e);
859
- }, _t = new WeakSet(), vi = function() {
868
+ this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, e);
869
+ }, _t = new WeakSet(), Ti = function() {
860
870
  const { videoId: t, autoplay: e, startTime: s } = this;
861
871
  return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
862
- }, $t = new WeakSet(), bi = function() {
872
+ }, xt = new WeakSet(), Ei = function() {
863
873
  const { videoId: t, autoplay: e, hash: s } = this;
864
874
  return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
865
- }, xt = new WeakSet(), yi = function() {
875
+ }, $t = new WeakSet(), Li = function() {
866
876
  const { videoId: t, autoplay: e } = this;
867
877
  return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
868
- }, Ct = new WeakSet(), wi = function() {
878
+ }, Ct = new WeakSet(), Ai = function() {
869
879
  const { videoId: t, autoplay: e } = this;
870
880
  return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
871
- }, Ht = new WeakSet(), Ti = function() {
881
+ }, Ht = new WeakSet(), Si = function() {
872
882
  const { videoId: t, autoplay: e } = this;
873
883
  return `<iframe class="instagram-media instagram-media-rendered" id="instagram-embed-0" src="https://www.instagram.com/p/${t}/embed/" width="num-w" height=" num-h" scrolling="auto" frameborder="0" data-instgrm-payload-id="instagram-media-payload-0"></iframe>`;
874
- }, Mt = new WeakSet(), Ei = function() {
884
+ }, Mt = new WeakSet(), Di = function() {
875
885
  const { videoId: t, autoplay: e } = this;
876
886
  return `<iframe name="__tt_embed__v79271677875424740" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/player/v1/${t}?&${e === "on" ? "autoplay=1" : ""}"></iframe>`;
887
+ }, qt = new WeakSet(), ki = function() {
888
+ const { videoId: t, autoplay: e } = this;
889
+ return `<video src="${t}" autoplay muted playsinline controls></video>`;
877
890
  };
878
- const vn = (n) => new Promise((i) => {
891
+ const Ln = (n) => new Promise((i) => {
879
892
  let t = setTimeout(() => (clearTimeout(t), i()), n);
880
893
  });
881
- function Ai(n) {
894
+ function _i(n) {
882
895
  const i = [];
883
896
  n && n.forEach((t) => {
884
897
  t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
885
- }), f("html").addClass("scrollLock"), bs(i);
898
+ }), g("html").addClass("scrollLock"), Ss(i);
886
899
  }
887
- function Li(n) {
900
+ function xi(n) {
888
901
  const i = [];
889
902
  n && n.forEach((t) => {
890
903
  t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
891
- }), f("html").removeClass("scrollLock"), ys(i);
904
+ }), g("html").removeClass("scrollLock"), Ds(i);
892
905
  }
893
- async function bn(n = 0) {
894
- if (f(".loading-wrapper").length)
906
+ async function An(n = 0) {
907
+ if (g(".loading-wrapper").length)
895
908
  return;
896
- f("body").append(`
909
+ g("body").append(`
897
910
  <div class="loading-wrapper">
898
911
  <div class="icon-box">
899
912
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
@@ -903,31 +916,31 @@ async function bn(n = 0) {
903
916
  </svg>
904
917
  </div>
905
918
  </div>
906
- `), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
907
- Ai();
919
+ `), g(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
920
+ _i();
908
921
  });
909
922
  }
910
- function yn() {
911
- f(".loading-wrapper").fadeOut(300).promise().done(function() {
912
- f(".loading-wrapper").remove(), Li();
923
+ function Sn() {
924
+ g(".loading-wrapper").fadeOut(300).promise().done(function() {
925
+ g(".loading-wrapper").remove(), xi();
913
926
  });
914
927
  }
915
- function wn(n, i) {
916
- new rn(n, i);
928
+ function Dn(n, i) {
929
+ new pn(n, i);
917
930
  }
918
- function Hs() {
919
- const n = document.querySelector("[data-aost]") && new hi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new Ve("[data-anchor-target]"), t = new Ye({ callback_loaded: () => {
920
- } }), e = new Ks();
931
+ function js() {
932
+ const n = document.querySelector("[data-aost]") && new gi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new ii("[data-anchor-target]"), t = new Qe({ callback_loaded: () => {
933
+ } }), e = new an();
921
934
  n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
922
935
  }
923
- function Tn(n, i = () => {
936
+ function kn(n, i = () => {
924
937
  }) {
925
- f(`[data-tab-content=${n}]`).fadeIn(function() {
938
+ g(`[data-tab-content=${n}]`).fadeIn(function() {
926
939
  typeof i == "function" && i();
927
- }).siblings("[data-tab-content]").hide(), Hs();
940
+ }).siblings("[data-tab-content]").hide(), js();
928
941
  }
929
- function En() {
930
- qe(
942
+ function _n() {
943
+ Ie(
931
944
  {
932
945
  target: document.body,
933
946
  cancel: {
@@ -951,28 +964,28 @@ function En() {
951
964
  }
952
965
  );
953
966
  }
954
- function An() {
967
+ function xn() {
955
968
  window.onpageshow = function(n) {
956
969
  n.persisted && window.location.reload();
957
970
  };
958
971
  }
959
- function Ln() {
972
+ function $n() {
960
973
  const n = navigator.userAgent;
961
974
  return {
962
975
  BigSurUP: /Mac OS X 10.15/.test(n) || /Mac OS X 10_15_7/.test(n) || /Mac OS X 10_15_8/.test(n) || /Mac OS X 10_15_9/.test(n) || /Mac OS X 11_/.test(n) || /Mac OS X 12_/.test(n)
963
976
  };
964
977
  }
965
- function Sn(n, i) {
966
- f(n).on("click", function() {
967
- f(this).toggleClass(i);
978
+ function Cn(n, i) {
979
+ g(n).on("click", function() {
980
+ g(this).toggleClass(i);
968
981
  });
969
982
  }
970
- function Dn(n, i) {
971
- f(n).on("click", function() {
972
- f(n).not(this).removeClass(i), f(this).addClass(i);
983
+ function Hn(n, i) {
984
+ g(n).on("click", function() {
985
+ g(n).not(this).removeClass(i), g(this).addClass(i);
973
986
  });
974
987
  }
975
- function Ms(n, i = 250) {
988
+ function zs(n, i = 250) {
976
989
  let t = null;
977
990
  return function(...e) {
978
991
  let s = this;
@@ -981,7 +994,7 @@ function Ms(n, i = 250) {
981
994
  }, i);
982
995
  };
983
996
  }
984
- function kn(n, i = 250) {
997
+ function Mn(n, i = 250) {
985
998
  let t, e;
986
999
  return function() {
987
1000
  const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
@@ -990,44 +1003,44 @@ function kn(n, i = 250) {
990
1003
  }, i)) : (t = a, n.apply(s, o));
991
1004
  };
992
1005
  }
993
- function _n() {
994
- window._g.interval = [], f(".countdown").each((i, t) => {
995
- const e = Number(f(t).attr("data-seconds")) + 1;
1006
+ function qn() {
1007
+ window._g.interval = [], g(".countdown").each((i, t) => {
1008
+ const e = Number(g(t).attr("data-seconds")) + 1;
996
1009
  let s = Math.floor(e / 60) + ":" + e % 60;
997
1010
  window._g.interval[i] = setInterval(function() {
998
1011
  var o = s.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
999
- --r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, f(t).html(a + ":" + r), s = a + ":" + r;
1012
+ --r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, g(t).html(a + ":" + r), s = a + ":" + r;
1000
1013
  }, 1e3);
1001
1014
  });
1002
1015
  }
1003
- function $n(n = 500) {
1016
+ function On(n = 500) {
1004
1017
  return new Promise((i, t) => {
1005
1018
  let e = setTimeout(() => {
1006
1019
  clearTimeout(e), i();
1007
1020
  }, n);
1008
1021
  });
1009
1022
  }
1010
- function xn() {
1023
+ function In() {
1011
1024
  const n = function() {
1012
1025
  let i = window.innerHeight * 0.01;
1013
1026
  document.documentElement.style.setProperty("--vh", i + "px");
1014
1027
  };
1015
- n(), window.addEventListener("resize", Ms(n));
1028
+ n(), window.addEventListener("resize", zs(n));
1016
1029
  }
1017
- function Cn(n, i, t, e, s) {
1018
- const o = this, r = f(n).html().split("<br>");
1030
+ function Nn(n, i, t, e, s) {
1031
+ const o = this, r = g(n).html().split("<br>");
1019
1032
  let l = "", c = 0;
1020
1033
  r.forEach((u, p) => {
1021
1034
  p !== 0 && (l += "<br>"), u.split("").forEach((m, v) => {
1022
1035
  i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), m === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++), v === u.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++);
1023
1036
  });
1024
- }), f(n).html(l);
1037
+ }), g(n).html(l);
1025
1038
  }
1026
- function Hn(n, i) {
1039
+ function Pn(n, i) {
1027
1040
  const t = Math.pow(10, i);
1028
1041
  return Math.round(n * t) / t;
1029
1042
  }
1030
- function Mn(n) {
1043
+ function jn(n) {
1031
1044
  let i = n.activeIndex, t = n.slides.length;
1032
1045
  if (n.params.loop)
1033
1046
  switch (n.activeIndex) {
@@ -1042,176 +1055,195 @@ function Mn(n) {
1042
1055
  }
1043
1056
  return i;
1044
1057
  }
1045
- function qn(n, i) {
1058
+ function zn(n, i) {
1046
1059
  const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
1047
- (n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), f(n.params.navigation.nextEl).hide(), f(n.params.navigation.prevEl).hide(), f(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), f(n.params.navigation.nextEl).show(), f(n.params.navigation.prevEl).show(), f(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
1060
+ (n.loopedSlides ? n.slides.length - n.loopedSlides * 2 : n.slides.length) <= s ? (t.addClass("swiper-no-swiping"), g(n.params.navigation.nextEl).hide(), g(n.params.navigation.prevEl).hide(), g(n.params.pagination.el).hide(), n.params.autoplay.enabled = !1, n.autoplay.stop()) : (t.removeClass("swiper-no-swiping"), g(n.params.navigation.nextEl).show(), g(n.params.navigation.prevEl).show(), g(n.params.pagination.el).show(), n.params.autoplay.enabled && n.autoplay.start());
1048
1061
  }
1049
- function In(n) {
1062
+ function Bn(n) {
1050
1063
  n.el.querySelectorAll("img.detect-shade").forEach((i) => {
1051
1064
  i.addEventListener("load", function() {
1052
1065
  detectShade(i);
1053
1066
  });
1054
1067
  });
1055
1068
  }
1056
- function On(n) {
1057
- const i = n.el, t = f(i).find(".swiper-slide-active"), e = f(t).find("video").get(0), s = f(i).find(".swiper-slide video");
1058
- n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
1069
+ function Wn(n) {
1070
+ const i = n.el, t = g(i).find(".swiper-slide-active"), e = g(t).find("video").get(0), s = g(i).find(".swiper-slide video");
1071
+ n.autoplay.stop(), g(e).off("ended"), e ? (s.each((o, a) => {
1059
1072
  a.currentTime = 0;
1060
- }), f(e).on("ended", function() {
1073
+ }), g(e).on("ended", function() {
1061
1074
  n.slideNext();
1062
1075
  }), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
1063
1076
  }
1064
- function Nn() {
1065
- f(".number-grow").each(function(n, i) {
1066
- const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1077
+ function Gn() {
1078
+ g(".number-grow").each(function(n, i) {
1079
+ const t = g(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1067
1080
  let r = "";
1068
1081
  for (var l = 0; l <= 9; l++)
1069
1082
  r += String(l) + "<br>";
1070
1083
  return r;
1071
1084
  };
1072
- f(o).each(function(r, l) {
1085
+ g(o).each(function(r, l) {
1073
1086
  const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
1074
1087
  t.append(c);
1075
1088
  });
1076
1089
  });
1077
1090
  }
1078
- function Pn() {
1079
- f(".letter-grow").each(function(n, i) {
1080
- const t = f(i), s = t.attr("data-letter").split(""), o = () => {
1091
+ function Rn() {
1092
+ g(".letter-grow").each(function(n, i) {
1093
+ const t = g(i), s = t.attr("data-letter").split(""), o = () => {
1081
1094
  let a = "";
1082
1095
  for (let r = 65; r <= 90; r++)
1083
1096
  a += String.fromCharCode(r) + "<br>";
1084
1097
  return a;
1085
1098
  };
1086
- f(s).each(function(a, r) {
1099
+ g(s).each(function(a, r) {
1087
1100
  const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
1088
1101
  t.append(l);
1089
1102
  });
1090
1103
  });
1091
1104
  }
1092
- function jn(n) {
1105
+ function Xn(n) {
1093
1106
  const i = getComputedStyle(n).transform;
1094
1107
  let t = i.match(/^matrix3d\((.+)\)$/);
1095
1108
  return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
1096
1109
  }
1097
- function zn(n) {
1110
+ function Yn(n) {
1098
1111
  const i = getComputedStyle(n).transform;
1099
1112
  let t = i.match(/^matrix3d\((.+)\)$/);
1100
1113
  return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
1101
1114
  }
1102
- function Wn(n) {
1115
+ function Fn(n) {
1103
1116
  const i = document.createElement("div");
1104
1117
  return i.innerHTML = n, i.childNodes[0];
1105
1118
  }
1106
- const We = (n) => n.videoId !== "" || typeof n.videoId < "u", qs = (n) => n.$selector.getAttribute("video4-active") === "on", dt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
1107
- var K, De, qt, Si, It, Di, tt, ke, Ot, ki;
1108
- class Is {
1119
+ const Xe = (n) => n.videoId !== "" || typeof n.videoId < "u", Bs = (n) => n.$selector.getAttribute("video4-active") === "on", dt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
1120
+ var K, _e, Ot, $i, It, Ci, tt, xe, Nt, Hi;
1121
+ const W = class W {
1122
+ //*-* 給Article4用的 **//
1109
1123
  constructor(i, t = {}) {
1110
1124
  h(this, K);
1111
- h(this, qt);
1125
+ h(this, Ot);
1112
1126
  h(this, It);
1113
1127
  h(this, tt);
1114
- h(this, Ot);
1115
- if (!rt(i) && !Te(i) && !lt(i)) {
1116
- je("video4", `找不到該物件 -> ${i}`);
1128
+ h(this, Nt);
1129
+ if (!rt(i) && !Ee(i) && !lt(i)) {
1130
+ Ge("video4", `找不到該物件 -> ${i}`);
1117
1131
  return;
1118
1132
  }
1119
1133
  this.__storage__ = {
1120
1134
  el: i,
1121
1135
  options: t
1122
- }, this.active = "data-video-active", d(this, K, De).call(this);
1136
+ }, this.active = "data-video-active", d(this, K, _e).call(this);
1123
1137
  }
1124
1138
  update() {
1125
- d(this, K, De).call(this);
1139
+ d(this, K, _e).call(this);
1126
1140
  }
1127
- }
1128
- K = new WeakSet(), De = function() {
1129
- const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Y;
1130
- if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
1131
- for (const [o, a] of Object.entries(this.options.on))
1132
- this.__events__[o] = [a];
1133
- d(this, qt, Si).call(this);
1134
- }, qt = new WeakSet(), Si = function() {
1141
+ };
1142
+ K = new WeakSet(), _e = function() {
1143
+ const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = Ne;
1144
+ if (t.isGlobal && (W.globalOptions = t), this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign(
1145
+ {},
1146
+ { LAYOUT: o },
1147
+ // 原始 configs 的 LAYOUT
1148
+ e,
1149
+ // 原始 configs 的 SETTINGS
1150
+ W.globalOptions,
1151
+ // 全站 A 設定
1152
+ t
1153
+ // 個別傳入的設定 (優先級最高)
1154
+ ), this.__events__ = Object.assign({}, s), this.options.on)
1155
+ for (const [a, r] of Object.entries(this.options.on))
1156
+ this.__events__[a] = [r];
1157
+ d(this, Ot, $i).call(this);
1158
+ }, Ot = new WeakSet(), $i = function() {
1135
1159
  const { elements: i, options: t } = this;
1136
1160
  i.forEach((e) => {
1137
- e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Ot, ki).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), We(e.video.params) && !qs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, It, Di).call(this, e)), We(e.video.params) || je("video4", "無法取得影片 ID");
1161
+ e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Nt, Hi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Xe(e.video.params) && !Bs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, It, Ci).call(this, e)), Xe(e.video.params) || Ge("video4", "無法取得影片 ID");
1138
1162
  }), this.emit("init");
1139
- }, It = new WeakSet(), Di = function(i) {
1140
- const { LAYOUT: t } = Y, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
1141
- if (l === "onBox") {
1142
- let g = null;
1163
+ }, It = new WeakSet(), Ci = function(i) {
1164
+ const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: p } = e;
1165
+ if (l === "onBox" || l === "inBox") {
1166
+ let f = null;
1143
1167
  if (u === "on") {
1144
- i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1145
- const m = s.querySelector("img");
1146
- m.insertAdjacentHTML(A.after, t[o]);
1147
- const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
1148
- !v && r == "youtube" ? p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
1149
- const y = b.thumbnail_url;
1150
- m.setAttribute("src", `${y}`);
1151
- }).catch(function(b) {
1168
+ i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), L("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1169
+ const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), b = t[o] ? t[o] : t[0] || "";
1170
+ b ? m.insertAdjacentHTML(S.after, b) : L("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube" ? p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((y) => y.json()).then((y) => {
1171
+ const w = y.thumbnail_url;
1172
+ m.setAttribute("src", `${w}`);
1173
+ }).catch(function(y) {
1152
1174
  console.log("error");
1153
- }) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1175
+ }) : L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1154
1176
  }
1155
- c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt, ke), g.addEventListener("click", g.video.eventHandler);
1177
+ c == "off" ? f = s : (f = s.querySelector(c) ?? s, s.querySelector(c) || L("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), f.video || (f.video = {}, f.video.params = e), f.video.eventHandler = d(this, tt, xe), f.addEventListener("click", f.video.eventHandler);
1156
1178
  } else if (l === "onPage") {
1157
- let g = null;
1179
+ let f = null;
1158
1180
  if (u == "on") {
1159
- i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(A.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1181
+ i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), L("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1160
1182
  const m = s.querySelector("img");
1161
- m.insertAdjacentHTML(A.after, t[o]);
1183
+ m.insertAdjacentHTML(S.after, t[o]);
1162
1184
  const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
1163
1185
  !v && r == "youtube" ? p == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
1164
1186
  const y = b.thumbnail_url;
1165
1187
  m.setAttribute("src", `${y}`);
1166
1188
  }).catch(function(b) {
1167
1189
  console.log("error");
1168
- }) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1190
+ }) : v || L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? f = s : (f = s.querySelector(c) ?? s, s.querySelector(c) || L("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1169
1191
  } else {
1170
1192
  s.innerHTML = dt(e);
1171
1193
  return;
1172
1194
  }
1173
- g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, tt, ke), g.addEventListener("click", g.video.eventHandler);
1174
- }
1175
- }, tt = new WeakSet(), ke = function(i) {
1176
- const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoTargetRoute: l, videoType: c, videoIgHtml: u } = t.params, p = new Ye({ callback_loaded: (g) => {
1177
- } });
1178
- if (o == "onBox") {
1179
- const g = {
1195
+ f.video || (f.video = {}, f.video.params = e), f.video.eventHandler = d(this, tt, xe), f.addEventListener("click", f.video.eventHandler);
1196
+ }
1197
+ }, tt = new WeakSet(), xe = function(i) {
1198
+ const { video: t, emit: e } = this, { $selector: s, videoMode: o, videoTarget: a, videoKeep: r, videoId: l, videoTargetRoute: c, videoType: u, videoIgHtml: p } = t.params, f = new Qe({ callback_loaded: (v) => {
1199
+ } }), m = new URLSearchParams({
1200
+ video_mode: o,
1201
+ video_type: u,
1202
+ video_id: l
1203
+ });
1204
+ if (o == "onBox" || o == "inBox") {
1205
+ const v = {
1180
1206
  target: a,
1181
- route: l,
1207
+ route: c + `?${m.toString()}`,
1182
1208
  on: {
1183
- complete(m) {
1184
- var v;
1185
- c == "instagram" ? (m.setAttribute("video-typeStyle", `${c}`), (v = window.instgrm) != null && v.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (m.querySelector(".modal-content").insertAdjacentHTML("beforeend", dt(t.params)), m.setAttribute("video-typeStyle", `${c}`));
1209
+ complete(b) {
1210
+ var y;
1211
+ o == "onBox" && (u == "instagram" ? (b.setAttribute("video-typeStyle", `${u}`), (y = window.instgrm) != null && y.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (b.querySelector(".modal-content").insertAdjacentHTML("beforeend", dt(t.params)), b.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && b.setAttribute("video-typeStyle", `${u}`);
1186
1212
  },
1187
- open(m) {
1188
- const v = m.querySelectorAll("[data-overlayscrollbars-viewport]");
1189
- if (p.update(), Ai([...v]), c == "instagram") {
1190
- const b = document.querySelector("[video-template] .modal-content");
1191
- new ResizeObserver((k) => {
1192
- k[0].contentRect.height > 50 && b.classList.add("active");
1193
- }).observe(b);
1213
+ open(b) {
1214
+ const y = b.querySelectorAll("[data-overlayscrollbars-viewport]");
1215
+ if (f.update(), _i([...y]), o == "onBox" && u == "instagram") {
1216
+ const w = document.querySelector("[video-template] .modal-content");
1217
+ new ResizeObserver((E) => {
1218
+ E[0].contentRect.height > 50 && w.classList.add("active");
1219
+ }).observe(w);
1220
+ }
1221
+ if (o == "inBox") {
1222
+ const w = b.querySelectorAll("[video-target]");
1223
+ w.length > 0 && new W(w, { LAYOUT: t.params.LAYOUT, videoLayoutNo: t.params.videoLayoutNo });
1194
1224
  }
1195
1225
  },
1196
- close(m) {
1197
- const v = m.querySelectorAll("[data-overlayscrollbars-viewport]");
1198
- Li([...v]);
1226
+ close(b) {
1227
+ const y = b.querySelectorAll("[data-overlayscrollbars-viewport]");
1228
+ xi([...y]);
1199
1229
  },
1200
- destroy(m) {
1230
+ destroy(b) {
1201
1231
  }
1202
1232
  }
1203
1233
  };
1204
- J.open(g);
1234
+ J.open(v);
1205
1235
  } else if (o == "onPage")
1206
1236
  if (t.params.videoAutoplay = "on", r == "off") {
1237
+ if (s.querySelector("video-player"))
1238
+ return;
1207
1239
  s.innerHTML = dt(t.params);
1208
1240
  return;
1209
1241
  } else {
1210
1242
  (s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", dt(t.params));
1211
1243
  return;
1212
1244
  }
1213
- }, Ot = new WeakSet(), ki = function(i) {
1214
- const { SETTINGS: t } = Y;
1245
+ }, Nt = new WeakSet(), Hi = function(i) {
1246
+ const t = this.options;
1215
1247
  return {
1216
1248
  $selector: i,
1217
1249
  videoId: i.getAttribute("video-id"),
@@ -1226,12 +1258,14 @@ K = new WeakSet(), De = function() {
1226
1258
  videoTargetRoute: i.getAttribute("video-target-route") || t.videoTargetRoute,
1227
1259
  videoStartTime: i.getAttribute("video-starttime") || t.videoStartTime,
1228
1260
  videoHighQualityPic: i.getAttribute("video-highquality") || t.videoHighQuality,
1229
- videoIgHtml: i.getAttribute("video-ig") || t.videoIgHtml
1261
+ videoIgHtml: i.getAttribute("video-ig") || t.videoIgHtml,
1262
+ LAYOUT: t.LAYOUT || []
1230
1263
  };
1231
- };
1232
- Object.assign(Is.prototype, O);
1233
- customElements.define("video-player", Cs);
1234
- const Os = {
1264
+ }, We(W, "globalOptions", {});
1265
+ let ke = W;
1266
+ Object.assign(ke.prototype, I);
1267
+ customElements.define("video-player", Ps);
1268
+ const Ws = {
1235
1269
  "zh-tw": {
1236
1270
  臺北市: [
1237
1271
  ["中正區", "100"],
@@ -2062,8 +2096,8 @@ const Os = {
2062
2096
  }
2063
2097
  };
2064
2098
  let U;
2065
- const Ns = (n) => {
2066
- const { TEMPLATE: i } = Ie, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
2099
+ const Gs = (n) => {
2100
+ const { TEMPLATE: i } = Pe, { childDom: t } = n.s, e = document.createElement("div"), s = n.classList.contains("filter"), o = n.getAttribute("filter-placeholder"), a = n.getAttribute("d4-icon"), r = n.getAttribute("custom-template");
2067
2101
  e.innerHTML = i(
2068
2102
  s,
2069
2103
  o,
@@ -2076,12 +2110,12 @@ const Ns = (n) => {
2076
2110
  (!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
2077
2111
  }) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
2078
2112
  }), e.children[0];
2079
- }, Ps = (n) => {
2113
+ }, Rs = (n) => {
2080
2114
  var t;
2081
2115
  const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
2082
2116
  i && i.forEach((e) => {
2083
2117
  const s = document.querySelector(e);
2084
- s || E("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && C(s, [...s.s.allLi].indexOf(s.s.activeLi)));
2118
+ s || L("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && C(s, [...s.s.allLi].indexOf(s.s.activeLi)));
2085
2119
  });
2086
2120
  }, C = (n, i) => {
2087
2121
  const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
@@ -2124,7 +2158,7 @@ const Ns = (n) => {
2124
2158
  const o = n.querySelectorAll(".dropdown-list li.active");
2125
2159
  o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
2126
2160
  const l = r.getAttribute("data-option"), c = r.textContent.trim(), u = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
2127
- n.s.selectDisplayEl.insertAdjacentHTML(A.append, u);
2161
+ n.s.selectDisplayEl.insertAdjacentHTML(S.append, u);
2128
2162
  })), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
2129
2163
  index: [...e].indexOf(r),
2130
2164
  id: r.getAttribute("data-option"),
@@ -2135,42 +2169,42 @@ const Ns = (n) => {
2135
2169
  break;
2136
2170
  }
2137
2171
  }
2138
- }, js = (n) => {
2172
+ }, Xs = (n) => {
2139
2173
  const i = n.s.cityLang;
2140
- f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (U = JSON.parse(f("#newCityData").val())[0], console.log([0])) : U = Os, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(U[i]).forEach((t) => {
2174
+ g("#newCityData").length > 0 ? g("#newCityData").val() !== "" && (U = JSON.parse(g("#newCityData").val())[0], console.log([0])) : U = Ws, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(U[i]).forEach((t) => {
2141
2175
  const e = document.createElement("li");
2142
2176
  e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
2143
2177
  }), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
2144
- }, zs = (n, i) => {
2178
+ }, Ys = (n, i) => {
2145
2179
  const t = n.s.cityLang;
2146
2180
  U[t][i].forEach((e, s) => {
2147
2181
  const o = document.createElement("li");
2148
2182
  o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
2149
2183
  });
2150
- }, _i = () => {
2151
- S('dropdown-el[d4-status="open"]').forEach((i) => {
2184
+ }, Mi = () => {
2185
+ k('dropdown-el[d4-status="open"]').forEach((i) => {
2152
2186
  i.close();
2153
2187
  });
2154
- }, Ws = () => {
2155
- const { SETTINGS: n } = Ie;
2188
+ }, Fs = () => {
2189
+ const { SETTINGS: n } = Pe;
2156
2190
  ((t, e) => {
2157
2191
  Object.keys(e).forEach((s) => {
2158
2192
  t.style.setProperty(`--${s}`, e[s]);
2159
2193
  });
2160
2194
  })(document.documentElement, n.scrollbar);
2161
2195
  };
2162
- Ws();
2196
+ Fs();
2163
2197
  document.addEventListener("click", function() {
2164
- _i();
2198
+ Mi();
2165
2199
  });
2166
- var Nt, xi, Pt, Ci, jt, Hi, zt, Mi;
2167
- class $i extends HTMLElement {
2200
+ var Pt, Oi, jt, Ii, zt, Ni, Bt, Pi;
2201
+ class qi extends HTMLElement {
2168
2202
  constructor() {
2169
2203
  super();
2170
- h(this, Nt);
2171
2204
  h(this, Pt);
2172
2205
  h(this, jt);
2173
2206
  h(this, zt);
2207
+ h(this, Bt);
2174
2208
  this.initialize = !1;
2175
2209
  }
2176
2210
  static get observedAttributes() {
@@ -2191,13 +2225,13 @@ class $i extends HTMLElement {
2191
2225
  switch (o.hasAttribute("multiple") ? "multiple" : "single") {
2192
2226
  case "single":
2193
2227
  const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
2194
- w(r) ? C(o, [...o.s.allLi].indexOf(r)) : C(o, -1);
2228
+ T(r) ? C(o, [...o.s.allLi].indexOf(r)) : C(o, -1);
2195
2229
  break;
2196
2230
  case "multiple":
2197
2231
  const l = [];
2198
2232
  o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
2199
2233
  const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
2200
- w(p) && (p.classList.add("active"), l.push(p));
2234
+ T(p) && (p.classList.add("active"), l.push(p));
2201
2235
  });
2202
2236
  const c = l.map((u) => [...o.s.allLi].indexOf(u));
2203
2237
  C(o, c);
@@ -2216,11 +2250,11 @@ class $i extends HTMLElement {
2216
2250
  }
2217
2251
  connectedCallback() {
2218
2252
  const t = this;
2219
- t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Nt, xi).call(this));
2253
+ t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Pt, Oi).call(this));
2220
2254
  }
2221
2255
  open() {
2222
2256
  const t = this, e = t.querySelector(".dropdown-scroller").clientHeight, s = t.classList.contains("filter"), o = () => s ? t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e : e;
2223
- return _i(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
2257
+ return Mi(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
2224
2258
  height: ${o()}px;
2225
2259
  z-index: 2;
2226
2260
  `, this;
@@ -2242,14 +2276,14 @@ class $i extends HTMLElement {
2242
2276
  this.__events__.selectOption();
2243
2277
  }
2244
2278
  }
2245
- Nt = new WeakSet(), xi = function() {
2246
- this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Pt, Ci).call(this);
2247
- }, Pt = new WeakSet(), Ci = function() {
2248
- this.s.childDom = this.childNodes, this.s.template = Ns(this), this.innerHTML = "", this.append(this.s.template), d(this, jt, Hi).call(this);
2249
- }, jt = new WeakSet(), Hi = function() {
2279
+ Pt = new WeakSet(), Oi = function() {
2280
+ this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, jt, Ii).call(this);
2281
+ }, jt = new WeakSet(), Ii = function() {
2282
+ this.s.childDom = this.childNodes, this.s.template = Gs(this), this.innerHTML = "", this.append(this.s.template), d(this, zt, Ni).call(this);
2283
+ }, zt = new WeakSet(), Ni = function() {
2250
2284
  var s;
2251
2285
  const t = this;
2252
- t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", js(t), t.s.subDropdownTotalH = 0;
2286
+ t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Xs(t), t.s.subDropdownTotalH = 0;
2253
2287
  const e = t.getAttribute("d4-value");
2254
2288
  switch (t.s.selectType) {
2255
2289
  case "single":
@@ -2258,14 +2292,14 @@ Nt = new WeakSet(), xi = function() {
2258
2292
  const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
2259
2293
  if (r && l) {
2260
2294
  const c = r.getAttribute("d4-value");
2261
- if (zs(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2295
+ if (Ys(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2262
2296
  const u = e.split(",")[1];
2263
2297
  o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
2264
2298
  }
2265
2299
  }
2266
2300
  } else
2267
2301
  o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
2268
- w(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
2302
+ T(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
2269
2303
  index: [...t.s.allLi].indexOf(o),
2270
2304
  id: e,
2271
2305
  el: o
@@ -2279,7 +2313,7 @@ Nt = new WeakSet(), xi = function() {
2279
2313
  const a = [];
2280
2314
  e.split(",").forEach((r) => {
2281
2315
  const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
2282
- w(l) && a.push(l);
2316
+ T(l) && a.push(l);
2283
2317
  }), a.length > 0 ? t.s.value = {
2284
2318
  index: a.map((r) => [...t.s.allLi].indexOf(r)),
2285
2319
  id: a.map((r) => r.getAttribute("data-option")),
@@ -2291,8 +2325,8 @@ Nt = new WeakSet(), xi = function() {
2291
2325
  };
2292
2326
  break;
2293
2327
  }
2294
- C(t, t.s.value.index), d(s = t, zt, Mi).call(s), t.classList.add("d4-initialize");
2295
- }, zt = new WeakSet(), Mi = function() {
2328
+ C(t, t.s.value.index), d(s = t, Bt, Pi).call(s), t.classList.add("d4-initialize");
2329
+ }, Bt = new WeakSet(), Pi = function() {
2296
2330
  const t = this;
2297
2331
  t.__events__.dropdownToggle = () => {
2298
2332
  t.addEventListener("click", function(e) {
@@ -2314,10 +2348,10 @@ Nt = new WeakSet(), xi = function() {
2314
2348
  const r = t.querySelector(".dropdown-scroller"), l = () => {
2315
2349
  if (t.__scroller__) {
2316
2350
  const { viewport: c } = t.__scroller__.elements();
2317
- if (w(t.s.activeLi)) {
2318
- const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, g = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
2351
+ if (T(t.s.activeLi)) {
2352
+ const u = t.s.activeLi.clientHeight / 2, p = t.s.activeLi.offsetTop, f = p - r.clientHeight / 2 + u > 0 ? p - r.clientHeight / 2 + u : 0;
2319
2353
  c.scrollTo({
2320
- top: g,
2354
+ top: f,
2321
2355
  behavior: "smooth"
2322
2356
  });
2323
2357
  } else
@@ -2338,7 +2372,7 @@ Nt = new WeakSet(), xi = function() {
2338
2372
  t.s.dropdownEl.addEventListener("transitionend", e);
2339
2373
  }, t.__events__.bindScrollbar = (e = this) => {
2340
2374
  const s = e.querySelector(".dropdown-scroller");
2341
- e.__scroller__ = qe(s, {
2375
+ e.__scroller__ = Ie(s, {
2342
2376
  overflowBehavior: {
2343
2377
  x: "hidden"
2344
2378
  }
@@ -2349,27 +2383,27 @@ Nt = new WeakSet(), xi = function() {
2349
2383
  e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
2350
2384
  l.addEventListener("click", function(c) {
2351
2385
  var m;
2352
- const u = this, p = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
2386
+ const u = this, p = [...e.s.allLi].indexOf(u), f = parseInt(e.getAttribute("d4-default-height"));
2353
2387
  if (u.classList.contains("has-sublayer")) {
2354
2388
  c.stopPropagation();
2355
2389
  const v = u.querySelector(".sub-dropdown"), b = v.querySelector(".sub-dropdown-list"), y = parseInt(getComputedStyle(b).marginTop) + parseInt(getComputedStyle(b).marginBottom);
2356
2390
  v.style.cssText = `--height: ${b.offsetHeight + y}px`;
2357
- const k = parseInt(v.style.cssText.replace("--height:", "").trim()), G = parseInt(getComputedStyle(a).maxHeight), D = () => {
2358
- s = g + e.s.subDropdownTotalH, o = s > G ? G : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
2391
+ const w = parseInt(v.style.cssText.replace("--height:", "").trim()), z = parseInt(getComputedStyle(a).maxHeight), E = () => {
2392
+ s = f + e.s.subDropdownTotalH, o = s > z ? z : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
2359
2393
  };
2360
- u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= k, D()) : (u.classList.add("open"), e.s.subDropdownTotalH += k, D());
2361
- const R = () => {
2362
- e.__scroller__.update(!0), v.removeEventListener("transitionend", R);
2394
+ u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= w, E()) : (u.classList.add("open"), e.s.subDropdownTotalH += w, E());
2395
+ const X = () => {
2396
+ e.__scroller__.update(!0), v.removeEventListener("transitionend", X);
2363
2397
  };
2364
- v.addEventListener("transitionend", R);
2398
+ v.addEventListener("transitionend", X);
2365
2399
  } else
2366
- switch (Ps(e), e.s.selectType) {
2400
+ switch (Rs(e), e.s.selectType) {
2367
2401
  case "single":
2368
2402
  if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
2369
2403
  const v = e.s.cityLang, b = l.textContent.trim(), y = document.getElementById(e.getAttribute("dist-select"));
2370
- y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), U[v][b].forEach((k, G) => {
2371
- const D = document.createElement("li");
2372
- D.textContent = k[0], D.setAttribute("data-option", k[0]), y.querySelector(".dropdown-list").append(D);
2404
+ y && (y.querySelector(".dropdown-list").textContent = "", C(y, -1), U[v][b].forEach((w, z) => {
2405
+ const E = document.createElement("li");
2406
+ E.textContent = w[0], E.setAttribute("data-option", w[0]), y.querySelector(".dropdown-list").append(E);
2373
2407
  }), e.__events__.selectOption(y));
2374
2408
  }
2375
2409
  (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
@@ -2408,8 +2442,8 @@ Nt = new WeakSet(), xi = function() {
2408
2442
  });
2409
2443
  }, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
2410
2444
  };
2411
- Object.assign($i.prototype, O);
2412
- customElements.define("dropdown-el", $i);
2445
+ Object.assign(qi.prototype, I);
2446
+ customElements.define("dropdown-el", qi);
2413
2447
  function ht(n) {
2414
2448
  const i = {};
2415
2449
  return [...n.attributes].forEach((t) => {
@@ -2419,7 +2453,7 @@ function ht(n) {
2419
2453
  }
2420
2454
  }), Object.keys(i).length === 0 ? null : i;
2421
2455
  }
2422
- function Be(n) {
2456
+ function Ye(n) {
2423
2457
  if (ht(n)) {
2424
2458
  let i;
2425
2459
  const t = Object.keys(ht(n)).map((e) => ({
@@ -2435,7 +2469,7 @@ function Be(n) {
2435
2469
  } else
2436
2470
  return n.s.options.duration;
2437
2471
  }
2438
- function Bs(n) {
2472
+ function Us(n) {
2439
2473
  const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
2440
2474
  o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
2441
2475
  a.append(l);
@@ -2446,7 +2480,7 @@ function Bs(n) {
2446
2480
  }
2447
2481
  n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
2448
2482
  }
2449
- function $(n) {
2483
+ function x(n) {
2450
2484
  const { behavior: i, direction: t, continual: e } = n.s.options;
2451
2485
  let s = {};
2452
2486
  switch (i) {
@@ -2502,20 +2536,20 @@ function $(n) {
2502
2536
  }
2503
2537
  return s;
2504
2538
  }
2505
- function Gs(n) {
2539
+ function Js(n) {
2506
2540
  let i;
2507
2541
  return function(t) {
2508
2542
  i && clearTimeout(i), i = setTimeout(n, 200, t);
2509
2543
  };
2510
2544
  }
2511
- var Wt, qi, Bt, Ii, Gt, Oi, Rt, Ni;
2512
- class Rs extends HTMLElement {
2545
+ var Wt, ji, Gt, zi, Rt, Bi, Xt, Wi;
2546
+ class Zs extends HTMLElement {
2513
2547
  constructor() {
2514
2548
  super();
2515
2549
  h(this, Wt);
2516
- h(this, Bt);
2517
2550
  h(this, Gt);
2518
2551
  h(this, Rt);
2552
+ h(this, Xt);
2519
2553
  this.initialize = !1;
2520
2554
  }
2521
2555
  static get observedAttributes() {
@@ -2524,7 +2558,7 @@ class Rs extends HTMLElement {
2524
2558
  attributeChangedCallback(t, e, s) {
2525
2559
  }
2526
2560
  connectedCallback() {
2527
- this.initialize || (this.initialize = !0, d(this, Wt, qi).call(this));
2561
+ this.initialize || (this.initialize = !0, d(this, Wt, ji).call(this));
2528
2562
  }
2529
2563
  play() {
2530
2564
  this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
@@ -2533,25 +2567,25 @@ class Rs extends HTMLElement {
2533
2567
  this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
2534
2568
  }
2535
2569
  }
2536
- Wt = new WeakSet(), qi = function() {
2570
+ Wt = new WeakSet(), ji = function() {
2537
2571
  const t = {
2538
- direction: this.getAttribute("direction") || x.SETTINGS.direction,
2572
+ direction: this.getAttribute("direction") || $.SETTINGS.direction,
2539
2573
  // up / down / left / right
2540
- behavior: this.getAttribute("behavior") || x.SETTINGS.behavior,
2574
+ behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
2541
2575
  // normal / alternate / endStop
2542
- duration: Number(this.getAttribute("duration")) || x.SETTINGS.duration,
2576
+ duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
2543
2577
  // ms
2544
- durationBreakpoints: ht(this) || x.SETTINGS.durationBreakpoints,
2545
- autoplay: this.getAttribute("autoplay") || x.SETTINGS.autoplay,
2578
+ durationBreakpoints: ht(this) || $.SETTINGS.durationBreakpoints,
2579
+ autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
2546
2580
  // normal / alternate / endStop
2547
- pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : x.SETTINGS.pauseOnMouseenter,
2581
+ pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
2548
2582
  // true / false
2549
- continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : x.SETTINGS.continual,
2583
+ continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
2550
2584
  // true / false
2551
- gap: Number(this.getAttribute("gap")) || x.SETTINGS.gap
2585
+ gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
2552
2586
  };
2553
- this.s = {}, this.s.options = t, this.s.nowDuration = Be(this), Bs(this), d(this, Bt, Ii).call(this);
2554
- }, Bt = new WeakSet(), Ii = function() {
2587
+ this.s = {}, this.s.options = t, this.s.nowDuration = Ye(this), Us(this), d(this, Gt, zi).call(this);
2588
+ }, Gt = new WeakSet(), zi = function() {
2555
2589
  const { direction: t, continual: e, gap: s } = this.s.options;
2556
2590
  switch (t) {
2557
2591
  case "left":
@@ -2563,17 +2597,17 @@ Wt = new WeakSet(), qi = function() {
2563
2597
  e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${s}px;`;
2564
2598
  break;
2565
2599
  }
2566
- d(this, Gt, Oi).call(this), d(this, Rt, Ni).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
2567
- }, Gt = new WeakSet(), Oi = function() {
2600
+ d(this, Rt, Bi).call(this), d(this, Xt, Wi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
2601
+ }, Rt = new WeakSet(), Bi = function() {
2568
2602
  const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
2569
2603
  let c;
2570
2604
  function u() {
2571
2605
  switch (s) {
2572
2606
  case "normal":
2573
- t.s.animateEl.style.transform = `${$(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate($(t).animate1, {
2607
+ t.s.animateEl.style.transform = `${x(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(x(t).animate1, {
2574
2608
  duration: t.s.nowDuration,
2575
2609
  iterations: 1 / 0
2576
- }), l && (t.s.cloneAnimateEl.style.transform = `${$(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate($(t).animate2, {
2610
+ }), l && (t.s.cloneAnimateEl.style.transform = `${x(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(x(t).animate2, {
2577
2611
  duration: t.s.nowDuration,
2578
2612
  delay: -t.s.nowDuration / 2,
2579
2613
  iterations: 1 / 0
@@ -2584,25 +2618,25 @@ Wt = new WeakSet(), qi = function() {
2584
2618
  let v = [];
2585
2619
  switch (e) {
2586
2620
  case "top":
2587
- p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
2621
+ p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
2588
2622
  break;
2589
2623
  case "right":
2590
- p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2624
+ p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(t.s.nowDuration / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2591
2625
  break;
2592
2626
  case "bottom":
2593
- p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
2627
+ p = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), f = parseInt(o / (p * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
2594
2628
  break;
2595
2629
  case "left":
2596
- p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
2630
+ p = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), f = parseInt(o / (p * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
2597
2631
  break;
2598
2632
  }
2599
2633
  return v;
2600
- }, p, g;
2634
+ }, p, f;
2601
2635
  (t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${m()[0].transform}`, t.s.animateEl.animate(m(), {
2602
- duration: g,
2636
+ duration: f,
2603
2637
  fill: "forwards"
2604
2638
  }).finished.then(() => {
2605
- t.s.animation = t.s.animateEl.animate($(t).animate1, {
2639
+ t.s.animation = t.s.animateEl.animate(x(t).animate1, {
2606
2640
  duration: t.s.nowDuration,
2607
2641
  iterations: 1 / 0
2608
2642
  });
@@ -2611,7 +2645,7 @@ Wt = new WeakSet(), qi = function() {
2611
2645
  });
2612
2646
  break;
2613
2647
  case "endStop":
2614
- t.s.animateEl.style.transform = `${$(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate($(t).animate1, {
2648
+ t.s.animateEl.style.transform = `${x(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(x(t).animate1, {
2615
2649
  duration: t.s.nowDuration,
2616
2650
  fill: "forwards"
2617
2651
  });
@@ -2629,23 +2663,23 @@ Wt = new WeakSet(), qi = function() {
2629
2663
  }), t.addEventListener("mouseleave", function() {
2630
2664
  t.s.animation && r && t.s.animation.playState === "paused" && t.play();
2631
2665
  });
2632
- }, Rt = new WeakSet(), Ni = function() {
2666
+ }, Xt = new WeakSet(), Wi = function() {
2633
2667
  const t = this;
2634
2668
  function e() {
2635
2669
  const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
2636
- t.s.nowDuration = Be(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate($(t).animate1, {
2670
+ t.s.nowDuration = Ye(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(x(t).animate1, {
2637
2671
  duration: t.s.nowDuration,
2638
2672
  iterations: 1 / 0
2639
- }), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate($(t).animate2, {
2673
+ }), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(x(t).animate2, {
2640
2674
  duration: t.s.nowDuration,
2641
2675
  delay: -t.s.nowDuration / 2,
2642
2676
  iterations: 1 / 0
2643
2677
  }), t.s.cloneAnimation.startTime = o);
2644
2678
  }
2645
- window.addEventListener("resize", Gs(e));
2679
+ window.addEventListener("resize", Js(e));
2646
2680
  };
2647
- customElements.define("marquee-el", Rs);
2648
- const Ge = function(n, i) {
2681
+ customElements.define("marquee-el", Zs);
2682
+ const Fe = function(n, i) {
2649
2683
  let t;
2650
2684
  return function(e) {
2651
2685
  t && clearTimeout(t), t = setTimeout(n, 200, e);
@@ -2658,7 +2692,7 @@ const Ge = function(n, i) {
2658
2692
  return;
2659
2693
  }
2660
2694
  n.classList.add(i);
2661
- }, T = (n, i) => {
2695
+ }, A = (n, i) => {
2662
2696
  if (lt(n)) {
2663
2697
  n.forEach((t) => {
2664
2698
  t.classList.remove(i);
@@ -2667,22 +2701,22 @@ const Ge = function(n, i) {
2667
2701
  }
2668
2702
  n.classList.remove(i);
2669
2703
  };
2670
- var Xt, Pi, Ft, ji, Yt, zi, et, _e, W, pt, Ut, Wi;
2671
- class Re {
2704
+ var Yt, Gi, Ft, Ri, Ut, Xi, et, $e, G, pt, Jt, Yi;
2705
+ class Ue {
2672
2706
  constructor(i) {
2673
2707
  // 初始化
2674
- h(this, Xt);
2708
+ h(this, Yt);
2675
2709
  // 左右箭頭事件綁定
2676
2710
  h(this, Ft);
2677
2711
  // 左右拖拉事件綁定
2678
- h(this, Yt);
2712
+ h(this, Ut);
2679
2713
  // 卷軸位置判斷
2680
2714
  h(this, et);
2681
2715
  // 隱藏按鈕判斷
2682
- h(this, W);
2716
+ h(this, G);
2683
2717
  // 選項事件綁定
2684
- h(this, Ut);
2685
- this.$element = i, this.option = i.s.option.drag, d(this, Xt, Pi).call(this);
2718
+ h(this, Jt);
2719
+ this.$element = i, this.option = i.s.option.drag, d(this, Yt, Gi).call(this);
2686
2720
  }
2687
2721
  // 更新 active 位置
2688
2722
  update(i) {
@@ -2696,7 +2730,7 @@ class Re {
2696
2730
  }
2697
2731
  }
2698
2732
  }
2699
- Xt = new WeakSet(), Pi = function() {
2733
+ Yt = new WeakSet(), Gi = function() {
2700
2734
  var s, o, a, r;
2701
2735
  const i = this;
2702
2736
  if (!i.$element)
@@ -2705,11 +2739,11 @@ Xt = new WeakSet(), Pi = function() {
2705
2739
  let t = !1;
2706
2740
  const e = () => {
2707
2741
  t || (requestAnimationFrame(() => {
2708
- d(this, et, _e).call(this), d(this, W, pt).call(this), t = !1;
2742
+ d(this, et, $e).call(this), d(this, G, pt).call(this), t = !1;
2709
2743
  }), t = !0);
2710
2744
  };
2711
- i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, Yt, zi).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
2712
- A.prepend,
2745
+ i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, Ut, Xi).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
2746
+ S.prepend,
2713
2747
  `<div class="navigation">
2714
2748
  <div class="button prev">
2715
2749
  <div></div>
@@ -2718,10 +2752,10 @@ Xt = new WeakSet(), Pi = function() {
2718
2752
  <div></div>
2719
2753
  </div>
2720
2754
  </div>`
2721
- ), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Ft, ji).call(a)), d(r = i, Ut, Wi).call(r), i.update(), requestAnimationFrame(() => {
2722
- d(this, et, _e).call(this), d(this, W, pt).call(this);
2755
+ ), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Ft, Ri).call(a)), d(r = i, Jt, Yi).call(r), i.update(), requestAnimationFrame(() => {
2756
+ d(this, et, $e).call(this), d(this, G, pt).call(this);
2723
2757
  });
2724
- }, Ft = new WeakSet(), ji = function() {
2758
+ }, Ft = new WeakSet(), Ri = function() {
2725
2759
  const i = this, { $wrapper: t, $button: e } = i, s = function() {
2726
2760
  const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
2727
2761
  t.scrollTo({
@@ -2729,13 +2763,13 @@ Xt = new WeakSet(), Pi = function() {
2729
2763
  behavior: "smooth"
2730
2764
  }), setTimeout(() => {
2731
2765
  var r;
2732
- d(r = i, W, pt).call(r);
2766
+ d(r = i, G, pt).call(r);
2733
2767
  }, 100);
2734
2768
  };
2735
2769
  e.forEach((o) => {
2736
2770
  o.removeEventListener("click", s), o.addEventListener("click", s);
2737
2771
  });
2738
- }, Yt = new WeakSet(), zi = function() {
2772
+ }, Ut = new WeakSet(), Xi = function() {
2739
2773
  const { $wrapper: i } = this;
2740
2774
  let t = !1, e = !1, s = 0, o = 0;
2741
2775
  const a = function(p) {
@@ -2765,21 +2799,21 @@ Xt = new WeakSet(), Pi = function() {
2765
2799
  i.querySelectorAll("a").forEach((p) => {
2766
2800
  p.removeEventListener("click", u), p.addEventListener("click", u);
2767
2801
  });
2768
- }, et = new WeakSet(), _e = function() {
2802
+ }, et = new WeakSet(), $e = function() {
2769
2803
  const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
2770
- e <= 0 || (_(i, "scrollable"), s == 0 ? (T(i, "scrollable"), _(t, "start"), T(t, "end")) : s + 1 >= e ? (T(i, "scrollable"), T(t, "start"), _(t, "end")) : (_(t, "center"), T(t, "start"), T(t, "end")));
2771
- }, W = new WeakSet(), pt = function() {
2804
+ e <= 0 || (_(i, "scrollable"), s == 0 ? (A(i, "scrollable"), _(t, "start"), A(t, "end")) : s + 1 >= e ? (A(i, "scrollable"), A(t, "start"), _(t, "end")) : (_(t, "center"), A(t, "start"), A(t, "end")));
2805
+ }, G = new WeakSet(), pt = function() {
2772
2806
  const { $wrapper: i, $button: t, $element: e } = this;
2773
2807
  if (!t)
2774
2808
  return;
2775
2809
  const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
2776
2810
  if (s <= 0) {
2777
- _(t, "hide"), T(t, "active"), _(e, "noScrollable");
2811
+ _(t, "hide"), A(t, "active"), _(e, "noScrollable");
2778
2812
  return;
2779
2813
  }
2780
- s > 0 && (_(t, "active"), T(e, "noScrollable")), o == 0 ? t.forEach((a) => {
2814
+ s > 0 && (_(t, "active"), A(e, "noScrollable")), o == 0 ? t.forEach((a) => {
2781
2815
  if (a.classList.contains("next")) {
2782
- T(a, "hide");
2816
+ A(a, "hide");
2783
2817
  return;
2784
2818
  }
2785
2819
  _(a, "hide");
@@ -2788,9 +2822,9 @@ Xt = new WeakSet(), Pi = function() {
2788
2822
  _(a, "hide");
2789
2823
  return;
2790
2824
  }
2791
- T(a, "hide");
2792
- }) : T(t, "hide");
2793
- }, Ut = new WeakSet(), Wi = function() {
2825
+ A(a, "hide");
2826
+ }) : A(t, "hide");
2827
+ }, Jt = new WeakSet(), Yi = function() {
2794
2828
  const { $element: i } = this, t = (s) => {
2795
2829
  if (this.option.selected) {
2796
2830
  const o = s.getAttribute("data-option").trim();
@@ -2804,31 +2838,31 @@ Xt = new WeakSet(), Pi = function() {
2804
2838
  s.removeEventListener("click", e), s.addEventListener("click", e);
2805
2839
  });
2806
2840
  };
2807
- var Jt, Bi, Zt, Gi, Qt, Ri, Vt, Xi;
2808
- class Xs {
2841
+ var Zt, Fi, Qt, Ui, Vt, Ji, Kt, Zi;
2842
+ class Qs {
2809
2843
  constructor(i) {
2810
2844
  // 初始化
2811
- h(this, Jt);
2812
- // 隱藏按鈕判斷
2813
2845
  h(this, Zt);
2814
- // 展開箭頭事件綁定
2846
+ // 隱藏按鈕判斷
2815
2847
  h(this, Qt);
2816
- // 選項事件綁定
2848
+ // 展開箭頭事件綁定
2817
2849
  h(this, Vt);
2818
- this.$element = i, this.option = i.s.option.collapse, d(this, Jt, Bi).call(this);
2850
+ // 選項事件綁定
2851
+ h(this, Kt);
2852
+ this.$element = i, this.option = i.s.option.collapse, d(this, Zt, Fi).call(this);
2819
2853
  }
2820
2854
  }
2821
- Jt = new WeakSet(), Bi = function() {
2822
- this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Zt, Gi).call(this) && d(this, Qt, Ri).call(this), d(this, Vt, Xi).call(this));
2823
- }, Zt = new WeakSet(), Gi = function() {
2855
+ Zt = new WeakSet(), Fi = function() {
2856
+ this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, Qt, Ui).call(this) && d(this, Vt, Ji).call(this), d(this, Kt, Zi).call(this));
2857
+ }, Qt = new WeakSet(), Ui = function() {
2824
2858
  const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
2825
- return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(A.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), T(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
2826
- }, Qt = new WeakSet(), Ri = function() {
2859
+ return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), A(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
2860
+ }, Vt = new WeakSet(), Ji = function() {
2827
2861
  const { $element: i, $button: t } = this, e = function() {
2828
2862
  i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
2829
2863
  };
2830
2864
  t.removeEventListener("click", e), t.addEventListener("click", e);
2831
- }, Vt = new WeakSet(), Xi = function() {
2865
+ }, Kt = new WeakSet(), Zi = function() {
2832
2866
  const { $element: i } = this, t = (s, o) => {
2833
2867
  if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
2834
2868
  const a = s.getAttribute("data-option").trim();
@@ -2842,20 +2876,20 @@ Jt = new WeakSet(), Bi = function() {
2842
2876
  s.removeEventListener("click", e), s.addEventListener("click", e);
2843
2877
  });
2844
2878
  };
2845
- const Fs = (n) => {
2879
+ const Vs = (n) => {
2846
2880
  const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
2847
- return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e)), i == "collapse" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(A.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(A.append, e)), i == "dropdown" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(A.append, e)), s.children;
2881
+ return i == "drag" && (s.innerHTML = H.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = H.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
2848
2882
  };
2849
- var Kt, Fi, te, Yi, it, $e, B, mt;
2850
- class Ys extends HTMLElement {
2883
+ var te, Qi, ee, Vi, it, Ce, R, mt;
2884
+ class Ks extends HTMLElement {
2851
2885
  constructor() {
2852
2886
  super();
2853
- h(this, Kt);
2854
2887
  h(this, te);
2888
+ h(this, ee);
2855
2889
  // 斷點設定
2856
2890
  h(this, it);
2857
2891
  // check type
2858
- h(this, B);
2892
+ h(this, R);
2859
2893
  this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
2860
2894
  }
2861
2895
  static get observedAttributes() {
@@ -2867,7 +2901,7 @@ class Ys extends HTMLElement {
2867
2901
  case "m4-type":
2868
2902
  if (e === null || e === s)
2869
2903
  return;
2870
- this.s.type = s, d(this, B, mt).call(this);
2904
+ this.s.type = s, d(this, R, mt).call(this);
2871
2905
  break;
2872
2906
  case "m4-status":
2873
2907
  if (e === s)
@@ -2884,13 +2918,13 @@ class Ys extends HTMLElement {
2884
2918
  }
2885
2919
  }
2886
2920
  connectedCallback() {
2887
- this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, Kt, Fi).call(this));
2921
+ this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, te, Qi).call(this));
2888
2922
  }
2889
2923
  update() {
2890
- d(this, it, $e).call(this);
2924
+ d(this, it, Ce).call(this);
2891
2925
  }
2892
2926
  }
2893
- Kt = new WeakSet(), Fi = function() {
2927
+ te = new WeakSet(), Qi = function() {
2894
2928
  let t = {};
2895
2929
  this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? H.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
2896
2930
  const e = (s) => {
@@ -2901,72 +2935,72 @@ Kt = new WeakSet(), Fi = function() {
2901
2935
  }
2902
2936
  this.update();
2903
2937
  };
2904
- window.removeEventListener("resize", Ge(e)), window.addEventListener("resize", Ge(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, H.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, H.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, H.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, H.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, te, Yi).call(this);
2905
- }, te = new WeakSet(), Yi = function() {
2906
- this.classList.add("m4-init"), d(this, it, $e).call(this);
2907
- }, it = new WeakSet(), $e = function() {
2938
+ window.removeEventListener("resize", Fe(e)), window.addEventListener("resize", Fe(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, H.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, H.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, H.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, H.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, ee, Vi).call(this);
2939
+ }, ee = new WeakSet(), Vi = function() {
2940
+ this.classList.add("m4-init"), d(this, it, Ce).call(this);
2941
+ }, it = new WeakSet(), Ce = function() {
2908
2942
  const t = Object.keys(this.s.option.breakpoint);
2909
2943
  if (!t.length) {
2910
- d(this, B, mt).call(this);
2944
+ d(this, R, mt).call(this);
2911
2945
  return;
2912
2946
  }
2913
2947
  t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
2914
2948
  var s, o, a, r;
2915
- return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, B, mt).call(this), window.innerWidth >= e;
2949
+ return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, R, mt).call(this), window.innerWidth >= e;
2916
2950
  });
2917
- }, B = new WeakSet(), mt = function() {
2951
+ }, R = new WeakSet(), mt = function() {
2918
2952
  var o;
2919
2953
  const { type: t } = this.s;
2920
- this.innerHTML = "", [...Fs(this)].forEach((a) => {
2954
+ this.innerHTML = "", [...Vs(this)].forEach((a) => {
2921
2955
  this.append(a);
2922
2956
  });
2923
2957
  const e = this.querySelector(`.drag-container .item[data-option="${this.getAttribute("m4-status")}"]`), s = this.querySelector(`.collapse-container .item[data-option="${this.getAttribute("m4-status")}"]`);
2924
2958
  switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
2925
2959
  case "drag":
2926
- this.drag = new Re(this);
2960
+ this.drag = new Ue(this);
2927
2961
  break;
2928
2962
  case "collapse":
2929
- this.drag = new Re(this), this.collapse = new Xs(this);
2963
+ this.drag = new Ue(this), this.collapse = new Qs(this);
2930
2964
  break;
2931
2965
  }
2932
2966
  (o = this.drag) == null || o.update();
2933
2967
  };
2934
- customElements.define("multipurpose-nav", Ys);
2935
- var ee, Ji, ie, Zi, st, xe, P, F, se, Qi, ne, Vi, oe, Ki, ae, ts, re, es, le, is, ce, ss, de, ns, ue, os, q, z, he, as, pe, rs, me, ls, ge, cs;
2936
- class Ui extends HTMLElement {
2968
+ customElements.define("multipurpose-nav", Ks);
2969
+ var ie, ts, se, es, st, He, P, F, ne, is, oe, ss, ae, ns, re, os, le, as, ce, rs, de, ls, ue, cs, he, ds, q, B, pe, us, me, hs, fe, ps, ge, ms;
2970
+ class Ki extends HTMLElement {
2937
2971
  // 定義組件的初始狀態
2938
2972
  constructor(t, e) {
2939
2973
  super();
2940
- h(this, ee);
2941
2974
  h(this, ie);
2975
+ h(this, se);
2942
2976
  // 第一關 判斷數量以及id設定
2943
2977
  h(this, st);
2944
2978
  // 第二關 id命名提醒
2945
2979
  h(this, P);
2946
- h(this, se);
2947
2980
  h(this, ne);
2948
2981
  h(this, oe);
2982
+ h(this, ae);
2949
2983
  // 執行函式
2950
2984
  // 移動至指定位置
2951
- h(this, ae);
2952
- // 移動
2953
2985
  h(this, re);
2954
- // 步驟狀態
2986
+ // 移動
2955
2987
  h(this, le);
2956
- // next 按鈕狀態
2988
+ // 步驟狀態
2957
2989
  h(this, ce);
2958
- // prev 按鈕狀態
2990
+ // next 按鈕狀態
2959
2991
  h(this, de);
2960
- // 頁籤狀態
2992
+ // prev 按鈕狀態
2961
2993
  h(this, ue);
2994
+ // 頁籤狀態
2995
+ h(this, he);
2962
2996
  // 第三關各種元件判斷 及 執行
2963
2997
  h(this, q);
2964
2998
  // 消失動畫
2965
- h(this, he);
2966
- // 出現動畫
2967
2999
  h(this, pe);
2968
- // 狀態
3000
+ // 出現動畫
2969
3001
  h(this, me);
3002
+ // 狀態
3003
+ h(this, fe);
2970
3004
  // resize
2971
3005
  h(this, ge);
2972
3006
  }
@@ -2975,17 +3009,17 @@ class Ui extends HTMLElement {
2975
3009
  return ["t4-active"];
2976
3010
  }
2977
3011
  attributeChangedCallback(t, e, s) {
2978
- t === "t4-active" && e !== s && d(this, me, ls).call(this, s);
3012
+ t === "t4-active" && e !== s && d(this, fe, ps).call(this, s);
2979
3013
  }
2980
3014
  connectedCallback() {
2981
- this.classList.contains("t4-initialize") || d(this, ee, Ji).call(this);
3015
+ this.classList.contains("t4-initialize") || d(this, ie, ts).call(this);
2982
3016
  }
2983
3017
  // ------------- 我是分隔線呦 -------------
2984
3018
  // 頁籤切換
2985
3019
  tabClick(t) {
2986
3020
  const { t: e } = this, s = e.tabs.indexOf(t) % e.tabPanels.length, o = e.tabGroup === "true" ? String(s) : t.getAttribute("t4-id");
2987
3021
  this.setActiveTab(o), setTimeout(() => {
2988
- d(this, q, z).call(this, "eventAnchor");
3022
+ d(this, q, B).call(this, "eventAnchor");
2989
3023
  }, e.transition.duration);
2990
3024
  }
2991
3025
  // 外部呼叫方法 $0.setActiveTab(0)
@@ -2994,7 +3028,7 @@ class Ui extends HTMLElement {
2994
3028
  e.activeTab = s, this.setAttribute("t4-active", s);
2995
3029
  const o = d(this, P, F).call(this, s);
2996
3030
  e.tabPanels.forEach((a, r) => {
2997
- r === o ? d(this, pe, rs).call(this, r) : d(this, he, as).call(this, r);
3031
+ r === o ? d(this, me, hs).call(this, r) : d(this, pe, us).call(this, r);
2998
3032
  });
2999
3033
  }
3000
3034
  // 外部呼叫方法 $0.goNext()
@@ -3009,11 +3043,11 @@ class Ui extends HTMLElement {
3009
3043
  }
3010
3044
  // 外部呼叫方法 $0.update()
3011
3045
  update() {
3012
- this.t.tabs = d(this, st, xe).call(this), ds(), console.log("tab update!!!!");
3046
+ this.t.tabs = d(this, st, He).call(this), fs(), console.log("tab update!!!!");
3013
3047
  }
3014
3048
  }
3015
- ee = new WeakSet(), Ji = function() {
3016
- const t = this.getAttribute("t4-name"), { SETTINGS: e } = Je;
3049
+ ie = new WeakSet(), ts = function() {
3050
+ const t = this.getAttribute("t4-name"), { SETTINGS: e } = Ke;
3017
3051
  document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
3018
3052
  tabs: [],
3019
3053
  name: t,
@@ -3032,14 +3066,14 @@ ee = new WeakSet(), Ji = function() {
3032
3066
  delay: this.getAttribute("t4-delay") || e.transition.delay
3033
3067
  },
3034
3068
  tabGroup: this.getAttribute("t4-group") || e.tabGroup
3035
- }, this.__events__ = {}, this.t.tabs = d(this, st, xe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ie, Zi).call(this);
3036
- }, ie = new WeakSet(), Zi = function() {
3037
- if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, se, Qi).call(this), this.t.recordUrl) {
3069
+ }, this.__events__ = {}, this.t.tabs = d(this, st, He).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, se, es).call(this);
3070
+ }, se = new WeakSet(), es = function() {
3071
+ if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ne, is).call(this), this.t.recordUrl) {
3038
3072
  const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
3039
3073
  e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
3040
3074
  }
3041
- this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ge, cs).call(this);
3042
- }, st = new WeakSet(), xe = function() {
3075
+ this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ge, ms).call(this);
3076
+ }, st = new WeakSet(), He = function() {
3043
3077
  const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
3044
3078
  return t.type === "normal" && t.tabGroup === "true" && t.tabPanels.length !== e.length && console.warn("按鈕與內容數量不同喔", t.tabPanels.length, e.length), t.tabGroup === "true" ? t.tabPanels.forEach((s, o) => s.setAttribute("t4-id", o)) : t.tabPanels.forEach((s) => {
3045
3079
  s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
@@ -3049,19 +3083,19 @@ ee = new WeakSet(), Ji = function() {
3049
3083
  s.length > 1 && console.warn("有兩個相同id設定", s);
3050
3084
  const o = s[0];
3051
3085
  return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
3052
- }, se = new WeakSet(), Qi = function() {
3086
+ }, ne = new WeakSet(), is = function() {
3053
3087
  const t = document.createElement("div");
3054
3088
  t.classList.add("swiper-container");
3055
3089
  const e = document.createElement("div");
3056
3090
  e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
3057
3091
  e.appendChild(s.cloneNode(!0));
3058
- }), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ne, Vi).call(this);
3059
- }, ne = new WeakSet(), Vi = function() {
3092
+ }), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, oe, ss).call(this);
3093
+ }, oe = new WeakSet(), ss = function() {
3060
3094
  const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
3061
3095
  t.style.overflow = "hidden", e.style.display = "flex";
3062
3096
  const o = s.length * 100 + "%";
3063
3097
  e.style.width = o;
3064
- }, oe = new WeakSet(), Ki = function(t) {
3098
+ }, ae = new WeakSet(), ns = function(t) {
3065
3099
  const { t: e } = this;
3066
3100
  if (e.recordUrl === "true") {
3067
3101
  const s = new URLSearchParams(document.location.search);
@@ -3069,55 +3103,55 @@ ee = new WeakSet(), Ji = function() {
3069
3103
  const o = `${window.location.pathname}?${s.toString()}`;
3070
3104
  history.replaceState({ t4Id: t }, "", o);
3071
3105
  }
3072
- }, ae = new WeakSet(), ts = function() {
3106
+ }, re = new WeakSet(), os = function() {
3073
3107
  const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
3074
- d(this, re, es).call(this, o);
3075
- }, re = new WeakSet(), es = function(t) {
3108
+ d(this, le, as).call(this, o);
3109
+ }, le = new WeakSet(), as = function(t) {
3076
3110
  window.scrollTo({
3077
3111
  top: t,
3078
3112
  behavior: "smooth"
3079
3113
  });
3080
- }, le = new WeakSet(), is = function(t) {
3114
+ }, ce = new WeakSet(), rs = function(t) {
3081
3115
  let e = parseInt(t, 10) + 1;
3082
3116
  this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
3083
- }, ce = new WeakSet(), ss = function(t) {
3117
+ }, de = new WeakSet(), ls = function(t) {
3084
3118
  const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === this.t.tabPanels.length - 1;
3085
3119
  e.forEach((a) => {
3086
3120
  s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
3087
3121
  });
3088
- }, de = new WeakSet(), ns = function(t) {
3122
+ }, ue = new WeakSet(), cs = function(t) {
3089
3123
  const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
3090
3124
  e.forEach((a) => {
3091
3125
  s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
3092
3126
  });
3093
- }, ue = new WeakSet(), os = function(t, e) {
3127
+ }, he = new WeakSet(), ds = function(t, e) {
3094
3128
  this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
3095
3129
  o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
3096
3130
  }) : this.t.tabs.forEach((s, o) => {
3097
3131
  s.getAttribute("t4-id") === e ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
3098
3132
  });
3099
- }, q = new WeakSet(), z = function(t, e, s) {
3133
+ }, q = new WeakSet(), B = function(t, e, s) {
3100
3134
  switch (t) {
3101
3135
  case "step":
3102
- Te(this.t.step) && d(this, le, is).call(this, e);
3136
+ Ee(this.t.step) && d(this, ce, rs).call(this, e);
3103
3137
  break;
3104
3138
  case "eventAnchor":
3105
- this.t.anchor && d(this, ae, ts).call(this);
3139
+ this.t.anchor && d(this, re, os).call(this);
3106
3140
  break;
3107
3141
  case "tabState":
3108
- this.t.type == "normal" && d(this, ue, os).call(this, e, s);
3142
+ this.t.type == "normal" && d(this, he, ds).call(this, e, s);
3109
3143
  break;
3110
3144
  case "btnState":
3111
- d(this, ce, ss).call(this, e), d(this, de, ns).call(this, e);
3145
+ d(this, de, ls).call(this, e), d(this, ue, cs).call(this, e);
3112
3146
  break;
3113
3147
  case "tabUrl":
3114
- this.t.recordUrl === "true" && d(this, oe, Ki).call(this, e);
3148
+ this.t.recordUrl === "true" && d(this, ae, ns).call(this, e);
3115
3149
  break;
3116
3150
  default:
3117
3151
  console.warn("請增加判斷,謝謝");
3118
3152
  break;
3119
3153
  }
3120
- }, he = new WeakSet(), as = function(t) {
3154
+ }, pe = new WeakSet(), us = function(t) {
3121
3155
  const { t: e } = this;
3122
3156
  this.t.transition;
3123
3157
  const s = e.tabPanels[t];
@@ -3134,7 +3168,7 @@ ee = new WeakSet(), Ji = function() {
3134
3168
  s.style.display = "none";
3135
3169
  break;
3136
3170
  }
3137
- }, pe = new WeakSet(), rs = function(t) {
3171
+ }, me = new WeakSet(), hs = function(t) {
3138
3172
  const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
3139
3173
  let r;
3140
3174
  switch (a.classList.add("show"), a.classList.remove("hide"), a.style.transition = `opacity ${e}ms ${s} ${o}ms`, a.style.display = "block", this.t.display) {
@@ -3159,25 +3193,25 @@ ee = new WeakSet(), Ji = function() {
3159
3193
  console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
3160
3194
  break;
3161
3195
  }
3162
- }, me = new WeakSet(), ls = function(t) {
3196
+ }, fe = new WeakSet(), ps = function(t) {
3163
3197
  const e = d(this, P, F).call(this, t);
3164
- d(this, q, z).call(this, "step", e), d(this, q, z).call(this, "btnState", e), d(this, q, z).call(this, "tabState", e, t), d(this, q, z).call(this, "tabUrl", t), this.emit("change");
3165
- }, ge = new WeakSet(), cs = function() {
3198
+ d(this, q, B).call(this, "step", e), d(this, q, B).call(this, "btnState", e), d(this, q, B).call(this, "tabState", e, t), d(this, q, B).call(this, "tabUrl", t), this.emit("change");
3199
+ }, ge = new WeakSet(), ms = function() {
3166
3200
  const t = this;
3167
3201
  window.addEventListener(
3168
3202
  "resize",
3169
- Us(() => {
3203
+ tn(() => {
3170
3204
  t.update();
3171
3205
  }, 1e3)
3172
3206
  );
3173
3207
  };
3174
- function Us(n, i = 1e3) {
3208
+ function tn(n, i = 1e3) {
3175
3209
  let t;
3176
3210
  return function(e) {
3177
3211
  t && clearTimeout(t), t = setTimeout(n, i, e);
3178
3212
  };
3179
3213
  }
3180
- function ds() {
3214
+ function fs() {
3181
3215
  const n = document.querySelectorAll("[t4-control]");
3182
3216
  document.addEventListener("click", function(i) {
3183
3217
  let t = !1;
@@ -3207,91 +3241,91 @@ function ds() {
3207
3241
  }
3208
3242
  });
3209
3243
  }
3210
- ds();
3211
- Object.assign(Ui.prototype, O);
3212
- customElements.define("tab-el", Ui);
3213
- const Xe = (n) => {
3244
+ fs();
3245
+ Object.assign(Ki.prototype, I);
3246
+ customElements.define("tab-el", Ki);
3247
+ const Je = (n) => {
3214
3248
  const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
3215
3249
  n.classList.add(t), o.style.height = 0, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
3216
- }, Js = (n) => {
3250
+ }, en = (n) => {
3217
3251
  const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
3218
3252
  n.collapse.height = a, n.classList.remove(t), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = s.property, o.style["transition-duration"] = s.duration, o.style["transition-timing-function"] = s.function, o.style["transition-delay"] = s.delay, o.style.overflow = "hidden";
3219
3253
  };
3220
- var nt, Ce, fe, us, ve, hs, ot, He;
3221
- class Zs {
3254
+ var nt, Me, ve, gs, be, vs, ot, qe;
3255
+ class sn {
3222
3256
  constructor(i, t = {}) {
3223
3257
  h(this, nt);
3224
- h(this, fe);
3225
3258
  h(this, ve);
3259
+ h(this, be);
3226
3260
  h(this, ot);
3227
- !rt(i) && !Te(i) && !lt(i) && !w(i) || (this.__storage__ = {
3261
+ !rt(i) && !Ee(i) && !lt(i) && !T(i) || (this.__storage__ = {
3228
3262
  el: i,
3229
3263
  options: t
3230
- }, this.active = "data-collapse-active", d(this, nt, Ce).call(this));
3264
+ }, this.active = "data-collapse-active", d(this, nt, Me).call(this));
3231
3265
  }
3232
3266
  update() {
3233
- d(this, nt, Ce).call(this);
3267
+ d(this, nt, Me).call(this);
3234
3268
  }
3235
3269
  }
3236
- nt = new WeakSet(), Ce = function() {
3237
- const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = Ze;
3238
- if (this.elements = t.state == "not active" ? S(i + `:not([${this.active}])`) : S(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
3270
+ nt = new WeakSet(), Me = function() {
3271
+ const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = ti;
3272
+ if (this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
3239
3273
  for (const [o, a] of Object.entries(this.options.on))
3240
3274
  this.__events__[o] = [a];
3241
- d(this, fe, us).call(this);
3242
- }, fe = new WeakSet(), us = function() {
3275
+ d(this, ve, gs).call(this);
3276
+ }, ve = new WeakSet(), gs = function() {
3243
3277
  const { elements: i, options: t } = this;
3244
3278
  i.forEach((e) => {
3245
- e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, ve, hs).call(this, e);
3279
+ e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, be, vs).call(this, e);
3246
3280
  }), this.emit("init");
3247
- }, ve = new WeakSet(), hs = function(i) {
3281
+ }, be = new WeakSet(), vs = function(i) {
3248
3282
  const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
3249
- if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, ot, He)), c.addEventListener("click", d(this, ot, He)), r) {
3250
- const p = (g) => {
3251
- g.stopPropagation();
3283
+ if (c.collapse.height = u.children[0].offsetHeight, a ? (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(e), u.style.height = "0px", u.style.overflow = "hidden") : (u.style.height = `${u.children[0].offsetHeight}px`, c.classList.remove(e)), c.removeEventListener("click", d(this, ot, qe)), c.addEventListener("click", d(this, ot, qe)), r) {
3284
+ const p = (f) => {
3285
+ f.stopPropagation();
3252
3286
  };
3253
3287
  u.removeEventListener("click", p), u.addEventListener("click", p);
3254
3288
  }
3255
- }, ot = new WeakSet(), He = function() {
3289
+ }, ot = new WeakSet(), qe = function() {
3256
3290
  const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
3257
3291
  r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
3258
- Xe(l);
3259
- }), Js(r)) : Xe(r), i.emit("afterCollapse");
3292
+ Je(l);
3293
+ }), en(r)) : Je(r), i.emit("afterCollapse");
3260
3294
  };
3261
- Object.assign(Zs.prototype, O);
3262
- function Qs(n, i) {
3295
+ Object.assign(sn.prototype, I);
3296
+ function nn(n, i) {
3263
3297
  const t = i, { color: e, opacity: s, duration: o } = i.s.options;
3264
3298
  let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
3265
3299
  a.style.cssText = `background: ${e};left: ${r}px;top: ${l}px;opacity: ${s};animation-duration: ${o}ms`, a.classList.add("circle"), t.appendChild(a), setTimeout(function() {
3266
3300
  a.remove();
3267
3301
  }, `${o}`);
3268
3302
  }
3269
- function ps() {
3303
+ function bs() {
3270
3304
  document.querySelectorAll("ripple-btn").forEach((n) => {
3271
3305
  n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
3272
3306
  });
3273
3307
  }
3274
- document.addEventListener("click", ps);
3275
- var at, Me, be, ms, ye, gs, we, fs;
3276
- class Vs extends HTMLElement {
3308
+ document.addEventListener("click", bs);
3309
+ var at, Oe, ye, ys, we, ws, Te, Ts;
3310
+ class on extends HTMLElement {
3277
3311
  constructor() {
3278
3312
  super();
3279
3313
  h(this, at);
3280
- h(this, be);
3281
3314
  h(this, ye);
3282
3315
  h(this, we);
3316
+ h(this, Te);
3283
3317
  this.initialize = !1;
3284
3318
  }
3285
3319
  connectedCallback() {
3286
3320
  const t = this;
3287
- t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, at, Me).call(this));
3321
+ t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, at, Oe).call(this));
3288
3322
  }
3289
3323
  update() {
3290
- this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, at, Me).call(this);
3324
+ this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, at, Oe).call(this);
3291
3325
  }
3292
3326
  }
3293
- at = new WeakSet(), Me = function() {
3294
- const { SETTINGS: t } = Qe;
3327
+ at = new WeakSet(), Oe = function() {
3328
+ const { SETTINGS: t } = ei;
3295
3329
  this.s = {};
3296
3330
  function e(o) {
3297
3331
  let a = !!o;
@@ -3305,20 +3339,20 @@ at = new WeakSet(), Me = function() {
3305
3339
  hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
3306
3340
  click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
3307
3341
  };
3308
- this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, be, ms).call(this);
3309
- }, be = new WeakSet(), ms = function() {
3310
- d(this, ye, gs).call(this), d(this, we, fs).call(this), this.classList.add("r4-initialize");
3311
- }, ye = new WeakSet(), gs = function() {
3342
+ this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, ye, ys).call(this);
3343
+ }, ye = new WeakSet(), ys = function() {
3344
+ d(this, we, ws).call(this), d(this, Te, Ts).call(this), this.classList.add("r4-initialize");
3345
+ }, we = new WeakSet(), ws = function() {
3312
3346
  const t = this, e = document.createElement("i");
3313
3347
  e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
3314
- }, we = new WeakSet(), fs = function() {
3348
+ }, Te = new WeakSet(), Ts = function() {
3315
3349
  const t = this.querySelector("i.hover-ball"), e = this;
3316
3350
  e.addEventListener("click", function(a) {
3317
- a.stopPropagation(), e.s.options.click && Qs(a, e);
3351
+ a.stopPropagation(), e.s.options.click && nn(a, e);
3318
3352
  });
3319
3353
  let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
3320
3354
  e.addEventListener(s, function(a) {
3321
- if (s === "touchstart" && ps(), e.s.options.hover) {
3355
+ if (s === "touchstart" && bs(), e.s.options.hover) {
3322
3356
  const r = Math.round(s === "mouseenter" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(s === "mouseenter" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: c, offsetHeight: u } = e, p = Math.max(c, u);
3323
3357
  t.style.width = p * 2 + "px", t.style.height = p * 2 + "px", t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
3324
3358
  }
@@ -3329,8 +3363,8 @@ at = new WeakSet(), Me = function() {
3329
3363
  }
3330
3364
  });
3331
3365
  };
3332
- customElements.define("ripple-btn", Vs);
3333
- class Ks {
3366
+ customElements.define("ripple-btn", on);
3367
+ class an {
3334
3368
  constructor() {
3335
3369
  this.init();
3336
3370
  }
@@ -3382,12 +3416,12 @@ class Ks {
3382
3416
  this.init();
3383
3417
  }
3384
3418
  }
3385
- function Fe(n, i) {
3419
+ function Ze(n, i) {
3386
3420
  return n ? function(t, e) {
3387
3421
  Function(n)(t, e);
3388
3422
  } : i;
3389
3423
  }
3390
- function tn(n, i, t, e) {
3424
+ function rn(n, i, t, e) {
3391
3425
  const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
3392
3426
  o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
3393
3427
  const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
@@ -3410,7 +3444,7 @@ function tn(n, i, t, e) {
3410
3444
  info: e
3411
3445
  }, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
3412
3446
  }
3413
- function en(n, i, t, e) {
3447
+ function ln(n, i, t, e) {
3414
3448
  const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
3415
3449
  let u = 0, p = 0;
3416
3450
  switch (s.width = t, s.height = e, n.previewSize) {
@@ -3421,17 +3455,17 @@ function en(n, i, t, e) {
3421
3455
  l < c ? (u = e / l * 100, p = s.height) : l > c ? (u = s.width, p = t * l / 100) : l === c && (u = s.width, p = s.height);
3422
3456
  break;
3423
3457
  }
3424
- const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
3425
- return o.drawImage(i, g, m, u, p), s;
3458
+ const f = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
3459
+ return o.drawImage(i, f, m, u, p), s;
3426
3460
  }
3427
- function sn(n, i) {
3461
+ function cn(n, i) {
3428
3462
  return new Promise((t, e) => {
3429
3463
  if (i) {
3430
3464
  const s = new Image();
3431
3465
  s.src = i, s.classList.add(n.previewSize), s.onload = () => {
3432
3466
  let o = {
3433
3467
  imgElement: s,
3434
- originalCanvas: en(n, s, s.width, s.height),
3468
+ originalCanvas: ln(n, s, s.width, s.height),
3435
3469
  info: {
3436
3470
  originalWidth: s.width,
3437
3471
  originalHeight: s.height,
@@ -3444,31 +3478,31 @@ function sn(n, i) {
3444
3478
  t();
3445
3479
  });
3446
3480
  }
3447
- function nn(n, i) {
3481
+ function dn(n, i) {
3448
3482
  const t = Math.pow(10, i);
3449
3483
  return Math.round(n * t) / t;
3450
3484
  }
3451
- function on(n, i) {
3485
+ function un(n, i) {
3452
3486
  let t = n.size / 1024 / 1024;
3453
- return `${nn(t, 2)}` <= i;
3487
+ return `${dn(t, 2)}` <= i;
3454
3488
  }
3455
- function an(n, i, t) {
3489
+ function hn(n, i, t) {
3456
3490
  if (n.target.files.length <= 0)
3457
3491
  return;
3458
3492
  const e = n.target.files[0], s = i.closest("[data-upload-item]");
3459
3493
  let o = new FileReader();
3460
3494
  o.onload = (a) => {
3461
3495
  const r = e.type.split("/")[0] === "image" ? a.target.result : null;
3462
- if (t.params.sizeLimit && !on(e, t.params.sizeLimit)) {
3496
+ if (t.params.sizeLimit && !un(e, t.params.sizeLimit)) {
3463
3497
  i.value = "", s.classList.add("over-limit"), t.params.on.overLimit && typeof t.params.on.overLimit == "function" && t.params.on.overLimit(i, t.params.sizeLimit);
3464
3498
  return;
3465
3499
  } else
3466
- s.classList.remove("over-limit"), s.classList.add("uploaded"), sn(t.params, r).then((l) => {
3467
- tn(i, t, e, l);
3500
+ s.classList.remove("over-limit"), s.classList.add("uploaded"), cn(t.params, r).then((l) => {
3501
+ rn(i, t, e, l);
3468
3502
  });
3469
3503
  }, o.readAsDataURL(e);
3470
3504
  }
3471
- class rn {
3505
+ class pn {
3472
3506
  constructor(i, t) {
3473
3507
  const e = this;
3474
3508
  e.el = i, e.params = {
@@ -3496,67 +3530,67 @@ class rn {
3496
3530
  previewSize: e.dataset.previewSize || i.params.previewSize,
3497
3531
  compress: e.dataset.compress || i.params.compress,
3498
3532
  on: {
3499
- changeAfter: Fe(e.dataset.changeAfter, i.params.on.changeAfter),
3500
- overLimit: Fe(e.dataset.overLimit, i.params.on.overLimit)
3533
+ changeAfter: Ze(e.dataset.changeAfter, i.params.on.changeAfter),
3534
+ overLimit: Ze(e.dataset.overLimit, i.params.on.overLimit)
3501
3535
  }
3502
3536
  };
3503
3537
  i.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), e.dataset.group || (e.dataset.group = o.group), e.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, e.addEventListener("change", function(a) {
3504
- an(a, e, i);
3538
+ hn(a, e, i);
3505
3539
  });
3506
3540
  }));
3507
3541
  }
3508
3542
  }
3509
3543
  export {
3510
- Ve as A,
3511
- An as B,
3512
- Zs as C,
3513
- $i as D,
3514
- Ln as E,
3515
- Sn as F,
3516
- Dn as G,
3517
- kn as H,
3518
- Ks as I,
3519
- _n as J,
3520
- $n as K,
3521
- xn as L,
3544
+ ii as A,
3545
+ xn as B,
3546
+ sn as C,
3547
+ qi as D,
3548
+ $n as E,
3549
+ Cn as F,
3550
+ Hn as G,
3551
+ Mn as H,
3552
+ an as I,
3553
+ qn as J,
3554
+ On as K,
3555
+ In as L,
3522
3556
  J as M,
3523
- Cn as N,
3524
- Hn as O,
3525
- Mn as P,
3526
- qn as Q,
3527
- Vs as R,
3528
- In as S,
3529
- Ui as T,
3530
- On as U,
3531
- Nn as V,
3532
- Pn as W,
3533
- jn as X,
3534
- zn as Y,
3535
- w as a,
3557
+ Nn as N,
3558
+ Pn as O,
3559
+ jn as P,
3560
+ zn as Q,
3561
+ on as R,
3562
+ Bn as S,
3563
+ Ki as T,
3564
+ Wn as U,
3565
+ Gn as V,
3566
+ Rn as W,
3567
+ Xn as X,
3568
+ Yn as Y,
3569
+ T as a,
3536
3570
  lt as b,
3537
- Es as c,
3538
- Ts as d,
3539
- Y as e,
3540
- A as f,
3541
- S as g,
3542
- fn as h,
3571
+ xs as c,
3572
+ _s as d,
3573
+ Ne as e,
3574
+ S as f,
3575
+ k as g,
3576
+ En as h,
3543
3577
  rt as i,
3544
- hi as j,
3545
- Rs as k,
3546
- Ys as l,
3547
- rn as m,
3548
- Ms as n,
3549
- Wn as o,
3550
- vn as p,
3551
- Ai as q,
3552
- Li as r,
3553
- ws as s,
3554
- bn as t,
3555
- yn as u,
3556
- Is as v,
3557
- wn as w,
3558
- Hs as x,
3559
- Tn as y,
3560
- En as z
3578
+ gi as j,
3579
+ Zs as k,
3580
+ Ks as l,
3581
+ pn as m,
3582
+ zs as n,
3583
+ Fn as o,
3584
+ Ln as p,
3585
+ _i as q,
3586
+ xi as r,
3587
+ ks as s,
3588
+ An as t,
3589
+ Sn as u,
3590
+ ke as v,
3591
+ Dn as w,
3592
+ js as x,
3593
+ kn as y,
3594
+ _n as z
3561
3595
  };
3562
3596
  //# sourceMappingURL=image-preview-bundle.js.map