@xwadex/fesd 0.0.58 → 0.0.59

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,6 +1,6 @@
1
- var Cs = Object.defineProperty;
2
- var Hs = (n, i, t) => i in n ? Cs(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
- var Je = (n, i, t) => (Hs(n, typeof i != "symbol" ? i + "" : i, t), t), Ms = (n, i, t) => {
1
+ var Ms = Object.defineProperty;
2
+ var Is = (n, i, t) => i in n ? Ms(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
+ var Ke = (n, i, t) => (Is(n, typeof i != "symbol" ? i + "" : i, t), t), qs = (n, i, t) => {
4
4
  if (!i.has(n))
5
5
  throw TypeError("Cannot " + t);
6
6
  };
@@ -9,15 +9,15 @@ var h = (n, i, t) => {
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  i instanceof WeakSet ? i.add(n) : i.set(n, t);
11
11
  };
12
- var d = (n, i, t) => (Ms(n, i, "access private method"), t);
12
+ var d = (n, i, t) => (qs(n, i, "access private method"), t);
13
13
  import f from "jquery";
14
- import { OverlayScrollbars as Xe } from "overlayscrollbars";
14
+ import { OverlayScrollbars as Fe } from "overlayscrollbars";
15
15
  import "./vendor-bundle.js";
16
16
  import "validator";
17
17
  import "flatpickr";
18
- import oi from "vanilla-lazyload";
19
- import { lock as Is, unlock as qs } from "tua-body-scroll-lock";
20
- const _e = {
18
+ import li from "vanilla-lazyload";
19
+ import { lock as Os, unlock as Ps } from "tua-body-scroll-lock";
20
+ const xe = {
21
21
  SETTINGS: {
22
22
  videoId: null,
23
23
  videoType: null,
@@ -78,7 +78,7 @@ const _e = {
78
78
  TEMPLATE() {
79
79
  return '<div class="player-container"><div class="player-wrapper"></div></div>';
80
80
  }
81
- }, Os = {
81
+ }, Ns = {
82
82
  SETTINGS: {
83
83
  success: null,
84
84
  text: null,
@@ -135,7 +135,7 @@ const _e = {
135
135
  gap: 30
136
136
  // 跑馬燈內容之間的距離 - Number
137
137
  }
138
- }, Ye = {
138
+ }, Je = {
139
139
  SETTINGS: {
140
140
  scrollbar: {
141
141
  "scrollbar-track-color": "transparent",
@@ -163,7 +163,7 @@ const _e = {
163
163
  </div>`;
164
164
  return t || r;
165
165
  }
166
- }, Ps = {
166
+ }, js = {
167
167
  SETTINGS: {
168
168
  basic_rwd: 900,
169
169
  markdownLink: !1,
@@ -172,7 +172,7 @@ const _e = {
172
172
  navigation: !1,
173
173
  scrollStep: !1
174
174
  }
175
- }, ai = {
175
+ }, ci = {
176
176
  SETTINGS: {
177
177
  scroller: window,
178
178
  class: "aost-show",
@@ -195,7 +195,7 @@ const _e = {
195
195
  enter: null,
196
196
  leave: null
197
197
  }
198
- }, vt = {
198
+ }, bt = {
199
199
  SETTINGS: {
200
200
  target: null,
201
201
  container: null,
@@ -255,7 +255,7 @@ const _e = {
255
255
  return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
256
256
  }
257
257
  }
258
- }, ri = {
258
+ }, di = {
259
259
  SETTINGS: {
260
260
  // 樣式 normal / process
261
261
  type: "normal",
@@ -275,7 +275,7 @@ const _e = {
275
275
  // 步驟狀態綁定
276
276
  stepOutput: ".step-show"
277
277
  }
278
- }, li = {
278
+ }, ui = {
279
279
  SETTINGS: {
280
280
  collapseClass: "collapse",
281
281
  block: "[collapse-block]",
@@ -308,7 +308,7 @@ const _e = {
308
308
  update: null,
309
309
  afterUpdate: null
310
310
  }
311
- }, ci = {
311
+ }, hi = {
312
312
  SETTINGS: {
313
313
  // 是否要加 hover 效果?
314
314
  hover: !0,
@@ -323,29 +323,29 @@ const _e = {
323
323
  // hover 毫秒 ?
324
324
  speed: 600
325
325
  }
326
- }, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
326
+ }, Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
327
327
  __proto__: null,
328
- anchor4: vt,
329
- aost4: ai,
330
- article4: Ps,
331
- collapse4: li,
332
- dropdown4: Ye,
328
+ anchor4: bt,
329
+ aost4: ci,
330
+ article4: js,
331
+ collapse4: ui,
332
+ dropdown4: Je,
333
333
  marquee4: M,
334
334
  modal4: j,
335
335
  multipurpose4: q,
336
- ripple4: ci,
337
- share4: Os,
338
- tab4: ri,
339
- video4: _e
336
+ ripple4: hi,
337
+ share4: Ns,
338
+ tab4: di,
339
+ video4: xe
340
340
  }, Symbol.toStringTag, { value: "Module" })), L = {
341
341
  before: "beforebegin",
342
342
  after: "afterend",
343
343
  append: "beforeend",
344
344
  prepend: "afterbegin"
345
- }, pt = (n) => typeof n == "string" && n !== "", xe = (n) => n instanceof HTMLElement, mt = (n) => n instanceof NodeList, A = (n) => D(n) !== null, G = (n) => typeof n == "function", D = (n) => xe(n) ? n : document.querySelector(n), k = (n) => mt(n) ? n : document.querySelectorAll(n), Ns = () => Math.random().toString(36).substr(2, 9), js = (n) => {
345
+ }, mt = (n) => typeof n == "string" && n !== "", $e = (n) => n instanceof HTMLElement, gt = (n) => n instanceof NodeList, A = (n) => _(n) !== null, G = (n) => typeof n == "function", _ = (n) => $e(n) ? n : document.querySelector(n), D = (n) => gt(n) ? n : document.querySelectorAll(n), zs = () => Math.random().toString(36).substr(2, 9), Bs = (n) => {
346
346
  const i = document.createElement("div");
347
347
  return i.innerHTML = n, i.childNodes;
348
- }, zs = (n) => {
348
+ }, Ws = (n) => {
349
349
  try {
350
350
  JSON.parse(n);
351
351
  } catch {
@@ -354,7 +354,7 @@ const _e = {
354
354
  return JSON.parse(n);
355
355
  }, E = (n, i) => {
356
356
  console.warn(`[${n} warn]: ${i}`);
357
- }, Ze = (n, i) => {
357
+ }, Ve = (n, i) => {
358
358
  console.error(`[${n} error]: ${i}`);
359
359
  }, z = {
360
360
  on(n, i) {
@@ -387,7 +387,7 @@ const _e = {
387
387
  G(s) && s.apply(this, e);
388
388
  }), this) : this;
389
389
  }
390
- }, Bs = {
390
+ }, Gs = {
391
391
  easeInOutCirc(n, i, t, e) {
392
392
  return (n /= e / 2) < 1 ? -t / 2 * (Math.sqrt(1 - n * n) - 1) + i : t / 2 * (Math.sqrt(1 - (n -= 2) * n) + 1) + i;
393
393
  },
@@ -397,33 +397,33 @@ const _e = {
397
397
  easeOutQuart(n, i, t, e) {
398
398
  return -t * ((n = n / e - 1) * n * n * n - 1) + i;
399
399
  }
400
- }, $e = (n, i) => {
401
- const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? D(e) : document.scrollingElement, v = m[u], w = A(t) ? D(t).getBoundingClientRect()[p] : 0 - v, b = A(s) ? D(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
400
+ }, Ce = (n, i) => {
401
+ const { target: t, container: e, spacer: s, speed: o, gap: a, easing: r, direction: l } = n, c = l === "horizontal", u = c ? "scrollLeft" : "scrollTop", p = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? _(e) : document.scrollingElement, v = m[u], w = A(t) ? _(t).getBoundingClientRect()[p] : 0 - v, b = A(s) ? _(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
402
402
  let y = 0;
403
403
  if (T === 0)
404
404
  return;
405
- const S = (_) => {
406
- const U = D(t);
407
- i && i.emit(_, U), !i && n.on && G(n.on[_]) && n.on[_](U);
405
+ const S = (k) => {
406
+ const F = _(t);
407
+ i && i.emit(k, F), !i && n.on && G(n.on[k]) && n.on[k](F);
408
408
  };
409
409
  S("beforeScroll");
410
410
  const O = () => {
411
411
  y += C;
412
- const _ = Bs[r](y, v, T, o);
413
- m[u] = _, y < o && requestAnimationFrame(O), y >= o && S("afterScroll");
412
+ const k = Gs[r](y, v, T, o);
413
+ m[u] = k, y < o && requestAnimationFrame(O), y >= o && S("afterScroll");
414
414
  };
415
415
  requestAnimationFrame(O);
416
416
  };
417
- var tt, Ce, Tt, ui, Et, hi;
418
- class di {
417
+ var tt, He, Et, mi, At, gi;
418
+ class pi {
419
419
  constructor(i, t = {}) {
420
420
  h(this, tt);
421
- h(this, Tt);
422
421
  h(this, Et);
422
+ h(this, At);
423
423
  this.__storage__ = {
424
424
  el: i,
425
425
  options: t
426
- }, this.active = "data-anchor-active", d(this, tt, Ce).call(this);
426
+ }, this.active = "data-anchor-active", d(this, tt, He).call(this);
427
427
  }
428
428
  destroy() {
429
429
  const { elements: i } = this;
@@ -433,39 +433,39 @@ class di {
433
433
  }
434
434
  update() {
435
435
  var i;
436
- return d(i = this.destroy(), tt, Ce).call(i), this.emit("afterUpdate"), this;
436
+ return d(i = this.destroy(), tt, He).call(i), this.emit("afterUpdate"), this;
437
437
  }
438
438
  static run(i) {
439
- const { SETTINGS: t } = vt, e = Object.assign({}, t, i);
439
+ const { SETTINGS: t } = bt, e = Object.assign({}, t, i);
440
440
  setTimeout(() => {
441
- $e(e);
441
+ Ce(e);
442
442
  }, e.delay);
443
443
  }
444
444
  static url(i) {
445
- const { SETTINGS: t } = vt, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
445
+ const { SETTINGS: t } = bt, { hashName: e } = i, s = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${e ? o.get(e) : s.split("?").pop()}"]`);
446
446
  if (!a)
447
447
  return;
448
448
  const r = Object.assign({}, t, i, { target: a });
449
449
  setTimeout(() => {
450
- $e(r);
450
+ Ce(r);
451
451
  }, r.delay);
452
452
  }
453
453
  }
454
- tt = new WeakSet(), Ce = function() {
454
+ tt = new WeakSet(), He = function() {
455
455
  const { el: i, options: t } = this.__storage__;
456
- if (!pt(i) || !A(i))
456
+ if (!mt(i) || !A(i))
457
457
  return;
458
- const { SETTINGS: e, EVENTS: s } = vt;
459
- 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)
458
+ const { SETTINGS: e, EVENTS: s } = bt;
459
+ if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.elements = D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
460
460
  for (const [o, a] of Object.entries(this.options.on))
461
461
  this.__events__[o] = [a];
462
- d(this, Tt, ui).call(this);
463
- }, Tt = new WeakSet(), ui = function() {
462
+ d(this, Et, mi).call(this);
463
+ }, Et = new WeakSet(), mi = function() {
464
464
  const { elements: i, options: t } = this;
465
465
  i.forEach((e) => {
466
- e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, Et, hi), 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, "");
466
+ e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, At, gi), 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, "");
467
467
  }), this.emit("afterInit");
468
- }, Et = new WeakSet(), hi = function() {
468
+ }, At = new WeakSet(), gi = function() {
469
469
  const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
470
470
  target: this.getAttribute("data-anchor-target") || i.target,
471
471
  container: this.getAttribute("data-anchor-container") || i.container,
@@ -479,12 +479,12 @@ tt = new WeakSet(), Ce = function() {
479
479
  this.removeEventListener("click", t), setTimeout(() => {
480
480
  this.addEventListener("click", t);
481
481
  }, s.speed), setTimeout(() => {
482
- $e(s, e);
482
+ Ce(s, e);
483
483
  }, s.delay);
484
484
  };
485
- Object.assign(di.prototype, z);
485
+ Object.assign(pi.prototype, z);
486
486
  window.MODALS || (window.MODALS = {});
487
- const { MODALS: P } = window, Ws = (n) => {
487
+ const { MODALS: P } = window, Rs = (n) => {
488
488
  const { TEMPLATE: i } = j, { childDom: t } = n, e = document.createElement("div");
489
489
  e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
490
490
  const s = e.querySelector(".modal-content");
@@ -492,13 +492,13 @@ const { MODALS: P } = window, Ws = (n) => {
492
492
  s.append(o);
493
493
  }), e.children[0];
494
494
  };
495
- var At, mi, Lt, gi, St, fi, Dt, vi, kt, bi;
496
- class pi extends HTMLElement {
495
+ var Lt, vi, St, bi, _t, yi, Dt, wi, kt, Ti;
496
+ class fi extends HTMLElement {
497
497
  constructor() {
498
498
  super();
499
- h(this, At);
500
499
  h(this, Lt);
501
500
  h(this, St);
501
+ h(this, _t);
502
502
  h(this, Dt);
503
503
  h(this, kt);
504
504
  this.initialize = !1;
@@ -509,12 +509,12 @@ class pi extends HTMLElement {
509
509
  attributeChangedCallback(t, e, s) {
510
510
  switch (t) {
511
511
  case ":state":
512
- d(this, kt, bi).call(this, s);
512
+ d(this, kt, Ti).call(this, s);
513
513
  break;
514
514
  }
515
515
  }
516
516
  connectedCallback() {
517
- this.initialize || (this.initialize = !0, d(this, At, mi).call(this));
517
+ this.initialize || (this.initialize = !0, d(this, Lt, vi).call(this));
518
518
  }
519
519
  open() {
520
520
  return this.setAttribute(":state", "open"), this;
@@ -526,22 +526,22 @@ class pi extends HTMLElement {
526
526
  return this.setAttribute(":state", "destroy"), this;
527
527
  }
528
528
  }
529
- At = new WeakSet(), mi = function() {
529
+ Lt = new WeakSet(), vi = function() {
530
530
  const { ATTRS: t } = j;
531
531
  this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
532
- const e = this.getAttribute(t.id) || Ns();
533
- this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this, Lt, gi).call(this);
534
- }, Lt = new WeakSet(), gi = function() {
535
- this.childDom = this.childNodes, this.template = Ws(this), this.innerHTML = "", this.append(this.template), d(this, St, fi).call(this);
536
- }, St = new WeakSet(), fi = function() {
532
+ const e = this.getAttribute(t.id) || zs();
533
+ this.getAttribute(t.id) || (E(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), P[e] && E(`the ${t.id} "${e}" is already be used.`), P[e] = this, d(this, St, bi).call(this);
534
+ }, St = new WeakSet(), bi = function() {
535
+ this.childDom = this.childNodes, this.template = Rs(this), this.innerHTML = "", this.append(this.template), d(this, _t, yi).call(this);
536
+ }, _t = new WeakSet(), yi = function() {
537
537
  const t = this.querySelector(".modal-scroller");
538
- this.__scroller__ = Xe(t, {
538
+ this.__scroller__ = Fe(t, {
539
539
  overflowBehavior: {
540
540
  x: "hidden"
541
541
  },
542
542
  autoUpdate: !0
543
- }), window.modalScroll = this.__scroller__, d(this, Dt, vi).call(this);
544
- }, Dt = new WeakSet(), vi = function() {
543
+ }), window.modalScroll = this.__scroller__, d(this, Dt, wi).call(this);
544
+ }, Dt = new WeakSet(), wi = function() {
545
545
  var a, r, l;
546
546
  const t = this, { ATTRS: e } = j, { close: s, destroy: o } = e;
547
547
  (a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
@@ -557,7 +557,7 @@ At = new WeakSet(), mi = function() {
557
557
  }), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
558
558
  c.stopPropagation();
559
559
  });
560
- }, kt = new WeakSet(), bi = function(t) {
560
+ }, kt = new WeakSet(), Ti = function(t) {
561
561
  const { __scroller__: e } = this;
562
562
  if (t === "open") {
563
563
  if (this.style.display = "block", e) {
@@ -588,22 +588,22 @@ At = new WeakSet(), mi = function() {
588
588
  this.addEventListener("transitionend", s);
589
589
  }
590
590
  };
591
- Object.assign(pi.prototype, z);
592
- const { MODALS: Fe } = window, gt = {}, yi = (n, i, ...t) => {
591
+ Object.assign(fi.prototype, z);
592
+ const { MODALS: Ze } = window, ft = {}, Ei = (n, i, ...t) => {
593
593
  if (!i)
594
594
  return;
595
595
  const e = n[i];
596
596
  e && G(e) && e.apply(n, t);
597
- }, wi = (n, ...i) => {
597
+ }, Ai = (n, ...i) => {
598
598
  n && G(n) && n.apply(V, i);
599
- }, Qe = (n, i) => {
600
- const { target: t } = n, e = Fe[t] || D(n.target);
601
- e && Ti(n, i), e || Gs(n, i);
602
- }, Ti = (n, i) => {
603
- const { target: t, action: e, on: s, e: o } = n, a = Fe[t] || D(n.target);
599
+ }, ti = (n, i) => {
600
+ const { target: t } = n, e = Ze[t] || _(n.target);
601
+ e && Li(n, i), e || Xs(n, i);
602
+ }, Li = (n, i) => {
603
+ const { target: t, action: e, on: s, e: o } = n, a = Ze[t] || _(n.target);
604
604
  switch (["open", "close", "destroy"].forEach((l) => {
605
605
  a.once(l, () => {
606
- i && (i.emit(l, a, o), yi(i, s[l], a, o)), i || wi(s[l], a);
606
+ i && (i.emit(l, a, o), Ei(i, s[l], a, o)), i || Ai(s[l], a);
607
607
  });
608
608
  }), e) {
609
609
  case "open":
@@ -620,34 +620,34 @@ const { MODALS: Fe } = window, gt = {}, yi = (n, i, ...t) => {
620
620
  l === "close" && a.open(), l === "open" && a.close();
621
621
  break;
622
622
  }
623
- }, Gs = async (n, i) => {
623
+ }, Xs = async (n, i) => {
624
624
  const { target: t, route: e, container: s, on: o, e: a } = n;
625
625
  if (!e)
626
626
  return E("modal4", "cannot find target or data-modal-route is not defined");
627
627
  const r = (l, ...c) => {
628
- i && (i.emit(l, ...c), yi(i, o[l], ...c)), i || wi(o[l], ...c);
628
+ i && (i.emit(l, ...c), Ei(i, o[l], ...c)), i || Ai(o[l], ...c);
629
629
  };
630
- gt[t] || (gt[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
631
- const c = js(l), u = D(s) || D(j.SETTINGS.container);
630
+ ft[t] || (ft[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
631
+ const c = Bs(l), u = _(s) || _(j.SETTINGS.container);
632
632
  [...c].forEach((g) => {
633
633
  u.append(g);
634
634
  });
635
- const p = Fe[t] || D(n.target);
636
- r("complete", p), Ti(n, i), delete gt[t];
635
+ const p = Ze[t] || _(n.target);
636
+ r("complete", p), Li(n, i), delete ft[t];
637
637
  }).catch((l) => {
638
- r("error", l), delete gt[t];
638
+ r("error", l), delete ft[t];
639
639
  }));
640
640
  };
641
- var et, He, _t, Ei, xt, Ai;
641
+ var et, Me, xt, Si, $t, _i;
642
642
  const B = class B {
643
643
  constructor(i, t = {}) {
644
644
  h(this, et);
645
- h(this, _t);
646
645
  h(this, xt);
646
+ h(this, $t);
647
647
  this.__storage__ = {
648
648
  el: i,
649
649
  options: t
650
- }, this.active = "data-modal-active", d(this, et, He).call(this);
650
+ }, this.active = "data-modal-active", d(this, et, Me).call(this);
651
651
  }
652
652
  destroy() {
653
653
  const { elements: i } = this;
@@ -657,12 +657,12 @@ const B = class B {
657
657
  }
658
658
  update() {
659
659
  var i;
660
- return d(i = this.destroy(), et, He).call(i), this.emit("update"), this;
660
+ return d(i = this.destroy(), et, Me).call(i), this.emit("update"), this;
661
661
  }
662
662
  /** static method 'open' */
663
663
  static open(i) {
664
664
  const { SETTINGS: t } = j, e = Object.assign({}, t, { on: {} }, i);
665
- Qe(e);
665
+ ti(e);
666
666
  }
667
667
  /** static method 'defineMethods' */
668
668
  static defineMethods(i) {
@@ -673,22 +673,22 @@ const B = class B {
673
673
  Object.assign(B.prototype, B.prototype.__methods__);
674
674
  }
675
675
  };
676
- et = new WeakSet(), He = function() {
676
+ et = new WeakSet(), Me = function() {
677
677
  const { el: i, options: t } = this.__storage__;
678
- if (!pt(i) || !A(i))
678
+ if (!mt(i) || !A(i))
679
679
  return;
680
680
  const { SETTINGS: e, EVENTS: s } = j;
681
- 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)
681
+ if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
682
682
  for (const [o, a] of Object.entries(this.options.on))
683
683
  this.__events__[o] = [a];
684
- d(this, _t, Ei).call(this);
685
- }, _t = new WeakSet(), Ei = function() {
684
+ d(this, xt, Si).call(this);
685
+ }, xt = new WeakSet(), Si = function() {
686
686
  const { elements: i, options: t } = this;
687
687
  i.forEach((e) => {
688
- e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, xt, Ai), 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, "");
688
+ e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, $t, _i), e.modal.defaultOptions = t, e.modal.methods = {}, e.modal.methods.destroy = this.destroy, e.modal.methods.update = this.update, e.addEventListener("click", e.modal.eventHandler), e.setAttribute(this.active, "");
689
689
  }), this.emit("init");
690
- }, xt = new WeakSet(), Ai = function(i) {
691
- const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = zs(this.getAttribute("data-modal-on"));
690
+ }, $t = new WeakSet(), _i = function(i) {
691
+ const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = Ws(this.getAttribute("data-modal-on"));
692
692
  o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
693
693
  const a = {
694
694
  target: this.getAttribute("data-modal-target") || t.target,
@@ -700,12 +700,12 @@ et = new WeakSet(), He = function() {
700
700
  };
701
701
  this.removeEventListener("click", e), setTimeout(() => {
702
702
  this.addEventListener("click", e);
703
- }, 200), Qe(a, s);
703
+ }, 200), ti(a, s);
704
704
  };
705
705
  let V = B;
706
706
  Object.assign(V.prototype, z);
707
- customElements.define("modern-modal", pi);
708
- const Rs = (n, i) => {
707
+ customElements.define("modern-modal", fi);
708
+ const Us = (n, i) => {
709
709
  const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
710
710
  i.forEach((s) => {
711
711
  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);
@@ -720,22 +720,22 @@ const Rs = (n, i) => {
720
720
  }, a);
721
721
  }
722
722
  });
723
- }, Xs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
724
- var it, Me, $t, Si;
725
- class Li {
723
+ }, Ys = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
724
+ var it, Ie, Ct, ki;
725
+ class Di {
726
726
  constructor(i, t = {}) {
727
727
  h(this, it);
728
- h(this, $t);
728
+ h(this, Ct);
729
729
  this.__storage__ = {
730
730
  el: i,
731
731
  options: t
732
- }, this.active = "data-aost-active", d(this, it, Me).call(this);
732
+ }, this.active = "data-aost-active", d(this, it, Ie).call(this);
733
733
  }
734
734
  destroy(i) {
735
735
  const { elements: t, options: e } = this;
736
736
  if (!t)
737
737
  return this;
738
- const { scroller: s } = e, o = s === window || !A(s) ? window : D(s);
738
+ const { scroller: s } = e, o = s === window || !A(s) ? window : _(s);
739
739
  return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
740
740
  if (!a.aost)
741
741
  return;
@@ -745,58 +745,58 @@ class Li {
745
745
  }
746
746
  update(i) {
747
747
  var t;
748
- d(t = this.destroy(i), it, Me).call(t);
748
+ d(t = this.destroy(i), it, Ie).call(t);
749
749
  }
750
750
  }
751
- it = new WeakSet(), Me = function() {
751
+ it = new WeakSet(), Ie = function() {
752
752
  const { el: i, options: t } = this.__storage__;
753
- if (!pt(i) || !A(i))
753
+ if (!mt(i) || !A(i))
754
754
  return;
755
- const { SETTINGS: e, EVENTS: s } = ai;
756
- 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)
755
+ const { SETTINGS: e, EVENTS: s } = ci;
756
+ if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
757
757
  for (const [o, a] of Object.entries(this.options.on))
758
758
  this.__events__[o] = [a];
759
- d(this, $t, Si).call(this);
760
- }, $t = new WeakSet(), Si = function() {
761
- const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !A(e) ? window : D(e);
759
+ d(this, Ct, ki).call(this);
760
+ }, Ct = new WeakSet(), ki = function() {
761
+ const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !A(e) ? window : _(e);
762
762
  this.eventHandler = () => {
763
- Rs(s, i);
763
+ Us(s, i);
764
764
  }, i.forEach((a) => {
765
- 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 = Xs(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, "");
765
+ 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 = Ys(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, "");
766
766
  });
767
767
  const { eventHandler: o } = this;
768
768
  o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
769
769
  };
770
- Object.assign(Li.prototype, z);
771
- const Ys = (n) => {
772
- const { TEMPLATE: i } = _e, { childDom: t } = n, e = document.createElement("div");
770
+ Object.assign(Di.prototype, z);
771
+ const Fs = (n) => {
772
+ const { TEMPLATE: i } = xe, { childDom: t } = n, e = document.createElement("div");
773
773
  e.innerHTML = i();
774
774
  const s = e.querySelector(".player-wrapper");
775
775
  return [...t].forEach((o) => {
776
776
  s.append(o);
777
777
  }), e.children[0];
778
778
  };
779
- var Ct, Di, Ht, ki, Mt, _i, It, xi, qt, $i, Ot, Ci, Pt, Hi, Nt, Mi, jt, Ii, zt, qi;
780
- class Fs extends HTMLElement {
779
+ var Ht, xi, Mt, $i, It, Ci, qt, Hi, Ot, Mi, Pt, Ii, Nt, qi, jt, Oi, zt, Pi, Bt, Ni;
780
+ class Js extends HTMLElement {
781
781
  constructor() {
782
782
  super();
783
- h(this, Ct);
784
783
  h(this, Ht);
785
784
  h(this, Mt);
786
- // youtube iframe
787
785
  h(this, It);
788
- // vimeo iframe
786
+ // youtube iframe
789
787
  h(this, qt);
790
- // youku iframe
788
+ // vimeo iframe
791
789
  h(this, Ot);
790
+ // youku iframe
792
791
  h(this, Pt);
793
- // 2025.02.11 新增 ig
794
792
  h(this, Nt);
795
- // 2025.02.11 新增 tiktok
793
+ // 2025.02.11 新增 ig
796
794
  h(this, jt);
797
- // 2026.01.15 新增 video
795
+ // 2025.02.11 新增 tiktok
798
796
  h(this, zt);
799
- d(this, Ct, Di).call(this);
797
+ // 2026.01.15 新增 video
798
+ h(this, Bt);
799
+ d(this, Ht, xi).call(this);
800
800
  }
801
801
  play() {
802
802
  const { videoType: t } = this;
@@ -833,16 +833,16 @@ class Fs extends HTMLElement {
833
833
  }
834
834
  }
835
835
  }
836
- Ct = new WeakSet(), Di = function() {
836
+ Ht = new WeakSet(), xi = function() {
837
837
  if (!this.getAttribute("video-id")) {
838
838
  E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
839
839
  return;
840
840
  }
841
- this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, Ht, ki).call(this);
842
- }, Ht = new WeakSet(), ki = function() {
843
- this.childDom = this.childNodes, this.template = Ys(this), this.innerHTML = "", this.append(this.template), d(this, Mt, _i).call(this);
844
- }, Mt = new WeakSet(), _i = function() {
845
- const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = _e;
841
+ this.videoId = this.getAttribute("video-id"), this.videoType = this.getAttribute("video-type"), this.videoMode = this.getAttribute("video-mode"), this.autoplay = this.getAttribute("video-autoplay"), this.startTime = this.getAttribute("video-starttime"), this.videoInboxImg = this.getAttribute("video-inbox-img"), d(this, Mt, $i).call(this);
842
+ }, Mt = new WeakSet(), $i = function() {
843
+ this.childDom = this.childNodes, this.template = Fs(this), this.innerHTML = "", this.append(this.template), d(this, It, Ci).call(this);
844
+ }, It = new WeakSet(), Ci = function() {
845
+ const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = xe;
846
846
  let o = "";
847
847
  function a(r) {
848
848
  f(r).addClass("cookie-disagree"), f(".cookie-disagree").append(s);
@@ -851,72 +851,72 @@ Ct = new WeakSet(), Di = function() {
851
851
  case "youtubeAPI":
852
852
  break;
853
853
  case "youtube":
854
- document.body.wd_youtube == !1 ? a("video-player") : o = d(this, It, xi).call(this);
854
+ document.body.wd_youtube == !1 ? a("video-player") : o = d(this, qt, Hi).call(this);
855
855
  break;
856
856
  case "youkuAPI":
857
857
  break;
858
858
  case "youku":
859
- document.body.wd_youku == !1 ? a("video-player") : o = d(this, Ot, Ci).call(this);
859
+ document.body.wd_youku == !1 ? a("video-player") : o = d(this, Pt, Ii).call(this);
860
860
  break;
861
861
  case "vimeo":
862
- document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, qt, $i).call(this);
862
+ document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, Ot, Mi).call(this);
863
863
  break;
864
864
  case "bilibili":
865
- document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Pt, Hi).call(this);
865
+ document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Nt, qi).call(this);
866
866
  break;
867
867
  case "instagram":
868
- document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, Nt, Mi).call(this);
868
+ document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, jt, Oi).call(this);
869
869
  break;
870
870
  case "tiktok":
871
- document.body.wd_tiktok == !1 ? a("video-player") : o = d(this, jt, Ii).call(this);
871
+ document.body.wd_tiktok == !1 ? a("video-player") : o = d(this, zt, Pi).call(this);
872
872
  break;
873
873
  case "videojs":
874
874
  break;
875
875
  case "video":
876
- o = d(this, zt, qi).call(this);
876
+ o = d(this, Bt, Ni).call(this);
877
877
  break;
878
878
  }
879
879
  this.querySelector(".player-wrapper").insertAdjacentHTML(L.prepend, o);
880
- }, It = new WeakSet(), xi = function() {
880
+ }, qt = new WeakSet(), Hi = function() {
881
881
  const { videoId: t, autoplay: e, startTime: s } = this;
882
882
  return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${s}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
883
- }, qt = new WeakSet(), $i = function() {
883
+ }, Ot = new WeakSet(), Mi = function() {
884
884
  const { videoId: t, autoplay: e, hash: s } = this;
885
885
  return `<iframe src="https://player.vimeo.com/video/${t}?h=${s}&${e === "on" ? "autoplay=1" : ""}&loop=1&color=ffffff&title=0&byline=0&portrait=0" frameborder="0" allow="${e === "on" ? "autoplay;" : ""} fullscreen; picture-in-picture" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"><\/script>`;
886
- }, Ot = new WeakSet(), Ci = function() {
886
+ }, Pt = new WeakSet(), Ii = function() {
887
887
  const { videoId: t, autoplay: e } = this;
888
888
  return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
889
- }, Pt = new WeakSet(), Hi = function() {
889
+ }, Nt = new WeakSet(), qi = function() {
890
890
  const { videoId: t, autoplay: e } = this;
891
891
  return `<iframe src="//player.bilibili.com/player.html?bvid=${t}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>`;
892
- }, Nt = new WeakSet(), Mi = function() {
892
+ }, jt = new WeakSet(), Oi = function() {
893
893
  const { videoId: t, autoplay: e } = this;
894
894
  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>`;
895
- }, jt = new WeakSet(), Ii = function() {
895
+ }, zt = new WeakSet(), Pi = function() {
896
896
  const { videoId: t, autoplay: e } = this;
897
897
  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>`;
898
- }, zt = new WeakSet(), qi = function() {
898
+ }, Bt = new WeakSet(), Ni = function() {
899
899
  const { videoId: t, autoplay: e } = this;
900
900
  return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
901
901
  };
902
902
  let Q = 0;
903
- function Oi(n) {
903
+ function ji(n) {
904
904
  const i = [];
905
905
  return (n || []).forEach((t) => {
906
906
  t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(t));
907
907
  }), i;
908
908
  }
909
- function Pi(n) {
910
- const i = Oi(n);
911
- Q += 1, Q === 1 && (document.documentElement.classList.add("scrollLock"), Is(i));
909
+ function zi(n) {
910
+ const i = ji(n);
911
+ Q += 1, Q === 1 && (document.documentElement.classList.add("scrollLock"), Os(i));
912
912
  }
913
- function Ni(n) {
913
+ function Bi(n) {
914
914
  if (Q = Math.max(0, Q - 1), Q === 0) {
915
- const i = Oi(n);
916
- qs(i), document.documentElement.classList.remove("scrollLock");
915
+ const i = ji(n);
916
+ Ps(i), document.documentElement.classList.remove("scrollLock");
917
917
  }
918
918
  }
919
- async function Hn(n = 0) {
919
+ async function In(n = 0) {
920
920
  if (f(".loading-wrapper").length)
921
921
  return;
922
922
  f("body").append(`
@@ -930,30 +930,30 @@ async function Hn(n = 0) {
930
930
  </div>
931
931
  </div>
932
932
  `), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
933
- Pi();
933
+ zi();
934
934
  });
935
935
  }
936
- function Mn() {
936
+ function qn() {
937
937
  f(".loading-wrapper").fadeOut(300).promise().done(function() {
938
- f(".loading-wrapper").remove(), Ni();
938
+ f(".loading-wrapper").remove(), Bi();
939
939
  });
940
940
  }
941
- function In(n, i) {
942
- new En(n, i);
941
+ function On(n, i) {
942
+ new Ln(n, i);
943
943
  }
944
- function Us() {
945
- const n = document.querySelector("[data-aost]") && new Li("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new di("[data-anchor-target]"), t = new oi({ callback_loaded: () => {
946
- } }), e = new gn();
944
+ function Zs() {
945
+ const n = document.querySelector("[data-aost]") && new Di("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new pi("[data-anchor-target]"), t = new li({ callback_loaded: () => {
946
+ } }), e = new vn();
947
947
  n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
948
948
  }
949
- function qn(n, i = () => {
949
+ function Pn(n, i = () => {
950
950
  }) {
951
951
  f(`[data-tab-content=${n}]`).fadeIn(function() {
952
952
  typeof i == "function" && i();
953
- }).siblings("[data-tab-content]").hide(), Us();
953
+ }).siblings("[data-tab-content]").hide(), Zs();
954
954
  }
955
- function On() {
956
- Xe(
955
+ function Nn() {
956
+ Fe(
957
957
  {
958
958
  target: document.body,
959
959
  cancel: {
@@ -977,31 +977,31 @@ function On() {
977
977
  }
978
978
  );
979
979
  }
980
- function Pn() {
980
+ function jn() {
981
981
  window.onpageshow = function(n) {
982
982
  n.persisted && window.location.reload();
983
983
  };
984
984
  }
985
- function Nn() {
985
+ function zn() {
986
986
  const n = navigator.userAgent;
987
987
  return {
988
988
  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)
989
989
  };
990
990
  }
991
- function jn(n, i) {
991
+ function Bn(n, i) {
992
992
  f(n).on("click", function() {
993
993
  f(this).toggleClass(i);
994
994
  });
995
995
  }
996
- function zn(n, i) {
996
+ function Wn(n, i) {
997
997
  f(n).on("click", function() {
998
998
  f(n).not(this).removeClass(i), f(this).addClass(i);
999
999
  });
1000
1000
  }
1001
- const Bn = (n) => new Promise((i) => {
1001
+ const Gn = (n) => new Promise((i) => {
1002
1002
  let t = setTimeout(() => (clearTimeout(t), i()), n);
1003
1003
  });
1004
- function Js(n, i = 250) {
1004
+ function Qs(n, i = 250) {
1005
1005
  let t = null;
1006
1006
  return function(...e) {
1007
1007
  let s = this;
@@ -1010,7 +1010,7 @@ function Js(n, i = 250) {
1010
1010
  }, i);
1011
1011
  };
1012
1012
  }
1013
- function Wn(n, i = 250) {
1013
+ function Rn(n, i = 250) {
1014
1014
  let t, e;
1015
1015
  return function() {
1016
1016
  const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
@@ -1019,7 +1019,7 @@ function Wn(n, i = 250) {
1019
1019
  }, i)) : (t = a, n.apply(s, o));
1020
1020
  };
1021
1021
  }
1022
- function Gn() {
1022
+ function Xn() {
1023
1023
  window._g.interval = [], f(".countdown").each((i, t) => {
1024
1024
  const e = Number(f(t).attr("data-seconds")) + 1;
1025
1025
  let s = Math.floor(e / 60) + ":" + e % 60;
@@ -1029,21 +1029,21 @@ function Gn() {
1029
1029
  }, 1e3);
1030
1030
  });
1031
1031
  }
1032
- function Rn(n = 500) {
1032
+ function Un(n = 500) {
1033
1033
  return new Promise((i, t) => {
1034
1034
  let e = setTimeout(() => {
1035
1035
  clearTimeout(e), i();
1036
1036
  }, n);
1037
1037
  });
1038
1038
  }
1039
- function Xn() {
1039
+ function Yn() {
1040
1040
  const n = function() {
1041
1041
  let i = window.innerHeight * 0.01;
1042
1042
  document.documentElement.style.setProperty("--vh", i + "px");
1043
1043
  };
1044
- n(), window.addEventListener("resize", Js(n));
1044
+ n(), window.addEventListener("resize", Qs(n));
1045
1045
  }
1046
- function Yn(n, i, t, e, s) {
1046
+ function Fn(n, i, t, e, s) {
1047
1047
  const o = this, r = f(n).html().split("<br>");
1048
1048
  let l = "", c = 0;
1049
1049
  r.forEach((u, p) => {
@@ -1052,11 +1052,11 @@ function Yn(n, i, t, e, s) {
1052
1052
  });
1053
1053
  }), f(n).html(l);
1054
1054
  }
1055
- function Fn(n, i) {
1055
+ function Jn(n, i) {
1056
1056
  const t = Math.pow(10, i);
1057
1057
  return Math.round(n * t) / t;
1058
1058
  }
1059
- function Un(n) {
1059
+ function Zn(n) {
1060
1060
  let i = n.activeIndex, t = n.slides.length;
1061
1061
  if (n.params.loop)
1062
1062
  switch (n.activeIndex) {
@@ -1071,18 +1071,18 @@ function Un(n) {
1071
1071
  }
1072
1072
  return i;
1073
1073
  }
1074
- function Jn(n, i) {
1074
+ function Qn(n, i) {
1075
1075
  const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
1076
1076
  (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());
1077
1077
  }
1078
- function Zn(n) {
1078
+ function Kn(n) {
1079
1079
  n.el.querySelectorAll("img.detect-shade").forEach((i) => {
1080
1080
  i.addEventListener("load", function() {
1081
1081
  detectShade(i);
1082
1082
  });
1083
1083
  });
1084
1084
  }
1085
- function Qn(n) {
1085
+ function Vn(n) {
1086
1086
  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");
1087
1087
  n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
1088
1088
  a.currentTime = 0;
@@ -1090,7 +1090,7 @@ function Qn(n) {
1090
1090
  n.slideNext();
1091
1091
  }), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
1092
1092
  }
1093
- function Kn() {
1093
+ function to() {
1094
1094
  f(".number-grow").each(function(n, i) {
1095
1095
  const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1096
1096
  let r = "";
@@ -1104,7 +1104,7 @@ function Kn() {
1104
1104
  });
1105
1105
  });
1106
1106
  }
1107
- function Vn() {
1107
+ function eo() {
1108
1108
  f(".letter-grow").each(function(n, i) {
1109
1109
  const t = f(i), s = t.attr("data-letter").split(""), o = () => {
1110
1110
  let a = "";
@@ -1118,48 +1118,48 @@ function Vn() {
1118
1118
  });
1119
1119
  });
1120
1120
  }
1121
- function to(n) {
1121
+ function io(n) {
1122
1122
  const i = getComputedStyle(n).transform;
1123
1123
  let t = i.match(/^matrix3d\((.+)\)$/);
1124
1124
  return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
1125
1125
  }
1126
- function eo(n) {
1126
+ function so(n) {
1127
1127
  const i = getComputedStyle(n).transform;
1128
1128
  let t = i.match(/^matrix3d\((.+)\)$/);
1129
1129
  return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
1130
1130
  }
1131
- function io(n) {
1131
+ function no(n) {
1132
1132
  const i = document.createElement("div");
1133
1133
  return i.innerHTML = n, i.childNodes[0];
1134
1134
  }
1135
- const Ke = (n) => n.videoId !== "" || typeof n.videoId < "u", Zs = (n) => n.$selector.getAttribute("video4-active") === "on", ft = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`, Ve = (n) => (console.log(n.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${n.videoId}"></blockquote>`);
1136
- var st, qe, Bt, ji, nt, Oe, ot, Pe, Wt, zi, at, Ne, Gt, Bi;
1135
+ const ei = (n) => n.videoId !== "" || typeof n.videoId < "u", Ks = (n) => n.$selector.getAttribute("video4-active") === "on", vt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`, ii = (n) => (console.log(n.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${n.videoId}"></blockquote>`);
1136
+ var st, Oe, Wt, Wi, nt, Pe, ot, Ne, Gt, Gi, at, je, Rt, Ri;
1137
1137
  const X = class X {
1138
1138
  //*-* 給Article4用的 **//
1139
1139
  constructor(i, t = {}) {
1140
1140
  h(this, st);
1141
- h(this, Bt);
1141
+ h(this, Wt);
1142
1142
  h(this, nt);
1143
1143
  h(this, ot);
1144
- h(this, Wt);
1145
- h(this, at);
1146
1144
  h(this, Gt);
1147
- if (!pt(i) && !xe(i) && !mt(i)) {
1148
- Ze("video4", `找不到該物件 -> ${i}`);
1145
+ h(this, at);
1146
+ h(this, Rt);
1147
+ if (!mt(i) && !$e(i) && !gt(i)) {
1148
+ Ve("video4", `找不到該物件 -> ${i}`);
1149
1149
  return;
1150
1150
  }
1151
1151
  this.__storage__ = {
1152
1152
  el: i,
1153
1153
  options: t
1154
- }, this.active = "data-video-active", d(this, st, qe).call(this);
1154
+ }, this.active = "data-video-active", d(this, st, Oe).call(this);
1155
1155
  }
1156
1156
  update() {
1157
- d(this, st, qe).call(this);
1157
+ d(this, st, Oe).call(this);
1158
1158
  }
1159
1159
  };
1160
- st = new WeakSet(), qe = function() {
1161
- const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = _e;
1162
- if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? k(i + `:not([${this.active}])`) : k(i), this.options = Object.assign(
1160
+ st = new WeakSet(), Oe = function() {
1161
+ const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = xe;
1162
+ if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign(
1163
1163
  {},
1164
1164
  { LAYOUT: o },
1165
1165
  // 原始 configs 的 LAYOUT
@@ -1172,18 +1172,18 @@ st = new WeakSet(), qe = function() {
1172
1172
  ), this.__events__ = Object.assign({}, s), this.options.on)
1173
1173
  for (const [a, r] of Object.entries(this.options.on))
1174
1174
  this.__events__[a] = [r];
1175
- d(this, Bt, ji).call(this);
1176
- }, Bt = new WeakSet(), ji = function() {
1175
+ d(this, Wt, Wi).call(this);
1176
+ }, Wt = new WeakSet(), Wi = function() {
1177
1177
  const { elements: i, options: t } = this;
1178
1178
  i.forEach((e) => {
1179
- e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Gt, Bi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Ke(e.video.params) && !Zs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Wt, zi).call(this, e)), Ke(e.video.params) || Ze("video4", "無法取得影片 ID");
1179
+ e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Rt, Ri).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), ei(e.video.params) && !Ks(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Gt, Gi).call(this, e)), ei(e.video.params) || Ve("video4", "無法取得影片 ID");
1180
1180
  }), this.emit("init");
1181
- }, nt = new WeakSet(), Oe = function(i) {
1181
+ }, nt = new WeakSet(), Pe = function(i) {
1182
1182
  const { $selector: t, videoId: e, videoType: s, videoInboxImg: o, videoHighQualityPic: a } = i, r = t == null ? void 0 : t.querySelector("img"), l = (r == null ? void 0 : r.getAttribute("src")) || (r == null ? void 0 : r.getAttribute("data-src"));
1183
1183
  return o ? Promise.resolve(o) : l ? Promise.resolve(l) : s == "youtube" ? a == "on" ? Promise.resolve(`https://img.youtube.com/vi/${e}/maxresdefault.jpg`) : Promise.resolve(`https://img.youtube.com/vi/${e}/0.jpg`) : s == "vimeo" ? Promise.resolve(`https://vumbnail.com/${e}_large.jpg`) : s == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${e}`, { method: "GET", redirect: "follow" }).then((c) => c.json()).then((c) => c.thumbnail_url).catch(function() {
1184
1184
  return "";
1185
1185
  }) : Promise.resolve("");
1186
- }, ot = new WeakSet(), Pe = function(i, t) {
1186
+ }, ot = new WeakSet(), Ne = function(i, t) {
1187
1187
  const { videoType: e, videoId: s } = t;
1188
1188
  if (!(i != null && i.getAttribute("src") || i != null && i.getAttribute("data-src"))) {
1189
1189
  if (e === "video") {
@@ -1196,11 +1196,11 @@ st = new WeakSet(), qe = function() {
1196
1196
  };
1197
1197
  return;
1198
1198
  }
1199
- d(this, nt, Oe).call(this, t).then((a) => {
1199
+ d(this, nt, Pe).call(this, t).then((a) => {
1200
1200
  a ? i.setAttribute("src", `${a}`) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1201
1201
  });
1202
1202
  }
1203
- }, Wt = new WeakSet(), zi = function(i) {
1203
+ }, Gt = new WeakSet(), Gi = function(i) {
1204
1204
  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;
1205
1205
  if (l === "onBox" || l === "inBox") {
1206
1206
  let g = null;
@@ -1208,7 +1208,7 @@ st = new WeakSet(), qe = function() {
1208
1208
  i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(L.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1209
1209
  const m = s.querySelector("img"), v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src")), w = t[o] ? t[o] : t[0] || "";
1210
1210
  if (w ? m.insertAdjacentHTML(L.after, w) : E("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v)
1211
- d(this, ot, Pe).call(this, m, e);
1211
+ d(this, ot, Ne).call(this, m, e);
1212
1212
  else if (!v && r == "youtube")
1213
1213
  p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
1214
1214
  else if (!v && r == "vimeo")
@@ -1229,7 +1229,7 @@ st = new WeakSet(), qe = function() {
1229
1229
  console.log("error");
1230
1230
  }) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1231
1231
  }
1232
- 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.instance = this), g.video.eventHandler = d(this, at, Ne), g.addEventListener("click", g.video.eventHandler);
1232
+ 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.instance = this), g.video.eventHandler = d(this, at, je), g.addEventListener("click", g.video.eventHandler);
1233
1233
  } else if (l === "onPage") {
1234
1234
  let g = null;
1235
1235
  if (u == "on") {
@@ -1242,14 +1242,14 @@ st = new WeakSet(), qe = function() {
1242
1242
  m.setAttribute("src", `${b}`);
1243
1243
  }).catch(function(w) {
1244
1244
  console.log("error");
1245
- }) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : d(this, ot, Pe).call(this, m, e), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1245
+ }) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : d(this, ot, Ne).call(this, m, e), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || E("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1246
1246
  } else {
1247
- s.innerHTML = ft(e);
1247
+ s.innerHTML = vt(e);
1248
1248
  return;
1249
1249
  }
1250
- g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, at, Ne), g.addEventListener("click", g.video.eventHandler);
1250
+ g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, at, je), g.addEventListener("click", g.video.eventHandler);
1251
1251
  }
1252
- }, at = new WeakSet(), Ne = function(i) {
1252
+ }, at = new WeakSet(), je = function(i) {
1253
1253
  const { video: t } = this, e = t.instance, {
1254
1254
  $selector: s,
1255
1255
  videoMode: o,
@@ -1263,7 +1263,7 @@ st = new WeakSet(), qe = function() {
1263
1263
  videoButton: m,
1264
1264
  videoLayoutNo: v,
1265
1265
  videoStartTime: w
1266
- } = t.params, b = new oi({ callback_loaded: (C) => {
1266
+ } = t.params, b = new li({ callback_loaded: (C) => {
1267
1267
  } }), T = new URLSearchParams({
1268
1268
  video_mode: o,
1269
1269
  video_type: u,
@@ -1276,25 +1276,25 @@ st = new WeakSet(), qe = function() {
1276
1276
  on: {
1277
1277
  complete(y) {
1278
1278
  var S, O;
1279
- o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (S = window.instgrm) != null && S.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Ve(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ft(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${u}`), u == "instagram" && ((O = window.instgrm) != null && O.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Ve(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
1279
+ o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (S = window.instgrm) != null && S.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ii(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", vt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${u}`), u == "instagram" && ((O = window.instgrm) != null && O.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ii(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
1280
1280
  },
1281
1281
  open(y) {
1282
1282
  var O;
1283
1283
  const S = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1284
- if (b.update(), Pi([...S]), u == "instagram") {
1285
- const _ = document.querySelector("[video-template] .modal-content");
1284
+ if (b.update(), zi([...S]), u == "instagram") {
1285
+ const k = document.querySelector("[video-template] .modal-content");
1286
1286
  new ResizeObserver((J) => {
1287
- J[0].contentRect.height > 50 && _.classList.add("active");
1288
- }).observe(_);
1287
+ J[0].contentRect.height > 50 && k.classList.add("active");
1288
+ }).observe(k);
1289
1289
  }
1290
1290
  if (o == "inBox")
1291
1291
  if (u == "instagram")
1292
1292
  f(".video-content").remove();
1293
1293
  else {
1294
- let _;
1295
- const U = y.querySelector(".video-content");
1296
- d(O = e, nt, Oe).call(O, t.params).then((J) => {
1297
- _ = `
1294
+ let k;
1295
+ const F = y.querySelector(".video-content");
1296
+ d(O = e, nt, Pe).call(O, t.params).then((J) => {
1297
+ k = `
1298
1298
  <div
1299
1299
  class="photo-box"
1300
1300
  video-target
@@ -1316,9 +1316,9 @@ st = new WeakSet(), qe = function() {
1316
1316
  />
1317
1317
  <img src="${J || ""}" alt="" />
1318
1318
  </picture>
1319
- </div>`, U.insertAdjacentHTML(L.prepend, _);
1320
- const Ue = y.querySelectorAll("[video-target]");
1321
- Ue.length > 0 && new X(Ue, {
1319
+ </div>`, F.insertAdjacentHTML(L.prepend, k);
1320
+ const Qe = y.querySelectorAll("[video-target]");
1321
+ Qe.length > 0 && new X(Qe, {
1322
1322
  LAYOUT: t.params.LAYOUT,
1323
1323
  videoLayoutNo: t.params.videoLayoutNo
1324
1324
  });
@@ -1328,7 +1328,7 @@ st = new WeakSet(), qe = function() {
1328
1328
  },
1329
1329
  close(y) {
1330
1330
  const S = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1331
- Ni([...S]), e == null || e.emit("closeModal");
1331
+ Bi([...S]), e == null || e.emit("closeModal");
1332
1332
  },
1333
1333
  destroy(y) {
1334
1334
  }
@@ -1339,13 +1339,13 @@ st = new WeakSet(), qe = function() {
1339
1339
  if (t.params.videoAutoplay = "on", r == "off") {
1340
1340
  if (s.querySelector("video-player"))
1341
1341
  return;
1342
- s.innerHTML = ft(t.params);
1342
+ s.innerHTML = vt(t.params);
1343
1343
  return;
1344
1344
  } else {
1345
- (s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", ft(t.params));
1345
+ (s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", vt(t.params));
1346
1346
  return;
1347
1347
  }
1348
- }, Gt = new WeakSet(), Bi = function(i) {
1348
+ }, Rt = new WeakSet(), Ri = function(i) {
1349
1349
  const t = this.options;
1350
1350
  return {
1351
1351
  $selector: i,
@@ -1365,11 +1365,11 @@ st = new WeakSet(), qe = function() {
1365
1365
  videoInboxImg: i.getAttribute("video-inbox-img") || t.videoInboxImgHtml,
1366
1366
  LAYOUT: t.LAYOUT || []
1367
1367
  };
1368
- }, Je(X, "globalOptions", {});
1369
- let Ie = X;
1370
- Object.assign(Ie.prototype, z);
1371
- customElements.define("video-player", Fs);
1372
- const Qs = {
1368
+ }, Ke(X, "globalOptions", {});
1369
+ let qe = X;
1370
+ Object.assign(qe.prototype, z);
1371
+ customElements.define("video-player", Js);
1372
+ const Vs = {
1373
1373
  "zh-tw": {
1374
1374
  臺北市: [
1375
1375
  ["中正區", "100"],
@@ -2200,8 +2200,8 @@ const Qs = {
2200
2200
  }
2201
2201
  };
2202
2202
  let K;
2203
- const Ks = (n) => {
2204
- const { TEMPLATE: i } = Ye, { 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");
2203
+ const tn = (n) => {
2204
+ const { TEMPLATE: i } = Je, { 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");
2205
2205
  e.innerHTML = i(
2206
2206
  s,
2207
2207
  o,
@@ -2214,7 +2214,7 @@ const Ks = (n) => {
2214
2214
  (!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
2215
2215
  }) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
2216
2216
  }), e.children[0];
2217
- }, Vs = (n) => {
2217
+ }, en = (n) => {
2218
2218
  var t;
2219
2219
  const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
2220
2220
  i && i.forEach((e) => {
@@ -2222,7 +2222,7 @@ const Ks = (n) => {
2222
2222
  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 && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
2223
2223
  });
2224
2224
  }, I = (n, i) => {
2225
- const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
2225
+ const t = n.getAttribute("d4-placeholder"), e = n.s.dropdownEl.querySelectorAll(".dropdown-list li");
2226
2226
  if (i < 0 || i.length === 0) {
2227
2227
  switch (e.forEach((s) => {
2228
2228
  s.classList.remove("active");
@@ -2259,7 +2259,7 @@ const Ks = (n) => {
2259
2259
  Array.isArray(i) && n.s.allLi.forEach((r) => {
2260
2260
  i.indexOf([...n.s.allLi].indexOf(r)) >= 0 ? r.classList.add("active") : r.classList.remove("active");
2261
2261
  });
2262
- const o = n.querySelectorAll(".dropdown-list li.active");
2262
+ const o = n.s.dropdownEl.querySelectorAll(".dropdown-list li.active");
2263
2263
  o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
2264
2264
  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>`;
2265
2265
  n.s.selectDisplayEl.insertAdjacentHTML(L.append, u);
@@ -2273,40 +2273,42 @@ const Ks = (n) => {
2273
2273
  break;
2274
2274
  }
2275
2275
  }
2276
- }, tn = (n) => {
2276
+ }, sn = (n) => {
2277
2277
  const i = n.s.cityLang;
2278
- f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (K = JSON.parse(f("#newCityData").val())[0], console.log([0])) : K = Qs, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(K[i]).forEach((t) => {
2278
+ f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (K = JSON.parse(f("#newCityData").val())[0], console.log([0])) : K = Vs, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(K[i]).forEach((t) => {
2279
2279
  const e = document.createElement("li");
2280
2280
  e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
2281
- }), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
2282
- }, en = (n, i) => {
2281
+ }), n.s.allLi = n.s.dropdownEl.querySelectorAll(".dropdown-list li"));
2282
+ }, nn = (n, i) => {
2283
2283
  const t = n.s.cityLang;
2284
2284
  K[t][i].forEach((e, s) => {
2285
2285
  const o = document.createElement("li");
2286
- o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
2286
+ o.textContent = e[0], o.setAttribute("data-option", e[0]), n.s.dropdownEl.querySelector(".dropdown-list").append(o);
2287
2287
  });
2288
- }, Wi = () => {
2289
- k('dropdown-el[d4-status="open"]').forEach((i) => {
2288
+ }, ze = () => {
2289
+ D('dropdown-el[d4-status="open"]').forEach((i) => {
2290
2290
  i.close();
2291
2291
  });
2292
- }, sn = () => {
2293
- const { SETTINGS: n } = Ye;
2292
+ }, on = () => {
2293
+ const { SETTINGS: n } = Je;
2294
2294
  ((t, e) => {
2295
2295
  Object.keys(e).forEach((s) => {
2296
2296
  t.style.setProperty(`--${s}`, e[s]);
2297
2297
  });
2298
2298
  })(document.documentElement, n.scrollbar);
2299
2299
  };
2300
- sn();
2300
+ on();
2301
2301
  document.addEventListener("click", function() {
2302
- Wi();
2302
+ ze();
2303
2303
  });
2304
- var Rt, Ri, Xt, Xi, Yt, Yi, Ft, Fi;
2305
- class Gi extends HTMLElement {
2304
+ var Xt, Ui, Ut, Yi, rt, Be, Yt, Fi, Ft, Ji;
2305
+ class Xi extends HTMLElement {
2306
2306
  constructor() {
2307
2307
  super();
2308
- h(this, Rt);
2309
2308
  h(this, Xt);
2309
+ h(this, Ut);
2310
+ // -** 獨立 dropdown 出 body 更新
2311
+ h(this, rt);
2310
2312
  h(this, Yt);
2311
2313
  h(this, Ft);
2312
2314
  this.initialize = !1;
@@ -2328,13 +2330,13 @@ class Gi extends HTMLElement {
2328
2330
  if (s !== "")
2329
2331
  switch (o.hasAttribute("multiple") ? "multiple" : "single") {
2330
2332
  case "single":
2331
- const r = o.querySelector(`.dropdown-list li[data-option="${s}"]`);
2333
+ const r = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${s}"]`);
2332
2334
  A(r) ? I(o, [...o.s.allLi].indexOf(r)) : I(o, -1);
2333
2335
  break;
2334
2336
  case "multiple":
2335
2337
  const l = [];
2336
- o.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
2337
- const p = o.querySelector(`.dropdown-list li[data-option="${u}"]`);
2338
+ o.s.dropdownEl.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
2339
+ const p = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${u}"]`);
2338
2340
  A(p) && (p.classList.add("active"), l.push(p));
2339
2341
  });
2340
2342
  const c = l.map((u) => [...o.s.allLi].indexOf(u));
@@ -2354,20 +2356,37 @@ class Gi extends HTMLElement {
2354
2356
  }
2355
2357
  connectedCallback() {
2356
2358
  const t = this;
2357
- t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Rt, Ri).call(this));
2359
+ t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Xt, Ui).call(this));
2360
+ }
2361
+ disconnectedCallback() {
2362
+ this.s && this.s.dropdownEl && this.s.dropdownEl.parentNode === document.body && document.body.removeChild(this.s.dropdownEl);
2358
2363
  }
2359
2364
  open() {
2360
- 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;
2361
- return Wi(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
2362
- height: ${o()}px;
2363
- z-index: 2;
2364
- `, this;
2365
+ const t = this;
2366
+ let e;
2367
+ t.getAttribute("d4-portal") == "true" ? (ze(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
2368
+ const s = t.classList.contains("filter"), o = () => {
2369
+ if (t.getAttribute("d4-portal") == "true") {
2370
+ if (s)
2371
+ return t.s.dropdownEl.querySelector(".dropdown-scroller .filter-bar") ? e : t.s.dropdownEl.querySelector(".filter-bar").clientHeight + e;
2372
+ } else if (s)
2373
+ return t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e;
2374
+ return e;
2375
+ };
2376
+ return !t.getAttribute("d4-portal") == "true" && ze(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${o()}px`), t.s.dropdownEl.style.zIndex = "9999", d(this, rt, Be).call(this), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${o()}px`, t.__events__._scrollUpdate = () => {
2377
+ var r;
2378
+ const a = t.getBoundingClientRect();
2379
+ a.bottom < 0 || a.top > window.innerHeight ? t.close() : d(r = t, rt, Be).call(r);
2380
+ }, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
2381
+ height: ${o()}px;
2382
+ z-index: 2;
2383
+ `), this;
2365
2384
  }
2366
2385
  close() {
2367
2386
  const t = this, e = t.s.dropdownEl.querySelectorAll(".has-sublayer"), s = parseInt(t.getAttribute("d4-default-height"));
2368
- return t.setAttribute("d4-status", "close"), t.s.dropdownEl.style.height = "0px", e.forEach((o) => {
2387
+ return t.setAttribute("d4-status", "close"), t.s.dropdownEl.style.height = "0px", t.getAttribute("d4-portal") == "true" && t.__events__._scrollUpdate && (window.removeEventListener("scroll", t.__events__._scrollUpdate, { capture: !0 }), window.removeEventListener("resize", t.__events__._scrollUpdate)), e.forEach((o) => {
2369
2388
  o.classList.remove("open");
2370
- }), t.style.cssText = `--maxHeight: ${s}px;`, t.s.subDropdownTotalH = 0, t.classList.contains("filter") && t.querySelector(".filter-input") && (t.querySelector(".filter-input").value = "", t.s.allLi.forEach((o) => o.removeAttribute("style"))), this;
2389
+ }), t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.style.setProperty("--maxHeight", `${s}px`) : t.style.cssText = `--maxHeight: ${s}px;`, t.s.subDropdownTotalH = 0, t.classList.contains("filter") && t.s.dropdownEl.querySelector(".filter-input") && (t.s.dropdownEl.querySelector(".filter-input").value = "", t.s.allLi.forEach((o) => o.removeAttribute("style"))), this;
2371
2390
  }
2372
2391
  scrollTo(t) {
2373
2392
  const e = this, { viewport: s } = e.__scroller__.elements();
@@ -2380,14 +2399,19 @@ class Gi extends HTMLElement {
2380
2399
  this.__events__.selectOption();
2381
2400
  }
2382
2401
  }
2383
- Rt = new WeakSet(), Ri = function() {
2384
- this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Xt, Xi).call(this);
2385
- }, Xt = new WeakSet(), Xi = function() {
2386
- this.s.childDom = this.childNodes, this.s.template = Ks(this), this.innerHTML = "", this.append(this.s.template), d(this, Yt, Yi).call(this);
2387
- }, Yt = new WeakSet(), Yi = function() {
2402
+ Xt = new WeakSet(), Ui = function() {
2403
+ this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Ut, Yi).call(this);
2404
+ }, Ut = new WeakSet(), Yi = function() {
2405
+ this.s.childDom = this.childNodes, this.s.template = tn(this), this.innerHTML = "", this.append(this.s.template), this.s.dropdownEl = this.querySelector(".dropdown"), this.getAttribute("d4-portal") === "true" && (this.s.dropdownEl.setAttribute("data-d4-portal", ""), document.body.appendChild(this.s.dropdownEl)), d(this, Yt, Fi).call(this);
2406
+ }, rt = new WeakSet(), Be = function() {
2407
+ const t = this, e = t.getBoundingClientRect(), s = t.s.dropdownEl;
2408
+ s.style.position = "fixed", s.style.overflow = "hidden", s.style.left = `${e.left}px`, s.style.width = `${e.width}px`;
2409
+ const o = parseInt(s.style.height) || s.scrollHeight;
2410
+ window.innerHeight - e.bottom < o && e.top > o ? s.style.top = `${e.top - o}px` : s.style.top = `${e.bottom}px`;
2411
+ }, Yt = new WeakSet(), Fi = function() {
2388
2412
  var s;
2389
2413
  const t = this;
2390
- 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", tn(t), t.s.subDropdownTotalH = 0;
2414
+ t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", sn(t), t.s.subDropdownTotalH = 0;
2391
2415
  const e = t.getAttribute("d4-value");
2392
2416
  switch (t.s.selectType) {
2393
2417
  case "single":
@@ -2396,9 +2420,9 @@ Rt = new WeakSet(), Ri = function() {
2396
2420
  const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
2397
2421
  if (r && l) {
2398
2422
  const c = r.getAttribute("d4-value");
2399
- if (en(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2423
+ if (nn(t, c), t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2400
2424
  const u = e.split(",")[1];
2401
- o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
2425
+ o = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
2402
2426
  }
2403
2427
  }
2404
2428
  } else
@@ -2416,7 +2440,7 @@ Rt = new WeakSet(), Ri = function() {
2416
2440
  case "multiple":
2417
2441
  const a = [];
2418
2442
  e.split(",").forEach((r) => {
2419
- const l = t.querySelector(`.dropdown-list li[data-option="${r}"]`);
2443
+ const l = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${r}"]`);
2420
2444
  A(l) && a.push(l);
2421
2445
  }), a.length > 0 ? t.s.value = {
2422
2446
  index: a.map((r) => [...t.s.allLi].indexOf(r)),
@@ -2429,8 +2453,8 @@ Rt = new WeakSet(), Ri = function() {
2429
2453
  };
2430
2454
  break;
2431
2455
  }
2432
- I(t, t.s.value.index), d(s = t, Ft, Fi).call(s), t.classList.add("d4-initialize");
2433
- }, Ft = new WeakSet(), Fi = function() {
2456
+ I(t, t.s.value.index), d(s = t, Ft, Ji).call(s), t.classList.add("d4-initialize");
2457
+ }, Ft = new WeakSet(), Ji = function() {
2434
2458
  const t = this;
2435
2459
  t.__events__.dropdownToggle = () => {
2436
2460
  t.addEventListener("click", function(e) {
@@ -2449,7 +2473,7 @@ Rt = new WeakSet(), Ri = function() {
2449
2473
  const o = t.getAttribute("d4-status"), a = t.classList.contains("filter");
2450
2474
  switch (o) {
2451
2475
  case "open":
2452
- const r = t.querySelector(".dropdown-scroller"), l = () => {
2476
+ const r = t.s.dropdownEl.querySelector(".dropdown-scroller"), l = () => {
2453
2477
  if (t.__scroller__) {
2454
2478
  const { viewport: c } = t.__scroller__.elements();
2455
2479
  if (A(t.s.activeLi)) {
@@ -2465,26 +2489,26 @@ Rt = new WeakSet(), Ri = function() {
2465
2489
  });
2466
2490
  }
2467
2491
  };
2468
- a && (t.querySelector(".filter-bar input").disabled = !1, t.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
2492
+ a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
2469
2493
  break;
2470
2494
  case "close":
2471
- t.__scroller__.update(!0), t.s.dropdownEl.removeAttribute("style"), a && (t.querySelector(".filter-bar input").disabled = !0);
2495
+ t.getAttribute("d4-portal") == "true" ? (t.__scroller__ && t.__scroller__.update(!0), t.s.dropdownEl.style.height = "", t.s.dropdownEl.style.zIndex = "", a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !0), t.s.dropdownEl.parentNode === document.body && document.body.removeChild(t.s.dropdownEl)) : (t.__scroller__.update(!0), t.s.dropdownEl.removeAttribute("style"), a && (t.querySelector(".filter-bar input").disabled = !0));
2472
2496
  break;
2473
2497
  }
2474
2498
  }
2475
2499
  }
2476
2500
  t.s.dropdownEl.addEventListener("transitionend", e);
2477
2501
  }, t.__events__.bindScrollbar = (e = this) => {
2478
- const s = e.querySelector(".dropdown-scroller");
2479
- e.__scroller__ = Xe(s, {
2502
+ const s = e.s.dropdownEl.querySelector(".dropdown-scroller");
2503
+ e.__scroller__ = Fe(s, {
2480
2504
  overflowBehavior: {
2481
2505
  x: "hidden"
2482
2506
  }
2483
2507
  });
2484
2508
  }, t.__events__.selectOption = (e = this) => {
2485
2509
  let s, o;
2486
- const a = e.querySelector(".dropdown-scroller"), r = e.classList.contains("city");
2487
- e.s.allLi = e.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
2510
+ const a = e.s.dropdownEl.querySelector(".dropdown-scroller"), r = e.classList.contains("city");
2511
+ e.s.allLi = e.s.dropdownEl.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
2488
2512
  l.addEventListener("click", function(c) {
2489
2513
  var m;
2490
2514
  const u = this, p = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
@@ -2493,7 +2517,7 @@ Rt = new WeakSet(), Ri = function() {
2493
2517
  const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
2494
2518
  v.style.cssText = `--height: ${w.offsetHeight + b}px`;
2495
2519
  const T = parseInt(v.style.cssText.replace("--height:", "").trim()), C = parseInt(getComputedStyle(a).maxHeight), y = () => {
2496
- s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
2520
+ s = g + e.s.subDropdownTotalH, o = s > C ? C : s, e.getAttribute("d4-portal") == "true" ? e.s.dropdownEl.style.setProperty("--maxHeight", `${o}px`) : e.style.cssText = `--maxHeight: ${o}px;`, e.s.dropdownEl.style.height = `${o}px`;
2497
2521
  };
2498
2522
  u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
2499
2523
  const S = () => {
@@ -2501,16 +2525,16 @@ Rt = new WeakSet(), Ri = function() {
2501
2525
  };
2502
2526
  v.addEventListener("transitionend", S);
2503
2527
  } else
2504
- switch (Vs(e), e.s.selectType) {
2528
+ switch (en(e), e.s.selectType) {
2505
2529
  case "single":
2506
2530
  if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
2507
2531
  const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
2508
- b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1), K[v][w].forEach((T, C) => {
2532
+ b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "", I(b, -1), K[v][w].forEach((T, C) => {
2509
2533
  const y = document.createElement("li");
2510
- y.textContent = T[0], y.setAttribute("data-option", T[0]), b.querySelector(".dropdown-list").append(y);
2534
+ y.textContent = T[0], y.setAttribute("data-option", T[0]), e.getAttribute("d4-portal") == "true" ? b.s.dropdownEl.querySelector(".dropdown-list").append(y) : b.querySelector(".dropdown-list").append(y);
2511
2535
  }), e.__events__.selectOption(b));
2512
2536
  }
2513
- (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer") && (c.stopPropagation(), e.close());
2537
+ (e.getAttribute("d4-portal") == "true" || (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer")) && (c.stopPropagation(), e.close());
2514
2538
  break;
2515
2539
  case "multiple":
2516
2540
  c.stopPropagation(), u.classList.toggle("active"), I(e, p);
@@ -2519,9 +2543,9 @@ Rt = new WeakSet(), Ri = function() {
2519
2543
  });
2520
2544
  });
2521
2545
  }, t.__events__.filterHandler = () => {
2522
- t.classList.contains("filter") && (t.querySelector(".filter-bar").addEventListener("click", function(e) {
2546
+ t.classList.contains("filter") && (t.s.dropdownEl.querySelector(".filter-bar").addEventListener("click", function(e) {
2523
2547
  e.stopPropagation();
2524
- }), t.querySelector(".filter-input").addEventListener("input", function() {
2548
+ }), t.s.dropdownEl.querySelector(".filter-input").addEventListener("input", function() {
2525
2549
  const e = this.value.toUpperCase();
2526
2550
  t.s.allLi.forEach((s) => {
2527
2551
  s.textContent.toUpperCase().includes(e) ? s.removeAttribute("style") : s.style.display = "none";
@@ -2533,7 +2557,7 @@ Rt = new WeakSet(), Ri = function() {
2533
2557
  return;
2534
2558
  if ((e.target.classList.contains("option-btn") ? e.target : e.target.parentElement).contains(e.target) && (e.stopPropagation(), e.target.classList.contains("remove-icon"))) {
2535
2559
  const a = e.target.parentElement.getAttribute("data-option");
2536
- t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${a}"]`).classList.remove("active"), t.s.activeLi = t.querySelectorAll(".dropdown-list li.active"), e.target.parentElement.remove();
2560
+ t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${a}"]`).classList.remove("active"), t.s.activeLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li.active"), e.target.parentElement.remove();
2537
2561
  const r = [...t.s.activeLi];
2538
2562
  t.s.value = r.map((c) => ({
2539
2563
  index: [...t.s.allLi].indexOf(c),
@@ -2544,11 +2568,11 @@ Rt = new WeakSet(), Ri = function() {
2544
2568
  t.setAttribute("d4-value", l.join()), r.length <= 0 && (t.s.selectDisplayEl.textContent = t.getAttribute("d4-placeholder").trim());
2545
2569
  }
2546
2570
  });
2547
- }, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
2571
+ }, t.__events__.dropdownToggle(), t.getAttribute("d4-portal") != "true" && t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
2548
2572
  };
2549
- Object.assign(Gi.prototype, z);
2550
- customElements.define("dropdown-el", Gi);
2551
- function bt(n) {
2573
+ Object.assign(Xi.prototype, z);
2574
+ customElements.define("dropdown-el", Xi);
2575
+ function yt(n) {
2552
2576
  const i = {};
2553
2577
  return [...n.attributes].forEach((t) => {
2554
2578
  if (t.name.includes("duration-")) {
@@ -2557,10 +2581,10 @@ function bt(n) {
2557
2581
  }
2558
2582
  }), Object.keys(i).length === 0 ? null : i;
2559
2583
  }
2560
- function ti(n) {
2561
- if (bt(n)) {
2584
+ function si(n) {
2585
+ if (yt(n)) {
2562
2586
  let i;
2563
- const t = Object.keys(bt(n)).map((e) => ({
2587
+ const t = Object.keys(yt(n)).map((e) => ({
2564
2588
  value: e,
2565
2589
  point: e
2566
2590
  }));
@@ -2569,11 +2593,11 @@ function ti(n) {
2569
2593
  const { point: s, value: o } = t[e];
2570
2594
  window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
2571
2595
  }
2572
- return i ? Number(bt(n)[i]) : n.s.options.duration;
2596
+ return i ? Number(yt(n)[i]) : n.s.options.duration;
2573
2597
  } else
2574
2598
  return n.s.options.duration;
2575
2599
  }
2576
- function nn(n) {
2600
+ function an(n) {
2577
2601
  const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
2578
2602
  o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
2579
2603
  a.append(l);
@@ -2640,20 +2664,20 @@ function H(n) {
2640
2664
  }
2641
2665
  return s;
2642
2666
  }
2643
- function on(n) {
2667
+ function rn(n) {
2644
2668
  let i;
2645
2669
  return function(t) {
2646
2670
  i && clearTimeout(i), i = setTimeout(n, 200, t);
2647
2671
  };
2648
2672
  }
2649
- var Ut, Ui, Jt, Ji, Zt, Zi, Qt, Qi;
2650
- class an extends HTMLElement {
2673
+ var Jt, Zi, Zt, Qi, Qt, Ki, Kt, Vi;
2674
+ class ln extends HTMLElement {
2651
2675
  constructor() {
2652
2676
  super();
2653
- h(this, Ut);
2654
2677
  h(this, Jt);
2655
2678
  h(this, Zt);
2656
2679
  h(this, Qt);
2680
+ h(this, Kt);
2657
2681
  this.initialize = !1;
2658
2682
  }
2659
2683
  static get observedAttributes() {
@@ -2662,7 +2686,7 @@ class an extends HTMLElement {
2662
2686
  attributeChangedCallback(t, e, s) {
2663
2687
  }
2664
2688
  connectedCallback() {
2665
- this.initialize || (this.initialize = !0, d(this, Ut, Ui).call(this));
2689
+ this.initialize || (this.initialize = !0, d(this, Jt, Zi).call(this));
2666
2690
  }
2667
2691
  play() {
2668
2692
  this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
@@ -2671,7 +2695,7 @@ class an extends HTMLElement {
2671
2695
  this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
2672
2696
  }
2673
2697
  }
2674
- Ut = new WeakSet(), Ui = function() {
2698
+ Jt = new WeakSet(), Zi = function() {
2675
2699
  const t = {
2676
2700
  direction: this.getAttribute("direction") || M.SETTINGS.direction,
2677
2701
  // up / down / left / right
@@ -2679,7 +2703,7 @@ Ut = new WeakSet(), Ui = function() {
2679
2703
  // normal / alternate / endStop
2680
2704
  duration: Number(this.getAttribute("duration")) || M.SETTINGS.duration,
2681
2705
  // ms
2682
- durationBreakpoints: bt(this) || M.SETTINGS.durationBreakpoints,
2706
+ durationBreakpoints: yt(this) || M.SETTINGS.durationBreakpoints,
2683
2707
  autoplay: this.getAttribute("autoplay") || M.SETTINGS.autoplay,
2684
2708
  // normal / alternate / endStop
2685
2709
  pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : M.SETTINGS.pauseOnMouseenter,
@@ -2688,8 +2712,8 @@ Ut = new WeakSet(), Ui = function() {
2688
2712
  // true / false
2689
2713
  gap: Number(this.getAttribute("gap")) || M.SETTINGS.gap
2690
2714
  };
2691
- this.s = {}, this.s.options = t, this.s.nowDuration = ti(this), nn(this), d(this, Jt, Ji).call(this);
2692
- }, Jt = new WeakSet(), Ji = function() {
2715
+ this.s = {}, this.s.options = t, this.s.nowDuration = si(this), an(this), d(this, Zt, Qi).call(this);
2716
+ }, Zt = new WeakSet(), Qi = function() {
2693
2717
  const { direction: t, continual: e, gap: s } = this.s.options;
2694
2718
  switch (t) {
2695
2719
  case "left":
@@ -2701,8 +2725,8 @@ Ut = new WeakSet(), Ui = function() {
2701
2725
  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;`;
2702
2726
  break;
2703
2727
  }
2704
- d(this, Zt, Zi).call(this), d(this, Qt, Qi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
2705
- }, Zt = new WeakSet(), Zi = function() {
2728
+ d(this, Qt, Ki).call(this), d(this, Kt, Vi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
2729
+ }, Qt = new WeakSet(), Ki = function() {
2706
2730
  const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
2707
2731
  let c;
2708
2732
  function u() {
@@ -2767,11 +2791,11 @@ Ut = new WeakSet(), Ui = function() {
2767
2791
  }), t.addEventListener("mouseleave", function() {
2768
2792
  t.s.animation && r && t.s.animation.playState === "paused" && t.play();
2769
2793
  });
2770
- }, Qt = new WeakSet(), Qi = function() {
2794
+ }, Kt = new WeakSet(), Vi = function() {
2771
2795
  const t = this;
2772
2796
  function e() {
2773
2797
  const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
2774
- t.s.nowDuration = ti(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
2798
+ t.s.nowDuration = si(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
2775
2799
  duration: t.s.nowDuration,
2776
2800
  iterations: 1 / 0
2777
2801
  }), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
@@ -2780,16 +2804,16 @@ Ut = new WeakSet(), Ui = function() {
2780
2804
  iterations: 1 / 0
2781
2805
  }), t.s.cloneAnimation.startTime = o);
2782
2806
  }
2783
- window.addEventListener("resize", on(e));
2807
+ window.addEventListener("resize", rn(e));
2784
2808
  };
2785
- customElements.define("marquee-el", an);
2786
- const ei = function(n, i) {
2809
+ customElements.define("marquee-el", ln);
2810
+ const ni = function(n, i) {
2787
2811
  let t;
2788
2812
  return function(e) {
2789
2813
  t && clearTimeout(t), t = setTimeout(n, 200, e);
2790
2814
  };
2791
2815
  }, x = (n, i) => {
2792
- if (mt(n)) {
2816
+ if (gt(n)) {
2793
2817
  n.forEach((t) => {
2794
2818
  t.classList.add(i);
2795
2819
  });
@@ -2797,7 +2821,7 @@ const ei = function(n, i) {
2797
2821
  }
2798
2822
  n.classList.add(i);
2799
2823
  }, $ = (n, i) => {
2800
- if (mt(n)) {
2824
+ if (gt(n)) {
2801
2825
  n.forEach((t) => {
2802
2826
  t.classList.remove(i);
2803
2827
  });
@@ -2805,22 +2829,22 @@ const ei = function(n, i) {
2805
2829
  }
2806
2830
  n.classList.remove(i);
2807
2831
  };
2808
- var Kt, Ki, Vt, Vi, te, ts, rt, je, Y, yt, ee, es;
2809
- class ii {
2832
+ var Vt, ts, te, es, ee, is, lt, We, U, wt, ie, ss;
2833
+ class oi {
2810
2834
  constructor(i) {
2811
2835
  // 初始化
2812
- h(this, Kt);
2813
- // 左右箭頭事件綁定
2814
2836
  h(this, Vt);
2815
- // 左右拖拉事件綁定
2837
+ // 左右箭頭事件綁定
2816
2838
  h(this, te);
2839
+ // 左右拖拉事件綁定
2840
+ h(this, ee);
2817
2841
  // 卷軸位置判斷
2818
- h(this, rt);
2842
+ h(this, lt);
2819
2843
  // 隱藏按鈕判斷
2820
- h(this, Y);
2844
+ h(this, U);
2821
2845
  // 選項事件綁定
2822
- h(this, ee);
2823
- this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Kt, Ki).call(this);
2846
+ h(this, ie);
2847
+ this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, Vt, ts).call(this);
2824
2848
  }
2825
2849
  // 更新 active 位置
2826
2850
  update(i = !1) {
@@ -2841,7 +2865,7 @@ class ii {
2841
2865
  s();
2842
2866
  }
2843
2867
  }
2844
- Kt = new WeakSet(), Ki = function() {
2868
+ Vt = new WeakSet(), ts = function() {
2845
2869
  var s, o, a, r;
2846
2870
  const i = this;
2847
2871
  if (!i.$element)
@@ -2850,10 +2874,10 @@ Kt = new WeakSet(), Ki = function() {
2850
2874
  let t = !1;
2851
2875
  const e = () => {
2852
2876
  t || (requestAnimationFrame(() => {
2853
- d(this, rt, je).call(this), d(this, Y, yt).call(this), t = !1;
2877
+ d(this, lt, We).call(this), d(this, U, wt).call(this), t = !1;
2854
2878
  }), t = !0);
2855
2879
  };
2856
- 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, te, ts).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
2880
+ i.$wrapper.removeEventListener("scroll", e), i.$wrapper.addEventListener("scroll", e), window.removeEventListener("resize", e), window.addEventListener("resize", e), (i.option.draggable || i.$element.s.type == "collapse") && d(s = i, ee, is).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
2857
2881
  L.prepend,
2858
2882
  `<div class="navigation">
2859
2883
  <div class="button prev">
@@ -2863,10 +2887,10 @@ Kt = new WeakSet(), Ki = function() {
2863
2887
  <div></div>
2864
2888
  </div>
2865
2889
  </div>`
2866
- ), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Vt, Vi).call(a)), d(r = i, ee, es).call(r), i.update(!0), requestAnimationFrame(() => {
2867
- d(this, rt, je).call(this), d(this, Y, yt).call(this);
2890
+ ), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, te, es).call(a)), d(r = i, ie, ss).call(r), i.update(!0), requestAnimationFrame(() => {
2891
+ d(this, lt, We).call(this), d(this, U, wt).call(this);
2868
2892
  });
2869
- }, Vt = new WeakSet(), Vi = function() {
2893
+ }, te = new WeakSet(), es = function() {
2870
2894
  const i = this, { $wrapper: t, $button: e } = i, s = function() {
2871
2895
  const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
2872
2896
  t.scrollTo({
@@ -2874,13 +2898,13 @@ Kt = new WeakSet(), Ki = function() {
2874
2898
  behavior: "smooth"
2875
2899
  }), setTimeout(() => {
2876
2900
  var r;
2877
- d(r = i, Y, yt).call(r);
2901
+ d(r = i, U, wt).call(r);
2878
2902
  }, 100);
2879
2903
  };
2880
2904
  e.forEach((o) => {
2881
2905
  o.removeEventListener("click", s), o.addEventListener("click", s);
2882
2906
  });
2883
- }, te = new WeakSet(), ts = function() {
2907
+ }, ee = new WeakSet(), is = function() {
2884
2908
  const { $wrapper: i } = this;
2885
2909
  let t = !1, e = !1, s = 0, o = 0;
2886
2910
  const a = function(p) {
@@ -2910,10 +2934,10 @@ Kt = new WeakSet(), Ki = function() {
2910
2934
  i.querySelectorAll("a").forEach((p) => {
2911
2935
  p.removeEventListener("click", u), p.addEventListener("click", u);
2912
2936
  });
2913
- }, rt = new WeakSet(), je = function() {
2937
+ }, lt = new WeakSet(), We = function() {
2914
2938
  const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
2915
2939
  e <= 0 || (x(i, "scrollable"), s == 0 ? (x(t, "start"), $(t, "end")) : s + 1 >= e ? ($(t, "start"), x(t, "end")) : (x(t, "center"), $(t, "start"), $(t, "end")));
2916
- }, Y = new WeakSet(), yt = function() {
2940
+ }, U = new WeakSet(), wt = function() {
2917
2941
  const { $wrapper: i, $button: t, $element: e } = this;
2918
2942
  if (!t)
2919
2943
  return;
@@ -2935,7 +2959,7 @@ Kt = new WeakSet(), Ki = function() {
2935
2959
  }
2936
2960
  $(a, "hide");
2937
2961
  }) : $(t, "hide");
2938
- }, ee = new WeakSet(), es = function() {
2962
+ }, ie = new WeakSet(), ss = function() {
2939
2963
  const { $element: i } = this, t = (s) => {
2940
2964
  if (this.option.selected) {
2941
2965
  const o = s.getAttribute("data-option").trim();
@@ -2949,31 +2973,31 @@ Kt = new WeakSet(), Ki = function() {
2949
2973
  s.removeEventListener("click", e), s.addEventListener("click", e);
2950
2974
  });
2951
2975
  };
2952
- var ie, is, se, ss, ne, ns, oe, os;
2953
- class rn {
2976
+ var se, ns, ne, os, oe, as, ae, rs;
2977
+ class cn {
2954
2978
  constructor(i) {
2955
2979
  // 初始化
2956
- h(this, ie);
2957
- // 隱藏按鈕判斷
2958
2980
  h(this, se);
2959
- // 展開箭頭事件綁定
2981
+ // 隱藏按鈕判斷
2960
2982
  h(this, ne);
2961
- // 選項事件綁定
2983
+ // 展開箭頭事件綁定
2962
2984
  h(this, oe);
2963
- this.$element = i, this.option = i.s.option.collapse, d(this, ie, is).call(this);
2985
+ // 選項事件綁定
2986
+ h(this, ae);
2987
+ this.$element = i, this.option = i.s.option.collapse, d(this, se, ns).call(this);
2964
2988
  }
2965
2989
  }
2966
- ie = new WeakSet(), is = function() {
2967
- this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, se, ss).call(this) && d(this, ne, ns).call(this), d(this, oe, os).call(this));
2968
- }, se = new WeakSet(), ss = function() {
2990
+ se = new WeakSet(), ns = function() {
2991
+ this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, ne, os).call(this) && d(this, oe, as).call(this), d(this, ae, rs).call(this));
2992
+ }, ne = new WeakSet(), os = function() {
2969
2993
  const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
2970
2994
  return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(L.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), $(this.$element, "noScrollable"), !0) : (x(this.$element, "noScrollable"), !1);
2971
- }, ne = new WeakSet(), ns = function() {
2995
+ }, oe = new WeakSet(), as = function() {
2972
2996
  const { $element: i, $button: t } = this, e = function() {
2973
2997
  i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
2974
2998
  };
2975
2999
  t.removeEventListener("click", e), t.addEventListener("click", e);
2976
- }, oe = new WeakSet(), os = function() {
3000
+ }, ae = new WeakSet(), rs = function() {
2977
3001
  const { $element: i } = this, t = (s, o) => {
2978
3002
  if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
2979
3003
  const a = s.getAttribute("data-option").trim();
@@ -2987,20 +3011,20 @@ ie = new WeakSet(), is = function() {
2987
3011
  s.removeEventListener("click", e), s.addEventListener("click", e);
2988
3012
  });
2989
3013
  };
2990
- const ln = (n) => {
3014
+ const dn = (n) => {
2991
3015
  const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
2992
3016
  return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(L.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(L.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(L.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(L.append, e)), s.children;
2993
3017
  };
2994
- var ae, as, re, rs, lt, ze, F, wt;
2995
- class cn extends HTMLElement {
3018
+ var re, ls, le, cs, ct, Ge, Y, Tt;
3019
+ class un extends HTMLElement {
2996
3020
  constructor() {
2997
3021
  super();
2998
- h(this, ae);
2999
3022
  h(this, re);
3023
+ h(this, le);
3000
3024
  // 斷點設定
3001
- h(this, lt);
3025
+ h(this, ct);
3002
3026
  // check type
3003
- h(this, F);
3027
+ h(this, Y);
3004
3028
  this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
3005
3029
  }
3006
3030
  static get observedAttributes() {
@@ -3012,7 +3036,7 @@ class cn extends HTMLElement {
3012
3036
  case "m4-type":
3013
3037
  if (e === null || e === s)
3014
3038
  return;
3015
- this.s.type = s, d(this, F, wt).call(this);
3039
+ this.s.type = s, d(this, Y, Tt).call(this);
3016
3040
  break;
3017
3041
  case "m4-status":
3018
3042
  if (e === s)
@@ -3029,13 +3053,13 @@ class cn extends HTMLElement {
3029
3053
  }
3030
3054
  }
3031
3055
  connectedCallback() {
3032
- this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, ae, as).call(this));
3056
+ this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, re, ls).call(this));
3033
3057
  }
3034
3058
  update() {
3035
- d(this, lt, ze).call(this);
3059
+ d(this, ct, Ge).call(this);
3036
3060
  }
3037
3061
  }
3038
- ae = new WeakSet(), as = function() {
3062
+ re = new WeakSet(), ls = function() {
3039
3063
  let t = {};
3040
3064
  this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? q.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
3041
3065
  const e = (s) => {
@@ -3046,84 +3070,84 @@ ae = new WeakSet(), as = function() {
3046
3070
  }
3047
3071
  this.update();
3048
3072
  };
3049
- window.removeEventListener("resize", ei(e)), window.addEventListener("resize", ei(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, re, rs).call(this);
3050
- }, re = new WeakSet(), rs = function() {
3051
- this.classList.add("m4-init"), d(this, lt, ze).call(this);
3052
- }, lt = new WeakSet(), ze = function() {
3073
+ window.removeEventListener("resize", ni(e)), window.addEventListener("resize", ni(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, le, cs).call(this);
3074
+ }, le = new WeakSet(), cs = function() {
3075
+ this.classList.add("m4-init"), d(this, ct, Ge).call(this);
3076
+ }, ct = new WeakSet(), Ge = function() {
3053
3077
  const t = Object.keys(this.s.option.breakpoint);
3054
3078
  if (!t.length) {
3055
- d(this, F, wt).call(this);
3079
+ d(this, Y, Tt).call(this);
3056
3080
  return;
3057
3081
  }
3058
3082
  t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
3059
3083
  var s, o, a, r;
3060
- 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, F, wt).call(this), window.innerWidth >= e;
3084
+ 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, Y, Tt).call(this), window.innerWidth >= e;
3061
3085
  });
3062
- }, F = new WeakSet(), wt = function() {
3086
+ }, Y = new WeakSet(), Tt = function() {
3063
3087
  var o;
3064
3088
  const { type: t } = this.s;
3065
- this.innerHTML = "", [...ln(this)].forEach((a) => {
3089
+ this.innerHTML = "", [...dn(this)].forEach((a) => {
3066
3090
  this.append(a);
3067
3091
  });
3068
3092
  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")}"]`);
3069
3093
  switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
3070
3094
  case "drag":
3071
- this.drag = new ii(this);
3095
+ this.drag = new oi(this);
3072
3096
  break;
3073
3097
  case "collapse":
3074
- this.drag = new ii(this), this.collapse = new rn(this);
3098
+ this.drag = new oi(this), this.collapse = new cn(this);
3075
3099
  break;
3076
3100
  }
3077
3101
  (o = this.drag) == null || o.update();
3078
3102
  };
3079
- customElements.define("multipurpose-nav", cn);
3080
- var le, cs, ce, ds, ct, Be, W, Z, de, us, ue, hs, he, ps, pe, ms, me, gs, ge, fs, fe, vs, ve, bs, be, ys, N, R, ye, ws, we, Ts, Te, Es, Ee, As;
3081
- class ls extends HTMLElement {
3103
+ customElements.define("multipurpose-nav", un);
3104
+ var ce, us, de, hs, dt, Re, W, Z, ue, ps, he, ms, pe, gs, me, fs, ge, vs, fe, bs, ve, ys, be, ws, ye, Ts, N, R, we, Es, Te, As, Ee, Ls, Ae, Ss;
3105
+ class ds extends HTMLElement {
3082
3106
  // 定義組件的初始狀態
3083
3107
  constructor(t, e) {
3084
3108
  super();
3085
- h(this, le);
3086
3109
  h(this, ce);
3110
+ h(this, de);
3087
3111
  // 第一關 判斷數量以及id設定
3088
- h(this, ct);
3112
+ h(this, dt);
3089
3113
  // 第二關 id命名提醒
3090
3114
  h(this, W);
3091
- h(this, de);
3092
3115
  h(this, ue);
3093
3116
  h(this, he);
3117
+ h(this, pe);
3094
3118
  // 執行函式
3095
3119
  // 移動至指定位置
3096
- h(this, pe);
3097
- // 移動
3098
3120
  h(this, me);
3099
- // 步驟狀態
3121
+ // 移動
3100
3122
  h(this, ge);
3101
- // next 按鈕狀態
3123
+ // 步驟狀態
3102
3124
  h(this, fe);
3103
- // prev 按鈕狀態
3125
+ // next 按鈕狀態
3104
3126
  h(this, ve);
3105
- // 頁籤狀態
3127
+ // prev 按鈕狀態
3106
3128
  h(this, be);
3129
+ // 頁籤狀態
3130
+ h(this, ye);
3107
3131
  // 第三關各種元件判斷 及 執行
3108
3132
  h(this, N);
3109
3133
  // 消失動畫
3110
- h(this, ye);
3111
- // 出現動畫
3112
3134
  h(this, we);
3113
- // 狀態
3135
+ // 出現動畫
3114
3136
  h(this, Te);
3115
- // resize
3137
+ // 狀態
3116
3138
  h(this, Ee);
3139
+ // resize
3140
+ h(this, Ae);
3117
3141
  }
3118
3142
  // 當組件的屬性被更改時會被呼叫
3119
3143
  static get observedAttributes() {
3120
3144
  return ["t4-active"];
3121
3145
  }
3122
3146
  attributeChangedCallback(t, e, s) {
3123
- t === "t4-active" && e !== s && d(this, Te, Es).call(this, s);
3147
+ t === "t4-active" && e !== s && d(this, Ee, Ls).call(this, s);
3124
3148
  }
3125
3149
  connectedCallback() {
3126
- this.classList.contains("t4-initialize") || d(this, le, cs).call(this);
3150
+ this.classList.contains("t4-initialize") || d(this, ce, us).call(this);
3127
3151
  }
3128
3152
  // ------------- 我是分隔線呦 -------------
3129
3153
  // 頁籤切換
@@ -3139,7 +3163,7 @@ class ls extends HTMLElement {
3139
3163
  e.activeTab = s, this.setAttribute("t4-active", s);
3140
3164
  const o = d(this, W, Z).call(this, s);
3141
3165
  e.tabPanels.forEach((a, r) => {
3142
- r === o ? d(this, we, Ts).call(this, r) : d(this, ye, ws).call(this, r);
3166
+ r === o ? d(this, Te, As).call(this, r) : d(this, we, Es).call(this, r);
3143
3167
  });
3144
3168
  }
3145
3169
  // 外部呼叫方法 $0.goNext()
@@ -3154,11 +3178,11 @@ class ls extends HTMLElement {
3154
3178
  }
3155
3179
  // 外部呼叫方法 $0.update()
3156
3180
  update() {
3157
- this.t.tabs = d(this, ct, Be).call(this), Ls(), console.log("tab update!!!!");
3181
+ this.t.tabs = d(this, dt, Re).call(this), _s(), console.log("tab update!!!!");
3158
3182
  }
3159
3183
  }
3160
- le = new WeakSet(), cs = function() {
3161
- const t = this.getAttribute("t4-name"), { SETTINGS: e } = ri;
3184
+ ce = new WeakSet(), us = function() {
3185
+ const t = this.getAttribute("t4-name"), { SETTINGS: e } = di;
3162
3186
  document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
3163
3187
  tabs: [],
3164
3188
  name: t,
@@ -3177,14 +3201,14 @@ le = new WeakSet(), cs = function() {
3177
3201
  delay: this.getAttribute("t4-delay") || e.transition.delay
3178
3202
  },
3179
3203
  tabGroup: this.getAttribute("t4-group") || e.tabGroup
3180
- }, this.__events__ = {}, this.t.tabs = d(this, ct, Be).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ce, ds).call(this);
3181
- }, ce = new WeakSet(), ds = function() {
3182
- if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, de, us).call(this), this.t.recordUrl) {
3204
+ }, this.__events__ = {}, this.t.tabs = d(this, dt, Re).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, de, hs).call(this);
3205
+ }, de = new WeakSet(), hs = function() {
3206
+ if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ue, ps).call(this), this.t.recordUrl) {
3183
3207
  const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
3184
3208
  e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
3185
3209
  }
3186
- this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ee, As).call(this);
3187
- }, ct = new WeakSet(), Be = function() {
3210
+ this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, Ae, Ss).call(this);
3211
+ }, dt = new WeakSet(), Re = function() {
3188
3212
  const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
3189
3213
  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) => {
3190
3214
  s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
@@ -3194,19 +3218,19 @@ le = new WeakSet(), cs = function() {
3194
3218
  s.length > 1 && console.warn("有兩個相同id設定", s);
3195
3219
  const o = s[0];
3196
3220
  return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
3197
- }, de = new WeakSet(), us = function() {
3221
+ }, ue = new WeakSet(), ps = function() {
3198
3222
  const t = document.createElement("div");
3199
3223
  t.classList.add("swiper-container");
3200
3224
  const e = document.createElement("div");
3201
3225
  e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
3202
3226
  e.appendChild(s.cloneNode(!0));
3203
- }), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, ue, hs).call(this);
3204
- }, ue = new WeakSet(), hs = function() {
3227
+ }), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, he, ms).call(this);
3228
+ }, he = new WeakSet(), ms = function() {
3205
3229
  const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
3206
3230
  t.style.overflow = "hidden", e.style.display = "flex";
3207
3231
  const o = s.length * 100 + "%";
3208
3232
  e.style.width = o;
3209
- }, he = new WeakSet(), ps = function(t) {
3233
+ }, pe = new WeakSet(), gs = function(t) {
3210
3234
  const { t: e } = this;
3211
3235
  if (e.recordUrl === "true") {
3212
3236
  const s = new URLSearchParams(document.location.search);
@@ -3214,28 +3238,28 @@ le = new WeakSet(), cs = function() {
3214
3238
  const o = `${window.location.pathname}?${s.toString()}`;
3215
3239
  history.replaceState({ t4Id: t }, "", o);
3216
3240
  }
3217
- }, pe = new WeakSet(), ms = function() {
3241
+ }, me = new WeakSet(), fs = function() {
3218
3242
  const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
3219
- d(this, me, gs).call(this, o);
3220
- }, me = new WeakSet(), gs = function(t) {
3243
+ d(this, ge, vs).call(this, o);
3244
+ }, ge = new WeakSet(), vs = function(t) {
3221
3245
  window.scrollTo({
3222
3246
  top: t,
3223
3247
  behavior: "smooth"
3224
3248
  });
3225
- }, ge = new WeakSet(), fs = function(t) {
3249
+ }, fe = new WeakSet(), bs = function(t) {
3226
3250
  let e = parseInt(t, 10) + 1;
3227
3251
  this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
3228
- }, fe = new WeakSet(), vs = function(t) {
3252
+ }, ve = new WeakSet(), ys = function(t) {
3229
3253
  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;
3230
3254
  e.forEach((a) => {
3231
3255
  s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
3232
3256
  });
3233
- }, ve = new WeakSet(), bs = function(t) {
3257
+ }, be = new WeakSet(), ws = function(t) {
3234
3258
  const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
3235
3259
  e.forEach((a) => {
3236
3260
  s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
3237
3261
  });
3238
- }, be = new WeakSet(), ys = function(t, e) {
3262
+ }, ye = new WeakSet(), Ts = function(t, e) {
3239
3263
  this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
3240
3264
  o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
3241
3265
  }) : this.t.tabs.forEach((s, o) => {
@@ -3244,25 +3268,25 @@ le = new WeakSet(), cs = function() {
3244
3268
  }, N = new WeakSet(), R = function(t, e, s) {
3245
3269
  switch (t) {
3246
3270
  case "step":
3247
- xe(this.t.step) && d(this, ge, fs).call(this, e);
3271
+ $e(this.t.step) && d(this, fe, bs).call(this, e);
3248
3272
  break;
3249
3273
  case "eventAnchor":
3250
- this.t.anchor && d(this, pe, ms).call(this);
3274
+ this.t.anchor && d(this, me, fs).call(this);
3251
3275
  break;
3252
3276
  case "tabState":
3253
- this.t.type == "normal" && d(this, be, ys).call(this, e, s);
3277
+ this.t.type == "normal" && d(this, ye, Ts).call(this, e, s);
3254
3278
  break;
3255
3279
  case "btnState":
3256
- d(this, fe, vs).call(this, e), d(this, ve, bs).call(this, e);
3280
+ d(this, ve, ys).call(this, e), d(this, be, ws).call(this, e);
3257
3281
  break;
3258
3282
  case "tabUrl":
3259
- this.t.recordUrl === "true" && d(this, he, ps).call(this, e);
3283
+ this.t.recordUrl === "true" && d(this, pe, gs).call(this, e);
3260
3284
  break;
3261
3285
  default:
3262
3286
  console.warn("請增加判斷,謝謝");
3263
3287
  break;
3264
3288
  }
3265
- }, ye = new WeakSet(), ws = function(t) {
3289
+ }, we = new WeakSet(), Es = function(t) {
3266
3290
  const { t: e } = this;
3267
3291
  this.t.transition;
3268
3292
  const s = e.tabPanels[t];
@@ -3279,7 +3303,7 @@ le = new WeakSet(), cs = function() {
3279
3303
  s.style.display = "none";
3280
3304
  break;
3281
3305
  }
3282
- }, we = new WeakSet(), Ts = function(t) {
3306
+ }, Te = new WeakSet(), As = function(t) {
3283
3307
  const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
3284
3308
  let r;
3285
3309
  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) {
@@ -3304,25 +3328,25 @@ le = new WeakSet(), cs = function() {
3304
3328
  console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
3305
3329
  break;
3306
3330
  }
3307
- }, Te = new WeakSet(), Es = function(t) {
3331
+ }, Ee = new WeakSet(), Ls = function(t) {
3308
3332
  const e = d(this, W, Z).call(this, t);
3309
3333
  d(this, N, R).call(this, "step", e), d(this, N, R).call(this, "btnState", e), d(this, N, R).call(this, "tabState", e, t), d(this, N, R).call(this, "tabUrl", t), this.emit("change");
3310
- }, Ee = new WeakSet(), As = function() {
3334
+ }, Ae = new WeakSet(), Ss = function() {
3311
3335
  const t = this;
3312
3336
  window.addEventListener(
3313
3337
  "resize",
3314
- dn(() => {
3338
+ hn(() => {
3315
3339
  t.update();
3316
3340
  }, 1e3)
3317
3341
  );
3318
3342
  };
3319
- function dn(n, i = 1e3) {
3343
+ function hn(n, i = 1e3) {
3320
3344
  let t;
3321
3345
  return function(e) {
3322
3346
  t && clearTimeout(t), t = setTimeout(n, i, e);
3323
3347
  };
3324
3348
  }
3325
- function Ls() {
3349
+ function _s() {
3326
3350
  const n = document.querySelectorAll("[t4-control]");
3327
3351
  document.addEventListener("click", function(i) {
3328
3352
  let t = !1;
@@ -3352,91 +3376,91 @@ function Ls() {
3352
3376
  }
3353
3377
  });
3354
3378
  }
3355
- Ls();
3356
- Object.assign(ls.prototype, z);
3357
- customElements.define("tab-el", ls);
3358
- const si = (n) => {
3379
+ _s();
3380
+ Object.assign(ds.prototype, z);
3381
+ customElements.define("tab-el", ds);
3382
+ const ai = (n) => {
3359
3383
  const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
3360
3384
  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";
3361
- }, un = (n) => {
3385
+ }, pn = (n) => {
3362
3386
  const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
3363
3387
  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";
3364
3388
  };
3365
- var dt, We, Ae, Ss, Le, Ds, ut, Ge;
3366
- class hn {
3389
+ var ut, Xe, Le, Ds, Se, ks, ht, Ue;
3390
+ class mn {
3367
3391
  constructor(i, t = {}) {
3368
- h(this, dt);
3369
- h(this, Ae);
3370
- h(this, Le);
3371
3392
  h(this, ut);
3372
- !pt(i) && !xe(i) && !mt(i) && !A(i) || (this.__storage__ = {
3393
+ h(this, Le);
3394
+ h(this, Se);
3395
+ h(this, ht);
3396
+ !mt(i) && !$e(i) && !gt(i) && !A(i) || (this.__storage__ = {
3373
3397
  el: i,
3374
3398
  options: t
3375
- }, this.active = "data-collapse-active", d(this, dt, We).call(this));
3399
+ }, this.active = "data-collapse-active", d(this, ut, Xe).call(this));
3376
3400
  }
3377
3401
  update() {
3378
- d(this, dt, We).call(this);
3402
+ d(this, ut, Xe).call(this);
3379
3403
  }
3380
3404
  }
3381
- dt = new WeakSet(), We = function() {
3382
- const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = li;
3383
- 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)
3405
+ ut = new WeakSet(), Xe = function() {
3406
+ const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = ui;
3407
+ if (this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
3384
3408
  for (const [o, a] of Object.entries(this.options.on))
3385
3409
  this.__events__[o] = [a];
3386
- d(this, Ae, Ss).call(this);
3387
- }, Ae = new WeakSet(), Ss = function() {
3410
+ d(this, Le, Ds).call(this);
3411
+ }, Le = new WeakSet(), Ds = function() {
3388
3412
  const { elements: i, options: t } = this;
3389
3413
  i.forEach((e) => {
3390
- e.collapse = {}, e.collapse.instance = this, e.collapse.defaultOptions = t, e.collapse.methods = {}, e.collapse.methods.update = this.update, e.setAttribute(this.active, ""), d(this, Le, Ds).call(this, e);
3414
+ 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, Se, ks).call(this, e);
3391
3415
  }), this.emit("init");
3392
- }, Le = new WeakSet(), Ds = function(i) {
3416
+ }, Se = new WeakSet(), ks = function(i) {
3393
3417
  const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
3394
- 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, ut, Ge)), c.addEventListener("click", d(this, ut, Ge)), r) {
3418
+ 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, ht, Ue)), c.addEventListener("click", d(this, ht, Ue)), r) {
3395
3419
  const p = (g) => {
3396
3420
  g.stopPropagation();
3397
3421
  };
3398
3422
  u.removeEventListener("click", p), u.addEventListener("click", p);
3399
3423
  }
3400
- }, ut = new WeakSet(), Ge = function() {
3424
+ }, ht = new WeakSet(), Ue = function() {
3401
3425
  const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
3402
3426
  r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
3403
- si(l);
3404
- }), un(r)) : si(r), i.emit("afterCollapse");
3427
+ ai(l);
3428
+ }), pn(r)) : ai(r), i.emit("afterCollapse");
3405
3429
  };
3406
- Object.assign(hn.prototype, z);
3407
- function pn(n, i) {
3430
+ Object.assign(mn.prototype, z);
3431
+ function gn(n, i) {
3408
3432
  const t = i, { color: e, opacity: s, duration: o } = i.s.options;
3409
3433
  let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
3410
3434
  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() {
3411
3435
  a.remove();
3412
3436
  }, `${o}`);
3413
3437
  }
3414
- function ks() {
3438
+ function xs() {
3415
3439
  document.querySelectorAll("ripple-btn").forEach((n) => {
3416
3440
  n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
3417
3441
  });
3418
3442
  }
3419
- document.addEventListener("click", ks);
3420
- var ht, Re, Se, _s, De, xs, ke, $s;
3421
- class mn extends HTMLElement {
3443
+ document.addEventListener("click", xs);
3444
+ var pt, Ye, _e, $s, De, Cs, ke, Hs;
3445
+ class fn extends HTMLElement {
3422
3446
  constructor() {
3423
3447
  super();
3424
- h(this, ht);
3425
- h(this, Se);
3448
+ h(this, pt);
3449
+ h(this, _e);
3426
3450
  h(this, De);
3427
3451
  h(this, ke);
3428
3452
  this.initialize = !1;
3429
3453
  }
3430
3454
  connectedCallback() {
3431
3455
  const t = this;
3432
- t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ht, Re).call(this));
3456
+ t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, pt, Ye).call(this));
3433
3457
  }
3434
3458
  update() {
3435
- this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ht, Re).call(this);
3459
+ this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, pt, Ye).call(this);
3436
3460
  }
3437
3461
  }
3438
- ht = new WeakSet(), Re = function() {
3439
- const { SETTINGS: t } = ci;
3462
+ pt = new WeakSet(), Ye = function() {
3463
+ const { SETTINGS: t } = hi;
3440
3464
  this.s = {};
3441
3465
  function e(o) {
3442
3466
  let a = !!o;
@@ -3450,20 +3474,20 @@ ht = new WeakSet(), Re = function() {
3450
3474
  hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
3451
3475
  click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
3452
3476
  };
3453
- this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Se, _s).call(this);
3454
- }, Se = new WeakSet(), _s = function() {
3455
- d(this, De, xs).call(this), d(this, ke, $s).call(this), this.classList.add("r4-initialize");
3456
- }, De = new WeakSet(), xs = function() {
3477
+ this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, _e, $s).call(this);
3478
+ }, _e = new WeakSet(), $s = function() {
3479
+ d(this, De, Cs).call(this), d(this, ke, Hs).call(this), this.classList.add("r4-initialize");
3480
+ }, De = new WeakSet(), Cs = function() {
3457
3481
  const t = this, e = document.createElement("i");
3458
3482
  e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
3459
- }, ke = new WeakSet(), $s = function() {
3483
+ }, ke = new WeakSet(), Hs = function() {
3460
3484
  const t = this.querySelector("i.hover-ball"), e = this;
3461
3485
  e.addEventListener("click", function(a) {
3462
- a.stopPropagation(), e.s.options.click && pn(a, e);
3486
+ a.stopPropagation(), e.s.options.click && gn(a, e);
3463
3487
  });
3464
3488
  let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
3465
3489
  e.addEventListener(s, function(a) {
3466
- if (s === "touchstart" && ks(), e.s.options.hover) {
3490
+ if (s === "touchstart" && xs(), e.s.options.hover) {
3467
3491
  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);
3468
3492
  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");
3469
3493
  }
@@ -3474,8 +3498,8 @@ ht = new WeakSet(), Re = function() {
3474
3498
  }
3475
3499
  });
3476
3500
  };
3477
- customElements.define("ripple-btn", mn);
3478
- class gn {
3501
+ customElements.define("ripple-btn", fn);
3502
+ class vn {
3479
3503
  constructor() {
3480
3504
  this.init();
3481
3505
  }
@@ -3527,12 +3551,12 @@ class gn {
3527
3551
  this.init();
3528
3552
  }
3529
3553
  }
3530
- function ni(n, i) {
3554
+ function ri(n, i) {
3531
3555
  return n ? function(t, e) {
3532
3556
  Function(n)(t, e);
3533
3557
  } : i;
3534
3558
  }
3535
- function fn(n, i, t, e) {
3559
+ function bn(n, i, t, e) {
3536
3560
  const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
3537
3561
  o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
3538
3562
  const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
@@ -3555,7 +3579,7 @@ function fn(n, i, t, e) {
3555
3579
  info: e
3556
3580
  }, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
3557
3581
  }
3558
- function vn(n, i, t, e) {
3582
+ function yn(n, i, t, e) {
3559
3583
  const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
3560
3584
  let u = 0, p = 0;
3561
3585
  switch (s.width = t, s.height = e, n.previewSize) {
@@ -3569,14 +3593,14 @@ function vn(n, i, t, e) {
3569
3593
  const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
3570
3594
  return o.drawImage(i, g, m, u, p), s;
3571
3595
  }
3572
- function bn(n, i) {
3596
+ function wn(n, i) {
3573
3597
  return new Promise((t, e) => {
3574
3598
  if (i) {
3575
3599
  const s = new Image();
3576
3600
  s.src = i, s.classList.add(n.previewSize), s.onload = () => {
3577
3601
  let o = {
3578
3602
  imgElement: s,
3579
- originalCanvas: vn(n, s, s.width, s.height),
3603
+ originalCanvas: yn(n, s, s.width, s.height),
3580
3604
  info: {
3581
3605
  originalWidth: s.width,
3582
3606
  originalHeight: s.height,
@@ -3589,31 +3613,31 @@ function bn(n, i) {
3589
3613
  t();
3590
3614
  });
3591
3615
  }
3592
- function yn(n, i) {
3616
+ function Tn(n, i) {
3593
3617
  const t = Math.pow(10, i);
3594
3618
  return Math.round(n * t) / t;
3595
3619
  }
3596
- function wn(n, i) {
3620
+ function En(n, i) {
3597
3621
  let t = n.size / 1024 / 1024;
3598
- return `${yn(t, 2)}` <= i;
3622
+ return `${Tn(t, 2)}` <= i;
3599
3623
  }
3600
- function Tn(n, i, t) {
3624
+ function An(n, i, t) {
3601
3625
  if (n.target.files.length <= 0)
3602
3626
  return;
3603
3627
  const e = n.target.files[0], s = i.closest("[data-upload-item]");
3604
3628
  let o = new FileReader();
3605
3629
  o.onload = (a) => {
3606
3630
  const r = e.type.split("/")[0] === "image" ? a.target.result : null;
3607
- if (t.params.sizeLimit && !wn(e, t.params.sizeLimit)) {
3631
+ if (t.params.sizeLimit && !En(e, t.params.sizeLimit)) {
3608
3632
  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);
3609
3633
  return;
3610
3634
  } else
3611
- s.classList.remove("over-limit"), s.classList.add("uploaded"), bn(t.params, r).then((l) => {
3612
- fn(i, t, e, l);
3635
+ s.classList.remove("over-limit"), s.classList.add("uploaded"), wn(t.params, r).then((l) => {
3636
+ bn(i, t, e, l);
3613
3637
  });
3614
3638
  }, o.readAsDataURL(e);
3615
3639
  }
3616
- class En {
3640
+ class Ln {
3617
3641
  constructor(i, t) {
3618
3642
  const e = this;
3619
3643
  e.el = i, e.params = {
@@ -3641,67 +3665,67 @@ class En {
3641
3665
  previewSize: e.dataset.previewSize || i.params.previewSize,
3642
3666
  compress: e.dataset.compress || i.params.compress,
3643
3667
  on: {
3644
- changeAfter: ni(e.dataset.changeAfter, i.params.on.changeAfter),
3645
- overLimit: ni(e.dataset.overLimit, i.params.on.overLimit)
3668
+ changeAfter: ri(e.dataset.changeAfter, i.params.on.changeAfter),
3669
+ overLimit: ri(e.dataset.overLimit, i.params.on.overLimit)
3646
3670
  }
3647
3671
  };
3648
3672
  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) {
3649
- Tn(a, e, i);
3673
+ An(a, e, i);
3650
3674
  });
3651
3675
  }));
3652
3676
  }
3653
3677
  }
3654
3678
  export {
3655
- di as A,
3656
- Nn as B,
3657
- hn as C,
3658
- Gi as D,
3659
- jn as E,
3660
- zn as F,
3661
- Bn as G,
3662
- Wn as H,
3663
- gn as I,
3664
- Gn as J,
3665
- Rn as K,
3666
- Xn as L,
3679
+ pi as A,
3680
+ zn as B,
3681
+ mn as C,
3682
+ Xi as D,
3683
+ Bn as E,
3684
+ Wn as F,
3685
+ Gn as G,
3686
+ Rn as H,
3687
+ vn as I,
3688
+ Xn as J,
3689
+ Un as K,
3690
+ Yn as L,
3667
3691
  V as M,
3668
- Yn as N,
3669
- Fn as O,
3670
- Un as P,
3671
- Jn as Q,
3672
- mn as R,
3673
- Zn as S,
3674
- ls as T,
3675
- Qn as U,
3676
- Kn as V,
3677
- Vn as W,
3678
- to as X,
3679
- eo as Y,
3692
+ Fn as N,
3693
+ Jn as O,
3694
+ Zn as P,
3695
+ Qn as Q,
3696
+ fn as R,
3697
+ Kn as S,
3698
+ ds as T,
3699
+ Vn as U,
3700
+ to as V,
3701
+ eo as W,
3702
+ io as X,
3703
+ so as Y,
3680
3704
  A as a,
3681
- mt as b,
3682
- Ns as c,
3683
- Ps as d,
3684
- _e as e,
3705
+ gt as b,
3706
+ zs as c,
3707
+ js as d,
3708
+ xe as e,
3685
3709
  L as f,
3686
- k as g,
3687
- Cn as h,
3688
- pt as i,
3689
- Li as j,
3690
- an as k,
3691
- cn as l,
3692
- En as m,
3693
- Js as n,
3694
- io as o,
3695
- Pi as p,
3696
- Ni as q,
3697
- Hn as r,
3698
- Os as s,
3699
- Mn as t,
3700
- In as u,
3701
- Ie as v,
3702
- Us as w,
3703
- qn as x,
3704
- On as y,
3705
- Pn as z
3710
+ D as g,
3711
+ Mn as h,
3712
+ mt as i,
3713
+ Di as j,
3714
+ ln as k,
3715
+ un as l,
3716
+ Ln as m,
3717
+ Qs as n,
3718
+ no as o,
3719
+ zi as p,
3720
+ Bi as q,
3721
+ In as r,
3722
+ Ns as s,
3723
+ qn as t,
3724
+ On as u,
3725
+ qe as v,
3726
+ Zs as w,
3727
+ Pn as x,
3728
+ Nn as y,
3729
+ jn as z
3706
3730
  };
3707
3731
  //# sourceMappingURL=image-preview-bundle.js.map