@xwadex/fesd 0.0.68 → 0.0.69

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,23 +1,11 @@
1
- var js = Object.defineProperty;
2
- var zs = (n, i, t) => i in n ? js(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
- var si = (n, i, t) => (zs(n, typeof i != "symbol" ? i + "" : i, t), t), Bs = (n, i, t) => {
4
- if (!i.has(n))
5
- throw TypeError("Cannot " + t);
6
- };
7
- var p = (n, i, t) => {
8
- if (i.has(n))
9
- throw TypeError("Cannot add the same private member more than once");
10
- i instanceof WeakSet ? i.add(n) : i.set(n, t);
11
- };
12
- var d = (n, i, t) => (Bs(n, i, "access private method"), t);
13
- import f from "jquery";
14
- import { OverlayScrollbars as Ve } from "overlayscrollbars";
1
+ import m from "jquery";
2
+ import { OverlayScrollbars as tt } from "overlayscrollbars";
15
3
  import "./vendor-bundle.js";
16
4
  import "validator";
17
5
  import "flatpickr";
18
- import hi from "vanilla-lazyload";
19
- import { lock as Ws, unlock as Gs } from "tua-body-scroll-lock";
20
- const Ie = {
6
+ import ht from "vanilla-lazyload";
7
+ import { unlock as Ct, lock as Ht } from "tua-body-scroll-lock";
8
+ const Z = {
21
9
  SETTINGS: {
22
10
  videoId: null,
23
11
  videoType: null,
@@ -78,14 +66,14 @@ const Ie = {
78
66
  TEMPLATE() {
79
67
  return '<div class="player-container"><div class="player-wrapper"></div></div>';
80
68
  }
81
- }, Rs = {
69
+ }, It = {
82
70
  SETTINGS: {
83
71
  success: null,
84
72
  text: null,
85
73
  className: null,
86
74
  duration: 1500
87
75
  }
88
- }, j = {
76
+ }, P = {
89
77
  SETTINGS: {
90
78
  target: null,
91
79
  route: null,
@@ -107,16 +95,16 @@ const Ie = {
107
95
  destroy: null,
108
96
  update: null
109
97
  },
110
- TEMPLATE(n) {
98
+ TEMPLATE(s) {
111
99
  return `
112
100
  <div class="modal-scroller">
113
- <div class="modal-wrapper" ${n === "destroy" ? "data-modal-destroy" : "data-modal-close"}>
101
+ <div class="modal-wrapper" ${s === "destroy" ? "data-modal-destroy" : "data-modal-close"}>
114
102
  <div class="modal-content" stop-propagation>
115
103
  </div>
116
104
  </div>
117
105
  `;
118
106
  }
119
- }, I = {
107
+ }, $ = {
120
108
  SETTINGS: {
121
109
  direction: "left",
122
110
  // 方向 - top || right || bottom || left
@@ -135,7 +123,7 @@ const Ie = {
135
123
  gap: 30
136
124
  // 跑馬燈內容之間的距離 - Number
137
125
  }
138
- }, ti = {
126
+ }, et = {
139
127
  SETTINGS: {
140
128
  scrollbar: {
141
129
  "scrollbar-track-color": "transparent",
@@ -144,26 +132,26 @@ const Ie = {
144
132
  "scrollbar-radius": "10px"
145
133
  }
146
134
  },
147
- TEMPLATE(n, i, t, e) {
135
+ TEMPLATE(s, t, e, i) {
148
136
  const o = `
149
- <i class="${e || "dropdown-icon"}"></i>
137
+ <i class="${i || "dropdown-icon"}"></i>
150
138
  `, a = `
151
139
  <div class="filter-bar">
152
- <input class="filter-input" type="text" placeholder="${i}" disabled>
140
+ <input class="filter-input" type="text" placeholder="${t}" disabled>
153
141
  </div>
154
142
  `, r = `<div class="select-wrapper">
155
143
  <div class="select-display"></div>
156
144
  ${o}
157
145
  <div class="dropdown">
158
- ${n ? a : ""}
146
+ ${s ? a : ""}
159
147
  <div class="dropdown-scroller">
160
148
  <ul class="dropdown-list"></ul>
161
149
  </div>
162
150
  </div>
163
151
  </div>`;
164
- return t || r;
152
+ return e || r;
165
153
  }
166
- }, Xs = {
154
+ }, qt = {
167
155
  SETTINGS: {
168
156
  basic_rwd: 900,
169
157
  markdownLink: !1,
@@ -172,7 +160,7 @@ const Ie = {
172
160
  navigation: !1,
173
161
  scrollStep: !1
174
162
  }
175
- }, mi = {
163
+ }, mt = {
176
164
  SETTINGS: {
177
165
  scroller: window,
178
166
  class: "aost-show",
@@ -195,7 +183,7 @@ const Ie = {
195
183
  enter: null,
196
184
  leave: null
197
185
  }
198
- }, wt = {
186
+ }, F = {
199
187
  SETTINGS: {
200
188
  target: null,
201
189
  container: null,
@@ -213,7 +201,7 @@ const Ie = {
213
201
  beforeScroll: null,
214
202
  afterScroll: null
215
203
  }
216
- }, q = {
204
+ }, x = {
217
205
  SETTINGS: {
218
206
  type: "drag",
219
207
  drag: {
@@ -240,22 +228,22 @@ const Ie = {
240
228
  </ul>
241
229
  </div>`;
242
230
  },
243
- collapse(n) {
231
+ collapse(s) {
244
232
  return `<div class="drag-container">
245
233
  <ul class="wrapper">
246
234
  </ul>
247
- <div class="collapse-placeholder">${n.placeholder}</div>
235
+ <div class="collapse-placeholder">${s.placeholder}</div>
248
236
  </div>
249
237
  <div class="collapse-container">
250
238
  <ul class="wrapper">
251
239
  </ul>
252
240
  </div>`;
253
241
  },
254
- dropdown(n) {
255
- return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
242
+ dropdown(s) {
243
+ return `<dropdown-el${s.placeholder ? ` d4-placeholder="${s.placeholder}"` : ""}${s.value ? ` d4-value="${s.value}"` : ""}></dropdown-el>`;
256
244
  }
257
245
  }
258
- }, gi = {
246
+ }, gt = {
259
247
  SETTINGS: {
260
248
  // 樣式 normal / process
261
249
  type: "normal",
@@ -275,7 +263,7 @@ const Ie = {
275
263
  // 步驟狀態綁定
276
264
  stepOutput: ".step-show"
277
265
  }
278
- }, fi = {
266
+ }, ft = {
279
267
  SETTINGS: {
280
268
  collapseClass: "collapse",
281
269
  block: "[collapse-block]",
@@ -308,7 +296,7 @@ const Ie = {
308
296
  update: null,
309
297
  afterUpdate: null
310
298
  }
311
- }, vi = {
299
+ }, vt = {
312
300
  SETTINGS: {
313
301
  // 是否要加 hover 效果?
314
302
  hover: !0,
@@ -323,198 +311,242 @@ const Ie = {
323
311
  // hover 毫秒 ?
324
312
  speed: 600
325
313
  }
326
- }, jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
314
+ }, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
327
315
  __proto__: null,
328
- anchor4: wt,
329
- aost4: mi,
330
- article4: Xs,
331
- collapse4: fi,
332
- dropdown4: ti,
333
- marquee4: I,
334
- modal4: j,
335
- multipurpose4: q,
336
- ripple4: vi,
337
- share4: Rs,
338
- tab4: gi,
339
- video4: Ie
340
- }, Symbol.toStringTag, { value: "Module" })), S = {
341
- before: "beforebegin",
316
+ anchor4: F,
317
+ aost4: mt,
318
+ article4: qt,
319
+ collapse4: ft,
320
+ dropdown4: et,
321
+ marquee4: $,
322
+ modal4: P,
323
+ multipurpose4: x,
324
+ ripple4: vt,
325
+ share4: It,
326
+ tab4: gt,
327
+ video4: Z
328
+ }, Symbol.toStringTag, { value: "Module" })), E = {
342
329
  after: "afterend",
343
330
  append: "beforeend",
344
331
  prepend: "afterbegin"
345
- }, ft = (n) => typeof n == "string" && n !== "", Me = (n) => n instanceof HTMLElement, vt = (n) => n instanceof NodeList, A = (n) => _(n) !== null, G = (n) => typeof n == "function", _ = (n) => Me(n) ? n : document.querySelector(n), D = (n) => vt(n) ? n : document.querySelectorAll(n), Us = () => Math.random().toString(36).substr(2, 9), Ys = (n) => {
346
- const i = document.createElement("div");
347
- return i.innerHTML = n, i.childNodes;
348
- }, Fs = (n) => {
332
+ }, R = (s) => typeof s == "string" && s !== "", Q = (s) => s instanceof HTMLElement, X = (s) => s instanceof NodeList, T = (s) => A(s) !== null, j = (s) => typeof s == "function", A = (s) => Q(s) ? s : document.querySelector(s), S = (s) => X(s) ? s : document.querySelectorAll(s), Mt = () => Math.random().toString(36).substr(2, 9), Ot = (s) => {
333
+ const t = document.createElement("div");
334
+ return t.innerHTML = s, t.childNodes;
335
+ }, Pt = (s) => {
349
336
  try {
350
- JSON.parse(n);
337
+ JSON.parse(s);
351
338
  } catch {
352
- return n;
353
- }
354
- return JSON.parse(n);
355
- }, E = (n, i) => {
356
- console.warn(`[${n} warn]: ${i}`);
357
- }, ni = (n, i) => {
358
- console.error(`[${n} error]: ${i}`);
359
- }, z = {
360
- on(n, i) {
361
- if (!G(i))
362
- return this;
363
- const { __events__: t } = this;
364
- return n.split(" ").forEach((e) => {
365
- t[e] || (t[e] = []), t[e].push(i);
339
+ return s;
340
+ }
341
+ return JSON.parse(s);
342
+ }, w = (s, t) => {
343
+ console.warn(`[${s} warn]: ${t}`);
344
+ }, nt = (s, t) => {
345
+ console.error(`[${s} error]: ${t}`);
346
+ }, N = {
347
+ on(s, t) {
348
+ if (!j(t)) return this;
349
+ const { __events__: e } = this;
350
+ return s.split(" ").forEach((i) => {
351
+ e[i] || (e[i] = []), e[i].push(t);
366
352
  }), this;
367
353
  },
368
- off(n, i) {
369
- const { __events__: t } = this;
370
- return n.split(" ").forEach((e) => {
371
- typeof i > "u" ? t[e] = [] : t[e] && t[e].forEach((s, o) => {
372
- s === i && t[e].splice(o, 1);
354
+ off(s, t) {
355
+ const { __events__: e } = this;
356
+ return s.split(" ").forEach((i) => {
357
+ typeof t > "u" ? e[i] = [] : e[i] && e[i].forEach((n, o) => {
358
+ n === t && e[i].splice(o, 1);
373
359
  });
374
360
  }), this;
375
361
  },
376
- once(n, i) {
377
- if (!G(i))
378
- return this;
379
- const t = (...e) => {
380
- this.off(n, t), i.apply(this, e);
362
+ once(s, t) {
363
+ if (!j(t)) return this;
364
+ const e = (...i) => {
365
+ this.off(s, e), t.apply(this, i);
381
366
  };
382
- return this.on(n, t);
367
+ return this.on(s, e);
383
368
  },
384
- emit(...n) {
385
- const { __events__: i } = this, t = n[0], e = n.slice(1, n.length);
386
- return i[t] ? (i[t].forEach((s) => {
387
- G(s) && s.apply(this, e);
369
+ emit(...s) {
370
+ const { __events__: t } = this, e = s[0], i = s.slice(1, s.length);
371
+ return t[e] ? (t[e].forEach((n) => {
372
+ j(n) && n.apply(this, i);
388
373
  }), this) : this;
389
374
  }
390
- }, Js = {
391
- easeInOutCirc(n, i, t, e) {
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;
375
+ }, Nt = {
376
+ easeInOutCirc(s, t, e, i) {
377
+ return (s /= i / 2) < 1 ? -e / 2 * (Math.sqrt(1 - s * s) - 1) + t : e / 2 * (Math.sqrt(1 - (s -= 2) * s) + 1) + t;
393
378
  },
394
- easeInQuart(n, i, t, e) {
395
- return t * (n /= e) * n * n * n + i;
379
+ easeInQuart(s, t, e, i) {
380
+ return e * (s /= i) * s * s * s + t;
396
381
  },
397
- easeOutQuart(n, i, t, e) {
398
- return -t * ((n = n / e - 1) * n * n * n - 1) + i;
382
+ easeOutQuart(s, t, e, i) {
383
+ return -e * ((s = s / i - 1) * s * s * s - 1) + t;
399
384
  }
400
- }, qe = (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", h = c ? "left" : "top", g = c ? "width" : "height", m = A(e) ? _(e) : document.scrollingElement, v = m[u], w = A(t) ? _(t).getBoundingClientRect()[h] : 0 - v, b = A(s) ? _(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
385
+ }, K = (s, t) => {
386
+ const { target: e, container: i, spacer: n, speed: o, gap: a, easing: r, direction: l } = s, c = l === "horizontal", d = c ? "scrollLeft" : "scrollTop", u = c ? "left" : "top", h = c ? "width" : "height", p = T(i) ? A(i) : document.scrollingElement, g = p[d], b = T(e) ? A(e).getBoundingClientRect()[u] : 0 - g, f = T(n) ? A(n).getBoundingClientRect()[h] : 0, v = b - a - f, H = 15;
402
387
  let y = 0;
403
- if (T === 0)
404
- return;
405
- const L = (k) => {
406
- const J = _(t);
407
- i && i.emit(k, J), !i && n.on && G(n.on[k]) && n.on[k](J);
388
+ if (v === 0) return;
389
+ const z = (q) => {
390
+ const M = A(e);
391
+ t && t.emit(q, M), !t && s.on && j(s.on[q]) && s.on[q](M);
408
392
  };
409
- L("beforeScroll");
410
- const O = () => {
411
- y += C;
412
- const k = Js[r](y, v, T, o);
413
- m[u] = k, y < o && requestAnimationFrame(O), y >= o && L("afterScroll");
393
+ z("beforeScroll");
394
+ const I = () => {
395
+ y += H;
396
+ const q = Nt[r](y, g, v, o);
397
+ p[d] = q, y < o && requestAnimationFrame(I), y >= o && z("afterScroll");
414
398
  };
415
- requestAnimationFrame(O);
399
+ requestAnimationFrame(I);
416
400
  };
417
- var et, Oe, Lt, yi, _t, wi;
418
- class bi {
419
- constructor(i, t = {}) {
420
- p(this, et);
421
- p(this, Lt);
422
- p(this, _t);
401
+ class bt {
402
+ constructor(t, e = {}) {
423
403
  this.__storage__ = {
424
- el: i,
425
- options: t
426
- }, this.active = "data-anchor-active", d(this, et, Oe).call(this);
404
+ el: t,
405
+ options: e
406
+ }, this.active = "data-anchor-active", this.#t();
407
+ }
408
+ #t() {
409
+ const { el: t, options: e } = this.__storage__;
410
+ if (!R(t) || !T(t)) return;
411
+ const { SETTINGS: i, EVENTS: n } = F;
412
+ if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.elements = S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
413
+ for (const [o, a] of Object.entries(this.options.on))
414
+ this.__events__[o] = [a];
415
+ this.#s();
416
+ }
417
+ #s() {
418
+ const { elements: t, options: e } = this;
419
+ t.forEach((i) => {
420
+ i.anchor = {}, i.anchor.instance = this, i.anchor.eventHandler = this.#e, i.anchor.defaultOptions = e, i.anchor.methods = {}, i.anchor.methods.destroy = this.destroy, i.anchor.methods.update = this.update, i.addEventListener("click", i.anchor.eventHandler), i.setAttribute(this.active, "");
421
+ }), this.emit("afterInit");
422
+ }
423
+ #e() {
424
+ const { defaultOptions: t, eventHandler: e, instance: i } = this.anchor, n = {
425
+ target: this.getAttribute("data-anchor-target") || t.target,
426
+ container: this.getAttribute("data-anchor-container") || t.container,
427
+ spacer: this.getAttribute("data-anchor-spacer") || t.spacer,
428
+ gap: parseInt(this.getAttribute("data-anchor-gap") || t.gap),
429
+ speed: parseInt(this.getAttribute("data-anchor-speed")) || t.speed,
430
+ delay: parseInt(this.getAttribute("data-anchor-delay")) || t.delay,
431
+ easing: this.getAttribute("data-anchor-easing") || t.easing,
432
+ direction: this.getAttribute("data-anchor-direction") || t.direction
433
+ };
434
+ this.removeEventListener("click", e), setTimeout(() => {
435
+ this.addEventListener("click", e);
436
+ }, n.speed), setTimeout(() => {
437
+ K(n, i);
438
+ }, n.delay);
427
439
  }
428
440
  destroy() {
429
- const { elements: i } = this;
430
- return this.emit("beforeDestroy"), i.forEach((t) => {
431
- t.anchor && (t.removeEventListener("click", t.anchor.eventHandler), delete t.anchor);
441
+ const { elements: t } = this;
442
+ return this.emit("beforeDestroy"), t.forEach((e) => {
443
+ e.anchor && (e.removeEventListener("click", e.anchor.eventHandler), delete e.anchor);
432
444
  }), this;
433
445
  }
434
446
  update() {
435
- var i;
436
- return d(i = this.destroy(), et, Oe).call(i), this.emit("afterUpdate"), this;
447
+ return this.destroy().#t(), this.emit("afterUpdate"), this;
437
448
  }
438
- static run(i) {
439
- const { SETTINGS: t } = wt, e = Object.assign({}, t, i);
449
+ static run(t) {
450
+ const { SETTINGS: e } = F, i = Object.assign({}, e, t);
440
451
  setTimeout(() => {
441
- qe(e);
442
- }, e.delay);
452
+ K(i);
453
+ }, i.delay);
443
454
  }
444
- static url(i) {
445
- const { SETTINGS: t } = wt, { 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
- if (!a)
447
- return;
448
- const r = Object.assign({}, t, i, { target: a });
455
+ static url(t) {
456
+ const { SETTINGS: e } = F, { hashName: i } = t, n = window.location.search || window.location.hash, { searchParams: o } = new URL(window.location), a = document.querySelector(`[data-anchor-id="${i ? o.get(i) : n.split("?").pop()}"]`);
457
+ if (!a) return;
458
+ const r = Object.assign({}, e, t, { target: a });
449
459
  setTimeout(() => {
450
- qe(r);
460
+ K(r);
451
461
  }, r.delay);
452
462
  }
453
463
  }
454
- et = new WeakSet(), Oe = function() {
455
- const { el: i, options: t } = this.__storage__;
456
- if (!ft(i) || !A(i))
457
- return;
458
- const { SETTINGS: e, EVENTS: s } = wt;
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
- for (const [o, a] of Object.entries(this.options.on))
461
- this.__events__[o] = [a];
462
- d(this, Lt, yi).call(this);
463
- }, Lt = new WeakSet(), yi = function() {
464
- const { elements: i, options: t } = this;
465
- i.forEach((e) => {
466
- e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, _t, wi), 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
- }), this.emit("afterInit");
468
- }, _t = new WeakSet(), wi = function() {
469
- const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
470
- target: this.getAttribute("data-anchor-target") || i.target,
471
- container: this.getAttribute("data-anchor-container") || i.container,
472
- spacer: this.getAttribute("data-anchor-spacer") || i.spacer,
473
- gap: parseInt(this.getAttribute("data-anchor-gap") || i.gap),
474
- speed: parseInt(this.getAttribute("data-anchor-speed")) || i.speed,
475
- delay: parseInt(this.getAttribute("data-anchor-delay")) || i.delay,
476
- easing: this.getAttribute("data-anchor-easing") || i.easing,
477
- direction: this.getAttribute("data-anchor-direction") || i.direction
478
- };
479
- this.removeEventListener("click", t), setTimeout(() => {
480
- this.addEventListener("click", t);
481
- }, s.speed), setTimeout(() => {
482
- qe(s, e);
483
- }, s.delay);
484
- };
485
- Object.assign(bi.prototype, z);
464
+ Object.assign(bt.prototype, N);
486
465
  window.MODALS || (window.MODALS = {});
487
- const { MODALS: P } = window, Zs = (n) => {
488
- const { TEMPLATE: i } = j, { childDom: t } = n, e = document.createElement("div");
489
- e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
490
- const s = e.querySelector(".modal-content");
491
- return [...t].forEach((o) => {
492
- s.append(o);
493
- }), e.children[0];
466
+ const { MODALS: O } = window, jt = (s) => {
467
+ const { TEMPLATE: t } = P, { childDom: e } = s, i = document.createElement("div");
468
+ i.innerHTML = t(s.getAttribute("data-modal-template-setting"));
469
+ const n = i.querySelector(".modal-content");
470
+ return [...e].forEach((o) => {
471
+ n.append(o);
472
+ }), i.children[0];
494
473
  };
495
- var Dt, Ei, kt, Ai, xt, Si, $t, Li, Ct, _i;
496
- class Ti extends HTMLElement {
474
+ class yt extends HTMLElement {
497
475
  constructor() {
498
- super();
499
- p(this, Dt);
500
- p(this, kt);
501
- p(this, xt);
502
- p(this, $t);
503
- p(this, Ct);
504
- this.initialize = !1;
476
+ super(), this.initialize = !1;
505
477
  }
506
478
  static get observedAttributes() {
507
479
  return [":state"];
508
480
  }
509
- attributeChangedCallback(t, e, s) {
510
- switch (t) {
511
- case ":state":
512
- d(this, Ct, _i).call(this, s);
513
- break;
514
- }
481
+ attributeChangedCallback(t, e, i) {
482
+ t === ":state" && this.#n(i);
515
483
  }
516
484
  connectedCallback() {
517
- this.initialize || (this.initialize = !0, d(this, Dt, Ei).call(this));
485
+ this.initialize || (this.initialize = !0, this.#t());
486
+ }
487
+ #t() {
488
+ const { ATTRS: t } = P;
489
+ this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
490
+ const e = this.getAttribute(t.id) || Mt();
491
+ this.getAttribute(t.id) || (w(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && w(`the ${t.id} "${e}" is already be used.`), O[e] = this, this.#s();
492
+ }
493
+ #s() {
494
+ this.childDom = this.childNodes, this.template = jt(this), this.innerHTML = "", this.append(this.template), this.#e();
495
+ }
496
+ #e() {
497
+ const t = this.querySelector(".modal-scroller");
498
+ this.__scroller__ = tt(t, {
499
+ overflowBehavior: {
500
+ x: "hidden"
501
+ },
502
+ autoUpdate: !0
503
+ }), window.modalScroll = this.__scroller__, this.#i();
504
+ }
505
+ #i() {
506
+ const t = this, { ATTRS: e } = P, { close: i, destroy: n } = e;
507
+ t.querySelectorAll(`[${i}]`)?.forEach((o) => {
508
+ o.addEventListener("click", function() {
509
+ const a = this.getAttribute(i);
510
+ (a && O[a] ? O[a] : t).close();
511
+ });
512
+ }), t.querySelectorAll(`[${n}]`)?.forEach((o) => {
513
+ o.addEventListener("click", function() {
514
+ const a = this.getAttribute(n);
515
+ (a && O[a] ? O[a] : t).destroy();
516
+ });
517
+ }), t.querySelector("[stop-propagation]")?.addEventListener("click", function(o) {
518
+ o.stopPropagation();
519
+ });
520
+ }
521
+ #n(t) {
522
+ const { __scroller__: e } = this;
523
+ if (t === "open") {
524
+ if (this.style.display = "block", e) {
525
+ const { viewport: i } = e.elements();
526
+ i.scrollTo({
527
+ top: 0
528
+ });
529
+ }
530
+ setTimeout(() => {
531
+ this.classList.add("show"), this.emit("open");
532
+ }, 100);
533
+ }
534
+ if (t === "close") {
535
+ if (!this.classList.contains("show")) return;
536
+ this.classList.remove("show");
537
+ const i = () => {
538
+ this.style.removeProperty("display"), this.emit("close"), this.removeEventListener("transitionend", i);
539
+ };
540
+ this.addEventListener("transitionend", i);
541
+ }
542
+ if (t === "destroy") {
543
+ this.classList.remove("show");
544
+ const i = () => {
545
+ const { ATTRS: n } = P, o = this.getAttribute(n.id);
546
+ this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"), O[o] && delete O[o];
547
+ };
548
+ this.addEventListener("transitionend", i);
549
+ }
518
550
  }
519
551
  open() {
520
552
  return this.setAttribute(":state", "open"), this;
@@ -526,86 +558,23 @@ class Ti extends HTMLElement {
526
558
  return this.setAttribute(":state", "destroy"), this;
527
559
  }
528
560
  }
529
- Dt = new WeakSet(), Ei = function() {
530
- const { ATTRS: t } = j;
531
- this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
532
- const e = this.getAttribute(t.id) || Us();
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, kt, Ai).call(this);
534
- }, kt = new WeakSet(), Ai = function() {
535
- this.childDom = this.childNodes, this.template = Zs(this), this.innerHTML = "", this.append(this.template), d(this, xt, Si).call(this);
536
- }, xt = new WeakSet(), Si = function() {
537
- const t = this.querySelector(".modal-scroller");
538
- this.__scroller__ = Ve(t, {
539
- overflowBehavior: {
540
- x: "hidden"
541
- },
542
- autoUpdate: !0
543
- }), window.modalScroll = this.__scroller__, d(this, $t, Li).call(this);
544
- }, $t = new WeakSet(), Li = function() {
545
- var a, r, l;
546
- const t = this, { ATTRS: e } = j, { close: s, destroy: o } = e;
547
- (a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
548
- c.addEventListener("click", function() {
549
- const u = this.getAttribute(s);
550
- (u && P[u] ? P[u] : t).close();
551
- });
552
- }), (r = t.querySelectorAll(`[${o}]`)) == null || r.forEach((c) => {
553
- c.addEventListener("click", function() {
554
- const u = this.getAttribute(o);
555
- (u && P[u] ? P[u] : t).destroy();
556
- });
557
- }), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
558
- c.stopPropagation();
559
- });
560
- }, Ct = new WeakSet(), _i = function(t) {
561
- const { __scroller__: e } = this;
562
- if (t === "open") {
563
- if (this.style.display = "block", e) {
564
- const { viewport: s } = e.elements();
565
- s.scrollTo({
566
- top: 0
567
- });
568
- }
569
- setTimeout(() => {
570
- this.classList.add("show"), this.emit("open");
571
- }, 100);
572
- }
573
- if (t === "close") {
574
- if (!this.classList.contains("show"))
575
- return;
576
- this.classList.remove("show");
577
- const s = () => {
578
- this.style.removeProperty("display"), this.emit("close"), this.removeEventListener("transitionend", s);
579
- };
580
- this.addEventListener("transitionend", s);
581
- }
582
- if (t === "destroy") {
583
- this.classList.remove("show");
584
- const s = () => {
585
- const { ATTRS: o } = j, a = this.getAttribute(o.id);
586
- this.style.removeProperty("display"), this.emit("close"), this.remove(), this.emit("destroy"), P[a] && delete P[a];
587
- };
588
- this.addEventListener("transitionend", s);
589
- }
590
- };
591
- Object.assign(Ti.prototype, z);
592
- const { MODALS: ei } = window, bt = {}, Di = (n, i, ...t) => {
593
- if (!i)
594
- return;
595
- const e = n[i];
596
- e && G(e) && e.apply(n, t);
597
- }, ki = (n, ...i) => {
598
- n && G(n) && n.apply(tt, i);
599
- }, oi = (n, i) => {
600
- const { target: t } = n, e = ei[t] || _(n.target);
601
- e && xi(n, i), e || Qs(n, i);
602
- }, xi = (n, i) => {
603
- const { target: t, action: e, on: s, e: o } = n, a = ei[t] || _(n.target);
561
+ Object.assign(yt.prototype, N);
562
+ const { MODALS: it } = window, U = {}, wt = (s, t, ...e) => {
563
+ if (!t) return;
564
+ const i = s[t];
565
+ i && j(i) && i.apply(s, e);
566
+ }, Tt = (s, ...t) => {
567
+ s && j(s) && s.apply(C, t);
568
+ }, ot = (s, t) => {
569
+ const { target: e } = s, i = it[e] || A(s.target);
570
+ i && Et(s, t), i || zt(s, t);
571
+ }, Et = (s, t) => {
572
+ const { target: e, action: i, on: n, e: o } = s, a = it[e] || A(s.target);
604
573
  switch (["open", "close", "destroy"].forEach((l) => {
605
574
  a.once(l, () => {
606
- i && (i.emit(l, a, o), Di(i, s[l], a, o)), i || ki(s[l], a);
575
+ t && (t.emit(l, a, o), wt(t, n[l], a, o)), t || Tt(n[l], a);
607
576
  });
608
- }), e) {
577
+ }), i) {
609
578
  case "open":
610
579
  a.open();
611
580
  break;
@@ -620,183 +589,234 @@ const { MODALS: ei } = window, bt = {}, Di = (n, i, ...t) => {
620
589
  l === "close" && a.open(), l === "open" && a.close();
621
590
  break;
622
591
  }
623
- }, Qs = async (n, i) => {
624
- const { target: t, route: e, container: s, on: o, e: a } = n;
625
- if (!e)
626
- return E("modal4", "cannot find target or data-modal-route is not defined");
592
+ }, zt = async (s, t) => {
593
+ const { target: e, route: i, container: n, on: o, e: a } = s;
594
+ if (!i) return w("modal4", "cannot find target or data-modal-route is not defined");
627
595
  const r = (l, ...c) => {
628
- i && (i.emit(l, ...c), Di(i, o[l], ...c)), i || ki(o[l], ...c);
596
+ t && (t.emit(l, ...c), wt(t, o[l], ...c)), t || Tt(o[l], ...c);
629
597
  };
630
- bt[t] || (bt[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
631
- const c = Ys(l), u = _(s) || _(j.SETTINGS.container);
632
- [...c].forEach((g) => {
633
- u.append(g);
598
+ U[e] || (U[e] = !0, fetch(i).then((l) => (r("success", a), l.text())).then((l) => {
599
+ const c = Ot(l), d = A(n) || A(P.SETTINGS.container);
600
+ [...c].forEach((h) => {
601
+ d.append(h);
634
602
  });
635
- const h = ei[t] || _(n.target);
636
- r("complete", h), xi(n, i), delete bt[t];
603
+ const u = it[e] || A(s.target);
604
+ r("complete", u), Et(s, t), delete U[e];
637
605
  }).catch((l) => {
638
- r("error", l), delete bt[t];
606
+ r("error", l), delete U[e];
639
607
  }));
640
608
  };
641
- var it, Pe, Ht, $i, It, Ci;
642
- const B = class B {
643
- constructor(i, t = {}) {
644
- p(this, it);
645
- p(this, Ht);
646
- p(this, It);
609
+ class C {
610
+ constructor(t, e = {}) {
647
611
  this.__storage__ = {
648
- el: i,
649
- options: t
650
- }, this.active = "data-modal-active", d(this, it, Pe).call(this);
612
+ el: t,
613
+ options: e
614
+ }, this.active = "data-modal-active", this.#t();
615
+ }
616
+ #t() {
617
+ const { el: t, options: e } = this.__storage__;
618
+ if (!R(t) || !T(t)) return;
619
+ const { SETTINGS: i, EVENTS: n } = P;
620
+ if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
621
+ for (const [o, a] of Object.entries(this.options.on))
622
+ this.__events__[o] = [a];
623
+ this.#s();
624
+ }
625
+ #s() {
626
+ const { elements: t, options: e } = this;
627
+ t.forEach((i) => {
628
+ i.modal = {}, i.modal.instance = this, i.modal.eventHandler = this.#e, i.modal.defaultOptions = e, i.modal.methods = {}, i.modal.methods.destroy = this.destroy, i.modal.methods.update = this.update, i.addEventListener("click", i.modal.eventHandler), i.setAttribute(this.active, "");
629
+ }), this.emit("init");
630
+ }
631
+ #e(t) {
632
+ const { defaultOptions: e, eventHandler: i, instance: n } = this.modal, o = Pt(this.getAttribute("data-modal-on"));
633
+ o && typeof o != "object" && w("modal4", "data-modal-on must be a json string.");
634
+ const a = {
635
+ target: this.getAttribute("data-modal-target") || e.target,
636
+ action: this.getAttribute("data-modal-action") || e.action,
637
+ route: this.getAttribute("data-modal-route") || e.route,
638
+ container: this.getAttribute("data-modal-container") || e.container,
639
+ on: o && typeof o == "object" ? o : {},
640
+ e: t
641
+ };
642
+ this.removeEventListener("click", i), setTimeout(() => {
643
+ this.addEventListener("click", i);
644
+ }, 200), ot(a, n);
651
645
  }
652
646
  destroy() {
653
- const { elements: i } = this;
654
- return i.forEach((t) => {
655
- t.modal && (t.removeEventListener("click", t.modal.eventHandler), delete t.modal);
647
+ const { elements: t } = this;
648
+ return t.forEach((e) => {
649
+ e.modal && (e.removeEventListener("click", e.modal.eventHandler), delete e.modal);
656
650
  }), this;
657
651
  }
658
652
  update() {
659
- var i;
660
- return d(i = this.destroy(), it, Pe).call(i), this.emit("update"), this;
653
+ return this.destroy().#t(), this.emit("update"), this;
661
654
  }
662
655
  /** static method 'open' */
663
- static open(i) {
664
- const { SETTINGS: t } = j, e = Object.assign({}, t, { on: {} }, i);
665
- oi(e);
656
+ static open(t) {
657
+ const { SETTINGS: e } = P, i = Object.assign({}, e, { on: {} }, t);
658
+ ot(i);
666
659
  }
667
660
  /** static method 'defineMethods' */
668
- static defineMethods(i) {
669
- B.prototype.__methods__ || (B.prototype.__methods__ = {});
670
- const t = B.prototype.__methods__;
671
- for (const [e, s] of Object.entries(i))
672
- G(s) && (t[e] = s);
673
- Object.assign(B.prototype, B.prototype.__methods__);
661
+ static defineMethods(t) {
662
+ C.prototype.__methods__ || (C.prototype.__methods__ = {});
663
+ const e = C.prototype.__methods__;
664
+ for (const [i, n] of Object.entries(t))
665
+ j(n) && (e[i] = n);
666
+ Object.assign(C.prototype, C.prototype.__methods__);
674
667
  }
675
- };
676
- it = new WeakSet(), Pe = function() {
677
- const { el: i, options: t } = this.__storage__;
678
- if (!ft(i) || !A(i))
679
- return;
680
- const { SETTINGS: e, EVENTS: s } = j;
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
- for (const [o, a] of Object.entries(this.options.on))
683
- this.__events__[o] = [a];
684
- d(this, Ht, $i).call(this);
685
- }, Ht = new WeakSet(), $i = function() {
686
- const { elements: i, options: t } = this;
687
- i.forEach((e) => {
688
- e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, It, Ci), 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
- }), this.emit("init");
690
- }, It = new WeakSet(), Ci = function(i) {
691
- const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = Fs(this.getAttribute("data-modal-on"));
692
- o && typeof o != "object" && E("modal4", "data-modal-on must be a json string.");
693
- const a = {
694
- target: this.getAttribute("data-modal-target") || t.target,
695
- action: this.getAttribute("data-modal-action") || t.action,
696
- route: this.getAttribute("data-modal-route") || t.route,
697
- container: this.getAttribute("data-modal-container") || t.container,
698
- on: o && typeof o == "object" ? o : {},
699
- e: i
700
- };
701
- this.removeEventListener("click", e), setTimeout(() => {
702
- this.addEventListener("click", e);
703
- }, 200), oi(a, s);
704
- };
705
- let tt = B;
706
- Object.assign(tt.prototype, z);
707
- customElements.define("modern-modal", Ti);
708
- const Ks = (n, i) => {
709
- const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
710
- i.forEach((s) => {
711
- const { class: o, delay: a, start: r, end: l, repeat: c, instance: u } = s.aost, { top: h, bottom: g } = s.getBoundingClientRect(), m = t * (r / 100), v = t * (l / 100);
712
- if (h - e <= m && g - e >= v && s.offsetParent)
668
+ }
669
+ Object.assign(C.prototype, N);
670
+ customElements.define("modern-modal", yt);
671
+ const Bt = (s, t) => {
672
+ const e = s === window ? s.innerHeight : s.getBoundingClientRect().height, i = s === window ? 0 : s.getBoundingClientRect().top;
673
+ t.forEach((n) => {
674
+ const { class: o, delay: a, start: r, end: l, repeat: c, instance: d } = n.aost, { top: u, bottom: h } = n.getBoundingClientRect(), p = e * (r / 100), g = e * (l / 100);
675
+ if (u - i <= p && h - i >= g && n.offsetParent)
713
676
  setTimeout(() => {
714
- s.classList.add(o);
677
+ n.classList.add(o);
715
678
  }, a);
716
679
  else {
717
- const b = s.classList.contains(o) && c === "down" && h - e >= m || c === "up" && g - e <= v || c === !0;
680
+ const f = n.classList.contains(o) && c === "down" && u - i >= p || c === "up" && h - i <= g || c === !0;
718
681
  setTimeout(() => {
719
- b && s.classList.remove(o);
682
+ f && n.classList.remove(o);
720
683
  }, a);
721
684
  }
722
685
  });
723
- }, Vs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
724
- var st, Ne, Mt, Ii;
725
- class Hi {
726
- constructor(i, t = {}) {
727
- p(this, st);
728
- p(this, Mt);
686
+ }, Wt = (s, t) => s === "up" || s === "down" ? s : s !== null ? s === "true" ? !0 : s === "false" ? !1 : t.repeat : t.repeat;
687
+ class At {
688
+ constructor(t, e = {}) {
729
689
  this.__storage__ = {
730
- el: i,
731
- options: t
732
- }, this.active = "data-aost-active", d(this, st, Ne).call(this);
733
- }
734
- destroy(i) {
735
- const { elements: t, options: e } = this;
736
- if (!t)
737
- return this;
738
- const { scroller: s } = e, o = s === window || !A(s) ? window : _(s);
739
- return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
740
- if (!a.aost)
741
- return;
690
+ el: t,
691
+ options: e
692
+ }, this.active = "data-aost-active", this.#t();
693
+ }
694
+ #t() {
695
+ const { el: t, options: e } = this.__storage__;
696
+ if (!R(t) || !T(t)) return;
697
+ const { SETTINGS: i, EVENTS: n } = mt;
698
+ if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
699
+ for (const [o, a] of Object.entries(this.options.on))
700
+ this.__events__[o] = [a];
701
+ this.#s();
702
+ }
703
+ #s() {
704
+ const { elements: t, options: e } = this, { scroller: i } = e, n = i === window || !T(i) ? window : A(i);
705
+ this.eventHandler = () => {
706
+ Bt(n, t);
707
+ }, t.forEach((a) => {
708
+ a.aost = {}, a.aost.class = a.getAttribute("data-aost-class") || e.class, a.aost.delay = parseInt(a.getAttribute("data-aost-delay")) || e.delay, a.aost.start = parseInt(a.getAttribute("data-aost-start")) || e.start, a.aost.end = parseInt(a.getAttribute("data-aost-end")) || e.end, a.aost.repeat = Wt(a.getAttribute("data-aost-repeat"), e), a.aost.methods = {}, a.aost.methods.destroy = this.destroy, a.aost.methods.update = this.update, a.aost.instance = this, a.setAttribute(this.active, "");
709
+ });
710
+ const { eventHandler: o } = this;
711
+ o(), n.aost = {}, n.aost.eventHandler = o, n.addEventListener("scroll", n.aost.eventHandler, !1);
712
+ }
713
+ destroy(t) {
714
+ const { elements: e, options: i } = this;
715
+ if (!e) return this;
716
+ const { scroller: n } = i, o = n === window || !T(n) ? window : A(n);
717
+ return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), e.forEach((a) => {
718
+ if (!a.aost) return;
742
719
  const { class: r } = a.aost;
743
- i && a.classList.remove(r), delete a.aost;
720
+ t && a.classList.remove(r), delete a.aost;
744
721
  }), this;
745
722
  }
746
- update(i) {
747
- var t;
748
- d(t = this.destroy(i), st, Ne).call(t);
723
+ update(t) {
724
+ this.destroy(t).#t();
749
725
  }
750
726
  }
751
- st = new WeakSet(), Ne = function() {
752
- const { el: i, options: t } = this.__storage__;
753
- if (!ft(i) || !A(i))
754
- return;
755
- const { SETTINGS: e, EVENTS: s } = mi;
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
- for (const [o, a] of Object.entries(this.options.on))
758
- this.__events__[o] = [a];
759
- d(this, Mt, Ii).call(this);
760
- }, Mt = new WeakSet(), Ii = function() {
761
- const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !A(e) ? window : _(e);
762
- this.eventHandler = () => {
763
- Ks(s, i);
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 = Vs(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
- });
767
- const { eventHandler: o } = this;
768
- o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
769
- };
770
- Object.assign(Hi.prototype, z);
771
- const tn = (n) => {
772
- const { TEMPLATE: i } = Ie, { childDom: t } = n, e = document.createElement("div");
773
- e.innerHTML = i();
774
- const s = e.querySelector(".player-wrapper");
775
- return [...t].forEach((o) => {
776
- s.append(o);
777
- }), e.children[0];
727
+ Object.assign(At.prototype, N);
728
+ const Gt = (s) => {
729
+ const { TEMPLATE: t } = Z, { childDom: e } = s, i = document.createElement("div");
730
+ i.innerHTML = t();
731
+ const n = i.querySelector(".player-wrapper");
732
+ return [...e].forEach((o) => {
733
+ n.append(o);
734
+ }), i.children[0];
778
735
  };
779
- var qt, Mi, Ot, qi, Pt, Oi, Nt, Pi, jt, Ni, zt, ji, Bt, zi, Wt, Bi, Gt, Wi, Rt, Gi;
780
- class en extends HTMLElement {
736
+ class Rt extends HTMLElement {
781
737
  constructor() {
782
- super();
783
- p(this, qt);
784
- p(this, Ot);
785
- p(this, Pt);
786
- // youtube iframe
787
- p(this, Nt);
788
- // vimeo iframe
789
- p(this, jt);
790
- // youku iframe
791
- p(this, zt);
792
- p(this, Bt);
793
- // 2025.02.11 新增 ig
794
- p(this, Wt);
795
- // 2025.02.11 新增 tiktok
796
- p(this, Gt);
797
- // 2026.01.15 新增 video
798
- p(this, Rt);
799
- d(this, qt, Mi).call(this);
738
+ super(), this.#t();
739
+ }
740
+ #t() {
741
+ if (!this.getAttribute("video-id")) {
742
+ w("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
743
+ return;
744
+ }
745
+ 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"), this.#s();
746
+ }
747
+ #s() {
748
+ this.childDom = this.childNodes, this.template = Gt(this), this.innerHTML = "", this.append(this.template), this.#e();
749
+ }
750
+ #e() {
751
+ const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: i } = Z;
752
+ let n = "";
753
+ function o(a) {
754
+ m(a).addClass("cookie-disagree"), m(".cookie-disagree").append(i);
755
+ }
756
+ switch (t) {
757
+ case "youtubeAPI":
758
+ break;
759
+ case "youtube":
760
+ document.body.wd_youtube == !1 ? o("video-player") : n = this.#i();
761
+ break;
762
+ case "youkuAPI":
763
+ break;
764
+ case "youku":
765
+ document.body.wd_youku == !1 ? o("video-player") : n = this.#o();
766
+ break;
767
+ case "vimeo":
768
+ document.body.wd_vimeo == !1 ? o("video-player") : n = this.#n();
769
+ break;
770
+ case "bilibili":
771
+ document.body.wd_bilibili == !1 ? o("video-player") : n = this.#a();
772
+ break;
773
+ case "instagram":
774
+ document.body.wd_instagram == !1 ? o(".instagram-media") : n = this.#l();
775
+ break;
776
+ case "tiktok":
777
+ document.body.wd_tiktok == !1 ? o("video-player") : n = this.#c();
778
+ break;
779
+ case "videojs":
780
+ break;
781
+ case "video":
782
+ n = this.#d();
783
+ break;
784
+ }
785
+ this.querySelector(".player-wrapper").insertAdjacentHTML(E.prepend, n);
786
+ }
787
+ // youtube iframe
788
+ #i() {
789
+ const { videoId: t, autoplay: e, startTime: i } = this;
790
+ return `<iframe src="https://www.youtube.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}&start=${i}&mute=1&loop=1&enablejsapi=1" frameborder="0" allowfullscreen="0" volumn="0" allow="${e === "on" ? "autoplay;" : ""} encrypted-media; gyroscope; picture-in-picture;"></iframe>`;
791
+ }
792
+ // vimeo iframe
793
+ #n() {
794
+ const { videoId: t, autoplay: e, hash: i } = this;
795
+ return `<iframe src="https://player.vimeo.com/video/${t}?h=${i}&${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>`;
796
+ }
797
+ // youku iframe
798
+ #o() {
799
+ const { videoId: t, autoplay: e } = this;
800
+ return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=true" : ""}" allow="${e === "on" ? "autoplay;" : ""} width="100%" height="100%" frameborder=0 "allowfullscreen"></iframe>`;
801
+ }
802
+ #a() {
803
+ const { videoId: t, autoplay: e } = this;
804
+ 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>`;
805
+ }
806
+ // 2025.02.11 新增 ig
807
+ #l() {
808
+ const { videoId: t, autoplay: e } = this;
809
+ 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>`;
810
+ }
811
+ // 2025.02.11 新增 tiktok
812
+ #c() {
813
+ const { videoId: t, autoplay: e } = this;
814
+ 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>`;
815
+ }
816
+ // 2026.01.15 新增 video
817
+ #d() {
818
+ const { videoId: t, autoplay: e } = this;
819
+ return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
800
820
  }
801
821
  play() {
802
822
  const { videoType: t } = this;
@@ -833,92 +853,25 @@ class en extends HTMLElement {
833
853
  }
834
854
  }
835
855
  }
836
- qt = new WeakSet(), Mi = function() {
837
- if (!this.getAttribute("video-id")) {
838
- E("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
839
- return;
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, Ot, qi).call(this);
842
- }, Ot = new WeakSet(), qi = function() {
843
- this.childDom = this.childNodes, this.template = tn(this), this.innerHTML = "", this.append(this.template), d(this, Pt, Oi).call(this);
844
- }, Pt = new WeakSet(), Oi = function() {
845
- const { videoType: t, videoMode: e } = this, { COOKIEDISAGREELAYOUT: s } = Ie;
846
- let o = "";
847
- function a(r) {
848
- f(r).addClass("cookie-disagree"), f(".cookie-disagree").append(s);
849
- }
850
- switch (t) {
851
- case "youtubeAPI":
852
- break;
853
- case "youtube":
854
- document.body.wd_youtube == !1 ? a("video-player") : o = d(this, Nt, Pi).call(this);
855
- break;
856
- case "youkuAPI":
857
- break;
858
- case "youku":
859
- document.body.wd_youku == !1 ? a("video-player") : o = d(this, zt, ji).call(this);
860
- break;
861
- case "vimeo":
862
- document.body.wd_vimeo == !1 ? a("video-player") : o = d(this, jt, Ni).call(this);
863
- break;
864
- case "bilibili":
865
- document.body.wd_bilibili == !1 ? a("video-player") : o = d(this, Bt, zi).call(this);
866
- break;
867
- case "instagram":
868
- document.body.wd_instagram == !1 ? a(".instagram-media") : o = d(this, Wt, Bi).call(this);
869
- break;
870
- case "tiktok":
871
- document.body.wd_tiktok == !1 ? a("video-player") : o = d(this, Gt, Wi).call(this);
872
- break;
873
- case "videojs":
874
- break;
875
- case "video":
876
- o = d(this, Rt, Gi).call(this);
877
- break;
878
- }
879
- this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, o);
880
- }, Nt = new WeakSet(), Pi = function() {
881
- const { videoId: t, autoplay: e, startTime: s } = this;
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
- }, jt = new WeakSet(), Ni = function() {
884
- const { videoId: t, autoplay: e, hash: s } = this;
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
- }, zt = new WeakSet(), ji = function() {
887
- const { videoId: t, autoplay: e } = this;
888
- return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=true" : ""}" allow="${e === "on" ? "autoplay;" : ""} width="100%" height="100%" frameborder=0 "allowfullscreen"></iframe>`;
889
- }, Bt = new WeakSet(), zi = function() {
890
- const { videoId: t, autoplay: e } = this;
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
- }, Wt = new WeakSet(), Bi = function() {
893
- const { videoId: t, autoplay: e } = this;
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
- }, Gt = new WeakSet(), Wi = function() {
896
- const { videoId: t, autoplay: e } = this;
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
- }, Rt = new WeakSet(), Gi = function() {
899
- const { videoId: t, autoplay: e } = this;
900
- return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
901
- };
902
- let K = 0;
903
- function Ri(n) {
904
- const i = [];
905
- return (n || []).forEach((t) => {
906
- t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(t));
907
- }), i;
856
+ let B = 0;
857
+ function St(s) {
858
+ const t = [];
859
+ return (s || []).forEach((e) => {
860
+ e instanceof HTMLElement ? t.push(e) : typeof e == "string" && t.push(...document.querySelectorAll(e));
861
+ }), t;
908
862
  }
909
- function Xi(n) {
910
- const i = Ri(n);
911
- K += 1, K === 1 && document.documentElement.classList.add("scrollLock"), Ws(i);
863
+ function Lt(s) {
864
+ const t = St(s);
865
+ B += 1, B === 1 && document.documentElement.classList.add("scrollLock"), Ht(t);
912
866
  }
913
- function Ui(n) {
914
- K = Math.max(0, K - 1);
915
- const i = Ri(n);
916
- Gs(i), K === 0 && document.documentElement.classList.remove("scrollLock");
867
+ function _t(s) {
868
+ B = Math.max(0, B - 1);
869
+ const t = St(s);
870
+ Ct(t), B === 0 && document.documentElement.classList.remove("scrollLock");
917
871
  }
918
- async function zn(n = 0) {
919
- if (f(".loading-wrapper").length)
920
- return;
921
- f("body").append(`
872
+ async function De(s = 0) {
873
+ if (m(".loading-wrapper").length) return;
874
+ m("body").append(`
922
875
  <div class="loading-wrapper">
923
876
  <div class="icon-box">
924
877
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><path d="M10 50A40 40 0 0 0 90 50A40 42 0 0 1 10 50" fill="#ffffff" stroke="none">
@@ -928,31 +881,31 @@ async function zn(n = 0) {
928
881
  </svg>
929
882
  </div>
930
883
  </div>
931
- `), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
932
- Xi();
884
+ `), m(".loading-wrapper").delay(s).fadeIn(300).promise().done(function() {
885
+ Lt();
933
886
  });
934
887
  }
935
- function Bn() {
936
- f(".loading-wrapper").fadeOut(300).promise().done(function() {
937
- f(".loading-wrapper").remove(), Ui();
888
+ function $e() {
889
+ m(".loading-wrapper").fadeOut(300).promise().done(function() {
890
+ m(".loading-wrapper").remove(), _t();
938
891
  });
939
892
  }
940
- function Wn(n, i) {
941
- new $n(n, i);
893
+ function ke(s, t) {
894
+ new be(s, t);
942
895
  }
943
- function sn() {
944
- const n = document.querySelector("[data-aost]") && new Hi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new bi("[data-anchor-target]"), t = new hi({ callback_loaded: () => {
945
- } }), e = new An();
946
- n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
896
+ function Xt() {
897
+ const s = document.querySelector("[data-aost]") && new At("[data-aost]"), t = document.querySelector("[data-anchor-target]") && new bt("[data-anchor-target]"), e = new ht({ callback_loaded: () => {
898
+ } }), i = new ue();
899
+ s?.update(), e.update(), i.reValidate(), t?.update();
947
900
  }
948
- function Gn(n, i = () => {
901
+ function xe(s, t = () => {
949
902
  }) {
950
- f(`[data-tab-content=${n}]`).fadeIn(function() {
951
- typeof i == "function" && i();
952
- }).siblings("[data-tab-content]").hide(), sn();
903
+ m(`[data-tab-content=${s}]`).fadeIn(function() {
904
+ typeof t == "function" && t();
905
+ }).siblings("[data-tab-content]").hide(), Xt();
953
906
  }
954
- function Rn() {
955
- Ve(
907
+ function Ce() {
908
+ tt(
956
909
  {
957
910
  target: document.body,
958
911
  cancel: {
@@ -976,399 +929,394 @@ function Rn() {
976
929
  }
977
930
  );
978
931
  }
979
- function Xn() {
980
- window.onpageshow = function(n) {
981
- n.persisted && window.location.reload();
932
+ function He() {
933
+ window.onpageshow = function(s) {
934
+ s.persisted && window.location.reload();
982
935
  };
983
936
  }
984
- function Un() {
985
- const n = navigator.userAgent;
937
+ function Ie() {
938
+ const s = navigator.userAgent;
986
939
  return {
987
- 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)
940
+ BigSurUP: /Mac OS X 10.15/.test(s) || /Mac OS X 10_15_7/.test(s) || /Mac OS X 10_15_8/.test(s) || /Mac OS X 10_15_9/.test(s) || /Mac OS X 11_/.test(s) || /Mac OS X 12_/.test(s)
988
941
  };
989
942
  }
990
- function Yn(n, i) {
991
- f(n).on("click", function() {
992
- f(this).toggleClass(i);
943
+ function qe(s, t) {
944
+ m(s).on("click", function() {
945
+ m(this).toggleClass(t);
993
946
  });
994
947
  }
995
- function Fn(n, i) {
996
- f(n).on("click", function() {
997
- f(n).not(this).removeClass(i), f(this).addClass(i);
948
+ function Me(s, t) {
949
+ m(s).on("click", function() {
950
+ m(s).not(this).removeClass(t), m(this).addClass(t);
998
951
  });
999
952
  }
1000
- const Jn = (n) => new Promise((i) => {
1001
- let t = setTimeout(() => (clearTimeout(t), i()), n);
953
+ const Oe = (s) => new Promise((t) => {
954
+ let e = setTimeout(() => (clearTimeout(e), t()), s);
1002
955
  });
1003
- function nn(n, i = 250) {
1004
- let t = null;
1005
- return function(...e) {
1006
- let s = this;
1007
- clearTimeout(t), t = setTimeout(() => {
1008
- n.apply(s, e);
1009
- }, i);
956
+ function Ut(s, t = 250) {
957
+ let e = null;
958
+ return function(...i) {
959
+ let n = this;
960
+ clearTimeout(e), e = setTimeout(() => {
961
+ s.apply(n, i);
962
+ }, t);
1010
963
  };
1011
964
  }
1012
- function Zn(n, i = 250) {
1013
- let t, e;
965
+ function Pe(s, t = 250) {
966
+ let e, i;
1014
967
  return function() {
1015
- const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
1016
- t && a < t + i ? (clearTimeout(e), e = setTimeout(function() {
1017
- t = a, n.apply(s, o);
1018
- }, i)) : (t = a, n.apply(s, o));
968
+ const n = this, o = arguments, a = +/* @__PURE__ */ new Date();
969
+ e && a < e + t ? (clearTimeout(i), i = setTimeout(function() {
970
+ e = a, s.apply(n, o);
971
+ }, t)) : (e = a, s.apply(n, o));
1019
972
  };
1020
973
  }
1021
- function Qn() {
1022
- window._g.interval = [], f(".countdown").each((i, t) => {
1023
- const e = Number(f(t).attr("data-seconds")) + 1;
1024
- let s = Math.floor(e / 60) + ":" + e % 60;
1025
- window._g.interval[i] = setInterval(function() {
1026
- var o = s.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
1027
- --r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[i]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, f(t).html(a + ":" + r), s = a + ":" + r;
974
+ function Ne() {
975
+ window._g.interval = [], m(".countdown").each((t, e) => {
976
+ const i = Number(m(e).attr("data-seconds")) + 1;
977
+ let n = Math.floor(i / 60) + ":" + i % 60;
978
+ window._g.interval[t] = setInterval(function() {
979
+ var o = n.split(":"), a = parseInt(o[0], 10), r = parseInt(o[1], 10);
980
+ --r, a = r < 0 ? --a : a, a = a < 10 ? a = "0" + a : a, a == 0 && r == 0 && clearInterval(window._g.interval[t]), r = r < 0 ? 59 : r, r = r < 10 ? "0" + r : r, m(e).html(a + ":" + r), n = a + ":" + r;
1028
981
  }, 1e3);
1029
982
  });
1030
983
  }
1031
- function Kn(n = 500) {
1032
- return new Promise((i, t) => {
1033
- let e = setTimeout(() => {
1034
- clearTimeout(e), i();
1035
- }, n);
984
+ function je(s = 500) {
985
+ return new Promise((t, e) => {
986
+ let i = setTimeout(() => {
987
+ clearTimeout(i), t();
988
+ }, s);
1036
989
  });
1037
990
  }
1038
- function Vn() {
1039
- const n = function() {
1040
- let i = window.innerHeight * 0.01;
1041
- document.documentElement.style.setProperty("--vh", i + "px");
991
+ function ze() {
992
+ const s = function() {
993
+ let t = window.innerHeight * 0.01;
994
+ document.documentElement.style.setProperty("--vh", t + "px");
1042
995
  };
1043
- n(), window.addEventListener("resize", nn(n));
996
+ s(), window.addEventListener("resize", Ut(s));
1044
997
  }
1045
- function to(n, i, t, e, s) {
1046
- const o = this, r = f(n).html().split("<br>");
998
+ function Be(s, t, e, i, n) {
999
+ const o = this, r = m(s).html().split("<br>");
1047
1000
  let l = "", c = 0;
1048
- r.forEach((u, h) => {
1049
- h !== 0 && (l += "<br>"), u.split("").forEach((m, v) => {
1050
- i ? (v === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), m === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++), v === u.length - 1 && (l += "</span>")) : m === " " ? l += " " : (l += `<span class="letter"${s || t ? ` style="${s ? `transition: ${o.formatFloat(Math.random(), 2) * s}s;` : ""}${t ? t === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${t + c * e}s;` : ""}"` : ""}>${m}</span>`, c++);
1001
+ r.forEach((d, u) => {
1002
+ u !== 0 && (l += "<br>"), d.split("").forEach((p, g) => {
1003
+ t ? (g === 0 && (l += '<span class="letter-wrap" style="display: inline-block">'), p === " " ? l += '</span> <span class="letter-wrap" style="display: inline-block">' : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${p}</span>`, c++), g === d.length - 1 && (l += "</span>")) : p === " " ? l += " " : (l += `<span class="letter"${n || e ? ` style="${n ? `transition: ${o.formatFloat(Math.random(), 2) * n}s;` : ""}${e ? e === "random" ? `transition-delay: ${o.formatFloat(Math.random(), 2)}s;` : `transition-delay: ${e + c * i}s;` : ""}"` : ""}>${p}</span>`, c++);
1051
1004
  });
1052
- }), f(n).html(l);
1005
+ }), m(s).html(l);
1053
1006
  }
1054
- function eo(n, i) {
1055
- const t = Math.pow(10, i);
1056
- return Math.round(n * t) / t;
1007
+ function We(s, t) {
1008
+ const e = Math.pow(10, t);
1009
+ return Math.round(s * e) / e;
1057
1010
  }
1058
- function io(n) {
1059
- let i = n.activeIndex, t = n.slides.length;
1060
- if (n.params.loop)
1061
- switch (n.activeIndex) {
1011
+ function Ge(s) {
1012
+ let t = s.activeIndex, e = s.slides.length;
1013
+ if (s.params.loop)
1014
+ switch (s.activeIndex) {
1062
1015
  case 0:
1063
- i = t - 3;
1016
+ t = e - 3;
1064
1017
  break;
1065
- case t - 1:
1066
- i = 0;
1018
+ case e - 1:
1019
+ t = 0;
1067
1020
  break;
1068
1021
  default:
1069
- --i;
1022
+ --t;
1070
1023
  }
1071
- return i;
1024
+ return t;
1072
1025
  }
1073
- function so(n, i) {
1074
- const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
1075
- (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());
1026
+ function Re(s, t) {
1027
+ const e = s.$el, i = s.params.grid.rows, n = t || s.params.slidesPerView * i;
1028
+ (s.loopedSlides ? s.slides.length - s.loopedSlides * 2 : s.slides.length) <= n ? (e.addClass("swiper-no-swiping"), m(s.params.navigation.nextEl).hide(), m(s.params.navigation.prevEl).hide(), m(s.params.pagination.el).hide(), s.params.autoplay.enabled = !1, s.autoplay.stop()) : (e.removeClass("swiper-no-swiping"), m(s.params.navigation.nextEl).show(), m(s.params.navigation.prevEl).show(), m(s.params.pagination.el).show(), s.params.autoplay.enabled && s.autoplay.start());
1076
1029
  }
1077
- function no(n) {
1078
- n.el.querySelectorAll("img.detect-shade").forEach((i) => {
1079
- i.addEventListener("load", function() {
1080
- detectShade(i);
1030
+ function Xe(s) {
1031
+ s.el.querySelectorAll("img.detect-shade").forEach((t) => {
1032
+ t.addEventListener("load", function() {
1033
+ detectShade(t);
1081
1034
  });
1082
1035
  });
1083
1036
  }
1084
- function oo(n) {
1085
- 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");
1086
- n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
1037
+ function Ue(s) {
1038
+ const t = s.el, e = m(t).find(".swiper-slide-active"), i = m(e).find("video").get(0), n = m(t).find(".swiper-slide video");
1039
+ s.autoplay.stop(), m(i).off("ended"), i ? (n.each((o, a) => {
1087
1040
  a.currentTime = 0;
1088
- }), f(e).on("ended", function() {
1089
- n.slideNext();
1090
- }), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
1041
+ }), m(i).on("ended", function() {
1042
+ s.slideNext();
1043
+ }), i.play()) : s.params.autoplay.enabled && s.autoplay.start();
1091
1044
  }
1092
- function ao() {
1093
- f(".number-grow").each(function(n, i) {
1094
- const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1045
+ function Ye() {
1046
+ m(".number-grow").each(function(s, t) {
1047
+ const e = m(t), o = e.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
1095
1048
  let r = "";
1096
1049
  for (var l = 0; l <= 9; l++)
1097
1050
  r += String(l) + "<br>";
1098
1051
  return r;
1099
1052
  };
1100
- f(o).each(function(r, l) {
1053
+ m(o).each(function(r, l) {
1101
1054
  const c = () => l !== "," ? `<div class="num" data-final-num="${l}"><div><br>${a()}<br>${a()}</div></div>` : `<div class="comma">${l}</div>`;
1102
- t.append(c);
1055
+ e.append(c);
1103
1056
  });
1104
1057
  });
1105
1058
  }
1106
- function ro() {
1107
- f(".letter-grow").each(function(n, i) {
1108
- const t = f(i), s = t.attr("data-letter").split(""), o = () => {
1059
+ function Fe() {
1060
+ m(".letter-grow").each(function(s, t) {
1061
+ const e = m(t), n = e.attr("data-letter").split(""), o = () => {
1109
1062
  let a = "";
1110
1063
  for (let r = 65; r <= 90; r++)
1111
1064
  a += String.fromCharCode(r) + "<br>";
1112
1065
  return a;
1113
1066
  };
1114
- f(s).each(function(a, r) {
1067
+ m(n).each(function(a, r) {
1115
1068
  const l = `<div class="letter" data-final-letter="${r}"><div><br>${o()}<br>${o()}</div></div>`;
1116
- t.append(l);
1069
+ e.append(l);
1117
1070
  });
1118
1071
  });
1119
1072
  }
1120
- function lo(n) {
1121
- const i = getComputedStyle(n).transform;
1122
- let t = i.match(/^matrix3d\((.+)\)$/);
1123
- return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
1073
+ function Je(s) {
1074
+ const t = getComputedStyle(s).transform;
1075
+ let e = t.match(/^matrix3d\((.+)\)$/);
1076
+ return e ? parseFloat(e[1].split(", ")[12]) : (e = t.match(/^matrix\((.+)\)$/), e ? parseFloat(e[1].split(", ")[4]) : 0);
1124
1077
  }
1125
- function co(n) {
1126
- const i = getComputedStyle(n).transform;
1127
- let t = i.match(/^matrix3d\((.+)\)$/);
1128
- return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
1078
+ function Ze(s) {
1079
+ const t = getComputedStyle(s).transform;
1080
+ let e = t.match(/^matrix3d\((.+)\)$/);
1081
+ return e ? parseFloat(e[1].split(", ")[13]) : (e = t.match(/^matrix\((.+)\)$/), e ? parseFloat(e[1].split(", ")[5]) : 0);
1129
1082
  }
1130
- function uo(n) {
1131
- const i = document.createElement("div");
1132
- return i.innerHTML = n, i.childNodes[0];
1083
+ function Qe(s) {
1084
+ const t = document.createElement("div");
1085
+ return t.innerHTML = s, t.childNodes[0];
1133
1086
  }
1134
- const ai = (n) => n.videoId !== "" || typeof n.videoId < "u", on = (n) => n.$selector.getAttribute("video4-active") === "on", yt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`, ri = (n) => (console.log(n.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${n.videoId}"></blockquote>`);
1135
- var nt, ze, Xt, Yi, ot, Be, at, We, Ut, Fi, rt, Ge, Yt, Ji;
1136
- const X = class X {
1087
+ const at = (s) => s.videoId !== "" || typeof s.videoId < "u", Yt = (s) => s.$selector.getAttribute("video4-active") === "on", Y = (s) => `<video-player video-id="${s.videoId}" video-type="${s.videoType}" video-startTime="${s.videoStartTime}" video-autoplay="${s.videoAutoplay}"></video-player>`, rt = (s) => (console.log(s.videoId, "params.videoId"), `<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${s.videoId}"></blockquote>`);
1088
+ class W {
1089
+ static globalOptions = {};
1137
1090
  //*-* 給Article4用的 **//
1138
- constructor(i, t = {}) {
1139
- p(this, nt);
1140
- p(this, Xt);
1141
- p(this, ot);
1142
- p(this, at);
1143
- p(this, Ut);
1144
- p(this, rt);
1145
- p(this, Yt);
1146
- if (!ft(i) && !Me(i) && !vt(i)) {
1147
- ni("video4", `找不到該物件 -> ${i}`);
1091
+ constructor(t, e = {}) {
1092
+ if (!R(t) && !Q(t) && !X(t)) {
1093
+ nt("video4", `找不到該物件 -> ${t}`);
1148
1094
  return;
1149
1095
  }
1150
1096
  this.__storage__ = {
1151
- el: i,
1152
- options: t
1153
- }, this.active = "data-video-active", d(this, nt, ze).call(this);
1154
- }
1155
- update() {
1156
- d(this, nt, ze).call(this);
1157
- }
1158
- };
1159
- nt = new WeakSet(), ze = function() {
1160
- const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = Ie;
1161
- if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? D(i + `:not([${this.active}])`) : D(i), this.options = Object.assign(
1162
- {},
1163
- { LAYOUT: o },
1164
- // 原始 configs 的 LAYOUT
1165
- e,
1166
- // 原始 configs 的 SETTINGS
1167
- X.globalOptions,
1168
- // 全站 A 設定
1169
- t
1170
- // 個別傳入的設定 (優先級最高)
1171
- ), this.__events__ = Object.assign({}, s), this.options.on)
1172
- for (const [a, r] of Object.entries(this.options.on))
1173
- this.__events__[a] = [r];
1174
- d(this, Xt, Yi).call(this);
1175
- }, Xt = new WeakSet(), Yi = function() {
1176
- const { elements: i, options: t } = this;
1177
- i.forEach((e) => {
1178
- e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, Yt, Ji).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), ai(e.video.params) && !on(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, Ut, Fi).call(this, e)), ai(e.video.params) || ni("video4", "無法取得影片 ID");
1179
- }), this.emit("init");
1180
- }, ot = new WeakSet(), Be = function(i) {
1181
- 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"));
1182
- 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() {
1183
- return "";
1184
- }) : Promise.resolve("");
1185
- }, at = new WeakSet(), We = function(i, t) {
1186
- const { videoType: e, videoId: s } = t;
1187
- if (!(i != null && i.getAttribute("src") || i != null && i.getAttribute("data-src"))) {
1188
- if (e === "video") {
1189
- const a = document.createElement("video");
1190
- a.src = s, a.preload = "metadata", a.muted = !0, a.playsInline = !0, a.crossOrigin = "anonymous", a.onloadeddata = () => {
1191
- a.currentTime = 0.5;
1192
- }, a.onseeked = () => {
1193
- const r = document.createElement("canvas");
1194
- r.width = a.videoWidth, r.height = a.videoHeight, r.getContext("2d").drawImage(a, 0, 0), i.src = r.toDataURL("image/jpeg", 0.85);
1195
- };
1196
- return;
1097
+ el: t,
1098
+ options: e
1099
+ }, this.active = "data-video-active", this.#t();
1100
+ }
1101
+ #t() {
1102
+ const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n, LAYOUT: o } = Z;
1103
+ if (e.isGlobal && (W.globalOptions = e), this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign(
1104
+ {},
1105
+ { LAYOUT: o },
1106
+ // 原始 configs LAYOUT
1107
+ i,
1108
+ // 原始 configs 的 SETTINGS
1109
+ W.globalOptions,
1110
+ // 全站 A 設定
1111
+ e
1112
+ // 個別傳入的設定 (優先級最高)
1113
+ ), this.__events__ = Object.assign({}, n), this.options.on)
1114
+ for (const [a, r] of Object.entries(this.options.on))
1115
+ this.__events__[a] = [r];
1116
+ this.#s();
1117
+ }
1118
+ #s() {
1119
+ const { elements: t, options: e } = this;
1120
+ t.forEach((i) => {
1121
+ i.video = {}, i.video.instance = this, i.video.defaultOptions = e, i.video.params = this.#a(i), i.video.methods = {}, i.video.methods.update = this.update, i.setAttribute(this.active, ""), at(i.video.params) && !Yt(i.video.params) && (i.setAttribute("video4-active", "on"), this.#n(i)), at(i.video.params) || nt("video4", "無法取得影片 ID");
1122
+ }), this.emit("init");
1123
+ }
1124
+ #e(t) {
1125
+ const { $selector: e, videoId: i, videoType: n, videoInboxImg: o, videoHighQualityPic: a } = t, r = e?.querySelector("img"), l = r?.getAttribute("src") || r?.getAttribute("data-src");
1126
+ return o ? Promise.resolve(o) : l ? Promise.resolve(l) : n == "youtube" ? a == "on" ? Promise.resolve(`https://img.youtube.com/vi/${i}/maxresdefault.jpg`) : Promise.resolve(`https://img.youtube.com/vi/${i}/0.jpg`) : n == "vimeo" ? Promise.resolve(`https://vumbnail.com/${i}_large.jpg`) : n == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${i}`, { method: "GET", redirect: "follow" }).then((c) => c.json()).then((c) => c.thumbnail_url).catch(function() {
1127
+ return "";
1128
+ }) : Promise.resolve("");
1129
+ }
1130
+ #i(t, e) {
1131
+ const { videoType: i, videoId: n } = e;
1132
+ if (!(t?.getAttribute("src") || t?.getAttribute("data-src"))) {
1133
+ if (i === "video") {
1134
+ const a = document.createElement("video");
1135
+ a.src = n, a.preload = "metadata", a.muted = !0, a.playsInline = !0, a.crossOrigin = "anonymous", a.onloadeddata = () => {
1136
+ a.currentTime = 0.5;
1137
+ }, a.onseeked = () => {
1138
+ const r = document.createElement("canvas");
1139
+ r.width = a.videoWidth, r.height = a.videoHeight, r.getContext("2d").drawImage(a, 0, 0), t.src = r.toDataURL("image/jpeg", 0.85);
1140
+ };
1141
+ return;
1142
+ }
1143
+ this.#e(e).then((a) => {
1144
+ a ? t.setAttribute("src", `${a}`) : w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1145
+ });
1197
1146
  }
1198
- d(this, ot, Be).call(this, t).then((a) => {
1199
- a ? i.setAttribute("src", `${a}`) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1200
- });
1201
1147
  }
1202
- }, Ut = new WeakSet(), Fi = function(i) {
1203
- const { LAYOUT: t } = this.options, e = i.video.params, { $selector: s, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: u, videoHighQualityPic: h } = e;
1204
- if (l === "onBox" || l === "inBox") {
1205
- let g = null;
1206
- if (u === "on") {
1207
- i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1208
- 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] || "";
1209
- if (w ? m.insertAdjacentHTML(S.after, w) : E("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v)
1210
- d(this, at, We).call(this, m, e);
1211
- else if (!v && r == "youtube")
1212
- h == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
1213
- else if (!v && r == "vimeo")
1214
- m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
1215
- else if (!v && r === "video") {
1216
- const b = document.createElement("video");
1217
- b.src = a, b.preload = "metadata", b.muted = !0, b.playsInline = !0, b.crossOrigin = "anonymous", b.onloadeddata = () => {
1218
- b.currentTime = 0.5;
1219
- }, b.onseeked = () => {
1220
- const T = document.createElement("canvas");
1221
- T.width = b.videoWidth, T.height = b.videoHeight, T.getContext("2d").drawImage(b, 0, 0), m.src = T.toDataURL("image/jpeg", 0.85);
1222
- };
1223
- } else
1224
- !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
1225
- const T = b.thumbnail_url;
1226
- m.setAttribute("src", `${T}`);
1148
+ #n(t) {
1149
+ const { LAYOUT: e } = this.options, i = t.video.params, { $selector: n, videoLayoutNo: o, videoId: a, videoType: r, videoMode: l, videoButton: c, videoCover: d, videoHighQualityPic: u } = i;
1150
+ if (l === "onBox" || l === "inBox") {
1151
+ let h = null;
1152
+ if (d === "on") {
1153
+ t.classList.add("video4-cover"), n.querySelector("img") || (n.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), w("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
1154
+ const p = n.querySelector("img"), g = p?.getAttribute("src") || p?.getAttribute("data-src"), b = e[o] ? e[o] : e[0] || "";
1155
+ if (b ? p.insertAdjacentHTML(E.after, b) : w("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !g)
1156
+ this.#i(p, i);
1157
+ else if (!g && r == "youtube")
1158
+ u == "on" ? p.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : p.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
1159
+ else if (!g && r == "vimeo")
1160
+ p.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
1161
+ else if (!g && r === "video") {
1162
+ const f = document.createElement("video");
1163
+ f.src = a, f.preload = "metadata", f.muted = !0, f.playsInline = !0, f.crossOrigin = "anonymous", f.onloadeddata = () => {
1164
+ f.currentTime = 0.5;
1165
+ }, f.onseeked = () => {
1166
+ const v = document.createElement("canvas");
1167
+ v.width = f.videoWidth, v.height = f.videoHeight, v.getContext("2d").drawImage(f, 0, 0), p.src = v.toDataURL("image/jpeg", 0.85);
1168
+ };
1169
+ } else !g && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((f) => f.json()).then((f) => {
1170
+ const v = f.thumbnail_url;
1171
+ p.setAttribute("src", `${v}`);
1172
+ }).catch(function(f) {
1173
+ console.log("error");
1174
+ }) : w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1175
+ }
1176
+ c == "off" ? h = n : (h = n.querySelector(c) ?? n, n.querySelector(c) || w("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), h.video || (h.video = {}, h.video.params = i, h.video.instance = this), h.video.eventHandler = this.#o, h.addEventListener("click", h.video.eventHandler);
1177
+ } else if (l === "onPage") {
1178
+ let h = null;
1179
+ if (d == "on") {
1180
+ t.classList.add("video4-cover"), n.querySelector("img") || (n.insertAdjacentHTML(E.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), w("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1181
+ const p = n.querySelector("img");
1182
+ p.insertAdjacentHTML(E.after, e[o]);
1183
+ const g = p?.getAttribute("src") || p?.getAttribute("data-src");
1184
+ g ? !g && r == "youtube" ? u == "on" ? p.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : p.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !g && r == "vimeo" ? p.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !g && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((b) => b.json()).then((b) => {
1185
+ const f = b.thumbnail_url;
1186
+ p.setAttribute("src", `${f}`);
1227
1187
  }).catch(function(b) {
1228
1188
  console.log("error");
1229
- }) : E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
1230
- }
1231
- 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, rt, Ge), g.addEventListener("click", g.video.eventHandler);
1232
- } else if (l === "onPage") {
1233
- let g = null;
1234
- if (u == "on") {
1235
- i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), E("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
1236
- const m = s.querySelector("img");
1237
- m.insertAdjacentHTML(S.after, t[o]);
1238
- const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
1239
- v ? !v && r == "youtube" ? h == "on" ? m.setAttribute("src", `http://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`) : !v && r == "vimeo" ? m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`) : !v && r == "tiktok" ? fetch(`https://www.tiktok.com/oembed?url=https://www.tiktok.com/@/video/${a}`, { method: "GET", redirect: "follow" }).then((w) => w.json()).then((w) => {
1240
- const b = w.thumbnail_url;
1241
- m.setAttribute("src", `${b}`);
1242
- }).catch(function(w) {
1243
- console.log("error");
1244
- }) : v || E("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : d(this, at, We).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
- } else {
1246
- s.innerHTML = yt(e);
1247
- return;
1189
+ }) : g || w("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片") : this.#i(p, i), c == "off" ? h = n : (h = n.querySelector(c) ?? n, n.querySelector(c) || w("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
1190
+ } else {
1191
+ n.innerHTML = Y(i);
1192
+ return;
1193
+ }
1194
+ h.video || (h.video = {}, h.video.params = i), h.video.eventHandler = this.#o, h.addEventListener("click", h.video.eventHandler);
1248
1195
  }
1249
- g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, rt, Ge), g.addEventListener("click", g.video.eventHandler);
1250
- }
1251
- }, rt = new WeakSet(), Ge = function(i) {
1252
- const { video: t } = this, e = t.instance, {
1253
- $selector: s,
1254
- videoMode: o,
1255
- videoTarget: a,
1256
- videoKeep: r,
1257
- videoId: l,
1258
- videoTargetRoute: c,
1259
- videoType: u,
1260
- videoIgHtml: h,
1261
- videoInboxImg: g,
1262
- videoButton: m,
1263
- videoLayoutNo: v,
1264
- videoStartTime: w
1265
- } = t.params, b = new hi({ callback_loaded: (C) => {
1266
- } }), T = new URLSearchParams({
1267
- video_mode: o,
1268
- video_type: u,
1269
- video_id: l
1270
- });
1271
- if (o == "onBox" || o == "inBox") {
1272
- const C = {
1273
- target: a,
1274
- route: c + `?${T.toString()}`,
1275
- on: {
1276
- complete(y) {
1277
- var L, O;
1278
- o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (L = window.instgrm) != null && L.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", ri(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", yt(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", ri(t.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
1279
- },
1280
- open(y) {
1281
- var O;
1282
- const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1283
- if (b.update(), Xi([...L]), u == "instagram") {
1284
- const k = document.querySelector("[video-template] .modal-content");
1285
- new ResizeObserver((Z) => {
1286
- Z[0].contentRect.height > 50 && k.classList.add("active");
1287
- }).observe(k);
1288
- }
1289
- if (o == "inBox")
1290
- if (u == "instagram")
1291
- f(".video-content").remove();
1292
- else {
1293
- let k;
1294
- const J = y.querySelector(".video-content");
1295
- d(O = e, ot, Be).call(O, t.params).then((Z) => {
1296
- k = `
1196
+ }
1197
+ #o(t) {
1198
+ const { video: e } = this, i = e.instance, {
1199
+ $selector: n,
1200
+ videoMode: o,
1201
+ videoTarget: a,
1202
+ videoKeep: r,
1203
+ videoId: l,
1204
+ videoTargetRoute: c,
1205
+ videoType: d,
1206
+ videoIgHtml: u,
1207
+ videoInboxImg: h,
1208
+ videoButton: p,
1209
+ videoLayoutNo: g,
1210
+ videoStartTime: b
1211
+ } = e.params, f = new ht({ callback_loaded: (H) => {
1212
+ } }), v = new URLSearchParams({
1213
+ video_mode: o,
1214
+ video_type: d,
1215
+ video_id: l
1216
+ });
1217
+ if (o == "onBox" || o == "inBox") {
1218
+ const H = {
1219
+ target: a,
1220
+ route: c + `?${v.toString()}`,
1221
+ on: {
1222
+ complete(y) {
1223
+ o == "onBox" && (d == "instagram" ? (y.setAttribute("video-typeStyle", `${d}`), window.instgrm?.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", rt(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", Y(e.params)), y.setAttribute("video-typeStyle", `${d}`))), o == "inBox" && (y.setAttribute("video-typeStyle", `${d}`), d == "instagram" && (window.instgrm?.Embeds ? (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", rt(e.params)), window.instgrm.Embeds.process()) : console.log("window.instgrm is undefined")));
1224
+ },
1225
+ open(y) {
1226
+ const z = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1227
+ if (f.update(), Lt([...z]), d == "instagram") {
1228
+ const I = document.querySelector("[video-template] .modal-content");
1229
+ new ResizeObserver((M) => {
1230
+ M[0].contentRect.height > 50 && I.classList.add("active");
1231
+ }).observe(I);
1232
+ }
1233
+ if (o == "inBox")
1234
+ if (d == "instagram")
1235
+ m(".video-content").remove();
1236
+ else {
1237
+ let I;
1238
+ const q = y.querySelector(".video-content");
1239
+ i.#e(e.params).then((M) => {
1240
+ I = `
1297
1241
  <div
1298
1242
  class="photo-box"
1299
1243
  video-target
1300
1244
  video-mode="onPage"
1301
- video-type="${u}"
1245
+ video-type="${d}"
1302
1246
  video-id="${l}"
1303
- video-button="${m}"
1304
- video-layout-no="${v}"
1305
- video-starttime="${w}"
1247
+ video-button="${p}"
1248
+ video-layout-no="${g}"
1249
+ video-starttime="${b}"
1306
1250
  >
1307
1251
  <picture>
1308
1252
  <source
1309
- srcset="${Z || ""}"
1253
+ srcset="${M || ""}"
1310
1254
  type="image/webp"
1311
1255
  />
1312
1256
  <source
1313
- srcset="${Z || ""}"
1257
+ srcset="${M || ""}"
1314
1258
  type="image/jpeg"
1315
1259
  />
1316
- <img src="${Z || ""}" alt="" />
1260
+ <img src="${M || ""}" alt="" />
1317
1261
  </picture>
1318
- </div>`, J.insertAdjacentHTML(S.prepend, k);
1319
- const ii = y.querySelectorAll("[video-target]");
1320
- ii.length > 0 && new X(ii, {
1321
- LAYOUT: t.params.LAYOUT,
1322
- videoLayoutNo: t.params.videoLayoutNo
1262
+ </div>`, q.insertAdjacentHTML(E.prepend, I);
1263
+ const st = y.querySelectorAll("[video-target]");
1264
+ st.length > 0 && new W(st, {
1265
+ LAYOUT: e.params.LAYOUT,
1266
+ videoLayoutNo: e.params.videoLayoutNo
1267
+ });
1323
1268
  });
1324
- });
1325
- }
1326
- e == null || e.emit("openModal");
1327
- },
1328
- close(y) {
1329
- const L = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1330
- Ui([...L]), e == null || e.emit("closeModal");
1331
- },
1332
- destroy(y) {
1269
+ }
1270
+ i?.emit("openModal");
1271
+ },
1272
+ close(y) {
1273
+ const z = y.querySelectorAll("[data-overlayscrollbars-viewport]");
1274
+ _t([...z]), i?.emit("closeModal");
1275
+ },
1276
+ destroy(y) {
1277
+ }
1333
1278
  }
1279
+ };
1280
+ C.open(H);
1281
+ } else if (o == "onPage")
1282
+ if (e.params.videoAutoplay = "on", r == "off") {
1283
+ if (n.querySelector("video-player"))
1284
+ return;
1285
+ n.innerHTML = Y(e.params);
1286
+ return;
1287
+ } else {
1288
+ (n.querySelector(r) ?? n).insertAdjacentHTML("beforeend", Y(e.params));
1289
+ return;
1334
1290
  }
1291
+ }
1292
+ #a(t) {
1293
+ const e = this.options;
1294
+ return {
1295
+ $selector: t,
1296
+ videoId: t.getAttribute("video-id"),
1297
+ videoType: t.getAttribute("video-type"),
1298
+ videoAutoplay: t.getAttribute("video-autoplay") || e.videoAutoplay,
1299
+ videoMode: t.getAttribute("video-mode") || e.videoMode,
1300
+ videoButton: t.getAttribute("video-button") || e.videoButton,
1301
+ videoKeep: t.getAttribute("video-keep") || e.videoKeep,
1302
+ videoCover: t.getAttribute("video-cover") || e.videoCover,
1303
+ videoLayoutNo: t.getAttribute("video-layout-no") || e.videoLayoutNo,
1304
+ videoTarget: t.getAttribute("video-target") || e.videoTarget,
1305
+ videoTargetRoute: t.getAttribute("video-target-route") || e.videoTargetRoute,
1306
+ videoStartTime: t.getAttribute("video-starttime") || e.videoStartTime,
1307
+ videoHighQualityPic: t.getAttribute("video-highquality") || e.videoHighQuality,
1308
+ videoIgHtml: t.getAttribute("video-ig") || e.videoIgHtml,
1309
+ videoInboxImg: t.getAttribute("video-inbox-img") || e.videoInboxImgHtml,
1310
+ LAYOUT: e.LAYOUT || []
1335
1311
  };
1336
- tt.open(C);
1337
- } else if (o == "onPage")
1338
- if (t.params.videoAutoplay = "on", r == "off") {
1339
- if (s.querySelector("video-player"))
1340
- return;
1341
- s.innerHTML = yt(t.params);
1342
- return;
1343
- } else {
1344
- (s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", yt(t.params));
1345
- return;
1346
- }
1347
- }, Yt = new WeakSet(), Ji = function(i) {
1348
- const t = this.options;
1349
- return {
1350
- $selector: i,
1351
- videoId: i.getAttribute("video-id"),
1352
- videoType: i.getAttribute("video-type"),
1353
- videoAutoplay: i.getAttribute("video-autoplay") || t.videoAutoplay,
1354
- videoMode: i.getAttribute("video-mode") || t.videoMode,
1355
- videoButton: i.getAttribute("video-button") || t.videoButton,
1356
- videoKeep: i.getAttribute("video-keep") || t.videoKeep,
1357
- videoCover: i.getAttribute("video-cover") || t.videoCover,
1358
- videoLayoutNo: i.getAttribute("video-layout-no") || t.videoLayoutNo,
1359
- videoTarget: i.getAttribute("video-target") || t.videoTarget,
1360
- videoTargetRoute: i.getAttribute("video-target-route") || t.videoTargetRoute,
1361
- videoStartTime: i.getAttribute("video-starttime") || t.videoStartTime,
1362
- videoHighQualityPic: i.getAttribute("video-highquality") || t.videoHighQuality,
1363
- videoIgHtml: i.getAttribute("video-ig") || t.videoIgHtml,
1364
- videoInboxImg: i.getAttribute("video-inbox-img") || t.videoInboxImgHtml,
1365
- LAYOUT: t.LAYOUT || []
1366
- };
1367
- }, si(X, "globalOptions", {});
1368
- let je = X;
1369
- Object.assign(je.prototype, z);
1370
- customElements.define("video-player", en);
1371
- const an = {
1312
+ }
1313
+ update() {
1314
+ this.#t();
1315
+ }
1316
+ }
1317
+ Object.assign(W.prototype, N);
1318
+ customElements.define("video-player", Rt);
1319
+ const Ft = {
1372
1320
  "zh-tw": {
1373
1321
  臺北市: [
1374
1322
  ["中正區", "100"],
@@ -2198,208 +2146,370 @@ const an = {
2198
2146
  ]
2199
2147
  }
2200
2148
  };
2201
- let V;
2202
- const rn = (n) => {
2203
- const { TEMPLATE: i } = ti, { 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");
2204
- e.innerHTML = i(
2205
- s,
2149
+ let G;
2150
+ const Jt = (s) => {
2151
+ const { TEMPLATE: t } = et, { childDom: e } = s.s, i = document.createElement("div"), n = s.classList.contains("filter"), o = s.getAttribute("filter-placeholder"), a = s.getAttribute("d4-icon"), r = s.getAttribute("custom-template");
2152
+ i.innerHTML = t(
2153
+ n,
2206
2154
  o,
2207
2155
  r,
2208
2156
  a
2209
2157
  );
2210
- const l = e.querySelector(".dropdown-list");
2211
- return [...t].forEach((c) => {
2212
- c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((h) => {
2213
- (!h.hasAttribute("data-option") || h.getAttribute("data-option").trim() === "") && h.setAttribute("data-option", h.textContent.trim());
2158
+ const l = i.querySelector(".dropdown-list");
2159
+ return [...e].forEach((c) => {
2160
+ c.tagName === "LI" && (c.classList.contains("has-sublayer") ? [...c.querySelectorAll("li")].forEach((u) => {
2161
+ (!u.hasAttribute("data-option") || u.getAttribute("data-option").trim() === "") && u.setAttribute("data-option", u.textContent.trim());
2214
2162
  }) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
2215
- }), e.children[0];
2216
- }, ln = (n) => {
2217
- var t;
2218
- const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
2219
- i && i.forEach((e) => {
2220
- const s = document.querySelector(e);
2221
- 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 && M(s, [...s.s.allLi].indexOf(s.s.activeLi)));
2163
+ }), i.children[0];
2164
+ }, Zt = (s) => {
2165
+ const t = s.getAttribute("control-elements")?.split(",");
2166
+ t && t.forEach((e) => {
2167
+ const i = document.querySelector(e);
2168
+ i || w("dropdown", `Can't not find control element(${e})`), i && i.classList.contains("disabled") && (i.classList.remove("disabled"), i.tagName === "DROPDOWN-EL" && i.s.activeLi && k(i, [...i.s.allLi].indexOf(i.s.activeLi)));
2222
2169
  });
2223
- }, M = (n, i) => {
2224
- const t = n.getAttribute("d4-placeholder"), e = n.s.dropdownEl.querySelectorAll(".dropdown-list li");
2225
- if (i < 0 || i.length === 0) {
2226
- switch (e.forEach((s) => {
2227
- s.classList.remove("active");
2228
- }), n.s.activeLi = void 0, n.s.selectType) {
2170
+ }, k = (s, t) => {
2171
+ const e = s.getAttribute("d4-placeholder"), i = s.s.dropdownEl.querySelectorAll(".dropdown-list li");
2172
+ if (t < 0 || t.length === 0) {
2173
+ switch (i.forEach((n) => {
2174
+ n.classList.remove("active");
2175
+ }), s.s.activeLi = void 0, s.s.selectType) {
2229
2176
  case "single":
2230
- n.s.value = {
2177
+ s.s.value = {
2231
2178
  index: -1,
2232
2179
  id: void 0,
2233
2180
  el: void 0
2234
2181
  };
2235
2182
  break;
2236
2183
  case "multiple":
2237
- n.s.value = [];
2184
+ s.s.value = [];
2238
2185
  break;
2239
2186
  }
2240
- n.s.selectDisplayEl.textContent = t.trim(), n.setAttribute("d4-value", "");
2187
+ s.s.selectDisplayEl.textContent = e.trim(), s.setAttribute("d4-value", "");
2241
2188
  } else {
2242
- if (n.classList.contains("disabled")) {
2243
- n.s.selectDisplayEl.textContent = t.trim();
2189
+ if (s.classList.contains("disabled")) {
2190
+ s.s.selectDisplayEl.textContent = e.trim();
2244
2191
  return;
2245
2192
  }
2246
- switch (n.s.selectType) {
2193
+ switch (s.s.selectType) {
2247
2194
  case "single":
2248
- const s = e[i].textContent.trim();
2249
- n.s.allLi.forEach((r) => {
2195
+ const n = i[t].textContent.trim();
2196
+ s.s.allLi.forEach((r) => {
2250
2197
  r.classList.remove("active");
2251
- }), e[i].classList.add("active"), n.s.selectDisplayEl.textContent = s, n.s.activeLi = e[i], n.s.value = {
2252
- index: i,
2253
- id: e[i].getAttribute("data-option"),
2254
- el: e[i]
2198
+ }), i[t].classList.add("active"), s.s.selectDisplayEl.textContent = n, s.s.activeLi = i[t], s.s.value = {
2199
+ index: t,
2200
+ id: i[t].getAttribute("data-option"),
2201
+ el: i[t]
2255
2202
  };
2256
2203
  break;
2257
2204
  case "multiple":
2258
- Array.isArray(i) && n.s.allLi.forEach((r) => {
2259
- i.indexOf([...n.s.allLi].indexOf(r)) >= 0 ? r.classList.add("active") : r.classList.remove("active");
2205
+ Array.isArray(t) && s.s.allLi.forEach((r) => {
2206
+ t.indexOf([...s.s.allLi].indexOf(r)) >= 0 ? r.classList.add("active") : r.classList.remove("active");
2260
2207
  });
2261
- const o = n.s.dropdownEl.querySelectorAll(".dropdown-list li.active");
2262
- o.length <= 0 ? n.s.selectDisplayEl.textContent = t.trim() : (n.s.selectDisplayEl.textContent = "", o.forEach((r) => {
2263
- 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>`;
2264
- n.s.selectDisplayEl.insertAdjacentHTML(S.append, u);
2265
- })), n.s.activeLi = o, n.s.value = [...o].map((r) => ({
2266
- index: [...e].indexOf(r),
2208
+ const o = s.s.dropdownEl.querySelectorAll(".dropdown-list li.active");
2209
+ o.length <= 0 ? s.s.selectDisplayEl.textContent = e.trim() : (s.s.selectDisplayEl.textContent = "", o.forEach((r) => {
2210
+ const l = r.getAttribute("data-option"), c = r.textContent.trim(), d = `<div class="option-btn" data-option="${l}"><div class="text">${c}</div><div class="remove-icon"></div></div>`;
2211
+ s.s.selectDisplayEl.insertAdjacentHTML(E.append, d);
2212
+ })), s.s.activeLi = o, s.s.value = [...o].map((r) => ({
2213
+ index: [...i].indexOf(r),
2267
2214
  id: r.getAttribute("data-option"),
2268
2215
  el: r
2269
2216
  }));
2270
2217
  const a = [...o].map((r) => r.getAttribute("data-option"));
2271
- n.setAttribute("d4-value", a.join());
2218
+ s.setAttribute("d4-value", a.join());
2272
2219
  break;
2273
2220
  }
2274
2221
  }
2275
- }, cn = (n) => {
2276
- const i = n.s.cityLang;
2277
- f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (V = JSON.parse(f("#newCityData").val())[0], console.log([0])) : V = an, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(V[i]).forEach((t) => {
2278
- const e = document.createElement("li");
2279
- e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
2280
- }), n.s.allLi = n.s.dropdownEl.querySelectorAll(".dropdown-list li"));
2281
- }, dn = (n, i) => {
2282
- const t = n.s.cityLang;
2283
- V[t][i].forEach((e, s) => {
2222
+ }, Qt = (s) => {
2223
+ const t = s.s.cityLang;
2224
+ m("#newCityData").length > 0 ? m("#newCityData").val() !== "" && (G = JSON.parse(m("#newCityData").val())[0], console.log([0])) : G = Ft, s.classList.contains("city") && (s.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(G[t]).forEach((e) => {
2225
+ const i = document.createElement("li");
2226
+ i.textContent = e, i.setAttribute("data-option", e), s.s.dropdownEl.querySelector(".dropdown-list").append(i);
2227
+ }), s.s.allLi = s.s.dropdownEl.querySelectorAll(".dropdown-list li"));
2228
+ }, Kt = (s, t) => {
2229
+ const e = s.s.cityLang;
2230
+ G[e][t].forEach((i, n) => {
2284
2231
  const o = document.createElement("li");
2285
- o.textContent = e[0], o.setAttribute("data-option", e[0]), n.s.dropdownEl.querySelector(".dropdown-list").append(o);
2232
+ o.textContent = i[0], o.setAttribute("data-option", i[0]), s.s.dropdownEl.querySelector(".dropdown-list").append(o);
2286
2233
  });
2287
- }, Re = () => {
2288
- D('dropdown-el[d4-status="open"]').forEach((i) => {
2289
- i.close();
2234
+ }, V = () => {
2235
+ S('dropdown-el[d4-status="open"]').forEach((t) => {
2236
+ t.close();
2290
2237
  });
2291
- }, un = () => {
2292
- const { SETTINGS: n } = ti;
2293
- ((t, e) => {
2294
- Object.keys(e).forEach((s) => {
2295
- t.style.setProperty(`--${s}`, e[s]);
2238
+ }, Vt = () => {
2239
+ const { SETTINGS: s } = et;
2240
+ ((e, i) => {
2241
+ Object.keys(i).forEach((n) => {
2242
+ e.style.setProperty(`--${n}`, i[n]);
2296
2243
  });
2297
- })(document.documentElement, n.scrollbar);
2244
+ })(document.documentElement, s.scrollbar);
2298
2245
  };
2299
- un();
2246
+ Vt();
2300
2247
  document.addEventListener("click", function() {
2301
- Re();
2248
+ V();
2302
2249
  });
2303
- var Ft, Qi, Jt, Ki, U, Tt, Zt, Vi, Qt, ts;
2304
- class Zi extends HTMLElement {
2250
+ class Dt extends HTMLElement {
2305
2251
  constructor() {
2306
- super();
2307
- p(this, Ft);
2308
- p(this, Jt);
2309
- // -** 獨立 dropdown 出 body 更新
2310
- p(this, U);
2311
- p(this, Zt);
2312
- p(this, Qt);
2313
- this.initialize = !1;
2252
+ super(), this.initialize = !1;
2314
2253
  }
2315
2254
  static get observedAttributes() {
2316
2255
  return ["d4-status", "d4-placeholder", "d4-value"];
2317
2256
  }
2318
- attributeChangedCallback(t, e, s) {
2319
- const o = this;
2257
+ attributeChangedCallback(t, e, i) {
2258
+ const n = this;
2320
2259
  switch (t) {
2321
2260
  case "d4-status":
2322
- if (e === null || e === s)
2323
- return;
2324
- (s === "open" || s === "close") && o.emit(s);
2261
+ if (e === null || e === i) return;
2262
+ (i === "open" || i === "close") && n.emit(i);
2325
2263
  break;
2326
2264
  case "d4-value":
2327
- if (e === null || e === s)
2328
- return;
2329
- if (s !== "")
2330
- switch (o.hasAttribute("multiple") ? "multiple" : "single") {
2265
+ if (e === null || e === i) return;
2266
+ if (i !== "")
2267
+ switch (n.hasAttribute("multiple") ? "multiple" : "single") {
2331
2268
  case "single":
2332
- const r = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${s}"]`);
2333
- A(r) ? M(o, [...o.s.allLi].indexOf(r)) : M(o, -1);
2269
+ const a = n.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${i}"]`);
2270
+ T(a) ? k(n, [...n.s.allLi].indexOf(a)) : k(n, -1);
2334
2271
  break;
2335
2272
  case "multiple":
2336
- const l = [];
2337
- o.s.dropdownEl.querySelector(".dropdown-list li").classList.remove("active"), s.split(",").forEach((u) => {
2338
- const h = o.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${u}"]`);
2339
- A(h) && (h.classList.add("active"), l.push(h));
2273
+ const r = [];
2274
+ n.s.dropdownEl.querySelector(".dropdown-list li").classList.remove("active"), i.split(",").forEach((c) => {
2275
+ const d = n.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${c}"]`);
2276
+ T(d) && (d.classList.add("active"), r.push(d));
2340
2277
  });
2341
- const c = l.map((u) => [...o.s.allLi].indexOf(u));
2342
- M(o, c);
2278
+ const l = r.map((c) => [...n.s.allLi].indexOf(c));
2279
+ k(n, l);
2343
2280
  break;
2344
2281
  }
2345
2282
  else
2346
- M(o, -1);
2347
- o.emit("change");
2283
+ k(n, -1);
2284
+ n.emit("change");
2348
2285
  break;
2349
2286
  case "d4-placeholder":
2350
- if (e === null)
2351
- return;
2352
- e !== s && o.s.value.index < 0 && M(o, o.s.value.index);
2287
+ if (e === null) return;
2288
+ e !== i && n.s.value.index < 0 && k(n, n.s.value.index);
2353
2289
  break;
2354
2290
  }
2355
2291
  }
2356
2292
  connectedCallback() {
2357
2293
  const t = this;
2358
- t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Ft, Qi).call(this));
2294
+ t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, this.#t());
2359
2295
  }
2360
2296
  disconnectedCallback() {
2361
2297
  this.s && this.s.dropdownEl && this.s.dropdownEl.parentNode === document.body && document.body.removeChild(this.s.dropdownEl);
2362
2298
  }
2299
+ #t() {
2300
+ this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), this.#s();
2301
+ }
2302
+ #s() {
2303
+ this.s.childDom = this.childNodes, this.s.template = Jt(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)), this.#i();
2304
+ }
2305
+ // -** 獨立 dropdown 出 body 更新
2306
+ #e() {
2307
+ const t = this, e = t.getBoundingClientRect(), i = t.s.dropdownEl;
2308
+ i.style.position = "fixed", i.style.overflow = "hidden", i.style.left = `${e.left}px`, i.style.width = `${e.width}px`;
2309
+ const n = parseInt(i.style.height) || i.scrollHeight;
2310
+ window.innerHeight - e.bottom < n && e.top > n ? (i.style.top = "auto", i.style.bottom = `${window.innerHeight - e.top + 5}px`) : (i.style.top = `${e.bottom + 5}px`, i.style.bottom = "auto");
2311
+ }
2312
+ #i() {
2313
+ const t = this;
2314
+ 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", Qt(t), t.s.subDropdownTotalH = 0;
2315
+ const e = t.getAttribute("d4-value");
2316
+ switch (t.s.selectType) {
2317
+ case "single":
2318
+ let i;
2319
+ if (t.classList.contains("dist")) {
2320
+ const o = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), a = o ? o.getAttribute("d4-value") !== "" : !1;
2321
+ if (o && a) {
2322
+ const r = o.getAttribute("d4-value");
2323
+ if (Kt(t, r), t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2324
+ const l = e.split(",")[1];
2325
+ i = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${l}"]`), t.setAttribute("d4-value", l);
2326
+ }
2327
+ }
2328
+ } else
2329
+ i = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
2330
+ T(i) ? (i.classList.add("active"), t.s.activeLi = i, t.s.value = {
2331
+ index: [...t.s.allLi].indexOf(i),
2332
+ id: e,
2333
+ el: i
2334
+ }) : (t.s.activeLi = void 0, t.s.value = {
2335
+ index: -1,
2336
+ id: void 0,
2337
+ el: void 0
2338
+ });
2339
+ break;
2340
+ case "multiple":
2341
+ const n = [];
2342
+ e.split(",").forEach((o) => {
2343
+ const a = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${o}"]`);
2344
+ T(a) && n.push(a);
2345
+ }), n.length > 0 ? t.s.value = {
2346
+ index: n.map((o) => [...t.s.allLi].indexOf(o)),
2347
+ id: n.map((o) => o.getAttribute("data-option")),
2348
+ el: n.map((o) => o)
2349
+ } : t.s.value = {
2350
+ index: [],
2351
+ id: void 0,
2352
+ el: void 0
2353
+ };
2354
+ break;
2355
+ }
2356
+ k(t, t.s.value.index), t.#n(), t.classList.add("d4-initialize");
2357
+ }
2358
+ #n() {
2359
+ const t = this;
2360
+ t.__events__.dropdownToggle = () => {
2361
+ t.addEventListener("click", function(e) {
2362
+ switch (e.stopPropagation(), t.getAttribute("d4-status")) {
2363
+ case "open":
2364
+ t.close();
2365
+ break;
2366
+ case "close":
2367
+ t.open();
2368
+ break;
2369
+ }
2370
+ });
2371
+ }, t.__events__.transitionend = () => {
2372
+ function e(i) {
2373
+ if (i.target === this) {
2374
+ const n = t.getAttribute("d4-status"), o = t.classList.contains("filter");
2375
+ switch (n) {
2376
+ case "open":
2377
+ const a = t.s.dropdownEl.querySelector(".dropdown-scroller"), r = () => {
2378
+ if (t.__scroller__) {
2379
+ const { viewport: l } = t.__scroller__.elements();
2380
+ if (T(t.s.activeLi)) {
2381
+ const c = t.s.activeLi.clientHeight / 2, d = t.s.activeLi.offsetTop, u = d - a.clientHeight / 2 + c > 0 ? d - a.clientHeight / 2 + c : 0;
2382
+ l.scrollTo({
2383
+ top: u,
2384
+ behavior: "smooth"
2385
+ });
2386
+ } else
2387
+ l.scrollTo({
2388
+ top: 0,
2389
+ behavior: "smooth"
2390
+ });
2391
+ }
2392
+ };
2393
+ t.s.subDropdownTotalH > 0 && t.__scroller__ && t.__scroller__.update(!0), o && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && r();
2394
+ break;
2395
+ case "close":
2396
+ t.getAttribute("d4-portal") == "true" ? (t.__scroller__ && t.__scroller__.update(!0), t.s.dropdownEl.style.height = "", t.s.dropdownEl.style.zIndex = "", o && (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"), o && (t.querySelector(".filter-bar input").disabled = !0));
2397
+ break;
2398
+ }
2399
+ }
2400
+ }
2401
+ t.s.dropdownEl.addEventListener("transitionend", e);
2402
+ }, t.__events__.bindScrollbar = (e = this) => {
2403
+ const i = e.s.dropdownEl.querySelector(".dropdown-scroller");
2404
+ e.__scroller__ = tt(i, {
2405
+ overflowBehavior: {
2406
+ x: "hidden"
2407
+ }
2408
+ });
2409
+ }, t.__events__.selectOption = (e = this) => {
2410
+ let i, n;
2411
+ const o = e.s.dropdownEl.querySelector(".dropdown-scroller"), a = e.classList.contains("city");
2412
+ e.s.allLi = e.s.dropdownEl.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((r) => {
2413
+ r.addEventListener("click", function(l) {
2414
+ const c = this, d = [...e.s.allLi].indexOf(c), u = parseInt(e.getAttribute("d4-default-height"));
2415
+ if (c.classList.contains("has-sublayer")) {
2416
+ l.stopPropagation();
2417
+ const h = c.querySelector(".sub-dropdown"), p = h.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(p).marginTop) + parseInt(getComputedStyle(p).marginBottom);
2418
+ h.style.cssText = `--height: ${p.offsetHeight + g}px`;
2419
+ const b = parseInt(h.style.cssText.replace("--height:", "").trim()), f = parseInt(getComputedStyle(o).maxHeight), v = () => {
2420
+ i = u + e.s.subDropdownTotalH, n = i > f ? f : i, e.getAttribute("d4-portal") == "true" ? e.s.dropdownEl.style.setProperty("--maxHeight", `${n}px`) : e.style.cssText = `--maxHeight: ${n}px;`, e.s.dropdownEl.style.height = `${n}px`;
2421
+ };
2422
+ c.classList.contains("open") ? (c.classList.remove("open"), e.s.subDropdownTotalH -= b, v()) : (c.classList.add("open"), e.s.subDropdownTotalH += b, v());
2423
+ const H = () => {
2424
+ e.__scroller__.update(!0), h.removeEventListener("transitionend", H);
2425
+ };
2426
+ h.addEventListener("transitionend", H);
2427
+ } else
2428
+ switch (Zt(e), e.s.selectType) {
2429
+ // 單選
2430
+ case "single":
2431
+ if (e.setAttribute("d4-value", c.getAttribute("data-option")), a) {
2432
+ const h = e.s.cityLang, p = r.textContent.trim(), g = document.getElementById(e.getAttribute("dist-select"));
2433
+ g && (g.s.dropdownEl.querySelector(".dropdown-list").textContent = "", k(g, -1), G[h][p].forEach((b, f) => {
2434
+ const v = document.createElement("li");
2435
+ v.textContent = b[0], v.setAttribute("data-option", b[0]), e.getAttribute("d4-portal") == "true" ? g.s.dropdownEl.querySelector(".dropdown-list").append(v) : g.querySelector(".dropdown-list").append(v);
2436
+ }), e.__events__.selectOption(g));
2437
+ }
2438
+ (e.getAttribute("d4-portal") == "true" || c.parentNode.closest("li")?.classList.contains("has-sublayer")) && (l.stopPropagation(), e.close());
2439
+ break;
2440
+ // 複選
2441
+ case "multiple":
2442
+ l.stopPropagation(), c.classList.toggle("active"), k(e, d);
2443
+ break;
2444
+ }
2445
+ });
2446
+ });
2447
+ }, t.__events__.filterHandler = () => {
2448
+ t.classList.contains("filter") && (t.s.dropdownEl.querySelector(".filter-bar").addEventListener("click", function(e) {
2449
+ e.stopPropagation();
2450
+ }), t.s.dropdownEl.querySelector(".filter-input").addEventListener("input", function() {
2451
+ const e = this.value.toUpperCase();
2452
+ t.s.allLi.forEach((i) => {
2453
+ i.textContent.toUpperCase().includes(e) ? i.removeAttribute("style") : i.style.display = "none";
2454
+ });
2455
+ }));
2456
+ }, t.__events__.removeTag = () => {
2457
+ t.s.selectType !== "single" && t.s.selectDisplayEl.addEventListener("click", function(e) {
2458
+ if (e.target.classList.contains("select-display")) return;
2459
+ if ((e.target.classList.contains("option-btn") ? e.target : e.target.parentElement).contains(e.target) && (e.stopPropagation(), e.target.classList.contains("remove-icon"))) {
2460
+ const o = e.target.parentElement.getAttribute("data-option");
2461
+ t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${o}"]`).classList.remove("active"), t.s.activeLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li.active"), e.target.parentElement.remove();
2462
+ const a = [...t.s.activeLi];
2463
+ t.s.value = a.map((l) => ({
2464
+ index: [...t.s.allLi].indexOf(l),
2465
+ id: l.getAttribute("data-option"),
2466
+ el: l
2467
+ })), t.s.activeLi = a;
2468
+ const r = a.map((l) => l.getAttribute("data-option"));
2469
+ t.setAttribute("d4-value", r.join()), a.length <= 0 && (t.s.selectDisplayEl.textContent = t.getAttribute("d4-placeholder").trim());
2470
+ }
2471
+ });
2472
+ }, t.__events__.dropdownToggle(), t.getAttribute("d4-portal") != "true" && t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
2473
+ }
2363
2474
  open() {
2364
2475
  const t = this;
2365
2476
  let e;
2366
- t.getAttribute("d4-portal") == "true" ? (Re(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), d(this, U, Tt).call(this), t.s.dropdownEl.offsetHeight, e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
2367
- const s = t.classList.contains("filter"), o = () => {
2477
+ t.getAttribute("d4-portal") == "true" ? (V(), t.s.dropdownEl.parentNode !== document.body && document.body.appendChild(t.s.dropdownEl), t.__scroller__ || t.__events__.bindScrollbar(), this.#e(), t.s.dropdownEl.offsetHeight, e = t.s.dropdownEl.querySelector(".dropdown-scroller").clientHeight) : e = t.querySelector(".dropdown-scroller").clientHeight;
2478
+ const i = t.classList.contains("filter"), n = () => {
2368
2479
  if (t.getAttribute("d4-portal") == "true") {
2369
- if (s)
2480
+ if (i)
2370
2481
  return t.s.dropdownEl.querySelector(".dropdown-scroller .filter-bar") ? e : t.s.dropdownEl.querySelector(".filter-bar").clientHeight + e;
2371
- } else if (s)
2482
+ } else if (i)
2372
2483
  return t.querySelector(".dropdown-scroller .filter-bar") ? e : t.querySelector(".filter-bar").clientHeight + e;
2373
2484
  return e;
2374
2485
  };
2375
2486
  t.s.subDropdownTotalH = 0;
2376
- const a = t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.querySelector(".dropdown-scroller") : t.querySelector(".dropdown-scroller"), r = parseInt(getComputedStyle(a).maxHeight);
2377
- t.s.dropdownEl.querySelectorAll('.has-sublayer[data-open="true"]').forEach((c) => {
2378
- const u = c.querySelector(".sub-dropdown"), h = u.querySelector(".sub-dropdown-list"), g = parseInt(getComputedStyle(h).marginTop) + parseInt(getComputedStyle(h).marginBottom);
2379
- u.style.cssText = `--height: ${h.offsetHeight + g}px`, t.s.subDropdownTotalH += parseInt(u.style.cssText.replace("--height:", "").trim()), c.classList.add("open");
2487
+ const o = t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.querySelector(".dropdown-scroller") : t.querySelector(".dropdown-scroller"), a = parseInt(getComputedStyle(o).maxHeight);
2488
+ t.s.dropdownEl.querySelectorAll('.has-sublayer[data-open="true"]').forEach((l) => {
2489
+ const c = l.querySelector(".sub-dropdown"), d = c.querySelector(".sub-dropdown-list"), u = parseInt(getComputedStyle(d).marginTop) + parseInt(getComputedStyle(d).marginBottom);
2490
+ c.style.cssText = `--height: ${d.offsetHeight + u}px`, t.s.subDropdownTotalH += parseInt(c.style.cssText.replace("--height:", "").trim()), l.classList.add("open");
2380
2491
  });
2381
- const l = () => {
2382
- const c = o() + t.s.subDropdownTotalH;
2383
- return c > r ? r : c;
2492
+ const r = () => {
2493
+ const l = n() + t.s.subDropdownTotalH;
2494
+ return l > a ? a : l;
2384
2495
  };
2385
- return t.getAttribute("d4-portal") !== "true" && Re(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${l()}px`), t.s.dropdownEl.style.zIndex = "9999", d(this, U, Tt).call(this), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${l()}px`, t.__events__._scrollUpdate = () => {
2386
- var u;
2387
- const c = t.getBoundingClientRect();
2388
- c.bottom < 0 || c.top > window.innerHeight ? t.close() : d(u = t, U, Tt).call(u);
2389
- }, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${l()}px;`, t.s.dropdownEl.style.cssText = `
2390
- height: ${l()}px;
2496
+ return t.getAttribute("d4-portal") !== "true" && V(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", n()), t.getAttribute("d4-portal") == "true" ? (t.s.dropdownEl.style.setProperty("--maxHeight", `${r()}px`), t.s.dropdownEl.style.zIndex = "9999", this.#e(), t.s.dropdownEl.offsetHeight, t.s.dropdownEl.style.height = `${r()}px`, t.__events__._scrollUpdate = () => {
2497
+ const l = t.getBoundingClientRect();
2498
+ l.bottom < 0 || l.top > window.innerHeight ? t.close() : t.#e();
2499
+ }, window.addEventListener("scroll", t.__events__._scrollUpdate, { passive: !0, capture: !0 }), window.addEventListener("resize", t.__events__._scrollUpdate, { passive: !0 })) : (t.style.cssText = `--maxHeight: ${r()}px;`, t.s.dropdownEl.style.cssText = `
2500
+ height: ${r()}px;
2391
2501
  z-index: 2;
2392
2502
  `), this;
2393
2503
  }
2394
2504
  close() {
2395
- const t = this, e = t.s.dropdownEl.querySelectorAll(".has-sublayer"), s = parseInt(t.getAttribute("d4-default-height"));
2396
- 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) => {
2397
- o.classList.remove("open");
2398
- }), 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;
2505
+ const t = this, e = t.s.dropdownEl.querySelectorAll(".has-sublayer"), i = parseInt(t.getAttribute("d4-default-height"));
2506
+ 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((n) => {
2507
+ n.classList.remove("open");
2508
+ }), t.getAttribute("d4-portal") == "true" ? t.s.dropdownEl.style.setProperty("--maxHeight", `${i}px`) : t.style.cssText = `--maxHeight: ${i}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((n) => n.removeAttribute("style"))), this;
2399
2509
  }
2400
2510
  scrollTo(t) {
2401
- const e = this, { viewport: s } = e.__scroller__.elements();
2402
- s.scrollTo({
2511
+ const e = this, { viewport: i } = e.__scroller__.elements();
2512
+ i.scrollTo({
2403
2513
  top: t,
2404
2514
  behavior: "smooth"
2405
2515
  });
@@ -2408,294 +2518,232 @@ class Zi extends HTMLElement {
2408
2518
  this.__events__.selectOption();
2409
2519
  }
2410
2520
  }
2411
- Ft = new WeakSet(), Qi = function() {
2412
- this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Jt, Ki).call(this);
2413
- }, Jt = new WeakSet(), Ki = function() {
2414
- this.s.childDom = this.childNodes, this.s.template = rn(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, Zt, Vi).call(this);
2415
- }, U = new WeakSet(), Tt = function() {
2416
- const t = this, e = t.getBoundingClientRect(), s = t.s.dropdownEl;
2417
- s.style.position = "fixed", s.style.overflow = "hidden", s.style.left = `${e.left}px`, s.style.width = `${e.width}px`;
2418
- const o = parseInt(s.style.height) || s.scrollHeight;
2419
- window.innerHeight - e.bottom < o && e.top > o ? (s.style.top = "auto", s.style.bottom = `${window.innerHeight - e.top + 5}px`) : (s.style.top = `${e.bottom + 5}px`, s.style.bottom = "auto");
2420
- }, Zt = new WeakSet(), Vi = function() {
2421
- var s;
2422
- const t = this;
2423
- 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", cn(t), t.s.subDropdownTotalH = 0;
2424
- const e = t.getAttribute("d4-value");
2425
- switch (t.s.selectType) {
2426
- case "single":
2427
- let o;
2428
- if (t.classList.contains("dist")) {
2429
- const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
2430
- if (r && l) {
2431
- const c = r.getAttribute("d4-value");
2432
- if (dn(t, c), t.s.allLi = t.s.dropdownEl.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
2433
- const u = e.split(",")[1];
2434
- o = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
2435
- }
2436
- }
2437
- } else
2438
- o = t.querySelector(`.dropdown-list li[data-option="${e}"]`);
2439
- A(o) ? (o.classList.add("active"), t.s.activeLi = o, t.s.value = {
2440
- index: [...t.s.allLi].indexOf(o),
2441
- id: e,
2442
- el: o
2443
- }) : (t.s.activeLi = void 0, t.s.value = {
2444
- index: -1,
2445
- id: void 0,
2446
- el: void 0
2447
- });
2448
- break;
2449
- case "multiple":
2450
- const a = [];
2451
- e.split(",").forEach((r) => {
2452
- const l = t.s.dropdownEl.querySelector(`.dropdown-list li[data-option="${r}"]`);
2453
- A(l) && a.push(l);
2454
- }), a.length > 0 ? t.s.value = {
2455
- index: a.map((r) => [...t.s.allLi].indexOf(r)),
2456
- id: a.map((r) => r.getAttribute("data-option")),
2457
- el: a.map((r) => r)
2458
- } : t.s.value = {
2459
- index: [],
2460
- id: void 0,
2461
- el: void 0
2462
- };
2463
- break;
2464
- }
2465
- M(t, t.s.value.index), d(s = t, Qt, ts).call(s), t.classList.add("d4-initialize");
2466
- }, Qt = new WeakSet(), ts = function() {
2467
- const t = this;
2468
- t.__events__.dropdownToggle = () => {
2469
- t.addEventListener("click", function(e) {
2470
- switch (e.stopPropagation(), t.getAttribute("d4-status")) {
2471
- case "open":
2472
- t.close();
2473
- break;
2474
- case "close":
2475
- t.open();
2476
- break;
2477
- }
2478
- });
2479
- }, t.__events__.transitionend = () => {
2480
- function e(s) {
2481
- if (s.target === this) {
2482
- const o = t.getAttribute("d4-status"), a = t.classList.contains("filter");
2483
- switch (o) {
2484
- case "open":
2485
- const r = t.s.dropdownEl.querySelector(".dropdown-scroller"), l = () => {
2486
- if (t.__scroller__) {
2487
- const { viewport: c } = t.__scroller__.elements();
2488
- if (A(t.s.activeLi)) {
2489
- const u = t.s.activeLi.clientHeight / 2, h = t.s.activeLi.offsetTop, g = h - r.clientHeight / 2 + u > 0 ? h - r.clientHeight / 2 + u : 0;
2490
- c.scrollTo({
2491
- top: g,
2492
- behavior: "smooth"
2493
- });
2494
- } else
2495
- c.scrollTo({
2496
- top: 0,
2497
- behavior: "smooth"
2498
- });
2499
- }
2500
- };
2501
- t.s.subDropdownTotalH > 0 && t.__scroller__ && t.__scroller__.update(!0), a && (t.s.dropdownEl.querySelector(".filter-bar input").disabled = !1, t.s.dropdownEl.querySelector(".filter-bar input").focus()), t.s.selectType === "single" && l();
2502
- break;
2503
- case "close":
2504
- 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));
2505
- break;
2506
- }
2507
- }
2521
+ Object.assign(Dt.prototype, N);
2522
+ customElements.define("dropdown-el", Dt);
2523
+ function J(s) {
2524
+ const t = {};
2525
+ return [...s.attributes].forEach((e) => {
2526
+ if (e.name.includes("duration-")) {
2527
+ const i = e.name.replace("duration-", ""), n = e.nodeValue;
2528
+ t[i] = Number(n);
2508
2529
  }
2509
- t.s.dropdownEl.addEventListener("transitionend", e);
2510
- }, t.__events__.bindScrollbar = (e = this) => {
2511
- const s = e.s.dropdownEl.querySelector(".dropdown-scroller");
2512
- e.__scroller__ = Ve(s, {
2513
- overflowBehavior: {
2514
- x: "hidden"
2515
- }
2516
- });
2517
- }, t.__events__.selectOption = (e = this) => {
2518
- let s, o;
2519
- const a = e.s.dropdownEl.querySelector(".dropdown-scroller"), r = e.classList.contains("city");
2520
- e.s.allLi = e.s.dropdownEl.querySelectorAll(".dropdown-list li"), e.s.allLi.forEach((l) => {
2521
- l.addEventListener("click", function(c) {
2522
- var m;
2523
- const u = this, h = [...e.s.allLi].indexOf(u), g = parseInt(e.getAttribute("d4-default-height"));
2524
- if (u.classList.contains("has-sublayer")) {
2525
- c.stopPropagation();
2526
- const v = u.querySelector(".sub-dropdown"), w = v.querySelector(".sub-dropdown-list"), b = parseInt(getComputedStyle(w).marginTop) + parseInt(getComputedStyle(w).marginBottom);
2527
- v.style.cssText = `--height: ${w.offsetHeight + b}px`;
2528
- const T = parseInt(v.style.cssText.replace("--height:", "").trim()), C = parseInt(getComputedStyle(a).maxHeight), y = () => {
2529
- 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`;
2530
- };
2531
- u.classList.contains("open") ? (u.classList.remove("open"), e.s.subDropdownTotalH -= T, y()) : (u.classList.add("open"), e.s.subDropdownTotalH += T, y());
2532
- const L = () => {
2533
- e.__scroller__.update(!0), v.removeEventListener("transitionend", L);
2534
- };
2535
- v.addEventListener("transitionend", L);
2536
- } else
2537
- switch (ln(e), e.s.selectType) {
2538
- case "single":
2539
- if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
2540
- const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
2541
- b && (b.s.dropdownEl.querySelector(".dropdown-list").textContent = "", M(b, -1), V[v][w].forEach((T, C) => {
2542
- const y = document.createElement("li");
2543
- 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);
2544
- }), e.__events__.selectOption(b));
2545
- }
2546
- (e.getAttribute("d4-portal") == "true" || (m = u.parentNode.closest("li")) != null && m.classList.contains("has-sublayer")) && (c.stopPropagation(), e.close());
2547
- break;
2548
- case "multiple":
2549
- c.stopPropagation(), u.classList.toggle("active"), M(e, h);
2550
- break;
2551
- }
2552
- });
2553
- });
2554
- }, t.__events__.filterHandler = () => {
2555
- t.classList.contains("filter") && (t.s.dropdownEl.querySelector(".filter-bar").addEventListener("click", function(e) {
2556
- e.stopPropagation();
2557
- }), t.s.dropdownEl.querySelector(".filter-input").addEventListener("input", function() {
2558
- const e = this.value.toUpperCase();
2559
- t.s.allLi.forEach((s) => {
2560
- s.textContent.toUpperCase().includes(e) ? s.removeAttribute("style") : s.style.display = "none";
2561
- });
2562
- }));
2563
- }, t.__events__.removeTag = () => {
2564
- t.s.selectType !== "single" && t.s.selectDisplayEl.addEventListener("click", function(e) {
2565
- if (e.target.classList.contains("select-display"))
2566
- return;
2567
- if ((e.target.classList.contains("option-btn") ? e.target : e.target.parentElement).contains(e.target) && (e.stopPropagation(), e.target.classList.contains("remove-icon"))) {
2568
- const a = e.target.parentElement.getAttribute("data-option");
2569
- 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();
2570
- const r = [...t.s.activeLi];
2571
- t.s.value = r.map((c) => ({
2572
- index: [...t.s.allLi].indexOf(c),
2573
- id: c.getAttribute("data-option"),
2574
- el: c
2575
- })), t.s.activeLi = r;
2576
- const l = r.map((c) => c.getAttribute("data-option"));
2577
- t.setAttribute("d4-value", l.join()), r.length <= 0 && (t.s.selectDisplayEl.textContent = t.getAttribute("d4-placeholder").trim());
2578
- }
2579
- });
2580
- }, t.__events__.dropdownToggle(), t.getAttribute("d4-portal") != "true" && t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
2581
- };
2582
- Object.assign(Zi.prototype, z);
2583
- customElements.define("dropdown-el", Zi);
2584
- function Et(n) {
2585
- const i = {};
2586
- return [...n.attributes].forEach((t) => {
2587
- if (t.name.includes("duration-")) {
2588
- const e = t.name.replace("duration-", ""), s = t.nodeValue;
2589
- i[e] = Number(s);
2590
- }
2591
- }), Object.keys(i).length === 0 ? null : i;
2530
+ }), Object.keys(t).length === 0 ? null : t;
2592
2531
  }
2593
- function li(n) {
2594
- if (Et(n)) {
2595
- let i;
2596
- const t = Object.keys(Et(n)).map((e) => ({
2597
- value: e,
2598
- point: e
2532
+ function lt(s) {
2533
+ if (J(s)) {
2534
+ let t;
2535
+ const e = Object.keys(J(s)).map((i) => ({
2536
+ value: i,
2537
+ point: i
2599
2538
  }));
2600
- t.sort((e, s) => parseInt(s.value, 10) - parseInt(e.value, 10));
2601
- for (let e = 0; e < t.length; e += 1) {
2602
- const { point: s, value: o } = t[e];
2603
- window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
2539
+ e.sort((i, n) => parseInt(n.value, 10) - parseInt(i.value, 10));
2540
+ for (let i = 0; i < e.length; i += 1) {
2541
+ const { point: n, value: o } = e[i];
2542
+ window.matchMedia(`(max-width: ${o}px)`).matches && (t = n);
2604
2543
  }
2605
- return i ? Number(Et(n)[i]) : n.s.options.duration;
2544
+ return t ? Number(J(s)[t]) : s.s.options.duration;
2606
2545
  } else
2607
- return n.s.options.duration;
2546
+ return s.s.options.duration;
2608
2547
  }
2609
- function pn(n) {
2610
- const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
2611
- o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
2548
+ function te(s) {
2549
+ const { behavior: t, continual: e, gap: i } = s.s.options, n = s.childNodes, o = document.createElement("div"), a = document.createElement("div");
2550
+ o.className = "animate-container", a.className = "animate-item", [...n].forEach((l) => {
2612
2551
  a.append(l);
2613
2552
  });
2614
2553
  function r() {
2615
2554
  const l = a.cloneNode(!0);
2616
- return l.classList.add("clone"), n.s.cloneAnimation = null, n.s.cloneAnimateEl = l, l;
2555
+ return l.classList.add("clone"), s.s.cloneAnimation = null, s.s.cloneAnimateEl = l, l;
2617
2556
  }
2618
- n.s.animation = null, n.s.animateEl = a, n.textContent = "", o.append(a), n.append(o), a.clientWidth * 2 + e >= n.clientWidth ? i === "normal" && t && o.append(r()) : n.s.options.continual = !1;
2557
+ s.s.animation = null, s.s.animateEl = a, s.textContent = "", o.append(a), s.append(o), a.clientWidth * 2 + i >= s.clientWidth ? t === "normal" && e && o.append(r()) : s.s.options.continual = !1;
2619
2558
  }
2620
- function H(n) {
2621
- const { behavior: i, direction: t, continual: e } = n.s.options;
2622
- let s = {};
2623
- switch (i) {
2559
+ function D(s) {
2560
+ const { behavior: t, direction: e, continual: i } = s.s.options;
2561
+ let n = {};
2562
+ switch (t) {
2624
2563
  case "normal":
2625
2564
  let o, a;
2626
- switch (t) {
2565
+ switch (e) {
2627
2566
  case "top":
2628
- o = e ? "translate3d(0,100%,0)" : `translate3d(0,${n.clientHeight}px,0)`, a = "translate3d(0,-100%,0)", s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
2567
+ o = i ? "translate3d(0,100%,0)" : `translate3d(0,${s.clientHeight}px,0)`, a = "translate3d(0,-100%,0)", n.animate1 = [{ transform: o }, { transform: a }], i && (n.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(0,-200%,0)" }]);
2629
2568
  break;
2630
2569
  case "right":
2631
- o = e ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", a = e ? "translate3d(200%,0,0)" : `translate3d(${n.clientWidth}px,0,0)`, s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
2570
+ o = i ? "translate3d(0,0,0)" : "translate3d(-100%,0,0)", a = i ? "translate3d(200%,0,0)" : `translate3d(${s.clientWidth}px,0,0)`, n.animate1 = [{ transform: o }, { transform: a }], i && (n.animate2 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(100%,0,0)" }]);
2632
2571
  break;
2633
2572
  case "bottom":
2634
- o = "translate3d(0,-100%,0)", a = e ? "translate3d(0,100%,0)" : `translate3d(0,${n.clientHeight}px,0)`, s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
2573
+ o = "translate3d(0,-100%,0)", a = i ? "translate3d(0,100%,0)" : `translate3d(0,${s.clientHeight}px,0)`, n.animate1 = [{ transform: o }, { transform: a }], i && (n.animate2 = [{ transform: "translate3d(0,-200%,0)" }, { transform: "translate3d(0,0,0)" }]);
2635
2574
  break;
2636
2575
  case "left":
2637
- o = e ? "translate3d(100%,0,0)" : `translate3d(${n.clientWidth}px,0,0)`, a = "translate3d(-100%,0,0)", s.animate1 = [{ transform: o }, { transform: a }], e && (s.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
2576
+ o = i ? "translate3d(100%,0,0)" : `translate3d(${s.clientWidth}px,0,0)`, a = "translate3d(-100%,0,0)", n.animate1 = [{ transform: o }, { transform: a }], i && (n.animate2 = [{ transform: "translate3d(0,0,0)" }, { transform: "translate3d(-200%,0,0)" }]);
2638
2577
  break;
2639
2578
  }
2640
2579
  break;
2580
+ // 來回模式
2641
2581
  case "alternate":
2642
- switch (t) {
2582
+ switch (e) {
2643
2583
  case "top":
2644
- s.animate1 = [{ transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }];
2584
+ n.animate1 = [{ transform: `translate3d(0,calc(${s.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${s.clientHeight}px - 100%),0)` }];
2645
2585
  break;
2646
2586
  case "right":
2647
- s.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${n.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
2587
+ n.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${s.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }];
2648
2588
  break;
2649
2589
  case "bottom":
2650
- s.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
2590
+ n.animate1 = [{ transform: "translate3d(0,0,0)" }, { transform: `translate3d(0,calc(${s.clientHeight}px - 100%),0)` }, { transform: "translate3d(0,0,0)" }];
2651
2591
  break;
2652
2592
  case "left":
2653
- s.animate1 = [{ transform: `translate3d(calc(-100% + ${n.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${n.clientWidth}px),0,0)` }];
2593
+ n.animate1 = [{ transform: `translate3d(calc(-100% + ${s.clientWidth}px),0,0)` }, { transform: "translate3d(0,0,0)" }, { transform: `translate3d(calc(-100% + ${s.clientWidth}px),0,0)` }];
2654
2594
  break;
2655
2595
  }
2656
2596
  break;
2657
2597
  case "endStop":
2658
- switch (t) {
2598
+ switch (e) {
2659
2599
  case "top":
2660
- s.animate1 = [{ transform: `translate3d(0,${n.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
2600
+ n.animate1 = [{ transform: `translate3d(0,${s.clientHeight}px,0)` }, { transform: "translate3d(0,0,0)" }];
2661
2601
  break;
2662
2602
  case "right":
2663
- s.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2603
+ n.animate1 = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2664
2604
  break;
2665
2605
  case "bottom":
2666
- s.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${n.clientHeight}px - 100%),0)` }];
2606
+ n.animate1 = [{ transform: "translate3d(0,-100%,0)" }, { transform: `translate3d(0,calc(${s.clientHeight}px - 100%),0)` }];
2667
2607
  break;
2668
2608
  case "left":
2669
- s.animate1 = [{ transform: `translate3d(${n.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${n.clientWidth}px - 100%),0,0)` }];
2609
+ n.animate1 = [{ transform: `translate3d(${s.clientWidth}px,0,0)` }, { transform: `translate3d(calc(${s.clientWidth}px - 100%),0,0)` }];
2670
2610
  break;
2671
2611
  }
2672
2612
  break;
2673
2613
  }
2674
- return s;
2614
+ return n;
2675
2615
  }
2676
- function hn(n) {
2677
- let i;
2678
- return function(t) {
2679
- i && clearTimeout(i), i = setTimeout(n, 200, t);
2616
+ function ee(s) {
2617
+ let t;
2618
+ return function(e) {
2619
+ t && clearTimeout(t), t = setTimeout(s, 200, e);
2680
2620
  };
2681
2621
  }
2682
- var Kt, es, Vt, is, te, ss, ee, ns;
2683
- class mn extends HTMLElement {
2622
+ class ie extends HTMLElement {
2684
2623
  constructor() {
2685
- super();
2686
- p(this, Kt);
2687
- p(this, Vt);
2688
- p(this, te);
2689
- p(this, ee);
2690
- this.initialize = !1;
2624
+ super(), this.initialize = !1;
2691
2625
  }
2692
2626
  static get observedAttributes() {
2693
2627
  return [];
2694
2628
  }
2695
- attributeChangedCallback(t, e, s) {
2629
+ attributeChangedCallback(t, e, i) {
2696
2630
  }
2697
2631
  connectedCallback() {
2698
- this.initialize || (this.initialize = !0, d(this, Kt, es).call(this));
2632
+ this.initialize || (this.initialize = !0, this.#t());
2633
+ }
2634
+ #t() {
2635
+ const t = {
2636
+ direction: this.getAttribute("direction") || $.SETTINGS.direction,
2637
+ // up / down / left / right
2638
+ behavior: this.getAttribute("behavior") || $.SETTINGS.behavior,
2639
+ // normal / alternate / endStop
2640
+ duration: Number(this.getAttribute("duration")) || $.SETTINGS.duration,
2641
+ // ms
2642
+ durationBreakpoints: J(this) || $.SETTINGS.durationBreakpoints,
2643
+ autoplay: this.getAttribute("autoplay") || $.SETTINGS.autoplay,
2644
+ // normal / alternate / endStop
2645
+ pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : $.SETTINGS.pauseOnMouseenter,
2646
+ // true / false
2647
+ continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : $.SETTINGS.continual,
2648
+ // true / false
2649
+ gap: Number(this.getAttribute("gap")) || $.SETTINGS.gap
2650
+ };
2651
+ this.s = {}, this.s.options = t, this.s.nowDuration = lt(this), te(this), this.#s();
2652
+ }
2653
+ #s() {
2654
+ const { direction: t, continual: e, gap: i } = this.s.options;
2655
+ switch (t) {
2656
+ case "left":
2657
+ case "right":
2658
+ this.style.cssText = `--continual-gap: ${i}px;`;
2659
+ break;
2660
+ case "top":
2661
+ case "bottom":
2662
+ e ? this.style.cssText = `height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${i}px;` : this.style.cssText = `min-height: ${this.s.animateEl.clientHeight}px;--continual-gap: ${i}px;`;
2663
+ break;
2664
+ }
2665
+ this.#e(), this.#i(), e && this.classList.add("continual"), this.classList.add("m4-initialize");
2666
+ }
2667
+ #e() {
2668
+ const t = this, { direction: e, behavior: i, duration: n, autoplay: o, pauseOnMouseenter: a, continual: r } = t.s.options;
2669
+ let l;
2670
+ function c() {
2671
+ switch (i) {
2672
+ case "normal":
2673
+ t.s.animateEl.style.transform = `${D(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2674
+ duration: t.s.nowDuration,
2675
+ iterations: 1 / 0
2676
+ }), r && (t.s.cloneAnimateEl.style.transform = `${D(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(D(t).animate2, {
2677
+ duration: t.s.nowDuration,
2678
+ delay: -t.s.nowDuration / 2,
2679
+ iterations: 1 / 0
2680
+ }));
2681
+ break;
2682
+ case "alternate":
2683
+ let h = function() {
2684
+ let p = [];
2685
+ switch (e) {
2686
+ case "top":
2687
+ d = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), u = parseInt(t.s.nowDuration / (d * 2)) * t.s.animateEl.scrollHeight, p = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
2688
+ break;
2689
+ case "right":
2690
+ d = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), u = parseInt(t.s.nowDuration / (d * 2)) * t.s.animateEl.scrollWidth, p = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2691
+ break;
2692
+ case "bottom":
2693
+ d = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), u = parseInt(n / (d * 2)) * t.s.animateEl.scrollHeight, p = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
2694
+ break;
2695
+ case "left":
2696
+ d = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), u = parseInt(n / (d * 2)) * t.s.animateEl.scrollWidth, p = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
2697
+ break;
2698
+ }
2699
+ return p;
2700
+ }, d, u;
2701
+ (t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${h()[0].transform}`, t.s.animateEl.animate(h(), {
2702
+ duration: u,
2703
+ fill: "forwards"
2704
+ }).finished.then(() => {
2705
+ t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2706
+ duration: t.s.nowDuration,
2707
+ iterations: 1 / 0
2708
+ });
2709
+ })), t.s.animation && t.s.animation.ready.then(() => {
2710
+ t.s.animateEl.classList.add("ready");
2711
+ });
2712
+ break;
2713
+ case "endStop":
2714
+ t.s.animateEl.style.transform = `${D(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2715
+ duration: t.s.nowDuration,
2716
+ fill: "forwards"
2717
+ });
2718
+ break;
2719
+ }
2720
+ t.s.animateEl.classList.add("start"), o === !1 && (t.s.animateEl.classList.remove("start"), t.s.animation.cancel());
2721
+ }
2722
+ clearTimeout(l), l = setTimeout(
2723
+ () => {
2724
+ c();
2725
+ },
2726
+ o || 0
2727
+ ), t.addEventListener("mouseenter", function() {
2728
+ t.s.animation && a && t.s.animation.playState === "running" && t.pause();
2729
+ }), t.addEventListener("mouseleave", function() {
2730
+ t.s.animation && a && t.s.animation.playState === "paused" && t.play();
2731
+ });
2732
+ }
2733
+ #i() {
2734
+ const t = this;
2735
+ function e() {
2736
+ const i = t.s.animation.startTime, n = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
2737
+ t.s.nowDuration = lt(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(D(t).animate1, {
2738
+ duration: t.s.nowDuration,
2739
+ iterations: 1 / 0
2740
+ }), t.s.animation.startTime = i, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(D(t).animate2, {
2741
+ duration: t.s.nowDuration,
2742
+ delay: -t.s.nowDuration / 2,
2743
+ iterations: 1 / 0
2744
+ }), t.s.cloneAnimation.startTime = n);
2745
+ }
2746
+ window.addEventListener("resize", ee(e));
2699
2747
  }
2700
2748
  play() {
2701
2749
  this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
@@ -2704,191 +2752,47 @@ class mn extends HTMLElement {
2704
2752
  this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
2705
2753
  }
2706
2754
  }
2707
- Kt = new WeakSet(), es = function() {
2708
- const t = {
2709
- direction: this.getAttribute("direction") || I.SETTINGS.direction,
2710
- // up / down / left / right
2711
- behavior: this.getAttribute("behavior") || I.SETTINGS.behavior,
2712
- // normal / alternate / endStop
2713
- duration: Number(this.getAttribute("duration")) || I.SETTINGS.duration,
2714
- // ms
2715
- durationBreakpoints: Et(this) || I.SETTINGS.durationBreakpoints,
2716
- autoplay: this.getAttribute("autoplay") || I.SETTINGS.autoplay,
2717
- // normal / alternate / endStop
2718
- pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : I.SETTINGS.pauseOnMouseenter,
2719
- // true / false
2720
- continual: this.getAttribute("continual") ? this.getAttribute("continual") === "true" : I.SETTINGS.continual,
2721
- // true / false
2722
- gap: Number(this.getAttribute("gap")) || I.SETTINGS.gap
2755
+ customElements.define("marquee-el", ie);
2756
+ const ct = function(s, t) {
2757
+ let e;
2758
+ return function(i) {
2759
+ e && clearTimeout(e), e = setTimeout(s, 200, i);
2723
2760
  };
2724
- this.s = {}, this.s.options = t, this.s.nowDuration = li(this), pn(this), d(this, Vt, is).call(this);
2725
- }, Vt = new WeakSet(), is = function() {
2726
- const { direction: t, continual: e, gap: s } = this.s.options;
2727
- switch (t) {
2728
- case "left":
2729
- case "right":
2730
- this.style.cssText = `--continual-gap: ${s}px;`;
2731
- break;
2732
- case "top":
2733
- case "bottom":
2734
- 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;`;
2735
- break;
2736
- }
2737
- d(this, te, ss).call(this), d(this, ee, ns).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
2738
- }, te = new WeakSet(), ss = function() {
2739
- const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
2740
- let c;
2741
- function u() {
2742
- switch (s) {
2743
- case "normal":
2744
- t.s.animateEl.style.transform = `${H(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(H(t).animate1, {
2745
- duration: t.s.nowDuration,
2746
- iterations: 1 / 0
2747
- }), l && (t.s.cloneAnimateEl.style.transform = `${H(t).animate2[0].transform}`, t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
2748
- duration: t.s.nowDuration,
2749
- delay: -t.s.nowDuration / 2,
2750
- iterations: 1 / 0
2751
- }));
2752
- break;
2753
- case "alternate":
2754
- let m = function() {
2755
- let v = [];
2756
- switch (e) {
2757
- case "top":
2758
- h = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(t.s.nowDuration / (h * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: `translate3d(0,${t.clientHeight}px,0)` }, { transform: `translate3d(0,calc(${t.clientHeight}px - 100%),0)` }];
2759
- break;
2760
- case "right":
2761
- h = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(t.s.nowDuration / (h * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: "translate3d(-100%,0,0)" }, { transform: "translate3d(0,0,0)" }];
2762
- break;
2763
- case "bottom":
2764
- h = Math.abs(t.s.animateEl.scrollHeight - t.clientHeight), g = parseInt(o / (h * 2)) * t.s.animateEl.scrollHeight, v = [{ transform: "translate3d(0,-100%,0)" }, { transform: "translate3d(0,0,0)" }];
2765
- break;
2766
- case "left":
2767
- h = Math.abs(t.s.animateEl.scrollWidth - t.clientWidth), g = parseInt(o / (h * 2)) * t.s.animateEl.scrollWidth, v = [{ transform: `translate3d(${t.clientWidth}px,0,0)` }, { transform: `translate3d(calc(-100% + ${t.clientWidth}px),0,0)` }];
2768
- break;
2769
- }
2770
- return v;
2771
- }, h, g;
2772
- (t.clientHeight > t.s.animateEl.scrollHeight || e === "left" || e === "right") && (t.s.animateEl.style.transform = `${m()[0].transform}`, t.s.animateEl.animate(m(), {
2773
- duration: g,
2774
- fill: "forwards"
2775
- }).finished.then(() => {
2776
- t.s.animation = t.s.animateEl.animate(H(t).animate1, {
2777
- duration: t.s.nowDuration,
2778
- iterations: 1 / 0
2779
- });
2780
- })), t.s.animation && t.s.animation.ready.then(() => {
2781
- t.s.animateEl.classList.add("ready");
2782
- });
2783
- break;
2784
- case "endStop":
2785
- t.s.animateEl.style.transform = `${H(t).animate1[0].transform}`, t.s.animation = t.s.animateEl.animate(H(t).animate1, {
2786
- duration: t.s.nowDuration,
2787
- fill: "forwards"
2788
- });
2789
- break;
2790
- }
2791
- t.s.animateEl.classList.add("start"), a === !1 && (t.s.animateEl.classList.remove("start"), t.s.animation.cancel());
2792
- }
2793
- clearTimeout(c), c = setTimeout(
2794
- () => {
2795
- u();
2796
- },
2797
- a || 0
2798
- ), t.addEventListener("mouseenter", function() {
2799
- t.s.animation && r && t.s.animation.playState === "running" && t.pause();
2800
- }), t.addEventListener("mouseleave", function() {
2801
- t.s.animation && r && t.s.animation.playState === "paused" && t.play();
2802
- });
2803
- }, ee = new WeakSet(), ns = function() {
2804
- const t = this;
2805
- function e() {
2806
- const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
2807
- t.s.nowDuration = li(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
2808
- duration: t.s.nowDuration,
2809
- iterations: 1 / 0
2810
- }), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
2811
- duration: t.s.nowDuration,
2812
- delay: -t.s.nowDuration / 2,
2813
- iterations: 1 / 0
2814
- }), t.s.cloneAnimation.startTime = o);
2815
- }
2816
- window.addEventListener("resize", hn(e));
2817
- };
2818
- customElements.define("marquee-el", mn);
2819
- const ci = function(n, i) {
2820
- let t;
2821
- return function(e) {
2822
- t && clearTimeout(t), t = setTimeout(n, 200, e);
2823
- };
2824
- }, x = (n, i) => {
2825
- if (vt(n)) {
2826
- n.forEach((t) => {
2827
- t.classList.add(i);
2761
+ }, L = (s, t) => {
2762
+ if (X(s)) {
2763
+ s.forEach((e) => {
2764
+ e.classList.add(t);
2828
2765
  });
2829
2766
  return;
2830
2767
  }
2831
- n.classList.add(i);
2832
- }, $ = (n, i) => {
2833
- if (vt(n)) {
2834
- n.forEach((t) => {
2835
- t.classList.remove(i);
2768
+ s.classList.add(t);
2769
+ }, _ = (s, t) => {
2770
+ if (X(s)) {
2771
+ s.forEach((e) => {
2772
+ e.classList.remove(t);
2836
2773
  });
2837
2774
  return;
2838
2775
  }
2839
- n.classList.remove(i);
2776
+ s.classList.remove(t);
2840
2777
  };
2841
- var ie, os, se, as, ne, rs, lt, Xe, Y, At, oe, ls;
2842
- class di {
2843
- constructor(i) {
2844
- // 初始化
2845
- p(this, ie);
2846
- // 左右箭頭事件綁定
2847
- p(this, se);
2848
- // 左右拖拉事件綁定
2849
- p(this, ne);
2850
- // 卷軸位置判斷
2851
- p(this, lt);
2852
- // 隱藏按鈕判斷
2853
- p(this, Y);
2854
- // 選項事件綁定
2855
- p(this, oe);
2856
- this.$element = i, this.option = i.s.option.drag, this._didInitialScroll = !1, d(this, ie, os).call(this);
2778
+ class dt {
2779
+ constructor(t) {
2780
+ this.$element = t, this.option = t.s.option.drag, this._didInitialScroll = !1, this.#t();
2857
2781
  }
2858
- // 更新 active 位置
2859
- update(i = !1) {
2860
- const t = this.$element.querySelector(".wrapper"), e = t == null ? void 0 : t.querySelector(".active");
2861
- if (!e || !t)
2862
- return;
2863
- const s = () => {
2864
- const o = t.getBoundingClientRect(), a = e.getBoundingClientRect(), r = o.left + o.width / 2, c = a.left + a.width / 2 - r, u = t.scrollLeft + c;
2865
- t.scrollTo({
2866
- left: u,
2867
- behavior: "smooth"
2868
- });
2782
+ // 初始化
2783
+ #t() {
2784
+ const t = this;
2785
+ if (!t.$element) return;
2786
+ t.$container = t.$element.querySelector(".drag-container"), t.$wrapper = t.$container.querySelector(".wrapper");
2787
+ let e = !1;
2788
+ const i = () => {
2789
+ e || (requestAnimationFrame(() => {
2790
+ this.#i(), this.#n(), e = !1;
2791
+ }), e = !0);
2869
2792
  };
2870
- if (i && !this._didInitialScroll) {
2871
- this._didInitialScroll = !0, setTimeout(s, 250);
2872
- return;
2873
- }
2874
- s();
2875
- }
2876
- }
2877
- ie = new WeakSet(), os = function() {
2878
- var s, o, a, r;
2879
- const i = this;
2880
- if (!i.$element)
2881
- return;
2882
- i.$container = i.$element.querySelector(".drag-container"), i.$wrapper = i.$container.querySelector(".wrapper");
2883
- let t = !1;
2884
- const e = () => {
2885
- t || (requestAnimationFrame(() => {
2886
- d(this, lt, Xe).call(this), d(this, Y, At).call(this), t = !1;
2887
- }), t = !0);
2888
- };
2889
- 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, ne, rs).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
2890
- S.prepend,
2891
- `<div class="navigation">
2793
+ t.$wrapper.removeEventListener("scroll", i), t.$wrapper.addEventListener("scroll", i), window.removeEventListener("resize", i), window.addEventListener("resize", i), (t.option.draggable || t.$element.s.type == "collapse") && t.#e(), t.option.navigation && t.$element.s.type !== "collapse" && (t.$container.insertAdjacentHTML(
2794
+ E.prepend,
2795
+ `<div class="navigation">
2892
2796
  <div class="button prev">
2893
2797
  <div></div>
2894
2798
  </div>
@@ -2896,661 +2800,661 @@ ie = new WeakSet(), os = function() {
2896
2800
  <div></div>
2897
2801
  </div>
2898
2802
  </div>`
2899
- ), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, se, as).call(a)), d(r = i, oe, ls).call(r), i.update(!0), requestAnimationFrame(() => {
2900
- d(this, lt, Xe).call(this), d(this, Y, At).call(this);
2901
- });
2902
- }, se = new WeakSet(), as = function() {
2903
- const i = this, { $wrapper: t, $button: e } = i, s = function() {
2904
- const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
2905
- t.scrollTo({
2906
- left: o ? t.scrollLeft + a : t.scrollLeft - a,
2907
- behavior: "smooth"
2908
- }), setTimeout(() => {
2909
- var r;
2910
- d(r = i, Y, At).call(r);
2911
- }, 100);
2912
- };
2913
- e.forEach((o) => {
2914
- o.removeEventListener("click", s), o.addEventListener("click", s);
2915
- });
2916
- }, ne = new WeakSet(), rs = function() {
2917
- const { $wrapper: i } = this;
2918
- let t = !1, e = !1, s = 0, o = 0;
2919
- const a = function(h) {
2920
- h.preventDefault(), e = !1, t = !0, s = h.pageX - i.offsetLeft, o = i.scrollLeft;
2921
- };
2922
- i.removeEventListener("mousedown", a), i.addEventListener("mousedown", a);
2923
- const r = function() {
2924
- e = !1, t = !1;
2925
- };
2926
- i.removeEventListener("mouseleave", r), i.addEventListener("mouseleave", r);
2927
- const l = function(h) {
2928
- h.preventDefault(), t = !1;
2929
- };
2930
- i.removeEventListener("mouseup", l), i.addEventListener("mouseup", l);
2931
- const c = function(h) {
2932
- if (h.preventDefault(), e = !0, !t)
2933
- return;
2934
- const m = h.pageX - i.offsetLeft - s;
2935
- i.scrollTo({
2936
- left: o - m
2803
+ ), t.$button = t.$container?.querySelectorAll(".button"), t.#s()), t.#o(), t.update(!0), requestAnimationFrame(() => {
2804
+ this.#i(), this.#n();
2937
2805
  });
2938
- };
2939
- i.removeEventListener("mousemove", c), i.addEventListener("mousemove", c);
2940
- const u = function(h) {
2941
- e && (h.preventDefault(), h.stopPropagation());
2942
- };
2943
- i.querySelectorAll("a").forEach((h) => {
2944
- h.removeEventListener("click", u), h.addEventListener("click", u);
2945
- });
2946
- }, lt = new WeakSet(), Xe = function() {
2947
- const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
2948
- 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")));
2949
- }, Y = new WeakSet(), At = function() {
2950
- const { $wrapper: i, $button: t, $element: e } = this;
2951
- if (!t)
2952
- return;
2953
- const s = i.scrollWidth - i.clientWidth, o = i.scrollLeft;
2954
- if (s <= 0) {
2955
- x(t, "hide"), $(t, "active"), x(e, "noScrollable");
2956
- return;
2957
2806
  }
2958
- s > 0 && (x(t, "active"), $(e, "noScrollable")), o == 0 ? t.forEach((a) => {
2959
- if (a.classList.contains("next")) {
2960
- $(a, "hide");
2807
+ // 更新 active 位置
2808
+ update(t = !1) {
2809
+ const e = this.$element.querySelector(".wrapper"), i = e?.querySelector(".active");
2810
+ if (!i || !e) return;
2811
+ const n = () => {
2812
+ const o = e.getBoundingClientRect(), a = i.getBoundingClientRect(), r = o.left + o.width / 2, c = a.left + a.width / 2 - r, d = e.scrollLeft + c;
2813
+ e.scrollTo({
2814
+ left: d,
2815
+ behavior: "smooth"
2816
+ });
2817
+ };
2818
+ if (t && !this._didInitialScroll) {
2819
+ this._didInitialScroll = !0, setTimeout(n, 250);
2961
2820
  return;
2962
2821
  }
2963
- x(a, "hide");
2964
- }) : o + 1 >= s ? t.forEach((a) => {
2965
- if (a.classList.contains("next")) {
2966
- x(a, "hide");
2822
+ n();
2823
+ }
2824
+ // 左右箭頭事件綁定
2825
+ #s() {
2826
+ const t = this, { $wrapper: e, $button: i } = t, n = function() {
2827
+ const o = this.classList.contains("next"), a = parseInt(e.getBoundingClientRect().width * 0.7);
2828
+ e.scrollTo({
2829
+ left: o ? e.scrollLeft + a : e.scrollLeft - a,
2830
+ behavior: "smooth"
2831
+ }), setTimeout(() => {
2832
+ t.#n();
2833
+ }, 100);
2834
+ };
2835
+ i.forEach((o) => {
2836
+ o.removeEventListener("click", n), o.addEventListener("click", n);
2837
+ });
2838
+ }
2839
+ // 左右拖拉事件綁定
2840
+ #e() {
2841
+ const { $wrapper: t } = this;
2842
+ let e = !1, i = !1, n = 0, o = 0;
2843
+ const a = function(u) {
2844
+ u.preventDefault(), i = !1, e = !0, n = u.pageX - t.offsetLeft, o = t.scrollLeft;
2845
+ };
2846
+ t.removeEventListener("mousedown", a), t.addEventListener("mousedown", a);
2847
+ const r = function() {
2848
+ i = !1, e = !1;
2849
+ };
2850
+ t.removeEventListener("mouseleave", r), t.addEventListener("mouseleave", r);
2851
+ const l = function(u) {
2852
+ u.preventDefault(), e = !1;
2853
+ };
2854
+ t.removeEventListener("mouseup", l), t.addEventListener("mouseup", l);
2855
+ const c = function(u) {
2856
+ if (u.preventDefault(), i = !0, !e) return;
2857
+ const p = u.pageX - t.offsetLeft - n;
2858
+ t.scrollTo({
2859
+ left: o - p
2860
+ });
2861
+ };
2862
+ t.removeEventListener("mousemove", c), t.addEventListener("mousemove", c);
2863
+ const d = function(u) {
2864
+ i && (u.preventDefault(), u.stopPropagation());
2865
+ };
2866
+ t.querySelectorAll("a").forEach((u) => {
2867
+ u.removeEventListener("click", d), u.addEventListener("click", d);
2868
+ });
2869
+ }
2870
+ // 卷軸位置判斷
2871
+ #i() {
2872
+ const { $container: t, $wrapper: e } = this, i = e.scrollWidth - e.clientWidth, n = Math.round(e.scrollLeft);
2873
+ i <= 0 || (L(t, "scrollable"), n == 0 ? (L(e, "start"), _(e, "end")) : n + 1 >= i ? (_(e, "start"), L(e, "end")) : (L(e, "center"), _(e, "start"), _(e, "end")));
2874
+ }
2875
+ // 隱藏按鈕判斷
2876
+ #n() {
2877
+ const { $wrapper: t, $button: e, $element: i } = this;
2878
+ if (!e) return;
2879
+ const n = t.scrollWidth - t.clientWidth, o = t.scrollLeft;
2880
+ if (n <= 0) {
2881
+ L(e, "hide"), _(e, "active"), L(i, "noScrollable");
2967
2882
  return;
2968
2883
  }
2969
- $(a, "hide");
2970
- }) : $(t, "hide");
2971
- }, oe = new WeakSet(), ls = function() {
2972
- const { $element: i } = this, t = (s) => {
2973
- if (this.option.selected) {
2974
- const o = s.getAttribute("data-option").trim();
2975
- i.setAttribute("m4-status", o);
2884
+ n > 0 && (L(e, "active"), _(i, "noScrollable")), o == 0 ? e.forEach((a) => {
2885
+ if (a.classList.contains("next")) {
2886
+ _(a, "hide");
2887
+ return;
2888
+ }
2889
+ L(a, "hide");
2890
+ }) : o + 1 >= n ? e.forEach((a) => {
2891
+ if (a.classList.contains("next")) {
2892
+ L(a, "hide");
2893
+ return;
2894
+ }
2895
+ _(a, "hide");
2896
+ }) : _(e, "hide");
2897
+ }
2898
+ // 選項事件綁定
2899
+ #o() {
2900
+ const { $element: t } = this, e = (n) => {
2901
+ if (this.option.selected) {
2902
+ const o = n.getAttribute("data-option").trim();
2903
+ t.setAttribute("m4-status", o);
2904
+ }
2905
+ };
2906
+ function i() {
2907
+ e(this);
2976
2908
  }
2977
- };
2978
- function e() {
2979
- t(this);
2980
- }
2981
- this.$container.querySelectorAll(".item").forEach((s) => {
2982
- s.removeEventListener("click", e), s.addEventListener("click", e);
2983
- });
2984
- };
2985
- var ae, cs, re, ds, le, us, ce, ps;
2986
- class gn {
2987
- constructor(i) {
2988
- // 初始化
2989
- p(this, ae);
2990
- // 隱藏按鈕判斷
2991
- p(this, re);
2992
- // 展開箭頭事件綁定
2993
- p(this, le);
2994
- // 選項事件綁定
2995
- p(this, ce);
2996
- this.$element = i, this.option = i.s.option.collapse, d(this, ae, cs).call(this);
2909
+ this.$container.querySelectorAll(".item").forEach((n) => {
2910
+ n.removeEventListener("click", i), n.addEventListener("click", i);
2911
+ });
2997
2912
  }
2998
2913
  }
2999
- ae = new WeakSet(), cs = function() {
3000
- this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, re, ds).call(this) && d(this, le, us).call(this), d(this, ce, ps).call(this));
3001
- }, re = new WeakSet(), ds = function() {
3002
- const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
3003
- return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), $(this.$element, "noScrollable"), !0) : (x(this.$element, "noScrollable"), !1);
3004
- }, le = new WeakSet(), us = function() {
3005
- const { $element: i, $button: t } = this, e = function() {
3006
- i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
3007
- };
3008
- t.removeEventListener("click", e), t.addEventListener("click", e);
3009
- }, ce = new WeakSet(), ps = function() {
3010
- const { $element: i } = this, t = (s, o) => {
3011
- if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
3012
- const a = s.getAttribute("data-option").trim();
3013
- i.setAttribute("m4-status", a);
2914
+ class se {
2915
+ constructor(t) {
2916
+ this.$element = t, this.option = t.s.option.collapse, this.#t();
2917
+ }
2918
+ // 初始化
2919
+ #t() {
2920
+ this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), this.#s() && this.#e(), this.#i());
2921
+ }
2922
+ // 隱藏按鈕判斷
2923
+ #s() {
2924
+ const t = this.$element.querySelector(".drag-container"), e = t.querySelector(".wrapper");
2925
+ return e.scrollWidth - e.clientWidth > 0 ? (t.insertAdjacentHTML(E.append, '<div class="open-collapse"></div>'), this.$button = t.querySelector(".open-collapse"), _(this.$element, "noScrollable"), !0) : (L(this.$element, "noScrollable"), !1);
2926
+ }
2927
+ // 展開箭頭事件綁定
2928
+ #e() {
2929
+ const { $element: t, $button: e } = this, i = function() {
2930
+ t.classList.contains("expand") ? t.classList.remove("expand") : t.classList.add("expand");
2931
+ };
2932
+ e.removeEventListener("click", i), e.addEventListener("click", i);
2933
+ }
2934
+ // 選項事件綁定
2935
+ #i() {
2936
+ const { $element: t } = this, e = (n, o) => {
2937
+ if (t?.classList.contains("expand") ? t?.classList.remove("expand") : t?.classList.add("expand"), this.option.selected) {
2938
+ const a = n.getAttribute("data-option").trim();
2939
+ t.setAttribute("m4-status", a);
2940
+ }
2941
+ };
2942
+ function i() {
2943
+ e(this);
3014
2944
  }
3015
- };
3016
- function e() {
3017
- t(this);
2945
+ this.$container.querySelectorAll(".item").forEach((n) => {
2946
+ n.removeEventListener("click", i), n.addEventListener("click", i);
2947
+ });
3018
2948
  }
3019
- this.$container.querySelectorAll(".item").forEach((s) => {
3020
- s.removeEventListener("click", e), s.addEventListener("click", e);
3021
- });
3022
- };
3023
- const fn = (n) => {
3024
- const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
3025
- return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
2949
+ }
2950
+ const ne = (s) => {
2951
+ const { type: t, option: e, originalDomString: i } = s.s, n = document.createElement("div");
2952
+ return t == "drag" && (n.innerHTML = x.TEMPLATE[t]().trim(), n.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, i)), t == "collapse" && (n.innerHTML = x.TEMPLATE[t](e?.collapse).trim(), n.querySelector(".drag-container .wrapper").insertAdjacentHTML(E.append, i), n.querySelector(".collapse-container .wrapper").insertAdjacentHTML(E.append, i)), t == "dropdown" && (n.innerHTML = x.TEMPLATE[t](e?.dropdown).trim(), n.querySelector("dropdown-el").insertAdjacentHTML(E.append, i)), n.children;
3026
2953
  };
3027
- var de, hs, ue, ms, ct, Ue, dt, Ye, pe, gs, ut, Fe, F, St;
3028
- class vn extends HTMLElement {
2954
+ class oe extends HTMLElement {
3029
2955
  constructor() {
3030
- super();
3031
- p(this, de);
3032
- p(this, ue);
3033
- // 斷點設定
3034
- p(this, ct);
3035
- // 同步目前選中的項目
3036
- p(this, dt);
3037
- // 下拉選項事件綁定
3038
- p(this, pe);
3039
- // 關閉展開中的 collapse
3040
- p(this, ut);
3041
- // check type
3042
- p(this, F);
3043
- this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
2956
+ super(), this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
3044
2957
  }
3045
2958
  static get observedAttributes() {
3046
2959
  return ["m4-type", "m4-status"];
3047
2960
  }
3048
- attributeChangedCallback(t, e, s) {
2961
+ attributeChangedCallback(t, e, i) {
3049
2962
  switch (t) {
3050
2963
  case "m4-type":
3051
- if (e === null || e === s)
3052
- return;
3053
- this.s.type = s, d(this, F, St).call(this);
2964
+ if (e === null || e === i) return;
2965
+ this.s.type = i, this.#a();
3054
2966
  break;
3055
2967
  case "m4-status":
3056
- if (e === s)
3057
- return;
3058
- d(this, dt, Ye).call(this, s);
2968
+ if (e === i) return;
2969
+ this.#i(i);
3059
2970
  break;
3060
2971
  }
3061
2972
  }
3062
2973
  connectedCallback() {
3063
- this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, de, hs).call(this));
2974
+ this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, this.#t());
3064
2975
  }
3065
2976
  update() {
3066
- d(this, ut, Fe).call(this), d(this, ct, Ue).call(this);
2977
+ this.#o(), this.#e();
2978
+ }
2979
+ #t() {
2980
+ let t = {};
2981
+ this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? x.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
2982
+ const e = (i) => {
2983
+ if (i.type === "resize") {
2984
+ if (window.innerWidth === this.previousWidth) return;
2985
+ this.previousWidth = window.innerWidth;
2986
+ }
2987
+ this.update();
2988
+ };
2989
+ window.removeEventListener("resize", ct(e)), window.addEventListener("resize", ct(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, x.SETTINGS.drag, t?.drag), this.s.option.collapse = Object.assign({}, x.SETTINGS.collapse, t?.collapse), this.s.option.dropdown = Object.assign({}, x.SETTINGS.dropdown, t?.dropdown), this.s.option.breakpoint = Object.assign({}, x.SETTINGS.breakpoint, t?.breakpoint), this.#s();
3067
2990
  }
3068
- }
3069
- de = new WeakSet(), hs = function() {
3070
- let t = {};
3071
- 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"));
3072
- const e = (s) => {
3073
- if (s.type === "resize") {
3074
- if (window.innerWidth === this.previousWidth)
3075
- return;
3076
- this.previousWidth = window.innerWidth;
3077
- }
3078
- this.update();
3079
- };
3080
- window.removeEventListener("resize", ci(e)), window.addEventListener("resize", ci(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, ue, ms).call(this);
3081
- }, ue = new WeakSet(), ms = function() {
3082
- this.classList.add("m4-init"), d(this, ct, Ue).call(this);
3083
- }, ct = new WeakSet(), Ue = function() {
3084
- const t = Object.keys(this.s.option.breakpoint);
3085
- if (!t.length) {
3086
- d(this, F, St).call(this);
3087
- return;
2991
+ #s() {
2992
+ this.classList.add("m4-init"), this.#e();
3088
2993
  }
3089
- t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
3090
- var s, o, a, r;
3091
- 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, St).call(this), window.innerWidth >= e;
3092
- });
3093
- }, dt = new WeakSet(), Ye = function(t = this.getAttribute("m4-status")) {
3094
- var a;
3095
- const e = t ?? "", s = (r) => {
3096
- this.querySelectorAll(r).forEach((l) => {
3097
- var u;
3098
- const c = (u = l.getAttribute("data-option")) == null ? void 0 : u.trim();
3099
- l.classList.toggle("active", c === e);
3100
- });
3101
- };
3102
- s(".drag-container .item"), s(".collapse-container .item");
3103
- const o = this.querySelector("dropdown-el");
3104
- o && o.getAttribute("d4-value") !== e && o.setAttribute("d4-value", e), (a = this.drag) == null || a.update();
3105
- }, pe = new WeakSet(), gs = function() {
3106
- var e;
3107
- const t = this.querySelector("dropdown-el");
3108
- !t || typeof t.on != "function" || (this.__events__.dropdownChange = () => {
3109
- var o;
3110
- const s = ((o = t.getAttribute("d4-value")) == null ? void 0 : o.trim()) ?? "";
3111
- this.getAttribute("m4-status") !== s && this.setAttribute("m4-status", s);
3112
- }, (e = t.off) == null || e.call(t, "change", this.__events__.dropdownChange), t.on("change", this.__events__.dropdownChange));
3113
- }, ut = new WeakSet(), Fe = function() {
3114
- this.classList.remove("expand");
3115
- }, F = new WeakSet(), St = function() {
3116
- const { type: t } = this.s;
3117
- switch (d(this, ut, Fe).call(this), this.innerHTML = "", [...fn(this)].forEach((e) => {
3118
- this.append(e);
3119
- }), t) {
3120
- case "drag":
3121
- this.drag = new di(this);
3122
- break;
3123
- case "collapse":
3124
- this.drag = new di(this), this.collapse = new gn(this);
3125
- break;
3126
- case "dropdown":
3127
- d(this, pe, gs).call(this);
3128
- break;
2994
+ // 斷點設定
2995
+ #e() {
2996
+ const t = Object.keys(this.s.option.breakpoint);
2997
+ if (!t.length) {
2998
+ this.#a();
2999
+ return;
3000
+ }
3001
+ t.map((e) => Number(e)).sort((e, i) => i - e).some((e) => (window.innerWidth >= e && (this.s.type = this.s.option.breakpoint[e]?.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, this.s.option.breakpoint[e]?.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, this.s.option.breakpoint[e]?.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, this.s.option.breakpoint[e]?.dropdown)), this.#a(), window.innerWidth >= e));
3002
+ }
3003
+ // 同步目前選中的項目
3004
+ #i(t = this.getAttribute("m4-status")) {
3005
+ const e = t ?? "", i = (o) => {
3006
+ this.querySelectorAll(o).forEach((a) => {
3007
+ const r = a.getAttribute("data-option")?.trim();
3008
+ a.classList.toggle("active", r === e);
3009
+ });
3010
+ };
3011
+ i(".drag-container .item"), i(".collapse-container .item");
3012
+ const n = this.querySelector("dropdown-el");
3013
+ n && n.getAttribute("d4-value") !== e && n.setAttribute("d4-value", e), this.drag?.update();
3014
+ }
3015
+ // 下拉選項事件綁定
3016
+ #n() {
3017
+ const t = this.querySelector("dropdown-el");
3018
+ !t || typeof t.on != "function" || (this.__events__.dropdownChange = () => {
3019
+ const e = t.getAttribute("d4-value")?.trim() ?? "";
3020
+ this.getAttribute("m4-status") !== e && this.setAttribute("m4-status", e);
3021
+ }, t.off?.("change", this.__events__.dropdownChange), t.on("change", this.__events__.dropdownChange));
3022
+ }
3023
+ // 關閉展開中的 collapse
3024
+ #o() {
3025
+ this.classList.remove("expand");
3026
+ }
3027
+ // check type
3028
+ #a() {
3029
+ const { type: t } = this.s;
3030
+ switch (this.#o(), this.innerHTML = "", [...ne(this)].forEach((e) => {
3031
+ this.append(e);
3032
+ }), this.#i(), t) {
3033
+ case "drag":
3034
+ this.drag = new dt(this);
3035
+ break;
3036
+ case "collapse":
3037
+ this.drag = new dt(this), this.collapse = new se(this);
3038
+ break;
3039
+ case "dropdown":
3040
+ this.#n();
3041
+ break;
3042
+ }
3129
3043
  }
3130
- d(this, dt, Ye).call(this);
3131
- };
3132
- customElements.define("multipurpose-nav", vn);
3133
- var he, vs, me, bs, pt, Je, W, Q, ge, ys, fe, ws, ve, Ts, be, Es, ye, As, we, Ss, Te, Ls, Ee, _s, Ae, Ds, N, R, Se, ks, Le, xs, _e, $s, De, Cs;
3134
- class fs extends HTMLElement {
3044
+ }
3045
+ customElements.define("multipurpose-nav", oe);
3046
+ class $t extends HTMLElement {
3135
3047
  // 定義組件的初始狀態
3136
3048
  constructor(t, e) {
3137
3049
  super();
3138
- p(this, he);
3139
- p(this, me);
3140
- // 第一關 判斷數量以及id設定
3141
- p(this, pt);
3142
- // 第二關 id命名提醒
3143
- p(this, W);
3144
- p(this, ge);
3145
- p(this, fe);
3146
- p(this, ve);
3147
- // 執行函式
3148
- // 移動至指定位置
3149
- p(this, be);
3150
- // 移動
3151
- p(this, ye);
3152
- // 步驟狀態
3153
- p(this, we);
3154
- // next 按鈕狀態
3155
- p(this, Te);
3156
- // prev 按鈕狀態
3157
- p(this, Ee);
3158
- // 頁籤狀態
3159
- p(this, Ae);
3160
- // 第三關各種元件判斷 及 執行
3161
- p(this, N);
3162
- // 消失動畫
3163
- p(this, Se);
3164
- // 出現動畫
3165
- p(this, Le);
3166
- // 狀態
3167
- p(this, _e);
3168
- // resize
3169
- p(this, De);
3170
3050
  }
3171
3051
  // 當組件的屬性被更改時會被呼叫
3172
3052
  static get observedAttributes() {
3173
3053
  return ["t4-active"];
3174
3054
  }
3175
- attributeChangedCallback(t, e, s) {
3176
- t === "t4-active" && e !== s && d(this, _e, $s).call(this, s);
3055
+ attributeChangedCallback(t, e, i) {
3056
+ t === "t4-active" && e !== i && this.#f(i);
3177
3057
  }
3178
3058
  connectedCallback() {
3179
- this.classList.contains("t4-initialize") || d(this, he, vs).call(this);
3059
+ this.classList.contains("t4-initialize") || this.#t();
3060
+ }
3061
+ #t() {
3062
+ const t = this.getAttribute("t4-name"), { SETTINGS: e } = gt;
3063
+ document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
3064
+ tabs: [],
3065
+ name: t,
3066
+ tabPanels: [...this.children],
3067
+ activeTab: "",
3068
+ stepOutput: e.stepOutput,
3069
+ recordUrl: this.getAttribute("t4-url") || e.recordUrl,
3070
+ type: this.getAttribute("t4-type") || e.type,
3071
+ display: this.getAttribute("t4-display") || e.display,
3072
+ defaultPage: this.getAttribute("t4-defaultPage") || e.defaultPage,
3073
+ anchor: this.getAttribute("t4-anchor"),
3074
+ gap: this.getAttribute("t4-gap") || e.anchorGap,
3075
+ transition: {
3076
+ duration: this.getAttribute("t4-duration") || e.transition.duration,
3077
+ timing: this.getAttribute("t4-timing") || e.transition.timing,
3078
+ delay: this.getAttribute("t4-delay") || e.transition.delay
3079
+ },
3080
+ tabGroup: this.getAttribute("t4-group") || e.tabGroup
3081
+ }, this.__events__ = {}, this.t.tabs = this.#e(), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), this.#s();
3082
+ }
3083
+ #s() {
3084
+ if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && this.#n(), this.t.recordUrl) {
3085
+ const e = new URLSearchParams(document.location.search).get(this.t.name), i = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
3086
+ e && i.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
3087
+ }
3088
+ this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), this.#v();
3089
+ }
3090
+ // 第一關 判斷數量以及id設定
3091
+ #e() {
3092
+ const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
3093
+ 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((i, n) => i.setAttribute("t4-id", n)) : t.tabPanels.forEach((i) => {
3094
+ i.getAttribute("t4-id") || console.warn(i, "請幫我設定id!!");
3095
+ }), e;
3096
+ }
3097
+ // 第二關 id命名提醒
3098
+ #i(t) {
3099
+ const { t: e } = this, i = e.tabPanels.filter((o) => o.getAttribute("t4-id") === t);
3100
+ i.length > 1 && console.warn("有兩個相同id設定", i);
3101
+ const n = i[0];
3102
+ return n ? e.tabPanels.indexOf(n) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
3103
+ }
3104
+ #n() {
3105
+ const t = document.createElement("div");
3106
+ t.classList.add("swiper-container");
3107
+ const e = document.createElement("div");
3108
+ e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((i) => {
3109
+ e.appendChild(i.cloneNode(!0));
3110
+ }), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), this.#o();
3111
+ }
3112
+ #o() {
3113
+ const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), i = this.t.tabPanels;
3114
+ t.style.overflow = "hidden", e.style.display = "flex";
3115
+ const n = i.length * 100 + "%";
3116
+ e.style.width = n;
3117
+ }
3118
+ #a(t) {
3119
+ const { t: e } = this;
3120
+ if (e.recordUrl === "true") {
3121
+ const i = new URLSearchParams(document.location.search);
3122
+ i.set(e.name, t);
3123
+ const n = `${window.location.pathname}?${i.toString()}`;
3124
+ history.replaceState({ t4Id: t }, "", n);
3125
+ }
3126
+ }
3127
+ // 執行函式
3128
+ // 移動至指定位置
3129
+ #l() {
3130
+ const t = parseInt(this.t.gap, 10), e = window.pageYOffset, n = this.getBoundingClientRect().top + e - t;
3131
+ this.#c(n);
3132
+ }
3133
+ // 移動
3134
+ #c(t) {
3135
+ window.scrollTo({
3136
+ top: t,
3137
+ behavior: "smooth"
3138
+ });
3139
+ }
3140
+ // 步驟狀態
3141
+ #d(t) {
3142
+ let e = parseInt(t, 10) + 1;
3143
+ this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
3144
+ }
3145
+ // next 按鈕狀態
3146
+ #u(t) {
3147
+ const e = document.querySelectorAll(`[t4-role="next"][t4-control="${this.t.name}"]`), i = this.t.tabPanels.length === 1, n = t === this.t.tabPanels.length - 1;
3148
+ e.forEach((o) => {
3149
+ i || n ? o.setAttribute("disabled", "") : o.removeAttribute("disabled");
3150
+ });
3151
+ }
3152
+ // prev 按鈕狀態
3153
+ #p(t) {
3154
+ const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), i = this.t.tabPanels.length === 1, n = t === 0;
3155
+ e.forEach((o) => {
3156
+ i || n ? o.setAttribute("disabled", "") : o.removeAttribute("disabled");
3157
+ });
3158
+ }
3159
+ // 頁籤狀態
3160
+ #h(t, e) {
3161
+ this.t.tabGroup === "true" ? this.t.tabs.forEach((i, n) => {
3162
+ n == t ? i.setAttribute("aria-selected", !0) : i.setAttribute("aria-selected", !1);
3163
+ }) : this.t.tabs.forEach((i, n) => {
3164
+ i.getAttribute("t4-id") === e ? i.setAttribute("aria-selected", !0) : i.setAttribute("aria-selected", !1);
3165
+ });
3166
+ }
3167
+ // 第三關各種元件判斷 及 執行
3168
+ #r(t, e, i) {
3169
+ switch (t) {
3170
+ case "step":
3171
+ Q(this.t.step) && this.#d(e);
3172
+ break;
3173
+ case "eventAnchor":
3174
+ this.t.anchor && this.#l();
3175
+ break;
3176
+ case "tabState":
3177
+ this.t.type == "normal" && this.#h(e, i);
3178
+ break;
3179
+ case "btnState":
3180
+ this.#u(e), this.#p(e);
3181
+ break;
3182
+ case "tabUrl":
3183
+ this.t.recordUrl === "true" && this.#a(e);
3184
+ break;
3185
+ default:
3186
+ console.warn("請增加判斷,謝謝");
3187
+ break;
3188
+ }
3189
+ }
3190
+ // 消失動畫
3191
+ #m(t) {
3192
+ const { t: e } = this, { duration: i, timing: n, delay: o } = this.t.transition, a = e.tabPanels[t];
3193
+ switch (a.classList.remove("show"), a.classList.add("hide"), e.display) {
3194
+ case "fade":
3195
+ a.style.cssText = "display: none; opacity: 0;";
3196
+ break;
3197
+ case "slide":
3198
+ a.style.cssText = "display: none; opacity: 0; max-height: unset;";
3199
+ break;
3200
+ case "swiper":
3201
+ break;
3202
+ default:
3203
+ a.style.display = "none";
3204
+ break;
3205
+ }
3206
+ }
3207
+ // 出現動畫
3208
+ #g(t) {
3209
+ const { duration: e, timing: i, delay: n } = this.t.transition, o = this.t.tabPanels[t];
3210
+ let a;
3211
+ switch (o.classList.add("show"), o.classList.remove("hide"), o.style.transition = `opacity ${e}ms ${i} ${n}ms`, o.style.display = "block", this.t.display) {
3212
+ case "fade":
3213
+ o.style.opacity = "0", a = setTimeout(() => {
3214
+ clearTimeout(a), o.style.opacity = "1";
3215
+ }, 100);
3216
+ break;
3217
+ case "slide":
3218
+ console.warn(this.t.display, "抱歉,好像壞掉了...");
3219
+ const r = o.offsetHeight;
3220
+ o.style.opacity = "1", o.style.maxHeight = "0", a = setTimeout(() => {
3221
+ clearTimeout(a), o.style.maxHeight = r + "px";
3222
+ }, 100);
3223
+ break;
3224
+ case "swiper":
3225
+ o.style.opacity = "1";
3226
+ const l = this.querySelector(".swiper-wrapper"), c = this.t.tabPanels[0].offsetWidth, d = -t * c;
3227
+ l.style.transition = `transform ${e}ms ${i} ${n}ms`, l.style.transform = `translateX(${d}px)`;
3228
+ break;
3229
+ default:
3230
+ console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
3231
+ break;
3232
+ }
3233
+ }
3234
+ // 狀態
3235
+ #f(t) {
3236
+ const e = this.#i(t);
3237
+ this.#r("step", e), this.#r("btnState", e), this.#r("tabState", e, t), this.#r("tabUrl", t), this.emit("change");
3238
+ }
3239
+ // resize
3240
+ #v() {
3241
+ const t = this;
3242
+ window.addEventListener(
3243
+ "resize",
3244
+ ae(() => {
3245
+ t.update();
3246
+ }, 1e3)
3247
+ );
3180
3248
  }
3181
3249
  // ------------- 我是分隔線呦 -------------
3182
3250
  // 頁籤切換
3183
3251
  tabClick(t) {
3184
- const { t: e } = this, s = e.tabs.indexOf(t) % e.tabPanels.length, o = e.tabGroup === "true" ? String(s) : t.getAttribute("t4-id");
3185
- this.setActiveTab(o), setTimeout(() => {
3186
- d(this, N, R).call(this, "eventAnchor");
3252
+ const { t: e } = this, i = e.tabs.indexOf(t) % e.tabPanels.length, n = e.tabGroup === "true" ? String(i) : t.getAttribute("t4-id");
3253
+ this.setActiveTab(n), setTimeout(() => {
3254
+ this.#r("eventAnchor");
3187
3255
  }, e.transition.duration);
3188
3256
  }
3189
3257
  // 外部呼叫方法 $0.setActiveTab(0)
3190
3258
  setActiveTab(t) {
3191
- const { t: e } = this, s = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
3192
- e.activeTab = s, this.setAttribute("t4-active", s);
3193
- const o = d(this, W, Q).call(this, s);
3194
- e.tabPanels.forEach((a, r) => {
3195
- r === o ? d(this, Le, xs).call(this, r) : d(this, Se, ks).call(this, r);
3259
+ const { t: e } = this, i = t === "" ? e.tabPanels[0].getAttribute("t4-id") : t;
3260
+ e.activeTab = i, this.setAttribute("t4-active", i);
3261
+ const n = this.#i(i);
3262
+ e.tabPanels.forEach((o, a) => {
3263
+ a === n ? this.#g(a) : this.#m(a);
3196
3264
  });
3197
3265
  }
3198
3266
  // 外部呼叫方法 $0.goNext()
3199
3267
  goNext() {
3200
- const t = d(this, W, Q).call(this, this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), s = this.t.tabPanels[e].getAttribute("t4-id");
3201
- this.setActiveTab(s);
3268
+ const t = this.#i(this.t.activeTab), e = Math.min(this.t.tabPanels.length - 1, t + 1), i = this.t.tabPanels[e].getAttribute("t4-id");
3269
+ this.setActiveTab(i);
3202
3270
  }
3203
3271
  // 外部呼叫方法 $0.goPrev()
3204
3272
  goPrev() {
3205
- const t = d(this, W, Q).call(this, this.t.activeTab), e = Math.max(0, t - 1), s = this.t.tabPanels[e].getAttribute("t4-id");
3206
- this.setActiveTab(s);
3273
+ const t = this.#i(this.t.activeTab), e = Math.max(0, t - 1), i = this.t.tabPanels[e].getAttribute("t4-id");
3274
+ this.setActiveTab(i);
3207
3275
  }
3208
3276
  // 外部呼叫方法 $0.update()
3209
3277
  update() {
3210
- this.t.tabs = d(this, pt, Je).call(this), Hs(), console.log("tab update!!!!");
3278
+ this.t.tabs = this.#e(), kt(), console.log("tab update!!!!");
3211
3279
  }
3212
3280
  }
3213
- he = new WeakSet(), vs = function() {
3214
- const t = this.getAttribute("t4-name"), { SETTINGS: e } = gi;
3215
- document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
3216
- tabs: [],
3217
- name: t,
3218
- tabPanels: [...this.children],
3219
- activeTab: "",
3220
- stepOutput: e.stepOutput,
3221
- recordUrl: this.getAttribute("t4-url") || e.recordUrl,
3222
- type: this.getAttribute("t4-type") || e.type,
3223
- display: this.getAttribute("t4-display") || e.display,
3224
- defaultPage: this.getAttribute("t4-defaultPage") || e.defaultPage,
3225
- anchor: this.getAttribute("t4-anchor"),
3226
- gap: this.getAttribute("t4-gap") || e.anchorGap,
3227
- transition: {
3228
- duration: this.getAttribute("t4-duration") || e.transition.duration,
3229
- timing: this.getAttribute("t4-timing") || e.transition.timing,
3230
- delay: this.getAttribute("t4-delay") || e.transition.delay
3231
- },
3232
- tabGroup: this.getAttribute("t4-group") || e.tabGroup
3233
- }, this.__events__ = {}, this.t.tabs = d(this, pt, Je).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, me, bs).call(this);
3234
- }, me = new WeakSet(), bs = function() {
3235
- if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, ge, ys).call(this), this.t.recordUrl) {
3236
- const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
3237
- e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
3238
- }
3239
- this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, De, Cs).call(this);
3240
- }, pt = new WeakSet(), Je = function() {
3241
- const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
3242
- 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) => {
3243
- s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
3244
- }), e;
3245
- }, W = new WeakSet(), Q = function(t) {
3246
- const { t: e } = this, s = e.tabPanels.filter((a) => a.getAttribute("t4-id") === t);
3247
- s.length > 1 && console.warn("有兩個相同id設定", s);
3248
- const o = s[0];
3249
- return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
3250
- }, ge = new WeakSet(), ys = function() {
3251
- const t = document.createElement("div");
3252
- t.classList.add("swiper-container");
3253
- const e = document.createElement("div");
3254
- e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
3255
- e.appendChild(s.cloneNode(!0));
3256
- }), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, fe, ws).call(this);
3257
- }, fe = new WeakSet(), ws = function() {
3258
- const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
3259
- t.style.overflow = "hidden", e.style.display = "flex";
3260
- const o = s.length * 100 + "%";
3261
- e.style.width = o;
3262
- }, ve = new WeakSet(), Ts = function(t) {
3263
- const { t: e } = this;
3264
- if (e.recordUrl === "true") {
3265
- const s = new URLSearchParams(document.location.search);
3266
- s.set(e.name, t);
3267
- const o = `${window.location.pathname}?${s.toString()}`;
3268
- history.replaceState({ t4Id: t }, "", o);
3269
- }
3270
- }, be = new WeakSet(), Es = function() {
3271
- const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
3272
- d(this, ye, As).call(this, o);
3273
- }, ye = new WeakSet(), As = function(t) {
3274
- window.scrollTo({
3275
- top: t,
3276
- behavior: "smooth"
3277
- });
3278
- }, we = new WeakSet(), Ss = function(t) {
3279
- let e = parseInt(t, 10) + 1;
3280
- this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
3281
- }, Te = new WeakSet(), Ls = function(t) {
3282
- 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;
3283
- e.forEach((a) => {
3284
- s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
3285
- });
3286
- }, Ee = new WeakSet(), _s = function(t) {
3287
- const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
3288
- e.forEach((a) => {
3289
- s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
3290
- });
3291
- }, Ae = new WeakSet(), Ds = function(t, e) {
3292
- this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
3293
- o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
3294
- }) : this.t.tabs.forEach((s, o) => {
3295
- s.getAttribute("t4-id") === e ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
3296
- });
3297
- }, N = new WeakSet(), R = function(t, e, s) {
3298
- switch (t) {
3299
- case "step":
3300
- Me(this.t.step) && d(this, we, Ss).call(this, e);
3301
- break;
3302
- case "eventAnchor":
3303
- this.t.anchor && d(this, be, Es).call(this);
3304
- break;
3305
- case "tabState":
3306
- this.t.type == "normal" && d(this, Ae, Ds).call(this, e, s);
3307
- break;
3308
- case "btnState":
3309
- d(this, Te, Ls).call(this, e), d(this, Ee, _s).call(this, e);
3310
- break;
3311
- case "tabUrl":
3312
- this.t.recordUrl === "true" && d(this, ve, Ts).call(this, e);
3313
- break;
3314
- default:
3315
- console.warn("請增加判斷,謝謝");
3316
- break;
3317
- }
3318
- }, Se = new WeakSet(), ks = function(t) {
3319
- const { t: e } = this;
3320
- this.t.transition;
3321
- const s = e.tabPanels[t];
3322
- switch (s.classList.remove("show"), s.classList.add("hide"), e.display) {
3323
- case "fade":
3324
- s.style.cssText = "display: none; opacity: 0;";
3325
- break;
3326
- case "slide":
3327
- s.style.cssText = "display: none; opacity: 0; max-height: unset;";
3328
- break;
3329
- case "swiper":
3330
- break;
3331
- default:
3332
- s.style.display = "none";
3333
- break;
3334
- }
3335
- }, Le = new WeakSet(), xs = function(t) {
3336
- const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
3337
- let r;
3338
- 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) {
3339
- case "fade":
3340
- a.style.opacity = "0", r = setTimeout(() => {
3341
- clearTimeout(r), a.style.opacity = "1";
3342
- }, 100);
3343
- break;
3344
- case "slide":
3345
- console.warn(this.t.display, "抱歉,好像壞掉了...");
3346
- const l = a.offsetHeight;
3347
- a.style.opacity = "1", a.style.maxHeight = "0", r = setTimeout(() => {
3348
- clearTimeout(r), a.style.maxHeight = l + "px";
3349
- }, 100);
3350
- break;
3351
- case "swiper":
3352
- a.style.opacity = "1";
3353
- const c = this.querySelector(".swiper-wrapper"), u = this.t.tabPanels[0].offsetWidth, h = -t * u;
3354
- c.style.transition = `transform ${e}ms ${s} ${o}ms`, c.style.transform = `translateX(${h}px)`;
3355
- break;
3356
- default:
3357
- console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
3358
- break;
3359
- }
3360
- }, _e = new WeakSet(), $s = function(t) {
3361
- const e = d(this, W, Q).call(this, t);
3362
- 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");
3363
- }, De = new WeakSet(), Cs = function() {
3364
- const t = this;
3365
- window.addEventListener(
3366
- "resize",
3367
- bn(() => {
3368
- t.update();
3369
- }, 1e3)
3370
- );
3371
- };
3372
- function bn(n, i = 1e3) {
3373
- let t;
3374
- return function(e) {
3375
- t && clearTimeout(t), t = setTimeout(n, i, e);
3281
+ function ae(s, t = 1e3) {
3282
+ let e;
3283
+ return function(i) {
3284
+ e && clearTimeout(e), e = setTimeout(s, t, i);
3376
3285
  };
3377
3286
  }
3378
- function Hs() {
3379
- const n = document.querySelectorAll("[t4-control]");
3380
- document.addEventListener("click", function(i) {
3381
- let t = !1;
3382
- for (const e of n)
3383
- if (e.contains(i.target) || i.target.closest("[t4-control]") === e) {
3384
- t = !0;
3287
+ function kt() {
3288
+ const s = document.querySelectorAll("[t4-control]");
3289
+ document.addEventListener("click", function(t) {
3290
+ let e = !1;
3291
+ for (const i of s)
3292
+ if (i.contains(t.target) || t.target.closest("[t4-control]") === i) {
3293
+ e = !0;
3385
3294
  break;
3386
3295
  }
3387
- if (t) {
3388
- const e = i.target.closest("[t4-control]"), s = e.getAttribute("t4-control"), o = document.querySelectorAll(`tab-el[t4-name="${s}"]`), a = e.getAttribute("t4-role");
3296
+ if (e) {
3297
+ const i = t.target.closest("[t4-control]"), n = i.getAttribute("t4-control"), o = document.querySelectorAll(`tab-el[t4-name="${n}"]`), a = i.getAttribute("t4-role");
3389
3298
  o.forEach((r) => {
3390
3299
  switch (a) {
3391
3300
  case "tab":
3392
- r.tabClick(e);
3301
+ r.tabClick(i);
3393
3302
  break;
3394
3303
  case "next":
3395
- r.goNext(e);
3304
+ r.goNext(i);
3396
3305
  break;
3397
3306
  case "prev":
3398
- r.goPrev(e);
3307
+ r.goPrev(i);
3399
3308
  break;
3400
3309
  default:
3401
- console.warn("你是誰??", e);
3310
+ console.warn("你是誰??", i);
3402
3311
  break;
3403
3312
  }
3404
3313
  });
3405
3314
  }
3406
3315
  });
3407
3316
  }
3408
- Hs();
3409
- Object.assign(fs.prototype, z);
3410
- customElements.define("tab-el", fs);
3411
- const ui = (n) => {
3412
- const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
3413
- 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";
3414
- }, yn = (n) => {
3415
- const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
3416
- 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";
3317
+ kt();
3318
+ Object.assign($t.prototype, N);
3319
+ customElements.define("tab-el", $t);
3320
+ const ut = (s) => {
3321
+ const { defaultOptions: t } = s.collapse, { collapseClass: e, target: i, transition: n } = t, o = s.querySelector(i);
3322
+ s.classList.add(e), o.style.height = 0, o.style["transition-property"] = n.property, o.style["transition-duration"] = n.duration, o.style["transition-timing-function"] = n.function, o.style["transition-delay"] = n.delay, o.style.overflow = "hidden";
3323
+ }, re = (s) => {
3324
+ const { defaultOptions: t } = s.collapse, { collapseClass: e, target: i, transition: n } = t, o = s.querySelector(i), a = o.children[0].offsetHeight;
3325
+ s.collapse.height = a, s.classList.remove(e), o.style.display = "block", o.style.height = `${a}px`, o.style["transition-property"] = n.property, o.style["transition-duration"] = n.duration, o.style["transition-timing-function"] = n.function, o.style["transition-delay"] = n.delay, o.style.overflow = "hidden";
3417
3326
  };
3418
- var ht, Ze, ke, Is, xe, Ms, mt, Qe;
3419
- class wn {
3420
- constructor(i, t = {}) {
3421
- p(this, ht);
3422
- p(this, ke);
3423
- p(this, xe);
3424
- p(this, mt);
3425
- !ft(i) && !Me(i) && !vt(i) && !A(i) || (this.__storage__ = {
3426
- el: i,
3427
- options: t
3428
- }, this.active = "data-collapse-active", d(this, ht, Ze).call(this));
3327
+ class le {
3328
+ constructor(t, e = {}) {
3329
+ !R(t) && !Q(t) && !X(t) && !T(t) || (this.__storage__ = {
3330
+ el: t,
3331
+ options: e
3332
+ }, this.active = "data-collapse-active", this.#t());
3333
+ }
3334
+ #t() {
3335
+ const { el: t, options: e } = this.__storage__, { SETTINGS: i, EVENTS: n } = ft;
3336
+ if (this.elements = e.state == "not active" ? S(t + `:not([${this.active}])`) : S(t), this.options = Object.assign({}, i, e), this.__events__ = Object.assign({}, n), this.options.on)
3337
+ for (const [o, a] of Object.entries(this.options.on))
3338
+ this.__events__[o] = [a];
3339
+ this.#s();
3340
+ }
3341
+ #s() {
3342
+ const { elements: t, options: e } = this;
3343
+ t.forEach((i) => {
3344
+ i.collapse = {}, i.collapse.instance = this, i.collapse.defaultOptions = e, i.collapse.methods = {}, i.collapse.methods.update = this.update, i.setAttribute(this.active, ""), this.#e(i);
3345
+ }), this.emit("init");
3346
+ }
3347
+ #e(t) {
3348
+ const { options: e } = this, { collapseClass: i, block: n, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = e, c = t, d = c.querySelector(o);
3349
+ if (c.collapse.height = d.children[0].offsetHeight, a ? (d.style.height = `${d.children[0].offsetHeight}px`, c.classList.remove(i)) : !c.classList.contains(l) && !c.hasAttribute(l) ? (c.classList.add(i), d.style.height = "0px", d.style.overflow = "hidden") : (d.style.height = `${d.children[0].offsetHeight}px`, c.classList.remove(i)), c.removeEventListener("click", this.#i), c.addEventListener("click", this.#i), r) {
3350
+ const u = (h) => {
3351
+ h.stopPropagation();
3352
+ };
3353
+ d.removeEventListener("click", u), d.addEventListener("click", u);
3354
+ }
3355
+ }
3356
+ #i() {
3357
+ const { instance: t, defaultOptions: e } = this.collapse, { collapseClass: i, block: n, target: o, single: a } = e, r = this;
3358
+ r.classList.contains(i) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
3359
+ ut(l);
3360
+ }), re(r)) : ut(r), t.emit("afterCollapse");
3429
3361
  }
3430
3362
  update() {
3431
- d(this, ht, Ze).call(this);
3363
+ this.#t();
3432
3364
  }
3433
3365
  }
3434
- ht = new WeakSet(), Ze = function() {
3435
- const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = fi;
3436
- 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)
3437
- for (const [o, a] of Object.entries(this.options.on))
3438
- this.__events__[o] = [a];
3439
- d(this, ke, Is).call(this);
3440
- }, ke = new WeakSet(), Is = function() {
3441
- const { elements: i, options: t } = this;
3442
- i.forEach((e) => {
3443
- 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, xe, Ms).call(this, e);
3444
- }), this.emit("init");
3445
- }, xe = new WeakSet(), Ms = function(i) {
3446
- const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
3447
- 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, mt, Qe)), c.addEventListener("click", d(this, mt, Qe)), r) {
3448
- const h = (g) => {
3449
- g.stopPropagation();
3450
- };
3451
- u.removeEventListener("click", h), u.addEventListener("click", h);
3452
- }
3453
- }, mt = new WeakSet(), Qe = function() {
3454
- const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
3455
- r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
3456
- ui(l);
3457
- }), yn(r)) : ui(r), i.emit("afterCollapse");
3458
- };
3459
- Object.assign(wn.prototype, z);
3460
- function Tn(n, i) {
3461
- const t = i, { color: e, opacity: s, duration: o } = i.s.options;
3462
- let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
3463
- 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() {
3366
+ Object.assign(le.prototype, N);
3367
+ function ce(s, t) {
3368
+ const e = t, { color: i, opacity: n, duration: o } = t.s.options;
3369
+ let a = document.createElement("span"), r = s.clientX - e.getBoundingClientRect().left, l = s.clientY - e.getBoundingClientRect().top;
3370
+ a.style.cssText = `background: ${i};left: ${r}px;top: ${l}px;opacity: ${n};animation-duration: ${o}ms`, a.classList.add("circle"), e.appendChild(a), setTimeout(function() {
3464
3371
  a.remove();
3465
3372
  }, `${o}`);
3466
3373
  }
3467
- function qs() {
3468
- document.querySelectorAll("ripple-btn").forEach((n) => {
3469
- n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
3374
+ function xt() {
3375
+ document.querySelectorAll("ripple-btn").forEach((s) => {
3376
+ s.querySelector(".hover-ball"), s.style.setProperty("--r", ""), s.classList.remove("entered");
3470
3377
  });
3471
3378
  }
3472
- document.addEventListener("click", qs);
3473
- var gt, Ke, $e, Os, Ce, Ps, He, Ns;
3474
- class En extends HTMLElement {
3379
+ document.addEventListener("click", xt);
3380
+ class de extends HTMLElement {
3475
3381
  constructor() {
3476
- super();
3477
- p(this, gt);
3478
- p(this, $e);
3479
- p(this, Ce);
3480
- p(this, He);
3481
- this.initialize = !1;
3382
+ super(), this.initialize = !1;
3482
3383
  }
3483
3384
  connectedCallback() {
3484
3385
  const t = this;
3485
- t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, gt, Ke).call(this));
3386
+ t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, this.#t());
3387
+ }
3388
+ #t() {
3389
+ const { SETTINGS: t } = vt;
3390
+ this.s = {};
3391
+ function e(n) {
3392
+ let o = !!n;
3393
+ return o = n === "true", o;
3394
+ }
3395
+ const i = {
3396
+ color: this.getAttribute("r4-color") || t.color,
3397
+ opacity: this.getAttribute("r4-opacity") || t.opacity,
3398
+ duration: Number(this.getAttribute("r4-duration")) || t.duration,
3399
+ speed: Number(this.getAttribute("r4-speed")) || t.speed,
3400
+ hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
3401
+ click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
3402
+ };
3403
+ this.s.options = i, this.s.options.hover && this.classList.add("hover-btn"), this.#s();
3404
+ }
3405
+ #s() {
3406
+ this.#e(), this.#i(), this.classList.add("r4-initialize");
3407
+ }
3408
+ #e() {
3409
+ const t = this, e = document.createElement("i");
3410
+ e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
3411
+ }
3412
+ #i() {
3413
+ const t = this.querySelector("i.hover-ball"), e = this;
3414
+ e.addEventListener("click", function(o) {
3415
+ o.stopPropagation(), e.s.options.click && ce(o, e);
3416
+ });
3417
+ let i = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", n = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
3418
+ e.addEventListener(i, function(o) {
3419
+ if (i === "touchstart" && xt(), e.s.options.hover) {
3420
+ const a = Math.round(i === "mouseenter" ? o.clientX - e.getBoundingClientRect().left : o.changedTouches[0].clientX - e.getBoundingClientRect().x), r = Math.round(i === "mouseenter" ? o.clientY - e.getBoundingClientRect().top : o.changedTouches[0].clientY - e.getBoundingClientRect().y), { offsetWidth: l, offsetHeight: c } = e, d = Math.max(l, c);
3421
+ t.style.width = d * 2 + "px", t.style.height = d * 2 + "px", t.style.left = a + "px", t.style.top = r + "px", e.classList.add("entered");
3422
+ }
3423
+ }), e.addEventListener(n, function(o) {
3424
+ if (n !== "touchend" && e.s.options.hover) {
3425
+ const a = Math.round(n === "mouseleave" ? o.clientX - e.getBoundingClientRect().left : o.changedTouches[0].clientX - e.getBoundingClientRect().x), r = Math.round(n === "mouseleave" ? o.clientY - e.getBoundingClientRect().top : o.changedTouches[0].clientY - e.getBoundingClientRect().y);
3426
+ t.style.width = "1px", t.style.height = "1px", e.style.setProperty("--r", ""), t.style.left = a + "px", t.style.top = r + "px", e.classList.remove("entered");
3427
+ }
3428
+ });
3486
3429
  }
3487
3430
  update() {
3488
- this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, gt, Ke).call(this);
3431
+ this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), this.#t();
3489
3432
  }
3490
3433
  }
3491
- gt = new WeakSet(), Ke = function() {
3492
- const { SETTINGS: t } = vi;
3493
- this.s = {};
3494
- function e(o) {
3495
- let a = !!o;
3496
- return a = o === "true", a;
3497
- }
3498
- const s = {
3499
- color: this.getAttribute("r4-color") || t.color,
3500
- opacity: this.getAttribute("r4-opacity") || t.opacity,
3501
- duration: Number(this.getAttribute("r4-duration")) || t.duration,
3502
- speed: Number(this.getAttribute("r4-speed")) || t.speed,
3503
- hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
3504
- click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
3505
- };
3506
- this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, $e, Os).call(this);
3507
- }, $e = new WeakSet(), Os = function() {
3508
- d(this, Ce, Ps).call(this), d(this, He, Ns).call(this), this.classList.add("r4-initialize");
3509
- }, Ce = new WeakSet(), Ps = function() {
3510
- const t = this, e = document.createElement("i");
3511
- e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
3512
- }, He = new WeakSet(), Ns = function() {
3513
- const t = this.querySelector("i.hover-ball"), e = this;
3514
- e.addEventListener("click", function(a) {
3515
- a.stopPropagation(), e.s.options.click && Tn(a, e);
3516
- });
3517
- let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
3518
- e.addEventListener(s, function(a) {
3519
- if (s === "touchstart" && qs(), e.s.options.hover) {
3520
- 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, h = Math.max(c, u);
3521
- t.style.width = h * 2 + "px", t.style.height = h * 2 + "px", t.style.left = r + "px", t.style.top = l + "px", e.classList.add("entered");
3522
- }
3523
- }), e.addEventListener(o, function(a) {
3524
- if (o !== "touchend" && e.s.options.hover) {
3525
- const r = Math.round(o === "mouseleave" ? a.clientX - e.getBoundingClientRect().left : a.changedTouches[0].clientX - e.getBoundingClientRect().x), l = Math.round(o === "mouseleave" ? a.clientY - e.getBoundingClientRect().top : a.changedTouches[0].clientY - e.getBoundingClientRect().y);
3526
- t.style.width = "1px", t.style.height = "1px", e.style.setProperty("--r", ""), t.style.left = r + "px", t.style.top = l + "px", e.classList.remove("entered");
3527
- }
3528
- });
3529
- };
3530
- customElements.define("ripple-btn", En);
3531
- class An {
3434
+ customElements.define("ripple-btn", de);
3435
+ class ue {
3532
3436
  constructor() {
3533
3437
  this.init();
3534
3438
  }
3535
3439
  init() {
3536
- const i = document.querySelectorAll("*:not([video-id]) > img"), t = (o, a) => {
3537
- const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), u = Math.sqrt(o ** 2 + a ** 2), h = Math.asin(a / u) * 180 / Math.PI;
3440
+ const t = document.querySelectorAll("*:not([video-id]) > img"), e = (o, a) => {
3441
+ const r = document.createElement("div"), l = document.createElement("span"), c = document.createElement("span"), d = Math.sqrt(o ** 2 + a ** 2), u = Math.asin(a / d) * 180 / Math.PI;
3538
3442
  return r.className = "no-image", l.className = "slash1", l.style.cssText = `
3539
- width: ${u}px;
3540
- transform: rotate(${h}deg);
3443
+ width: ${d}px;
3444
+ transform: rotate(${u}deg);
3541
3445
  `, c.className = "slash2", c.style.cssText = `
3542
- width: ${u}px;
3543
- transform: rotate(${-h}deg);
3446
+ width: ${d}px;
3447
+ transform: rotate(${-u}deg);
3544
3448
  `, r.appendChild(l), r.appendChild(c), r;
3545
- }, e = document.querySelectorAll(".error-image");
3546
- for (let o = 0; o < e.length; o++)
3547
- e[o].remove();
3548
- i.forEach((o) => {
3449
+ }, i = document.querySelectorAll(".error-image");
3450
+ for (let o = 0; o < i.length; o++)
3451
+ i[o].remove();
3452
+ t.forEach((o) => {
3549
3453
  let a;
3550
3454
  const r = o.parentElement.clientWidth, l = o.parentElement.clientHeight;
3551
3455
  if (o.classList.contains("lazy") || o.classList.contains("swiper-lazy") ? a = o.getAttribute("data-src") : a = o.getAttribute("src"), a === "") {
3552
- const c = document.createElement("div"), u = getComputedStyle(o.parentElement).position;
3553
- c.className = "error-image", u === "static" && (o.parentElement.style.position = "relative"), o.parentElement.appendChild(c), c.style.cssText = `
3456
+ const c = document.createElement("div"), d = getComputedStyle(o.parentElement).position;
3457
+ c.className = "error-image", d === "static" && (o.parentElement.style.position = "relative"), o.parentElement.appendChild(c), c.style.cssText = `
3554
3458
  position: absolute;
3555
3459
  top: 50%;
3556
3460
  left: 50%;
@@ -3558,118 +3462,117 @@ class An {
3558
3462
  height: 100%;
3559
3463
  transform: translate(-50%,-50%);
3560
3464
  z-index: 1;
3561
- `, c.appendChild(t(r, l));
3465
+ `, c.appendChild(e(r, l));
3562
3466
  }
3563
3467
  });
3564
- function s() {
3468
+ function n() {
3565
3469
  const o = document.querySelectorAll(".no-image");
3566
3470
  o.length <= 0 || o.forEach((a) => {
3567
- const r = a.parentElement.clientWidth, l = a.parentElement.clientHeight, c = Math.sqrt(r ** 2 + l ** 2), u = Math.asin(l / c) * 180 / Math.PI;
3471
+ const r = a.parentElement.clientWidth, l = a.parentElement.clientHeight, c = Math.sqrt(r ** 2 + l ** 2), d = Math.asin(l / c) * 180 / Math.PI;
3568
3472
  a.querySelector(".slash1").style.cssText = `
3569
3473
  width: ${c}px;
3570
- transform: rotate(${u}deg);
3474
+ transform: rotate(${d}deg);
3571
3475
  `, a.querySelector(".slash2").style.cssText = `
3572
3476
  width: ${c}px;
3573
- transform: rotate(${-u}deg);
3477
+ transform: rotate(${-d}deg);
3574
3478
  `;
3575
3479
  });
3576
3480
  }
3577
- window.addEventListener("resize", s);
3481
+ window.addEventListener("resize", n);
3578
3482
  }
3579
3483
  reValidate() {
3580
3484
  this.init();
3581
3485
  }
3582
3486
  }
3583
- function pi(n, i) {
3584
- return n ? function(t, e) {
3585
- Function(n)(t, e);
3586
- } : i;
3487
+ function pt(s, t) {
3488
+ return s ? function(e, i) {
3489
+ Function(s)(e, i);
3490
+ } : t;
3587
3491
  }
3588
- function Sn(n, i, t, e) {
3589
- const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
3590
- o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
3591
- const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
3592
- if (s.compress) {
3593
- const l = t.name.substring(t.name.lastIndexOf(".")).replace("."), c = t.name.replace(`.${l}`, "");
3594
- e.originalCanvas.toBlob(
3595
- function(u) {
3596
- const h = new File([u], `${c}`, { type: t.type });
3492
+ function pe(s, t, e, i) {
3493
+ const n = t.params, o = s.closest("[data-upload-item]").querySelector("[data-preview]");
3494
+ o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(i.imgElement);
3495
+ const a = s.dataset.group, r = document.querySelector(t.el).dataset.index;
3496
+ if (n.compress) {
3497
+ const l = e.name.substring(e.name.lastIndexOf(".")).replace("."), c = e.name.replace(`.${l}`, "");
3498
+ i.originalCanvas.toBlob(
3499
+ function(d) {
3500
+ const u = new File([d], `${c}`, { type: e.type });
3597
3501
  uploadImage[`${a}`][r] = {
3598
- file: h,
3599
- info: e
3600
- }, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
3502
+ file: u,
3503
+ info: i
3504
+ }, n.on.changeAfter && typeof n.on.changeAfter == "function" && n.on.changeAfter(s, i);
3601
3505
  },
3602
- t.type,
3603
- s.compress
3506
+ e.type,
3507
+ n.compress
3604
3508
  );
3605
3509
  } else
3606
3510
  uploadImage[`${a}`][r] = {
3607
- file: t,
3608
- info: e
3609
- }, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
3511
+ file: e,
3512
+ info: i
3513
+ }, n.on.changeAfter && typeof n.on.changeAfter == "function" && n.on.changeAfter(s, i);
3610
3514
  }
3611
- function Ln(n, i, t, e) {
3612
- const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
3613
- let u = 0, h = 0;
3614
- switch (s.width = t, s.height = e, n.previewSize) {
3515
+ function he(s, t, e, i) {
3516
+ const n = document.createElement("canvas"), o = n.getContext("2d"), a = t.width, l = t.height / a * 100, c = i / e * 100;
3517
+ let d = 0, u = 0;
3518
+ switch (n.width = e, n.height = i, s.previewSize) {
3615
3519
  case "contain":
3616
- l < c ? (u = s.width, h = t * l / 100) : l > c ? (u = e / l * 100, h = s.height) : (u = s.width, h = s.height);
3520
+ l < c ? (d = n.width, u = e * l / 100) : l > c ? (d = i / l * 100, u = n.height) : (d = n.width, u = n.height);
3617
3521
  break;
3618
3522
  case "cover":
3619
- l < c ? (u = e / l * 100, h = s.height) : l > c ? (u = s.width, h = t * l / 100) : l === c && (u = s.width, h = s.height);
3523
+ l < c ? (d = i / l * 100, u = n.height) : l > c ? (d = n.width, u = e * l / 100) : l === c && (d = n.width, u = n.height);
3620
3524
  break;
3621
3525
  }
3622
- const g = (s.width - u) * 0.5, m = (s.height - h) * 0.5;
3623
- return o.drawImage(i, g, m, u, h), s;
3526
+ const h = (n.width - d) * 0.5, p = (n.height - u) * 0.5;
3527
+ return o.drawImage(t, h, p, d, u), n;
3624
3528
  }
3625
- function _n(n, i) {
3626
- return new Promise((t, e) => {
3627
- if (i) {
3628
- const s = new Image();
3629
- s.src = i, s.classList.add(n.previewSize), s.onload = () => {
3529
+ function me(s, t) {
3530
+ return new Promise((e, i) => {
3531
+ if (t) {
3532
+ const n = new Image();
3533
+ n.src = t, n.classList.add(s.previewSize), n.onload = () => {
3630
3534
  let o = {
3631
- imgElement: s,
3632
- originalCanvas: Ln(n, s, s.width, s.height),
3535
+ imgElement: n,
3536
+ originalCanvas: he(s, n, n.width, n.height),
3633
3537
  info: {
3634
- originalWidth: s.width,
3635
- originalHeight: s.height,
3636
- ratio: s.height / s.width * 100 + "%"
3538
+ originalWidth: n.width,
3539
+ originalHeight: n.height,
3540
+ ratio: n.height / n.width * 100 + "%"
3637
3541
  }
3638
3542
  };
3639
- t(o);
3543
+ e(o);
3640
3544
  };
3641
3545
  } else
3642
- t();
3546
+ e();
3643
3547
  });
3644
3548
  }
3645
- function Dn(n, i) {
3646
- const t = Math.pow(10, i);
3647
- return Math.round(n * t) / t;
3549
+ function ge(s, t) {
3550
+ const e = Math.pow(10, t);
3551
+ return Math.round(s * e) / e;
3648
3552
  }
3649
- function kn(n, i) {
3650
- let t = n.size / 1024 / 1024;
3651
- return `${Dn(t, 2)}` <= i;
3553
+ function fe(s, t) {
3554
+ let e = s.size / 1024 / 1024;
3555
+ return `${ge(e, 2)}` <= t;
3652
3556
  }
3653
- function xn(n, i, t) {
3654
- if (n.target.files.length <= 0)
3655
- return;
3656
- const e = n.target.files[0], s = i.closest("[data-upload-item]");
3557
+ function ve(s, t, e) {
3558
+ if (s.target.files.length <= 0) return;
3559
+ const i = s.target.files[0], n = t.closest("[data-upload-item]");
3657
3560
  let o = new FileReader();
3658
3561
  o.onload = (a) => {
3659
- const r = e.type.split("/")[0] === "image" ? a.target.result : null;
3660
- if (t.params.sizeLimit && !kn(e, t.params.sizeLimit)) {
3661
- 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);
3562
+ const r = i.type.split("/")[0] === "image" ? a.target.result : null;
3563
+ if (e.params.sizeLimit && !fe(i, e.params.sizeLimit)) {
3564
+ t.value = "", n.classList.add("over-limit"), e.params.on.overLimit && typeof e.params.on.overLimit == "function" && e.params.on.overLimit(t, e.params.sizeLimit);
3662
3565
  return;
3663
3566
  } else
3664
- s.classList.remove("over-limit"), s.classList.add("uploaded"), _n(t.params, r).then((l) => {
3665
- Sn(i, t, e, l);
3567
+ n.classList.remove("over-limit"), n.classList.add("uploaded"), me(e.params, r).then((l) => {
3568
+ pe(t, e, i, l);
3666
3569
  });
3667
- }, o.readAsDataURL(e);
3570
+ }, o.readAsDataURL(i);
3668
3571
  }
3669
- class $n {
3670
- constructor(i, t) {
3671
- const e = this;
3672
- e.el = i, e.params = {
3572
+ class be {
3573
+ constructor(t, e) {
3574
+ const i = this;
3575
+ i.el = t, i.params = {
3673
3576
  on: {
3674
3577
  changeAfter: null,
3675
3578
  overLimit: null
@@ -3682,79 +3585,79 @@ class $n {
3682
3585
  //縮圖形式 (type: String 'contain' || 'cover')
3683
3586
  compress: 0.8
3684
3587
  //壓縮品質 (type: Number 0~1 || false)
3685
- }, Object.assign(e.params, t), e.init();
3588
+ }, Object.assign(i.params, e), i.init();
3686
3589
  }
3687
3590
  init() {
3688
- const i = this, t = document.querySelectorAll(`${i.el}:not(.preview-active)`);
3689
- t.length <= 0 || (window.uploadImage = {}, t.forEach((e, s) => {
3690
- e.classList.add("preview-active");
3591
+ const t = this, e = document.querySelectorAll(`${t.el}:not(.preview-active)`);
3592
+ e.length <= 0 || (window.uploadImage = {}, e.forEach((i, n) => {
3593
+ i.classList.add("preview-active");
3691
3594
  const o = {
3692
- group: e.dataset.group || i.params.group,
3693
- sizeLimit: parseInt(e.dataset.limit) || i.params.sizeLimit,
3694
- previewSize: e.dataset.previewSize || i.params.previewSize,
3695
- compress: e.dataset.compress || i.params.compress,
3595
+ group: i.dataset.group || t.params.group,
3596
+ sizeLimit: parseInt(i.dataset.limit) || t.params.sizeLimit,
3597
+ previewSize: i.dataset.previewSize || t.params.previewSize,
3598
+ compress: i.dataset.compress || t.params.compress,
3696
3599
  on: {
3697
- changeAfter: pi(e.dataset.changeAfter, i.params.on.changeAfter),
3698
- overLimit: pi(e.dataset.overLimit, i.params.on.overLimit)
3600
+ changeAfter: pt(i.dataset.changeAfter, t.params.on.changeAfter),
3601
+ overLimit: pt(i.dataset.overLimit, t.params.on.overLimit)
3699
3602
  }
3700
3603
  };
3701
- 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) {
3702
- xn(a, e, i);
3604
+ t.params = o, typeof uploadImage[`${o.group}`] > "u" && (uploadImage[`${o.group}`] = []), i.dataset.group || (i.dataset.group = o.group), i.dataset.index = document.querySelectorAll(`[data-group="${o.group}"]`).length - 1, i.addEventListener("change", function(a) {
3605
+ ve(a, i, t);
3703
3606
  });
3704
3607
  }));
3705
3608
  }
3706
3609
  }
3707
3610
  export {
3708
- bi as A,
3709
- Un as B,
3710
- wn as C,
3711
- Zi as D,
3712
- Yn as E,
3713
- Fn as F,
3714
- Jn as G,
3715
- Zn as H,
3716
- An as I,
3717
- Qn as J,
3718
- Kn as K,
3719
- Vn as L,
3720
- tt as M,
3721
- to as N,
3722
- eo as O,
3723
- io as P,
3724
- so as Q,
3725
- En as R,
3726
- no as S,
3727
- fs as T,
3728
- oo as U,
3729
- ao as V,
3730
- ro as W,
3731
- lo as X,
3732
- co as Y,
3733
- A as a,
3734
- vt as b,
3735
- Us as c,
3736
- Xs as d,
3737
- Ie as e,
3738
- S as f,
3739
- D as g,
3740
- jn as h,
3741
- ft as i,
3742
- Hi as j,
3743
- mn as k,
3744
- vn as l,
3745
- $n as m,
3746
- nn as n,
3747
- uo as o,
3748
- Xi as p,
3749
- Ui as q,
3750
- zn as r,
3751
- Rs as s,
3752
- Bn as t,
3753
- Wn as u,
3754
- je as v,
3755
- sn as w,
3756
- Gn as x,
3757
- Rn as y,
3758
- Xn as z
3611
+ bt as A,
3612
+ T as B,
3613
+ le as C,
3614
+ Dt as D,
3615
+ X as E,
3616
+ R as F,
3617
+ Ue as G,
3618
+ Fe as H,
3619
+ be as I,
3620
+ $e as J,
3621
+ De as K,
3622
+ Ye as L,
3623
+ ie as M,
3624
+ Lt as N,
3625
+ _t as O,
3626
+ It as P,
3627
+ Oe as Q,
3628
+ de as R,
3629
+ Xe as S,
3630
+ $t as T,
3631
+ xe as U,
3632
+ Pe as V,
3633
+ W,
3634
+ Z as X,
3635
+ Be as Y,
3636
+ At as a,
3637
+ ue as b,
3638
+ C as c,
3639
+ oe as d,
3640
+ Xt as e,
3641
+ He as f,
3642
+ qt as g,
3643
+ Ce as h,
3644
+ Me as i,
3645
+ qe as j,
3646
+ _e as k,
3647
+ Ne as l,
3648
+ Mt as m,
3649
+ Ut as n,
3650
+ je as o,
3651
+ Ie as p,
3652
+ ze as q,
3653
+ We as r,
3654
+ S as s,
3655
+ Ge as t,
3656
+ Re as u,
3657
+ Je as v,
3658
+ Ze as w,
3659
+ Qe as x,
3660
+ ke as y,
3661
+ E as z
3759
3662
  };
3760
3663
  //# sourceMappingURL=image-preview-bundle.js.map