@xwadex/fesd 0.0.29 → 0.0.30
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
CHANGED
@@ -8,9 +8,9 @@ var m = (r, t, e) => {
|
|
8
8
|
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
9
9
|
};
|
10
10
|
var p = (r, t, e) => (bt(r, t, "access private method"), e);
|
11
|
-
import { i as tt, a as V, g as
|
11
|
+
import { i as tt, a as V, g as T, v as ft, c as wt, b as vt, d as yt, e as $t, f as xt, s as At } from "./image-preview-bundle.js";
|
12
12
|
import { A as Dt, j as Ht, C as jt, h as Pt, D as Ft, m as Ut, I as Vt, k as Yt, M as Gt, l as Jt, R as Kt, T as Qt } from "./image-preview-bundle.js";
|
13
|
-
import { m as C, S as
|
13
|
+
import { m as C, S as St, p as Et } from "./vendor-bundle.js";
|
14
14
|
const E = () => {
|
15
15
|
const r = navigator.userAgent, t = {
|
16
16
|
// Firefox 1.0+
|
@@ -64,26 +64,26 @@ const E = () => {
|
|
64
64
|
if (r[t])
|
65
65
|
return r[t];
|
66
66
|
});
|
67
|
-
},
|
67
|
+
}, Tt = () => console.dir(E());
|
68
68
|
function Rt() {
|
69
69
|
return {
|
70
70
|
init: E,
|
71
71
|
isBrowser4: Lt,
|
72
72
|
isMobile4: Ct,
|
73
73
|
isOs4: kt,
|
74
|
-
logs:
|
74
|
+
logs: Tt
|
75
75
|
};
|
76
76
|
}
|
77
77
|
const f = (r, t, e) => {
|
78
78
|
r && (vt(r) ? r.forEach((s) => s.style[t] = e) : r.style[t] = e);
|
79
79
|
};
|
80
|
-
var
|
80
|
+
var q, et, W, st, x, Y, _, rt, O, it, M, ot, R, at, B, nt, N, lt, I, ct, X, dt, A, G, z, ut, S, J;
|
81
81
|
class Bt {
|
82
82
|
constructor(t, e = {}) {
|
83
|
-
m(this,
|
83
|
+
m(this, q);
|
84
84
|
m(this, W);
|
85
85
|
// 取得元件上的設定值
|
86
|
-
m(this,
|
86
|
+
m(this, x);
|
87
87
|
// 設置設定值的 CSS 樣式
|
88
88
|
m(this, _);
|
89
89
|
// 表格拖曳功能
|
@@ -97,35 +97,35 @@ class Bt {
|
|
97
97
|
m(this, I);
|
98
98
|
// Navigation 設置
|
99
99
|
m(this, X);
|
100
|
-
m(this,
|
100
|
+
m(this, A);
|
101
101
|
m(this, z);
|
102
|
-
m(this,
|
102
|
+
m(this, S);
|
103
103
|
!tt(t) || !V(t) || (this.__storage__ = {
|
104
104
|
el: t,
|
105
105
|
options: e
|
106
|
-
}, this.active = "data-article-active", p(this,
|
106
|
+
}, this.active = "data-article-active", p(this, q, et).call(this));
|
107
107
|
}
|
108
108
|
update() {
|
109
109
|
const { elements: t } = this;
|
110
110
|
t.forEach((e) => {
|
111
111
|
e.querySelectorAll("._article").forEach((s) => {
|
112
|
-
s.article = {}, s.article.parent = e, s.article.params = p(this,
|
112
|
+
s.article = {}, s.article.parent = e, s.article.params = p(this, x, Y).call(this, s), p(this, A, G).call(this, s), p(this, S, J).call(this, s);
|
113
113
|
});
|
114
114
|
});
|
115
115
|
}
|
116
116
|
}
|
117
|
-
|
117
|
+
q = new WeakSet(), et = function() {
|
118
118
|
const { el: t, options: e } = this.__storage__, { SETTINGS: s } = yt;
|
119
|
-
this.elements = e.state == "not active" ?
|
119
|
+
this.elements = e.state == "not active" ? T(t + `:not([${this.active}])`) : T(t), this.elements = T(t), this.options = Object.assign({}, s, e), p(this, W, st).call(this);
|
120
120
|
}, W = new WeakSet(), st = function() {
|
121
121
|
const { elements: t } = this;
|
122
122
|
t.forEach((e) => {
|
123
123
|
e.setAttribute(this.active, ""), e.querySelectorAll("._article").forEach((s) => {
|
124
|
-
var
|
125
|
-
s.article = {}, s.article.parent = e, s.article.params = p(this,
|
124
|
+
var o, n;
|
125
|
+
s.article = {}, s.article.parent = e, s.article.params = p(this, x, Y).call(this, s), s.article.methods = {}, s.article.methods.update = this.update, p(n = p(o = p(this, _, rt).call(this, s), A, G).call(o, s), z, ut).call(n, s), p(this, S, J).call(this, s);
|
126
126
|
});
|
127
127
|
});
|
128
|
-
},
|
128
|
+
}, x = new WeakSet(), Y = function(t) {
|
129
129
|
return {
|
130
130
|
// 元件本身
|
131
131
|
$selector: t,
|
@@ -166,178 +166,230 @@ T = new WeakSet(), et = function() {
|
|
166
166
|
return f(e.$h, "color", e.hColor), f(e.$subH, "color", e.subHColor), f(e.$p, "color", e.pColor), f(e.$description, "color", e.descriptionColor), f(e.$button, "backgroundColor", e.buttonColor), f(e.$button, "color", e.buttonTextColor), e.buttonColorHover && e.$button && (e.$button.appendChild(document.createElement("span")), f(e.$button.querySelector("span"), "backgroundColor", e.buttonColorHover)), f(e.$backgroundWrap, "backgroundColor", e.typeFullColor), f(e.$contentWrap, "backgroundColor", e.typeFullBoxColor), f(e.$quote, "color", e.quoteColor), this;
|
167
167
|
}, O = new WeakSet(), it = function(t) {
|
168
168
|
const { params: e } = t.article, s = e.$table;
|
169
|
-
let
|
170
|
-
s.addEventListener("mousedown", function(
|
171
|
-
|
172
|
-
const
|
173
|
-
n =
|
169
|
+
let o = !1, n, a, d, u;
|
170
|
+
s.addEventListener("mousedown", function(i) {
|
171
|
+
i.preventDefault(), o = !0;
|
172
|
+
const l = s.getBoundingClientRect();
|
173
|
+
n = i.pageX - l.left, a = i.pageY - l.top, d = s.scrollLeft, u = s.scrollTop;
|
174
174
|
}), s.addEventListener("mouseleave", function() {
|
175
|
-
|
175
|
+
o = !1;
|
176
176
|
}), s.addEventListener("mouseup", function() {
|
177
|
-
|
178
|
-
}), s.addEventListener("mousemove", function(
|
179
|
-
if (!
|
177
|
+
o = !1;
|
178
|
+
}), s.addEventListener("mousemove", function(i) {
|
179
|
+
if (!o)
|
180
180
|
return;
|
181
|
-
|
182
|
-
const
|
183
|
-
s.scrollLeft =
|
181
|
+
i.preventDefault();
|
182
|
+
const l = s.getBoundingClientRect(), c = i.pageX - l.left, h = i.pageY - l.top, g = c - n, b = h - a;
|
183
|
+
s.scrollLeft = d - g, s.scrollTop = u - b;
|
184
184
|
});
|
185
185
|
}, M = new WeakSet(), ot = function(t, e, s) {
|
186
|
-
const { basic_rwd:
|
186
|
+
const { basic_rwd: o } = this.options, n = window.innerWidth < o, a = [...t.querySelectorAll("tr")];
|
187
187
|
if (n || !a.length)
|
188
188
|
return;
|
189
|
-
const
|
190
|
-
p(this, N, lt).call(this, t,
|
189
|
+
const d = p(this, R, at).call(this, a);
|
190
|
+
p(this, N, lt).call(this, t, d, e, s);
|
191
191
|
}, R = new WeakSet(), at = function(t) {
|
192
192
|
const e = [], s = /* @__PURE__ */ new Set();
|
193
|
-
return t.forEach((
|
194
|
-
const a = [...
|
193
|
+
return t.forEach((o, n) => {
|
194
|
+
const a = [...o.children];
|
195
195
|
e[n] = [];
|
196
|
-
let
|
197
|
-
a.forEach((
|
198
|
-
const
|
199
|
-
for (; e[n][
|
200
|
-
|
201
|
-
for (let
|
202
|
-
const h = n +
|
196
|
+
let d = 0;
|
197
|
+
a.forEach((u) => {
|
198
|
+
const i = +u.getAttribute("rowspan") || 1, l = +u.getAttribute("colspan") || 1;
|
199
|
+
for (; e[n][d] || s.has(`${n},${d}`); )
|
200
|
+
d++;
|
201
|
+
for (let c = 0; c < i; c++) {
|
202
|
+
const h = n + c;
|
203
203
|
e[h] ?? (e[h] = []);
|
204
|
-
for (let g = 0; g <
|
205
|
-
const b =
|
204
|
+
for (let g = 0; g < l; g++) {
|
205
|
+
const b = d + g;
|
206
206
|
e[h][b] = {
|
207
|
-
el:
|
207
|
+
el: c === 0 && g === 0 ? u : null,
|
208
208
|
topRow: n,
|
209
|
-
leftCol:
|
210
|
-
rowspan:
|
211
|
-
colspan:
|
212
|
-
},
|
209
|
+
leftCol: d,
|
210
|
+
rowspan: i,
|
211
|
+
colspan: l
|
212
|
+
}, c > 0 && s.add(`${h},${b}`);
|
213
213
|
}
|
214
214
|
}
|
215
|
-
|
215
|
+
d += l;
|
216
216
|
});
|
217
217
|
}), e;
|
218
218
|
}, B = new WeakSet(), nt = function(t, e) {
|
219
219
|
var a;
|
220
|
-
const s = e.length,
|
221
|
-
for (let
|
222
|
-
for (let
|
223
|
-
const
|
224
|
-
if (
|
225
|
-
const
|
226
|
-
|
220
|
+
const s = e.length, o = Array(s).fill(0), n = t.getBoundingClientRect().top;
|
221
|
+
for (let d = 0; d < s; d++)
|
222
|
+
for (let u = 0; u < (((a = e[d]) == null ? void 0 : a.length) || 0); u++) {
|
223
|
+
const i = e[d][u];
|
224
|
+
if (i != null && i.el) {
|
225
|
+
const l = i.el.getBoundingClientRect().top;
|
226
|
+
o[d] = l - n;
|
227
227
|
break;
|
228
228
|
}
|
229
229
|
}
|
230
|
-
return
|
231
|
-
}, N = new WeakSet(), lt = function(t, e, s,
|
232
|
-
var
|
233
|
-
const n = p(this, B, nt).call(this, t, e), a = ((
|
234
|
-
for (let
|
235
|
-
for (let
|
236
|
-
const
|
237
|
-
if (
|
238
|
-
|
230
|
+
return o;
|
231
|
+
}, N = new WeakSet(), lt = function(t, e, s, o) {
|
232
|
+
var u;
|
233
|
+
const n = p(this, B, nt).call(this, t, e), a = ((u = e[0]) == null ? void 0 : u.length) ?? 0, d = Array(a).fill(0);
|
234
|
+
for (let i = 0; i < a; i++)
|
235
|
+
for (let l = 0; l < e.length; l++) {
|
236
|
+
const c = e[l][i];
|
237
|
+
if (c != null && c.el) {
|
238
|
+
d[i] = c.el.offsetLeft;
|
239
239
|
break;
|
240
240
|
}
|
241
241
|
}
|
242
242
|
e.forEach(
|
243
|
-
(
|
244
|
-
if (!(
|
243
|
+
(i) => i.forEach((l) => {
|
244
|
+
if (!(l != null && l.el))
|
245
245
|
return;
|
246
|
-
const { el:
|
247
|
-
|
246
|
+
const { el: c, topRow: h, leftCol: g } = l, b = h < s, v = g < o;
|
247
|
+
c.style.position = "sticky", c.style.zIndex = b && v ? 3 : b ? 2 : v ? 1 : 0, c.style.backgroundColor = getComputedStyle(c).backgroundColor, b && (c.style.top = `${n[h]}px`), v && (c.style.left = `${d[g]}px`);
|
248
248
|
})
|
249
249
|
);
|
250
250
|
}, I = new WeakSet(), ct = function(t) {
|
251
|
-
const { markdownLink: e } = this.options;
|
251
|
+
const { markdownLink: e, markdownImg: s } = this.options;
|
252
252
|
if (t.hasAttribute("data-markdown-rendered"))
|
253
253
|
return;
|
254
254
|
new C.Renderer(), C.use({
|
255
|
-
extensions: [
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
255
|
+
extensions: [
|
256
|
+
{
|
257
|
+
name: "center",
|
258
|
+
level: "block",
|
259
|
+
start(i) {
|
260
|
+
var l;
|
261
|
+
return (l = i.match(/@center@/)) == null ? void 0 : l.index;
|
262
|
+
},
|
263
|
+
tokenizer(i) {
|
264
|
+
const c = /^@center@(.+?)@center@/s.exec(i);
|
265
|
+
if (c)
|
266
|
+
return {
|
267
|
+
type: "center",
|
268
|
+
raw: c[0],
|
269
|
+
text: c[1],
|
270
|
+
tokens: this.lexer.inlineTokens(c[1])
|
271
|
+
};
|
272
|
+
},
|
273
|
+
renderer(i) {
|
274
|
+
return `<div data-center="true">${C.parser(i.tokens)}</div>`;
|
275
|
+
}
|
261
276
|
},
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
277
|
+
{
|
278
|
+
name: "sup",
|
279
|
+
level: "inline",
|
280
|
+
start(i) {
|
281
|
+
var l;
|
282
|
+
return (l = i.match(/@sup@/)) == null ? void 0 : l.index;
|
283
|
+
},
|
284
|
+
tokenizer(i) {
|
285
|
+
const c = /^@sup@(.+?)@sup@/.exec(i);
|
286
|
+
if (c)
|
287
|
+
return {
|
288
|
+
type: "sup",
|
289
|
+
raw: c[0],
|
290
|
+
text: c[1],
|
291
|
+
tokens: this.lexer.inlineTokens(c[1])
|
292
|
+
};
|
293
|
+
},
|
294
|
+
renderer(i) {
|
295
|
+
return `<sup>${i.text}</sup>`;
|
296
|
+
}
|
271
297
|
},
|
272
|
-
|
273
|
-
|
298
|
+
{
|
299
|
+
name: "sub",
|
300
|
+
level: "inline",
|
301
|
+
start(i) {
|
302
|
+
var l;
|
303
|
+
return (l = i.match(/@sub@/)) == null ? void 0 : l.index;
|
304
|
+
},
|
305
|
+
tokenizer(i) {
|
306
|
+
const c = /^@sub@(.+?)@sub@/.exec(i);
|
307
|
+
if (c)
|
308
|
+
return {
|
309
|
+
type: "sub",
|
310
|
+
raw: c[0],
|
311
|
+
text: c[1],
|
312
|
+
tokens: this.lexer.inlineTokens(c[1])
|
313
|
+
};
|
314
|
+
},
|
315
|
+
renderer(i) {
|
316
|
+
return `<sub>${i.text}</sub>`;
|
317
|
+
}
|
274
318
|
}
|
275
|
-
|
319
|
+
]
|
276
320
|
});
|
277
|
-
const
|
278
|
-
ALLOWED_TAGS:
|
279
|
-
|
321
|
+
const o = ["h2", "h3", "h4", "h5", "h6", "b", "del", "i", "em", "strong", "p", "ul", "ol", "li", "br", "span", "div", "sup", "sub"], n = ["data-center"], a = (i) => Et.sanitize(i, {
|
322
|
+
ALLOWED_TAGS: [
|
323
|
+
...o,
|
324
|
+
...e ? ["a"] : [],
|
325
|
+
...s ? ["img"] : []
|
326
|
+
],
|
327
|
+
ALLOWED_ATTR: [
|
328
|
+
...n,
|
329
|
+
...e ? ["href", "title", "target"] : [],
|
330
|
+
...s ? ["src", "alt", "title"] : []
|
331
|
+
],
|
280
332
|
RETURN_TRUSTED_TYPE: !1
|
281
|
-
}),
|
282
|
-
t.querySelectorAll("td,th").forEach((
|
283
|
-
|
284
|
-
const
|
285
|
-
|
333
|
+
}), d = (i) => a(C.parse(i));
|
334
|
+
t.querySelectorAll("td,th").forEach((i) => {
|
335
|
+
i.innerHTML = i.textContent;
|
336
|
+
const l = i.textContent.trim().replace(/<[^>]*>/g, "");
|
337
|
+
i.innerHTML = d(l);
|
286
338
|
}), t.setAttribute("data-markdown-rendered", "true");
|
287
339
|
}, X = new WeakSet(), dt = function(t) {
|
288
|
-
const { scrollStep: e } = this.options, s = t.querySelector("._contentWrap"),
|
289
|
-
if (!s || !
|
340
|
+
const { scrollStep: e } = this.options, s = t.querySelector("._contentWrap"), o = t.querySelector("._tableCover"), n = t.querySelector("._table"), a = typeof e == "number" ? e : s.clientWidth * 0.5;
|
341
|
+
if (!s || !o || o.querySelector(".table_navigation"))
|
290
342
|
return;
|
291
|
-
const
|
292
|
-
|
293
|
-
const
|
294
|
-
|
295
|
-
const
|
296
|
-
const
|
297
|
-
|
343
|
+
const d = document.createElement("div");
|
344
|
+
d.className = "table_navigation";
|
345
|
+
const u = document.createElement("div"), i = document.createElement("div");
|
346
|
+
u.className = "table-nav-left", i.className = "table-nav-right", d.appendChild(u), d.appendChild(i), o.appendChild(d);
|
347
|
+
const l = () => {
|
348
|
+
const c = n.scrollLeft, h = n.scrollWidth - n.clientWidth;
|
349
|
+
u.classList.toggle("disabled", c <= 0), i.classList.toggle("disabled", c >= h - 1);
|
298
350
|
};
|
299
|
-
|
351
|
+
u.addEventListener("click", () => {
|
300
352
|
n.scrollBy({ left: -a, behavior: "smooth" });
|
301
|
-
}),
|
353
|
+
}), i.addEventListener("click", () => {
|
302
354
|
n.scrollBy({ left: a, behavior: "smooth" });
|
303
|
-
}), n.addEventListener("scroll",
|
304
|
-
},
|
355
|
+
}), n.addEventListener("scroll", l), window.addEventListener("resize", l), l();
|
356
|
+
}, A = new WeakSet(), G = function(t) {
|
305
357
|
const { params: e } = t.article;
|
306
358
|
return e.$video.length && new ft(e.$video), this;
|
307
359
|
}, z = new WeakSet(), ut = function(t) {
|
308
360
|
const { basic_rwd: e } = this.options, { params: s } = t.article;
|
309
361
|
if (!s.$swiper)
|
310
362
|
return;
|
311
|
-
const
|
363
|
+
const o = wt(), n = this;
|
312
364
|
let a = {
|
313
365
|
on: {
|
314
|
-
init(
|
315
|
-
const
|
316
|
-
s.$video.length && ([...
|
366
|
+
init(i) {
|
367
|
+
const l = i.$el[0];
|
368
|
+
s.$video.length && ([...l.querySelectorAll("[video4-active]")].forEach((h) => {
|
317
369
|
var g, b;
|
318
370
|
(g = h.querySelector($t.SETTINGS.videoButton)) == null || g.remove(), (b = h.querySelector(".overlay")) == null || b.remove(), h.removeAttribute("video4-active");
|
319
371
|
}), n.update());
|
320
372
|
},
|
321
|
-
observerUpdate(
|
322
|
-
|
373
|
+
observerUpdate(i) {
|
374
|
+
i.params.autoplay.enabled && (i.autoplay.start(), i.update());
|
323
375
|
}
|
324
376
|
},
|
325
377
|
observer: !0,
|
326
378
|
breakpoints: {}
|
327
379
|
};
|
328
|
-
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${
|
329
|
-
const
|
330
|
-
|
331
|
-
const
|
332
|
-
|
333
|
-
nextEl: `.swiper-button-next.swiper-${
|
334
|
-
prevEl: `.swiper-button-prev.swiper-${
|
380
|
+
if (s.$selector.setAttribute("img-swiper", "on"), s.$selector.classList.add(`swiper-${o}`), s.$selector.getAttribute("swiper-arrow") !== "off" && s.$selector.getAttribute("swiper-arrow")) {
|
381
|
+
const i = document.createElement("div");
|
382
|
+
i.className = `swiper-button-next swiper-${o}`, s.$swiperButtonCover.appendChild(i);
|
383
|
+
const l = document.createElement("div");
|
384
|
+
l.className = `swiper-button-prev swiper-${o}`, s.$swiperButtonCover.appendChild(l), a.navigation = {
|
385
|
+
nextEl: `.swiper-button-next.swiper-${o}`,
|
386
|
+
prevEl: `.swiper-button-prev.swiper-${o}`
|
335
387
|
};
|
336
388
|
}
|
337
389
|
if (s.$selector.getAttribute("swiper-nav") !== "off" || !s.$selector.getAttribute("swiper-nav")) {
|
338
|
-
const
|
339
|
-
|
340
|
-
el: `.swiper-pagination.swiper-${
|
390
|
+
const i = document.createElement("div");
|
391
|
+
i.className = `swiper-pagination swiper-${o}`, s.$swiper.appendChild(i), a.pagination = {
|
392
|
+
el: `.swiper-pagination.swiper-${o}`,
|
341
393
|
clickable: !0
|
342
394
|
};
|
343
395
|
}
|
@@ -347,16 +399,16 @@ T = new WeakSet(), et = function() {
|
|
347
399
|
delay: 3e3,
|
348
400
|
disableOnInteraction: !1
|
349
401
|
}), (s.$selector.getAttribute("swiper-loop") !== "off" || !s.$selector.getAttribute("swiper-loop")) && (a.loop = !0), s.$selector.getAttribute("swiper-speed") && (a.speed = parseInt(s.$selector.getAttribute("swiper-speed"))), s.$selector.getAttribute("swiper-parallax") !== "off" && !s.$selector.getAttribute("swiper-loop") && (a.parallax = !0), s.$selector.getAttribute("swiper-pagination-dynamic") === "on" && (a.pagination.dynamicBullets = !0, a.pagination ? a.pagination.dynamicBullets = !0 : console.warn("pagination undefined"));
|
350
|
-
let
|
351
|
-
s.$swiper.querySelectorAll(".swiper-slide").length <=
|
352
|
-
const
|
353
|
-
return t.article.swiperList = [], t.article.swiperList.push(
|
354
|
-
},
|
402
|
+
let d = () => window.innerWidth > e && Number(s.$selector.getAttribute("swiper-num")) || 1;
|
403
|
+
s.$swiper.querySelectorAll(".swiper-slide").length <= d() && (a.navigation = !1, a.pagination = !1, a.autoplay = !1, a.loop = !1, s.$selector.querySelector(".swiper-button-cover").style.display = "none", s.$selector.querySelector(".swiper-pagination").style.display = "none", s.$swiper.classList.add("swiper-no-swiping"));
|
404
|
+
const u = new St(s.$swiper, a);
|
405
|
+
return t.article.swiperList = [], t.article.swiperList.push(u), this;
|
406
|
+
}, S = new WeakSet(), J = function(t) {
|
355
407
|
const { navigation: e } = this.options, { params: s } = t.article;
|
356
408
|
if (!s.$table)
|
357
409
|
return;
|
358
|
-
const
|
359
|
-
|
410
|
+
const o = t.getAttribute("freeze-table") === "on", n = parseInt(t.getAttribute("freeze-table-row") ?? "1", 10), a = parseInt(t.getAttribute("freeze-table-col") ?? "1", 10), d = t.querySelector("table"), u = t.querySelector("._tipText"), i = t.offsetWidth, l = d.offsetWidth, c = i < l, h = s.markdown === "on", g = () => {
|
411
|
+
o && p(this, M, ot).call(this, d, n, a), (o || c) && p(this, O, it).call(this, t), h && p(this, I, ct).call(this, d), e && c && p(this, X, dt).call(this, t), c ? (t.classList.add("overflow"), u.style.display = "flex") : (t.classList.remove("overflow"), u.style.display = "none");
|
360
412
|
};
|
361
413
|
return g(), window.addEventListener("resize", g), this;
|
362
414
|
};
|
@@ -369,26 +421,26 @@ function w(r) {
|
|
369
421
|
y: 0,
|
370
422
|
z: 0
|
371
423
|
};
|
372
|
-
const s = e.includes("3d") ? "3d" : "2d",
|
424
|
+
const s = e.includes("3d") ? "3d" : "2d", o = e.match(/matrix.*\((.+)\)/)[1].split(", ");
|
373
425
|
if (s === "2d")
|
374
426
|
return {
|
375
|
-
x: Number(
|
376
|
-
y: Number(
|
427
|
+
x: Number(o[4]),
|
428
|
+
y: Number(o[5]),
|
377
429
|
z: 0
|
378
430
|
};
|
379
431
|
if (s === "3d")
|
380
432
|
return {
|
381
|
-
x: Number(
|
382
|
-
y: Number(
|
383
|
-
z: Number(
|
433
|
+
x: Number(o[12]),
|
434
|
+
y: Number(o[13]),
|
435
|
+
z: Number(o[14])
|
384
436
|
};
|
385
437
|
}
|
386
438
|
function k(r) {
|
387
439
|
const e = r.querySelector(".wrapper").querySelectorAll(".item");
|
388
440
|
let s = 0;
|
389
|
-
return e.forEach((
|
390
|
-
const n = getComputedStyle(
|
391
|
-
s +=
|
441
|
+
return e.forEach((o) => {
|
442
|
+
const n = getComputedStyle(o), a = parseInt(n.marginLeft), d = parseInt(n.marginRight);
|
443
|
+
s += o.getBoundingClientRect().width + a + d;
|
392
444
|
}), s;
|
393
445
|
}
|
394
446
|
function U(r) {
|
@@ -399,7 +451,7 @@ function U(r) {
|
|
399
451
|
if (w(r.slideWrapEl).x < r.translateMin && w(r.slideWrapEl).x > r.translateMax)
|
400
452
|
return "is-middle";
|
401
453
|
}
|
402
|
-
function
|
454
|
+
function qt(r) {
|
403
455
|
const t = r.el, e = t.querySelector(".wrapper");
|
404
456
|
e.addEventListener(K, function(s) {
|
405
457
|
switch (r.isDown = !0, r.slidable && e.classList.add("dragging"), K) {
|
@@ -413,16 +465,16 @@ function Tt(r) {
|
|
413
465
|
r.nowTranslateX = w(e).x;
|
414
466
|
}), e.addEventListener(Q, function(s) {
|
415
467
|
r.isDown = !1, e.classList.remove("dragging"), e.classList.remove("moving");
|
416
|
-
let
|
468
|
+
let o;
|
417
469
|
switch (F) {
|
418
470
|
case "mousemove":
|
419
|
-
|
471
|
+
o = s.pageX - r.startX;
|
420
472
|
break;
|
421
473
|
case "touchmove":
|
422
|
-
|
474
|
+
o = s.changedTouches[0].pageX - r.startX;
|
423
475
|
break;
|
424
476
|
}
|
425
|
-
if (
|
477
|
+
if (o === 0 && s.target.closest(".item")) {
|
426
478
|
if (Q === "mouseup" && s.button !== 0)
|
427
479
|
return;
|
428
480
|
e.querySelectorAll(".item").forEach((a) => {
|
@@ -437,20 +489,20 @@ function Tt(r) {
|
|
437
489
|
if (!r.isDown)
|
438
490
|
return;
|
439
491
|
s.preventDefault();
|
440
|
-
let
|
492
|
+
let o;
|
441
493
|
switch (F) {
|
442
494
|
case "mousemove":
|
443
|
-
|
495
|
+
o = s.pageX - r.startX;
|
444
496
|
break;
|
445
497
|
case "touchmove":
|
446
|
-
|
498
|
+
o = s.changedTouches[0].pageX - r.startX;
|
447
499
|
break;
|
448
500
|
}
|
449
|
-
if (
|
501
|
+
if (o !== 0) {
|
450
502
|
e.classList.add("moving");
|
451
503
|
const n = {
|
452
504
|
transition: "all 0ms ease 0s",
|
453
|
-
transform: `translate3d(${r.nowTranslateX +
|
505
|
+
transform: `translate3d(${r.nowTranslateX + o}px,0,0)`
|
454
506
|
};
|
455
507
|
Object.assign(e.style, n);
|
456
508
|
}
|
@@ -478,7 +530,7 @@ class Nt {
|
|
478
530
|
const t = this;
|
479
531
|
t.slidable && (t.slideWrapEl.style.width = `${t.slideTotalWidth}px`, t.el.classList.add("slidable"), t.slideWrapEl.querySelector(".item.active") && t.moveActive()), window.addEventListener("resize", function() {
|
480
532
|
t.update();
|
481
|
-
}),
|
533
|
+
}), qt(t), Wt(t.el);
|
482
534
|
}
|
483
535
|
moveActive(t) {
|
484
536
|
const e = this, s = e.slideWrapEl.querySelector(".item.active"), n = s.previousElementSibling ? s.offsetLeft - e.el.clientWidth / 2 + s.clientWidth / 2 : 0;
|
@@ -588,17 +640,17 @@ class It {
|
|
588
640
|
}
|
589
641
|
}
|
590
642
|
D = new WeakSet(), pt = function() {
|
591
|
-
const { el: t, options: e } = this.__storage__, { SETTINGS: s } =
|
592
|
-
!tt(t) || !V(t) || (this.elements =
|
643
|
+
const { el: t, options: e } = this.__storage__, { SETTINGS: s } = At;
|
644
|
+
!tt(t) || !V(t) || (this.elements = T(t), this.options = Object.assign({}, s, e), p(this, H, ht).call(this));
|
593
645
|
}, H = new WeakSet(), ht = function() {
|
594
646
|
const { elements: t, options: e } = this;
|
595
647
|
t.forEach((s) => {
|
596
|
-
s.querySelectorAll("[share-target]").forEach((
|
597
|
-
|
648
|
+
s.querySelectorAll("[share-target]").forEach((o) => {
|
649
|
+
o.share = {}, o.share.instance = this, o.share.params = e, o.share.eventHandler = p(this, j, mt), o.addEventListener("click", o.share.eventHandler);
|
598
650
|
});
|
599
651
|
});
|
600
652
|
}, j = new WeakSet(), mt = function() {
|
601
|
-
const { eventHandler: t, params: e } = this.share, s = this.getAttribute("share-target"),
|
653
|
+
const { eventHandler: t, params: e } = this.share, s = this.getAttribute("share-target"), o = {
|
602
654
|
source: this.getAttribute("utm-source"),
|
603
655
|
medium: this.getAttribute("utm-medium"),
|
604
656
|
campaign: this.getAttribute("utm-campaign")
|
@@ -608,7 +660,7 @@ D = new WeakSet(), pt = function() {
|
|
608
660
|
className: this.getAttribute("copy-class") || e.className,
|
609
661
|
duration: this.getAttribute("copy-duration") || e.duration
|
610
662
|
}, a = encodeURIComponent(document.URL);
|
611
|
-
let
|
663
|
+
let d = a;
|
612
664
|
if (s == "wechat") {
|
613
665
|
window.open(`https://api.qrserver.com/v1/create-qr-code/?data=${a}&size=250x250`, "share to wechat", "width=300,height=300");
|
614
666
|
return;
|
@@ -616,20 +668,20 @@ D = new WeakSet(), pt = function() {
|
|
616
668
|
if (s == "url") {
|
617
669
|
if (V(".copied-wrapper"))
|
618
670
|
return;
|
619
|
-
document.querySelector("body").insertAdjacentHTML(
|
620
|
-
const
|
621
|
-
n.className &&
|
622
|
-
const
|
623
|
-
if (
|
671
|
+
document.querySelector("body").insertAdjacentHTML(xt.append, `<div class='copied-wrapper'><div class='text'>${n.success ? n.success : ""}</div><input id='clipboard' type='text' readonly></div>`);
|
672
|
+
const u = document.querySelector(".copied-wrapper");
|
673
|
+
n.className && u.classList.add(n.className), u.style.top = this.getBoundingClientRect().top + window.scrollY + "px", u.style.left = this.getBoundingClientRect().left + this.getBoundingClientRect().width / 2 + "px", u.style.display = "block";
|
674
|
+
const i = document.querySelector("#clipboard");
|
675
|
+
if (i.value = n.text ?? window.location.href, i.setSelectionRange(0, 9999), i.select(), document.execCommand("copy")) {
|
624
676
|
document.execCommand("copy");
|
625
|
-
const
|
626
|
-
|
677
|
+
const l = document.querySelector(".copied-wrapper"), c = document.querySelector(".copied-wrapper .text");
|
678
|
+
c.style.display = "block", c.style.opacity = 0;
|
627
679
|
const h = (b, v) => {
|
628
680
|
let y = 0;
|
629
681
|
const $ = 50, L = $ / v, P = setInterval(function() {
|
630
682
|
y += L, b.style.opacity = y, y >= 1 && (clearInterval(P), setTimeout(function() {
|
631
683
|
g(b, 300, function() {
|
632
|
-
|
684
|
+
l.remove();
|
633
685
|
});
|
634
686
|
}, n.duration));
|
635
687
|
}, $);
|
@@ -639,11 +691,11 @@ D = new WeakSet(), pt = function() {
|
|
639
691
|
$ -= P, b.style.opacity = $, $ <= 0 && (clearInterval(gt), b.style.display = "none", y && y());
|
640
692
|
}, L);
|
641
693
|
};
|
642
|
-
h(
|
694
|
+
h(c, 300);
|
643
695
|
}
|
644
696
|
return;
|
645
697
|
}
|
646
|
-
|
698
|
+
d = `${d}${o.source ? `?utm_source=${o.source}` : ""}${o.medium ? `&utm_medium${o.medium}` : ""}${o.campaign ? `&utm_campaign${o.campaign}` : ""}`, d = d.replace("?", "%3F").replace(new RegExp("&", "g"), "%26"), s == "line" ? window.open(`${Z(s)}${a}`) : window.open(`${Z(s)}${d}"e=${d}`), this.removeEventListener("click", t), setTimeout(() => {
|
647
699
|
this.addEventListener("click", t);
|
648
700
|
}, 100);
|
649
701
|
};
|