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