@xwadex/fesd 0.0.48 → 0.0.50
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/image-preview-bundle.js +539 -530
- package/dist/image-preview-bundle.js.map +1 -1
- package/dist/tools-bundle.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Ds = Object.defineProperty;
|
|
2
|
+
var ks = (n, i, t) => i in n ? Ds(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
|
|
3
|
+
var Xe = (n, i, t) => (ks(n, typeof i != "symbol" ? i + "" : i, t), t), xs = (n, i, t) => {
|
|
4
4
|
if (!i.has(n))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
@@ -9,15 +9,15 @@ var h = (n, i, t) => {
|
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
i instanceof WeakSet ? i.add(n) : i.set(n, t);
|
|
11
11
|
};
|
|
12
|
-
var d = (n, i, t) => (
|
|
13
|
-
import { OverlayScrollbars as
|
|
12
|
+
var d = (n, i, t) => (xs(n, i, "access private method"), t);
|
|
13
|
+
import { OverlayScrollbars as je } from "overlayscrollbars";
|
|
14
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 ti from "vanilla-lazyload";
|
|
19
|
+
import { lock as $s, unlock as _s } from "tua-body-scroll-lock";
|
|
20
|
+
const ze = {
|
|
21
21
|
SETTINGS: {
|
|
22
22
|
videoId: null,
|
|
23
23
|
videoType: null,
|
|
@@ -60,7 +60,7 @@ const je = {
|
|
|
60
60
|
TEMPLATE() {
|
|
61
61
|
return '<div class="player-container"><div class="player-wrapper"></div></div>';
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, Cs = {
|
|
64
64
|
SETTINGS: {
|
|
65
65
|
success: null,
|
|
66
66
|
text: null,
|
|
@@ -117,7 +117,7 @@ const je = {
|
|
|
117
117
|
gap: 30
|
|
118
118
|
// 跑馬燈內容之間的距離 - Number
|
|
119
119
|
}
|
|
120
|
-
},
|
|
120
|
+
}, Be = {
|
|
121
121
|
SETTINGS: {
|
|
122
122
|
scrollbar: {
|
|
123
123
|
"scrollbar-track-color": "transparent",
|
|
@@ -145,7 +145,7 @@ const je = {
|
|
|
145
145
|
</div>`;
|
|
146
146
|
return t || r;
|
|
147
147
|
}
|
|
148
|
-
},
|
|
148
|
+
}, Hs = {
|
|
149
149
|
SETTINGS: {
|
|
150
150
|
basic_rwd: 900,
|
|
151
151
|
markdownLink: !1,
|
|
@@ -154,7 +154,7 @@ const je = {
|
|
|
154
154
|
navigation: !1,
|
|
155
155
|
scrollStep: !1
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, ei = {
|
|
158
158
|
SETTINGS: {
|
|
159
159
|
scroller: window,
|
|
160
160
|
class: "aost-show",
|
|
@@ -177,7 +177,7 @@ const je = {
|
|
|
177
177
|
enter: null,
|
|
178
178
|
leave: null
|
|
179
179
|
}
|
|
180
|
-
},
|
|
180
|
+
}, mt = {
|
|
181
181
|
SETTINGS: {
|
|
182
182
|
target: null,
|
|
183
183
|
container: null,
|
|
@@ -237,7 +237,7 @@ const je = {
|
|
|
237
237
|
return `<dropdown-el${n.placeholder ? ` d4-placeholder="${n.placeholder}"` : ""}${n.value ? ` d4-value="${n.value}"` : ""}></dropdown-el>`;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
},
|
|
240
|
+
}, ii = {
|
|
241
241
|
SETTINGS: {
|
|
242
242
|
// 樣式 normal / process
|
|
243
243
|
type: "normal",
|
|
@@ -257,7 +257,7 @@ const je = {
|
|
|
257
257
|
// 步驟狀態綁定
|
|
258
258
|
stepOutput: ".step-show"
|
|
259
259
|
}
|
|
260
|
-
},
|
|
260
|
+
}, si = {
|
|
261
261
|
SETTINGS: {
|
|
262
262
|
collapseClass: "collapse",
|
|
263
263
|
block: "[collapse-block]",
|
|
@@ -290,7 +290,7 @@ const je = {
|
|
|
290
290
|
update: null,
|
|
291
291
|
afterUpdate: null
|
|
292
292
|
}
|
|
293
|
-
},
|
|
293
|
+
}, ni = {
|
|
294
294
|
SETTINGS: {
|
|
295
295
|
// 是否要加 hover 效果?
|
|
296
296
|
hover: !0,
|
|
@@ -305,38 +305,38 @@ const je = {
|
|
|
305
305
|
// hover 毫秒 ?
|
|
306
306
|
speed: 600
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
309
309
|
__proto__: null,
|
|
310
|
-
anchor4:
|
|
311
|
-
aost4:
|
|
312
|
-
article4:
|
|
313
|
-
collapse4:
|
|
314
|
-
dropdown4:
|
|
310
|
+
anchor4: mt,
|
|
311
|
+
aost4: ei,
|
|
312
|
+
article4: Hs,
|
|
313
|
+
collapse4: si,
|
|
314
|
+
dropdown4: Be,
|
|
315
315
|
marquee4: M,
|
|
316
316
|
modal4: P,
|
|
317
317
|
multipurpose4: q,
|
|
318
|
-
ripple4:
|
|
319
|
-
share4:
|
|
320
|
-
tab4:
|
|
321
|
-
video4:
|
|
318
|
+
ripple4: ni,
|
|
319
|
+
share4: Cs,
|
|
320
|
+
tab4: ii,
|
|
321
|
+
video4: ze
|
|
322
322
|
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
323
323
|
before: "beforebegin",
|
|
324
324
|
after: "afterend",
|
|
325
325
|
append: "beforeend",
|
|
326
326
|
prepend: "afterbegin"
|
|
327
|
-
},
|
|
327
|
+
}, dt = (n) => typeof n == "string" && n !== "", Se = (n) => n instanceof HTMLElement, ut = (n) => n instanceof NodeList, E = (n) => x(n) !== null, G = (n) => typeof n == "function", x = (n) => Se(n) ? n : document.querySelector(n), $ = (n) => ut(n) ? n : document.querySelectorAll(n), Ms = () => Math.random().toString(36).substr(2, 9), Is = (n) => {
|
|
328
328
|
const i = document.createElement("div");
|
|
329
329
|
return i.innerHTML = n, i.childNodes;
|
|
330
|
-
},
|
|
330
|
+
}, qs = (n) => {
|
|
331
331
|
try {
|
|
332
332
|
JSON.parse(n);
|
|
333
333
|
} catch {
|
|
334
334
|
return n;
|
|
335
335
|
}
|
|
336
336
|
return JSON.parse(n);
|
|
337
|
-
},
|
|
337
|
+
}, L = (n, i) => {
|
|
338
338
|
console.warn(`[${n} warn]: ${i}`);
|
|
339
|
-
},
|
|
339
|
+
}, Fe = (n, i) => {
|
|
340
340
|
console.error(`[${n} error]: ${i}`);
|
|
341
341
|
}, j = {
|
|
342
342
|
on(n, i) {
|
|
@@ -369,7 +369,7 @@ const je = {
|
|
|
369
369
|
G(s) && s.apply(this, e);
|
|
370
370
|
}), this) : this;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, Os = {
|
|
373
373
|
easeInOutCirc(n, i, t, e) {
|
|
374
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;
|
|
375
375
|
},
|
|
@@ -379,33 +379,33 @@ const je = {
|
|
|
379
379
|
easeOutQuart(n, i, t, e) {
|
|
380
380
|
return -t * ((n = n / e - 1) * n * n * n - 1) + i;
|
|
381
381
|
}
|
|
382
|
-
},
|
|
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 = E(e) ?
|
|
382
|
+
}, De = (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 = E(e) ? x(e) : document.scrollingElement, v = m[u], w = E(t) ? x(t).getBoundingClientRect()[p] : 0 - v, b = E(s) ? x(s).getBoundingClientRect()[g] : 0, T = w - a - b, C = 15;
|
|
384
384
|
let y = 0;
|
|
385
385
|
if (T === 0)
|
|
386
386
|
return;
|
|
387
|
-
const D = (
|
|
388
|
-
const z =
|
|
389
|
-
i && i.emit(
|
|
387
|
+
const D = (A) => {
|
|
388
|
+
const z = x(t);
|
|
389
|
+
i && i.emit(A, z), !i && n.on && G(n.on[A]) && n.on[A](z);
|
|
390
390
|
};
|
|
391
391
|
D("beforeScroll");
|
|
392
392
|
const U = () => {
|
|
393
393
|
y += C;
|
|
394
|
-
const
|
|
395
|
-
m[u] =
|
|
394
|
+
const A = Os[r](y, v, T, o);
|
|
395
|
+
m[u] = A, y < o && requestAnimationFrame(U), y >= o && D("afterScroll");
|
|
396
396
|
};
|
|
397
397
|
requestAnimationFrame(U);
|
|
398
398
|
};
|
|
399
|
-
var
|
|
400
|
-
class
|
|
399
|
+
var K, ke, bt, ai, yt, ri;
|
|
400
|
+
class oi {
|
|
401
401
|
constructor(i, t = {}) {
|
|
402
|
-
h(this,
|
|
403
|
-
h(this, vt);
|
|
402
|
+
h(this, K);
|
|
404
403
|
h(this, bt);
|
|
404
|
+
h(this, yt);
|
|
405
405
|
this.__storage__ = {
|
|
406
406
|
el: i,
|
|
407
407
|
options: t
|
|
408
|
-
}, this.active = "data-anchor-active", d(this,
|
|
408
|
+
}, this.active = "data-anchor-active", d(this, K, ke).call(this);
|
|
409
409
|
}
|
|
410
410
|
destroy() {
|
|
411
411
|
const { elements: i } = this;
|
|
@@ -415,39 +415,39 @@ class ni {
|
|
|
415
415
|
}
|
|
416
416
|
update() {
|
|
417
417
|
var i;
|
|
418
|
-
return d(i = this.destroy(),
|
|
418
|
+
return d(i = this.destroy(), K, ke).call(i), this.emit("afterUpdate"), this;
|
|
419
419
|
}
|
|
420
420
|
static run(i) {
|
|
421
|
-
const { SETTINGS: t } =
|
|
421
|
+
const { SETTINGS: t } = mt, e = Object.assign({}, t, i);
|
|
422
422
|
setTimeout(() => {
|
|
423
|
-
|
|
423
|
+
De(e);
|
|
424
424
|
}, e.delay);
|
|
425
425
|
}
|
|
426
426
|
static url(i) {
|
|
427
|
-
const { SETTINGS: t } =
|
|
427
|
+
const { SETTINGS: t } = mt, { 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()}"]`);
|
|
428
428
|
if (!a)
|
|
429
429
|
return;
|
|
430
430
|
const r = Object.assign({}, t, i, { target: a });
|
|
431
431
|
setTimeout(() => {
|
|
432
|
-
|
|
432
|
+
De(r);
|
|
433
433
|
}, r.delay);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
K = new WeakSet(), ke = function() {
|
|
437
437
|
const { el: i, options: t } = this.__storage__;
|
|
438
|
-
if (!
|
|
438
|
+
if (!dt(i) || !E(i))
|
|
439
439
|
return;
|
|
440
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
441
|
-
if (this.elements = t.state == "not active" ?
|
|
440
|
+
const { SETTINGS: e, EVENTS: s } = mt;
|
|
441
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.elements = $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
442
442
|
for (const [o, a] of Object.entries(this.options.on))
|
|
443
443
|
this.__events__[o] = [a];
|
|
444
|
-
d(this,
|
|
445
|
-
},
|
|
444
|
+
d(this, bt, ai).call(this);
|
|
445
|
+
}, bt = new WeakSet(), ai = function() {
|
|
446
446
|
const { elements: i, options: t } = this;
|
|
447
447
|
i.forEach((e) => {
|
|
448
|
-
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this,
|
|
448
|
+
e.anchor = {}, e.anchor.instance = this, e.anchor.eventHandler = d(this, yt, ri), 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, "");
|
|
449
449
|
}), this.emit("afterInit");
|
|
450
|
-
},
|
|
450
|
+
}, yt = new WeakSet(), ri = function() {
|
|
451
451
|
const { defaultOptions: i, eventHandler: t, instance: e } = this.anchor, s = {
|
|
452
452
|
target: this.getAttribute("data-anchor-target") || i.target,
|
|
453
453
|
container: this.getAttribute("data-anchor-container") || i.container,
|
|
@@ -461,12 +461,12 @@ V = new WeakSet(), De = function() {
|
|
|
461
461
|
this.removeEventListener("click", t), setTimeout(() => {
|
|
462
462
|
this.addEventListener("click", t);
|
|
463
463
|
}, s.speed), setTimeout(() => {
|
|
464
|
-
|
|
464
|
+
De(s, e);
|
|
465
465
|
}, s.delay);
|
|
466
466
|
};
|
|
467
|
-
Object.assign(
|
|
467
|
+
Object.assign(oi.prototype, j);
|
|
468
468
|
window.MODALS || (window.MODALS = {});
|
|
469
|
-
const { MODALS: O } = window,
|
|
469
|
+
const { MODALS: O } = window, Ns = (n) => {
|
|
470
470
|
const { TEMPLATE: i } = P, { childDom: t } = n, e = document.createElement("div");
|
|
471
471
|
e.innerHTML = i(n.getAttribute("data-modal-template-setting"));
|
|
472
472
|
const s = e.querySelector(".modal-content");
|
|
@@ -474,14 +474,14 @@ const { MODALS: O } = window, qs = (n) => {
|
|
|
474
474
|
s.append(o);
|
|
475
475
|
}), e.children[0];
|
|
476
476
|
};
|
|
477
|
-
var
|
|
478
|
-
class
|
|
477
|
+
var wt, ci, Tt, di, Et, ui, At, hi, Lt, pi;
|
|
478
|
+
class li extends HTMLElement {
|
|
479
479
|
constructor() {
|
|
480
480
|
super();
|
|
481
|
-
h(this, yt);
|
|
482
481
|
h(this, wt);
|
|
483
482
|
h(this, Tt);
|
|
484
483
|
h(this, Et);
|
|
484
|
+
h(this, At);
|
|
485
485
|
h(this, Lt);
|
|
486
486
|
this.initialize = !1;
|
|
487
487
|
}
|
|
@@ -491,12 +491,12 @@ class ri extends HTMLElement {
|
|
|
491
491
|
attributeChangedCallback(t, e, s) {
|
|
492
492
|
switch (t) {
|
|
493
493
|
case ":state":
|
|
494
|
-
d(this, Lt,
|
|
494
|
+
d(this, Lt, pi).call(this, s);
|
|
495
495
|
break;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
connectedCallback() {
|
|
499
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
499
|
+
this.initialize || (this.initialize = !0, d(this, wt, ci).call(this));
|
|
500
500
|
}
|
|
501
501
|
open() {
|
|
502
502
|
return this.setAttribute(":state", "open"), this;
|
|
@@ -508,22 +508,22 @@ class ri extends HTMLElement {
|
|
|
508
508
|
return this.setAttribute(":state", "destroy"), this;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
|
|
511
|
+
wt = new WeakSet(), ci = function() {
|
|
512
512
|
const { ATTRS: t } = P;
|
|
513
513
|
this.__events__ = {}, this.getAttribute(":state") || this.setAttribute(":state", "close");
|
|
514
|
-
const e = this.getAttribute(t.id) ||
|
|
515
|
-
this.getAttribute(t.id) || (
|
|
516
|
-
}, wt = new WeakSet(), ci = function() {
|
|
517
|
-
this.childDom = this.childNodes, this.template = qs(this), this.innerHTML = "", this.append(this.template), d(this, Tt, di).call(this);
|
|
514
|
+
const e = this.getAttribute(t.id) || Ms();
|
|
515
|
+
this.getAttribute(t.id) || (L(`modern-modal needs a ${t.id} attribute with a unique id.`), this.setAttribute(t.id, e)), O[e] && L(`the ${t.id} "${e}" is already be used.`), O[e] = this, d(this, Tt, di).call(this);
|
|
518
516
|
}, Tt = new WeakSet(), di = function() {
|
|
517
|
+
this.childDom = this.childNodes, this.template = Ns(this), this.innerHTML = "", this.append(this.template), d(this, Et, ui).call(this);
|
|
518
|
+
}, Et = new WeakSet(), ui = function() {
|
|
519
519
|
const t = this.querySelector(".modal-scroller");
|
|
520
|
-
this.__scroller__ =
|
|
520
|
+
this.__scroller__ = je(t, {
|
|
521
521
|
overflowBehavior: {
|
|
522
522
|
x: "hidden"
|
|
523
523
|
},
|
|
524
524
|
autoUpdate: !0
|
|
525
|
-
}), window.modalScroll = this.__scroller__, d(this,
|
|
526
|
-
},
|
|
525
|
+
}), window.modalScroll = this.__scroller__, d(this, At, hi).call(this);
|
|
526
|
+
}, At = new WeakSet(), hi = function() {
|
|
527
527
|
var a, r, l;
|
|
528
528
|
const t = this, { ATTRS: e } = P, { close: s, destroy: o } = e;
|
|
529
529
|
(a = t.querySelectorAll(`[${s}]`)) == null || a.forEach((c) => {
|
|
@@ -539,7 +539,7 @@ yt = new WeakSet(), li = function() {
|
|
|
539
539
|
}), (l = t.querySelector("[stop-propagation]")) == null || l.addEventListener("click", function(c) {
|
|
540
540
|
c.stopPropagation();
|
|
541
541
|
});
|
|
542
|
-
}, Lt = new WeakSet(),
|
|
542
|
+
}, Lt = new WeakSet(), pi = function(t) {
|
|
543
543
|
const { __scroller__: e } = this;
|
|
544
544
|
if (t === "open") {
|
|
545
545
|
if (this.style.display = "block", e) {
|
|
@@ -570,22 +570,22 @@ yt = new WeakSet(), li = function() {
|
|
|
570
570
|
this.addEventListener("transitionend", s);
|
|
571
571
|
}
|
|
572
572
|
};
|
|
573
|
-
Object.assign(
|
|
574
|
-
const { MODALS:
|
|
573
|
+
Object.assign(li.prototype, j);
|
|
574
|
+
const { MODALS: We } = window, ht = {}, mi = (n, i, ...t) => {
|
|
575
575
|
if (!i)
|
|
576
576
|
return;
|
|
577
577
|
const e = n[i];
|
|
578
578
|
e && G(e) && e.apply(n, t);
|
|
579
|
-
},
|
|
580
|
-
n && G(n) && n.apply(
|
|
579
|
+
}, gi = (n, ...i) => {
|
|
580
|
+
n && G(n) && n.apply(V, i);
|
|
581
581
|
}, Ye = (n, i) => {
|
|
582
|
-
const { target: t } = n, e =
|
|
583
|
-
e &&
|
|
584
|
-
},
|
|
585
|
-
const { target: t, action: e, on: s, e: o } = n, a =
|
|
582
|
+
const { target: t } = n, e = We[t] || x(n.target);
|
|
583
|
+
e && fi(n, i), e || Ps(n, i);
|
|
584
|
+
}, fi = (n, i) => {
|
|
585
|
+
const { target: t, action: e, on: s, e: o } = n, a = We[t] || x(n.target);
|
|
586
586
|
switch (["open", "close", "destroy"].forEach((l) => {
|
|
587
587
|
a.once(l, () => {
|
|
588
|
-
i && (i.emit(l, a, o),
|
|
588
|
+
i && (i.emit(l, a, o), mi(i, s[l], a, o)), i || gi(s[l], a);
|
|
589
589
|
});
|
|
590
590
|
}), e) {
|
|
591
591
|
case "open":
|
|
@@ -602,34 +602,34 @@ const { MODALS: Be } = window, ut = {}, pi = (n, i, ...t) => {
|
|
|
602
602
|
l === "close" && a.open(), l === "open" && a.close();
|
|
603
603
|
break;
|
|
604
604
|
}
|
|
605
|
-
},
|
|
605
|
+
}, Ps = async (n, i) => {
|
|
606
606
|
const { target: t, route: e, container: s, on: o, e: a } = n;
|
|
607
607
|
if (!e)
|
|
608
|
-
return
|
|
608
|
+
return L("modal4", "cannot find target or data-modal-route is not defined");
|
|
609
609
|
const r = (l, ...c) => {
|
|
610
|
-
i && (i.emit(l, ...c),
|
|
610
|
+
i && (i.emit(l, ...c), mi(i, o[l], ...c)), i || gi(o[l], ...c);
|
|
611
611
|
};
|
|
612
|
-
|
|
613
|
-
const c =
|
|
612
|
+
ht[t] || (ht[t] = !0, fetch(e).then((l) => (r("success", a), l.text())).then((l) => {
|
|
613
|
+
const c = Is(l), u = x(s) || x(P.SETTINGS.container);
|
|
614
614
|
[...c].forEach((g) => {
|
|
615
615
|
u.append(g);
|
|
616
616
|
});
|
|
617
|
-
const p =
|
|
618
|
-
r("complete", p),
|
|
617
|
+
const p = We[t] || x(n.target);
|
|
618
|
+
r("complete", p), fi(n, i), delete ht[t];
|
|
619
619
|
}).catch((l) => {
|
|
620
|
-
r("error", l), delete
|
|
620
|
+
r("error", l), delete ht[t];
|
|
621
621
|
}));
|
|
622
622
|
};
|
|
623
|
-
var
|
|
623
|
+
var tt, xe, St, vi, Dt, bi;
|
|
624
624
|
const B = class B {
|
|
625
625
|
constructor(i, t = {}) {
|
|
626
|
-
h(this,
|
|
627
|
-
h(this, At);
|
|
626
|
+
h(this, tt);
|
|
628
627
|
h(this, St);
|
|
628
|
+
h(this, Dt);
|
|
629
629
|
this.__storage__ = {
|
|
630
630
|
el: i,
|
|
631
631
|
options: t
|
|
632
|
-
}, this.active = "data-modal-active", d(this,
|
|
632
|
+
}, this.active = "data-modal-active", d(this, tt, xe).call(this);
|
|
633
633
|
}
|
|
634
634
|
destroy() {
|
|
635
635
|
const { elements: i } = this;
|
|
@@ -639,7 +639,7 @@ const B = class B {
|
|
|
639
639
|
}
|
|
640
640
|
update() {
|
|
641
641
|
var i;
|
|
642
|
-
return d(i = this.destroy(),
|
|
642
|
+
return d(i = this.destroy(), tt, xe).call(i), this.emit("update"), this;
|
|
643
643
|
}
|
|
644
644
|
/** static method 'open' */
|
|
645
645
|
static open(i) {
|
|
@@ -655,23 +655,23 @@ const B = class B {
|
|
|
655
655
|
Object.assign(B.prototype, B.prototype.__methods__);
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
|
-
|
|
658
|
+
tt = new WeakSet(), xe = function() {
|
|
659
659
|
const { el: i, options: t } = this.__storage__;
|
|
660
|
-
if (!
|
|
660
|
+
if (!dt(i) || !E(i))
|
|
661
661
|
return;
|
|
662
662
|
const { SETTINGS: e, EVENTS: s } = P;
|
|
663
|
-
if (this.elements = t.state == "not active" ?
|
|
663
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
664
664
|
for (const [o, a] of Object.entries(this.options.on))
|
|
665
665
|
this.__events__[o] = [a];
|
|
666
|
-
d(this,
|
|
667
|
-
},
|
|
666
|
+
d(this, St, vi).call(this);
|
|
667
|
+
}, St = new WeakSet(), vi = function() {
|
|
668
668
|
const { elements: i, options: t } = this;
|
|
669
669
|
i.forEach((e) => {
|
|
670
|
-
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this,
|
|
670
|
+
e.modal = {}, e.modal.instance = this, e.modal.eventHandler = d(this, Dt, bi), 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, "");
|
|
671
671
|
}), this.emit("init");
|
|
672
|
-
},
|
|
673
|
-
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o =
|
|
674
|
-
o && typeof o != "object" &&
|
|
672
|
+
}, Dt = new WeakSet(), bi = function(i) {
|
|
673
|
+
const { defaultOptions: t, eventHandler: e, instance: s } = this.modal, o = qs(this.getAttribute("data-modal-on"));
|
|
674
|
+
o && typeof o != "object" && L("modal4", "data-modal-on must be a json string.");
|
|
675
675
|
const a = {
|
|
676
676
|
target: this.getAttribute("data-modal-target") || t.target,
|
|
677
677
|
action: this.getAttribute("data-modal-action") || t.action,
|
|
@@ -684,10 +684,10 @@ K = new WeakSet(), ke = function() {
|
|
|
684
684
|
this.addEventListener("click", e);
|
|
685
685
|
}, 200), Ye(a, s);
|
|
686
686
|
};
|
|
687
|
-
let
|
|
688
|
-
Object.assign(
|
|
689
|
-
customElements.define("modern-modal",
|
|
690
|
-
const
|
|
687
|
+
let V = B;
|
|
688
|
+
Object.assign(V.prototype, j);
|
|
689
|
+
customElements.define("modern-modal", li);
|
|
690
|
+
const js = (n, i) => {
|
|
691
691
|
const t = n === window ? n.innerHeight : n.getBoundingClientRect().height, e = n === window ? 0 : n.getBoundingClientRect().top;
|
|
692
692
|
i.forEach((s) => {
|
|
693
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);
|
|
@@ -702,22 +702,22 @@ const Ns = (n, i) => {
|
|
|
702
702
|
}, a);
|
|
703
703
|
}
|
|
704
704
|
});
|
|
705
|
-
},
|
|
706
|
-
var
|
|
707
|
-
class
|
|
705
|
+
}, zs = (n, i) => n === "up" || n === "down" ? n : n !== null ? n === "true" ? !0 : n === "false" ? !1 : i.repeat : i.repeat;
|
|
706
|
+
var et, $e, kt, wi;
|
|
707
|
+
class yi {
|
|
708
708
|
constructor(i, t = {}) {
|
|
709
|
-
h(this,
|
|
710
|
-
h(this,
|
|
709
|
+
h(this, et);
|
|
710
|
+
h(this, kt);
|
|
711
711
|
this.__storage__ = {
|
|
712
712
|
el: i,
|
|
713
713
|
options: t
|
|
714
|
-
}, this.active = "data-aost-active", d(this,
|
|
714
|
+
}, this.active = "data-aost-active", d(this, et, $e).call(this);
|
|
715
715
|
}
|
|
716
716
|
destroy(i) {
|
|
717
717
|
const { elements: t, options: e } = this;
|
|
718
718
|
if (!t)
|
|
719
719
|
return this;
|
|
720
|
-
const { scroller: s } = e, o = s === window || !E(s) ? window :
|
|
720
|
+
const { scroller: s } = e, o = s === window || !E(s) ? window : x(s);
|
|
721
721
|
return o.aost && (o.removeEventListener("scroll", o.aost.eventHandler), delete o.aost), t.forEach((a) => {
|
|
722
722
|
if (!a.aost)
|
|
723
723
|
return;
|
|
@@ -727,58 +727,58 @@ class bi {
|
|
|
727
727
|
}
|
|
728
728
|
update(i) {
|
|
729
729
|
var t;
|
|
730
|
-
d(t = this.destroy(i),
|
|
730
|
+
d(t = this.destroy(i), et, $e).call(t);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
|
|
733
|
+
et = new WeakSet(), $e = function() {
|
|
734
734
|
const { el: i, options: t } = this.__storage__;
|
|
735
|
-
if (!
|
|
735
|
+
if (!dt(i) || !E(i))
|
|
736
736
|
return;
|
|
737
|
-
const { SETTINGS: e, EVENTS: s } =
|
|
738
|
-
if (this.elements = t.state == "not active" ?
|
|
737
|
+
const { SETTINGS: e, EVENTS: s } = ei;
|
|
738
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
739
739
|
for (const [o, a] of Object.entries(this.options.on))
|
|
740
740
|
this.__events__[o] = [a];
|
|
741
|
-
d(this,
|
|
742
|
-
},
|
|
743
|
-
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !E(e) ? window :
|
|
741
|
+
d(this, kt, wi).call(this);
|
|
742
|
+
}, kt = new WeakSet(), wi = function() {
|
|
743
|
+
const { elements: i, options: t } = this, { scroller: e } = t, s = e === window || !E(e) ? window : x(e);
|
|
744
744
|
this.eventHandler = () => {
|
|
745
|
-
|
|
745
|
+
js(s, i);
|
|
746
746
|
}, i.forEach((a) => {
|
|
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 =
|
|
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 = zs(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, "");
|
|
748
748
|
});
|
|
749
749
|
const { eventHandler: o } = this;
|
|
750
750
|
o(), s.aost = {}, s.aost.eventHandler = o, s.addEventListener("scroll", s.aost.eventHandler, !1);
|
|
751
751
|
};
|
|
752
|
-
Object.assign(
|
|
753
|
-
const
|
|
754
|
-
const { TEMPLATE: i } =
|
|
752
|
+
Object.assign(yi.prototype, j);
|
|
753
|
+
const Bs = (n) => {
|
|
754
|
+
const { TEMPLATE: i } = ze, { childDom: t } = n, e = document.createElement("div");
|
|
755
755
|
e.innerHTML = i();
|
|
756
756
|
const s = e.querySelector(".player-wrapper");
|
|
757
757
|
return [...t].forEach((o) => {
|
|
758
758
|
s.append(o);
|
|
759
759
|
}), e.children[0];
|
|
760
760
|
};
|
|
761
|
-
var
|
|
762
|
-
class
|
|
761
|
+
var xt, Ti, $t, Ei, _t, Ai, Ct, Li, Ht, Si, Mt, Di, It, ki, qt, xi, Ot, $i, Nt, _i;
|
|
762
|
+
class Ws extends HTMLElement {
|
|
763
763
|
constructor() {
|
|
764
764
|
super();
|
|
765
|
-
h(this, kt);
|
|
766
|
-
h(this, $t);
|
|
767
765
|
h(this, xt);
|
|
768
|
-
|
|
766
|
+
h(this, $t);
|
|
769
767
|
h(this, _t);
|
|
770
|
-
//
|
|
768
|
+
// youtube iframe
|
|
771
769
|
h(this, Ct);
|
|
772
|
-
//
|
|
770
|
+
// vimeo iframe
|
|
773
771
|
h(this, Ht);
|
|
772
|
+
// youku iframe
|
|
774
773
|
h(this, Mt);
|
|
775
|
-
// 2025.02.11 新增 ig
|
|
776
774
|
h(this, It);
|
|
777
|
-
// 2025.02.11 新增
|
|
775
|
+
// 2025.02.11 新增 ig
|
|
778
776
|
h(this, qt);
|
|
779
|
-
//
|
|
777
|
+
// 2025.02.11 新增 tiktok
|
|
780
778
|
h(this, Ot);
|
|
781
|
-
|
|
779
|
+
// 2026.01.15 新增 video
|
|
780
|
+
h(this, Nt);
|
|
781
|
+
d(this, xt, Ti).call(this);
|
|
782
782
|
}
|
|
783
783
|
play() {
|
|
784
784
|
const { videoType: t } = this;
|
|
@@ -815,15 +815,15 @@ class zs extends HTMLElement {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
|
|
818
|
+
xt = new WeakSet(), Ti = function() {
|
|
819
819
|
if (!this.getAttribute("video-id")) {
|
|
820
|
-
|
|
820
|
+
L("videoPlayer", "video-render needs a ['video-id'] attribute to creat player.");
|
|
821
821
|
return;
|
|
822
822
|
}
|
|
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,
|
|
824
|
-
}, $t = new WeakSet(),
|
|
825
|
-
this.childDom = this.childNodes, this.template =
|
|
826
|
-
},
|
|
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, Ei).call(this);
|
|
824
|
+
}, $t = new WeakSet(), Ei = function() {
|
|
825
|
+
this.childDom = this.childNodes, this.template = Bs(this), this.innerHTML = "", this.append(this.template), d(this, _t, Ai).call(this);
|
|
826
|
+
}, _t = new WeakSet(), Ai = function() {
|
|
827
827
|
const { videoType: t, videoMode: e } = this;
|
|
828
828
|
let s = "";
|
|
829
829
|
function o(a) {
|
|
@@ -849,70 +849,72 @@ kt = new WeakSet(), wi = function() {
|
|
|
849
849
|
case "youtubeAPI":
|
|
850
850
|
break;
|
|
851
851
|
case "youtube":
|
|
852
|
-
document.body.wd_youtube == !1 ? o("video-player") : s = d(this,
|
|
852
|
+
document.body.wd_youtube == !1 ? o("video-player") : s = d(this, Ct, Li).call(this);
|
|
853
853
|
break;
|
|
854
854
|
case "youkuAPI":
|
|
855
855
|
break;
|
|
856
856
|
case "youku":
|
|
857
|
-
document.body.wd_youku == !1 ? o("video-player") : s = d(this,
|
|
857
|
+
document.body.wd_youku == !1 ? o("video-player") : s = d(this, Mt, Di).call(this);
|
|
858
858
|
break;
|
|
859
859
|
case "vimeo":
|
|
860
|
-
document.body.wd_vimeo == !1 ? o("video-player") : s = d(this,
|
|
860
|
+
document.body.wd_vimeo == !1 ? o("video-player") : s = d(this, Ht, Si).call(this);
|
|
861
861
|
break;
|
|
862
862
|
case "bilibili":
|
|
863
|
-
document.body.wd_bilibili == !1 ? o("video-player") : s = d(this,
|
|
863
|
+
document.body.wd_bilibili == !1 ? o("video-player") : s = d(this, It, ki).call(this);
|
|
864
864
|
break;
|
|
865
865
|
case "instagram":
|
|
866
|
-
document.body.wd_instagram == !1 ? o(".instagram-media") : s = d(this,
|
|
866
|
+
document.body.wd_instagram == !1 ? o(".instagram-media") : s = d(this, qt, xi).call(this);
|
|
867
867
|
break;
|
|
868
868
|
case "tiktok":
|
|
869
|
-
document.body.wd_tiktok == !1 ? o("video-player") : s = d(this,
|
|
869
|
+
document.body.wd_tiktok == !1 ? o("video-player") : s = d(this, Ot, $i).call(this);
|
|
870
870
|
break;
|
|
871
871
|
case "videojs":
|
|
872
872
|
break;
|
|
873
873
|
case "video":
|
|
874
|
-
s = d(this,
|
|
874
|
+
s = d(this, Nt, _i).call(this);
|
|
875
875
|
break;
|
|
876
876
|
}
|
|
877
877
|
this.querySelector(".player-wrapper").insertAdjacentHTML(S.prepend, s);
|
|
878
|
-
},
|
|
878
|
+
}, Ct = new WeakSet(), Li = function() {
|
|
879
879
|
const { videoId: t, autoplay: e, startTime: s } = this;
|
|
880
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>`;
|
|
881
|
-
},
|
|
881
|
+
}, Ht = new WeakSet(), Si = function() {
|
|
882
882
|
const { videoId: t, autoplay: e, hash: s } = this;
|
|
883
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>`;
|
|
884
|
-
},
|
|
884
|
+
}, Mt = new WeakSet(), Di = function() {
|
|
885
885
|
const { videoId: t, autoplay: e } = this;
|
|
886
886
|
return `<iframe src="https://player.youku.com/embed/${t}?rel=0&${e === "on" ? "autoplay=1" : ""}" frameborder=0 "allowfullscreen"></iframe>`;
|
|
887
|
-
},
|
|
887
|
+
}, It = new WeakSet(), ki = function() {
|
|
888
888
|
const { videoId: t, autoplay: e } = this;
|
|
889
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>`;
|
|
890
|
-
},
|
|
890
|
+
}, qt = new WeakSet(), xi = function() {
|
|
891
891
|
const { videoId: t, autoplay: e } = this;
|
|
892
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>`;
|
|
893
|
-
},
|
|
893
|
+
}, Ot = new WeakSet(), $i = function() {
|
|
894
894
|
const { videoId: t, autoplay: e } = this;
|
|
895
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>`;
|
|
896
|
-
},
|
|
896
|
+
}, Nt = new WeakSet(), _i = function() {
|
|
897
897
|
const { videoId: t, autoplay: e } = this;
|
|
898
898
|
return `<video src="${t}" ${e == "on" ? "autoplay" : ""} muted playsinline controls></video>`;
|
|
899
899
|
};
|
|
900
|
-
|
|
901
|
-
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
902
|
-
});
|
|
903
|
-
function _i(n) {
|
|
904
|
-
const i = [];
|
|
905
|
-
n && n.forEach((t) => {
|
|
906
|
-
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(`${t}`));
|
|
907
|
-
}), f("html").addClass("scrollLock"), ks(i);
|
|
908
|
-
}
|
|
900
|
+
let Z = 0;
|
|
909
901
|
function Ci(n) {
|
|
910
902
|
const i = [];
|
|
911
|
-
n
|
|
912
|
-
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(
|
|
913
|
-
}),
|
|
903
|
+
return (n || []).forEach((t) => {
|
|
904
|
+
t instanceof HTMLElement ? i.push(t) : typeof t == "string" && i.push(...document.querySelectorAll(t));
|
|
905
|
+
}), i;
|
|
914
906
|
}
|
|
915
|
-
|
|
907
|
+
function Hi(n) {
|
|
908
|
+
const i = Ci(n);
|
|
909
|
+
Z += 1, Z === 1 && (document.documentElement.classList.add("scrollLock"), $s(i));
|
|
910
|
+
}
|
|
911
|
+
function Mi(n) {
|
|
912
|
+
if (Z = Math.max(0, Z - 1), Z === 0) {
|
|
913
|
+
const i = Ci(n);
|
|
914
|
+
_s(i), document.documentElement.classList.remove("scrollLock");
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
async function kn(n = 0) {
|
|
916
918
|
if (f(".loading-wrapper").length)
|
|
917
919
|
return;
|
|
918
920
|
f("body").append(`
|
|
@@ -926,30 +928,30 @@ async function Dn(n = 0) {
|
|
|
926
928
|
</div>
|
|
927
929
|
</div>
|
|
928
930
|
`), f(".loading-wrapper").delay(n).fadeIn(300).promise().done(function() {
|
|
929
|
-
|
|
931
|
+
Hi();
|
|
930
932
|
});
|
|
931
933
|
}
|
|
932
|
-
function
|
|
934
|
+
function xn() {
|
|
933
935
|
f(".loading-wrapper").fadeOut(300).promise().done(function() {
|
|
934
|
-
f(".loading-wrapper").remove(),
|
|
936
|
+
f(".loading-wrapper").remove(), Mi();
|
|
935
937
|
});
|
|
936
938
|
}
|
|
937
939
|
function $n(n, i) {
|
|
938
|
-
new
|
|
940
|
+
new vn(n, i);
|
|
939
941
|
}
|
|
940
|
-
function
|
|
941
|
-
const n = document.querySelector("[data-aost]") && new
|
|
942
|
-
} }), e = new
|
|
942
|
+
function Gs() {
|
|
943
|
+
const n = document.querySelector("[data-aost]") && new yi("[data-aost]"), i = document.querySelector("[data-anchor-target]") && new oi("[data-anchor-target]"), t = new ti({ callback_loaded: () => {
|
|
944
|
+
} }), e = new dn();
|
|
943
945
|
n == null || n.update(), t.update(), e.reValidate(), i == null || i.update();
|
|
944
946
|
}
|
|
945
|
-
function
|
|
947
|
+
function _n(n, i = () => {
|
|
946
948
|
}) {
|
|
947
949
|
f(`[data-tab-content=${n}]`).fadeIn(function() {
|
|
948
950
|
typeof i == "function" && i();
|
|
949
|
-
}).siblings("[data-tab-content]").hide(),
|
|
951
|
+
}).siblings("[data-tab-content]").hide(), Gs();
|
|
950
952
|
}
|
|
951
|
-
function
|
|
952
|
-
|
|
953
|
+
function Cn() {
|
|
954
|
+
je(
|
|
953
955
|
{
|
|
954
956
|
target: document.body,
|
|
955
957
|
cancel: {
|
|
@@ -973,28 +975,31 @@ function _n() {
|
|
|
973
975
|
}
|
|
974
976
|
);
|
|
975
977
|
}
|
|
976
|
-
function
|
|
978
|
+
function Hn() {
|
|
977
979
|
window.onpageshow = function(n) {
|
|
978
980
|
n.persisted && window.location.reload();
|
|
979
981
|
};
|
|
980
982
|
}
|
|
981
|
-
function
|
|
983
|
+
function Mn() {
|
|
982
984
|
const n = navigator.userAgent;
|
|
983
985
|
return {
|
|
984
986
|
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)
|
|
985
987
|
};
|
|
986
988
|
}
|
|
987
|
-
function
|
|
989
|
+
function In(n, i) {
|
|
988
990
|
f(n).on("click", function() {
|
|
989
991
|
f(this).toggleClass(i);
|
|
990
992
|
});
|
|
991
993
|
}
|
|
992
|
-
function
|
|
994
|
+
function qn(n, i) {
|
|
993
995
|
f(n).on("click", function() {
|
|
994
996
|
f(n).not(this).removeClass(i), f(this).addClass(i);
|
|
995
997
|
});
|
|
996
998
|
}
|
|
997
|
-
|
|
999
|
+
const On = (n) => new Promise((i) => {
|
|
1000
|
+
let t = setTimeout(() => (clearTimeout(t), i()), n);
|
|
1001
|
+
});
|
|
1002
|
+
function Rs(n, i = 250) {
|
|
998
1003
|
let t = null;
|
|
999
1004
|
return function(...e) {
|
|
1000
1005
|
let s = this;
|
|
@@ -1003,7 +1008,7 @@ function Ws(n, i = 250) {
|
|
|
1003
1008
|
}, i);
|
|
1004
1009
|
};
|
|
1005
1010
|
}
|
|
1006
|
-
function
|
|
1011
|
+
function Nn(n, i = 250) {
|
|
1007
1012
|
let t, e;
|
|
1008
1013
|
return function() {
|
|
1009
1014
|
const s = this, o = arguments, a = +/* @__PURE__ */ new Date();
|
|
@@ -1012,7 +1017,7 @@ function qn(n, i = 250) {
|
|
|
1012
1017
|
}, i)) : (t = a, n.apply(s, o));
|
|
1013
1018
|
};
|
|
1014
1019
|
}
|
|
1015
|
-
function
|
|
1020
|
+
function Pn() {
|
|
1016
1021
|
window._g.interval = [], f(".countdown").each((i, t) => {
|
|
1017
1022
|
const e = Number(f(t).attr("data-seconds")) + 1;
|
|
1018
1023
|
let s = Math.floor(e / 60) + ":" + e % 60;
|
|
@@ -1022,21 +1027,21 @@ function On() {
|
|
|
1022
1027
|
}, 1e3);
|
|
1023
1028
|
});
|
|
1024
1029
|
}
|
|
1025
|
-
function
|
|
1030
|
+
function jn(n = 500) {
|
|
1026
1031
|
return new Promise((i, t) => {
|
|
1027
1032
|
let e = setTimeout(() => {
|
|
1028
1033
|
clearTimeout(e), i();
|
|
1029
1034
|
}, n);
|
|
1030
1035
|
});
|
|
1031
1036
|
}
|
|
1032
|
-
function
|
|
1037
|
+
function zn() {
|
|
1033
1038
|
const n = function() {
|
|
1034
1039
|
let i = window.innerHeight * 0.01;
|
|
1035
1040
|
document.documentElement.style.setProperty("--vh", i + "px");
|
|
1036
1041
|
};
|
|
1037
|
-
n(), window.addEventListener("resize",
|
|
1042
|
+
n(), window.addEventListener("resize", Rs(n));
|
|
1038
1043
|
}
|
|
1039
|
-
function
|
|
1044
|
+
function Bn(n, i, t, e, s) {
|
|
1040
1045
|
const o = this, r = f(n).html().split("<br>");
|
|
1041
1046
|
let l = "", c = 0;
|
|
1042
1047
|
r.forEach((u, p) => {
|
|
@@ -1045,11 +1050,11 @@ function jn(n, i, t, e, s) {
|
|
|
1045
1050
|
});
|
|
1046
1051
|
}), f(n).html(l);
|
|
1047
1052
|
}
|
|
1048
|
-
function
|
|
1053
|
+
function Wn(n, i) {
|
|
1049
1054
|
const t = Math.pow(10, i);
|
|
1050
1055
|
return Math.round(n * t) / t;
|
|
1051
1056
|
}
|
|
1052
|
-
function
|
|
1057
|
+
function Gn(n) {
|
|
1053
1058
|
let i = n.activeIndex, t = n.slides.length;
|
|
1054
1059
|
if (n.params.loop)
|
|
1055
1060
|
switch (n.activeIndex) {
|
|
@@ -1064,18 +1069,18 @@ function Bn(n) {
|
|
|
1064
1069
|
}
|
|
1065
1070
|
return i;
|
|
1066
1071
|
}
|
|
1067
|
-
function
|
|
1072
|
+
function Rn(n, i) {
|
|
1068
1073
|
const t = n.$el, e = n.params.grid.rows, s = i || n.params.slidesPerView * e;
|
|
1069
1074
|
(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());
|
|
1070
1075
|
}
|
|
1071
|
-
function
|
|
1076
|
+
function Xn(n) {
|
|
1072
1077
|
n.el.querySelectorAll("img.detect-shade").forEach((i) => {
|
|
1073
1078
|
i.addEventListener("load", function() {
|
|
1074
1079
|
detectShade(i);
|
|
1075
1080
|
});
|
|
1076
1081
|
});
|
|
1077
1082
|
}
|
|
1078
|
-
function
|
|
1083
|
+
function Fn(n) {
|
|
1079
1084
|
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
1085
|
n.autoplay.stop(), f(e).off("ended"), e ? (s.each((o, a) => {
|
|
1081
1086
|
a.currentTime = 0;
|
|
@@ -1083,7 +1088,7 @@ function Rn(n) {
|
|
|
1083
1088
|
n.slideNext();
|
|
1084
1089
|
}), e.play()) : n.params.autoplay.enabled && n.autoplay.start();
|
|
1085
1090
|
}
|
|
1086
|
-
function
|
|
1091
|
+
function Yn() {
|
|
1087
1092
|
f(".number-grow").each(function(n, i) {
|
|
1088
1093
|
const t = f(i), o = t.attr("data-num").replace(/(\d)(?=(?:\d{3})+$)/g, "$1,").split(""), a = () => {
|
|
1089
1094
|
let r = "";
|
|
@@ -1097,7 +1102,7 @@ function Xn() {
|
|
|
1097
1102
|
});
|
|
1098
1103
|
});
|
|
1099
1104
|
}
|
|
1100
|
-
function
|
|
1105
|
+
function Un() {
|
|
1101
1106
|
f(".letter-grow").each(function(n, i) {
|
|
1102
1107
|
const t = f(i), s = t.attr("data-letter").split(""), o = () => {
|
|
1103
1108
|
let a = "";
|
|
@@ -1111,46 +1116,46 @@ function Yn() {
|
|
|
1111
1116
|
});
|
|
1112
1117
|
});
|
|
1113
1118
|
}
|
|
1114
|
-
function
|
|
1119
|
+
function Jn(n) {
|
|
1115
1120
|
const i = getComputedStyle(n).transform;
|
|
1116
1121
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1117
1122
|
return t ? parseFloat(t[1].split(", ")[12]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[4]) : 0);
|
|
1118
1123
|
}
|
|
1119
|
-
function
|
|
1124
|
+
function Zn(n) {
|
|
1120
1125
|
const i = getComputedStyle(n).transform;
|
|
1121
1126
|
let t = i.match(/^matrix3d\((.+)\)$/);
|
|
1122
1127
|
return t ? parseFloat(t[1].split(", ")[13]) : (t = i.match(/^matrix\((.+)\)$/), t ? parseFloat(t[1].split(", ")[5]) : 0);
|
|
1123
1128
|
}
|
|
1124
|
-
function
|
|
1129
|
+
function Qn(n) {
|
|
1125
1130
|
const i = document.createElement("div");
|
|
1126
1131
|
return i.innerHTML = n, i.childNodes[0];
|
|
1127
1132
|
}
|
|
1128
|
-
const
|
|
1129
|
-
var
|
|
1133
|
+
const Ue = (n) => n.videoId !== "" || typeof n.videoId < "u", Xs = (n) => n.$selector.getAttribute("video4-active") === "on", pt = (n) => `<video-player video-id="${n.videoId}" video-type="${n.videoType}" video-startTime="${n.videoStartTime}" video-autoplay="${n.videoAutoplay}"></video-player>`;
|
|
1134
|
+
var it, Ce, Pt, Ii, jt, qi, st, He, zt, Oi;
|
|
1130
1135
|
const X = class X {
|
|
1131
1136
|
//*-* 給Article4用的 **//
|
|
1132
1137
|
constructor(i, t = {}) {
|
|
1133
|
-
h(this, et);
|
|
1134
|
-
h(this, Nt);
|
|
1135
|
-
h(this, Pt);
|
|
1136
1138
|
h(this, it);
|
|
1139
|
+
h(this, Pt);
|
|
1137
1140
|
h(this, jt);
|
|
1138
|
-
|
|
1139
|
-
|
|
1141
|
+
h(this, st);
|
|
1142
|
+
h(this, zt);
|
|
1143
|
+
if (!dt(i) && !Se(i) && !ut(i)) {
|
|
1144
|
+
Fe("video4", `找不到該物件 -> ${i}`);
|
|
1140
1145
|
return;
|
|
1141
1146
|
}
|
|
1142
1147
|
this.__storage__ = {
|
|
1143
1148
|
el: i,
|
|
1144
1149
|
options: t
|
|
1145
|
-
}, this.active = "data-video-active", d(this,
|
|
1150
|
+
}, this.active = "data-video-active", d(this, it, Ce).call(this);
|
|
1146
1151
|
}
|
|
1147
1152
|
update() {
|
|
1148
|
-
d(this,
|
|
1153
|
+
d(this, it, Ce).call(this);
|
|
1149
1154
|
}
|
|
1150
1155
|
};
|
|
1151
|
-
|
|
1152
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } =
|
|
1153
|
-
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ?
|
|
1156
|
+
it = new WeakSet(), Ce = function() {
|
|
1157
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s, LAYOUT: o } = ze;
|
|
1158
|
+
if (t.isGlobal && (X.globalOptions = t), this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign(
|
|
1154
1159
|
{},
|
|
1155
1160
|
{ LAYOUT: o },
|
|
1156
1161
|
// 原始 configs 的 LAYOUT
|
|
@@ -1163,20 +1168,20 @@ et = new WeakSet(), _e = function() {
|
|
|
1163
1168
|
), this.__events__ = Object.assign({}, s), this.options.on)
|
|
1164
1169
|
for (const [a, r] of Object.entries(this.options.on))
|
|
1165
1170
|
this.__events__[a] = [r];
|
|
1166
|
-
d(this,
|
|
1167
|
-
},
|
|
1171
|
+
d(this, Pt, Ii).call(this);
|
|
1172
|
+
}, Pt = new WeakSet(), Ii = function() {
|
|
1168
1173
|
const { elements: i, options: t } = this;
|
|
1169
1174
|
i.forEach((e) => {
|
|
1170
|
-
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this,
|
|
1175
|
+
e.video = {}, e.video.instance = this, e.video.defaultOptions = t, e.video.params = d(this, zt, Oi).call(this, e), e.video.methods = {}, e.video.methods.update = this.update, e.setAttribute(this.active, ""), Ue(e.video.params) && !Xs(e.video.params) && (e.setAttribute("video4-active", "on"), d(this, jt, qi).call(this, e)), Ue(e.video.params) || Fe("video4", "無法取得影片 ID");
|
|
1171
1176
|
}), this.emit("init");
|
|
1172
|
-
},
|
|
1177
|
+
}, jt = new WeakSet(), qi = function(i) {
|
|
1173
1178
|
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;
|
|
1174
1179
|
if (l === "onBox" || l === "inBox") {
|
|
1175
1180
|
let g = null;
|
|
1176
1181
|
if (u === "on") {
|
|
1177
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'),
|
|
1182
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), L("video4", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構,若無結構則自動加入圖片結構"));
|
|
1178
1183
|
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
|
-
if (w ? m.insertAdjacentHTML(S.after, w) :
|
|
1184
|
+
if (w ? m.insertAdjacentHTML(S.after, w) : L("video4", `找不到對應的 LAYOUT 設定 (No: ${o}),且無預設樣式。`), !v && r == "youtube")
|
|
1180
1185
|
p == "on" ? m.setAttribute("src", `https://img.youtube.com/vi/${a}/maxresdefault.jpg `) : m.setAttribute("src", `https://img.youtube.com/vi/${a}/0.jpg`);
|
|
1181
1186
|
else if (!v && r == "vimeo")
|
|
1182
1187
|
m.setAttribute("src", `https://vumbnail.com/${a}_large.jpg`);
|
|
@@ -1194,13 +1199,13 @@ et = new WeakSet(), _e = function() {
|
|
|
1194
1199
|
m.setAttribute("src", `${T}`);
|
|
1195
1200
|
}).catch(function(b) {
|
|
1196
1201
|
console.log("error");
|
|
1197
|
-
}) :
|
|
1202
|
+
}) : L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片");
|
|
1198
1203
|
}
|
|
1199
|
-
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) ||
|
|
1204
|
+
c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || L("video4", `找不到 videoButton 設定的 element -> '${c}' , 點擊物件轉移至 '${this.__storage__.el}'`)), g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st, He), g.addEventListener("click", g.video.eventHandler);
|
|
1200
1205
|
} else if (l === "onPage") {
|
|
1201
1206
|
let g = null;
|
|
1202
1207
|
if (u == "on") {
|
|
1203
|
-
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'),
|
|
1208
|
+
i.classList.add("video4-cover"), s.querySelector("img") || (s.insertAdjacentHTML(S.prepend, '<picture><source srcset="" type="image/webp"><source srcset="" type="image/jpeg"><img src="" alt></picture>'), L("video", "若啟用 [videoCover] 且選擇 onBox 模式必須於 video-target 內放置 img 結構"));
|
|
1204
1209
|
const m = s.querySelector("img");
|
|
1205
1210
|
m.insertAdjacentHTML(S.after, t[o]);
|
|
1206
1211
|
const v = (m == null ? void 0 : m.getAttribute("src")) || (m == null ? void 0 : m.getAttribute("data-src"));
|
|
@@ -1209,14 +1214,14 @@ et = new WeakSet(), _e = function() {
|
|
|
1209
1214
|
m.setAttribute("src", `${b}`);
|
|
1210
1215
|
}).catch(function(w) {
|
|
1211
1216
|
console.log("error");
|
|
1212
|
-
}) : v ||
|
|
1217
|
+
}) : v || L("video4", "僅 youtube & vimeo 提供,無圖片時放置預設封面畫面,其他影片平台請自行上傳封面照片"), c == "off" ? g = s : (g = s.querySelector(c) ?? s, s.querySelector(c) || L("video4", `找不到 videoButton 設定的 element -> '${c}', 點擊物件轉移至 '${this.__storage__.el}'`));
|
|
1213
1218
|
} else {
|
|
1214
|
-
s.innerHTML =
|
|
1219
|
+
s.innerHTML = pt(e);
|
|
1215
1220
|
return;
|
|
1216
1221
|
}
|
|
1217
|
-
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this,
|
|
1222
|
+
g.video || (g.video = {}, g.video.params = e), g.video.eventHandler = d(this, st, He), g.addEventListener("click", g.video.eventHandler);
|
|
1218
1223
|
}
|
|
1219
|
-
},
|
|
1224
|
+
}, st = new WeakSet(), He = function(i) {
|
|
1220
1225
|
const { video: t, emit: e } = this, {
|
|
1221
1226
|
$selector: s,
|
|
1222
1227
|
videoMode: o,
|
|
@@ -1230,7 +1235,7 @@ et = new WeakSet(), _e = function() {
|
|
|
1230
1235
|
videoButton: m,
|
|
1231
1236
|
videoLayoutNo: v,
|
|
1232
1237
|
videoStartTime: w
|
|
1233
|
-
} = t.params, b = new
|
|
1238
|
+
} = t.params, b = new ti({ callback_loaded: (C) => {
|
|
1234
1239
|
} }), T = new URLSearchParams({
|
|
1235
1240
|
video_mode: o,
|
|
1236
1241
|
video_type: u,
|
|
@@ -1243,21 +1248,21 @@ et = new WeakSet(), _e = function() {
|
|
|
1243
1248
|
on: {
|
|
1244
1249
|
complete(y) {
|
|
1245
1250
|
var D;
|
|
1246
|
-
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend",
|
|
1251
|
+
o == "onBox" && (u == "instagram" ? (y.setAttribute("video-typeStyle", `${u}`), (D = window.instgrm) != null && D.Embeds ? window.instgrm.Embeds.process() : console.log("window.instgrm is undefined")) : (y.querySelector(".modal-content").insertAdjacentHTML("beforeend", pt(t.params)), y.setAttribute("video-typeStyle", `${u}`))), o == "inBox" && y.setAttribute("video-typeStyle", `${u}`);
|
|
1247
1252
|
},
|
|
1248
1253
|
open(y) {
|
|
1249
1254
|
var U;
|
|
1250
1255
|
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1251
|
-
if (b.update(),
|
|
1252
|
-
const
|
|
1253
|
-
new ResizeObserver((
|
|
1254
|
-
|
|
1255
|
-
}).observe(
|
|
1256
|
+
if (b.update(), Hi([...D]), o == "onBox" && u == "instagram") {
|
|
1257
|
+
const A = document.querySelector("[video-template] .modal-content");
|
|
1258
|
+
new ResizeObserver((Ge) => {
|
|
1259
|
+
Ge[0].contentRect.height > 50 && A.classList.add("active");
|
|
1260
|
+
}).observe(A);
|
|
1256
1261
|
}
|
|
1257
1262
|
if (o == "inBox") {
|
|
1258
|
-
const
|
|
1263
|
+
const A = g || ((U = s.querySelector("img")) == null ? void 0 : U.src);
|
|
1259
1264
|
let z;
|
|
1260
|
-
|
|
1265
|
+
A == null ? z = `
|
|
1261
1266
|
<div
|
|
1262
1267
|
class="photo-box"
|
|
1263
1268
|
video-target
|
|
@@ -1281,18 +1286,18 @@ et = new WeakSet(), _e = function() {
|
|
|
1281
1286
|
>
|
|
1282
1287
|
<picture>
|
|
1283
1288
|
<source
|
|
1284
|
-
srcset="${
|
|
1289
|
+
srcset="${A}"
|
|
1285
1290
|
type="image/webp"
|
|
1286
1291
|
/>
|
|
1287
1292
|
<source
|
|
1288
|
-
srcset="${
|
|
1293
|
+
srcset="${A}"
|
|
1289
1294
|
type="image/jpeg"
|
|
1290
1295
|
/>
|
|
1291
|
-
<img src="${
|
|
1296
|
+
<img src="${A}" alt="" />
|
|
1292
1297
|
</picture>
|
|
1293
1298
|
</div>`, y.querySelector(".video-content").insertAdjacentHTML(S.prepend, z);
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1299
|
+
const Re = y.querySelectorAll("[video-target]");
|
|
1300
|
+
Re.length > 0 && new X(Re, {
|
|
1296
1301
|
LAYOUT: t.params.LAYOUT,
|
|
1297
1302
|
videoLayoutNo: t.params.videoLayoutNo
|
|
1298
1303
|
});
|
|
@@ -1300,24 +1305,24 @@ et = new WeakSet(), _e = function() {
|
|
|
1300
1305
|
},
|
|
1301
1306
|
close(y) {
|
|
1302
1307
|
const D = y.querySelectorAll("[data-overlayscrollbars-viewport]");
|
|
1303
|
-
|
|
1308
|
+
Mi([...D]);
|
|
1304
1309
|
},
|
|
1305
1310
|
destroy(y) {
|
|
1306
1311
|
}
|
|
1307
1312
|
}
|
|
1308
1313
|
};
|
|
1309
|
-
|
|
1314
|
+
V.open(C);
|
|
1310
1315
|
} else if (o == "onPage")
|
|
1311
1316
|
if (t.params.videoAutoplay = "on", r == "off") {
|
|
1312
1317
|
if (s.querySelector("video-player"))
|
|
1313
1318
|
return;
|
|
1314
|
-
s.innerHTML =
|
|
1319
|
+
s.innerHTML = pt(t.params);
|
|
1315
1320
|
return;
|
|
1316
1321
|
} else {
|
|
1317
|
-
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend",
|
|
1322
|
+
(s.querySelector(r) ?? s).insertAdjacentHTML("beforeend", pt(t.params));
|
|
1318
1323
|
return;
|
|
1319
1324
|
}
|
|
1320
|
-
},
|
|
1325
|
+
}, zt = new WeakSet(), Oi = function(i) {
|
|
1321
1326
|
const t = this.options;
|
|
1322
1327
|
return {
|
|
1323
1328
|
$selector: i,
|
|
@@ -1337,11 +1342,11 @@ et = new WeakSet(), _e = function() {
|
|
|
1337
1342
|
videoInboxImg: i.getAttribute("video-inbox-img") || t.videoInboxImgHtml,
|
|
1338
1343
|
LAYOUT: t.LAYOUT || []
|
|
1339
1344
|
};
|
|
1340
|
-
},
|
|
1341
|
-
let
|
|
1342
|
-
Object.assign(
|
|
1343
|
-
customElements.define("video-player",
|
|
1344
|
-
const
|
|
1345
|
+
}, Xe(X, "globalOptions", {});
|
|
1346
|
+
let _e = X;
|
|
1347
|
+
Object.assign(_e.prototype, j);
|
|
1348
|
+
customElements.define("video-player", Ws);
|
|
1349
|
+
const Fs = {
|
|
1345
1350
|
"zh-tw": {
|
|
1346
1351
|
臺北市: [
|
|
1347
1352
|
["中正區", "100"],
|
|
@@ -2171,9 +2176,9 @@ const Rs = {
|
|
|
2171
2176
|
]
|
|
2172
2177
|
}
|
|
2173
2178
|
};
|
|
2174
|
-
let
|
|
2175
|
-
const
|
|
2176
|
-
const { TEMPLATE: i } =
|
|
2179
|
+
let Q;
|
|
2180
|
+
const Ys = (n) => {
|
|
2181
|
+
const { TEMPLATE: i } = Be, { 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");
|
|
2177
2182
|
e.innerHTML = i(
|
|
2178
2183
|
s,
|
|
2179
2184
|
o,
|
|
@@ -2186,12 +2191,12 @@ const Xs = (n) => {
|
|
|
2186
2191
|
(!p.hasAttribute("data-option") || p.getAttribute("data-option").trim() === "") && p.setAttribute("data-option", p.textContent.trim());
|
|
2187
2192
|
}) : (!c.hasAttribute("data-option") || c.getAttribute("data-option").trim() === "") && c.setAttribute("data-option", c.textContent.trim())), l.append(c);
|
|
2188
2193
|
}), e.children[0];
|
|
2189
|
-
},
|
|
2194
|
+
}, Us = (n) => {
|
|
2190
2195
|
var t;
|
|
2191
2196
|
const i = (t = n.getAttribute("control-elements")) == null ? void 0 : t.split(",");
|
|
2192
2197
|
i && i.forEach((e) => {
|
|
2193
2198
|
const s = document.querySelector(e);
|
|
2194
|
-
s ||
|
|
2199
|
+
s || L("dropdown", `Can't not find control element(${e})`), s && s.classList.contains("disabled") && (s.classList.remove("disabled"), s.tagName === "DROPDOWN-EL" && s.s.activeLi && I(s, [...s.s.allLi].indexOf(s.s.activeLi)));
|
|
2195
2200
|
});
|
|
2196
2201
|
}, I = (n, i) => {
|
|
2197
2202
|
const t = n.getAttribute("d4-placeholder"), e = n.querySelectorAll(".dropdown-list li");
|
|
@@ -2245,42 +2250,42 @@ const Xs = (n) => {
|
|
|
2245
2250
|
break;
|
|
2246
2251
|
}
|
|
2247
2252
|
}
|
|
2248
|
-
},
|
|
2253
|
+
}, Js = (n) => {
|
|
2249
2254
|
const i = n.s.cityLang;
|
|
2250
|
-
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (
|
|
2255
|
+
f("#newCityData").length > 0 ? f("#newCityData").val() !== "" && (Q = JSON.parse(f("#newCityData").val())[0], console.log([0])) : Q = Fs, n.classList.contains("city") && (n.s.dropdownEl.querySelector(".dropdown-list").innerHTML = "", Object.keys(Q[i]).forEach((t) => {
|
|
2251
2256
|
const e = document.createElement("li");
|
|
2252
2257
|
e.textContent = t, e.setAttribute("data-option", t), n.s.dropdownEl.querySelector(".dropdown-list").append(e);
|
|
2253
2258
|
}), n.s.allLi = n.querySelectorAll(".dropdown-list li"));
|
|
2254
|
-
},
|
|
2259
|
+
}, Zs = (n, i) => {
|
|
2255
2260
|
const t = n.s.cityLang;
|
|
2256
|
-
|
|
2261
|
+
Q[t][i].forEach((e, s) => {
|
|
2257
2262
|
const o = document.createElement("li");
|
|
2258
2263
|
o.textContent = e[0], o.setAttribute("data-option", e[0]), n.querySelector(".dropdown-list").append(o);
|
|
2259
2264
|
});
|
|
2260
|
-
},
|
|
2261
|
-
|
|
2265
|
+
}, Ni = () => {
|
|
2266
|
+
$('dropdown-el[d4-status="open"]').forEach((i) => {
|
|
2262
2267
|
i.close();
|
|
2263
2268
|
});
|
|
2264
|
-
},
|
|
2265
|
-
const { SETTINGS: n } =
|
|
2269
|
+
}, Qs = () => {
|
|
2270
|
+
const { SETTINGS: n } = Be;
|
|
2266
2271
|
((t, e) => {
|
|
2267
2272
|
Object.keys(e).forEach((s) => {
|
|
2268
2273
|
t.style.setProperty(`--${s}`, e[s]);
|
|
2269
2274
|
});
|
|
2270
2275
|
})(document.documentElement, n.scrollbar);
|
|
2271
2276
|
};
|
|
2272
|
-
|
|
2277
|
+
Qs();
|
|
2273
2278
|
document.addEventListener("click", function() {
|
|
2274
|
-
|
|
2279
|
+
Ni();
|
|
2275
2280
|
});
|
|
2276
|
-
var
|
|
2277
|
-
class
|
|
2281
|
+
var Bt, ji, Wt, zi, Gt, Bi, Rt, Wi;
|
|
2282
|
+
class Pi extends HTMLElement {
|
|
2278
2283
|
constructor() {
|
|
2279
2284
|
super();
|
|
2280
|
-
h(this, zt);
|
|
2281
2285
|
h(this, Bt);
|
|
2282
2286
|
h(this, Wt);
|
|
2283
2287
|
h(this, Gt);
|
|
2288
|
+
h(this, Rt);
|
|
2284
2289
|
this.initialize = !1;
|
|
2285
2290
|
}
|
|
2286
2291
|
static get observedAttributes() {
|
|
@@ -2326,11 +2331,11 @@ class Oi extends HTMLElement {
|
|
|
2326
2331
|
}
|
|
2327
2332
|
connectedCallback() {
|
|
2328
2333
|
const t = this;
|
|
2329
|
-
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this,
|
|
2334
|
+
t.initialize || t.classList.contains("d4-initialize") || (t.initialize = !0, d(this, Bt, ji).call(this));
|
|
2330
2335
|
}
|
|
2331
2336
|
open() {
|
|
2332
2337
|
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;
|
|
2333
|
-
return
|
|
2338
|
+
return Ni(), t.setAttribute("d4-status", "open"), t.setAttribute("d4-default-height", o()), t.style.cssText = `--maxHeight: ${o()}px;`, t.s.dropdownEl.style.cssText = `
|
|
2334
2339
|
height: ${o()}px;
|
|
2335
2340
|
z-index: 2;
|
|
2336
2341
|
`, this;
|
|
@@ -2352,14 +2357,14 @@ class Oi extends HTMLElement {
|
|
|
2352
2357
|
this.__events__.selectOption();
|
|
2353
2358
|
}
|
|
2354
2359
|
}
|
|
2355
|
-
|
|
2356
|
-
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this,
|
|
2357
|
-
},
|
|
2358
|
-
this.s.childDom = this.childNodes, this.s.template =
|
|
2359
|
-
},
|
|
2360
|
+
Bt = new WeakSet(), ji = function() {
|
|
2361
|
+
this.s = {}, this.__events__ = {}, this.hasAttribute("d4-status") || this.setAttribute("d4-status", "close"), this.hasAttribute("d4-value") || this.setAttribute("d4-value", ""), d(this, Wt, zi).call(this);
|
|
2362
|
+
}, Wt = new WeakSet(), zi = function() {
|
|
2363
|
+
this.s.childDom = this.childNodes, this.s.template = Ys(this), this.innerHTML = "", this.append(this.s.template), d(this, Gt, Bi).call(this);
|
|
2364
|
+
}, Gt = new WeakSet(), Bi = function() {
|
|
2360
2365
|
var s;
|
|
2361
2366
|
const t = this;
|
|
2362
|
-
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",
|
|
2367
|
+
t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.s.selectDisplayEl = t.querySelector(".select-display"), t.s.dropdownEl = t.querySelector(".dropdown"), t.s.selectType = t.hasAttribute("multiple") ? "multiple" : "single", t.s.cityLang = t.hasAttribute("city-lang") ? t.getAttribute("city-lang") : "zh-tw", Js(t), t.s.subDropdownTotalH = 0;
|
|
2363
2368
|
const e = t.getAttribute("d4-value");
|
|
2364
2369
|
switch (t.s.selectType) {
|
|
2365
2370
|
case "single":
|
|
@@ -2368,7 +2373,7 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2368
2373
|
const r = document.querySelector(`dropdown-el[dist-select="${t.id}"]`), l = r ? r.getAttribute("d4-value") !== "" : !1;
|
|
2369
2374
|
if (r && l) {
|
|
2370
2375
|
const c = r.getAttribute("d4-value");
|
|
2371
|
-
if (
|
|
2376
|
+
if (Zs(t, c), t.s.allLi = t.querySelectorAll(".dropdown-list li"), t.classList.remove("disabled"), t.getAttribute("d4-value") !== "") {
|
|
2372
2377
|
const u = e.split(",")[1];
|
|
2373
2378
|
o = t.querySelector(`.dropdown-list li[data-option="${u}"]`), t.setAttribute("d4-value", u);
|
|
2374
2379
|
}
|
|
@@ -2401,8 +2406,8 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2401
2406
|
};
|
|
2402
2407
|
break;
|
|
2403
2408
|
}
|
|
2404
|
-
I(t, t.s.value.index), d(s = t,
|
|
2405
|
-
},
|
|
2409
|
+
I(t, t.s.value.index), d(s = t, Rt, Wi).call(s), t.classList.add("d4-initialize");
|
|
2410
|
+
}, Rt = new WeakSet(), Wi = function() {
|
|
2406
2411
|
const t = this;
|
|
2407
2412
|
t.__events__.dropdownToggle = () => {
|
|
2408
2413
|
t.addEventListener("click", function(e) {
|
|
@@ -2448,7 +2453,7 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2448
2453
|
t.s.dropdownEl.addEventListener("transitionend", e);
|
|
2449
2454
|
}, t.__events__.bindScrollbar = (e = this) => {
|
|
2450
2455
|
const s = e.querySelector(".dropdown-scroller");
|
|
2451
|
-
e.__scroller__ =
|
|
2456
|
+
e.__scroller__ = je(s, {
|
|
2452
2457
|
overflowBehavior: {
|
|
2453
2458
|
x: "hidden"
|
|
2454
2459
|
}
|
|
@@ -2473,11 +2478,11 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2473
2478
|
};
|
|
2474
2479
|
v.addEventListener("transitionend", D);
|
|
2475
2480
|
} else
|
|
2476
|
-
switch (
|
|
2481
|
+
switch (Us(e), e.s.selectType) {
|
|
2477
2482
|
case "single":
|
|
2478
2483
|
if (e.setAttribute("d4-value", u.getAttribute("data-option")), r) {
|
|
2479
2484
|
const v = e.s.cityLang, w = l.textContent.trim(), b = document.getElementById(e.getAttribute("dist-select"));
|
|
2480
|
-
b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1),
|
|
2485
|
+
b && (b.querySelector(".dropdown-list").textContent = "", I(b, -1), Q[v][w].forEach((T, C) => {
|
|
2481
2486
|
const y = document.createElement("li");
|
|
2482
2487
|
y.textContent = T[0], y.setAttribute("data-option", T[0]), b.querySelector(".dropdown-list").append(y);
|
|
2483
2488
|
}), e.__events__.selectOption(b));
|
|
@@ -2518,9 +2523,9 @@ zt = new WeakSet(), Ni = function() {
|
|
|
2518
2523
|
});
|
|
2519
2524
|
}, t.__events__.dropdownToggle(), t.__events__.bindScrollbar(), t.__events__.selectOption(), t.__events__.filterHandler(), t.__events__.removeTag(), t.__events__.transitionend();
|
|
2520
2525
|
};
|
|
2521
|
-
Object.assign(
|
|
2522
|
-
customElements.define("dropdown-el",
|
|
2523
|
-
function
|
|
2526
|
+
Object.assign(Pi.prototype, j);
|
|
2527
|
+
customElements.define("dropdown-el", Pi);
|
|
2528
|
+
function gt(n) {
|
|
2524
2529
|
const i = {};
|
|
2525
2530
|
return [...n.attributes].forEach((t) => {
|
|
2526
2531
|
if (t.name.includes("duration-")) {
|
|
@@ -2529,10 +2534,10 @@ function mt(n) {
|
|
|
2529
2534
|
}
|
|
2530
2535
|
}), Object.keys(i).length === 0 ? null : i;
|
|
2531
2536
|
}
|
|
2532
|
-
function
|
|
2533
|
-
if (
|
|
2537
|
+
function Je(n) {
|
|
2538
|
+
if (gt(n)) {
|
|
2534
2539
|
let i;
|
|
2535
|
-
const t = Object.keys(
|
|
2540
|
+
const t = Object.keys(gt(n)).map((e) => ({
|
|
2536
2541
|
value: e,
|
|
2537
2542
|
point: e
|
|
2538
2543
|
}));
|
|
@@ -2541,11 +2546,11 @@ function Ue(n) {
|
|
|
2541
2546
|
const { point: s, value: o } = t[e];
|
|
2542
2547
|
window.matchMedia(`(max-width: ${o}px)`).matches && (i = s);
|
|
2543
2548
|
}
|
|
2544
|
-
return i ? Number(
|
|
2549
|
+
return i ? Number(gt(n)[i]) : n.s.options.duration;
|
|
2545
2550
|
} else
|
|
2546
2551
|
return n.s.options.duration;
|
|
2547
2552
|
}
|
|
2548
|
-
function
|
|
2553
|
+
function Vs(n) {
|
|
2549
2554
|
const { behavior: i, continual: t, gap: e } = n.s.options, s = n.childNodes, o = document.createElement("div"), a = document.createElement("div");
|
|
2550
2555
|
o.className = "animate-container", a.className = "animate-item", [...s].forEach((l) => {
|
|
2551
2556
|
a.append(l);
|
|
@@ -2612,20 +2617,20 @@ function H(n) {
|
|
|
2612
2617
|
}
|
|
2613
2618
|
return s;
|
|
2614
2619
|
}
|
|
2615
|
-
function
|
|
2620
|
+
function Ks(n) {
|
|
2616
2621
|
let i;
|
|
2617
2622
|
return function(t) {
|
|
2618
2623
|
i && clearTimeout(i), i = setTimeout(n, 200, t);
|
|
2619
2624
|
};
|
|
2620
2625
|
}
|
|
2621
|
-
var
|
|
2622
|
-
class
|
|
2626
|
+
var Xt, Gi, Ft, Ri, Yt, Xi, Ut, Fi;
|
|
2627
|
+
class tn extends HTMLElement {
|
|
2623
2628
|
constructor() {
|
|
2624
2629
|
super();
|
|
2625
|
-
h(this, Rt);
|
|
2626
2630
|
h(this, Xt);
|
|
2627
|
-
h(this, Yt);
|
|
2628
2631
|
h(this, Ft);
|
|
2632
|
+
h(this, Yt);
|
|
2633
|
+
h(this, Ut);
|
|
2629
2634
|
this.initialize = !1;
|
|
2630
2635
|
}
|
|
2631
2636
|
static get observedAttributes() {
|
|
@@ -2634,7 +2639,7 @@ class Vs extends HTMLElement {
|
|
|
2634
2639
|
attributeChangedCallback(t, e, s) {
|
|
2635
2640
|
}
|
|
2636
2641
|
connectedCallback() {
|
|
2637
|
-
this.initialize || (this.initialize = !0, d(this,
|
|
2642
|
+
this.initialize || (this.initialize = !0, d(this, Xt, Gi).call(this));
|
|
2638
2643
|
}
|
|
2639
2644
|
play() {
|
|
2640
2645
|
this.s.animation.play(), this.s.animateEl.classList.add("start"), this.s.options.continual && (this.s.cloneAnimation.play(), this.s.cloneAnimateEl.classList.add("start"));
|
|
@@ -2643,7 +2648,7 @@ class Vs extends HTMLElement {
|
|
|
2643
2648
|
this.s.animation.pause(), this.s.options.continual && this.s.cloneAnimation.pause();
|
|
2644
2649
|
}
|
|
2645
2650
|
}
|
|
2646
|
-
|
|
2651
|
+
Xt = new WeakSet(), Gi = function() {
|
|
2647
2652
|
const t = {
|
|
2648
2653
|
direction: this.getAttribute("direction") || M.SETTINGS.direction,
|
|
2649
2654
|
// up / down / left / right
|
|
@@ -2651,7 +2656,7 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2651
2656
|
// normal / alternate / endStop
|
|
2652
2657
|
duration: Number(this.getAttribute("duration")) || M.SETTINGS.duration,
|
|
2653
2658
|
// ms
|
|
2654
|
-
durationBreakpoints:
|
|
2659
|
+
durationBreakpoints: gt(this) || M.SETTINGS.durationBreakpoints,
|
|
2655
2660
|
autoplay: this.getAttribute("autoplay") || M.SETTINGS.autoplay,
|
|
2656
2661
|
// normal / alternate / endStop
|
|
2657
2662
|
pauseOnMouseenter: this.getAttribute("pauseOnMouseEnter") ? this.getAttribute("pauseOnMouseEnter") === "true" : M.SETTINGS.pauseOnMouseenter,
|
|
@@ -2660,8 +2665,8 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2660
2665
|
// true / false
|
|
2661
2666
|
gap: Number(this.getAttribute("gap")) || M.SETTINGS.gap
|
|
2662
2667
|
};
|
|
2663
|
-
this.s = {}, this.s.options = t, this.s.nowDuration =
|
|
2664
|
-
},
|
|
2668
|
+
this.s = {}, this.s.options = t, this.s.nowDuration = Je(this), Vs(this), d(this, Ft, Ri).call(this);
|
|
2669
|
+
}, Ft = new WeakSet(), Ri = function() {
|
|
2665
2670
|
const { direction: t, continual: e, gap: s } = this.s.options;
|
|
2666
2671
|
switch (t) {
|
|
2667
2672
|
case "left":
|
|
@@ -2673,8 +2678,8 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2673
2678
|
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;`;
|
|
2674
2679
|
break;
|
|
2675
2680
|
}
|
|
2676
|
-
d(this, Yt,
|
|
2677
|
-
}, Yt = new WeakSet(),
|
|
2681
|
+
d(this, Yt, Xi).call(this), d(this, Ut, Fi).call(this), e && this.classList.add("continual"), this.classList.add("m4-initialize");
|
|
2682
|
+
}, Yt = new WeakSet(), Xi = function() {
|
|
2678
2683
|
const t = this, { direction: e, behavior: s, duration: o, autoplay: a, pauseOnMouseenter: r, continual: l } = t.s.options;
|
|
2679
2684
|
let c;
|
|
2680
2685
|
function u() {
|
|
@@ -2739,11 +2744,11 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2739
2744
|
}), t.addEventListener("mouseleave", function() {
|
|
2740
2745
|
t.s.animation && r && t.s.animation.playState === "paused" && t.play();
|
|
2741
2746
|
});
|
|
2742
|
-
},
|
|
2747
|
+
}, Ut = new WeakSet(), Fi = function() {
|
|
2743
2748
|
const t = this;
|
|
2744
2749
|
function e() {
|
|
2745
2750
|
const s = t.s.animation.startTime, o = t.s.cloneAnimation ? t.s.cloneAnimation.startTime : null;
|
|
2746
|
-
t.s.nowDuration =
|
|
2751
|
+
t.s.nowDuration = Je(t), t.s.animation.cancel(), t.s.cloneAnimation && t.s.cloneAnimation.cancel(), t.s.animation = t.s.animateEl.animate(H(t).animate1, {
|
|
2747
2752
|
duration: t.s.nowDuration,
|
|
2748
2753
|
iterations: 1 / 0
|
|
2749
2754
|
}), t.s.animation.startTime = s, t.s.cloneAnimation && (t.s.cloneAnimation = t.s.cloneAnimateEl.animate(H(t).animate2, {
|
|
@@ -2752,16 +2757,16 @@ Rt = new WeakSet(), Bi = function() {
|
|
|
2752
2757
|
iterations: 1 / 0
|
|
2753
2758
|
}), t.s.cloneAnimation.startTime = o);
|
|
2754
2759
|
}
|
|
2755
|
-
window.addEventListener("resize",
|
|
2760
|
+
window.addEventListener("resize", Ks(e));
|
|
2756
2761
|
};
|
|
2757
|
-
customElements.define("marquee-el",
|
|
2758
|
-
const
|
|
2762
|
+
customElements.define("marquee-el", tn);
|
|
2763
|
+
const Ze = function(n, i) {
|
|
2759
2764
|
let t;
|
|
2760
2765
|
return function(e) {
|
|
2761
2766
|
t && clearTimeout(t), t = setTimeout(n, 200, e);
|
|
2762
2767
|
};
|
|
2763
2768
|
}, _ = (n, i) => {
|
|
2764
|
-
if (
|
|
2769
|
+
if (ut(n)) {
|
|
2765
2770
|
n.forEach((t) => {
|
|
2766
2771
|
t.classList.add(i);
|
|
2767
2772
|
});
|
|
@@ -2769,7 +2774,7 @@ const Je = function(n, i) {
|
|
|
2769
2774
|
}
|
|
2770
2775
|
n.classList.add(i);
|
|
2771
2776
|
}, k = (n, i) => {
|
|
2772
|
-
if (
|
|
2777
|
+
if (ut(n)) {
|
|
2773
2778
|
n.forEach((t) => {
|
|
2774
2779
|
t.classList.remove(i);
|
|
2775
2780
|
});
|
|
@@ -2777,36 +2782,40 @@ const Je = function(n, i) {
|
|
|
2777
2782
|
}
|
|
2778
2783
|
n.classList.remove(i);
|
|
2779
2784
|
};
|
|
2780
|
-
var
|
|
2781
|
-
class
|
|
2785
|
+
var Jt, Yi, Zt, Ui, Qt, Ji, nt, Me, F, ft, Vt, Zi;
|
|
2786
|
+
class Qe {
|
|
2782
2787
|
constructor(i) {
|
|
2783
2788
|
// 初始化
|
|
2784
|
-
h(this, Ut);
|
|
2785
|
-
// 左右箭頭事件綁定
|
|
2786
2789
|
h(this, Jt);
|
|
2787
|
-
//
|
|
2790
|
+
// 左右箭頭事件綁定
|
|
2788
2791
|
h(this, Zt);
|
|
2792
|
+
// 左右拖拉事件綁定
|
|
2793
|
+
h(this, Qt);
|
|
2789
2794
|
// 卷軸位置判斷
|
|
2790
|
-
h(this,
|
|
2795
|
+
h(this, nt);
|
|
2791
2796
|
// 隱藏按鈕判斷
|
|
2792
|
-
h(this,
|
|
2797
|
+
h(this, F);
|
|
2793
2798
|
// 選項事件綁定
|
|
2794
|
-
h(this,
|
|
2795
|
-
this.$element = i, this.option = i.s.option.drag, d(this,
|
|
2799
|
+
h(this, Vt);
|
|
2800
|
+
this.$element = i, this.option = i.s.option.drag, d(this, Jt, Yi).call(this);
|
|
2796
2801
|
}
|
|
2797
2802
|
// 更新 active 位置
|
|
2798
2803
|
update(i) {
|
|
2799
2804
|
const t = this.$element.querySelector(".wrapper"), e = t == null ? void 0 : t.querySelector(".active");
|
|
2800
|
-
if (e) {
|
|
2801
|
-
const s =
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2805
|
+
if (e && t) {
|
|
2806
|
+
const s = t.querySelectorAll(".item"), o = e === s[0], a = e === s[s.length - 1];
|
|
2807
|
+
let r = "center";
|
|
2808
|
+
o ? r = "start" : a && (r = "end"), setTimeout(() => {
|
|
2809
|
+
e.scrollIntoView({
|
|
2810
|
+
behavior: "smooth",
|
|
2811
|
+
block: "nearest",
|
|
2812
|
+
inline: r
|
|
2813
|
+
});
|
|
2814
|
+
}, 100);
|
|
2806
2815
|
}
|
|
2807
2816
|
}
|
|
2808
2817
|
}
|
|
2809
|
-
|
|
2818
|
+
Jt = new WeakSet(), Yi = function() {
|
|
2810
2819
|
var s, o, a, r;
|
|
2811
2820
|
const i = this;
|
|
2812
2821
|
if (!i.$element)
|
|
@@ -2815,10 +2824,10 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2815
2824
|
let t = !1;
|
|
2816
2825
|
const e = () => {
|
|
2817
2826
|
t || (requestAnimationFrame(() => {
|
|
2818
|
-
d(this,
|
|
2827
|
+
d(this, nt, Me).call(this), d(this, F, ft).call(this), t = !1;
|
|
2819
2828
|
}), t = !0);
|
|
2820
2829
|
};
|
|
2821
|
-
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,
|
|
2830
|
+
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, Qt, Ji).call(s), i.option.navigation && i.$element.s.type !== "collapse" && (i.$container.insertAdjacentHTML(
|
|
2822
2831
|
S.prepend,
|
|
2823
2832
|
`<div class="navigation">
|
|
2824
2833
|
<div class="button prev">
|
|
@@ -2828,10 +2837,10 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2828
2837
|
<div></div>
|
|
2829
2838
|
</div>
|
|
2830
2839
|
</div>`
|
|
2831
|
-
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i,
|
|
2832
|
-
d(this,
|
|
2840
|
+
), i.$button = (o = i.$container) == null ? void 0 : o.querySelectorAll(".button"), d(a = i, Zt, Ui).call(a)), d(r = i, Vt, Zi).call(r), i.update(), requestAnimationFrame(() => {
|
|
2841
|
+
d(this, nt, Me).call(this), d(this, F, ft).call(this);
|
|
2833
2842
|
});
|
|
2834
|
-
},
|
|
2843
|
+
}, Zt = new WeakSet(), Ui = function() {
|
|
2835
2844
|
const i = this, { $wrapper: t, $button: e } = i, s = function() {
|
|
2836
2845
|
const o = this.classList.contains("next"), a = parseInt(t.getBoundingClientRect().width * 0.7);
|
|
2837
2846
|
t.scrollTo({
|
|
@@ -2839,13 +2848,13 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2839
2848
|
behavior: "smooth"
|
|
2840
2849
|
}), setTimeout(() => {
|
|
2841
2850
|
var r;
|
|
2842
|
-
d(r = i,
|
|
2851
|
+
d(r = i, F, ft).call(r);
|
|
2843
2852
|
}, 100);
|
|
2844
2853
|
};
|
|
2845
2854
|
e.forEach((o) => {
|
|
2846
2855
|
o.removeEventListener("click", s), o.addEventListener("click", s);
|
|
2847
2856
|
});
|
|
2848
|
-
},
|
|
2857
|
+
}, Qt = new WeakSet(), Ji = function() {
|
|
2849
2858
|
const { $wrapper: i } = this;
|
|
2850
2859
|
let t = !1, e = !1, s = 0, o = 0;
|
|
2851
2860
|
const a = function(p) {
|
|
@@ -2875,10 +2884,10 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2875
2884
|
i.querySelectorAll("a").forEach((p) => {
|
|
2876
2885
|
p.removeEventListener("click", u), p.addEventListener("click", u);
|
|
2877
2886
|
});
|
|
2878
|
-
},
|
|
2887
|
+
}, nt = new WeakSet(), Me = function() {
|
|
2879
2888
|
const { $container: i, $wrapper: t } = this, e = t.scrollWidth - t.clientWidth, s = Math.round(t.scrollLeft);
|
|
2880
2889
|
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")));
|
|
2881
|
-
},
|
|
2890
|
+
}, F = new WeakSet(), ft = function() {
|
|
2882
2891
|
const { $wrapper: i, $button: t, $element: e } = this;
|
|
2883
2892
|
if (!t)
|
|
2884
2893
|
return;
|
|
@@ -2900,7 +2909,7 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2900
2909
|
}
|
|
2901
2910
|
k(a, "hide");
|
|
2902
2911
|
}) : k(t, "hide");
|
|
2903
|
-
},
|
|
2912
|
+
}, Vt = new WeakSet(), Zi = function() {
|
|
2904
2913
|
const { $element: i } = this, t = (s) => {
|
|
2905
2914
|
if (this.option.selected) {
|
|
2906
2915
|
const o = s.getAttribute("data-option").trim();
|
|
@@ -2914,31 +2923,31 @@ Ut = new WeakSet(), Xi = function() {
|
|
|
2914
2923
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2915
2924
|
});
|
|
2916
2925
|
};
|
|
2917
|
-
var
|
|
2918
|
-
class
|
|
2926
|
+
var Kt, Qi, te, Vi, ee, Ki, ie, ts;
|
|
2927
|
+
class en {
|
|
2919
2928
|
constructor(i) {
|
|
2920
2929
|
// 初始化
|
|
2921
|
-
h(this, Vt);
|
|
2922
|
-
// 隱藏按鈕判斷
|
|
2923
2930
|
h(this, Kt);
|
|
2924
|
-
//
|
|
2931
|
+
// 隱藏按鈕判斷
|
|
2925
2932
|
h(this, te);
|
|
2926
|
-
//
|
|
2933
|
+
// 展開箭頭事件綁定
|
|
2927
2934
|
h(this, ee);
|
|
2928
|
-
|
|
2935
|
+
// 選項事件綁定
|
|
2936
|
+
h(this, ie);
|
|
2937
|
+
this.$element = i, this.option = i.s.option.collapse, d(this, Kt, Qi).call(this);
|
|
2929
2938
|
}
|
|
2930
2939
|
}
|
|
2931
|
-
|
|
2932
|
-
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this,
|
|
2933
|
-
},
|
|
2940
|
+
Kt = new WeakSet(), Qi = function() {
|
|
2941
|
+
this.$element && (this.$container = this.$element.querySelector(".collapse-container"), this.$wrapper = this.$container.querySelector(".wrapper"), d(this, te, Vi).call(this) && d(this, ee, Ki).call(this), d(this, ie, ts).call(this));
|
|
2942
|
+
}, te = new WeakSet(), Vi = function() {
|
|
2934
2943
|
const i = this.$element.querySelector(".drag-container"), t = i.querySelector(".wrapper");
|
|
2935
2944
|
return t.scrollWidth - t.clientWidth > 0 ? (i.insertAdjacentHTML(S.append, '<div class="open-collapse"></div>'), this.$button = i.querySelector(".open-collapse"), k(this.$element, "noScrollable"), !0) : (_(this.$element, "noScrollable"), !1);
|
|
2936
|
-
},
|
|
2945
|
+
}, ee = new WeakSet(), Ki = function() {
|
|
2937
2946
|
const { $element: i, $button: t } = this, e = function() {
|
|
2938
2947
|
i.classList.contains("expand") ? i.classList.remove("expand") : i.classList.add("expand");
|
|
2939
2948
|
};
|
|
2940
2949
|
t.removeEventListener("click", e), t.addEventListener("click", e);
|
|
2941
|
-
},
|
|
2950
|
+
}, ie = new WeakSet(), ts = function() {
|
|
2942
2951
|
const { $element: i } = this, t = (s, o) => {
|
|
2943
2952
|
if (i != null && i.classList.contains("expand") ? i == null || i.classList.remove("expand") : i == null || i.classList.add("expand"), this.option.selected) {
|
|
2944
2953
|
const a = s.getAttribute("data-option").trim();
|
|
@@ -2952,20 +2961,20 @@ Vt = new WeakSet(), Ji = function() {
|
|
|
2952
2961
|
s.removeEventListener("click", e), s.addEventListener("click", e);
|
|
2953
2962
|
});
|
|
2954
2963
|
};
|
|
2955
|
-
const
|
|
2964
|
+
const sn = (n) => {
|
|
2956
2965
|
const { type: i, option: t, originalDomString: e } = n.s, s = document.createElement("div");
|
|
2957
2966
|
return i == "drag" && (s.innerHTML = q.TEMPLATE[i]().trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e)), i == "collapse" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.collapse).trim(), s.querySelector(".drag-container .wrapper").insertAdjacentHTML(S.append, e), s.querySelector(".collapse-container .wrapper").insertAdjacentHTML(S.append, e)), i == "dropdown" && (s.innerHTML = q.TEMPLATE[i](t == null ? void 0 : t.dropdown).trim(), s.querySelector("dropdown-el").insertAdjacentHTML(S.append, e)), s.children;
|
|
2958
2967
|
};
|
|
2959
|
-
var
|
|
2960
|
-
class
|
|
2968
|
+
var se, es, ne, is, ot, Ie, Y, vt;
|
|
2969
|
+
class nn extends HTMLElement {
|
|
2961
2970
|
constructor() {
|
|
2962
2971
|
super();
|
|
2963
|
-
h(this, ie);
|
|
2964
2972
|
h(this, se);
|
|
2973
|
+
h(this, ne);
|
|
2965
2974
|
// 斷點設定
|
|
2966
|
-
h(this,
|
|
2975
|
+
h(this, ot);
|
|
2967
2976
|
// check type
|
|
2968
|
-
h(this,
|
|
2977
|
+
h(this, Y);
|
|
2969
2978
|
this.initialize = !1, this.__events__ = {}, this.s = {}, this.s.originalDomString = this.innerHTML.trim().replace(/\n/g, ""), this.previousWidth = window.innerWidth;
|
|
2970
2979
|
}
|
|
2971
2980
|
static get observedAttributes() {
|
|
@@ -2977,7 +2986,7 @@ class en extends HTMLElement {
|
|
|
2977
2986
|
case "m4-type":
|
|
2978
2987
|
if (e === null || e === s)
|
|
2979
2988
|
return;
|
|
2980
|
-
this.s.type = s, d(this,
|
|
2989
|
+
this.s.type = s, d(this, Y, vt).call(this);
|
|
2981
2990
|
break;
|
|
2982
2991
|
case "m4-status":
|
|
2983
2992
|
if (e === s)
|
|
@@ -2994,13 +3003,13 @@ class en extends HTMLElement {
|
|
|
2994
3003
|
}
|
|
2995
3004
|
}
|
|
2996
3005
|
connectedCallback() {
|
|
2997
|
-
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this,
|
|
3006
|
+
this.initialize || this.classList.contains("m4-init") || (this.initialize = !0, d(this, se, es).call(this));
|
|
2998
3007
|
}
|
|
2999
3008
|
update() {
|
|
3000
|
-
d(this,
|
|
3009
|
+
d(this, ot, Ie).call(this);
|
|
3001
3010
|
}
|
|
3002
3011
|
}
|
|
3003
|
-
|
|
3012
|
+
se = new WeakSet(), es = function() {
|
|
3004
3013
|
let t = {};
|
|
3005
3014
|
this.hasAttribute("m4-value") || this.setAttribute("m4-value", ""), this.s.type = this.getAttribute("m4-type") ?? q.SETTINGS.type, this.hasAttribute("m4-option") && (t = this.getAttribute("m4-option") ? JSON.parse(this.getAttribute("m4-option")) : {}, this.removeAttribute("m4-option"));
|
|
3006
3015
|
const e = (s) => {
|
|
@@ -3011,84 +3020,84 @@ ie = new WeakSet(), Ki = function() {
|
|
|
3011
3020
|
}
|
|
3012
3021
|
this.update();
|
|
3013
3022
|
};
|
|
3014
|
-
window.removeEventListener("resize",
|
|
3015
|
-
},
|
|
3016
|
-
this.classList.add("m4-init"), d(this,
|
|
3017
|
-
},
|
|
3023
|
+
window.removeEventListener("resize", Ze(e)), window.addEventListener("resize", Ze(e)), this.s.option = {}, this.s.option.drag = Object.assign({}, q.SETTINGS.drag, t == null ? void 0 : t.drag), this.s.option.collapse = Object.assign({}, q.SETTINGS.collapse, t == null ? void 0 : t.collapse), this.s.option.dropdown = Object.assign({}, q.SETTINGS.dropdown, t == null ? void 0 : t.dropdown), this.s.option.breakpoint = Object.assign({}, q.SETTINGS.breakpoint, t == null ? void 0 : t.breakpoint), d(this, ne, is).call(this);
|
|
3024
|
+
}, ne = new WeakSet(), is = function() {
|
|
3025
|
+
this.classList.add("m4-init"), d(this, ot, Ie).call(this);
|
|
3026
|
+
}, ot = new WeakSet(), Ie = function() {
|
|
3018
3027
|
const t = Object.keys(this.s.option.breakpoint);
|
|
3019
3028
|
if (!t.length) {
|
|
3020
|
-
d(this,
|
|
3029
|
+
d(this, Y, vt).call(this);
|
|
3021
3030
|
return;
|
|
3022
3031
|
}
|
|
3023
3032
|
t.map((e) => Number(e)).sort((e, s) => s - e).some((e) => {
|
|
3024
3033
|
var s, o, a, r;
|
|
3025
|
-
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,
|
|
3034
|
+
return window.innerWidth >= e && (this.s.type = (s = this.s.option.breakpoint[e]) == null ? void 0 : s.type, this.setAttribute("m4-type", this.s.type), this.s.option.drag = Object.assign({}, this.s.option.drag, (o = this.s.option.breakpoint[e]) == null ? void 0 : o.drag), this.s.option.collapse = Object.assign({}, this.s.option.collapse, (a = this.s.option.breakpoint[e]) == null ? void 0 : a.collapse), this.s.option.dropdown = Object.assign({}, this.s.option.dropdown, (r = this.s.option.breakpoint[e]) == null ? void 0 : r.dropdown)), d(this, Y, vt).call(this), window.innerWidth >= e;
|
|
3026
3035
|
});
|
|
3027
|
-
},
|
|
3036
|
+
}, Y = new WeakSet(), vt = function() {
|
|
3028
3037
|
var o;
|
|
3029
3038
|
const { type: t } = this.s;
|
|
3030
|
-
this.innerHTML = "", [...
|
|
3039
|
+
this.innerHTML = "", [...sn(this)].forEach((a) => {
|
|
3031
3040
|
this.append(a);
|
|
3032
3041
|
});
|
|
3033
3042
|
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")}"]`);
|
|
3034
3043
|
switch (e == null || e.classList.add("active"), s == null || s.classList.add("active"), t) {
|
|
3035
3044
|
case "drag":
|
|
3036
|
-
this.drag = new
|
|
3045
|
+
this.drag = new Qe(this);
|
|
3037
3046
|
break;
|
|
3038
3047
|
case "collapse":
|
|
3039
|
-
this.drag = new
|
|
3048
|
+
this.drag = new Qe(this), this.collapse = new en(this);
|
|
3040
3049
|
break;
|
|
3041
3050
|
}
|
|
3042
3051
|
(o = this.drag) == null || o.update();
|
|
3043
3052
|
};
|
|
3044
|
-
customElements.define("multipurpose-nav",
|
|
3045
|
-
var
|
|
3046
|
-
class
|
|
3053
|
+
customElements.define("multipurpose-nav", nn);
|
|
3054
|
+
var oe, ns, ae, os, at, qe, W, J, re, as, le, rs, ce, ls, de, cs, ue, ds, he, us, pe, hs, me, ps, ge, ms, N, R, fe, gs, ve, fs, be, vs, ye, bs;
|
|
3055
|
+
class ss extends HTMLElement {
|
|
3047
3056
|
// 定義組件的初始狀態
|
|
3048
3057
|
constructor(t, e) {
|
|
3049
3058
|
super();
|
|
3050
|
-
h(this, ne);
|
|
3051
3059
|
h(this, oe);
|
|
3060
|
+
h(this, ae);
|
|
3052
3061
|
// 第一關 判斷數量以及id設定
|
|
3053
|
-
h(this,
|
|
3062
|
+
h(this, at);
|
|
3054
3063
|
// 第二關 id命名提醒
|
|
3055
3064
|
h(this, W);
|
|
3056
|
-
h(this, ae);
|
|
3057
3065
|
h(this, re);
|
|
3058
3066
|
h(this, le);
|
|
3067
|
+
h(this, ce);
|
|
3059
3068
|
// 執行函式
|
|
3060
3069
|
// 移動至指定位置
|
|
3061
|
-
h(this, ce);
|
|
3062
|
-
// 移動
|
|
3063
3070
|
h(this, de);
|
|
3064
|
-
//
|
|
3071
|
+
// 移動
|
|
3065
3072
|
h(this, ue);
|
|
3066
|
-
//
|
|
3073
|
+
// 步驟狀態
|
|
3067
3074
|
h(this, he);
|
|
3068
|
-
//
|
|
3075
|
+
// next 按鈕狀態
|
|
3069
3076
|
h(this, pe);
|
|
3070
|
-
//
|
|
3077
|
+
// prev 按鈕狀態
|
|
3071
3078
|
h(this, me);
|
|
3079
|
+
// 頁籤狀態
|
|
3080
|
+
h(this, ge);
|
|
3072
3081
|
// 第三關各種元件判斷 及 執行
|
|
3073
3082
|
h(this, N);
|
|
3074
3083
|
// 消失動畫
|
|
3075
|
-
h(this, ge);
|
|
3076
|
-
// 出現動畫
|
|
3077
3084
|
h(this, fe);
|
|
3078
|
-
//
|
|
3085
|
+
// 出現動畫
|
|
3079
3086
|
h(this, ve);
|
|
3080
|
-
//
|
|
3087
|
+
// 狀態
|
|
3081
3088
|
h(this, be);
|
|
3089
|
+
// resize
|
|
3090
|
+
h(this, ye);
|
|
3082
3091
|
}
|
|
3083
3092
|
// 當組件的屬性被更改時會被呼叫
|
|
3084
3093
|
static get observedAttributes() {
|
|
3085
3094
|
return ["t4-active"];
|
|
3086
3095
|
}
|
|
3087
3096
|
attributeChangedCallback(t, e, s) {
|
|
3088
|
-
t === "t4-active" && e !== s && d(this,
|
|
3097
|
+
t === "t4-active" && e !== s && d(this, be, vs).call(this, s);
|
|
3089
3098
|
}
|
|
3090
3099
|
connectedCallback() {
|
|
3091
|
-
this.classList.contains("t4-initialize") || d(this,
|
|
3100
|
+
this.classList.contains("t4-initialize") || d(this, oe, ns).call(this);
|
|
3092
3101
|
}
|
|
3093
3102
|
// ------------- 我是分隔線呦 -------------
|
|
3094
3103
|
// 頁籤切換
|
|
@@ -3104,7 +3113,7 @@ class es extends HTMLElement {
|
|
|
3104
3113
|
e.activeTab = s, this.setAttribute("t4-active", s);
|
|
3105
3114
|
const o = d(this, W, J).call(this, s);
|
|
3106
3115
|
e.tabPanels.forEach((a, r) => {
|
|
3107
|
-
r === o ? d(this,
|
|
3116
|
+
r === o ? d(this, ve, fs).call(this, r) : d(this, fe, gs).call(this, r);
|
|
3108
3117
|
});
|
|
3109
3118
|
}
|
|
3110
3119
|
// 外部呼叫方法 $0.goNext()
|
|
@@ -3119,11 +3128,11 @@ class es extends HTMLElement {
|
|
|
3119
3128
|
}
|
|
3120
3129
|
// 外部呼叫方法 $0.update()
|
|
3121
3130
|
update() {
|
|
3122
|
-
this.t.tabs = d(this,
|
|
3131
|
+
this.t.tabs = d(this, at, qe).call(this), ys(), console.log("tab update!!!!");
|
|
3123
3132
|
}
|
|
3124
3133
|
}
|
|
3125
|
-
|
|
3126
|
-
const t = this.getAttribute("t4-name"), { SETTINGS: e } =
|
|
3134
|
+
oe = new WeakSet(), ns = function() {
|
|
3135
|
+
const t = this.getAttribute("t4-name"), { SETTINGS: e } = ii;
|
|
3127
3136
|
document.querySelectorAll(`tab-el[t4-name=${t}]`).length > 1 && console.warn(t, "名字有重複喔!!!"), this.t = {
|
|
3128
3137
|
tabs: [],
|
|
3129
3138
|
name: t,
|
|
@@ -3142,14 +3151,14 @@ ne = new WeakSet(), is = function() {
|
|
|
3142
3151
|
delay: this.getAttribute("t4-delay") || e.transition.delay
|
|
3143
3152
|
},
|
|
3144
3153
|
tabGroup: this.getAttribute("t4-group") || e.tabGroup
|
|
3145
|
-
}, this.__events__ = {}, this.t.tabs = d(this,
|
|
3146
|
-
},
|
|
3147
|
-
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this,
|
|
3154
|
+
}, this.__events__ = {}, this.t.tabs = d(this, at, qe).call(this), this.t.step = document.querySelector(`[t4-control="${this.t.name}"]${this.t.stepOutput}`), d(this, ae, os).call(this);
|
|
3155
|
+
}, ae = new WeakSet(), os = function() {
|
|
3156
|
+
if (this.t.activeTab = this.t.defaultPage, this.t.display === "swiper" && d(this, re, as).call(this), this.t.recordUrl) {
|
|
3148
3157
|
const e = new URLSearchParams(document.location.search).get(this.t.name), s = document.querySelectorAll(`[t4-name="${this.t.name}"] .tab-panel[t4-id="${e}"]`);
|
|
3149
3158
|
e && s.length === 1 ? this.t.activeTab = e : console.warn(`沒有${e}這頁喔!!`);
|
|
3150
3159
|
}
|
|
3151
|
-
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this,
|
|
3152
|
-
},
|
|
3160
|
+
this.setActiveTab(this.t.activeTab), this.classList.add("t4-initialize"), d(this, ye, bs).call(this);
|
|
3161
|
+
}, at = new WeakSet(), qe = function() {
|
|
3153
3162
|
const { t } = this, e = Array.from(document.querySelectorAll(`[t4-control="${t.name}"][t4-role="tab"]`));
|
|
3154
3163
|
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) => {
|
|
3155
3164
|
s.getAttribute("t4-id") || console.warn(s, "請幫我設定id!!");
|
|
@@ -3159,19 +3168,19 @@ ne = new WeakSet(), is = function() {
|
|
|
3159
3168
|
s.length > 1 && console.warn("有兩個相同id設定", s);
|
|
3160
3169
|
const o = s[0];
|
|
3161
3170
|
return o ? e.tabPanels.indexOf(o) : (console.warn(`找不到t4-id為${t}的頁籤`), 0);
|
|
3162
|
-
},
|
|
3171
|
+
}, re = new WeakSet(), as = function() {
|
|
3163
3172
|
const t = document.createElement("div");
|
|
3164
3173
|
t.classList.add("swiper-container");
|
|
3165
3174
|
const e = document.createElement("div");
|
|
3166
3175
|
e.classList.add("swiper-wrapper"), this.t.tabPanels.forEach((s) => {
|
|
3167
3176
|
e.appendChild(s.cloneNode(!0));
|
|
3168
|
-
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this,
|
|
3169
|
-
},
|
|
3177
|
+
}), this.t.tabPanels = [...e.children], t.appendChild(e), this.innerHTML = "", this.appendChild(t), d(this, le, rs).call(this);
|
|
3178
|
+
}, le = new WeakSet(), rs = function() {
|
|
3170
3179
|
const t = this.querySelector(".swiper-container"), e = this.querySelector(".swiper-wrapper"), s = this.t.tabPanels;
|
|
3171
3180
|
t.style.overflow = "hidden", e.style.display = "flex";
|
|
3172
3181
|
const o = s.length * 100 + "%";
|
|
3173
3182
|
e.style.width = o;
|
|
3174
|
-
},
|
|
3183
|
+
}, ce = new WeakSet(), ls = function(t) {
|
|
3175
3184
|
const { t: e } = this;
|
|
3176
3185
|
if (e.recordUrl === "true") {
|
|
3177
3186
|
const s = new URLSearchParams(document.location.search);
|
|
@@ -3179,28 +3188,28 @@ ne = new WeakSet(), is = function() {
|
|
|
3179
3188
|
const o = `${window.location.pathname}?${s.toString()}`;
|
|
3180
3189
|
history.replaceState({ t4Id: t }, "", o);
|
|
3181
3190
|
}
|
|
3182
|
-
},
|
|
3191
|
+
}, de = new WeakSet(), cs = function() {
|
|
3183
3192
|
const t = parseInt(this.t.gap, 10), e = window.pageYOffset, o = this.getBoundingClientRect().top + e - t;
|
|
3184
|
-
d(this,
|
|
3185
|
-
},
|
|
3193
|
+
d(this, ue, ds).call(this, o);
|
|
3194
|
+
}, ue = new WeakSet(), ds = function(t) {
|
|
3186
3195
|
window.scrollTo({
|
|
3187
3196
|
top: t,
|
|
3188
3197
|
behavior: "smooth"
|
|
3189
3198
|
});
|
|
3190
|
-
},
|
|
3199
|
+
}, he = new WeakSet(), us = function(t) {
|
|
3191
3200
|
let e = parseInt(t, 10) + 1;
|
|
3192
3201
|
this.t.step.textContent = `${e}`, this.t.step.setAttribute("now-page", e);
|
|
3193
|
-
},
|
|
3202
|
+
}, pe = new WeakSet(), hs = function(t) {
|
|
3194
3203
|
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;
|
|
3195
3204
|
e.forEach((a) => {
|
|
3196
3205
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3197
3206
|
});
|
|
3198
|
-
},
|
|
3207
|
+
}, me = new WeakSet(), ps = function(t) {
|
|
3199
3208
|
const e = document.querySelectorAll(`[t4-role="prev"][t4-control="${this.t.name}"]`), s = this.t.tabPanels.length === 1, o = t === 0;
|
|
3200
3209
|
e.forEach((a) => {
|
|
3201
3210
|
s || o ? a.setAttribute("disabled", "") : a.removeAttribute("disabled");
|
|
3202
3211
|
});
|
|
3203
|
-
},
|
|
3212
|
+
}, ge = new WeakSet(), ms = function(t, e) {
|
|
3204
3213
|
this.t.tabGroup === "true" ? this.t.tabs.forEach((s, o) => {
|
|
3205
3214
|
o == t ? s.setAttribute("aria-selected", !0) : s.setAttribute("aria-selected", !1);
|
|
3206
3215
|
}) : this.t.tabs.forEach((s, o) => {
|
|
@@ -3209,25 +3218,25 @@ ne = new WeakSet(), is = function() {
|
|
|
3209
3218
|
}, N = new WeakSet(), R = function(t, e, s) {
|
|
3210
3219
|
switch (t) {
|
|
3211
3220
|
case "step":
|
|
3212
|
-
|
|
3221
|
+
Se(this.t.step) && d(this, he, us).call(this, e);
|
|
3213
3222
|
break;
|
|
3214
3223
|
case "eventAnchor":
|
|
3215
|
-
this.t.anchor && d(this,
|
|
3224
|
+
this.t.anchor && d(this, de, cs).call(this);
|
|
3216
3225
|
break;
|
|
3217
3226
|
case "tabState":
|
|
3218
|
-
this.t.type == "normal" && d(this,
|
|
3227
|
+
this.t.type == "normal" && d(this, ge, ms).call(this, e, s);
|
|
3219
3228
|
break;
|
|
3220
3229
|
case "btnState":
|
|
3221
|
-
d(this,
|
|
3230
|
+
d(this, pe, hs).call(this, e), d(this, me, ps).call(this, e);
|
|
3222
3231
|
break;
|
|
3223
3232
|
case "tabUrl":
|
|
3224
|
-
this.t.recordUrl === "true" && d(this,
|
|
3233
|
+
this.t.recordUrl === "true" && d(this, ce, ls).call(this, e);
|
|
3225
3234
|
break;
|
|
3226
3235
|
default:
|
|
3227
3236
|
console.warn("請增加判斷,謝謝");
|
|
3228
3237
|
break;
|
|
3229
3238
|
}
|
|
3230
|
-
},
|
|
3239
|
+
}, fe = new WeakSet(), gs = function(t) {
|
|
3231
3240
|
const { t: e } = this;
|
|
3232
3241
|
this.t.transition;
|
|
3233
3242
|
const s = e.tabPanels[t];
|
|
@@ -3244,7 +3253,7 @@ ne = new WeakSet(), is = function() {
|
|
|
3244
3253
|
s.style.display = "none";
|
|
3245
3254
|
break;
|
|
3246
3255
|
}
|
|
3247
|
-
},
|
|
3256
|
+
}, ve = new WeakSet(), fs = function(t) {
|
|
3248
3257
|
const { duration: e, timing: s, delay: o } = this.t.transition, a = this.t.tabPanels[t];
|
|
3249
3258
|
let r;
|
|
3250
3259
|
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) {
|
|
@@ -3269,25 +3278,25 @@ ne = new WeakSet(), is = function() {
|
|
|
3269
3278
|
console.warn(this.t.display, "沒有這個效果請自己想辦法!!!!");
|
|
3270
3279
|
break;
|
|
3271
3280
|
}
|
|
3272
|
-
},
|
|
3281
|
+
}, be = new WeakSet(), vs = function(t) {
|
|
3273
3282
|
const e = d(this, W, J).call(this, t);
|
|
3274
3283
|
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");
|
|
3275
|
-
},
|
|
3284
|
+
}, ye = new WeakSet(), bs = function() {
|
|
3276
3285
|
const t = this;
|
|
3277
3286
|
window.addEventListener(
|
|
3278
3287
|
"resize",
|
|
3279
|
-
|
|
3288
|
+
on(() => {
|
|
3280
3289
|
t.update();
|
|
3281
3290
|
}, 1e3)
|
|
3282
3291
|
);
|
|
3283
3292
|
};
|
|
3284
|
-
function
|
|
3293
|
+
function on(n, i = 1e3) {
|
|
3285
3294
|
let t;
|
|
3286
3295
|
return function(e) {
|
|
3287
3296
|
t && clearTimeout(t), t = setTimeout(n, i, e);
|
|
3288
3297
|
};
|
|
3289
3298
|
}
|
|
3290
|
-
function
|
|
3299
|
+
function ys() {
|
|
3291
3300
|
const n = document.querySelectorAll("[t4-control]");
|
|
3292
3301
|
document.addEventListener("click", function(i) {
|
|
3293
3302
|
let t = !1;
|
|
@@ -3317,91 +3326,91 @@ function vs() {
|
|
|
3317
3326
|
}
|
|
3318
3327
|
});
|
|
3319
3328
|
}
|
|
3320
|
-
|
|
3321
|
-
Object.assign(
|
|
3322
|
-
customElements.define("tab-el",
|
|
3323
|
-
const
|
|
3329
|
+
ys();
|
|
3330
|
+
Object.assign(ss.prototype, j);
|
|
3331
|
+
customElements.define("tab-el", ss);
|
|
3332
|
+
const Ve = (n) => {
|
|
3324
3333
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e);
|
|
3325
3334
|
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";
|
|
3326
|
-
},
|
|
3335
|
+
}, an = (n) => {
|
|
3327
3336
|
const { defaultOptions: i } = n.collapse, { collapseClass: t, target: e, transition: s } = i, o = n.querySelector(e), a = o.children[0].offsetHeight;
|
|
3328
3337
|
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";
|
|
3329
3338
|
};
|
|
3330
|
-
var
|
|
3331
|
-
class
|
|
3339
|
+
var rt, Oe, we, ws, Te, Ts, lt, Ne;
|
|
3340
|
+
class rn {
|
|
3332
3341
|
constructor(i, t = {}) {
|
|
3333
|
-
h(this, at);
|
|
3334
|
-
h(this, ye);
|
|
3335
|
-
h(this, we);
|
|
3336
3342
|
h(this, rt);
|
|
3337
|
-
|
|
3343
|
+
h(this, we);
|
|
3344
|
+
h(this, Te);
|
|
3345
|
+
h(this, lt);
|
|
3346
|
+
!dt(i) && !Se(i) && !ut(i) && !E(i) || (this.__storage__ = {
|
|
3338
3347
|
el: i,
|
|
3339
3348
|
options: t
|
|
3340
|
-
}, this.active = "data-collapse-active", d(this,
|
|
3349
|
+
}, this.active = "data-collapse-active", d(this, rt, Oe).call(this));
|
|
3341
3350
|
}
|
|
3342
3351
|
update() {
|
|
3343
|
-
d(this,
|
|
3352
|
+
d(this, rt, Oe).call(this);
|
|
3344
3353
|
}
|
|
3345
3354
|
}
|
|
3346
|
-
|
|
3347
|
-
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } =
|
|
3348
|
-
if (this.elements = t.state == "not active" ?
|
|
3355
|
+
rt = new WeakSet(), Oe = function() {
|
|
3356
|
+
const { el: i, options: t } = this.__storage__, { SETTINGS: e, EVENTS: s } = si;
|
|
3357
|
+
if (this.elements = t.state == "not active" ? $(i + `:not([${this.active}])`) : $(i), this.options = Object.assign({}, e, t), this.__events__ = Object.assign({}, s), this.options.on)
|
|
3349
3358
|
for (const [o, a] of Object.entries(this.options.on))
|
|
3350
3359
|
this.__events__[o] = [a];
|
|
3351
|
-
d(this,
|
|
3352
|
-
},
|
|
3360
|
+
d(this, we, ws).call(this);
|
|
3361
|
+
}, we = new WeakSet(), ws = function() {
|
|
3353
3362
|
const { elements: i, options: t } = this;
|
|
3354
3363
|
i.forEach((e) => {
|
|
3355
|
-
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,
|
|
3364
|
+
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, Te, Ts).call(this, e);
|
|
3356
3365
|
}), this.emit("init");
|
|
3357
|
-
},
|
|
3366
|
+
}, Te = new WeakSet(), Ts = function(i) {
|
|
3358
3367
|
const { options: t } = this, { collapseClass: e, block: s, target: o, defaultOpen: a, targetStopPropagation: r, defaultActiveMark: l } = t, c = i, u = c.querySelector(o);
|
|
3359
|
-
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,
|
|
3368
|
+
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, lt, Ne)), c.addEventListener("click", d(this, lt, Ne)), r) {
|
|
3360
3369
|
const p = (g) => {
|
|
3361
3370
|
g.stopPropagation();
|
|
3362
3371
|
};
|
|
3363
3372
|
u.removeEventListener("click", p), u.addEventListener("click", p);
|
|
3364
3373
|
}
|
|
3365
|
-
},
|
|
3374
|
+
}, lt = new WeakSet(), Ne = function() {
|
|
3366
3375
|
const { instance: i, defaultOptions: t } = this.collapse, { collapseClass: e, block: s, target: o, single: a } = t, r = this;
|
|
3367
3376
|
r.classList.contains(e) ? (a && r.parentNode.querySelectorAll(`.${r.classList[0]}`).forEach((l) => {
|
|
3368
|
-
|
|
3369
|
-
}),
|
|
3377
|
+
Ve(l);
|
|
3378
|
+
}), an(r)) : Ve(r), i.emit("afterCollapse");
|
|
3370
3379
|
};
|
|
3371
|
-
Object.assign(
|
|
3372
|
-
function
|
|
3380
|
+
Object.assign(rn.prototype, j);
|
|
3381
|
+
function ln(n, i) {
|
|
3373
3382
|
const t = i, { color: e, opacity: s, duration: o } = i.s.options;
|
|
3374
3383
|
let a = document.createElement("span"), r = n.clientX - t.getBoundingClientRect().left, l = n.clientY - t.getBoundingClientRect().top;
|
|
3375
3384
|
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() {
|
|
3376
3385
|
a.remove();
|
|
3377
3386
|
}, `${o}`);
|
|
3378
3387
|
}
|
|
3379
|
-
function
|
|
3388
|
+
function Es() {
|
|
3380
3389
|
document.querySelectorAll("ripple-btn").forEach((n) => {
|
|
3381
3390
|
n.querySelector(".hover-ball"), n.style.setProperty("--r", ""), n.classList.remove("entered");
|
|
3382
3391
|
});
|
|
3383
3392
|
}
|
|
3384
|
-
document.addEventListener("click",
|
|
3385
|
-
var
|
|
3386
|
-
class
|
|
3393
|
+
document.addEventListener("click", Es);
|
|
3394
|
+
var ct, Pe, Ee, As, Ae, Ls, Le, Ss;
|
|
3395
|
+
class cn extends HTMLElement {
|
|
3387
3396
|
constructor() {
|
|
3388
3397
|
super();
|
|
3389
|
-
h(this,
|
|
3390
|
-
h(this, Te);
|
|
3398
|
+
h(this, ct);
|
|
3391
3399
|
h(this, Ee);
|
|
3400
|
+
h(this, Ae);
|
|
3392
3401
|
h(this, Le);
|
|
3393
3402
|
this.initialize = !1;
|
|
3394
3403
|
}
|
|
3395
3404
|
connectedCallback() {
|
|
3396
3405
|
const t = this;
|
|
3397
|
-
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this,
|
|
3406
|
+
t.initialize || t.classList.contains("r4-initialize") || (t.initialize = !0, d(this, ct, Pe).call(this));
|
|
3398
3407
|
}
|
|
3399
3408
|
update() {
|
|
3400
|
-
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this,
|
|
3409
|
+
this.classList.remove("r4-initialize"), this.querySelector("i.hover-ball").remove(), d(this, ct, Pe).call(this);
|
|
3401
3410
|
}
|
|
3402
3411
|
}
|
|
3403
|
-
|
|
3404
|
-
const { SETTINGS: t } =
|
|
3412
|
+
ct = new WeakSet(), Pe = function() {
|
|
3413
|
+
const { SETTINGS: t } = ni;
|
|
3405
3414
|
this.s = {};
|
|
3406
3415
|
function e(o) {
|
|
3407
3416
|
let a = !!o;
|
|
@@ -3415,20 +3424,20 @@ lt = new WeakSet(), Ne = function() {
|
|
|
3415
3424
|
hover: this.getAttribute("r4-hover") ? e(this.getAttribute("r4-hover")) : t.hover,
|
|
3416
3425
|
click: this.getAttribute("r4-hover-click") ? e(this.getAttribute("r4-hover-click")) : t.click
|
|
3417
3426
|
};
|
|
3418
|
-
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this,
|
|
3419
|
-
},
|
|
3420
|
-
d(this,
|
|
3421
|
-
},
|
|
3427
|
+
this.s.options = s, this.s.options.hover && this.classList.add("hover-btn"), d(this, Ee, As).call(this);
|
|
3428
|
+
}, Ee = new WeakSet(), As = function() {
|
|
3429
|
+
d(this, Ae, Ls).call(this), d(this, Le, Ss).call(this), this.classList.add("r4-initialize");
|
|
3430
|
+
}, Ae = new WeakSet(), Ls = function() {
|
|
3422
3431
|
const t = this, e = document.createElement("i");
|
|
3423
3432
|
e.classList.add("hover-ball"), e.style.transitionDuration = `${t.s.options.speed}ms`, t.appendChild(e);
|
|
3424
|
-
}, Le = new WeakSet(),
|
|
3433
|
+
}, Le = new WeakSet(), Ss = function() {
|
|
3425
3434
|
const t = this.querySelector("i.hover-ball"), e = this;
|
|
3426
3435
|
e.addEventListener("click", function(a) {
|
|
3427
|
-
a.stopPropagation(), e.s.options.click &&
|
|
3436
|
+
a.stopPropagation(), e.s.options.click && ln(a, e);
|
|
3428
3437
|
});
|
|
3429
3438
|
let s = "ontouchstart" in document.documentElement ? "touchstart" : "mouseenter", o = "ontouchend" in document.documentElement ? "touchend" : "mouseleave";
|
|
3430
3439
|
e.addEventListener(s, function(a) {
|
|
3431
|
-
if (s === "touchstart" &&
|
|
3440
|
+
if (s === "touchstart" && Es(), e.s.options.hover) {
|
|
3432
3441
|
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);
|
|
3433
3442
|
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");
|
|
3434
3443
|
}
|
|
@@ -3439,8 +3448,8 @@ lt = new WeakSet(), Ne = function() {
|
|
|
3439
3448
|
}
|
|
3440
3449
|
});
|
|
3441
3450
|
};
|
|
3442
|
-
customElements.define("ripple-btn",
|
|
3443
|
-
class
|
|
3451
|
+
customElements.define("ripple-btn", cn);
|
|
3452
|
+
class dn {
|
|
3444
3453
|
constructor() {
|
|
3445
3454
|
this.init();
|
|
3446
3455
|
}
|
|
@@ -3492,12 +3501,12 @@ class ln {
|
|
|
3492
3501
|
this.init();
|
|
3493
3502
|
}
|
|
3494
3503
|
}
|
|
3495
|
-
function
|
|
3504
|
+
function Ke(n, i) {
|
|
3496
3505
|
return n ? function(t, e) {
|
|
3497
3506
|
Function(n)(t, e);
|
|
3498
3507
|
} : i;
|
|
3499
3508
|
}
|
|
3500
|
-
function
|
|
3509
|
+
function un(n, i, t, e) {
|
|
3501
3510
|
const s = i.params, o = n.closest("[data-upload-item]").querySelector("[data-preview]");
|
|
3502
3511
|
o.querySelector("img") && o.querySelector("img").remove(), o.appendChild(e.imgElement);
|
|
3503
3512
|
const a = n.dataset.group, r = document.querySelector(i.el).dataset.index;
|
|
@@ -3520,7 +3529,7 @@ function cn(n, i, t, e) {
|
|
|
3520
3529
|
info: e
|
|
3521
3530
|
}, s.on.changeAfter && typeof s.on.changeAfter == "function" && s.on.changeAfter(n, e);
|
|
3522
3531
|
}
|
|
3523
|
-
function
|
|
3532
|
+
function hn(n, i, t, e) {
|
|
3524
3533
|
const s = document.createElement("canvas"), o = s.getContext("2d"), a = i.width, l = i.height / a * 100, c = e / t * 100;
|
|
3525
3534
|
let u = 0, p = 0;
|
|
3526
3535
|
switch (s.width = t, s.height = e, n.previewSize) {
|
|
@@ -3534,14 +3543,14 @@ function dn(n, i, t, e) {
|
|
|
3534
3543
|
const g = (s.width - u) * 0.5, m = (s.height - p) * 0.5;
|
|
3535
3544
|
return o.drawImage(i, g, m, u, p), s;
|
|
3536
3545
|
}
|
|
3537
|
-
function
|
|
3546
|
+
function pn(n, i) {
|
|
3538
3547
|
return new Promise((t, e) => {
|
|
3539
3548
|
if (i) {
|
|
3540
3549
|
const s = new Image();
|
|
3541
3550
|
s.src = i, s.classList.add(n.previewSize), s.onload = () => {
|
|
3542
3551
|
let o = {
|
|
3543
3552
|
imgElement: s,
|
|
3544
|
-
originalCanvas:
|
|
3553
|
+
originalCanvas: hn(n, s, s.width, s.height),
|
|
3545
3554
|
info: {
|
|
3546
3555
|
originalWidth: s.width,
|
|
3547
3556
|
originalHeight: s.height,
|
|
@@ -3554,31 +3563,31 @@ function un(n, i) {
|
|
|
3554
3563
|
t();
|
|
3555
3564
|
});
|
|
3556
3565
|
}
|
|
3557
|
-
function
|
|
3566
|
+
function mn(n, i) {
|
|
3558
3567
|
const t = Math.pow(10, i);
|
|
3559
3568
|
return Math.round(n * t) / t;
|
|
3560
3569
|
}
|
|
3561
|
-
function
|
|
3570
|
+
function gn(n, i) {
|
|
3562
3571
|
let t = n.size / 1024 / 1024;
|
|
3563
|
-
return `${
|
|
3572
|
+
return `${mn(t, 2)}` <= i;
|
|
3564
3573
|
}
|
|
3565
|
-
function
|
|
3574
|
+
function fn(n, i, t) {
|
|
3566
3575
|
if (n.target.files.length <= 0)
|
|
3567
3576
|
return;
|
|
3568
3577
|
const e = n.target.files[0], s = i.closest("[data-upload-item]");
|
|
3569
3578
|
let o = new FileReader();
|
|
3570
3579
|
o.onload = (a) => {
|
|
3571
3580
|
const r = e.type.split("/")[0] === "image" ? a.target.result : null;
|
|
3572
|
-
if (t.params.sizeLimit && !
|
|
3581
|
+
if (t.params.sizeLimit && !gn(e, t.params.sizeLimit)) {
|
|
3573
3582
|
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);
|
|
3574
3583
|
return;
|
|
3575
3584
|
} else
|
|
3576
|
-
s.classList.remove("over-limit"), s.classList.add("uploaded"),
|
|
3577
|
-
|
|
3585
|
+
s.classList.remove("over-limit"), s.classList.add("uploaded"), pn(t.params, r).then((l) => {
|
|
3586
|
+
un(i, t, e, l);
|
|
3578
3587
|
});
|
|
3579
3588
|
}, o.readAsDataURL(e);
|
|
3580
3589
|
}
|
|
3581
|
-
class
|
|
3590
|
+
class vn {
|
|
3582
3591
|
constructor(i, t) {
|
|
3583
3592
|
const e = this;
|
|
3584
3593
|
e.el = i, e.params = {
|
|
@@ -3606,67 +3615,67 @@ class gn {
|
|
|
3606
3615
|
previewSize: e.dataset.previewSize || i.params.previewSize,
|
|
3607
3616
|
compress: e.dataset.compress || i.params.compress,
|
|
3608
3617
|
on: {
|
|
3609
|
-
changeAfter:
|
|
3610
|
-
overLimit:
|
|
3618
|
+
changeAfter: Ke(e.dataset.changeAfter, i.params.on.changeAfter),
|
|
3619
|
+
overLimit: Ke(e.dataset.overLimit, i.params.on.overLimit)
|
|
3611
3620
|
}
|
|
3612
3621
|
};
|
|
3613
3622
|
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) {
|
|
3614
|
-
|
|
3623
|
+
fn(a, e, i);
|
|
3615
3624
|
});
|
|
3616
3625
|
}));
|
|
3617
3626
|
}
|
|
3618
3627
|
}
|
|
3619
3628
|
export {
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3629
|
+
oi as A,
|
|
3630
|
+
Mn as B,
|
|
3631
|
+
rn as C,
|
|
3632
|
+
Pi as D,
|
|
3633
|
+
In as E,
|
|
3634
|
+
qn as F,
|
|
3635
|
+
On as G,
|
|
3636
|
+
Nn as H,
|
|
3637
|
+
dn as I,
|
|
3638
|
+
Pn as J,
|
|
3639
|
+
jn as K,
|
|
3640
|
+
zn as L,
|
|
3641
|
+
V as M,
|
|
3642
|
+
Bn as N,
|
|
3643
|
+
Wn as O,
|
|
3644
|
+
Gn as P,
|
|
3645
|
+
Rn as Q,
|
|
3646
|
+
cn as R,
|
|
3647
|
+
Xn as S,
|
|
3648
|
+
ss as T,
|
|
3649
|
+
Fn as U,
|
|
3650
|
+
Yn as V,
|
|
3651
|
+
Un as W,
|
|
3652
|
+
Jn as X,
|
|
3653
|
+
Zn as Y,
|
|
3645
3654
|
E as a,
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3655
|
+
ut as b,
|
|
3656
|
+
Ms as c,
|
|
3657
|
+
Hs as d,
|
|
3658
|
+
ze as e,
|
|
3650
3659
|
S as f,
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3660
|
+
$ as g,
|
|
3661
|
+
Dn as h,
|
|
3662
|
+
dt as i,
|
|
3663
|
+
yi as j,
|
|
3664
|
+
tn as k,
|
|
3665
|
+
nn as l,
|
|
3666
|
+
vn as m,
|
|
3667
|
+
Rs as n,
|
|
3668
|
+
Qn as o,
|
|
3669
|
+
Hi as p,
|
|
3670
|
+
Mi as q,
|
|
3671
|
+
kn as r,
|
|
3672
|
+
Cs as s,
|
|
3673
|
+
xn as t,
|
|
3674
|
+
$n as u,
|
|
3675
|
+
_e as v,
|
|
3676
|
+
Gs as w,
|
|
3677
|
+
_n as x,
|
|
3678
|
+
Cn as y,
|
|
3679
|
+
Hn as z
|
|
3671
3680
|
};
|
|
3672
3681
|
//# sourceMappingURL=image-preview-bundle.js.map
|