@wikicasa-dev/components 1.2.10 → 1.2.12
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/UIKit/AccessibleSelect.vue.d.ts +73 -0
- package/dist/UIKit/Accordion/BaseAccordion.vue.d.ts +45 -0
- package/dist/UIKit/Accordion/BaseAccordionBtn.vue.d.ts +59 -0
- package/dist/UIKit/Accordion/BaseAccordionContent.vue.d.ts +29 -0
- package/dist/UIKit/Accordion/BaseAccordionItem.vue.d.ts +71 -0
- package/dist/UIKit/BaseAlert.vue.d.ts +41 -0
- package/dist/UIKit/BaseAutocomplete.vue.d.ts +108 -0
- package/dist/UIKit/BaseBadge.vue.d.ts +36 -0
- package/dist/UIKit/BaseCard.vue.d.ts +41 -0
- package/dist/UIKit/BaseComplexToggle.vue.d.ts +83 -0
- package/dist/UIKit/BaseDropDown.vue.d.ts +123 -0
- package/dist/UIKit/BaseFloatingLabel.vue.d.ts +44 -0
- package/dist/UIKit/BaseInput.vue.d.ts +143 -0
- package/dist/UIKit/BaseNavItem.vue.d.ts +43 -0
- package/dist/UIKit/BasePagination.vue.d.ts +65 -0
- package/dist/UIKit/BasePaper.vue.d.ts +2 -0
- package/dist/UIKit/BaseSelect/SelectItem.vue.d.ts +54 -0
- package/dist/UIKit/BaseSlider.vue.d.ts +42 -0
- package/dist/UIKit/BaseTab.vue.d.ts +60 -0
- package/dist/UIKit/BaseTextarea.vue.d.ts +82 -0
- package/dist/UIKit/BaseToggle.vue.d.ts +36 -0
- package/dist/UIKit/BaseTooltip.vue.d.ts +56 -0
- package/dist/UIKit/BaseUploadFile.vue.d.ts +37 -0
- package/dist/UIKit/Checkbox/CheckboxBtn.vue.d.ts +92 -0
- package/dist/UIKit/Checkbox/CheckboxGroup.vue.d.ts +78 -0
- package/dist/UIKit/Radio/RadioButton.vue.d.ts +26 -0
- package/dist/UIKit/Radio/RadioGroup.vue.d.ts +37 -0
- package/dist/autoplay-l0sNRNKZ.js +1 -0
- package/dist/components/IntersectionObserver/IntersectionObservable.vue.d.ts +24 -0
- package/dist/components/IntersectionObserver/IntersectionObserver.vue.d.ts +50 -0
- package/dist/components/carousel/SwiperCarousel.vue.d.ts +69 -0
- package/dist/components.js +33 -135
- package/dist/components.umd.cjs +14 -1
- package/dist/controller-l0sNRNKZ.js +1 -0
- package/dist/free-mode-l0sNRNKZ.js +1 -0
- package/dist/index-BZnZUpib.js +4872 -0
- package/dist/index-BtxYTF3f.js +900 -0
- package/dist/index.d.ts +32 -1
- package/dist/navigation-l0sNRNKZ.js +1 -0
- package/dist/pagination-l0sNRNKZ.js +1 -0
- package/dist/stories/Button.stories.d.ts +6 -6
- package/dist/style.css +1 -1
- package/dist/thumbs-l0sNRNKZ.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,900 @@
|
|
|
1
|
+
import { g as N, a as W, e as R, b as X, c as G, d as Y, m as D, f as Z, h as j, n as J, i as F, j as Q, k as q } from "./index-BZnZUpib.js";
|
|
2
|
+
import { Z as ce } from "./index-BZnZUpib.js";
|
|
3
|
+
function te(k) {
|
|
4
|
+
let {
|
|
5
|
+
swiper: e,
|
|
6
|
+
extendParams: A,
|
|
7
|
+
on: p,
|
|
8
|
+
emit: y
|
|
9
|
+
} = k;
|
|
10
|
+
const f = N(), C = W();
|
|
11
|
+
e.keyboard = {
|
|
12
|
+
enabled: !1
|
|
13
|
+
}, A({
|
|
14
|
+
keyboard: {
|
|
15
|
+
enabled: !1,
|
|
16
|
+
onlyInViewport: !0,
|
|
17
|
+
pageUpDown: !0
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
function b(i) {
|
|
21
|
+
if (!e.enabled)
|
|
22
|
+
return;
|
|
23
|
+
const {
|
|
24
|
+
rtlTranslate: c
|
|
25
|
+
} = e;
|
|
26
|
+
let d = i;
|
|
27
|
+
d.originalEvent && (d = d.originalEvent);
|
|
28
|
+
const u = d.keyCode || d.charCode, n = e.params.keyboard.pageUpDown, o = n && u === 33, r = n && u === 34, t = u === 37, a = u === 39, s = u === 38, g = u === 40;
|
|
29
|
+
if (!e.allowSlideNext && (e.isHorizontal() && a || e.isVertical() && g || r) || !e.allowSlidePrev && (e.isHorizontal() && t || e.isVertical() && s || o))
|
|
30
|
+
return !1;
|
|
31
|
+
if (!(d.shiftKey || d.altKey || d.ctrlKey || d.metaKey) && !(f.activeElement && f.activeElement.nodeName && (f.activeElement.nodeName.toLowerCase() === "input" || f.activeElement.nodeName.toLowerCase() === "textarea"))) {
|
|
32
|
+
if (e.params.keyboard.onlyInViewport && (o || r || t || a || s || g)) {
|
|
33
|
+
let x = !1;
|
|
34
|
+
if (R(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && R(e.el, `.${e.params.slideActiveClass}`).length === 0)
|
|
35
|
+
return;
|
|
36
|
+
const M = e.el, P = M.clientWidth, m = M.clientHeight, h = C.innerWidth, w = C.innerHeight, I = X(M);
|
|
37
|
+
c && (I.left -= M.scrollLeft);
|
|
38
|
+
const E = [[I.left, I.top], [I.left + P, I.top], [I.left, I.top + m], [I.left + P, I.top + m]];
|
|
39
|
+
for (let S = 0; S < E.length; S += 1) {
|
|
40
|
+
const L = E[S];
|
|
41
|
+
if (L[0] >= 0 && L[0] <= h && L[1] >= 0 && L[1] <= w) {
|
|
42
|
+
if (L[0] === 0 && L[1] === 0)
|
|
43
|
+
continue;
|
|
44
|
+
x = !0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!x)
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
e.isHorizontal() ? ((o || r || t || a) && (d.preventDefault ? d.preventDefault() : d.returnValue = !1), ((r || a) && !c || (o || t) && c) && e.slideNext(), ((o || t) && !c || (r || a) && c) && e.slidePrev()) : ((o || r || s || g) && (d.preventDefault ? d.preventDefault() : d.returnValue = !1), (r || g) && e.slideNext(), (o || s) && e.slidePrev()), y("keyPress", u);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function v() {
|
|
54
|
+
e.keyboard.enabled || (f.addEventListener("keydown", b), e.keyboard.enabled = !0);
|
|
55
|
+
}
|
|
56
|
+
function l() {
|
|
57
|
+
e.keyboard.enabled && (f.removeEventListener("keydown", b), e.keyboard.enabled = !1);
|
|
58
|
+
}
|
|
59
|
+
p("init", () => {
|
|
60
|
+
e.params.keyboard.enabled && v();
|
|
61
|
+
}), p("destroy", () => {
|
|
62
|
+
e.keyboard.enabled && l();
|
|
63
|
+
}), Object.assign(e.keyboard, {
|
|
64
|
+
enable: v,
|
|
65
|
+
disable: l
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function _(k, e, A, p) {
|
|
69
|
+
return k.params.createElements && Object.keys(p).forEach((y) => {
|
|
70
|
+
if (!A[y] && A.auto === !0) {
|
|
71
|
+
let f = G(k.el, `.${p[y]}`)[0];
|
|
72
|
+
f || (f = Y("div", p[y]), f.className = p[y], k.el.append(f)), A[y] = f, e[y] = f;
|
|
73
|
+
}
|
|
74
|
+
}), A;
|
|
75
|
+
}
|
|
76
|
+
function ae(k) {
|
|
77
|
+
let {
|
|
78
|
+
swiper: e,
|
|
79
|
+
extendParams: A,
|
|
80
|
+
on: p,
|
|
81
|
+
emit: y
|
|
82
|
+
} = k;
|
|
83
|
+
A({
|
|
84
|
+
navigation: {
|
|
85
|
+
nextEl: null,
|
|
86
|
+
prevEl: null,
|
|
87
|
+
hideOnClick: !1,
|
|
88
|
+
disabledClass: "swiper-button-disabled",
|
|
89
|
+
hiddenClass: "swiper-button-hidden",
|
|
90
|
+
lockClass: "swiper-button-lock",
|
|
91
|
+
navigationDisabledClass: "swiper-navigation-disabled"
|
|
92
|
+
}
|
|
93
|
+
}), e.navigation = {
|
|
94
|
+
nextEl: null,
|
|
95
|
+
prevEl: null
|
|
96
|
+
};
|
|
97
|
+
function f(n) {
|
|
98
|
+
let o;
|
|
99
|
+
return n && typeof n == "string" && e.isElement && (o = e.el.querySelector(n), o) ? o : (n && (typeof n == "string" && (o = [...document.querySelectorAll(n)]), e.params.uniqueNavElements && typeof n == "string" && o.length > 1 && e.el.querySelectorAll(n).length === 1 && (o = e.el.querySelector(n))), n && !o ? n : o);
|
|
100
|
+
}
|
|
101
|
+
function C(n, o) {
|
|
102
|
+
const r = e.params.navigation;
|
|
103
|
+
n = D(n), n.forEach((t) => {
|
|
104
|
+
t && (t.classList[o ? "add" : "remove"](...r.disabledClass.split(" ")), t.tagName === "BUTTON" && (t.disabled = o), e.params.watchOverflow && e.enabled && t.classList[e.isLocked ? "add" : "remove"](r.lockClass));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function b() {
|
|
108
|
+
const {
|
|
109
|
+
nextEl: n,
|
|
110
|
+
prevEl: o
|
|
111
|
+
} = e.navigation;
|
|
112
|
+
if (e.params.loop) {
|
|
113
|
+
C(o, !1), C(n, !1);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
C(o, e.isBeginning && !e.params.rewind), C(n, e.isEnd && !e.params.rewind);
|
|
117
|
+
}
|
|
118
|
+
function v(n) {
|
|
119
|
+
n.preventDefault(), !(e.isBeginning && !e.params.loop && !e.params.rewind) && (e.slidePrev(), y("navigationPrev"));
|
|
120
|
+
}
|
|
121
|
+
function l(n) {
|
|
122
|
+
n.preventDefault(), !(e.isEnd && !e.params.loop && !e.params.rewind) && (e.slideNext(), y("navigationNext"));
|
|
123
|
+
}
|
|
124
|
+
function i() {
|
|
125
|
+
const n = e.params.navigation;
|
|
126
|
+
if (e.params.navigation = _(e, e.originalParams.navigation, e.params.navigation, {
|
|
127
|
+
nextEl: "swiper-button-next",
|
|
128
|
+
prevEl: "swiper-button-prev"
|
|
129
|
+
}), !(n.nextEl || n.prevEl))
|
|
130
|
+
return;
|
|
131
|
+
let o = f(n.nextEl), r = f(n.prevEl);
|
|
132
|
+
Object.assign(e.navigation, {
|
|
133
|
+
nextEl: o,
|
|
134
|
+
prevEl: r
|
|
135
|
+
}), o = D(o), r = D(r);
|
|
136
|
+
const t = (a, s) => {
|
|
137
|
+
a && a.addEventListener("click", s === "next" ? l : v), !e.enabled && a && a.classList.add(...n.lockClass.split(" "));
|
|
138
|
+
};
|
|
139
|
+
o.forEach((a) => t(a, "next")), r.forEach((a) => t(a, "prev"));
|
|
140
|
+
}
|
|
141
|
+
function c() {
|
|
142
|
+
let {
|
|
143
|
+
nextEl: n,
|
|
144
|
+
prevEl: o
|
|
145
|
+
} = e.navigation;
|
|
146
|
+
n = D(n), o = D(o);
|
|
147
|
+
const r = (t, a) => {
|
|
148
|
+
t.removeEventListener("click", a === "next" ? l : v), t.classList.remove(...e.params.navigation.disabledClass.split(" "));
|
|
149
|
+
};
|
|
150
|
+
n.forEach((t) => r(t, "next")), o.forEach((t) => r(t, "prev"));
|
|
151
|
+
}
|
|
152
|
+
p("init", () => {
|
|
153
|
+
e.params.navigation.enabled === !1 ? u() : (i(), b());
|
|
154
|
+
}), p("toEdge fromEdge lock unlock", () => {
|
|
155
|
+
b();
|
|
156
|
+
}), p("destroy", () => {
|
|
157
|
+
c();
|
|
158
|
+
}), p("enable disable", () => {
|
|
159
|
+
let {
|
|
160
|
+
nextEl: n,
|
|
161
|
+
prevEl: o
|
|
162
|
+
} = e.navigation;
|
|
163
|
+
if (n = D(n), o = D(o), e.enabled) {
|
|
164
|
+
b();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
[...n, ...o].filter((r) => !!r).forEach((r) => r.classList.add(e.params.navigation.lockClass));
|
|
168
|
+
}), p("click", (n, o) => {
|
|
169
|
+
let {
|
|
170
|
+
nextEl: r,
|
|
171
|
+
prevEl: t
|
|
172
|
+
} = e.navigation;
|
|
173
|
+
r = D(r), t = D(t);
|
|
174
|
+
const a = o.target;
|
|
175
|
+
if (e.params.navigation.hideOnClick && !t.includes(a) && !r.includes(a)) {
|
|
176
|
+
if (e.pagination && e.params.pagination && e.params.pagination.clickable && (e.pagination.el === a || e.pagination.el.contains(a)))
|
|
177
|
+
return;
|
|
178
|
+
let s;
|
|
179
|
+
r.length ? s = r[0].classList.contains(e.params.navigation.hiddenClass) : t.length && (s = t[0].classList.contains(e.params.navigation.hiddenClass)), y(s === !0 ? "navigationShow" : "navigationHide"), [...r, ...t].filter((g) => !!g).forEach((g) => g.classList.toggle(e.params.navigation.hiddenClass));
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
const d = () => {
|
|
183
|
+
e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")), i(), b();
|
|
184
|
+
}, u = () => {
|
|
185
|
+
e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")), c();
|
|
186
|
+
};
|
|
187
|
+
Object.assign(e.navigation, {
|
|
188
|
+
enable: d,
|
|
189
|
+
disable: u,
|
|
190
|
+
update: b,
|
|
191
|
+
init: i,
|
|
192
|
+
destroy: c
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function H(k) {
|
|
196
|
+
return k === void 0 && (k = ""), `.${k.trim().replace(/([\.:!+\/])/g, "\\$1").replace(/ /g, ".")}`;
|
|
197
|
+
}
|
|
198
|
+
function ie(k) {
|
|
199
|
+
let {
|
|
200
|
+
swiper: e,
|
|
201
|
+
extendParams: A,
|
|
202
|
+
on: p,
|
|
203
|
+
emit: y
|
|
204
|
+
} = k;
|
|
205
|
+
const f = "swiper-pagination";
|
|
206
|
+
A({
|
|
207
|
+
pagination: {
|
|
208
|
+
el: null,
|
|
209
|
+
bulletElement: "span",
|
|
210
|
+
clickable: !1,
|
|
211
|
+
hideOnClick: !1,
|
|
212
|
+
renderBullet: null,
|
|
213
|
+
renderProgressbar: null,
|
|
214
|
+
renderFraction: null,
|
|
215
|
+
renderCustom: null,
|
|
216
|
+
progressbarOpposite: !1,
|
|
217
|
+
type: "bullets",
|
|
218
|
+
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
|
219
|
+
dynamicBullets: !1,
|
|
220
|
+
dynamicMainBullets: 1,
|
|
221
|
+
formatFractionCurrent: (t) => t,
|
|
222
|
+
formatFractionTotal: (t) => t,
|
|
223
|
+
bulletClass: `${f}-bullet`,
|
|
224
|
+
bulletActiveClass: `${f}-bullet-active`,
|
|
225
|
+
modifierClass: `${f}-`,
|
|
226
|
+
currentClass: `${f}-current`,
|
|
227
|
+
totalClass: `${f}-total`,
|
|
228
|
+
hiddenClass: `${f}-hidden`,
|
|
229
|
+
progressbarFillClass: `${f}-progressbar-fill`,
|
|
230
|
+
progressbarOppositeClass: `${f}-progressbar-opposite`,
|
|
231
|
+
clickableClass: `${f}-clickable`,
|
|
232
|
+
lockClass: `${f}-lock`,
|
|
233
|
+
horizontalClass: `${f}-horizontal`,
|
|
234
|
+
verticalClass: `${f}-vertical`,
|
|
235
|
+
paginationDisabledClass: `${f}-disabled`
|
|
236
|
+
}
|
|
237
|
+
}), e.pagination = {
|
|
238
|
+
el: null,
|
|
239
|
+
bullets: []
|
|
240
|
+
};
|
|
241
|
+
let C, b = 0;
|
|
242
|
+
function v() {
|
|
243
|
+
return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
|
|
244
|
+
}
|
|
245
|
+
function l(t, a) {
|
|
246
|
+
const {
|
|
247
|
+
bulletActiveClass: s
|
|
248
|
+
} = e.params.pagination;
|
|
249
|
+
t && (t = t[`${a === "prev" ? "previous" : "next"}ElementSibling`], t && (t.classList.add(`${s}-${a}`), t = t[`${a === "prev" ? "previous" : "next"}ElementSibling`], t && t.classList.add(`${s}-${a}-${a}`)));
|
|
250
|
+
}
|
|
251
|
+
function i(t) {
|
|
252
|
+
const a = t.target.closest(H(e.params.pagination.bulletClass));
|
|
253
|
+
if (!a)
|
|
254
|
+
return;
|
|
255
|
+
t.preventDefault();
|
|
256
|
+
const s = j(a) * e.params.slidesPerGroup;
|
|
257
|
+
if (e.params.loop) {
|
|
258
|
+
if (e.realIndex === s)
|
|
259
|
+
return;
|
|
260
|
+
e.slideToLoop(s);
|
|
261
|
+
} else
|
|
262
|
+
e.slideTo(s);
|
|
263
|
+
}
|
|
264
|
+
function c() {
|
|
265
|
+
const t = e.rtl, a = e.params.pagination;
|
|
266
|
+
if (v())
|
|
267
|
+
return;
|
|
268
|
+
let s = e.pagination.el;
|
|
269
|
+
s = D(s);
|
|
270
|
+
let g, x;
|
|
271
|
+
const M = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, P = e.params.loop ? Math.ceil(M / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
272
|
+
if (e.params.loop ? (x = e.previousRealIndex || 0, g = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (g = e.snapIndex, x = e.previousSnapIndex) : (x = e.previousIndex || 0, g = e.activeIndex || 0), a.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
|
|
273
|
+
const m = e.pagination.bullets;
|
|
274
|
+
let h, w, I;
|
|
275
|
+
if (a.dynamicBullets && (C = Z(m[0], e.isHorizontal() ? "width" : "height", !0), s.forEach((E) => {
|
|
276
|
+
E.style[e.isHorizontal() ? "width" : "height"] = `${C * (a.dynamicMainBullets + 4)}px`;
|
|
277
|
+
}), a.dynamicMainBullets > 1 && x !== void 0 && (b += g - (x || 0), b > a.dynamicMainBullets - 1 ? b = a.dynamicMainBullets - 1 : b < 0 && (b = 0)), h = Math.max(g - b, 0), w = h + (Math.min(m.length, a.dynamicMainBullets) - 1), I = (w + h) / 2), m.forEach((E) => {
|
|
278
|
+
const S = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((L) => `${a.bulletActiveClass}${L}`)].map((L) => typeof L == "string" && L.includes(" ") ? L.split(" ") : L).flat();
|
|
279
|
+
E.classList.remove(...S);
|
|
280
|
+
}), s.length > 1)
|
|
281
|
+
m.forEach((E) => {
|
|
282
|
+
const S = j(E);
|
|
283
|
+
S === g ? E.classList.add(...a.bulletActiveClass.split(" ")) : e.isElement && E.setAttribute("part", "bullet"), a.dynamicBullets && (S >= h && S <= w && E.classList.add(...`${a.bulletActiveClass}-main`.split(" ")), S === h && l(E, "prev"), S === w && l(E, "next"));
|
|
284
|
+
});
|
|
285
|
+
else {
|
|
286
|
+
const E = m[g];
|
|
287
|
+
if (E && E.classList.add(...a.bulletActiveClass.split(" ")), e.isElement && m.forEach((S, L) => {
|
|
288
|
+
S.setAttribute("part", L === g ? "bullet-active" : "bullet");
|
|
289
|
+
}), a.dynamicBullets) {
|
|
290
|
+
const S = m[h], L = m[w];
|
|
291
|
+
for (let $ = h; $ <= w; $ += 1)
|
|
292
|
+
m[$] && m[$].classList.add(...`${a.bulletActiveClass}-main`.split(" "));
|
|
293
|
+
l(S, "prev"), l(L, "next");
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (a.dynamicBullets) {
|
|
297
|
+
const E = Math.min(m.length, a.dynamicMainBullets + 4), S = (C * E - C) / 2 - I * C, L = t ? "right" : "left";
|
|
298
|
+
m.forEach(($) => {
|
|
299
|
+
$.style[e.isHorizontal() ? L : "top"] = `${S}px`;
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
s.forEach((m, h) => {
|
|
304
|
+
if (a.type === "fraction" && (m.querySelectorAll(H(a.currentClass)).forEach((w) => {
|
|
305
|
+
w.textContent = a.formatFractionCurrent(g + 1);
|
|
306
|
+
}), m.querySelectorAll(H(a.totalClass)).forEach((w) => {
|
|
307
|
+
w.textContent = a.formatFractionTotal(P);
|
|
308
|
+
})), a.type === "progressbar") {
|
|
309
|
+
let w;
|
|
310
|
+
a.progressbarOpposite ? w = e.isHorizontal() ? "vertical" : "horizontal" : w = e.isHorizontal() ? "horizontal" : "vertical";
|
|
311
|
+
const I = (g + 1) / P;
|
|
312
|
+
let E = 1, S = 1;
|
|
313
|
+
w === "horizontal" ? E = I : S = I, m.querySelectorAll(H(a.progressbarFillClass)).forEach((L) => {
|
|
314
|
+
L.style.transform = `translate3d(0,0,0) scaleX(${E}) scaleY(${S})`, L.style.transitionDuration = `${e.params.speed}ms`;
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
a.type === "custom" && a.renderCustom ? (m.innerHTML = a.renderCustom(e, g + 1, P), h === 0 && y("paginationRender", m)) : (h === 0 && y("paginationRender", m), y("paginationUpdate", m)), e.params.watchOverflow && e.enabled && m.classList[e.isLocked ? "add" : "remove"](a.lockClass);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function d() {
|
|
321
|
+
const t = e.params.pagination;
|
|
322
|
+
if (v())
|
|
323
|
+
return;
|
|
324
|
+
const a = 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;
|
|
325
|
+
let s = e.pagination.el;
|
|
326
|
+
s = D(s);
|
|
327
|
+
let g = "";
|
|
328
|
+
if (t.type === "bullets") {
|
|
329
|
+
let x = e.params.loop ? Math.ceil(a / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
330
|
+
e.params.freeMode && e.params.freeMode.enabled && x > a && (x = a);
|
|
331
|
+
for (let M = 0; M < x; M += 1)
|
|
332
|
+
t.renderBullet ? g += t.renderBullet.call(e, M, t.bulletClass) : g += `<${t.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${t.bulletClass}"></${t.bulletElement}>`;
|
|
333
|
+
}
|
|
334
|
+
t.type === "fraction" && (t.renderFraction ? g = t.renderFraction.call(e, t.currentClass, t.totalClass) : g = `<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`), t.type === "progressbar" && (t.renderProgressbar ? g = t.renderProgressbar.call(e, t.progressbarFillClass) : g = `<span class="${t.progressbarFillClass}"></span>`), e.pagination.bullets = [], s.forEach((x) => {
|
|
335
|
+
t.type !== "custom" && (x.innerHTML = g || ""), t.type === "bullets" && e.pagination.bullets.push(...x.querySelectorAll(H(t.bulletClass)));
|
|
336
|
+
}), t.type !== "custom" && y("paginationRender", s[0]);
|
|
337
|
+
}
|
|
338
|
+
function u() {
|
|
339
|
+
e.params.pagination = _(e, e.originalParams.pagination, e.params.pagination, {
|
|
340
|
+
el: "swiper-pagination"
|
|
341
|
+
});
|
|
342
|
+
const t = e.params.pagination;
|
|
343
|
+
if (!t.el)
|
|
344
|
+
return;
|
|
345
|
+
let a;
|
|
346
|
+
typeof t.el == "string" && e.isElement && (a = e.el.querySelector(t.el)), !a && typeof t.el == "string" && (a = [...document.querySelectorAll(t.el)]), a || (a = t.el), !(!a || a.length === 0) && (e.params.uniqueNavElements && typeof t.el == "string" && Array.isArray(a) && a.length > 1 && (a = [...e.el.querySelectorAll(t.el)], a.length > 1 && (a = a.filter((s) => R(s, ".swiper")[0] === e.el)[0])), Array.isArray(a) && a.length === 1 && (a = a[0]), Object.assign(e.pagination, {
|
|
347
|
+
el: a
|
|
348
|
+
}), a = D(a), a.forEach((s) => {
|
|
349
|
+
t.type === "bullets" && t.clickable && s.classList.add(...(t.clickableClass || "").split(" ")), s.classList.add(t.modifierClass + t.type), s.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.type === "bullets" && t.dynamicBullets && (s.classList.add(`${t.modifierClass}${t.type}-dynamic`), b = 0, t.dynamicMainBullets < 1 && (t.dynamicMainBullets = 1)), t.type === "progressbar" && t.progressbarOpposite && s.classList.add(t.progressbarOppositeClass), t.clickable && s.addEventListener("click", i), e.enabled || s.classList.add(t.lockClass);
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
function n() {
|
|
353
|
+
const t = e.params.pagination;
|
|
354
|
+
if (v())
|
|
355
|
+
return;
|
|
356
|
+
let a = e.pagination.el;
|
|
357
|
+
a && (a = D(a), a.forEach((s) => {
|
|
358
|
+
s.classList.remove(t.hiddenClass), s.classList.remove(t.modifierClass + t.type), s.classList.remove(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.clickable && (s.classList.remove(...(t.clickableClass || "").split(" ")), s.removeEventListener("click", i));
|
|
359
|
+
})), e.pagination.bullets && e.pagination.bullets.forEach((s) => s.classList.remove(...t.bulletActiveClass.split(" ")));
|
|
360
|
+
}
|
|
361
|
+
p("changeDirection", () => {
|
|
362
|
+
if (!e.pagination || !e.pagination.el)
|
|
363
|
+
return;
|
|
364
|
+
const t = e.params.pagination;
|
|
365
|
+
let {
|
|
366
|
+
el: a
|
|
367
|
+
} = e.pagination;
|
|
368
|
+
a = D(a), a.forEach((s) => {
|
|
369
|
+
s.classList.remove(t.horizontalClass, t.verticalClass), s.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass);
|
|
370
|
+
});
|
|
371
|
+
}), p("init", () => {
|
|
372
|
+
e.params.pagination.enabled === !1 ? r() : (u(), d(), c());
|
|
373
|
+
}), p("activeIndexChange", () => {
|
|
374
|
+
typeof e.snapIndex > "u" && c();
|
|
375
|
+
}), p("snapIndexChange", () => {
|
|
376
|
+
c();
|
|
377
|
+
}), p("snapGridLengthChange", () => {
|
|
378
|
+
d(), c();
|
|
379
|
+
}), p("destroy", () => {
|
|
380
|
+
n();
|
|
381
|
+
}), p("enable disable", () => {
|
|
382
|
+
let {
|
|
383
|
+
el: t
|
|
384
|
+
} = e.pagination;
|
|
385
|
+
t && (t = D(t), t.forEach((a) => a.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
|
|
386
|
+
}), p("lock unlock", () => {
|
|
387
|
+
c();
|
|
388
|
+
}), p("click", (t, a) => {
|
|
389
|
+
const s = a.target, g = D(e.pagination.el);
|
|
390
|
+
if (e.params.pagination.el && e.params.pagination.hideOnClick && g && g.length > 0 && !s.classList.contains(e.params.pagination.bulletClass)) {
|
|
391
|
+
if (e.navigation && (e.navigation.nextEl && s === e.navigation.nextEl || e.navigation.prevEl && s === e.navigation.prevEl))
|
|
392
|
+
return;
|
|
393
|
+
const x = g[0].classList.contains(e.params.pagination.hiddenClass);
|
|
394
|
+
y(x === !0 ? "paginationShow" : "paginationHide"), g.forEach((M) => M.classList.toggle(e.params.pagination.hiddenClass));
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
const o = () => {
|
|
398
|
+
e.el.classList.remove(e.params.pagination.paginationDisabledClass);
|
|
399
|
+
let {
|
|
400
|
+
el: t
|
|
401
|
+
} = e.pagination;
|
|
402
|
+
t && (t = D(t), t.forEach((a) => a.classList.remove(e.params.pagination.paginationDisabledClass))), u(), d(), c();
|
|
403
|
+
}, r = () => {
|
|
404
|
+
e.el.classList.add(e.params.pagination.paginationDisabledClass);
|
|
405
|
+
let {
|
|
406
|
+
el: t
|
|
407
|
+
} = e.pagination;
|
|
408
|
+
t && (t = D(t), t.forEach((a) => a.classList.add(e.params.pagination.paginationDisabledClass))), n();
|
|
409
|
+
};
|
|
410
|
+
Object.assign(e.pagination, {
|
|
411
|
+
enable: o,
|
|
412
|
+
disable: r,
|
|
413
|
+
render: d,
|
|
414
|
+
update: c,
|
|
415
|
+
init: u,
|
|
416
|
+
destroy: n
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function se(k) {
|
|
420
|
+
let {
|
|
421
|
+
swiper: e,
|
|
422
|
+
extendParams: A,
|
|
423
|
+
on: p
|
|
424
|
+
} = k;
|
|
425
|
+
A({
|
|
426
|
+
controller: {
|
|
427
|
+
control: void 0,
|
|
428
|
+
inverse: !1,
|
|
429
|
+
by: "slide"
|
|
430
|
+
// or 'container'
|
|
431
|
+
}
|
|
432
|
+
}), e.controller = {
|
|
433
|
+
control: void 0
|
|
434
|
+
};
|
|
435
|
+
function y(l, i) {
|
|
436
|
+
const c = /* @__PURE__ */ function() {
|
|
437
|
+
let o, r, t;
|
|
438
|
+
return (a, s) => {
|
|
439
|
+
for (r = -1, o = a.length; o - r > 1; )
|
|
440
|
+
t = o + r >> 1, a[t] <= s ? r = t : o = t;
|
|
441
|
+
return o;
|
|
442
|
+
};
|
|
443
|
+
}();
|
|
444
|
+
this.x = l, this.y = i, this.lastIndex = l.length - 1;
|
|
445
|
+
let d, u;
|
|
446
|
+
return this.interpolate = function(o) {
|
|
447
|
+
return o ? (u = c(this.x, o), d = u - 1, (o - this.x[d]) * (this.y[u] - this.y[d]) / (this.x[u] - this.x[d]) + this.y[d]) : 0;
|
|
448
|
+
}, this;
|
|
449
|
+
}
|
|
450
|
+
function f(l) {
|
|
451
|
+
e.controller.spline = e.params.loop ? new y(e.slidesGrid, l.slidesGrid) : new y(e.snapGrid, l.snapGrid);
|
|
452
|
+
}
|
|
453
|
+
function C(l, i) {
|
|
454
|
+
const c = e.controller.control;
|
|
455
|
+
let d, u;
|
|
456
|
+
const n = e.constructor;
|
|
457
|
+
function o(r) {
|
|
458
|
+
if (r.destroyed)
|
|
459
|
+
return;
|
|
460
|
+
const t = e.rtlTranslate ? -e.translate : e.translate;
|
|
461
|
+
e.params.controller.by === "slide" && (f(r), u = -e.controller.spline.interpolate(-t)), (!u || e.params.controller.by === "container") && (d = (r.maxTranslate() - r.minTranslate()) / (e.maxTranslate() - e.minTranslate()), (Number.isNaN(d) || !Number.isFinite(d)) && (d = 1), u = (t - e.minTranslate()) * d + r.minTranslate()), e.params.controller.inverse && (u = r.maxTranslate() - u), r.updateProgress(u), r.setTranslate(u, e), r.updateActiveIndex(), r.updateSlidesClasses();
|
|
462
|
+
}
|
|
463
|
+
if (Array.isArray(c))
|
|
464
|
+
for (let r = 0; r < c.length; r += 1)
|
|
465
|
+
c[r] !== i && c[r] instanceof n && o(c[r]);
|
|
466
|
+
else
|
|
467
|
+
c instanceof n && i !== c && o(c);
|
|
468
|
+
}
|
|
469
|
+
function b(l, i) {
|
|
470
|
+
const c = e.constructor, d = e.controller.control;
|
|
471
|
+
let u;
|
|
472
|
+
function n(o) {
|
|
473
|
+
o.destroyed || (o.setTransition(l, e), l !== 0 && (o.transitionStart(), o.params.autoHeight && J(() => {
|
|
474
|
+
o.updateAutoHeight();
|
|
475
|
+
}), F(o.wrapperEl, () => {
|
|
476
|
+
d && o.transitionEnd();
|
|
477
|
+
})));
|
|
478
|
+
}
|
|
479
|
+
if (Array.isArray(d))
|
|
480
|
+
for (u = 0; u < d.length; u += 1)
|
|
481
|
+
d[u] !== i && d[u] instanceof c && n(d[u]);
|
|
482
|
+
else
|
|
483
|
+
d instanceof c && i !== d && n(d);
|
|
484
|
+
}
|
|
485
|
+
function v() {
|
|
486
|
+
e.controller.control && e.controller.spline && (e.controller.spline = void 0, delete e.controller.spline);
|
|
487
|
+
}
|
|
488
|
+
p("beforeInit", () => {
|
|
489
|
+
if (typeof window < "u" && // eslint-disable-line
|
|
490
|
+
(typeof e.params.controller.control == "string" || e.params.controller.control instanceof HTMLElement)) {
|
|
491
|
+
const l = document.querySelector(e.params.controller.control);
|
|
492
|
+
if (l && l.swiper)
|
|
493
|
+
e.controller.control = l.swiper;
|
|
494
|
+
else if (l) {
|
|
495
|
+
const i = (c) => {
|
|
496
|
+
e.controller.control = c.detail[0], e.update(), l.removeEventListener("init", i);
|
|
497
|
+
};
|
|
498
|
+
l.addEventListener("init", i);
|
|
499
|
+
}
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
e.controller.control = e.params.controller.control;
|
|
503
|
+
}), p("update", () => {
|
|
504
|
+
v();
|
|
505
|
+
}), p("resize", () => {
|
|
506
|
+
v();
|
|
507
|
+
}), p("observerUpdate", () => {
|
|
508
|
+
v();
|
|
509
|
+
}), p("setTranslate", (l, i, c) => {
|
|
510
|
+
!e.controller.control || e.controller.control.destroyed || e.controller.setTranslate(i, c);
|
|
511
|
+
}), p("setTransition", (l, i, c) => {
|
|
512
|
+
!e.controller.control || e.controller.control.destroyed || e.controller.setTransition(i, c);
|
|
513
|
+
}), Object.assign(e.controller, {
|
|
514
|
+
setTranslate: C,
|
|
515
|
+
setTransition: b
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
function ne(k) {
|
|
519
|
+
let {
|
|
520
|
+
swiper: e,
|
|
521
|
+
extendParams: A,
|
|
522
|
+
on: p,
|
|
523
|
+
emit: y,
|
|
524
|
+
params: f
|
|
525
|
+
} = k;
|
|
526
|
+
e.autoplay = {
|
|
527
|
+
running: !1,
|
|
528
|
+
paused: !1,
|
|
529
|
+
timeLeft: 0
|
|
530
|
+
}, A({
|
|
531
|
+
autoplay: {
|
|
532
|
+
enabled: !1,
|
|
533
|
+
delay: 3e3,
|
|
534
|
+
waitForTransition: !0,
|
|
535
|
+
disableOnInteraction: !1,
|
|
536
|
+
stopOnLastSlide: !1,
|
|
537
|
+
reverseDirection: !1,
|
|
538
|
+
pauseOnMouseEnter: !1
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
let C, b, v = f && f.autoplay ? f.autoplay.delay : 3e3, l = f && f.autoplay ? f.autoplay.delay : 3e3, i, c = (/* @__PURE__ */ new Date()).getTime(), d, u, n, o, r, t, a;
|
|
542
|
+
function s(T) {
|
|
543
|
+
!e || e.destroyed || !e.wrapperEl || T.target === e.wrapperEl && (e.wrapperEl.removeEventListener("transitionend", s), !a && w());
|
|
544
|
+
}
|
|
545
|
+
const g = () => {
|
|
546
|
+
if (e.destroyed || !e.autoplay.running)
|
|
547
|
+
return;
|
|
548
|
+
e.autoplay.paused ? d = !0 : d && (l = i, d = !1);
|
|
549
|
+
const T = e.autoplay.paused ? i : c + l - (/* @__PURE__ */ new Date()).getTime();
|
|
550
|
+
e.autoplay.timeLeft = T, y("autoplayTimeLeft", T, T / v), b = requestAnimationFrame(() => {
|
|
551
|
+
g();
|
|
552
|
+
});
|
|
553
|
+
}, x = () => {
|
|
554
|
+
let T;
|
|
555
|
+
return e.virtual && e.params.virtual.enabled ? T = e.slides.filter((O) => O.classList.contains("swiper-slide-active"))[0] : T = e.slides[e.activeIndex], T ? parseInt(T.getAttribute("data-swiper-autoplay"), 10) : void 0;
|
|
556
|
+
}, M = (T) => {
|
|
557
|
+
if (e.destroyed || !e.autoplay.running)
|
|
558
|
+
return;
|
|
559
|
+
cancelAnimationFrame(b), g();
|
|
560
|
+
let B = typeof T > "u" ? e.params.autoplay.delay : T;
|
|
561
|
+
v = e.params.autoplay.delay, l = e.params.autoplay.delay;
|
|
562
|
+
const O = x();
|
|
563
|
+
!Number.isNaN(O) && O > 0 && typeof T > "u" && (B = O, v = O, l = O), i = B;
|
|
564
|
+
const z = e.params.speed, V = () => {
|
|
565
|
+
!e || e.destroyed || (e.params.autoplay.reverseDirection ? !e.isBeginning || e.params.loop || e.params.rewind ? (e.slidePrev(z, !0, !0), y("autoplay")) : e.params.autoplay.stopOnLastSlide || (e.slideTo(e.slides.length - 1, z, !0, !0), y("autoplay")) : !e.isEnd || e.params.loop || e.params.rewind ? (e.slideNext(z, !0, !0), y("autoplay")) : e.params.autoplay.stopOnLastSlide || (e.slideTo(0, z, !0, !0), y("autoplay")), e.params.cssMode && (c = (/* @__PURE__ */ new Date()).getTime(), requestAnimationFrame(() => {
|
|
566
|
+
M();
|
|
567
|
+
})));
|
|
568
|
+
};
|
|
569
|
+
return B > 0 ? (clearTimeout(C), C = setTimeout(() => {
|
|
570
|
+
V();
|
|
571
|
+
}, B)) : requestAnimationFrame(() => {
|
|
572
|
+
V();
|
|
573
|
+
}), B;
|
|
574
|
+
}, P = () => {
|
|
575
|
+
c = (/* @__PURE__ */ new Date()).getTime(), e.autoplay.running = !0, M(), y("autoplayStart");
|
|
576
|
+
}, m = () => {
|
|
577
|
+
e.autoplay.running = !1, clearTimeout(C), cancelAnimationFrame(b), y("autoplayStop");
|
|
578
|
+
}, h = (T, B) => {
|
|
579
|
+
if (e.destroyed || !e.autoplay.running)
|
|
580
|
+
return;
|
|
581
|
+
clearTimeout(C), T || (t = !0);
|
|
582
|
+
const O = () => {
|
|
583
|
+
y("autoplayPause"), e.params.autoplay.waitForTransition ? e.wrapperEl.addEventListener("transitionend", s) : w();
|
|
584
|
+
};
|
|
585
|
+
if (e.autoplay.paused = !0, B) {
|
|
586
|
+
r && (i = e.params.autoplay.delay), r = !1, O();
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
i = (i || e.params.autoplay.delay) - ((/* @__PURE__ */ new Date()).getTime() - c), !(e.isEnd && i < 0 && !e.params.loop) && (i < 0 && (i = 0), O());
|
|
590
|
+
}, w = () => {
|
|
591
|
+
e.isEnd && i < 0 && !e.params.loop || e.destroyed || !e.autoplay.running || (c = (/* @__PURE__ */ new Date()).getTime(), t ? (t = !1, M(i)) : M(), e.autoplay.paused = !1, y("autoplayResume"));
|
|
592
|
+
}, I = () => {
|
|
593
|
+
if (e.destroyed || !e.autoplay.running)
|
|
594
|
+
return;
|
|
595
|
+
const T = N();
|
|
596
|
+
T.visibilityState === "hidden" && (t = !0, h(!0)), T.visibilityState === "visible" && w();
|
|
597
|
+
}, E = (T) => {
|
|
598
|
+
T.pointerType === "mouse" && (t = !0, a = !0, !(e.animating || e.autoplay.paused) && h(!0));
|
|
599
|
+
}, S = (T) => {
|
|
600
|
+
T.pointerType === "mouse" && (a = !1, e.autoplay.paused && w());
|
|
601
|
+
}, L = () => {
|
|
602
|
+
e.params.autoplay.pauseOnMouseEnter && (e.el.addEventListener("pointerenter", E), e.el.addEventListener("pointerleave", S));
|
|
603
|
+
}, $ = () => {
|
|
604
|
+
e.el.removeEventListener("pointerenter", E), e.el.removeEventListener("pointerleave", S);
|
|
605
|
+
}, U = () => {
|
|
606
|
+
N().addEventListener("visibilitychange", I);
|
|
607
|
+
}, K = () => {
|
|
608
|
+
N().removeEventListener("visibilitychange", I);
|
|
609
|
+
};
|
|
610
|
+
p("init", () => {
|
|
611
|
+
e.params.autoplay.enabled && (L(), U(), P());
|
|
612
|
+
}), p("destroy", () => {
|
|
613
|
+
$(), K(), e.autoplay.running && m();
|
|
614
|
+
}), p("_freeModeStaticRelease", () => {
|
|
615
|
+
(n || t) && w();
|
|
616
|
+
}), p("_freeModeNoMomentumRelease", () => {
|
|
617
|
+
e.params.autoplay.disableOnInteraction ? m() : h(!0, !0);
|
|
618
|
+
}), p("beforeTransitionStart", (T, B, O) => {
|
|
619
|
+
e.destroyed || !e.autoplay.running || (O || !e.params.autoplay.disableOnInteraction ? h(!0, !0) : m());
|
|
620
|
+
}), p("sliderFirstMove", () => {
|
|
621
|
+
if (!(e.destroyed || !e.autoplay.running)) {
|
|
622
|
+
if (e.params.autoplay.disableOnInteraction) {
|
|
623
|
+
m();
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
u = !0, n = !1, t = !1, o = setTimeout(() => {
|
|
627
|
+
t = !0, n = !0, h(!0);
|
|
628
|
+
}, 200);
|
|
629
|
+
}
|
|
630
|
+
}), p("touchEnd", () => {
|
|
631
|
+
if (!(e.destroyed || !e.autoplay.running || !u)) {
|
|
632
|
+
if (clearTimeout(o), clearTimeout(C), e.params.autoplay.disableOnInteraction) {
|
|
633
|
+
n = !1, u = !1;
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
n && e.params.cssMode && w(), n = !1, u = !1;
|
|
637
|
+
}
|
|
638
|
+
}), p("slideChange", () => {
|
|
639
|
+
e.destroyed || !e.autoplay.running || (r = !0);
|
|
640
|
+
}), Object.assign(e.autoplay, {
|
|
641
|
+
start: P,
|
|
642
|
+
stop: m,
|
|
643
|
+
pause: h,
|
|
644
|
+
resume: w
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
function re(k) {
|
|
648
|
+
let {
|
|
649
|
+
swiper: e,
|
|
650
|
+
extendParams: A,
|
|
651
|
+
on: p
|
|
652
|
+
} = k;
|
|
653
|
+
A({
|
|
654
|
+
thumbs: {
|
|
655
|
+
swiper: null,
|
|
656
|
+
multipleActiveThumbs: !0,
|
|
657
|
+
autoScrollOffset: 0,
|
|
658
|
+
slideThumbActiveClass: "swiper-slide-thumb-active",
|
|
659
|
+
thumbsContainerClass: "swiper-thumbs"
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
let y = !1, f = !1;
|
|
663
|
+
e.thumbs = {
|
|
664
|
+
swiper: null
|
|
665
|
+
};
|
|
666
|
+
function C() {
|
|
667
|
+
const l = e.thumbs.swiper;
|
|
668
|
+
if (!l || l.destroyed)
|
|
669
|
+
return;
|
|
670
|
+
const i = l.clickedIndex, c = l.clickedSlide;
|
|
671
|
+
if (c && c.classList.contains(e.params.thumbs.slideThumbActiveClass) || typeof i > "u" || i === null)
|
|
672
|
+
return;
|
|
673
|
+
let d;
|
|
674
|
+
l.params.loop ? d = parseInt(l.clickedSlide.getAttribute("data-swiper-slide-index"), 10) : d = i, e.params.loop ? e.slideToLoop(d) : e.slideTo(d);
|
|
675
|
+
}
|
|
676
|
+
function b() {
|
|
677
|
+
const {
|
|
678
|
+
thumbs: l
|
|
679
|
+
} = e.params;
|
|
680
|
+
if (y)
|
|
681
|
+
return !1;
|
|
682
|
+
y = !0;
|
|
683
|
+
const i = e.constructor;
|
|
684
|
+
if (l.swiper instanceof i)
|
|
685
|
+
e.thumbs.swiper = l.swiper, Object.assign(e.thumbs.swiper.originalParams, {
|
|
686
|
+
watchSlidesProgress: !0,
|
|
687
|
+
slideToClickedSlide: !1
|
|
688
|
+
}), Object.assign(e.thumbs.swiper.params, {
|
|
689
|
+
watchSlidesProgress: !0,
|
|
690
|
+
slideToClickedSlide: !1
|
|
691
|
+
}), e.thumbs.swiper.update();
|
|
692
|
+
else if (Q(l.swiper)) {
|
|
693
|
+
const c = Object.assign({}, l.swiper);
|
|
694
|
+
Object.assign(c, {
|
|
695
|
+
watchSlidesProgress: !0,
|
|
696
|
+
slideToClickedSlide: !1
|
|
697
|
+
}), e.thumbs.swiper = new i(c), f = !0;
|
|
698
|
+
}
|
|
699
|
+
return e.thumbs.swiper.el.classList.add(e.params.thumbs.thumbsContainerClass), e.thumbs.swiper.on("tap", C), !0;
|
|
700
|
+
}
|
|
701
|
+
function v(l) {
|
|
702
|
+
const i = e.thumbs.swiper;
|
|
703
|
+
if (!i || i.destroyed)
|
|
704
|
+
return;
|
|
705
|
+
const c = i.params.slidesPerView === "auto" ? i.slidesPerViewDynamic() : i.params.slidesPerView;
|
|
706
|
+
let d = 1;
|
|
707
|
+
const u = e.params.thumbs.slideThumbActiveClass;
|
|
708
|
+
if (e.params.slidesPerView > 1 && !e.params.centeredSlides && (d = e.params.slidesPerView), e.params.thumbs.multipleActiveThumbs || (d = 1), d = Math.floor(d), i.slides.forEach((r) => r.classList.remove(u)), i.params.loop || i.params.virtual && i.params.virtual.enabled)
|
|
709
|
+
for (let r = 0; r < d; r += 1)
|
|
710
|
+
G(i.slidesEl, `[data-swiper-slide-index="${e.realIndex + r}"]`).forEach((t) => {
|
|
711
|
+
t.classList.add(u);
|
|
712
|
+
});
|
|
713
|
+
else
|
|
714
|
+
for (let r = 0; r < d; r += 1)
|
|
715
|
+
i.slides[e.realIndex + r] && i.slides[e.realIndex + r].classList.add(u);
|
|
716
|
+
const n = e.params.thumbs.autoScrollOffset, o = n && !i.params.loop;
|
|
717
|
+
if (e.realIndex !== i.realIndex || o) {
|
|
718
|
+
const r = i.activeIndex;
|
|
719
|
+
let t, a;
|
|
720
|
+
if (i.params.loop) {
|
|
721
|
+
const s = i.slides.filter((g) => g.getAttribute("data-swiper-slide-index") === `${e.realIndex}`)[0];
|
|
722
|
+
t = i.slides.indexOf(s), a = e.activeIndex > e.previousIndex ? "next" : "prev";
|
|
723
|
+
} else
|
|
724
|
+
t = e.realIndex, a = t > e.previousIndex ? "next" : "prev";
|
|
725
|
+
o && (t += a === "next" ? n : -1 * n), i.visibleSlidesIndexes && i.visibleSlidesIndexes.indexOf(t) < 0 && (i.params.centeredSlides ? t > r ? t = t - Math.floor(c / 2) + 1 : t = t + Math.floor(c / 2) - 1 : t > r && i.params.slidesPerGroup, i.slideTo(t, l ? 0 : void 0));
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
p("beforeInit", () => {
|
|
729
|
+
const {
|
|
730
|
+
thumbs: l
|
|
731
|
+
} = e.params;
|
|
732
|
+
if (!(!l || !l.swiper))
|
|
733
|
+
if (typeof l.swiper == "string" || l.swiper instanceof HTMLElement) {
|
|
734
|
+
const i = N(), c = () => {
|
|
735
|
+
const u = typeof l.swiper == "string" ? i.querySelector(l.swiper) : l.swiper;
|
|
736
|
+
if (u && u.swiper)
|
|
737
|
+
l.swiper = u.swiper, b(), v(!0);
|
|
738
|
+
else if (u) {
|
|
739
|
+
const n = (o) => {
|
|
740
|
+
l.swiper = o.detail[0], u.removeEventListener("init", n), b(), v(!0), l.swiper.update(), e.update();
|
|
741
|
+
};
|
|
742
|
+
u.addEventListener("init", n);
|
|
743
|
+
}
|
|
744
|
+
return u;
|
|
745
|
+
}, d = () => {
|
|
746
|
+
if (e.destroyed)
|
|
747
|
+
return;
|
|
748
|
+
c() || requestAnimationFrame(d);
|
|
749
|
+
};
|
|
750
|
+
requestAnimationFrame(d);
|
|
751
|
+
} else
|
|
752
|
+
b(), v(!0);
|
|
753
|
+
}), p("slideChange update resize observerUpdate", () => {
|
|
754
|
+
v();
|
|
755
|
+
}), p("setTransition", (l, i) => {
|
|
756
|
+
const c = e.thumbs.swiper;
|
|
757
|
+
!c || c.destroyed || c.setTransition(i);
|
|
758
|
+
}), p("beforeDestroy", () => {
|
|
759
|
+
const l = e.thumbs.swiper;
|
|
760
|
+
!l || l.destroyed || f && l.destroy();
|
|
761
|
+
}), Object.assign(e.thumbs, {
|
|
762
|
+
init: b,
|
|
763
|
+
update: v
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
function le(k) {
|
|
767
|
+
let {
|
|
768
|
+
swiper: e,
|
|
769
|
+
extendParams: A,
|
|
770
|
+
emit: p,
|
|
771
|
+
once: y
|
|
772
|
+
} = k;
|
|
773
|
+
A({
|
|
774
|
+
freeMode: {
|
|
775
|
+
enabled: !1,
|
|
776
|
+
momentum: !0,
|
|
777
|
+
momentumRatio: 1,
|
|
778
|
+
momentumBounce: !0,
|
|
779
|
+
momentumBounceRatio: 1,
|
|
780
|
+
momentumVelocityRatio: 1,
|
|
781
|
+
sticky: !1,
|
|
782
|
+
minimumVelocity: 0.02
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
function f() {
|
|
786
|
+
if (e.params.cssMode)
|
|
787
|
+
return;
|
|
788
|
+
const v = e.getTranslate();
|
|
789
|
+
e.setTranslate(v), e.setTransition(0), e.touchEventsData.velocities.length = 0, e.freeMode.onTouchEnd({
|
|
790
|
+
currentPos: e.rtl ? e.translate : -e.translate
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
function C() {
|
|
794
|
+
if (e.params.cssMode)
|
|
795
|
+
return;
|
|
796
|
+
const {
|
|
797
|
+
touchEventsData: v,
|
|
798
|
+
touches: l
|
|
799
|
+
} = e;
|
|
800
|
+
v.velocities.length === 0 && v.velocities.push({
|
|
801
|
+
position: l[e.isHorizontal() ? "startX" : "startY"],
|
|
802
|
+
time: v.touchStartTime
|
|
803
|
+
}), v.velocities.push({
|
|
804
|
+
position: l[e.isHorizontal() ? "currentX" : "currentY"],
|
|
805
|
+
time: q()
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
function b(v) {
|
|
809
|
+
let {
|
|
810
|
+
currentPos: l
|
|
811
|
+
} = v;
|
|
812
|
+
if (e.params.cssMode)
|
|
813
|
+
return;
|
|
814
|
+
const {
|
|
815
|
+
params: i,
|
|
816
|
+
wrapperEl: c,
|
|
817
|
+
rtlTranslate: d,
|
|
818
|
+
snapGrid: u,
|
|
819
|
+
touchEventsData: n
|
|
820
|
+
} = e, r = q() - n.touchStartTime;
|
|
821
|
+
if (l < -e.minTranslate()) {
|
|
822
|
+
e.slideTo(e.activeIndex);
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
if (l > -e.maxTranslate()) {
|
|
826
|
+
e.slides.length < u.length ? e.slideTo(u.length - 1) : e.slideTo(e.slides.length - 1);
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (i.freeMode.momentum) {
|
|
830
|
+
if (n.velocities.length > 1) {
|
|
831
|
+
const m = n.velocities.pop(), h = n.velocities.pop(), w = m.position - h.position, I = m.time - h.time;
|
|
832
|
+
e.velocity = w / I, e.velocity /= 2, Math.abs(e.velocity) < i.freeMode.minimumVelocity && (e.velocity = 0), (I > 150 || q() - m.time > 300) && (e.velocity = 0);
|
|
833
|
+
} else
|
|
834
|
+
e.velocity = 0;
|
|
835
|
+
e.velocity *= i.freeMode.momentumVelocityRatio, n.velocities.length = 0;
|
|
836
|
+
let t = 1e3 * i.freeMode.momentumRatio;
|
|
837
|
+
const a = e.velocity * t;
|
|
838
|
+
let s = e.translate + a;
|
|
839
|
+
d && (s = -s);
|
|
840
|
+
let g = !1, x;
|
|
841
|
+
const M = Math.abs(e.velocity) * 20 * i.freeMode.momentumBounceRatio;
|
|
842
|
+
let P;
|
|
843
|
+
if (s < e.maxTranslate())
|
|
844
|
+
i.freeMode.momentumBounce ? (s + e.maxTranslate() < -M && (s = e.maxTranslate() - M), x = e.maxTranslate(), g = !0, n.allowMomentumBounce = !0) : s = e.maxTranslate(), i.loop && i.centeredSlides && (P = !0);
|
|
845
|
+
else if (s > e.minTranslate())
|
|
846
|
+
i.freeMode.momentumBounce ? (s - e.minTranslate() > M && (s = e.minTranslate() + M), x = e.minTranslate(), g = !0, n.allowMomentumBounce = !0) : s = e.minTranslate(), i.loop && i.centeredSlides && (P = !0);
|
|
847
|
+
else if (i.freeMode.sticky) {
|
|
848
|
+
let m;
|
|
849
|
+
for (let h = 0; h < u.length; h += 1)
|
|
850
|
+
if (u[h] > -s) {
|
|
851
|
+
m = h;
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
Math.abs(u[m] - s) < Math.abs(u[m - 1] - s) || e.swipeDirection === "next" ? s = u[m] : s = u[m - 1], s = -s;
|
|
855
|
+
}
|
|
856
|
+
if (P && y("transitionEnd", () => {
|
|
857
|
+
e.loopFix();
|
|
858
|
+
}), e.velocity !== 0) {
|
|
859
|
+
if (d ? t = Math.abs((-s - e.translate) / e.velocity) : t = Math.abs((s - e.translate) / e.velocity), i.freeMode.sticky) {
|
|
860
|
+
const m = Math.abs((d ? -s : s) - e.translate), h = e.slidesSizesGrid[e.activeIndex];
|
|
861
|
+
m < h ? t = i.speed : m < 2 * h ? t = i.speed * 1.5 : t = i.speed * 2.5;
|
|
862
|
+
}
|
|
863
|
+
} else if (i.freeMode.sticky) {
|
|
864
|
+
e.slideToClosest();
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
i.freeMode.momentumBounce && g ? (e.updateProgress(x), e.setTransition(t), e.setTranslate(s), e.transitionStart(!0, e.swipeDirection), e.animating = !0, F(c, () => {
|
|
868
|
+
!e || e.destroyed || !n.allowMomentumBounce || (p("momentumBounce"), e.setTransition(i.speed), setTimeout(() => {
|
|
869
|
+
e.setTranslate(x), F(c, () => {
|
|
870
|
+
!e || e.destroyed || e.transitionEnd();
|
|
871
|
+
});
|
|
872
|
+
}, 0));
|
|
873
|
+
})) : e.velocity ? (p("_freeModeNoMomentumRelease"), e.updateProgress(s), e.setTransition(t), e.setTranslate(s), e.transitionStart(!0, e.swipeDirection), e.animating || (e.animating = !0, F(c, () => {
|
|
874
|
+
!e || e.destroyed || e.transitionEnd();
|
|
875
|
+
}))) : e.updateProgress(s), e.updateActiveIndex(), e.updateSlidesClasses();
|
|
876
|
+
} else if (i.freeMode.sticky) {
|
|
877
|
+
e.slideToClosest();
|
|
878
|
+
return;
|
|
879
|
+
} else
|
|
880
|
+
i.freeMode && p("_freeModeNoMomentumRelease");
|
|
881
|
+
(!i.freeMode.momentum || r >= i.longSwipesMs) && (p("_freeModeStaticRelease"), e.updateProgress(), e.updateActiveIndex(), e.updateSlidesClasses());
|
|
882
|
+
}
|
|
883
|
+
Object.assign(e, {
|
|
884
|
+
freeMode: {
|
|
885
|
+
onTouchStart: f,
|
|
886
|
+
onTouchMove: C,
|
|
887
|
+
onTouchEnd: b
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
export {
|
|
892
|
+
ne as Autoplay,
|
|
893
|
+
se as Controller,
|
|
894
|
+
le as FreeMode,
|
|
895
|
+
te as Keyboard,
|
|
896
|
+
ae as Navigation,
|
|
897
|
+
ie as Pagination,
|
|
898
|
+
re as Thumbs,
|
|
899
|
+
ce as Zoom
|
|
900
|
+
};
|