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