@slidejs/runner-swiper 0.1.3 → 0.1.4
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/.turbo/turbo-build.log +6 -20
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.mjs +415 -405
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/adapter.ts +4 -2
- package/src/index.ts +2 -2
- package/src/runner.ts +25 -4
- package/src/types.ts +7 -8
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Swiper as
|
|
1
|
+
import { Swiper as $ } from "swiper";
|
|
2
2
|
import { parseSlideDSL as U, compile as V } from "@slidejs/dsl";
|
|
3
3
|
import { SlideRunner as K } from "@slidejs/runner";
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function I(a) {
|
|
5
|
+
return a !== null && typeof a == "object" && "constructor" in a && a.constructor === Object;
|
|
6
6
|
}
|
|
7
|
-
function G(
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
Object.keys(e).filter((
|
|
11
|
-
typeof
|
|
7
|
+
function G(a, e) {
|
|
8
|
+
a === void 0 && (a = {}), e === void 0 && (e = {});
|
|
9
|
+
const r = ["__proto__", "constructor", "prototype"];
|
|
10
|
+
Object.keys(e).filter((t) => r.indexOf(t) < 0).forEach((t) => {
|
|
11
|
+
typeof a[t] > "u" ? a[t] = e[t] : I(e[t]) && I(a[t]) && Object.keys(e[t]).length > 0 && G(a[t], e[t]);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const F = {
|
|
15
15
|
body: {},
|
|
16
16
|
addEventListener() {
|
|
17
17
|
},
|
|
@@ -67,11 +67,11 @@ const $ = {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
function W() {
|
|
70
|
-
const
|
|
71
|
-
return G(
|
|
70
|
+
const a = typeof document < "u" ? document : {};
|
|
71
|
+
return G(a, F), a;
|
|
72
72
|
}
|
|
73
73
|
const J = {
|
|
74
|
-
document:
|
|
74
|
+
document: F,
|
|
75
75
|
navigator: {
|
|
76
76
|
userAgent: ""
|
|
77
77
|
},
|
|
@@ -121,142 +121,142 @@ const J = {
|
|
|
121
121
|
matchMedia() {
|
|
122
122
|
return {};
|
|
123
123
|
},
|
|
124
|
-
requestAnimationFrame(
|
|
125
|
-
return typeof setTimeout > "u" ? (
|
|
124
|
+
requestAnimationFrame(a) {
|
|
125
|
+
return typeof setTimeout > "u" ? (a(), null) : setTimeout(a, 0);
|
|
126
126
|
},
|
|
127
|
-
cancelAnimationFrame(
|
|
128
|
-
typeof setTimeout > "u" || clearTimeout(
|
|
127
|
+
cancelAnimationFrame(a) {
|
|
128
|
+
typeof setTimeout > "u" || clearTimeout(a);
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
function H() {
|
|
132
|
-
const
|
|
133
|
-
return G(
|
|
132
|
+
const a = typeof window < "u" ? window : {};
|
|
133
|
+
return G(a, J), a;
|
|
134
134
|
}
|
|
135
|
-
function X(
|
|
136
|
-
return
|
|
135
|
+
function X(a) {
|
|
136
|
+
return a === void 0 && (a = ""), a.trim().split(" ").filter((e) => !!e.trim());
|
|
137
137
|
}
|
|
138
|
-
function _(
|
|
138
|
+
function _(a, e) {
|
|
139
139
|
e === void 0 && (e = "");
|
|
140
|
-
const
|
|
141
|
-
return
|
|
140
|
+
const r = H(), t = [...a.children];
|
|
141
|
+
return r.HTMLSlotElement && a instanceof HTMLSlotElement && t.push(...a.assignedElements()), e ? t.filter((l) => l.matches(e)) : t;
|
|
142
142
|
}
|
|
143
|
-
function ee(
|
|
143
|
+
function ee(a, e) {
|
|
144
144
|
e === void 0 && (e = []);
|
|
145
|
-
const
|
|
146
|
-
return
|
|
145
|
+
const r = document.createElement(a);
|
|
146
|
+
return r.classList.add(...Array.isArray(e) ? e : X(e)), r;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const e = H(),
|
|
148
|
+
function ie(a) {
|
|
149
|
+
const e = H(), r = W(), t = a.getBoundingClientRect(), l = r.body, s = a.clientTop || l.clientTop || 0, y = a.clientLeft || l.clientLeft || 0, h = a === e ? e.scrollY : a.scrollTop, g = a === e ? e.scrollX : a.scrollLeft;
|
|
150
150
|
return {
|
|
151
|
-
top:
|
|
152
|
-
left:
|
|
151
|
+
top: t.top + h - s,
|
|
152
|
+
left: t.left + g - y
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
let e =
|
|
155
|
+
function T(a) {
|
|
156
|
+
let e = a, r;
|
|
157
157
|
if (e) {
|
|
158
|
-
for (
|
|
159
|
-
e.nodeType === 1 && (
|
|
160
|
-
return
|
|
158
|
+
for (r = 0; (e = e.previousSibling) !== null; )
|
|
159
|
+
e.nodeType === 1 && (r += 1);
|
|
160
|
+
return r;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function N(
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
for (;
|
|
167
|
-
e ?
|
|
168
|
-
return
|
|
163
|
+
function N(a, e) {
|
|
164
|
+
const r = [];
|
|
165
|
+
let t = a.parentElement;
|
|
166
|
+
for (; t; )
|
|
167
|
+
e ? t.matches(e) && r.push(t) : r.push(t), t = t.parentElement;
|
|
168
|
+
return r;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
const
|
|
172
|
-
return
|
|
170
|
+
function te(a, e, r) {
|
|
171
|
+
const t = H();
|
|
172
|
+
return a[e === "width" ? "offsetWidth" : "offsetHeight"] + parseFloat(t.getComputedStyle(a, null).getPropertyValue(e === "width" ? "margin-right" : "margin-top")) + parseFloat(t.getComputedStyle(a, null).getPropertyValue(e === "width" ? "margin-left" : "margin-bottom"));
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return (Array.isArray(
|
|
174
|
+
function E(a) {
|
|
175
|
+
return (Array.isArray(a) ? a : [a]).filter((e) => !!e);
|
|
176
176
|
}
|
|
177
|
-
function O(
|
|
178
|
-
e === void 0 && (e = ""), typeof trustedTypes < "u" ?
|
|
179
|
-
createHTML: (
|
|
180
|
-
}).createHTML(e) :
|
|
177
|
+
function O(a, e) {
|
|
178
|
+
e === void 0 && (e = ""), typeof trustedTypes < "u" ? a.innerHTML = trustedTypes.createPolicy("html", {
|
|
179
|
+
createHTML: (r) => r
|
|
180
|
+
}).createHTML(e) : a.innerHTML = e;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function q(a) {
|
|
183
183
|
let {
|
|
184
184
|
swiper: e,
|
|
185
|
-
extendParams:
|
|
186
|
-
on:
|
|
185
|
+
extendParams: r,
|
|
186
|
+
on: t,
|
|
187
187
|
emit: l
|
|
188
|
-
} =
|
|
189
|
-
const
|
|
188
|
+
} = a;
|
|
189
|
+
const s = W(), y = H();
|
|
190
190
|
e.keyboard = {
|
|
191
191
|
enabled: !1
|
|
192
|
-
},
|
|
192
|
+
}, r({
|
|
193
193
|
keyboard: {
|
|
194
194
|
enabled: !1,
|
|
195
195
|
onlyInViewport: !0,
|
|
196
196
|
pageUpDown: !0
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
|
-
function
|
|
199
|
+
function h(S) {
|
|
200
200
|
if (!e.enabled) return;
|
|
201
201
|
const {
|
|
202
|
-
rtlTranslate:
|
|
202
|
+
rtlTranslate: L
|
|
203
203
|
} = e;
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
if (!e.allowSlideNext && (e.isHorizontal() &&
|
|
204
|
+
let m = S;
|
|
205
|
+
m.originalEvent && (m = m.originalEvent);
|
|
206
|
+
const w = m.keyCode || m.charCode, c = e.params.keyboard.pageUpDown, p = c && w === 33, u = c && w === 34, f = w === 37, i = w === 39, n = w === 38, o = w === 40;
|
|
207
|
+
if (!e.allowSlideNext && (e.isHorizontal() && i || e.isVertical() && o || u) || !e.allowSlidePrev && (e.isHorizontal() && f || e.isVertical() && n || p))
|
|
208
208
|
return !1;
|
|
209
|
-
if (!(
|
|
210
|
-
if (e.params.keyboard.onlyInViewport && (p || u ||
|
|
211
|
-
let
|
|
209
|
+
if (!(m.shiftKey || m.altKey || m.ctrlKey || m.metaKey) && !(s.activeElement && (s.activeElement.isContentEditable || s.activeElement.nodeName && (s.activeElement.nodeName.toLowerCase() === "input" || s.activeElement.nodeName.toLowerCase() === "textarea")))) {
|
|
210
|
+
if (e.params.keyboard.onlyInViewport && (p || u || f || i || n || o)) {
|
|
211
|
+
let d = !1;
|
|
212
212
|
if (N(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && N(e.el, `.${e.params.slideActiveClass}`).length === 0)
|
|
213
213
|
return;
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
const D = [[
|
|
214
|
+
const x = e.el, M = x.clientWidth, Y = x.clientHeight, b = y.innerWidth, z = y.innerHeight, A = ie(x);
|
|
215
|
+
L && (A.left -= x.scrollLeft);
|
|
216
|
+
const D = [[A.left, A.top], [A.left + M, A.top], [A.left, A.top + Y], [A.left + M, A.top + Y]];
|
|
217
217
|
for (let C = 0; C < D.length; C += 1) {
|
|
218
|
-
const
|
|
219
|
-
if (
|
|
220
|
-
if (
|
|
221
|
-
|
|
218
|
+
const v = D[C];
|
|
219
|
+
if (v[0] >= 0 && v[0] <= b && v[1] >= 0 && v[1] <= z) {
|
|
220
|
+
if (v[0] === 0 && v[1] === 0) continue;
|
|
221
|
+
d = !0;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
if (!
|
|
224
|
+
if (!d) return;
|
|
225
225
|
}
|
|
226
|
-
e.isHorizontal() ? ((p || u ||
|
|
226
|
+
e.isHorizontal() ? ((p || u || f || i) && (m.preventDefault ? m.preventDefault() : m.returnValue = !1), ((u || i) && !L || (p || f) && L) && e.slideNext(), ((p || f) && !L || (u || i) && L) && e.slidePrev()) : ((p || u || n || o) && (m.preventDefault ? m.preventDefault() : m.returnValue = !1), (u || o) && e.slideNext(), (p || n) && e.slidePrev()), l("keyPress", w);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
e.keyboard.enabled || (
|
|
229
|
+
function g() {
|
|
230
|
+
e.keyboard.enabled || (s.addEventListener("keydown", h), e.keyboard.enabled = !0);
|
|
231
231
|
}
|
|
232
232
|
function k() {
|
|
233
|
-
e.keyboard.enabled && (
|
|
233
|
+
e.keyboard.enabled && (s.removeEventListener("keydown", h), e.keyboard.enabled = !1);
|
|
234
234
|
}
|
|
235
|
-
|
|
236
|
-
e.params.keyboard.enabled &&
|
|
237
|
-
}),
|
|
235
|
+
t("init", () => {
|
|
236
|
+
e.params.keyboard.enabled && g();
|
|
237
|
+
}), t("destroy", () => {
|
|
238
238
|
e.keyboard.enabled && k();
|
|
239
239
|
}), Object.assign(e.keyboard, {
|
|
240
|
-
enable:
|
|
240
|
+
enable: g,
|
|
241
241
|
disable: k
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
return
|
|
246
|
-
if (!
|
|
247
|
-
let
|
|
248
|
-
|
|
244
|
+
function Q(a, e, r, t) {
|
|
245
|
+
return a.params.createElements && Object.keys(t).forEach((l) => {
|
|
246
|
+
if (!r[l] && r.auto === !0) {
|
|
247
|
+
let s = _(a.el, `.${t[l]}`)[0];
|
|
248
|
+
s || (s = ee("div", t[l]), s.className = t[l], a.el.append(s)), r[l] = s, e[l] = s;
|
|
249
249
|
}
|
|
250
|
-
}),
|
|
250
|
+
}), r;
|
|
251
251
|
}
|
|
252
|
-
function R(
|
|
252
|
+
function R(a) {
|
|
253
253
|
let {
|
|
254
254
|
swiper: e,
|
|
255
|
-
extendParams:
|
|
256
|
-
on:
|
|
255
|
+
extendParams: r,
|
|
256
|
+
on: t,
|
|
257
257
|
emit: l
|
|
258
|
-
} =
|
|
259
|
-
|
|
258
|
+
} = a;
|
|
259
|
+
r({
|
|
260
260
|
navigation: {
|
|
261
261
|
nextEl: null,
|
|
262
262
|
prevEl: null,
|
|
@@ -270,119 +270,119 @@ function R(s) {
|
|
|
270
270
|
nextEl: null,
|
|
271
271
|
prevEl: null
|
|
272
272
|
};
|
|
273
|
-
function
|
|
273
|
+
function s(c) {
|
|
274
274
|
let p;
|
|
275
|
-
return
|
|
275
|
+
return c && typeof c == "string" && e.isElement && (p = e.el.querySelector(c) || e.hostEl.querySelector(c), p) ? p : (c && (typeof c == "string" && (p = [...document.querySelectorAll(c)]), e.params.uniqueNavElements && typeof c == "string" && p && p.length > 1 && e.el.querySelectorAll(c).length === 1 ? p = e.el.querySelector(c) : p && p.length === 1 && (p = p[0])), c && !p ? c : p);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function y(c, p) {
|
|
278
278
|
const u = e.params.navigation;
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
c = E(c), c.forEach((f) => {
|
|
280
|
+
f && (f.classList[p ? "add" : "remove"](...u.disabledClass.split(" ")), f.tagName === "BUTTON" && (f.disabled = p), e.params.watchOverflow && e.enabled && f.classList[e.isLocked ? "add" : "remove"](u.lockClass));
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function h() {
|
|
284
284
|
const {
|
|
285
|
-
nextEl:
|
|
285
|
+
nextEl: c,
|
|
286
286
|
prevEl: p
|
|
287
287
|
} = e.navigation;
|
|
288
288
|
if (e.params.loop) {
|
|
289
|
-
|
|
289
|
+
y(p, !1), y(c, !1);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
y(p, e.isBeginning && !e.params.rewind), y(c, e.isEnd && !e.params.rewind);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
|
|
294
|
+
function g(c) {
|
|
295
|
+
c.preventDefault(), !(e.isBeginning && !e.params.loop && !e.params.rewind) && (e.slidePrev(), l("navigationPrev"));
|
|
296
296
|
}
|
|
297
|
-
function k(
|
|
298
|
-
|
|
297
|
+
function k(c) {
|
|
298
|
+
c.preventDefault(), !(e.isEnd && !e.params.loop && !e.params.rewind) && (e.slideNext(), l("navigationNext"));
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
const
|
|
302
|
-
if (e.params.navigation =
|
|
300
|
+
function S() {
|
|
301
|
+
const c = e.params.navigation;
|
|
302
|
+
if (e.params.navigation = Q(e, e.originalParams.navigation, e.params.navigation, {
|
|
303
303
|
nextEl: "swiper-button-next",
|
|
304
304
|
prevEl: "swiper-button-prev"
|
|
305
|
-
}), !(
|
|
306
|
-
let p =
|
|
305
|
+
}), !(c.nextEl || c.prevEl)) return;
|
|
306
|
+
let p = s(c.nextEl), u = s(c.prevEl);
|
|
307
307
|
Object.assign(e.navigation, {
|
|
308
308
|
nextEl: p,
|
|
309
309
|
prevEl: u
|
|
310
|
-
}), p =
|
|
311
|
-
const
|
|
312
|
-
|
|
310
|
+
}), p = E(p), u = E(u);
|
|
311
|
+
const f = (i, n) => {
|
|
312
|
+
i && i.addEventListener("click", n === "next" ? k : g), !e.enabled && i && i.classList.add(...c.lockClass.split(" "));
|
|
313
313
|
};
|
|
314
|
-
p.forEach((
|
|
314
|
+
p.forEach((i) => f(i, "next")), u.forEach((i) => f(i, "prev"));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function L() {
|
|
317
317
|
let {
|
|
318
|
-
nextEl:
|
|
318
|
+
nextEl: c,
|
|
319
319
|
prevEl: p
|
|
320
320
|
} = e.navigation;
|
|
321
|
-
|
|
322
|
-
const u = (
|
|
323
|
-
|
|
321
|
+
c = E(c), p = E(p);
|
|
322
|
+
const u = (f, i) => {
|
|
323
|
+
f.removeEventListener("click", i === "next" ? k : g), f.classList.remove(...e.params.navigation.disabledClass.split(" "));
|
|
324
324
|
};
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
e.params.navigation.enabled === !1 ?
|
|
329
|
-
}),
|
|
330
|
-
|
|
331
|
-
}),
|
|
332
|
-
|
|
333
|
-
}),
|
|
325
|
+
c.forEach((f) => u(f, "next")), p.forEach((f) => u(f, "prev"));
|
|
326
|
+
}
|
|
327
|
+
t("init", () => {
|
|
328
|
+
e.params.navigation.enabled === !1 ? w() : (S(), h());
|
|
329
|
+
}), t("toEdge fromEdge lock unlock", () => {
|
|
330
|
+
h();
|
|
331
|
+
}), t("destroy", () => {
|
|
332
|
+
L();
|
|
333
|
+
}), t("enable disable", () => {
|
|
334
334
|
let {
|
|
335
|
-
nextEl:
|
|
335
|
+
nextEl: c,
|
|
336
336
|
prevEl: p
|
|
337
337
|
} = e.navigation;
|
|
338
|
-
if (
|
|
339
|
-
|
|
338
|
+
if (c = E(c), p = E(p), e.enabled) {
|
|
339
|
+
h();
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
[...
|
|
343
|
-
}),
|
|
342
|
+
[...c, ...p].filter((u) => !!u).forEach((u) => u.classList.add(e.params.navigation.lockClass));
|
|
343
|
+
}), t("click", (c, p) => {
|
|
344
344
|
let {
|
|
345
345
|
nextEl: u,
|
|
346
|
-
prevEl:
|
|
346
|
+
prevEl: f
|
|
347
347
|
} = e.navigation;
|
|
348
|
-
u =
|
|
349
|
-
const
|
|
350
|
-
let
|
|
351
|
-
if (e.isElement && !
|
|
348
|
+
u = E(u), f = E(f);
|
|
349
|
+
const i = p.target;
|
|
350
|
+
let n = f.includes(i) || u.includes(i);
|
|
351
|
+
if (e.isElement && !n) {
|
|
352
352
|
const o = p.path || p.composedPath && p.composedPath();
|
|
353
|
-
o && (
|
|
353
|
+
o && (n = o.find((d) => u.includes(d) || f.includes(d)));
|
|
354
354
|
}
|
|
355
|
-
if (e.params.navigation.hideOnClick && !
|
|
356
|
-
if (e.pagination && e.params.pagination && e.params.pagination.clickable && (e.pagination.el ===
|
|
355
|
+
if (e.params.navigation.hideOnClick && !n) {
|
|
356
|
+
if (e.pagination && e.params.pagination && e.params.pagination.clickable && (e.pagination.el === i || e.pagination.el.contains(i))) return;
|
|
357
357
|
let o;
|
|
358
|
-
u.length ? o = u[0].classList.contains(e.params.navigation.hiddenClass) :
|
|
358
|
+
u.length ? o = u[0].classList.contains(e.params.navigation.hiddenClass) : f.length && (o = f[0].classList.contains(e.params.navigation.hiddenClass)), l(o === !0 ? "navigationShow" : "navigationHide"), [...u, ...f].filter((d) => !!d).forEach((d) => d.classList.toggle(e.params.navigation.hiddenClass));
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
|
-
const
|
|
362
|
-
e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),
|
|
363
|
-
},
|
|
364
|
-
e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),
|
|
361
|
+
const m = () => {
|
|
362
|
+
e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")), S(), h();
|
|
363
|
+
}, w = () => {
|
|
364
|
+
e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")), L();
|
|
365
365
|
};
|
|
366
366
|
Object.assign(e.navigation, {
|
|
367
|
-
enable:
|
|
368
|
-
disable:
|
|
369
|
-
update:
|
|
370
|
-
init:
|
|
371
|
-
destroy:
|
|
367
|
+
enable: m,
|
|
368
|
+
disable: w,
|
|
369
|
+
update: h,
|
|
370
|
+
init: S,
|
|
371
|
+
destroy: L
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
374
|
+
function P(a) {
|
|
375
|
+
return a === void 0 && (a = ""), `.${a.trim().replace(/([\.:!+\/()[\]])/g, "\\$1").replace(/ /g, ".")}`;
|
|
376
376
|
}
|
|
377
|
-
function Z(
|
|
377
|
+
function Z(a) {
|
|
378
378
|
let {
|
|
379
379
|
swiper: e,
|
|
380
|
-
extendParams:
|
|
381
|
-
on:
|
|
380
|
+
extendParams: r,
|
|
381
|
+
on: t,
|
|
382
382
|
emit: l
|
|
383
|
-
} =
|
|
384
|
-
const
|
|
385
|
-
|
|
383
|
+
} = a;
|
|
384
|
+
const s = "swiper-pagination";
|
|
385
|
+
r({
|
|
386
386
|
pagination: {
|
|
387
387
|
el: null,
|
|
388
388
|
bulletElement: "span",
|
|
@@ -397,206 +397,206 @@ function Z(s) {
|
|
|
397
397
|
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
|
398
398
|
dynamicBullets: !1,
|
|
399
399
|
dynamicMainBullets: 1,
|
|
400
|
-
formatFractionCurrent: (
|
|
401
|
-
formatFractionTotal: (
|
|
402
|
-
bulletClass: `${
|
|
403
|
-
bulletActiveClass: `${
|
|
404
|
-
modifierClass: `${
|
|
405
|
-
currentClass: `${
|
|
406
|
-
totalClass: `${
|
|
407
|
-
hiddenClass: `${
|
|
408
|
-
progressbarFillClass: `${
|
|
409
|
-
progressbarOppositeClass: `${
|
|
410
|
-
clickableClass: `${
|
|
411
|
-
lockClass: `${
|
|
412
|
-
horizontalClass: `${
|
|
413
|
-
verticalClass: `${
|
|
414
|
-
paginationDisabledClass: `${
|
|
400
|
+
formatFractionCurrent: (i) => i,
|
|
401
|
+
formatFractionTotal: (i) => i,
|
|
402
|
+
bulletClass: `${s}-bullet`,
|
|
403
|
+
bulletActiveClass: `${s}-bullet-active`,
|
|
404
|
+
modifierClass: `${s}-`,
|
|
405
|
+
currentClass: `${s}-current`,
|
|
406
|
+
totalClass: `${s}-total`,
|
|
407
|
+
hiddenClass: `${s}-hidden`,
|
|
408
|
+
progressbarFillClass: `${s}-progressbar-fill`,
|
|
409
|
+
progressbarOppositeClass: `${s}-progressbar-opposite`,
|
|
410
|
+
clickableClass: `${s}-clickable`,
|
|
411
|
+
lockClass: `${s}-lock`,
|
|
412
|
+
horizontalClass: `${s}-horizontal`,
|
|
413
|
+
verticalClass: `${s}-vertical`,
|
|
414
|
+
paginationDisabledClass: `${s}-disabled`
|
|
415
415
|
}
|
|
416
416
|
}), e.pagination = {
|
|
417
417
|
el: null,
|
|
418
418
|
bullets: []
|
|
419
419
|
};
|
|
420
|
-
let
|
|
421
|
-
function
|
|
420
|
+
let y, h = 0;
|
|
421
|
+
function g() {
|
|
422
422
|
return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
|
|
423
423
|
}
|
|
424
|
-
function k(
|
|
424
|
+
function k(i, n) {
|
|
425
425
|
const {
|
|
426
426
|
bulletActiveClass: o
|
|
427
427
|
} = e.params.pagination;
|
|
428
|
-
|
|
428
|
+
i && (i = i[`${n === "prev" ? "previous" : "next"}ElementSibling`], i && (i.classList.add(`${o}-${n}`), i = i[`${n === "prev" ? "previous" : "next"}ElementSibling`], i && i.classList.add(`${o}-${n}-${n}`)));
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
if (
|
|
430
|
+
function S(i, n, o) {
|
|
431
|
+
if (i = i % o, n = n % o, n === i + 1)
|
|
432
432
|
return "next";
|
|
433
|
-
if (
|
|
433
|
+
if (n === i - 1)
|
|
434
434
|
return "previous";
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
const
|
|
438
|
-
if (!
|
|
436
|
+
function L(i) {
|
|
437
|
+
const n = i.target.closest(P(e.params.pagination.bulletClass));
|
|
438
|
+
if (!n)
|
|
439
439
|
return;
|
|
440
|
-
|
|
441
|
-
const o =
|
|
440
|
+
i.preventDefault();
|
|
441
|
+
const o = T(n) * e.params.slidesPerGroup;
|
|
442
442
|
if (e.params.loop) {
|
|
443
443
|
if (e.realIndex === o) return;
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const d = S(e.realIndex, o, e.slides.length);
|
|
445
|
+
d === "next" ? e.slideNext() : d === "previous" ? e.slidePrev() : e.slideToLoop(o);
|
|
446
446
|
} else
|
|
447
447
|
e.slideTo(o);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
const
|
|
451
|
-
if (
|
|
449
|
+
function m() {
|
|
450
|
+
const i = e.rtl, n = e.params.pagination;
|
|
451
|
+
if (g()) return;
|
|
452
452
|
let o = e.pagination.el;
|
|
453
|
-
o =
|
|
454
|
-
let
|
|
455
|
-
const
|
|
456
|
-
if (e.params.loop ? (
|
|
453
|
+
o = E(o);
|
|
454
|
+
let d, x;
|
|
455
|
+
const M = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, Y = e.params.loop ? Math.ceil(M / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
456
|
+
if (e.params.loop ? (x = e.previousRealIndex || 0, d = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (d = e.snapIndex, x = e.previousSnapIndex) : (x = e.previousIndex || 0, d = e.activeIndex || 0), n.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
|
|
457
457
|
const b = e.pagination.bullets;
|
|
458
|
-
let
|
|
459
|
-
if (
|
|
460
|
-
C.style[e.isHorizontal() ? "width" : "height"] = `${
|
|
461
|
-
}),
|
|
462
|
-
const
|
|
463
|
-
C.classList.remove(...
|
|
458
|
+
let z, A, D;
|
|
459
|
+
if (n.dynamicBullets && (y = te(b[0], e.isHorizontal() ? "width" : "height"), o.forEach((C) => {
|
|
460
|
+
C.style[e.isHorizontal() ? "width" : "height"] = `${y * (n.dynamicMainBullets + 4)}px`;
|
|
461
|
+
}), n.dynamicMainBullets > 1 && x !== void 0 && (h += d - (x || 0), h > n.dynamicMainBullets - 1 ? h = n.dynamicMainBullets - 1 : h < 0 && (h = 0)), z = Math.max(d - h, 0), A = z + (Math.min(b.length, n.dynamicMainBullets) - 1), D = (A + z) / 2), b.forEach((C) => {
|
|
462
|
+
const v = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((B) => `${n.bulletActiveClass}${B}`)].map((B) => typeof B == "string" && B.includes(" ") ? B.split(" ") : B).flat();
|
|
463
|
+
C.classList.remove(...v);
|
|
464
464
|
}), o.length > 1)
|
|
465
465
|
b.forEach((C) => {
|
|
466
|
-
const
|
|
467
|
-
|
|
466
|
+
const v = T(C);
|
|
467
|
+
v === d ? C.classList.add(...n.bulletActiveClass.split(" ")) : e.isElement && C.setAttribute("part", "bullet"), n.dynamicBullets && (v >= z && v <= A && C.classList.add(...`${n.bulletActiveClass}-main`.split(" ")), v === z && k(C, "prev"), v === A && k(C, "next"));
|
|
468
468
|
});
|
|
469
469
|
else {
|
|
470
|
-
const C = b[
|
|
471
|
-
if (C && C.classList.add(...
|
|
472
|
-
|
|
473
|
-
}),
|
|
474
|
-
const
|
|
475
|
-
for (let
|
|
476
|
-
b[
|
|
477
|
-
k(
|
|
470
|
+
const C = b[d];
|
|
471
|
+
if (C && C.classList.add(...n.bulletActiveClass.split(" ")), e.isElement && b.forEach((v, B) => {
|
|
472
|
+
v.setAttribute("part", B === d ? "bullet-active" : "bullet");
|
|
473
|
+
}), n.dynamicBullets) {
|
|
474
|
+
const v = b[z], B = b[A];
|
|
475
|
+
for (let j = z; j <= A; j += 1)
|
|
476
|
+
b[j] && b[j].classList.add(...`${n.bulletActiveClass}-main`.split(" "));
|
|
477
|
+
k(v, "prev"), k(B, "next");
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
if (
|
|
481
|
-
const C = Math.min(b.length,
|
|
482
|
-
b.forEach((
|
|
483
|
-
|
|
480
|
+
if (n.dynamicBullets) {
|
|
481
|
+
const C = Math.min(b.length, n.dynamicMainBullets + 4), v = (y * C - y) / 2 - D * y, B = i ? "right" : "left";
|
|
482
|
+
b.forEach((j) => {
|
|
483
|
+
j.style[e.isHorizontal() ? B : "top"] = `${v}px`;
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
o.forEach((b,
|
|
488
|
-
if (
|
|
489
|
-
|
|
490
|
-
}), b.querySelectorAll(
|
|
491
|
-
|
|
492
|
-
})),
|
|
493
|
-
let
|
|
494
|
-
|
|
495
|
-
const D = (
|
|
496
|
-
let C = 1,
|
|
497
|
-
|
|
498
|
-
|
|
487
|
+
o.forEach((b, z) => {
|
|
488
|
+
if (n.type === "fraction" && (b.querySelectorAll(P(n.currentClass)).forEach((A) => {
|
|
489
|
+
A.textContent = n.formatFractionCurrent(d + 1);
|
|
490
|
+
}), b.querySelectorAll(P(n.totalClass)).forEach((A) => {
|
|
491
|
+
A.textContent = n.formatFractionTotal(Y);
|
|
492
|
+
})), n.type === "progressbar") {
|
|
493
|
+
let A;
|
|
494
|
+
n.progressbarOpposite ? A = e.isHorizontal() ? "vertical" : "horizontal" : A = e.isHorizontal() ? "horizontal" : "vertical";
|
|
495
|
+
const D = (d + 1) / Y;
|
|
496
|
+
let C = 1, v = 1;
|
|
497
|
+
A === "horizontal" ? C = D : v = D, b.querySelectorAll(P(n.progressbarFillClass)).forEach((B) => {
|
|
498
|
+
B.style.transform = `translate3d(0,0,0) scaleX(${C}) scaleY(${v})`, B.style.transitionDuration = `${e.params.speed}ms`;
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
|
-
|
|
501
|
+
n.type === "custom" && n.renderCustom ? (O(b, n.renderCustom(e, d + 1, Y)), z === 0 && l("paginationRender", b)) : (z === 0 && l("paginationRender", b), l("paginationUpdate", b)), e.params.watchOverflow && e.enabled && b.classList[e.isLocked ? "add" : "remove"](n.lockClass);
|
|
502
502
|
});
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
504
|
+
function w() {
|
|
505
|
+
const i = e.params.pagination;
|
|
506
|
+
if (g()) return;
|
|
507
|
+
const n = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
|
|
508
508
|
let o = e.pagination.el;
|
|
509
|
-
o =
|
|
510
|
-
let
|
|
511
|
-
if (
|
|
512
|
-
let
|
|
513
|
-
e.params.freeMode && e.params.freeMode.enabled &&
|
|
514
|
-
for (let
|
|
515
|
-
|
|
509
|
+
o = E(o);
|
|
510
|
+
let d = "";
|
|
511
|
+
if (i.type === "bullets") {
|
|
512
|
+
let x = e.params.loop ? Math.ceil(n / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
513
|
+
e.params.freeMode && e.params.freeMode.enabled && x > n && (x = n);
|
|
514
|
+
for (let M = 0; M < x; M += 1)
|
|
515
|
+
i.renderBullet ? d += i.renderBullet.call(e, M, i.bulletClass) : d += `<${i.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${i.bulletClass}"></${i.bulletElement}>`;
|
|
516
516
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}),
|
|
517
|
+
i.type === "fraction" && (i.renderFraction ? d = i.renderFraction.call(e, i.currentClass, i.totalClass) : d = `<span class="${i.currentClass}"></span> / <span class="${i.totalClass}"></span>`), i.type === "progressbar" && (i.renderProgressbar ? d = i.renderProgressbar.call(e, i.progressbarFillClass) : d = `<span class="${i.progressbarFillClass}"></span>`), e.pagination.bullets = [], o.forEach((x) => {
|
|
518
|
+
i.type !== "custom" && O(x, d || ""), i.type === "bullets" && e.pagination.bullets.push(...x.querySelectorAll(P(i.bulletClass)));
|
|
519
|
+
}), i.type !== "custom" && l("paginationRender", o[0]);
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
e.params.pagination =
|
|
521
|
+
function c() {
|
|
522
|
+
e.params.pagination = Q(e, e.originalParams.pagination, e.params.pagination, {
|
|
523
523
|
el: "swiper-pagination"
|
|
524
524
|
});
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
let
|
|
528
|
-
typeof
|
|
529
|
-
el:
|
|
530
|
-
}),
|
|
531
|
-
|
|
525
|
+
const i = e.params.pagination;
|
|
526
|
+
if (!i.el) return;
|
|
527
|
+
let n;
|
|
528
|
+
typeof i.el == "string" && e.isElement && (n = e.el.querySelector(i.el)), !n && typeof i.el == "string" && (n = [...document.querySelectorAll(i.el)]), n || (n = i.el), !(!n || n.length === 0) && (e.params.uniqueNavElements && typeof i.el == "string" && Array.isArray(n) && n.length > 1 && (n = [...e.el.querySelectorAll(i.el)], n.length > 1 && (n = n.find((o) => N(o, ".swiper")[0] === e.el))), Array.isArray(n) && n.length === 1 && (n = n[0]), Object.assign(e.pagination, {
|
|
529
|
+
el: n
|
|
530
|
+
}), n = E(n), n.forEach((o) => {
|
|
531
|
+
i.type === "bullets" && i.clickable && o.classList.add(...(i.clickableClass || "").split(" ")), o.classList.add(i.modifierClass + i.type), o.classList.add(e.isHorizontal() ? i.horizontalClass : i.verticalClass), i.type === "bullets" && i.dynamicBullets && (o.classList.add(`${i.modifierClass}${i.type}-dynamic`), h = 0, i.dynamicMainBullets < 1 && (i.dynamicMainBullets = 1)), i.type === "progressbar" && i.progressbarOpposite && o.classList.add(i.progressbarOppositeClass), i.clickable && o.addEventListener("click", L), e.enabled || o.classList.add(i.lockClass);
|
|
532
532
|
}));
|
|
533
533
|
}
|
|
534
534
|
function p() {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
let
|
|
538
|
-
|
|
539
|
-
o.classList.remove(
|
|
540
|
-
})), e.pagination.bullets && e.pagination.bullets.forEach((o) => o.classList.remove(...
|
|
541
|
-
}
|
|
542
|
-
|
|
535
|
+
const i = e.params.pagination;
|
|
536
|
+
if (g()) return;
|
|
537
|
+
let n = e.pagination.el;
|
|
538
|
+
n && (n = E(n), n.forEach((o) => {
|
|
539
|
+
o.classList.remove(i.hiddenClass), o.classList.remove(i.modifierClass + i.type), o.classList.remove(e.isHorizontal() ? i.horizontalClass : i.verticalClass), i.clickable && (o.classList.remove(...(i.clickableClass || "").split(" ")), o.removeEventListener("click", L));
|
|
540
|
+
})), e.pagination.bullets && e.pagination.bullets.forEach((o) => o.classList.remove(...i.bulletActiveClass.split(" ")));
|
|
541
|
+
}
|
|
542
|
+
t("changeDirection", () => {
|
|
543
543
|
if (!e.pagination || !e.pagination.el) return;
|
|
544
|
-
const
|
|
544
|
+
const i = e.params.pagination;
|
|
545
545
|
let {
|
|
546
|
-
el:
|
|
546
|
+
el: n
|
|
547
547
|
} = e.pagination;
|
|
548
|
-
|
|
549
|
-
o.classList.remove(
|
|
548
|
+
n = E(n), n.forEach((o) => {
|
|
549
|
+
o.classList.remove(i.horizontalClass, i.verticalClass), o.classList.add(e.isHorizontal() ? i.horizontalClass : i.verticalClass);
|
|
550
550
|
});
|
|
551
|
-
}),
|
|
552
|
-
e.params.pagination.enabled === !1 ?
|
|
553
|
-
}),
|
|
554
|
-
typeof e.snapIndex > "u" &&
|
|
555
|
-
}),
|
|
556
|
-
|
|
557
|
-
}),
|
|
558
|
-
|
|
559
|
-
}),
|
|
551
|
+
}), t("init", () => {
|
|
552
|
+
e.params.pagination.enabled === !1 ? f() : (c(), w(), m());
|
|
553
|
+
}), t("activeIndexChange", () => {
|
|
554
|
+
typeof e.snapIndex > "u" && m();
|
|
555
|
+
}), t("snapIndexChange", () => {
|
|
556
|
+
m();
|
|
557
|
+
}), t("snapGridLengthChange", () => {
|
|
558
|
+
w(), m();
|
|
559
|
+
}), t("destroy", () => {
|
|
560
560
|
p();
|
|
561
|
-
}),
|
|
561
|
+
}), t("enable disable", () => {
|
|
562
562
|
let {
|
|
563
|
-
el:
|
|
563
|
+
el: i
|
|
564
564
|
} = e.pagination;
|
|
565
|
-
|
|
566
|
-
}),
|
|
567
|
-
|
|
568
|
-
}),
|
|
569
|
-
const o =
|
|
570
|
-
if (e.params.pagination.el && e.params.pagination.hideOnClick &&
|
|
565
|
+
i && (i = E(i), i.forEach((n) => n.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
|
|
566
|
+
}), t("lock unlock", () => {
|
|
567
|
+
m();
|
|
568
|
+
}), t("click", (i, n) => {
|
|
569
|
+
const o = n.target, d = E(e.pagination.el);
|
|
570
|
+
if (e.params.pagination.el && e.params.pagination.hideOnClick && d && d.length > 0 && !o.classList.contains(e.params.pagination.bulletClass)) {
|
|
571
571
|
if (e.navigation && (e.navigation.nextEl && o === e.navigation.nextEl || e.navigation.prevEl && o === e.navigation.prevEl)) return;
|
|
572
|
-
const
|
|
573
|
-
l(
|
|
572
|
+
const x = d[0].classList.contains(e.params.pagination.hiddenClass);
|
|
573
|
+
l(x === !0 ? "paginationShow" : "paginationHide"), d.forEach((M) => M.classList.toggle(e.params.pagination.hiddenClass));
|
|
574
574
|
}
|
|
575
575
|
});
|
|
576
576
|
const u = () => {
|
|
577
577
|
e.el.classList.remove(e.params.pagination.paginationDisabledClass);
|
|
578
578
|
let {
|
|
579
|
-
el:
|
|
579
|
+
el: i
|
|
580
580
|
} = e.pagination;
|
|
581
|
-
|
|
582
|
-
},
|
|
581
|
+
i && (i = E(i), i.forEach((n) => n.classList.remove(e.params.pagination.paginationDisabledClass))), c(), w(), m();
|
|
582
|
+
}, f = () => {
|
|
583
583
|
e.el.classList.add(e.params.pagination.paginationDisabledClass);
|
|
584
584
|
let {
|
|
585
|
-
el:
|
|
585
|
+
el: i
|
|
586
586
|
} = e.pagination;
|
|
587
|
-
|
|
587
|
+
i && (i = E(i), i.forEach((n) => n.classList.add(e.params.pagination.paginationDisabledClass))), p();
|
|
588
588
|
};
|
|
589
589
|
Object.assign(e.pagination, {
|
|
590
590
|
enable: u,
|
|
591
|
-
disable:
|
|
592
|
-
render:
|
|
593
|
-
update:
|
|
594
|
-
init:
|
|
591
|
+
disable: f,
|
|
592
|
+
render: w,
|
|
593
|
+
update: m,
|
|
594
|
+
init: c,
|
|
595
595
|
destroy: p
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
|
|
599
|
-
class
|
|
598
|
+
$.use([R, Z, q]);
|
|
599
|
+
class ne {
|
|
600
600
|
constructor() {
|
|
601
601
|
this.name = "swiper", this.eventHandlers = /* @__PURE__ */ new Map();
|
|
602
602
|
}
|
|
@@ -606,11 +606,11 @@ class re {
|
|
|
606
606
|
* @param container - 容器元素
|
|
607
607
|
* @param options - Swiper 选项
|
|
608
608
|
*/
|
|
609
|
-
async initialize(e,
|
|
609
|
+
async initialize(e, r) {
|
|
610
610
|
try {
|
|
611
611
|
if (this.createSwiperStructure(e), !this.swiperContainer || !this.swiperWrapper)
|
|
612
612
|
throw new Error("Swiper container not created");
|
|
613
|
-
const
|
|
613
|
+
const t = {
|
|
614
614
|
// 默认配置
|
|
615
615
|
direction: "horizontal",
|
|
616
616
|
loop: !1,
|
|
@@ -618,7 +618,7 @@ class re {
|
|
|
618
618
|
spaceBetween: 30,
|
|
619
619
|
slidesPerView: 1,
|
|
620
620
|
// 注册模块
|
|
621
|
-
modules: [R, Z,
|
|
621
|
+
modules: [R, Z, q],
|
|
622
622
|
// 导航配置
|
|
623
623
|
navigation: {
|
|
624
624
|
nextEl: ".swiper-button-next",
|
|
@@ -634,15 +634,15 @@ class re {
|
|
|
634
634
|
enabled: !0,
|
|
635
635
|
onlyInViewport: !0
|
|
636
636
|
},
|
|
637
|
-
...
|
|
637
|
+
...r?.swiperConfig
|
|
638
638
|
};
|
|
639
|
-
this.swiper = new
|
|
639
|
+
this.swiper = new $(this.swiperContainer, t), await new Promise((l) => {
|
|
640
640
|
requestAnimationFrame(() => {
|
|
641
641
|
l();
|
|
642
642
|
});
|
|
643
643
|
}), this.setupEventListeners(), this.emit("ready");
|
|
644
|
-
} catch (
|
|
645
|
-
const l =
|
|
644
|
+
} catch (t) {
|
|
645
|
+
const l = t instanceof Error ? t.message : String(t);
|
|
646
646
|
throw this.emit("error", { message: l }), new Error(`Failed to initialize SwiperAdapter: ${l}`);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
@@ -656,14 +656,14 @@ class re {
|
|
|
656
656
|
throw new Error("SwiperAdapter not initialized");
|
|
657
657
|
try {
|
|
658
658
|
this.swiperWrapper.innerHTML = "";
|
|
659
|
-
for (const
|
|
660
|
-
const
|
|
661
|
-
this.swiperWrapper.appendChild(
|
|
659
|
+
for (const r of e) {
|
|
660
|
+
const t = await this.renderSlide(r);
|
|
661
|
+
this.swiperWrapper.appendChild(t);
|
|
662
662
|
}
|
|
663
663
|
this.swiper.update(), this.emit("slideRendered", { totalSlides: e.length });
|
|
664
|
-
} catch (
|
|
665
|
-
const
|
|
666
|
-
throw this.emit("error", { message:
|
|
664
|
+
} catch (r) {
|
|
665
|
+
const t = r instanceof Error ? r.message : String(r);
|
|
666
|
+
throw this.emit("error", { message: t }), new Error(`Failed to render slides: ${t}`);
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
@@ -700,17 +700,17 @@ class re {
|
|
|
700
700
|
* @param index - 幻灯片索引
|
|
701
701
|
* @param slide - 新的幻灯片定义
|
|
702
702
|
*/
|
|
703
|
-
async updateSlide(e,
|
|
703
|
+
async updateSlide(e, r) {
|
|
704
704
|
if (!this.swiperWrapper || !this.swiper)
|
|
705
705
|
throw new Error("SwiperAdapter not initialized");
|
|
706
706
|
try {
|
|
707
707
|
const l = this.swiperWrapper.querySelectorAll(".swiper-slide")[e];
|
|
708
708
|
if (!l)
|
|
709
709
|
throw new Error(`Slide at index ${e} not found`);
|
|
710
|
-
const
|
|
711
|
-
l.replaceWith(
|
|
712
|
-
} catch (
|
|
713
|
-
const l =
|
|
710
|
+
const s = await this.renderSlide(r);
|
|
711
|
+
l.replaceWith(s), this.swiper.update();
|
|
712
|
+
} catch (t) {
|
|
713
|
+
const l = t instanceof Error ? t.message : String(t);
|
|
714
714
|
throw this.emit("error", { message: l }), new Error(`Failed to update slide: ${l}`);
|
|
715
715
|
}
|
|
716
716
|
}
|
|
@@ -720,8 +720,8 @@ class re {
|
|
|
720
720
|
* @param event - 事件类型
|
|
721
721
|
* @param handler - 事件处理器
|
|
722
722
|
*/
|
|
723
|
-
on(e,
|
|
724
|
-
this.eventHandlers.has(e) || this.eventHandlers.set(e, /* @__PURE__ */ new Set()), this.eventHandlers.get(e).add(
|
|
723
|
+
on(e, r) {
|
|
724
|
+
this.eventHandlers.has(e) || this.eventHandlers.set(e, /* @__PURE__ */ new Set()), this.eventHandlers.get(e).add(r);
|
|
725
725
|
}
|
|
726
726
|
/**
|
|
727
727
|
* 移除事件监听器
|
|
@@ -729,9 +729,9 @@ class re {
|
|
|
729
729
|
* @param event - 事件类型
|
|
730
730
|
* @param handler - 事件处理器
|
|
731
731
|
*/
|
|
732
|
-
off(e,
|
|
733
|
-
const
|
|
734
|
-
|
|
732
|
+
off(e, r) {
|
|
733
|
+
const t = this.eventHandlers.get(e);
|
|
734
|
+
t && t.delete(r);
|
|
735
735
|
}
|
|
736
736
|
/**
|
|
737
737
|
* 创建 Swiper DOM 结构
|
|
@@ -740,25 +740,25 @@ class re {
|
|
|
740
740
|
*/
|
|
741
741
|
createSwiperStructure(e) {
|
|
742
742
|
e.className = "swiper";
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
const
|
|
746
|
-
|
|
743
|
+
const r = document.createElement("div");
|
|
744
|
+
r.className = "swiper-wrapper";
|
|
745
|
+
const t = document.createElement("div");
|
|
746
|
+
t.className = "swiper-button-prev";
|
|
747
747
|
const l = document.createElement("div");
|
|
748
748
|
l.className = "swiper-button-next";
|
|
749
|
-
const
|
|
750
|
-
|
|
749
|
+
const s = document.createElement("div");
|
|
750
|
+
s.className = "swiper-pagination", e.appendChild(r), e.appendChild(t), e.appendChild(l), e.appendChild(s), this.swiperContainer = e, this.swiperWrapper = r;
|
|
751
751
|
}
|
|
752
752
|
/**
|
|
753
753
|
* 设置 Swiper 事件监听
|
|
754
754
|
*/
|
|
755
755
|
setupEventListeners() {
|
|
756
756
|
this.swiper && this.swiper.on("slideChange", () => {
|
|
757
|
-
const e = this.swiper.activeIndex,
|
|
757
|
+
const e = this.swiper.activeIndex, r = this.swiper.previousIndex;
|
|
758
758
|
this.emit("slideChanged", {
|
|
759
759
|
index: e,
|
|
760
|
-
previousIndex:
|
|
761
|
-
from:
|
|
760
|
+
previousIndex: r,
|
|
761
|
+
from: r,
|
|
762
762
|
to: e
|
|
763
763
|
});
|
|
764
764
|
});
|
|
@@ -770,19 +770,19 @@ class re {
|
|
|
770
770
|
* @returns slide 元素
|
|
771
771
|
*/
|
|
772
772
|
async renderSlide(e) {
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
775
|
-
const
|
|
776
|
-
|
|
773
|
+
const r = document.createElement("div");
|
|
774
|
+
if (r.className = "swiper-slide", e.behavior?.transition) {
|
|
775
|
+
const t = this.mapTransition(e.behavior.transition.type);
|
|
776
|
+
t && r.classList.add(`slide-transition-${t}`);
|
|
777
777
|
}
|
|
778
778
|
if (e.content.type === "dynamic") {
|
|
779
|
-
const
|
|
780
|
-
|
|
779
|
+
const t = await this.renderDynamicContent(e.content.component, e.content.props);
|
|
780
|
+
r.appendChild(t);
|
|
781
781
|
} else {
|
|
782
|
-
const
|
|
783
|
-
|
|
782
|
+
const t = this.renderTextContent(e.content.lines);
|
|
783
|
+
r.appendChild(t);
|
|
784
784
|
}
|
|
785
|
-
return
|
|
785
|
+
return r;
|
|
786
786
|
}
|
|
787
787
|
/**
|
|
788
788
|
* 渲染动态内容(Web Component)
|
|
@@ -796,11 +796,11 @@ class re {
|
|
|
796
796
|
* @param props - 组件属性
|
|
797
797
|
* @returns 组件元素
|
|
798
798
|
*/
|
|
799
|
-
async renderDynamicContent(e,
|
|
800
|
-
const
|
|
801
|
-
for (const [l,
|
|
802
|
-
typeof
|
|
803
|
-
return
|
|
799
|
+
async renderDynamicContent(e, r) {
|
|
800
|
+
const t = document.createElement(e);
|
|
801
|
+
for (const [l, s] of Object.entries(r))
|
|
802
|
+
typeof s == "string" || typeof s == "number" ? t.setAttribute(l, String(s)) : typeof s == "boolean" ? s && t.setAttribute(l, "") : t[l] = s;
|
|
803
|
+
return t;
|
|
804
804
|
}
|
|
805
805
|
/**
|
|
806
806
|
* 渲染文本内容
|
|
@@ -817,51 +817,51 @@ class re {
|
|
|
817
817
|
* @returns 内容容器元素
|
|
818
818
|
*/
|
|
819
819
|
renderTextContent(e) {
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
let
|
|
820
|
+
const r = document.createElement("div");
|
|
821
|
+
r.className = "slide-content";
|
|
822
|
+
let t = null;
|
|
823
823
|
for (const l of e) {
|
|
824
|
-
const
|
|
825
|
-
if (!
|
|
826
|
-
|
|
824
|
+
const s = l.trim();
|
|
825
|
+
if (!s) {
|
|
826
|
+
t = null;
|
|
827
827
|
continue;
|
|
828
828
|
}
|
|
829
|
-
if (
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
|
|
829
|
+
if (s.startsWith("# ")) {
|
|
830
|
+
t = null;
|
|
831
|
+
const g = document.createElement("h1");
|
|
832
|
+
g.textContent = s.substring(2), r.appendChild(g);
|
|
833
833
|
continue;
|
|
834
834
|
}
|
|
835
|
-
if (
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
|
|
835
|
+
if (s.startsWith("## ")) {
|
|
836
|
+
t = null;
|
|
837
|
+
const g = document.createElement("h2");
|
|
838
|
+
g.textContent = s.substring(3), r.appendChild(g);
|
|
839
839
|
continue;
|
|
840
840
|
}
|
|
841
|
-
if (
|
|
842
|
-
|
|
843
|
-
const
|
|
844
|
-
|
|
841
|
+
if (s.startsWith("### ")) {
|
|
842
|
+
t = null;
|
|
843
|
+
const g = document.createElement("h3");
|
|
844
|
+
g.textContent = s.substring(4), r.appendChild(g);
|
|
845
845
|
continue;
|
|
846
846
|
}
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
849
|
-
|
|
850
|
-
const
|
|
851
|
-
|
|
847
|
+
const y = s.match(/^!\[(.*?)\]\((.*?)\)$/);
|
|
848
|
+
if (y) {
|
|
849
|
+
t = null;
|
|
850
|
+
const g = document.createElement("img");
|
|
851
|
+
g.alt = y[1], g.src = y[2], g.style.maxWidth = "80%", g.style.maxHeight = "500px", r.appendChild(g);
|
|
852
852
|
continue;
|
|
853
853
|
}
|
|
854
|
-
if (
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
|
|
854
|
+
if (s.startsWith("- ")) {
|
|
855
|
+
t || (t = document.createElement("ul"), r.appendChild(t));
|
|
856
|
+
const g = document.createElement("li");
|
|
857
|
+
g.textContent = s.substring(2), t.appendChild(g);
|
|
858
858
|
continue;
|
|
859
859
|
}
|
|
860
|
-
|
|
861
|
-
const
|
|
862
|
-
|
|
860
|
+
t = null;
|
|
861
|
+
const h = document.createElement("p");
|
|
862
|
+
h.textContent = s, r.appendChild(h);
|
|
863
863
|
}
|
|
864
|
-
return
|
|
864
|
+
return r;
|
|
865
865
|
}
|
|
866
866
|
/**
|
|
867
867
|
* 映射 Slide DSL 过渡效果到 Swiper 过渡效果
|
|
@@ -878,50 +878,60 @@ class re {
|
|
|
878
878
|
* @param event - 事件类型
|
|
879
879
|
* @param data - 事件数据
|
|
880
880
|
*/
|
|
881
|
-
emit(e,
|
|
882
|
-
const
|
|
883
|
-
if (
|
|
884
|
-
for (const l of
|
|
881
|
+
emit(e, r) {
|
|
882
|
+
const t = this.eventHandlers.get(e);
|
|
883
|
+
if (t)
|
|
884
|
+
for (const l of t)
|
|
885
885
|
try {
|
|
886
|
-
l(
|
|
887
|
-
} catch (
|
|
888
|
-
console.error(`Error in ${e} handler:`,
|
|
886
|
+
l(r);
|
|
887
|
+
} catch (s) {
|
|
888
|
+
console.error(`Error in ${e} handler:`, s);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
|
-
const ne = '@font-face{font-family:swiper-icons;src:url(data:application/font-woff;charset=utf-8;base64,\\ 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);font-weight:400;font-style:normal}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}', se = ".swiper{width:100%;height:100%;--slidejs-swiper-navigation-color: var(--slidejs-navigation-color, #007aff);--slidejs-swiper-pagination-color: var(--slidejs-pagination-color, #007aff);--slidejs-swiper-pagination-bullet-active-color: var(--slidejs-pagination-active-color, #007aff);--slidejs-swiper-scrollbar-bg: var(--slidejs-scrollbar-bg, rgba(0, 0, 0, .1));--slidejs-swiper-scrollbar-drag-bg: var(--slidejs-scrollbar-drag-bg, rgba(0, 0, 0, .5));--swiper-navigation-color: var(--slidejs-navigation-color, #007aff);--swiper-pagination-color: var(--slidejs-pagination-color, #007aff);--swiper-pagination-bullet-active-color: var(--slidejs-pagination-active-color, #007aff);--swiper-theme-color: var(--slidejs-navigation-color, #007aff)}.swiper .swiper-button-next,.swiper .swiper-button-prev{color:var(--swiper-navigation-color, var(--slidejs-swiper-navigation-color, #007aff))!important}.swiper .swiper-pagination-bullet{background-color:var( --swiper-pagination-color, var(--slidejs-swiper-pagination-color, #007aff) )!important}.swiper .swiper-pagination-bullet-active{background-color:var( --swiper-pagination-bullet-active-color, var(--slidejs-swiper-pagination-bullet-active-color, #007aff) )!important}.swiper .swiper-scrollbar{background:var(--slidejs-swiper-scrollbar-bg, rgba(0, 0, 0, .1))!important}.swiper .swiper-scrollbar-drag{background:var(--slidejs-swiper-scrollbar-drag-bg, rgba(0, 0, 0, .5))!important}.swiper-slide{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:var(--slidejs-background-color, #fff);padding:2rem;box-sizing:border-box}.slide-content{width:100%;text-align:center}.slide-content h1{font-size:3rem;margin-bottom:1rem;color:var(--slidejs-heading-color, #333)}.slide-content h2{font-size:2rem;margin-bottom:1rem;color:var(--slidejs-heading-color, #666)}.slide-content h3{font-size:1.5rem;margin-bottom:.5rem;color:var(--slidejs-heading-color, #666)}.slide-content p{font-size:1.2rem;line-height:1.6;color:var(--slidejs-text-color, #555);margin-bottom:1rem}.slide-content ul{text-align:left;display:inline-block;font-size:1.2rem;line-height:1.8;color:var(--slidejs-text-color, #555)}.slide-content li{margin-bottom:.5rem}.slide-content img{border-radius:8px;box-shadow:0 4px 12px #0000001a}.swiper-button-next:after,.swiper-button-prev:after{font-size:24px}.swiper-pagination-bullet{opacity:.5}.swiper-pagination-bullet-active{opacity:1}";
|
|
893
|
-
async function
|
|
894
|
-
const
|
|
895
|
-
if (!document.head.querySelector(
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
if (
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
892
|
+
const re = '@font-face{font-family:swiper-icons;src:url(data:application/font-woff;charset=utf-8;base64,\\ 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);font-weight:400;font-style:normal}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}', ae = ':root{--swiper-navigation-size: 44px}.swiper-button-prev,.swiper-button-next{position:absolute;top:var(--swiper-navigation-top-offset, 50%);width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size) / 2));z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none!important}.swiper-button-prev svg,.swiper-button-next svg{width:100%;height:100%;object-fit:contain;transform-origin:center}.swiper-rtl .swiper-button-prev svg,.swiper-rtl .swiper-button-next svg{transform:rotate(180deg)}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:var(--swiper-navigation-sides-offset, 10px);right:auto}.swiper-button-lock{display:none}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:var(--swiper-navigation-sides-offset, 10px);left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}', se = ".swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translateZ(0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-webkit-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;transform:translate3d(0,-50%,0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translate(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, .25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}", oe = ".swiper{width:100%;height:100%;--slidejs-swiper-navigation-color: var(--slidejs-navigation-color, #007aff);--slidejs-swiper-pagination-color: var(--slidejs-pagination-color, #007aff);--slidejs-swiper-pagination-bullet-active-color: var(--slidejs-pagination-active-color, #007aff);--slidejs-swiper-scrollbar-bg: var(--slidejs-scrollbar-bg, rgba(0, 0, 0, .1));--slidejs-swiper-scrollbar-drag-bg: var(--slidejs-scrollbar-drag-bg, rgba(0, 0, 0, .5));--swiper-navigation-color: var(--slidejs-navigation-color, #007aff);--swiper-pagination-color: var(--slidejs-pagination-color, #007aff);--swiper-pagination-bullet-active-color: var(--slidejs-pagination-active-color, #007aff);--swiper-theme-color: var(--slidejs-navigation-color, #007aff)}.swiper .swiper-button-next,.swiper .swiper-button-prev{color:var(--swiper-navigation-color, var(--slidejs-swiper-navigation-color, #007aff))!important}.swiper .swiper-pagination-bullet{background-color:var( --swiper-pagination-color, var(--slidejs-swiper-pagination-color, #007aff) )!important}.swiper .swiper-pagination-bullet-active{background-color:var( --swiper-pagination-bullet-active-color, var(--slidejs-swiper-pagination-bullet-active-color, #007aff) )!important}.swiper .swiper-scrollbar{background:var(--slidejs-swiper-scrollbar-bg, rgba(0, 0, 0, .1))!important}.swiper .swiper-scrollbar-drag{background:var(--slidejs-swiper-scrollbar-drag-bg, rgba(0, 0, 0, .5))!important}.swiper-slide{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:var(--slidejs-background-color, #fff);padding:2rem;box-sizing:border-box}.slide-content{width:100%;text-align:center}.slide-content h1{font-size:3rem;margin-bottom:1rem;color:var(--slidejs-heading-color, #333)}.slide-content h2{font-size:2rem;margin-bottom:1rem;color:var(--slidejs-heading-color, #666)}.slide-content h3{font-size:1.5rem;margin-bottom:.5rem;color:var(--slidejs-heading-color, #666)}.slide-content p{font-size:1.2rem;line-height:1.6;color:var(--slidejs-text-color, #555);margin-bottom:1rem}.slide-content ul{text-align:left;display:inline-block;font-size:1.2rem;line-height:1.8;color:var(--slidejs-text-color, #555)}.slide-content li{margin-bottom:.5rem}.slide-content img{border-radius:8px;box-shadow:0 4px 12px #0000001a}.swiper-button-next:after,.swiper-button-prev:after{font-size:24px}.swiper-pagination-bullet{opacity:.5}.swiper-pagination-bullet-active{opacity:1}";
|
|
893
|
+
async function de(a, e, r) {
|
|
894
|
+
const t = await U(a), l = V(t), s = "swiper-styles";
|
|
895
|
+
if (!document.head.querySelector(`#${s}`)) {
|
|
896
|
+
const w = document.createElement("style");
|
|
897
|
+
w.id = s, w.textContent = re, document.head.appendChild(w);
|
|
898
|
+
}
|
|
899
|
+
const y = "swiper-navigation-styles";
|
|
900
|
+
if (!document.head.querySelector(`#${y}`)) {
|
|
901
|
+
const w = document.createElement("style");
|
|
902
|
+
w.id = y, w.textContent = ae, document.head.appendChild(w);
|
|
903
|
+
}
|
|
904
|
+
const h = "swiper-pagination-styles";
|
|
905
|
+
if (!document.head.querySelector(`#${h}`)) {
|
|
906
|
+
const w = document.createElement("style");
|
|
907
|
+
w.id = h, w.textContent = se, document.head.appendChild(w);
|
|
908
|
+
}
|
|
909
|
+
let g;
|
|
910
|
+
if (typeof r.container == "string") {
|
|
911
|
+
const w = document.querySelector(r.container);
|
|
912
|
+
if (!w)
|
|
913
|
+
throw new Error(`Container not found: ${r.container}`);
|
|
914
|
+
g = w;
|
|
905
915
|
} else
|
|
906
|
-
|
|
907
|
-
const
|
|
908
|
-
if (!
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
}
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
container:
|
|
916
|
-
adapter:
|
|
916
|
+
g = r.container;
|
|
917
|
+
const k = "slidejs-runner-swiper-styles";
|
|
918
|
+
if (!g.querySelector(`#${k}`)) {
|
|
919
|
+
const w = document.createElement("style");
|
|
920
|
+
w.id = k, w.textContent = oe, g.appendChild(w);
|
|
921
|
+
}
|
|
922
|
+
const S = document.createElement("div");
|
|
923
|
+
g.appendChild(S);
|
|
924
|
+
const L = new ne(), m = new K({
|
|
925
|
+
container: S,
|
|
926
|
+
adapter: L,
|
|
917
927
|
adapterOptions: {
|
|
918
|
-
swiperConfig:
|
|
928
|
+
swiperConfig: r.swiperOptions
|
|
919
929
|
}
|
|
920
930
|
});
|
|
921
|
-
return await
|
|
931
|
+
return await m.run(l, e), m;
|
|
922
932
|
}
|
|
923
933
|
export {
|
|
924
|
-
|
|
925
|
-
|
|
934
|
+
ne as SwiperAdapter,
|
|
935
|
+
de as createSlideRunner
|
|
926
936
|
};
|
|
927
937
|
//# sourceMappingURL=index.mjs.map
|