@gravity-ui/page-constructor 7.25.0 → 8.0.0-alpha.2

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.
Files changed (49) hide show
  1. package/build/cjs/_vendor/swiper-modules.js +1309 -0
  2. package/build/cjs/_vendor/swiper-modules.js.map +7 -0
  3. package/build/cjs/_vendor/swiper-react.js +4651 -0
  4. package/build/cjs/_vendor/swiper-react.js.map +7 -0
  5. package/build/cjs/_vendor/swiper.js +3822 -0
  6. package/build/cjs/_vendor/swiper.js.map +7 -0
  7. package/build/cjs/blocks/Questions/Questions.js +3 -6
  8. package/build/cjs/blocks/Questions/Questions.js.map +1 -1
  9. package/build/cjs/blocks/Slider/Slider.d.ts +6 -4
  10. package/build/cjs/blocks/Slider/Slider.js +7 -7
  11. package/build/cjs/blocks/Slider/Slider.js.map +1 -1
  12. package/build/cjs/blocks/Slider/useSlider.d.ts +1 -2
  13. package/build/cjs/blocks/Slider/useSlider.js +3 -7
  14. package/build/cjs/blocks/Slider/useSlider.js.map +1 -1
  15. package/build/cjs/blocks/Slider/useSliderPagination.d.ts +1 -1
  16. package/build/cjs/blocks/Slider/useSliderPagination.js.map +1 -1
  17. package/build/cjs/blocks/Slider/utils.d.ts +1 -1
  18. package/build/cjs/blocks/Slider/utils.js.map +1 -1
  19. package/build/cjs/models/constructor-items/blocks.d.ts +0 -1
  20. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  21. package/build/cjs/node_modules/swiper/modules/a11y.css +9 -0
  22. package/build/cjs/node_modules/swiper/modules/autoplay.css +0 -0
  23. package/build/cjs/node_modules/swiper/modules/index.js +1309 -0
  24. package/build/cjs/node_modules/swiper/modules/pagination.css +181 -0
  25. package/build/cjs/node_modules/swiper/package.json +14 -0
  26. package/build/cjs/node_modules/swiper/swiper-react.d.ts +497 -0
  27. package/build/cjs/node_modules/swiper/swiper-react.js +4651 -0
  28. package/build/cjs/node_modules/swiper/swiper.css +229 -0
  29. package/build/cjs/node_modules/swiper/swiper.d.ts +5 -0
  30. package/build/cjs/node_modules/swiper/swiper.js +3822 -0
  31. package/build/cjs/node_modules/swiper/types/index.d.ts +6 -0
  32. package/build/cjs/node_modules/swiper/types/modules/index.d.ts +53 -0
  33. package/build/esm/blocks/Questions/Questions.js +3 -6
  34. package/build/esm/blocks/Questions/Questions.js.map +1 -1
  35. package/build/esm/blocks/Slider/Slider.d.ts +6 -4
  36. package/build/esm/blocks/Slider/Slider.js +7 -7
  37. package/build/esm/blocks/Slider/Slider.js.map +1 -1
  38. package/build/esm/blocks/Slider/useSlider.d.ts +2 -3
  39. package/build/esm/blocks/Slider/useSlider.js +3 -7
  40. package/build/esm/blocks/Slider/useSlider.js.map +1 -1
  41. package/build/esm/blocks/Slider/useSliderPagination.d.ts +1 -1
  42. package/build/esm/blocks/Slider/useSliderPagination.js.map +1 -1
  43. package/build/esm/blocks/Slider/utils.d.ts +1 -1
  44. package/build/esm/blocks/Slider/utils.js.map +1 -1
  45. package/build/esm/models/constructor-items/blocks.d.ts +0 -1
  46. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  47. package/package.json +4 -2
  48. package/server/models/constructor-items/blocks.d.ts +0 -1
  49. package/widget/index.js +1 -1
@@ -0,0 +1,3822 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // node_modules/swiper/swiper.mjs
20
+ var swiper_exports = {};
21
+ __export(swiper_exports, {
22
+ Swiper: () => Swiper,
23
+ default: () => Swiper
24
+ });
25
+ module.exports = __toCommonJS(swiper_exports);
26
+
27
+ // node_modules/swiper/shared/ssr-window.esm.mjs
28
+ function isObject(obj) {
29
+ return obj !== null && typeof obj === "object" && "constructor" in obj && obj.constructor === Object;
30
+ }
31
+ function extend(target, src) {
32
+ if (target === void 0) {
33
+ target = {};
34
+ }
35
+ if (src === void 0) {
36
+ src = {};
37
+ }
38
+ Object.keys(src).forEach((key) => {
39
+ if (typeof target[key] === "undefined") target[key] = src[key];
40
+ else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
41
+ extend(target[key], src[key]);
42
+ }
43
+ });
44
+ }
45
+ var ssrDocument = {
46
+ body: {},
47
+ addEventListener() {
48
+ },
49
+ removeEventListener() {
50
+ },
51
+ activeElement: {
52
+ blur() {
53
+ },
54
+ nodeName: ""
55
+ },
56
+ querySelector() {
57
+ return null;
58
+ },
59
+ querySelectorAll() {
60
+ return [];
61
+ },
62
+ getElementById() {
63
+ return null;
64
+ },
65
+ createEvent() {
66
+ return {
67
+ initEvent() {
68
+ }
69
+ };
70
+ },
71
+ createElement() {
72
+ return {
73
+ children: [],
74
+ childNodes: [],
75
+ style: {},
76
+ setAttribute() {
77
+ },
78
+ getElementsByTagName() {
79
+ return [];
80
+ }
81
+ };
82
+ },
83
+ createElementNS() {
84
+ return {};
85
+ },
86
+ importNode() {
87
+ return null;
88
+ },
89
+ location: {
90
+ hash: "",
91
+ host: "",
92
+ hostname: "",
93
+ href: "",
94
+ origin: "",
95
+ pathname: "",
96
+ protocol: "",
97
+ search: ""
98
+ }
99
+ };
100
+ function getDocument() {
101
+ const doc = typeof document !== "undefined" ? document : {};
102
+ extend(doc, ssrDocument);
103
+ return doc;
104
+ }
105
+ var ssrWindow = {
106
+ document: ssrDocument,
107
+ navigator: {
108
+ userAgent: ""
109
+ },
110
+ location: {
111
+ hash: "",
112
+ host: "",
113
+ hostname: "",
114
+ href: "",
115
+ origin: "",
116
+ pathname: "",
117
+ protocol: "",
118
+ search: ""
119
+ },
120
+ history: {
121
+ replaceState() {
122
+ },
123
+ pushState() {
124
+ },
125
+ go() {
126
+ },
127
+ back() {
128
+ }
129
+ },
130
+ CustomEvent: function CustomEvent() {
131
+ return this;
132
+ },
133
+ addEventListener() {
134
+ },
135
+ removeEventListener() {
136
+ },
137
+ getComputedStyle() {
138
+ return {
139
+ getPropertyValue() {
140
+ return "";
141
+ }
142
+ };
143
+ },
144
+ Image() {
145
+ },
146
+ Date() {
147
+ },
148
+ screen: {},
149
+ setTimeout() {
150
+ },
151
+ clearTimeout() {
152
+ },
153
+ matchMedia() {
154
+ return {};
155
+ },
156
+ requestAnimationFrame(callback) {
157
+ if (typeof setTimeout === "undefined") {
158
+ callback();
159
+ return null;
160
+ }
161
+ return setTimeout(callback, 0);
162
+ },
163
+ cancelAnimationFrame(id) {
164
+ if (typeof setTimeout === "undefined") {
165
+ return;
166
+ }
167
+ clearTimeout(id);
168
+ }
169
+ };
170
+ function getWindow() {
171
+ const win = typeof window !== "undefined" ? window : {};
172
+ extend(win, ssrWindow);
173
+ return win;
174
+ }
175
+
176
+ // node_modules/swiper/shared/utils.mjs
177
+ function deleteProps(obj) {
178
+ const object = obj;
179
+ Object.keys(object).forEach((key) => {
180
+ try {
181
+ object[key] = null;
182
+ } catch (e) {
183
+ }
184
+ try {
185
+ delete object[key];
186
+ } catch (e) {
187
+ }
188
+ });
189
+ }
190
+ function nextTick(callback, delay) {
191
+ if (delay === void 0) {
192
+ delay = 0;
193
+ }
194
+ return setTimeout(callback, delay);
195
+ }
196
+ function now() {
197
+ return Date.now();
198
+ }
199
+ function getComputedStyle2(el) {
200
+ const window2 = getWindow();
201
+ let style;
202
+ if (window2.getComputedStyle) {
203
+ style = window2.getComputedStyle(el, null);
204
+ }
205
+ if (!style && el.currentStyle) {
206
+ style = el.currentStyle;
207
+ }
208
+ if (!style) {
209
+ style = el.style;
210
+ }
211
+ return style;
212
+ }
213
+ function getTranslate(el, axis) {
214
+ if (axis === void 0) {
215
+ axis = "x";
216
+ }
217
+ const window2 = getWindow();
218
+ let matrix;
219
+ let curTransform;
220
+ let transformMatrix;
221
+ const curStyle = getComputedStyle2(el);
222
+ if (window2.WebKitCSSMatrix) {
223
+ curTransform = curStyle.transform || curStyle.webkitTransform;
224
+ if (curTransform.split(",").length > 6) {
225
+ curTransform = curTransform.split(", ").map((a) => a.replace(",", ".")).join(", ");
226
+ }
227
+ transformMatrix = new window2.WebKitCSSMatrix(curTransform === "none" ? "" : curTransform);
228
+ } else {
229
+ transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,");
230
+ matrix = transformMatrix.toString().split(",");
231
+ }
232
+ if (axis === "x") {
233
+ if (window2.WebKitCSSMatrix) curTransform = transformMatrix.m41;
234
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
235
+ else curTransform = parseFloat(matrix[4]);
236
+ }
237
+ if (axis === "y") {
238
+ if (window2.WebKitCSSMatrix) curTransform = transformMatrix.m42;
239
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
240
+ else curTransform = parseFloat(matrix[5]);
241
+ }
242
+ return curTransform || 0;
243
+ }
244
+ function isObject2(o) {
245
+ return typeof o === "object" && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === "Object";
246
+ }
247
+ function isNode(node) {
248
+ if (typeof window !== "undefined" && typeof window.HTMLElement !== "undefined") {
249
+ return node instanceof HTMLElement;
250
+ }
251
+ return node && (node.nodeType === 1 || node.nodeType === 11);
252
+ }
253
+ function extend2() {
254
+ const to = Object(arguments.length <= 0 ? void 0 : arguments[0]);
255
+ const noExtend = ["__proto__", "constructor", "prototype"];
256
+ for (let i = 1; i < arguments.length; i += 1) {
257
+ const nextSource = i < 0 || arguments.length <= i ? void 0 : arguments[i];
258
+ if (nextSource !== void 0 && nextSource !== null && !isNode(nextSource)) {
259
+ const keysArray = Object.keys(Object(nextSource)).filter((key) => noExtend.indexOf(key) < 0);
260
+ for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
261
+ const nextKey = keysArray[nextIndex];
262
+ const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
263
+ if (desc !== void 0 && desc.enumerable) {
264
+ if (isObject2(to[nextKey]) && isObject2(nextSource[nextKey])) {
265
+ if (nextSource[nextKey].__swiper__) {
266
+ to[nextKey] = nextSource[nextKey];
267
+ } else {
268
+ extend2(to[nextKey], nextSource[nextKey]);
269
+ }
270
+ } else if (!isObject2(to[nextKey]) && isObject2(nextSource[nextKey])) {
271
+ to[nextKey] = {};
272
+ if (nextSource[nextKey].__swiper__) {
273
+ to[nextKey] = nextSource[nextKey];
274
+ } else {
275
+ extend2(to[nextKey], nextSource[nextKey]);
276
+ }
277
+ } else {
278
+ to[nextKey] = nextSource[nextKey];
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ return to;
285
+ }
286
+ function setCSSProperty(el, varName, varValue) {
287
+ el.style.setProperty(varName, varValue);
288
+ }
289
+ function animateCSSModeScroll(_ref) {
290
+ let {
291
+ swiper,
292
+ targetPosition,
293
+ side
294
+ } = _ref;
295
+ const window2 = getWindow();
296
+ const startPosition = -swiper.translate;
297
+ let startTime = null;
298
+ let time;
299
+ const duration = swiper.params.speed;
300
+ swiper.wrapperEl.style.scrollSnapType = "none";
301
+ window2.cancelAnimationFrame(swiper.cssModeFrameID);
302
+ const dir = targetPosition > startPosition ? "next" : "prev";
303
+ const isOutOfBound = (current, target) => {
304
+ return dir === "next" && current >= target || dir === "prev" && current <= target;
305
+ };
306
+ const animate = () => {
307
+ time = (/* @__PURE__ */ new Date()).getTime();
308
+ if (startTime === null) {
309
+ startTime = time;
310
+ }
311
+ const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
312
+ const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
313
+ let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
314
+ if (isOutOfBound(currentPosition, targetPosition)) {
315
+ currentPosition = targetPosition;
316
+ }
317
+ swiper.wrapperEl.scrollTo({
318
+ [side]: currentPosition
319
+ });
320
+ if (isOutOfBound(currentPosition, targetPosition)) {
321
+ swiper.wrapperEl.style.overflow = "hidden";
322
+ swiper.wrapperEl.style.scrollSnapType = "";
323
+ setTimeout(() => {
324
+ swiper.wrapperEl.style.overflow = "";
325
+ swiper.wrapperEl.scrollTo({
326
+ [side]: currentPosition
327
+ });
328
+ });
329
+ window2.cancelAnimationFrame(swiper.cssModeFrameID);
330
+ return;
331
+ }
332
+ swiper.cssModeFrameID = window2.requestAnimationFrame(animate);
333
+ };
334
+ animate();
335
+ }
336
+ function elementChildren(element, selector) {
337
+ if (selector === void 0) {
338
+ selector = "";
339
+ }
340
+ return [...element.children].filter((el) => el.matches(selector));
341
+ }
342
+ function createElement(tag, classes2) {
343
+ if (classes2 === void 0) {
344
+ classes2 = [];
345
+ }
346
+ const el = document.createElement(tag);
347
+ el.classList.add(...Array.isArray(classes2) ? classes2 : [classes2]);
348
+ return el;
349
+ }
350
+ function elementPrevAll(el, selector) {
351
+ const prevEls = [];
352
+ while (el.previousElementSibling) {
353
+ const prev = el.previousElementSibling;
354
+ if (selector) {
355
+ if (prev.matches(selector)) prevEls.push(prev);
356
+ } else prevEls.push(prev);
357
+ el = prev;
358
+ }
359
+ return prevEls;
360
+ }
361
+ function elementNextAll(el, selector) {
362
+ const nextEls = [];
363
+ while (el.nextElementSibling) {
364
+ const next = el.nextElementSibling;
365
+ if (selector) {
366
+ if (next.matches(selector)) nextEls.push(next);
367
+ } else nextEls.push(next);
368
+ el = next;
369
+ }
370
+ return nextEls;
371
+ }
372
+ function elementStyle(el, prop) {
373
+ const window2 = getWindow();
374
+ return window2.getComputedStyle(el, null).getPropertyValue(prop);
375
+ }
376
+ function elementIndex(el) {
377
+ let child = el;
378
+ let i;
379
+ if (child) {
380
+ i = 0;
381
+ while ((child = child.previousSibling) !== null) {
382
+ if (child.nodeType === 1) i += 1;
383
+ }
384
+ return i;
385
+ }
386
+ return void 0;
387
+ }
388
+ function elementParents(el, selector) {
389
+ const parents = [];
390
+ let parent = el.parentElement;
391
+ while (parent) {
392
+ if (selector) {
393
+ if (parent.matches(selector)) parents.push(parent);
394
+ } else {
395
+ parents.push(parent);
396
+ }
397
+ parent = parent.parentElement;
398
+ }
399
+ return parents;
400
+ }
401
+ function elementOuterSize(el, size, includeMargins) {
402
+ const window2 = getWindow();
403
+ if (includeMargins) {
404
+ return el[size === "width" ? "offsetWidth" : "offsetHeight"] + parseFloat(window2.getComputedStyle(el, null).getPropertyValue(size === "width" ? "margin-right" : "margin-top")) + parseFloat(window2.getComputedStyle(el, null).getPropertyValue(size === "width" ? "margin-left" : "margin-bottom"));
405
+ }
406
+ return el.offsetWidth;
407
+ }
408
+
409
+ // node_modules/swiper/shared/swiper-core.mjs
410
+ var support;
411
+ function calcSupport() {
412
+ const window2 = getWindow();
413
+ const document2 = getDocument();
414
+ return {
415
+ smoothScroll: document2.documentElement && document2.documentElement.style && "scrollBehavior" in document2.documentElement.style,
416
+ touch: !!("ontouchstart" in window2 || window2.DocumentTouch && document2 instanceof window2.DocumentTouch)
417
+ };
418
+ }
419
+ function getSupport() {
420
+ if (!support) {
421
+ support = calcSupport();
422
+ }
423
+ return support;
424
+ }
425
+ var deviceCached;
426
+ function calcDevice(_temp) {
427
+ let {
428
+ userAgent
429
+ } = _temp === void 0 ? {} : _temp;
430
+ const support2 = getSupport();
431
+ const window2 = getWindow();
432
+ const platform = window2.navigator.platform;
433
+ const ua = userAgent || window2.navigator.userAgent;
434
+ const device = {
435
+ ios: false,
436
+ android: false
437
+ };
438
+ const screenWidth = window2.screen.width;
439
+ const screenHeight = window2.screen.height;
440
+ const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
441
+ let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
442
+ const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
443
+ const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
444
+ const windows = platform === "Win32";
445
+ let macos = platform === "MacIntel";
446
+ const iPadScreens = ["1024x1366", "1366x1024", "834x1194", "1194x834", "834x1112", "1112x834", "768x1024", "1024x768", "820x1180", "1180x820", "810x1080", "1080x810"];
447
+ if (!ipad && macos && support2.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {
448
+ ipad = ua.match(/(Version)\/([\d.]+)/);
449
+ if (!ipad) ipad = [0, 1, "13_0_0"];
450
+ macos = false;
451
+ }
452
+ if (android && !windows) {
453
+ device.os = "android";
454
+ device.android = true;
455
+ }
456
+ if (ipad || iphone || ipod) {
457
+ device.os = "ios";
458
+ device.ios = true;
459
+ }
460
+ return device;
461
+ }
462
+ function getDevice(overrides) {
463
+ if (overrides === void 0) {
464
+ overrides = {};
465
+ }
466
+ if (!deviceCached) {
467
+ deviceCached = calcDevice(overrides);
468
+ }
469
+ return deviceCached;
470
+ }
471
+ var browser;
472
+ function calcBrowser() {
473
+ const window2 = getWindow();
474
+ let needPerspectiveFix = false;
475
+ function isSafari() {
476
+ const ua = window2.navigator.userAgent.toLowerCase();
477
+ return ua.indexOf("safari") >= 0 && ua.indexOf("chrome") < 0 && ua.indexOf("android") < 0;
478
+ }
479
+ if (isSafari()) {
480
+ const ua = String(window2.navigator.userAgent);
481
+ if (ua.includes("Version/")) {
482
+ const [major, minor] = ua.split("Version/")[1].split(" ")[0].split(".").map((num) => Number(num));
483
+ needPerspectiveFix = major < 16 || major === 16 && minor < 2;
484
+ }
485
+ }
486
+ return {
487
+ isSafari: needPerspectiveFix || isSafari(),
488
+ needPerspectiveFix,
489
+ isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window2.navigator.userAgent)
490
+ };
491
+ }
492
+ function getBrowser() {
493
+ if (!browser) {
494
+ browser = calcBrowser();
495
+ }
496
+ return browser;
497
+ }
498
+ function Resize(_ref) {
499
+ let {
500
+ swiper,
501
+ on,
502
+ emit
503
+ } = _ref;
504
+ const window2 = getWindow();
505
+ let observer = null;
506
+ let animationFrame = null;
507
+ const resizeHandler = () => {
508
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
509
+ emit("beforeResize");
510
+ emit("resize");
511
+ };
512
+ const createObserver = () => {
513
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
514
+ observer = new ResizeObserver((entries) => {
515
+ animationFrame = window2.requestAnimationFrame(() => {
516
+ const {
517
+ width,
518
+ height
519
+ } = swiper;
520
+ let newWidth = width;
521
+ let newHeight = height;
522
+ entries.forEach((_ref2) => {
523
+ let {
524
+ contentBoxSize,
525
+ contentRect,
526
+ target
527
+ } = _ref2;
528
+ if (target && target !== swiper.el) return;
529
+ newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
530
+ newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
531
+ });
532
+ if (newWidth !== width || newHeight !== height) {
533
+ resizeHandler();
534
+ }
535
+ });
536
+ });
537
+ observer.observe(swiper.el);
538
+ };
539
+ const removeObserver = () => {
540
+ if (animationFrame) {
541
+ window2.cancelAnimationFrame(animationFrame);
542
+ }
543
+ if (observer && observer.unobserve && swiper.el) {
544
+ observer.unobserve(swiper.el);
545
+ observer = null;
546
+ }
547
+ };
548
+ const orientationChangeHandler = () => {
549
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
550
+ emit("orientationchange");
551
+ };
552
+ on("init", () => {
553
+ if (swiper.params.resizeObserver && typeof window2.ResizeObserver !== "undefined") {
554
+ createObserver();
555
+ return;
556
+ }
557
+ window2.addEventListener("resize", resizeHandler);
558
+ window2.addEventListener("orientationchange", orientationChangeHandler);
559
+ });
560
+ on("destroy", () => {
561
+ removeObserver();
562
+ window2.removeEventListener("resize", resizeHandler);
563
+ window2.removeEventListener("orientationchange", orientationChangeHandler);
564
+ });
565
+ }
566
+ function Observer(_ref) {
567
+ let {
568
+ swiper,
569
+ extendParams,
570
+ on,
571
+ emit
572
+ } = _ref;
573
+ const observers = [];
574
+ const window2 = getWindow();
575
+ const attach = function(target, options) {
576
+ if (options === void 0) {
577
+ options = {};
578
+ }
579
+ const ObserverFunc = window2.MutationObserver || window2.WebkitMutationObserver;
580
+ const observer = new ObserverFunc((mutations) => {
581
+ if (swiper.__preventObserver__) return;
582
+ if (mutations.length === 1) {
583
+ emit("observerUpdate", mutations[0]);
584
+ return;
585
+ }
586
+ const observerUpdate = function observerUpdate2() {
587
+ emit("observerUpdate", mutations[0]);
588
+ };
589
+ if (window2.requestAnimationFrame) {
590
+ window2.requestAnimationFrame(observerUpdate);
591
+ } else {
592
+ window2.setTimeout(observerUpdate, 0);
593
+ }
594
+ });
595
+ observer.observe(target, {
596
+ attributes: typeof options.attributes === "undefined" ? true : options.attributes,
597
+ childList: typeof options.childList === "undefined" ? true : options.childList,
598
+ characterData: typeof options.characterData === "undefined" ? true : options.characterData
599
+ });
600
+ observers.push(observer);
601
+ };
602
+ const init = () => {
603
+ if (!swiper.params.observer) return;
604
+ if (swiper.params.observeParents) {
605
+ const containerParents = elementParents(swiper.hostEl);
606
+ for (let i = 0; i < containerParents.length; i += 1) {
607
+ attach(containerParents[i]);
608
+ }
609
+ }
610
+ attach(swiper.hostEl, {
611
+ childList: swiper.params.observeSlideChildren
612
+ });
613
+ attach(swiper.wrapperEl, {
614
+ attributes: false
615
+ });
616
+ };
617
+ const destroy = () => {
618
+ observers.forEach((observer) => {
619
+ observer.disconnect();
620
+ });
621
+ observers.splice(0, observers.length);
622
+ };
623
+ extendParams({
624
+ observer: false,
625
+ observeParents: false,
626
+ observeSlideChildren: false
627
+ });
628
+ on("init", init);
629
+ on("destroy", destroy);
630
+ }
631
+ var eventsEmitter = {
632
+ on(events2, handler, priority) {
633
+ const self = this;
634
+ if (!self.eventsListeners || self.destroyed) return self;
635
+ if (typeof handler !== "function") return self;
636
+ const method = priority ? "unshift" : "push";
637
+ events2.split(" ").forEach((event) => {
638
+ if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
639
+ self.eventsListeners[event][method](handler);
640
+ });
641
+ return self;
642
+ },
643
+ once(events2, handler, priority) {
644
+ const self = this;
645
+ if (!self.eventsListeners || self.destroyed) return self;
646
+ if (typeof handler !== "function") return self;
647
+ function onceHandler() {
648
+ self.off(events2, onceHandler);
649
+ if (onceHandler.__emitterProxy) {
650
+ delete onceHandler.__emitterProxy;
651
+ }
652
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
653
+ args[_key] = arguments[_key];
654
+ }
655
+ handler.apply(self, args);
656
+ }
657
+ onceHandler.__emitterProxy = handler;
658
+ return self.on(events2, onceHandler, priority);
659
+ },
660
+ onAny(handler, priority) {
661
+ const self = this;
662
+ if (!self.eventsListeners || self.destroyed) return self;
663
+ if (typeof handler !== "function") return self;
664
+ const method = priority ? "unshift" : "push";
665
+ if (self.eventsAnyListeners.indexOf(handler) < 0) {
666
+ self.eventsAnyListeners[method](handler);
667
+ }
668
+ return self;
669
+ },
670
+ offAny(handler) {
671
+ const self = this;
672
+ if (!self.eventsListeners || self.destroyed) return self;
673
+ if (!self.eventsAnyListeners) return self;
674
+ const index = self.eventsAnyListeners.indexOf(handler);
675
+ if (index >= 0) {
676
+ self.eventsAnyListeners.splice(index, 1);
677
+ }
678
+ return self;
679
+ },
680
+ off(events2, handler) {
681
+ const self = this;
682
+ if (!self.eventsListeners || self.destroyed) return self;
683
+ if (!self.eventsListeners) return self;
684
+ events2.split(" ").forEach((event) => {
685
+ if (typeof handler === "undefined") {
686
+ self.eventsListeners[event] = [];
687
+ } else if (self.eventsListeners[event]) {
688
+ self.eventsListeners[event].forEach((eventHandler, index) => {
689
+ if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
690
+ self.eventsListeners[event].splice(index, 1);
691
+ }
692
+ });
693
+ }
694
+ });
695
+ return self;
696
+ },
697
+ emit() {
698
+ const self = this;
699
+ if (!self.eventsListeners || self.destroyed) return self;
700
+ if (!self.eventsListeners) return self;
701
+ let events2;
702
+ let data;
703
+ let context;
704
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
705
+ args[_key2] = arguments[_key2];
706
+ }
707
+ if (typeof args[0] === "string" || Array.isArray(args[0])) {
708
+ events2 = args[0];
709
+ data = args.slice(1, args.length);
710
+ context = self;
711
+ } else {
712
+ events2 = args[0].events;
713
+ data = args[0].data;
714
+ context = args[0].context || self;
715
+ }
716
+ data.unshift(context);
717
+ const eventsArray = Array.isArray(events2) ? events2 : events2.split(" ");
718
+ eventsArray.forEach((event) => {
719
+ if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
720
+ self.eventsAnyListeners.forEach((eventHandler) => {
721
+ eventHandler.apply(context, [event, ...data]);
722
+ });
723
+ }
724
+ if (self.eventsListeners && self.eventsListeners[event]) {
725
+ self.eventsListeners[event].forEach((eventHandler) => {
726
+ eventHandler.apply(context, data);
727
+ });
728
+ }
729
+ });
730
+ return self;
731
+ }
732
+ };
733
+ function updateSize() {
734
+ const swiper = this;
735
+ let width;
736
+ let height;
737
+ const el = swiper.el;
738
+ if (typeof swiper.params.width !== "undefined" && swiper.params.width !== null) {
739
+ width = swiper.params.width;
740
+ } else {
741
+ width = el.clientWidth;
742
+ }
743
+ if (typeof swiper.params.height !== "undefined" && swiper.params.height !== null) {
744
+ height = swiper.params.height;
745
+ } else {
746
+ height = el.clientHeight;
747
+ }
748
+ if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
749
+ return;
750
+ }
751
+ width = width - parseInt(elementStyle(el, "padding-left") || 0, 10) - parseInt(elementStyle(el, "padding-right") || 0, 10);
752
+ height = height - parseInt(elementStyle(el, "padding-top") || 0, 10) - parseInt(elementStyle(el, "padding-bottom") || 0, 10);
753
+ if (Number.isNaN(width)) width = 0;
754
+ if (Number.isNaN(height)) height = 0;
755
+ Object.assign(swiper, {
756
+ width,
757
+ height,
758
+ size: swiper.isHorizontal() ? width : height
759
+ });
760
+ }
761
+ function updateSlides() {
762
+ const swiper = this;
763
+ function getDirectionLabel(property) {
764
+ if (swiper.isHorizontal()) {
765
+ return property;
766
+ }
767
+ return {
768
+ "width": "height",
769
+ "margin-top": "margin-left",
770
+ "margin-bottom ": "margin-right",
771
+ "margin-left": "margin-top",
772
+ "margin-right": "margin-bottom",
773
+ "padding-left": "padding-top",
774
+ "padding-right": "padding-bottom",
775
+ "marginRight": "marginBottom"
776
+ }[property];
777
+ }
778
+ function getDirectionPropertyValue(node, label) {
779
+ return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
780
+ }
781
+ const params = swiper.params;
782
+ const {
783
+ wrapperEl,
784
+ slidesEl,
785
+ size: swiperSize,
786
+ rtlTranslate: rtl,
787
+ wrongRTL
788
+ } = swiper;
789
+ const isVirtual = swiper.virtual && params.virtual.enabled;
790
+ const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
791
+ const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);
792
+ const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
793
+ let snapGrid = [];
794
+ const slidesGrid = [];
795
+ const slidesSizesGrid = [];
796
+ let offsetBefore = params.slidesOffsetBefore;
797
+ if (typeof offsetBefore === "function") {
798
+ offsetBefore = params.slidesOffsetBefore.call(swiper);
799
+ }
800
+ let offsetAfter = params.slidesOffsetAfter;
801
+ if (typeof offsetAfter === "function") {
802
+ offsetAfter = params.slidesOffsetAfter.call(swiper);
803
+ }
804
+ const previousSnapGridLength = swiper.snapGrid.length;
805
+ const previousSlidesGridLength = swiper.slidesGrid.length;
806
+ let spaceBetween = params.spaceBetween;
807
+ let slidePosition = -offsetBefore;
808
+ let prevSlideSize = 0;
809
+ let index = 0;
810
+ if (typeof swiperSize === "undefined") {
811
+ return;
812
+ }
813
+ if (typeof spaceBetween === "string" && spaceBetween.indexOf("%") >= 0) {
814
+ spaceBetween = parseFloat(spaceBetween.replace("%", "")) / 100 * swiperSize;
815
+ } else if (typeof spaceBetween === "string") {
816
+ spaceBetween = parseFloat(spaceBetween);
817
+ }
818
+ swiper.virtualSize = -spaceBetween;
819
+ slides.forEach((slideEl) => {
820
+ if (rtl) {
821
+ slideEl.style.marginLeft = "";
822
+ } else {
823
+ slideEl.style.marginRight = "";
824
+ }
825
+ slideEl.style.marginBottom = "";
826
+ slideEl.style.marginTop = "";
827
+ });
828
+ if (params.centeredSlides && params.cssMode) {
829
+ setCSSProperty(wrapperEl, "--swiper-centered-offset-before", "");
830
+ setCSSProperty(wrapperEl, "--swiper-centered-offset-after", "");
831
+ }
832
+ const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
833
+ if (gridEnabled) {
834
+ swiper.grid.initSlides(slidesLength);
835
+ }
836
+ let slideSize;
837
+ const shouldResetSlideSize = params.slidesPerView === "auto" && params.breakpoints && Object.keys(params.breakpoints).filter((key) => {
838
+ return typeof params.breakpoints[key].slidesPerView !== "undefined";
839
+ }).length > 0;
840
+ for (let i = 0; i < slidesLength; i += 1) {
841
+ slideSize = 0;
842
+ let slide2;
843
+ if (slides[i]) slide2 = slides[i];
844
+ if (gridEnabled) {
845
+ swiper.grid.updateSlide(i, slide2, slidesLength, getDirectionLabel);
846
+ }
847
+ if (slides[i] && elementStyle(slide2, "display") === "none") continue;
848
+ if (params.slidesPerView === "auto") {
849
+ if (shouldResetSlideSize) {
850
+ slides[i].style[getDirectionLabel("width")] = ``;
851
+ }
852
+ const slideStyles = getComputedStyle(slide2);
853
+ const currentTransform = slide2.style.transform;
854
+ const currentWebKitTransform = slide2.style.webkitTransform;
855
+ if (currentTransform) {
856
+ slide2.style.transform = "none";
857
+ }
858
+ if (currentWebKitTransform) {
859
+ slide2.style.webkitTransform = "none";
860
+ }
861
+ if (params.roundLengths) {
862
+ slideSize = swiper.isHorizontal() ? elementOuterSize(slide2, "width", true) : elementOuterSize(slide2, "height", true);
863
+ } else {
864
+ const width = getDirectionPropertyValue(slideStyles, "width");
865
+ const paddingLeft = getDirectionPropertyValue(slideStyles, "padding-left");
866
+ const paddingRight = getDirectionPropertyValue(slideStyles, "padding-right");
867
+ const marginLeft = getDirectionPropertyValue(slideStyles, "margin-left");
868
+ const marginRight = getDirectionPropertyValue(slideStyles, "margin-right");
869
+ const boxSizing = slideStyles.getPropertyValue("box-sizing");
870
+ if (boxSizing && boxSizing === "border-box") {
871
+ slideSize = width + marginLeft + marginRight;
872
+ } else {
873
+ const {
874
+ clientWidth,
875
+ offsetWidth
876
+ } = slide2;
877
+ slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
878
+ }
879
+ }
880
+ if (currentTransform) {
881
+ slide2.style.transform = currentTransform;
882
+ }
883
+ if (currentWebKitTransform) {
884
+ slide2.style.webkitTransform = currentWebKitTransform;
885
+ }
886
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
887
+ } else {
888
+ slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
889
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
890
+ if (slides[i]) {
891
+ slides[i].style[getDirectionLabel("width")] = `${slideSize}px`;
892
+ }
893
+ }
894
+ if (slides[i]) {
895
+ slides[i].swiperSlideSize = slideSize;
896
+ }
897
+ slidesSizesGrid.push(slideSize);
898
+ if (params.centeredSlides) {
899
+ slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
900
+ if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
901
+ if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
902
+ if (Math.abs(slidePosition) < 1 / 1e3) slidePosition = 0;
903
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
904
+ if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
905
+ slidesGrid.push(slidePosition);
906
+ } else {
907
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
908
+ if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
909
+ slidesGrid.push(slidePosition);
910
+ slidePosition = slidePosition + slideSize + spaceBetween;
911
+ }
912
+ swiper.virtualSize += slideSize + spaceBetween;
913
+ prevSlideSize = slideSize;
914
+ index += 1;
915
+ }
916
+ swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
917
+ if (rtl && wrongRTL && (params.effect === "slide" || params.effect === "coverflow")) {
918
+ wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
919
+ }
920
+ if (params.setWrapperSize) {
921
+ wrapperEl.style[getDirectionLabel("width")] = `${swiper.virtualSize + spaceBetween}px`;
922
+ }
923
+ if (gridEnabled) {
924
+ swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
925
+ }
926
+ if (!params.centeredSlides) {
927
+ const newSlidesGrid = [];
928
+ for (let i = 0; i < snapGrid.length; i += 1) {
929
+ let slidesGridItem = snapGrid[i];
930
+ if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
931
+ if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
932
+ newSlidesGrid.push(slidesGridItem);
933
+ }
934
+ }
935
+ snapGrid = newSlidesGrid;
936
+ if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
937
+ snapGrid.push(swiper.virtualSize - swiperSize);
938
+ }
939
+ }
940
+ if (isVirtual && params.loop) {
941
+ const size = slidesSizesGrid[0] + spaceBetween;
942
+ if (params.slidesPerGroup > 1) {
943
+ const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup);
944
+ const groupSize = size * params.slidesPerGroup;
945
+ for (let i = 0; i < groups; i += 1) {
946
+ snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize);
947
+ }
948
+ }
949
+ for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) {
950
+ if (params.slidesPerGroup === 1) {
951
+ snapGrid.push(snapGrid[snapGrid.length - 1] + size);
952
+ }
953
+ slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size);
954
+ swiper.virtualSize += size;
955
+ }
956
+ }
957
+ if (snapGrid.length === 0) snapGrid = [0];
958
+ if (spaceBetween !== 0) {
959
+ const key = swiper.isHorizontal() && rtl ? "marginLeft" : getDirectionLabel("marginRight");
960
+ slides.filter((_, slideIndex) => {
961
+ if (!params.cssMode || params.loop) return true;
962
+ if (slideIndex === slides.length - 1) {
963
+ return false;
964
+ }
965
+ return true;
966
+ }).forEach((slideEl) => {
967
+ slideEl.style[key] = `${spaceBetween}px`;
968
+ });
969
+ }
970
+ if (params.centeredSlides && params.centeredSlidesBounds) {
971
+ let allSlidesSize = 0;
972
+ slidesSizesGrid.forEach((slideSizeValue) => {
973
+ allSlidesSize += slideSizeValue + (spaceBetween || 0);
974
+ });
975
+ allSlidesSize -= spaceBetween;
976
+ const maxSnap = allSlidesSize - swiperSize;
977
+ snapGrid = snapGrid.map((snap) => {
978
+ if (snap <= 0) return -offsetBefore;
979
+ if (snap > maxSnap) return maxSnap + offsetAfter;
980
+ return snap;
981
+ });
982
+ }
983
+ if (params.centerInsufficientSlides) {
984
+ let allSlidesSize = 0;
985
+ slidesSizesGrid.forEach((slideSizeValue) => {
986
+ allSlidesSize += slideSizeValue + (spaceBetween || 0);
987
+ });
988
+ allSlidesSize -= spaceBetween;
989
+ if (allSlidesSize < swiperSize) {
990
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
991
+ snapGrid.forEach((snap, snapIndex) => {
992
+ snapGrid[snapIndex] = snap - allSlidesOffset;
993
+ });
994
+ slidesGrid.forEach((snap, snapIndex) => {
995
+ slidesGrid[snapIndex] = snap + allSlidesOffset;
996
+ });
997
+ }
998
+ }
999
+ Object.assign(swiper, {
1000
+ slides,
1001
+ snapGrid,
1002
+ slidesGrid,
1003
+ slidesSizesGrid
1004
+ });
1005
+ if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
1006
+ setCSSProperty(wrapperEl, "--swiper-centered-offset-before", `${-snapGrid[0]}px`);
1007
+ setCSSProperty(wrapperEl, "--swiper-centered-offset-after", `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
1008
+ const addToSnapGrid = -swiper.snapGrid[0];
1009
+ const addToSlidesGrid = -swiper.slidesGrid[0];
1010
+ swiper.snapGrid = swiper.snapGrid.map((v) => v + addToSnapGrid);
1011
+ swiper.slidesGrid = swiper.slidesGrid.map((v) => v + addToSlidesGrid);
1012
+ }
1013
+ if (slidesLength !== previousSlidesLength) {
1014
+ swiper.emit("slidesLengthChange");
1015
+ }
1016
+ if (snapGrid.length !== previousSnapGridLength) {
1017
+ if (swiper.params.watchOverflow) swiper.checkOverflow();
1018
+ swiper.emit("snapGridLengthChange");
1019
+ }
1020
+ if (slidesGrid.length !== previousSlidesGridLength) {
1021
+ swiper.emit("slidesGridLengthChange");
1022
+ }
1023
+ if (params.watchSlidesProgress) {
1024
+ swiper.updateSlidesOffset();
1025
+ }
1026
+ if (!isVirtual && !params.cssMode && (params.effect === "slide" || params.effect === "fade")) {
1027
+ const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
1028
+ const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
1029
+ if (slidesLength <= params.maxBackfaceHiddenSlides) {
1030
+ if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass);
1031
+ } else if (hasClassBackfaceClassAdded) {
1032
+ swiper.el.classList.remove(backFaceHiddenClass);
1033
+ }
1034
+ }
1035
+ }
1036
+ function updateAutoHeight(speed) {
1037
+ const swiper = this;
1038
+ const activeSlides = [];
1039
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1040
+ let newHeight = 0;
1041
+ let i;
1042
+ if (typeof speed === "number") {
1043
+ swiper.setTransition(speed);
1044
+ } else if (speed === true) {
1045
+ swiper.setTransition(swiper.params.speed);
1046
+ }
1047
+ const getSlideByIndex = (index) => {
1048
+ if (isVirtual) {
1049
+ return swiper.slides[swiper.getSlideIndexByData(index)];
1050
+ }
1051
+ return swiper.slides[index];
1052
+ };
1053
+ if (swiper.params.slidesPerView !== "auto" && swiper.params.slidesPerView > 1) {
1054
+ if (swiper.params.centeredSlides) {
1055
+ (swiper.visibleSlides || []).forEach((slide2) => {
1056
+ activeSlides.push(slide2);
1057
+ });
1058
+ } else {
1059
+ for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
1060
+ const index = swiper.activeIndex + i;
1061
+ if (index > swiper.slides.length && !isVirtual) break;
1062
+ activeSlides.push(getSlideByIndex(index));
1063
+ }
1064
+ }
1065
+ } else {
1066
+ activeSlides.push(getSlideByIndex(swiper.activeIndex));
1067
+ }
1068
+ for (i = 0; i < activeSlides.length; i += 1) {
1069
+ if (typeof activeSlides[i] !== "undefined") {
1070
+ const height = activeSlides[i].offsetHeight;
1071
+ newHeight = height > newHeight ? height : newHeight;
1072
+ }
1073
+ }
1074
+ if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`;
1075
+ }
1076
+ function updateSlidesOffset() {
1077
+ const swiper = this;
1078
+ const slides = swiper.slides;
1079
+ const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0;
1080
+ for (let i = 0; i < slides.length; i += 1) {
1081
+ slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();
1082
+ }
1083
+ }
1084
+ function updateSlidesProgress(translate2) {
1085
+ if (translate2 === void 0) {
1086
+ translate2 = this && this.translate || 0;
1087
+ }
1088
+ const swiper = this;
1089
+ const params = swiper.params;
1090
+ const {
1091
+ slides,
1092
+ rtlTranslate: rtl,
1093
+ snapGrid
1094
+ } = swiper;
1095
+ if (slides.length === 0) return;
1096
+ if (typeof slides[0].swiperSlideOffset === "undefined") swiper.updateSlidesOffset();
1097
+ let offsetCenter = -translate2;
1098
+ if (rtl) offsetCenter = translate2;
1099
+ slides.forEach((slideEl) => {
1100
+ slideEl.classList.remove(params.slideVisibleClass);
1101
+ });
1102
+ swiper.visibleSlidesIndexes = [];
1103
+ swiper.visibleSlides = [];
1104
+ let spaceBetween = params.spaceBetween;
1105
+ if (typeof spaceBetween === "string" && spaceBetween.indexOf("%") >= 0) {
1106
+ spaceBetween = parseFloat(spaceBetween.replace("%", "")) / 100 * swiper.size;
1107
+ } else if (typeof spaceBetween === "string") {
1108
+ spaceBetween = parseFloat(spaceBetween);
1109
+ }
1110
+ for (let i = 0; i < slides.length; i += 1) {
1111
+ const slide2 = slides[i];
1112
+ let slideOffset = slide2.swiperSlideOffset;
1113
+ if (params.cssMode && params.centeredSlides) {
1114
+ slideOffset -= slides[0].swiperSlideOffset;
1115
+ }
1116
+ const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide2.swiperSlideSize + spaceBetween);
1117
+ const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide2.swiperSlideSize + spaceBetween);
1118
+ const slideBefore = -(offsetCenter - slideOffset);
1119
+ const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
1120
+ const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
1121
+ if (isVisible) {
1122
+ swiper.visibleSlides.push(slide2);
1123
+ swiper.visibleSlidesIndexes.push(i);
1124
+ slides[i].classList.add(params.slideVisibleClass);
1125
+ }
1126
+ slide2.progress = rtl ? -slideProgress : slideProgress;
1127
+ slide2.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
1128
+ }
1129
+ }
1130
+ function updateProgress(translate2) {
1131
+ const swiper = this;
1132
+ if (typeof translate2 === "undefined") {
1133
+ const multiplier = swiper.rtlTranslate ? -1 : 1;
1134
+ translate2 = swiper && swiper.translate && swiper.translate * multiplier || 0;
1135
+ }
1136
+ const params = swiper.params;
1137
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1138
+ let {
1139
+ progress,
1140
+ isBeginning,
1141
+ isEnd,
1142
+ progressLoop
1143
+ } = swiper;
1144
+ const wasBeginning = isBeginning;
1145
+ const wasEnd = isEnd;
1146
+ if (translatesDiff === 0) {
1147
+ progress = 0;
1148
+ isBeginning = true;
1149
+ isEnd = true;
1150
+ } else {
1151
+ progress = (translate2 - swiper.minTranslate()) / translatesDiff;
1152
+ const isBeginningRounded = Math.abs(translate2 - swiper.minTranslate()) < 1;
1153
+ const isEndRounded = Math.abs(translate2 - swiper.maxTranslate()) < 1;
1154
+ isBeginning = isBeginningRounded || progress <= 0;
1155
+ isEnd = isEndRounded || progress >= 1;
1156
+ if (isBeginningRounded) progress = 0;
1157
+ if (isEndRounded) progress = 1;
1158
+ }
1159
+ if (params.loop) {
1160
+ const firstSlideIndex = swiper.getSlideIndexByData(0);
1161
+ const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1);
1162
+ const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex];
1163
+ const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex];
1164
+ const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1];
1165
+ const translateAbs = Math.abs(translate2);
1166
+ if (translateAbs >= firstSlideTranslate) {
1167
+ progressLoop = (translateAbs - firstSlideTranslate) / translateMax;
1168
+ } else {
1169
+ progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax;
1170
+ }
1171
+ if (progressLoop > 1) progressLoop -= 1;
1172
+ }
1173
+ Object.assign(swiper, {
1174
+ progress,
1175
+ progressLoop,
1176
+ isBeginning,
1177
+ isEnd
1178
+ });
1179
+ if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate2);
1180
+ if (isBeginning && !wasBeginning) {
1181
+ swiper.emit("reachBeginning toEdge");
1182
+ }
1183
+ if (isEnd && !wasEnd) {
1184
+ swiper.emit("reachEnd toEdge");
1185
+ }
1186
+ if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
1187
+ swiper.emit("fromEdge");
1188
+ }
1189
+ swiper.emit("progress", progress);
1190
+ }
1191
+ function updateSlidesClasses() {
1192
+ const swiper = this;
1193
+ const {
1194
+ slides,
1195
+ params,
1196
+ slidesEl,
1197
+ activeIndex
1198
+ } = swiper;
1199
+ const isVirtual = swiper.virtual && params.virtual.enabled;
1200
+ const getFilteredSlide = (selector) => {
1201
+ return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
1202
+ };
1203
+ slides.forEach((slideEl) => {
1204
+ slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
1205
+ });
1206
+ let activeSlide;
1207
+ if (isVirtual) {
1208
+ if (params.loop) {
1209
+ let slideIndex = activeIndex - swiper.virtual.slidesBefore;
1210
+ if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex;
1211
+ if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length;
1212
+ activeSlide = getFilteredSlide(`[data-swiper-slide-index="${slideIndex}"]`);
1213
+ } else {
1214
+ activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
1215
+ }
1216
+ } else {
1217
+ activeSlide = slides[activeIndex];
1218
+ }
1219
+ if (activeSlide) {
1220
+ activeSlide.classList.add(params.slideActiveClass);
1221
+ let nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1222
+ if (params.loop && !nextSlide) {
1223
+ nextSlide = slides[0];
1224
+ }
1225
+ if (nextSlide) {
1226
+ nextSlide.classList.add(params.slideNextClass);
1227
+ }
1228
+ let prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1229
+ if (params.loop && !prevSlide === 0) {
1230
+ prevSlide = slides[slides.length - 1];
1231
+ }
1232
+ if (prevSlide) {
1233
+ prevSlide.classList.add(params.slidePrevClass);
1234
+ }
1235
+ }
1236
+ swiper.emitSlidesClasses();
1237
+ }
1238
+ var processLazyPreloader = (swiper, imageEl) => {
1239
+ if (!swiper || swiper.destroyed || !swiper.params) return;
1240
+ const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;
1241
+ const slideEl = imageEl.closest(slideSelector());
1242
+ if (slideEl) {
1243
+ let lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1244
+ if (!lazyEl && swiper.isElement) {
1245
+ if (slideEl.shadowRoot) {
1246
+ lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1247
+ } else {
1248
+ requestAnimationFrame(() => {
1249
+ if (slideEl.shadowRoot) {
1250
+ lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1251
+ if (lazyEl) lazyEl.remove();
1252
+ }
1253
+ });
1254
+ }
1255
+ }
1256
+ if (lazyEl) lazyEl.remove();
1257
+ }
1258
+ };
1259
+ var unlazy = (swiper, index) => {
1260
+ if (!swiper.slides[index]) return;
1261
+ const imageEl = swiper.slides[index].querySelector('[loading="lazy"]');
1262
+ if (imageEl) imageEl.removeAttribute("loading");
1263
+ };
1264
+ var preload = (swiper) => {
1265
+ if (!swiper || swiper.destroyed || !swiper.params) return;
1266
+ let amount = swiper.params.lazyPreloadPrevNext;
1267
+ const len = swiper.slides.length;
1268
+ if (!len || !amount || amount < 0) return;
1269
+ amount = Math.min(amount, len);
1270
+ const slidesPerView = swiper.params.slidesPerView === "auto" ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView);
1271
+ const activeIndex = swiper.activeIndex;
1272
+ if (swiper.params.grid && swiper.params.grid.rows > 1) {
1273
+ const activeColumn = activeIndex;
1274
+ const preloadColumns = [activeColumn - amount];
1275
+ preloadColumns.push(...Array.from({
1276
+ length: amount
1277
+ }).map((_, i) => {
1278
+ return activeColumn + slidesPerView + i;
1279
+ }));
1280
+ swiper.slides.forEach((slideEl, i) => {
1281
+ if (preloadColumns.includes(slideEl.column)) unlazy(swiper, i);
1282
+ });
1283
+ return;
1284
+ }
1285
+ const slideIndexLastInView = activeIndex + slidesPerView - 1;
1286
+ if (swiper.params.rewind || swiper.params.loop) {
1287
+ for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) {
1288
+ const realIndex = (i % len + len) % len;
1289
+ if (realIndex < activeIndex || realIndex > slideIndexLastInView) unlazy(swiper, realIndex);
1290
+ }
1291
+ } else {
1292
+ for (let i = Math.max(activeIndex - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) {
1293
+ if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) {
1294
+ unlazy(swiper, i);
1295
+ }
1296
+ }
1297
+ }
1298
+ };
1299
+ function getActiveIndexByTranslate(swiper) {
1300
+ const {
1301
+ slidesGrid,
1302
+ params
1303
+ } = swiper;
1304
+ const translate2 = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1305
+ let activeIndex;
1306
+ for (let i = 0; i < slidesGrid.length; i += 1) {
1307
+ if (typeof slidesGrid[i + 1] !== "undefined") {
1308
+ if (translate2 >= slidesGrid[i] && translate2 < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
1309
+ activeIndex = i;
1310
+ } else if (translate2 >= slidesGrid[i] && translate2 < slidesGrid[i + 1]) {
1311
+ activeIndex = i + 1;
1312
+ }
1313
+ } else if (translate2 >= slidesGrid[i]) {
1314
+ activeIndex = i;
1315
+ }
1316
+ }
1317
+ if (params.normalizeSlideIndex) {
1318
+ if (activeIndex < 0 || typeof activeIndex === "undefined") activeIndex = 0;
1319
+ }
1320
+ return activeIndex;
1321
+ }
1322
+ function updateActiveIndex(newActiveIndex) {
1323
+ const swiper = this;
1324
+ const translate2 = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1325
+ const {
1326
+ snapGrid,
1327
+ params,
1328
+ activeIndex: previousIndex,
1329
+ realIndex: previousRealIndex,
1330
+ snapIndex: previousSnapIndex
1331
+ } = swiper;
1332
+ let activeIndex = newActiveIndex;
1333
+ let snapIndex;
1334
+ const getVirtualRealIndex = (aIndex) => {
1335
+ let realIndex2 = aIndex - swiper.virtual.slidesBefore;
1336
+ if (realIndex2 < 0) {
1337
+ realIndex2 = swiper.virtual.slides.length + realIndex2;
1338
+ }
1339
+ if (realIndex2 >= swiper.virtual.slides.length) {
1340
+ realIndex2 -= swiper.virtual.slides.length;
1341
+ }
1342
+ return realIndex2;
1343
+ };
1344
+ if (typeof activeIndex === "undefined") {
1345
+ activeIndex = getActiveIndexByTranslate(swiper);
1346
+ }
1347
+ if (snapGrid.indexOf(translate2) >= 0) {
1348
+ snapIndex = snapGrid.indexOf(translate2);
1349
+ } else {
1350
+ const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
1351
+ snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
1352
+ }
1353
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1354
+ if (activeIndex === previousIndex) {
1355
+ if (snapIndex !== previousSnapIndex) {
1356
+ swiper.snapIndex = snapIndex;
1357
+ swiper.emit("snapIndexChange");
1358
+ }
1359
+ if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
1360
+ swiper.realIndex = getVirtualRealIndex(activeIndex);
1361
+ }
1362
+ return;
1363
+ }
1364
+ let realIndex;
1365
+ if (swiper.virtual && params.virtual.enabled && params.loop) {
1366
+ realIndex = getVirtualRealIndex(activeIndex);
1367
+ } else if (swiper.slides[activeIndex]) {
1368
+ realIndex = parseInt(swiper.slides[activeIndex].getAttribute("data-swiper-slide-index") || activeIndex, 10);
1369
+ } else {
1370
+ realIndex = activeIndex;
1371
+ }
1372
+ Object.assign(swiper, {
1373
+ previousSnapIndex,
1374
+ snapIndex,
1375
+ previousRealIndex,
1376
+ realIndex,
1377
+ previousIndex,
1378
+ activeIndex
1379
+ });
1380
+ if (swiper.initialized) {
1381
+ preload(swiper);
1382
+ }
1383
+ swiper.emit("activeIndexChange");
1384
+ swiper.emit("snapIndexChange");
1385
+ if (swiper.initialized || swiper.params.runCallbacksOnInit) {
1386
+ if (previousRealIndex !== realIndex) {
1387
+ swiper.emit("realIndexChange");
1388
+ }
1389
+ swiper.emit("slideChange");
1390
+ }
1391
+ }
1392
+ function updateClickedSlide(el, path) {
1393
+ const swiper = this;
1394
+ const params = swiper.params;
1395
+ let slide2 = el.closest(`.${params.slideClass}, swiper-slide`);
1396
+ if (!slide2 && swiper.isElement && path && path.length > 1 && path.includes(el)) {
1397
+ [...path.slice(path.indexOf(el) + 1, path.length)].forEach((pathEl) => {
1398
+ if (!slide2 && pathEl.matches && pathEl.matches(`.${params.slideClass}, swiper-slide`)) {
1399
+ slide2 = pathEl;
1400
+ }
1401
+ });
1402
+ }
1403
+ let slideFound = false;
1404
+ let slideIndex;
1405
+ if (slide2) {
1406
+ for (let i = 0; i < swiper.slides.length; i += 1) {
1407
+ if (swiper.slides[i] === slide2) {
1408
+ slideFound = true;
1409
+ slideIndex = i;
1410
+ break;
1411
+ }
1412
+ }
1413
+ }
1414
+ if (slide2 && slideFound) {
1415
+ swiper.clickedSlide = slide2;
1416
+ if (swiper.virtual && swiper.params.virtual.enabled) {
1417
+ swiper.clickedIndex = parseInt(slide2.getAttribute("data-swiper-slide-index"), 10);
1418
+ } else {
1419
+ swiper.clickedIndex = slideIndex;
1420
+ }
1421
+ } else {
1422
+ swiper.clickedSlide = void 0;
1423
+ swiper.clickedIndex = void 0;
1424
+ return;
1425
+ }
1426
+ if (params.slideToClickedSlide && swiper.clickedIndex !== void 0 && swiper.clickedIndex !== swiper.activeIndex) {
1427
+ swiper.slideToClickedSlide();
1428
+ }
1429
+ }
1430
+ var update = {
1431
+ updateSize,
1432
+ updateSlides,
1433
+ updateAutoHeight,
1434
+ updateSlidesOffset,
1435
+ updateSlidesProgress,
1436
+ updateProgress,
1437
+ updateSlidesClasses,
1438
+ updateActiveIndex,
1439
+ updateClickedSlide
1440
+ };
1441
+ function getSwiperTranslate(axis) {
1442
+ if (axis === void 0) {
1443
+ axis = this.isHorizontal() ? "x" : "y";
1444
+ }
1445
+ const swiper = this;
1446
+ const {
1447
+ params,
1448
+ rtlTranslate: rtl,
1449
+ translate: translate2,
1450
+ wrapperEl
1451
+ } = swiper;
1452
+ if (params.virtualTranslate) {
1453
+ return rtl ? -translate2 : translate2;
1454
+ }
1455
+ if (params.cssMode) {
1456
+ return translate2;
1457
+ }
1458
+ let currentTranslate = getTranslate(wrapperEl, axis);
1459
+ currentTranslate += swiper.cssOverflowAdjustment();
1460
+ if (rtl) currentTranslate = -currentTranslate;
1461
+ return currentTranslate || 0;
1462
+ }
1463
+ function setTranslate(translate2, byController) {
1464
+ const swiper = this;
1465
+ const {
1466
+ rtlTranslate: rtl,
1467
+ params,
1468
+ wrapperEl,
1469
+ progress
1470
+ } = swiper;
1471
+ let x = 0;
1472
+ let y = 0;
1473
+ const z = 0;
1474
+ if (swiper.isHorizontal()) {
1475
+ x = rtl ? -translate2 : translate2;
1476
+ } else {
1477
+ y = translate2;
1478
+ }
1479
+ if (params.roundLengths) {
1480
+ x = Math.floor(x);
1481
+ y = Math.floor(y);
1482
+ }
1483
+ swiper.previousTranslate = swiper.translate;
1484
+ swiper.translate = swiper.isHorizontal() ? x : y;
1485
+ if (params.cssMode) {
1486
+ wrapperEl[swiper.isHorizontal() ? "scrollLeft" : "scrollTop"] = swiper.isHorizontal() ? -x : -y;
1487
+ } else if (!params.virtualTranslate) {
1488
+ if (swiper.isHorizontal()) {
1489
+ x -= swiper.cssOverflowAdjustment();
1490
+ } else {
1491
+ y -= swiper.cssOverflowAdjustment();
1492
+ }
1493
+ wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`;
1494
+ }
1495
+ let newProgress;
1496
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
1497
+ if (translatesDiff === 0) {
1498
+ newProgress = 0;
1499
+ } else {
1500
+ newProgress = (translate2 - swiper.minTranslate()) / translatesDiff;
1501
+ }
1502
+ if (newProgress !== progress) {
1503
+ swiper.updateProgress(translate2);
1504
+ }
1505
+ swiper.emit("setTranslate", swiper.translate, byController);
1506
+ }
1507
+ function minTranslate() {
1508
+ return -this.snapGrid[0];
1509
+ }
1510
+ function maxTranslate() {
1511
+ return -this.snapGrid[this.snapGrid.length - 1];
1512
+ }
1513
+ function translateTo(translate2, speed, runCallbacks, translateBounds, internal) {
1514
+ if (translate2 === void 0) {
1515
+ translate2 = 0;
1516
+ }
1517
+ if (speed === void 0) {
1518
+ speed = this.params.speed;
1519
+ }
1520
+ if (runCallbacks === void 0) {
1521
+ runCallbacks = true;
1522
+ }
1523
+ if (translateBounds === void 0) {
1524
+ translateBounds = true;
1525
+ }
1526
+ const swiper = this;
1527
+ const {
1528
+ params,
1529
+ wrapperEl
1530
+ } = swiper;
1531
+ if (swiper.animating && params.preventInteractionOnTransition) {
1532
+ return false;
1533
+ }
1534
+ const minTranslate2 = swiper.minTranslate();
1535
+ const maxTranslate2 = swiper.maxTranslate();
1536
+ let newTranslate;
1537
+ if (translateBounds && translate2 > minTranslate2) newTranslate = minTranslate2;
1538
+ else if (translateBounds && translate2 < maxTranslate2) newTranslate = maxTranslate2;
1539
+ else newTranslate = translate2;
1540
+ swiper.updateProgress(newTranslate);
1541
+ if (params.cssMode) {
1542
+ const isH = swiper.isHorizontal();
1543
+ if (speed === 0) {
1544
+ wrapperEl[isH ? "scrollLeft" : "scrollTop"] = -newTranslate;
1545
+ } else {
1546
+ if (!swiper.support.smoothScroll) {
1547
+ animateCSSModeScroll({
1548
+ swiper,
1549
+ targetPosition: -newTranslate,
1550
+ side: isH ? "left" : "top"
1551
+ });
1552
+ return true;
1553
+ }
1554
+ wrapperEl.scrollTo({
1555
+ [isH ? "left" : "top"]: -newTranslate,
1556
+ behavior: "smooth"
1557
+ });
1558
+ }
1559
+ return true;
1560
+ }
1561
+ if (speed === 0) {
1562
+ swiper.setTransition(0);
1563
+ swiper.setTranslate(newTranslate);
1564
+ if (runCallbacks) {
1565
+ swiper.emit("beforeTransitionStart", speed, internal);
1566
+ swiper.emit("transitionEnd");
1567
+ }
1568
+ } else {
1569
+ swiper.setTransition(speed);
1570
+ swiper.setTranslate(newTranslate);
1571
+ if (runCallbacks) {
1572
+ swiper.emit("beforeTransitionStart", speed, internal);
1573
+ swiper.emit("transitionStart");
1574
+ }
1575
+ if (!swiper.animating) {
1576
+ swiper.animating = true;
1577
+ if (!swiper.onTranslateToWrapperTransitionEnd) {
1578
+ swiper.onTranslateToWrapperTransitionEnd = function transitionEnd2(e) {
1579
+ if (!swiper || swiper.destroyed) return;
1580
+ if (e.target !== this) return;
1581
+ swiper.wrapperEl.removeEventListener("transitionend", swiper.onTranslateToWrapperTransitionEnd);
1582
+ swiper.onTranslateToWrapperTransitionEnd = null;
1583
+ delete swiper.onTranslateToWrapperTransitionEnd;
1584
+ if (runCallbacks) {
1585
+ swiper.emit("transitionEnd");
1586
+ }
1587
+ };
1588
+ }
1589
+ swiper.wrapperEl.addEventListener("transitionend", swiper.onTranslateToWrapperTransitionEnd);
1590
+ }
1591
+ }
1592
+ return true;
1593
+ }
1594
+ var translate = {
1595
+ getTranslate: getSwiperTranslate,
1596
+ setTranslate,
1597
+ minTranslate,
1598
+ maxTranslate,
1599
+ translateTo
1600
+ };
1601
+ function setTransition(duration, byController) {
1602
+ const swiper = this;
1603
+ if (!swiper.params.cssMode) {
1604
+ swiper.wrapperEl.style.transitionDuration = `${duration}ms`;
1605
+ swiper.wrapperEl.style.transitionDelay = duration === 0 ? `0ms` : "";
1606
+ }
1607
+ swiper.emit("setTransition", duration, byController);
1608
+ }
1609
+ function transitionEmit(_ref) {
1610
+ let {
1611
+ swiper,
1612
+ runCallbacks,
1613
+ direction,
1614
+ step
1615
+ } = _ref;
1616
+ const {
1617
+ activeIndex,
1618
+ previousIndex
1619
+ } = swiper;
1620
+ let dir = direction;
1621
+ if (!dir) {
1622
+ if (activeIndex > previousIndex) dir = "next";
1623
+ else if (activeIndex < previousIndex) dir = "prev";
1624
+ else dir = "reset";
1625
+ }
1626
+ swiper.emit(`transition${step}`);
1627
+ if (runCallbacks && activeIndex !== previousIndex) {
1628
+ if (dir === "reset") {
1629
+ swiper.emit(`slideResetTransition${step}`);
1630
+ return;
1631
+ }
1632
+ swiper.emit(`slideChangeTransition${step}`);
1633
+ if (dir === "next") {
1634
+ swiper.emit(`slideNextTransition${step}`);
1635
+ } else {
1636
+ swiper.emit(`slidePrevTransition${step}`);
1637
+ }
1638
+ }
1639
+ }
1640
+ function transitionStart(runCallbacks, direction) {
1641
+ if (runCallbacks === void 0) {
1642
+ runCallbacks = true;
1643
+ }
1644
+ const swiper = this;
1645
+ const {
1646
+ params
1647
+ } = swiper;
1648
+ if (params.cssMode) return;
1649
+ if (params.autoHeight) {
1650
+ swiper.updateAutoHeight();
1651
+ }
1652
+ transitionEmit({
1653
+ swiper,
1654
+ runCallbacks,
1655
+ direction,
1656
+ step: "Start"
1657
+ });
1658
+ }
1659
+ function transitionEnd(runCallbacks, direction) {
1660
+ if (runCallbacks === void 0) {
1661
+ runCallbacks = true;
1662
+ }
1663
+ const swiper = this;
1664
+ const {
1665
+ params
1666
+ } = swiper;
1667
+ swiper.animating = false;
1668
+ if (params.cssMode) return;
1669
+ swiper.setTransition(0);
1670
+ transitionEmit({
1671
+ swiper,
1672
+ runCallbacks,
1673
+ direction,
1674
+ step: "End"
1675
+ });
1676
+ }
1677
+ var transition = {
1678
+ setTransition,
1679
+ transitionStart,
1680
+ transitionEnd
1681
+ };
1682
+ function slideTo(index, speed, runCallbacks, internal, initial) {
1683
+ if (index === void 0) {
1684
+ index = 0;
1685
+ }
1686
+ if (speed === void 0) {
1687
+ speed = this.params.speed;
1688
+ }
1689
+ if (runCallbacks === void 0) {
1690
+ runCallbacks = true;
1691
+ }
1692
+ if (typeof index === "string") {
1693
+ index = parseInt(index, 10);
1694
+ }
1695
+ const swiper = this;
1696
+ let slideIndex = index;
1697
+ if (slideIndex < 0) slideIndex = 0;
1698
+ const {
1699
+ params,
1700
+ snapGrid,
1701
+ slidesGrid,
1702
+ previousIndex,
1703
+ activeIndex,
1704
+ rtlTranslate: rtl,
1705
+ wrapperEl,
1706
+ enabled
1707
+ } = swiper;
1708
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
1709
+ return false;
1710
+ }
1711
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
1712
+ let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
1713
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1714
+ const translate2 = -snapGrid[snapIndex];
1715
+ if (params.normalizeSlideIndex) {
1716
+ for (let i = 0; i < slidesGrid.length; i += 1) {
1717
+ const normalizedTranslate = -Math.floor(translate2 * 100);
1718
+ const normalizedGrid = Math.floor(slidesGrid[i] * 100);
1719
+ const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
1720
+ if (typeof slidesGrid[i + 1] !== "undefined") {
1721
+ if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
1722
+ slideIndex = i;
1723
+ } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
1724
+ slideIndex = i + 1;
1725
+ }
1726
+ } else if (normalizedTranslate >= normalizedGrid) {
1727
+ slideIndex = i;
1728
+ }
1729
+ }
1730
+ }
1731
+ if (swiper.initialized && slideIndex !== activeIndex) {
1732
+ if (!swiper.allowSlideNext && (rtl ? translate2 > swiper.translate && translate2 > swiper.minTranslate() : translate2 < swiper.translate && translate2 < swiper.minTranslate())) {
1733
+ return false;
1734
+ }
1735
+ if (!swiper.allowSlidePrev && translate2 > swiper.translate && translate2 > swiper.maxTranslate()) {
1736
+ if ((activeIndex || 0) !== slideIndex) {
1737
+ return false;
1738
+ }
1739
+ }
1740
+ }
1741
+ if (slideIndex !== (previousIndex || 0) && runCallbacks) {
1742
+ swiper.emit("beforeSlideChangeStart");
1743
+ }
1744
+ swiper.updateProgress(translate2);
1745
+ let direction;
1746
+ if (slideIndex > activeIndex) direction = "next";
1747
+ else if (slideIndex < activeIndex) direction = "prev";
1748
+ else direction = "reset";
1749
+ if (rtl && -translate2 === swiper.translate || !rtl && translate2 === swiper.translate) {
1750
+ swiper.updateActiveIndex(slideIndex);
1751
+ if (params.autoHeight) {
1752
+ swiper.updateAutoHeight();
1753
+ }
1754
+ swiper.updateSlidesClasses();
1755
+ if (params.effect !== "slide") {
1756
+ swiper.setTranslate(translate2);
1757
+ }
1758
+ if (direction !== "reset") {
1759
+ swiper.transitionStart(runCallbacks, direction);
1760
+ swiper.transitionEnd(runCallbacks, direction);
1761
+ }
1762
+ return false;
1763
+ }
1764
+ if (params.cssMode) {
1765
+ const isH = swiper.isHorizontal();
1766
+ const t = rtl ? translate2 : -translate2;
1767
+ if (speed === 0) {
1768
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1769
+ if (isVirtual) {
1770
+ swiper.wrapperEl.style.scrollSnapType = "none";
1771
+ swiper._immediateVirtual = true;
1772
+ }
1773
+ if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {
1774
+ swiper._cssModeVirtualInitialSet = true;
1775
+ requestAnimationFrame(() => {
1776
+ wrapperEl[isH ? "scrollLeft" : "scrollTop"] = t;
1777
+ });
1778
+ } else {
1779
+ wrapperEl[isH ? "scrollLeft" : "scrollTop"] = t;
1780
+ }
1781
+ if (isVirtual) {
1782
+ requestAnimationFrame(() => {
1783
+ swiper.wrapperEl.style.scrollSnapType = "";
1784
+ swiper._immediateVirtual = false;
1785
+ });
1786
+ }
1787
+ } else {
1788
+ if (!swiper.support.smoothScroll) {
1789
+ animateCSSModeScroll({
1790
+ swiper,
1791
+ targetPosition: t,
1792
+ side: isH ? "left" : "top"
1793
+ });
1794
+ return true;
1795
+ }
1796
+ wrapperEl.scrollTo({
1797
+ [isH ? "left" : "top"]: t,
1798
+ behavior: "smooth"
1799
+ });
1800
+ }
1801
+ return true;
1802
+ }
1803
+ swiper.setTransition(speed);
1804
+ swiper.setTranslate(translate2);
1805
+ swiper.updateActiveIndex(slideIndex);
1806
+ swiper.updateSlidesClasses();
1807
+ swiper.emit("beforeTransitionStart", speed, internal);
1808
+ swiper.transitionStart(runCallbacks, direction);
1809
+ if (speed === 0) {
1810
+ swiper.transitionEnd(runCallbacks, direction);
1811
+ } else if (!swiper.animating) {
1812
+ swiper.animating = true;
1813
+ if (!swiper.onSlideToWrapperTransitionEnd) {
1814
+ swiper.onSlideToWrapperTransitionEnd = function transitionEnd2(e) {
1815
+ if (!swiper || swiper.destroyed) return;
1816
+ if (e.target !== this) return;
1817
+ swiper.wrapperEl.removeEventListener("transitionend", swiper.onSlideToWrapperTransitionEnd);
1818
+ swiper.onSlideToWrapperTransitionEnd = null;
1819
+ delete swiper.onSlideToWrapperTransitionEnd;
1820
+ swiper.transitionEnd(runCallbacks, direction);
1821
+ };
1822
+ }
1823
+ swiper.wrapperEl.addEventListener("transitionend", swiper.onSlideToWrapperTransitionEnd);
1824
+ }
1825
+ return true;
1826
+ }
1827
+ function slideToLoop(index, speed, runCallbacks, internal) {
1828
+ if (index === void 0) {
1829
+ index = 0;
1830
+ }
1831
+ if (speed === void 0) {
1832
+ speed = this.params.speed;
1833
+ }
1834
+ if (runCallbacks === void 0) {
1835
+ runCallbacks = true;
1836
+ }
1837
+ if (typeof index === "string") {
1838
+ const indexAsNumber = parseInt(index, 10);
1839
+ index = indexAsNumber;
1840
+ }
1841
+ const swiper = this;
1842
+ let newIndex = index;
1843
+ if (swiper.params.loop) {
1844
+ if (swiper.virtual && swiper.params.virtual.enabled) {
1845
+ newIndex = newIndex + swiper.virtual.slidesBefore;
1846
+ } else {
1847
+ newIndex = swiper.getSlideIndexByData(newIndex);
1848
+ }
1849
+ }
1850
+ return swiper.slideTo(newIndex, speed, runCallbacks, internal);
1851
+ }
1852
+ function slideNext(speed, runCallbacks, internal) {
1853
+ if (speed === void 0) {
1854
+ speed = this.params.speed;
1855
+ }
1856
+ if (runCallbacks === void 0) {
1857
+ runCallbacks = true;
1858
+ }
1859
+ const swiper = this;
1860
+ const {
1861
+ enabled,
1862
+ params,
1863
+ animating
1864
+ } = swiper;
1865
+ if (!enabled) return swiper;
1866
+ let perGroup = params.slidesPerGroup;
1867
+ if (params.slidesPerView === "auto" && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
1868
+ perGroup = Math.max(swiper.slidesPerViewDynamic("current", true), 1);
1869
+ }
1870
+ const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
1871
+ const isVirtual = swiper.virtual && params.virtual.enabled;
1872
+ if (params.loop) {
1873
+ if (animating && !isVirtual && params.loopPreventsSliding) return false;
1874
+ swiper.loopFix({
1875
+ direction: "next"
1876
+ });
1877
+ swiper._clientLeft = swiper.wrapperEl.clientLeft;
1878
+ if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {
1879
+ requestAnimationFrame(() => {
1880
+ swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
1881
+ });
1882
+ return true;
1883
+ }
1884
+ }
1885
+ if (params.rewind && swiper.isEnd) {
1886
+ return swiper.slideTo(0, speed, runCallbacks, internal);
1887
+ }
1888
+ return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
1889
+ }
1890
+ function slidePrev(speed, runCallbacks, internal) {
1891
+ if (speed === void 0) {
1892
+ speed = this.params.speed;
1893
+ }
1894
+ if (runCallbacks === void 0) {
1895
+ runCallbacks = true;
1896
+ }
1897
+ const swiper = this;
1898
+ const {
1899
+ params,
1900
+ snapGrid,
1901
+ slidesGrid,
1902
+ rtlTranslate,
1903
+ enabled,
1904
+ animating
1905
+ } = swiper;
1906
+ if (!enabled) return swiper;
1907
+ const isVirtual = swiper.virtual && params.virtual.enabled;
1908
+ if (params.loop) {
1909
+ if (animating && !isVirtual && params.loopPreventsSliding) return false;
1910
+ swiper.loopFix({
1911
+ direction: "prev"
1912
+ });
1913
+ swiper._clientLeft = swiper.wrapperEl.clientLeft;
1914
+ }
1915
+ const translate2 = rtlTranslate ? swiper.translate : -swiper.translate;
1916
+ function normalize(val) {
1917
+ if (val < 0) return -Math.floor(Math.abs(val));
1918
+ return Math.floor(val);
1919
+ }
1920
+ const normalizedTranslate = normalize(translate2);
1921
+ const normalizedSnapGrid = snapGrid.map((val) => normalize(val));
1922
+ let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
1923
+ if (typeof prevSnap === "undefined" && params.cssMode) {
1924
+ let prevSnapIndex;
1925
+ snapGrid.forEach((snap, snapIndex) => {
1926
+ if (normalizedTranslate >= snap) {
1927
+ prevSnapIndex = snapIndex;
1928
+ }
1929
+ });
1930
+ if (typeof prevSnapIndex !== "undefined") {
1931
+ prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
1932
+ }
1933
+ }
1934
+ let prevIndex = 0;
1935
+ if (typeof prevSnap !== "undefined") {
1936
+ prevIndex = slidesGrid.indexOf(prevSnap);
1937
+ if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
1938
+ if (params.slidesPerView === "auto" && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
1939
+ prevIndex = prevIndex - swiper.slidesPerViewDynamic("previous", true) + 1;
1940
+ prevIndex = Math.max(prevIndex, 0);
1941
+ }
1942
+ }
1943
+ if (params.rewind && swiper.isBeginning) {
1944
+ const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
1945
+ return swiper.slideTo(lastIndex, speed, runCallbacks, internal);
1946
+ } else if (params.loop && swiper.activeIndex === 0 && params.cssMode) {
1947
+ requestAnimationFrame(() => {
1948
+ swiper.slideTo(prevIndex, speed, runCallbacks, internal);
1949
+ });
1950
+ return true;
1951
+ }
1952
+ return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
1953
+ }
1954
+ function slideReset(speed, runCallbacks, internal) {
1955
+ if (speed === void 0) {
1956
+ speed = this.params.speed;
1957
+ }
1958
+ if (runCallbacks === void 0) {
1959
+ runCallbacks = true;
1960
+ }
1961
+ const swiper = this;
1962
+ return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
1963
+ }
1964
+ function slideToClosest(speed, runCallbacks, internal, threshold) {
1965
+ if (speed === void 0) {
1966
+ speed = this.params.speed;
1967
+ }
1968
+ if (runCallbacks === void 0) {
1969
+ runCallbacks = true;
1970
+ }
1971
+ if (threshold === void 0) {
1972
+ threshold = 0.5;
1973
+ }
1974
+ const swiper = this;
1975
+ let index = swiper.activeIndex;
1976
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
1977
+ const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
1978
+ const translate2 = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
1979
+ if (translate2 >= swiper.snapGrid[snapIndex]) {
1980
+ const currentSnap = swiper.snapGrid[snapIndex];
1981
+ const nextSnap = swiper.snapGrid[snapIndex + 1];
1982
+ if (translate2 - currentSnap > (nextSnap - currentSnap) * threshold) {
1983
+ index += swiper.params.slidesPerGroup;
1984
+ }
1985
+ } else {
1986
+ const prevSnap = swiper.snapGrid[snapIndex - 1];
1987
+ const currentSnap = swiper.snapGrid[snapIndex];
1988
+ if (translate2 - prevSnap <= (currentSnap - prevSnap) * threshold) {
1989
+ index -= swiper.params.slidesPerGroup;
1990
+ }
1991
+ }
1992
+ index = Math.max(index, 0);
1993
+ index = Math.min(index, swiper.slidesGrid.length - 1);
1994
+ return swiper.slideTo(index, speed, runCallbacks, internal);
1995
+ }
1996
+ function slideToClickedSlide() {
1997
+ const swiper = this;
1998
+ const {
1999
+ params,
2000
+ slidesEl
2001
+ } = swiper;
2002
+ const slidesPerView = params.slidesPerView === "auto" ? swiper.slidesPerViewDynamic() : params.slidesPerView;
2003
+ let slideToIndex = swiper.clickedIndex;
2004
+ let realIndex;
2005
+ const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
2006
+ if (params.loop) {
2007
+ if (swiper.animating) return;
2008
+ realIndex = parseInt(swiper.clickedSlide.getAttribute("data-swiper-slide-index"), 10);
2009
+ if (params.centeredSlides) {
2010
+ if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
2011
+ swiper.loopFix();
2012
+ slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2013
+ nextTick(() => {
2014
+ swiper.slideTo(slideToIndex);
2015
+ });
2016
+ } else {
2017
+ swiper.slideTo(slideToIndex);
2018
+ }
2019
+ } else if (slideToIndex > swiper.slides.length - slidesPerView) {
2020
+ swiper.loopFix();
2021
+ slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2022
+ nextTick(() => {
2023
+ swiper.slideTo(slideToIndex);
2024
+ });
2025
+ } else {
2026
+ swiper.slideTo(slideToIndex);
2027
+ }
2028
+ } else {
2029
+ swiper.slideTo(slideToIndex);
2030
+ }
2031
+ }
2032
+ var slide = {
2033
+ slideTo,
2034
+ slideToLoop,
2035
+ slideNext,
2036
+ slidePrev,
2037
+ slideReset,
2038
+ slideToClosest,
2039
+ slideToClickedSlide
2040
+ };
2041
+ function loopCreate(slideRealIndex) {
2042
+ const swiper = this;
2043
+ const {
2044
+ params,
2045
+ slidesEl
2046
+ } = swiper;
2047
+ if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2048
+ const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
2049
+ slides.forEach((el, index) => {
2050
+ el.setAttribute("data-swiper-slide-index", index);
2051
+ });
2052
+ swiper.loopFix({
2053
+ slideRealIndex,
2054
+ direction: params.centeredSlides ? void 0 : "next"
2055
+ });
2056
+ }
2057
+ function loopFix(_temp) {
2058
+ let {
2059
+ slideRealIndex,
2060
+ slideTo: slideTo2 = true,
2061
+ direction,
2062
+ setTranslate: setTranslate2,
2063
+ activeSlideIndex,
2064
+ byController,
2065
+ byMousewheel
2066
+ } = _temp === void 0 ? {} : _temp;
2067
+ const swiper = this;
2068
+ if (!swiper.params.loop) return;
2069
+ swiper.emit("beforeLoopFix");
2070
+ const {
2071
+ slides,
2072
+ allowSlidePrev,
2073
+ allowSlideNext,
2074
+ slidesEl,
2075
+ params
2076
+ } = swiper;
2077
+ swiper.allowSlidePrev = true;
2078
+ swiper.allowSlideNext = true;
2079
+ if (swiper.virtual && params.virtual.enabled) {
2080
+ if (slideTo2) {
2081
+ if (!params.centeredSlides && swiper.snapIndex === 0) {
2082
+ swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
2083
+ } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
2084
+ swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
2085
+ } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
2086
+ swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
2087
+ }
2088
+ }
2089
+ swiper.allowSlidePrev = allowSlidePrev;
2090
+ swiper.allowSlideNext = allowSlideNext;
2091
+ swiper.emit("loopFix");
2092
+ return;
2093
+ }
2094
+ const slidesPerView = params.slidesPerView === "auto" ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));
2095
+ let loopedSlides = params.loopedSlides || slidesPerView;
2096
+ if (loopedSlides % params.slidesPerGroup !== 0) {
2097
+ loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;
2098
+ }
2099
+ swiper.loopedSlides = loopedSlides;
2100
+ const prependSlidesIndexes = [];
2101
+ const appendSlidesIndexes = [];
2102
+ let activeIndex = swiper.activeIndex;
2103
+ if (typeof activeSlideIndex === "undefined") {
2104
+ activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter((el) => el.classList.contains(params.slideActiveClass))[0]);
2105
+ } else {
2106
+ activeIndex = activeSlideIndex;
2107
+ }
2108
+ const isNext = direction === "next" || !direction;
2109
+ const isPrev = direction === "prev" || !direction;
2110
+ let slidesPrepended = 0;
2111
+ let slidesAppended = 0;
2112
+ if (activeSlideIndex < loopedSlides) {
2113
+ slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);
2114
+ for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {
2115
+ const index = i - Math.floor(i / slides.length) * slides.length;
2116
+ prependSlidesIndexes.push(slides.length - index - 1);
2117
+ }
2118
+ } else if (activeSlideIndex > swiper.slides.length - loopedSlides * 2) {
2119
+ slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);
2120
+ for (let i = 0; i < slidesAppended; i += 1) {
2121
+ const index = i - Math.floor(i / slides.length) * slides.length;
2122
+ appendSlidesIndexes.push(index);
2123
+ }
2124
+ }
2125
+ if (isPrev) {
2126
+ prependSlidesIndexes.forEach((index) => {
2127
+ swiper.slides[index].swiperLoopMoveDOM = true;
2128
+ slidesEl.prepend(swiper.slides[index]);
2129
+ swiper.slides[index].swiperLoopMoveDOM = false;
2130
+ });
2131
+ }
2132
+ if (isNext) {
2133
+ appendSlidesIndexes.forEach((index) => {
2134
+ swiper.slides[index].swiperLoopMoveDOM = true;
2135
+ slidesEl.append(swiper.slides[index]);
2136
+ swiper.slides[index].swiperLoopMoveDOM = false;
2137
+ });
2138
+ }
2139
+ swiper.recalcSlides();
2140
+ if (params.slidesPerView === "auto") {
2141
+ swiper.updateSlides();
2142
+ }
2143
+ if (params.watchSlidesProgress) {
2144
+ swiper.updateSlidesOffset();
2145
+ }
2146
+ if (slideTo2) {
2147
+ if (prependSlidesIndexes.length > 0 && isPrev) {
2148
+ if (typeof slideRealIndex === "undefined") {
2149
+ const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2150
+ const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended];
2151
+ const diff = newSlideTranslate - currentSlideTranslate;
2152
+ if (byMousewheel) {
2153
+ swiper.setTranslate(swiper.translate - diff);
2154
+ } else {
2155
+ swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
2156
+ if (setTranslate2) {
2157
+ swiper.touches[swiper.isHorizontal() ? "startX" : "startY"] += diff;
2158
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2159
+ }
2160
+ }
2161
+ } else {
2162
+ if (setTranslate2) {
2163
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
2164
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2165
+ }
2166
+ }
2167
+ } else if (appendSlidesIndexes.length > 0 && isNext) {
2168
+ if (typeof slideRealIndex === "undefined") {
2169
+ const currentSlideTranslate = swiper.slidesGrid[activeIndex];
2170
+ const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended];
2171
+ const diff = newSlideTranslate - currentSlideTranslate;
2172
+ if (byMousewheel) {
2173
+ swiper.setTranslate(swiper.translate - diff);
2174
+ } else {
2175
+ swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
2176
+ if (setTranslate2) {
2177
+ swiper.touches[swiper.isHorizontal() ? "startX" : "startY"] += diff;
2178
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2179
+ }
2180
+ }
2181
+ } else {
2182
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
2183
+ }
2184
+ }
2185
+ }
2186
+ swiper.allowSlidePrev = allowSlidePrev;
2187
+ swiper.allowSlideNext = allowSlideNext;
2188
+ if (swiper.controller && swiper.controller.control && !byController) {
2189
+ const loopParams = {
2190
+ slideRealIndex,
2191
+ direction,
2192
+ setTranslate: setTranslate2,
2193
+ activeSlideIndex,
2194
+ byController: true
2195
+ };
2196
+ if (Array.isArray(swiper.controller.control)) {
2197
+ swiper.controller.control.forEach((c) => {
2198
+ if (!c.destroyed && c.params.loop) c.loopFix({
2199
+ ...loopParams,
2200
+ slideTo: c.params.slidesPerView === params.slidesPerView ? slideTo2 : false
2201
+ });
2202
+ });
2203
+ } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) {
2204
+ swiper.controller.control.loopFix({
2205
+ ...loopParams,
2206
+ slideTo: swiper.controller.control.params.slidesPerView === params.slidesPerView ? slideTo2 : false
2207
+ });
2208
+ }
2209
+ }
2210
+ swiper.emit("loopFix");
2211
+ }
2212
+ function loopDestroy() {
2213
+ const swiper = this;
2214
+ const {
2215
+ params,
2216
+ slidesEl
2217
+ } = swiper;
2218
+ if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2219
+ swiper.recalcSlides();
2220
+ const newSlidesOrder = [];
2221
+ swiper.slides.forEach((slideEl) => {
2222
+ const index = typeof slideEl.swiperSlideIndex === "undefined" ? slideEl.getAttribute("data-swiper-slide-index") * 1 : slideEl.swiperSlideIndex;
2223
+ newSlidesOrder[index] = slideEl;
2224
+ });
2225
+ swiper.slides.forEach((slideEl) => {
2226
+ slideEl.removeAttribute("data-swiper-slide-index");
2227
+ });
2228
+ newSlidesOrder.forEach((slideEl) => {
2229
+ slidesEl.append(slideEl);
2230
+ });
2231
+ swiper.recalcSlides();
2232
+ swiper.slideTo(swiper.realIndex, 0);
2233
+ }
2234
+ var loop = {
2235
+ loopCreate,
2236
+ loopFix,
2237
+ loopDestroy
2238
+ };
2239
+ function setGrabCursor(moving) {
2240
+ const swiper = this;
2241
+ if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
2242
+ const el = swiper.params.touchEventsTarget === "container" ? swiper.el : swiper.wrapperEl;
2243
+ if (swiper.isElement) {
2244
+ swiper.__preventObserver__ = true;
2245
+ }
2246
+ el.style.cursor = "move";
2247
+ el.style.cursor = moving ? "grabbing" : "grab";
2248
+ if (swiper.isElement) {
2249
+ requestAnimationFrame(() => {
2250
+ swiper.__preventObserver__ = false;
2251
+ });
2252
+ }
2253
+ }
2254
+ function unsetGrabCursor() {
2255
+ const swiper = this;
2256
+ if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
2257
+ return;
2258
+ }
2259
+ if (swiper.isElement) {
2260
+ swiper.__preventObserver__ = true;
2261
+ }
2262
+ swiper[swiper.params.touchEventsTarget === "container" ? "el" : "wrapperEl"].style.cursor = "";
2263
+ if (swiper.isElement) {
2264
+ requestAnimationFrame(() => {
2265
+ swiper.__preventObserver__ = false;
2266
+ });
2267
+ }
2268
+ }
2269
+ var grabCursor = {
2270
+ setGrabCursor,
2271
+ unsetGrabCursor
2272
+ };
2273
+ function closestElement(selector, base) {
2274
+ if (base === void 0) {
2275
+ base = this;
2276
+ }
2277
+ function __closestFrom(el) {
2278
+ if (!el || el === getDocument() || el === getWindow()) return null;
2279
+ if (el.assignedSlot) el = el.assignedSlot;
2280
+ const found = el.closest(selector);
2281
+ if (!found && !el.getRootNode) {
2282
+ return null;
2283
+ }
2284
+ return found || __closestFrom(el.getRootNode().host);
2285
+ }
2286
+ return __closestFrom(base);
2287
+ }
2288
+ function onTouchStart(event) {
2289
+ const swiper = this;
2290
+ const document2 = getDocument();
2291
+ const window2 = getWindow();
2292
+ const data = swiper.touchEventsData;
2293
+ data.evCache.push(event);
2294
+ const {
2295
+ params,
2296
+ touches,
2297
+ enabled
2298
+ } = swiper;
2299
+ if (!enabled) return;
2300
+ if (!params.simulateTouch && event.pointerType === "mouse") return;
2301
+ if (swiper.animating && params.preventInteractionOnTransition) {
2302
+ return;
2303
+ }
2304
+ if (!swiper.animating && params.cssMode && params.loop) {
2305
+ swiper.loopFix();
2306
+ }
2307
+ let e = event;
2308
+ if (e.originalEvent) e = e.originalEvent;
2309
+ let targetEl = e.target;
2310
+ if (params.touchEventsTarget === "wrapper") {
2311
+ if (!swiper.wrapperEl.contains(targetEl)) return;
2312
+ }
2313
+ if ("which" in e && e.which === 3) return;
2314
+ if ("button" in e && e.button > 0) return;
2315
+ if (data.isTouched && data.isMoved) return;
2316
+ const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== "";
2317
+ const eventPath = event.composedPath ? event.composedPath() : event.path;
2318
+ if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
2319
+ targetEl = eventPath[0];
2320
+ }
2321
+ const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
2322
+ const isTargetShadow = !!(e.target && e.target.shadowRoot);
2323
+ if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) {
2324
+ swiper.allowClick = true;
2325
+ return;
2326
+ }
2327
+ if (params.swipeHandler) {
2328
+ if (!targetEl.closest(params.swipeHandler)) return;
2329
+ }
2330
+ touches.currentX = e.pageX;
2331
+ touches.currentY = e.pageY;
2332
+ const startX = touches.currentX;
2333
+ const startY = touches.currentY;
2334
+ const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
2335
+ const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
2336
+ if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window2.innerWidth - edgeSwipeThreshold)) {
2337
+ if (edgeSwipeDetection === "prevent") {
2338
+ event.preventDefault();
2339
+ } else {
2340
+ return;
2341
+ }
2342
+ }
2343
+ Object.assign(data, {
2344
+ isTouched: true,
2345
+ isMoved: false,
2346
+ allowTouchCallbacks: true,
2347
+ isScrolling: void 0,
2348
+ startMoving: void 0
2349
+ });
2350
+ touches.startX = startX;
2351
+ touches.startY = startY;
2352
+ data.touchStartTime = now();
2353
+ swiper.allowClick = true;
2354
+ swiper.updateSize();
2355
+ swiper.swipeDirection = void 0;
2356
+ if (params.threshold > 0) data.allowThresholdMove = false;
2357
+ let preventDefault = true;
2358
+ if (targetEl.matches(data.focusableElements)) {
2359
+ preventDefault = false;
2360
+ if (targetEl.nodeName === "SELECT") {
2361
+ data.isTouched = false;
2362
+ }
2363
+ }
2364
+ if (document2.activeElement && document2.activeElement.matches(data.focusableElements) && document2.activeElement !== targetEl) {
2365
+ document2.activeElement.blur();
2366
+ }
2367
+ const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
2368
+ if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) {
2369
+ e.preventDefault();
2370
+ }
2371
+ if (params.freeMode && params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {
2372
+ swiper.freeMode.onTouchStart();
2373
+ }
2374
+ swiper.emit("touchStart", e);
2375
+ }
2376
+ function onTouchMove(event) {
2377
+ const document2 = getDocument();
2378
+ const swiper = this;
2379
+ const data = swiper.touchEventsData;
2380
+ const {
2381
+ params,
2382
+ touches,
2383
+ rtlTranslate: rtl,
2384
+ enabled
2385
+ } = swiper;
2386
+ if (!enabled) return;
2387
+ if (!params.simulateTouch && event.pointerType === "mouse") return;
2388
+ let e = event;
2389
+ if (e.originalEvent) e = e.originalEvent;
2390
+ if (!data.isTouched) {
2391
+ if (data.startMoving && data.isScrolling) {
2392
+ swiper.emit("touchMoveOpposite", e);
2393
+ }
2394
+ return;
2395
+ }
2396
+ const pointerIndex = data.evCache.findIndex((cachedEv) => cachedEv.pointerId === e.pointerId);
2397
+ if (pointerIndex >= 0) data.evCache[pointerIndex] = e;
2398
+ const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;
2399
+ const pageX = targetTouch.pageX;
2400
+ const pageY = targetTouch.pageY;
2401
+ if (e.preventedByNestedSwiper) {
2402
+ touches.startX = pageX;
2403
+ touches.startY = pageY;
2404
+ return;
2405
+ }
2406
+ if (!swiper.allowTouchMove) {
2407
+ if (!e.target.matches(data.focusableElements)) {
2408
+ swiper.allowClick = false;
2409
+ }
2410
+ if (data.isTouched) {
2411
+ Object.assign(touches, {
2412
+ startX: pageX,
2413
+ startY: pageY,
2414
+ prevX: swiper.touches.currentX,
2415
+ prevY: swiper.touches.currentY,
2416
+ currentX: pageX,
2417
+ currentY: pageY
2418
+ });
2419
+ data.touchStartTime = now();
2420
+ }
2421
+ return;
2422
+ }
2423
+ if (params.touchReleaseOnEdges && !params.loop) {
2424
+ if (swiper.isVertical()) {
2425
+ if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
2426
+ data.isTouched = false;
2427
+ data.isMoved = false;
2428
+ return;
2429
+ }
2430
+ } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
2431
+ return;
2432
+ }
2433
+ }
2434
+ if (document2.activeElement) {
2435
+ if (e.target === document2.activeElement && e.target.matches(data.focusableElements)) {
2436
+ data.isMoved = true;
2437
+ swiper.allowClick = false;
2438
+ return;
2439
+ }
2440
+ }
2441
+ if (data.allowTouchCallbacks) {
2442
+ swiper.emit("touchMove", e);
2443
+ }
2444
+ if (e.targetTouches && e.targetTouches.length > 1) return;
2445
+ touches.currentX = pageX;
2446
+ touches.currentY = pageY;
2447
+ const diffX = touches.currentX - touches.startX;
2448
+ const diffY = touches.currentY - touches.startY;
2449
+ if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
2450
+ if (typeof data.isScrolling === "undefined") {
2451
+ let touchAngle;
2452
+ if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
2453
+ data.isScrolling = false;
2454
+ } else {
2455
+ if (diffX * diffX + diffY * diffY >= 25) {
2456
+ touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
2457
+ data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
2458
+ }
2459
+ }
2460
+ }
2461
+ if (data.isScrolling) {
2462
+ swiper.emit("touchMoveOpposite", e);
2463
+ }
2464
+ if (typeof data.startMoving === "undefined") {
2465
+ if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
2466
+ data.startMoving = true;
2467
+ }
2468
+ }
2469
+ if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {
2470
+ data.isTouched = false;
2471
+ return;
2472
+ }
2473
+ if (!data.startMoving) {
2474
+ return;
2475
+ }
2476
+ swiper.allowClick = false;
2477
+ if (!params.cssMode && e.cancelable) {
2478
+ e.preventDefault();
2479
+ }
2480
+ if (params.touchMoveStopPropagation && !params.nested) {
2481
+ e.stopPropagation();
2482
+ }
2483
+ let diff = swiper.isHorizontal() ? diffX : diffY;
2484
+ let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY;
2485
+ if (params.oneWayMovement) {
2486
+ diff = Math.abs(diff) * (rtl ? 1 : -1);
2487
+ touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);
2488
+ }
2489
+ touches.diff = diff;
2490
+ diff *= params.touchRatio;
2491
+ if (rtl) {
2492
+ diff = -diff;
2493
+ touchesDiff = -touchesDiff;
2494
+ }
2495
+ const prevTouchesDirection = swiper.touchesDirection;
2496
+ swiper.swipeDirection = diff > 0 ? "prev" : "next";
2497
+ swiper.touchesDirection = touchesDiff > 0 ? "prev" : "next";
2498
+ const isLoop = swiper.params.loop && !params.cssMode;
2499
+ const allowLoopFix = swiper.swipeDirection === "next" && swiper.allowSlideNext || swiper.swipeDirection === "prev" && swiper.allowSlidePrev;
2500
+ if (!data.isMoved) {
2501
+ if (isLoop && allowLoopFix) {
2502
+ swiper.loopFix({
2503
+ direction: swiper.swipeDirection
2504
+ });
2505
+ }
2506
+ data.startTranslate = swiper.getTranslate();
2507
+ swiper.setTransition(0);
2508
+ if (swiper.animating) {
2509
+ const evt = new window.CustomEvent("transitionend", {
2510
+ bubbles: true,
2511
+ cancelable: true
2512
+ });
2513
+ swiper.wrapperEl.dispatchEvent(evt);
2514
+ }
2515
+ data.allowMomentumBounce = false;
2516
+ if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2517
+ swiper.setGrabCursor(true);
2518
+ }
2519
+ swiper.emit("sliderFirstMove", e);
2520
+ }
2521
+ let loopFixed;
2522
+ if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
2523
+ swiper.loopFix({
2524
+ direction: swiper.swipeDirection,
2525
+ setTranslate: true
2526
+ });
2527
+ loopFixed = true;
2528
+ }
2529
+ swiper.emit("sliderMove", e);
2530
+ data.isMoved = true;
2531
+ data.currentTranslate = diff + data.startTranslate;
2532
+ let disableParentSwiper = true;
2533
+ let resistanceRatio = params.resistanceRatio;
2534
+ if (params.touchReleaseOnEdges) {
2535
+ resistanceRatio = 0;
2536
+ }
2537
+ if (diff > 0) {
2538
+ if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {
2539
+ swiper.loopFix({
2540
+ direction: "prev",
2541
+ setTranslate: true,
2542
+ activeSlideIndex: 0
2543
+ });
2544
+ }
2545
+ if (data.currentTranslate > swiper.minTranslate()) {
2546
+ disableParentSwiper = false;
2547
+ if (params.resistance) {
2548
+ data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
2549
+ }
2550
+ }
2551
+ } else if (diff < 0) {
2552
+ if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {
2553
+ swiper.loopFix({
2554
+ direction: "next",
2555
+ setTranslate: true,
2556
+ activeSlideIndex: swiper.slides.length - (params.slidesPerView === "auto" ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)))
2557
+ });
2558
+ }
2559
+ if (data.currentTranslate < swiper.maxTranslate()) {
2560
+ disableParentSwiper = false;
2561
+ if (params.resistance) {
2562
+ data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
2563
+ }
2564
+ }
2565
+ }
2566
+ if (disableParentSwiper) {
2567
+ e.preventedByNestedSwiper = true;
2568
+ }
2569
+ if (!swiper.allowSlideNext && swiper.swipeDirection === "next" && data.currentTranslate < data.startTranslate) {
2570
+ data.currentTranslate = data.startTranslate;
2571
+ }
2572
+ if (!swiper.allowSlidePrev && swiper.swipeDirection === "prev" && data.currentTranslate > data.startTranslate) {
2573
+ data.currentTranslate = data.startTranslate;
2574
+ }
2575
+ if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
2576
+ data.currentTranslate = data.startTranslate;
2577
+ }
2578
+ if (params.threshold > 0) {
2579
+ if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
2580
+ if (!data.allowThresholdMove) {
2581
+ data.allowThresholdMove = true;
2582
+ touches.startX = touches.currentX;
2583
+ touches.startY = touches.currentY;
2584
+ data.currentTranslate = data.startTranslate;
2585
+ touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
2586
+ return;
2587
+ }
2588
+ } else {
2589
+ data.currentTranslate = data.startTranslate;
2590
+ return;
2591
+ }
2592
+ }
2593
+ if (!params.followFinger || params.cssMode) return;
2594
+ if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
2595
+ swiper.updateActiveIndex();
2596
+ swiper.updateSlidesClasses();
2597
+ }
2598
+ if (params.freeMode && params.freeMode.enabled && swiper.freeMode) {
2599
+ swiper.freeMode.onTouchMove();
2600
+ }
2601
+ swiper.updateProgress(data.currentTranslate);
2602
+ swiper.setTranslate(data.currentTranslate);
2603
+ }
2604
+ function onTouchEnd(event) {
2605
+ const swiper = this;
2606
+ const data = swiper.touchEventsData;
2607
+ const pointerIndex = data.evCache.findIndex((cachedEv) => cachedEv.pointerId === event.pointerId);
2608
+ if (pointerIndex >= 0) {
2609
+ data.evCache.splice(pointerIndex, 1);
2610
+ }
2611
+ if (["pointercancel", "pointerout", "pointerleave", "contextmenu"].includes(event.type)) {
2612
+ const proceed = ["pointercancel", "contextmenu"].includes(event.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
2613
+ if (!proceed) {
2614
+ return;
2615
+ }
2616
+ }
2617
+ const {
2618
+ params,
2619
+ touches,
2620
+ rtlTranslate: rtl,
2621
+ slidesGrid,
2622
+ enabled
2623
+ } = swiper;
2624
+ if (!enabled) return;
2625
+ if (!params.simulateTouch && event.pointerType === "mouse") return;
2626
+ let e = event;
2627
+ if (e.originalEvent) e = e.originalEvent;
2628
+ if (data.allowTouchCallbacks) {
2629
+ swiper.emit("touchEnd", e);
2630
+ }
2631
+ data.allowTouchCallbacks = false;
2632
+ if (!data.isTouched) {
2633
+ if (data.isMoved && params.grabCursor) {
2634
+ swiper.setGrabCursor(false);
2635
+ }
2636
+ data.isMoved = false;
2637
+ data.startMoving = false;
2638
+ return;
2639
+ }
2640
+ if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
2641
+ swiper.setGrabCursor(false);
2642
+ }
2643
+ const touchEndTime = now();
2644
+ const timeDiff = touchEndTime - data.touchStartTime;
2645
+ if (swiper.allowClick) {
2646
+ const pathTree = e.path || e.composedPath && e.composedPath();
2647
+ swiper.updateClickedSlide(pathTree && pathTree[0] || e.target, pathTree);
2648
+ swiper.emit("tap click", e);
2649
+ if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
2650
+ swiper.emit("doubleTap doubleClick", e);
2651
+ }
2652
+ }
2653
+ data.lastClickTime = now();
2654
+ nextTick(() => {
2655
+ if (!swiper.destroyed) swiper.allowClick = true;
2656
+ });
2657
+ if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
2658
+ data.isTouched = false;
2659
+ data.isMoved = false;
2660
+ data.startMoving = false;
2661
+ return;
2662
+ }
2663
+ data.isTouched = false;
2664
+ data.isMoved = false;
2665
+ data.startMoving = false;
2666
+ let currentPos;
2667
+ if (params.followFinger) {
2668
+ currentPos = rtl ? swiper.translate : -swiper.translate;
2669
+ } else {
2670
+ currentPos = -data.currentTranslate;
2671
+ }
2672
+ if (params.cssMode) {
2673
+ return;
2674
+ }
2675
+ if (params.freeMode && params.freeMode.enabled) {
2676
+ swiper.freeMode.onTouchEnd({
2677
+ currentPos
2678
+ });
2679
+ return;
2680
+ }
2681
+ let stopIndex = 0;
2682
+ let groupSize = swiper.slidesSizesGrid[0];
2683
+ for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
2684
+ const increment2 = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2685
+ if (typeof slidesGrid[i + increment2] !== "undefined") {
2686
+ if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment2]) {
2687
+ stopIndex = i;
2688
+ groupSize = slidesGrid[i + increment2] - slidesGrid[i];
2689
+ }
2690
+ } else if (currentPos >= slidesGrid[i]) {
2691
+ stopIndex = i;
2692
+ groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
2693
+ }
2694
+ }
2695
+ let rewindFirstIndex = null;
2696
+ let rewindLastIndex = null;
2697
+ if (params.rewind) {
2698
+ if (swiper.isBeginning) {
2699
+ rewindLastIndex = params.virtual && params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
2700
+ } else if (swiper.isEnd) {
2701
+ rewindFirstIndex = 0;
2702
+ }
2703
+ }
2704
+ const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
2705
+ const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2706
+ if (timeDiff > params.longSwipesMs) {
2707
+ if (!params.longSwipes) {
2708
+ swiper.slideTo(swiper.activeIndex);
2709
+ return;
2710
+ }
2711
+ if (swiper.swipeDirection === "next") {
2712
+ if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);
2713
+ else swiper.slideTo(stopIndex);
2714
+ }
2715
+ if (swiper.swipeDirection === "prev") {
2716
+ if (ratio > 1 - params.longSwipesRatio) {
2717
+ swiper.slideTo(stopIndex + increment);
2718
+ } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {
2719
+ swiper.slideTo(rewindLastIndex);
2720
+ } else {
2721
+ swiper.slideTo(stopIndex);
2722
+ }
2723
+ }
2724
+ } else {
2725
+ if (!params.shortSwipes) {
2726
+ swiper.slideTo(swiper.activeIndex);
2727
+ return;
2728
+ }
2729
+ const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
2730
+ if (!isNavButtonTarget) {
2731
+ if (swiper.swipeDirection === "next") {
2732
+ swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);
2733
+ }
2734
+ if (swiper.swipeDirection === "prev") {
2735
+ swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);
2736
+ }
2737
+ } else if (e.target === swiper.navigation.nextEl) {
2738
+ swiper.slideTo(stopIndex + increment);
2739
+ } else {
2740
+ swiper.slideTo(stopIndex);
2741
+ }
2742
+ }
2743
+ }
2744
+ function onResize() {
2745
+ const swiper = this;
2746
+ const {
2747
+ params,
2748
+ el
2749
+ } = swiper;
2750
+ if (el && el.offsetWidth === 0) return;
2751
+ if (params.breakpoints) {
2752
+ swiper.setBreakpoint();
2753
+ }
2754
+ const {
2755
+ allowSlideNext,
2756
+ allowSlidePrev,
2757
+ snapGrid
2758
+ } = swiper;
2759
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
2760
+ swiper.allowSlideNext = true;
2761
+ swiper.allowSlidePrev = true;
2762
+ swiper.updateSize();
2763
+ swiper.updateSlides();
2764
+ swiper.updateSlidesClasses();
2765
+ const isVirtualLoop = isVirtual && params.loop;
2766
+ if ((params.slidesPerView === "auto" || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {
2767
+ swiper.slideTo(swiper.slides.length - 1, 0, false, true);
2768
+ } else {
2769
+ if (swiper.params.loop && !isVirtual) {
2770
+ swiper.slideToLoop(swiper.realIndex, 0, false, true);
2771
+ } else {
2772
+ swiper.slideTo(swiper.activeIndex, 0, false, true);
2773
+ }
2774
+ }
2775
+ if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
2776
+ clearTimeout(swiper.autoplay.resizeTimeout);
2777
+ swiper.autoplay.resizeTimeout = setTimeout(() => {
2778
+ if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
2779
+ swiper.autoplay.resume();
2780
+ }
2781
+ }, 500);
2782
+ }
2783
+ swiper.allowSlidePrev = allowSlidePrev;
2784
+ swiper.allowSlideNext = allowSlideNext;
2785
+ if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
2786
+ swiper.checkOverflow();
2787
+ }
2788
+ }
2789
+ function onClick(e) {
2790
+ const swiper = this;
2791
+ if (!swiper.enabled) return;
2792
+ if (!swiper.allowClick) {
2793
+ if (swiper.params.preventClicks) e.preventDefault();
2794
+ if (swiper.params.preventClicksPropagation && swiper.animating) {
2795
+ e.stopPropagation();
2796
+ e.stopImmediatePropagation();
2797
+ }
2798
+ }
2799
+ }
2800
+ function onScroll() {
2801
+ const swiper = this;
2802
+ const {
2803
+ wrapperEl,
2804
+ rtlTranslate,
2805
+ enabled
2806
+ } = swiper;
2807
+ if (!enabled) return;
2808
+ swiper.previousTranslate = swiper.translate;
2809
+ if (swiper.isHorizontal()) {
2810
+ swiper.translate = -wrapperEl.scrollLeft;
2811
+ } else {
2812
+ swiper.translate = -wrapperEl.scrollTop;
2813
+ }
2814
+ if (swiper.translate === 0) swiper.translate = 0;
2815
+ swiper.updateActiveIndex();
2816
+ swiper.updateSlidesClasses();
2817
+ let newProgress;
2818
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
2819
+ if (translatesDiff === 0) {
2820
+ newProgress = 0;
2821
+ } else {
2822
+ newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
2823
+ }
2824
+ if (newProgress !== swiper.progress) {
2825
+ swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
2826
+ }
2827
+ swiper.emit("setTranslate", swiper.translate, false);
2828
+ }
2829
+ function onLoad(e) {
2830
+ const swiper = this;
2831
+ processLazyPreloader(swiper, e.target);
2832
+ if (swiper.params.cssMode || swiper.params.slidesPerView !== "auto" && !swiper.params.autoHeight) {
2833
+ return;
2834
+ }
2835
+ swiper.update();
2836
+ }
2837
+ var dummyEventAttached = false;
2838
+ function dummyEventListener() {
2839
+ }
2840
+ var events = (swiper, method) => {
2841
+ const document2 = getDocument();
2842
+ const {
2843
+ params,
2844
+ el,
2845
+ wrapperEl,
2846
+ device
2847
+ } = swiper;
2848
+ const capture = !!params.nested;
2849
+ const domMethod = method === "on" ? "addEventListener" : "removeEventListener";
2850
+ const swiperMethod = method;
2851
+ el[domMethod]("pointerdown", swiper.onTouchStart, {
2852
+ passive: false
2853
+ });
2854
+ document2[domMethod]("pointermove", swiper.onTouchMove, {
2855
+ passive: false,
2856
+ capture
2857
+ });
2858
+ document2[domMethod]("pointerup", swiper.onTouchEnd, {
2859
+ passive: true
2860
+ });
2861
+ document2[domMethod]("pointercancel", swiper.onTouchEnd, {
2862
+ passive: true
2863
+ });
2864
+ document2[domMethod]("pointerout", swiper.onTouchEnd, {
2865
+ passive: true
2866
+ });
2867
+ document2[domMethod]("pointerleave", swiper.onTouchEnd, {
2868
+ passive: true
2869
+ });
2870
+ document2[domMethod]("contextmenu", swiper.onTouchEnd, {
2871
+ passive: true
2872
+ });
2873
+ if (params.preventClicks || params.preventClicksPropagation) {
2874
+ el[domMethod]("click", swiper.onClick, true);
2875
+ }
2876
+ if (params.cssMode) {
2877
+ wrapperEl[domMethod]("scroll", swiper.onScroll);
2878
+ }
2879
+ if (params.updateOnWindowResize) {
2880
+ swiper[swiperMethod](device.ios || device.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", onResize, true);
2881
+ } else {
2882
+ swiper[swiperMethod]("observerUpdate", onResize, true);
2883
+ }
2884
+ el[domMethod]("load", swiper.onLoad, {
2885
+ capture: true
2886
+ });
2887
+ };
2888
+ function attachEvents() {
2889
+ const swiper = this;
2890
+ const document2 = getDocument();
2891
+ const {
2892
+ params
2893
+ } = swiper;
2894
+ swiper.onTouchStart = onTouchStart.bind(swiper);
2895
+ swiper.onTouchMove = onTouchMove.bind(swiper);
2896
+ swiper.onTouchEnd = onTouchEnd.bind(swiper);
2897
+ if (params.cssMode) {
2898
+ swiper.onScroll = onScroll.bind(swiper);
2899
+ }
2900
+ swiper.onClick = onClick.bind(swiper);
2901
+ swiper.onLoad = onLoad.bind(swiper);
2902
+ if (!dummyEventAttached) {
2903
+ document2.addEventListener("touchstart", dummyEventListener);
2904
+ dummyEventAttached = true;
2905
+ }
2906
+ events(swiper, "on");
2907
+ }
2908
+ function detachEvents() {
2909
+ const swiper = this;
2910
+ events(swiper, "off");
2911
+ }
2912
+ var events$1 = {
2913
+ attachEvents,
2914
+ detachEvents
2915
+ };
2916
+ var isGridEnabled = (swiper, params) => {
2917
+ return swiper.grid && params.grid && params.grid.rows > 1;
2918
+ };
2919
+ function setBreakpoint() {
2920
+ const swiper = this;
2921
+ const {
2922
+ realIndex,
2923
+ initialized,
2924
+ params,
2925
+ el
2926
+ } = swiper;
2927
+ const breakpoints2 = params.breakpoints;
2928
+ if (!breakpoints2 || breakpoints2 && Object.keys(breakpoints2).length === 0) return;
2929
+ const breakpoint = swiper.getBreakpoint(breakpoints2, swiper.params.breakpointsBase, swiper.el);
2930
+ if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
2931
+ const breakpointOnlyParams = breakpoint in breakpoints2 ? breakpoints2[breakpoint] : void 0;
2932
+ const breakpointParams = breakpointOnlyParams || swiper.originalParams;
2933
+ const wasMultiRow = isGridEnabled(swiper, params);
2934
+ const isMultiRow = isGridEnabled(swiper, breakpointParams);
2935
+ const wasEnabled = params.enabled;
2936
+ if (wasMultiRow && !isMultiRow) {
2937
+ el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
2938
+ swiper.emitContainerClasses();
2939
+ } else if (!wasMultiRow && isMultiRow) {
2940
+ el.classList.add(`${params.containerModifierClass}grid`);
2941
+ if (breakpointParams.grid.fill && breakpointParams.grid.fill === "column" || !breakpointParams.grid.fill && params.grid.fill === "column") {
2942
+ el.classList.add(`${params.containerModifierClass}grid-column`);
2943
+ }
2944
+ swiper.emitContainerClasses();
2945
+ }
2946
+ ["navigation", "pagination", "scrollbar"].forEach((prop) => {
2947
+ if (typeof breakpointParams[prop] === "undefined") return;
2948
+ const wasModuleEnabled = params[prop] && params[prop].enabled;
2949
+ const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;
2950
+ if (wasModuleEnabled && !isModuleEnabled) {
2951
+ swiper[prop].disable();
2952
+ }
2953
+ if (!wasModuleEnabled && isModuleEnabled) {
2954
+ swiper[prop].enable();
2955
+ }
2956
+ });
2957
+ const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
2958
+ const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
2959
+ const wasLoop = params.loop;
2960
+ if (directionChanged && initialized) {
2961
+ swiper.changeDirection();
2962
+ }
2963
+ extend2(swiper.params, breakpointParams);
2964
+ const isEnabled = swiper.params.enabled;
2965
+ const hasLoop = swiper.params.loop;
2966
+ Object.assign(swiper, {
2967
+ allowTouchMove: swiper.params.allowTouchMove,
2968
+ allowSlideNext: swiper.params.allowSlideNext,
2969
+ allowSlidePrev: swiper.params.allowSlidePrev
2970
+ });
2971
+ if (wasEnabled && !isEnabled) {
2972
+ swiper.disable();
2973
+ } else if (!wasEnabled && isEnabled) {
2974
+ swiper.enable();
2975
+ }
2976
+ swiper.currentBreakpoint = breakpoint;
2977
+ swiper.emit("_beforeBreakpoint", breakpointParams);
2978
+ if (initialized) {
2979
+ if (needsReLoop) {
2980
+ swiper.loopDestroy();
2981
+ swiper.loopCreate(realIndex);
2982
+ swiper.updateSlides();
2983
+ } else if (!wasLoop && hasLoop) {
2984
+ swiper.loopCreate(realIndex);
2985
+ swiper.updateSlides();
2986
+ } else if (wasLoop && !hasLoop) {
2987
+ swiper.loopDestroy();
2988
+ }
2989
+ }
2990
+ swiper.emit("breakpoint", breakpointParams);
2991
+ }
2992
+ function getBreakpoint(breakpoints2, base, containerEl) {
2993
+ if (base === void 0) {
2994
+ base = "window";
2995
+ }
2996
+ if (!breakpoints2 || base === "container" && !containerEl) return void 0;
2997
+ let breakpoint = false;
2998
+ const window2 = getWindow();
2999
+ const currentHeight = base === "window" ? window2.innerHeight : containerEl.clientHeight;
3000
+ const points = Object.keys(breakpoints2).map((point) => {
3001
+ if (typeof point === "string" && point.indexOf("@") === 0) {
3002
+ const minRatio = parseFloat(point.substr(1));
3003
+ const value = currentHeight * minRatio;
3004
+ return {
3005
+ value,
3006
+ point
3007
+ };
3008
+ }
3009
+ return {
3010
+ value: point,
3011
+ point
3012
+ };
3013
+ });
3014
+ points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
3015
+ for (let i = 0; i < points.length; i += 1) {
3016
+ const {
3017
+ point,
3018
+ value
3019
+ } = points[i];
3020
+ if (base === "window") {
3021
+ if (window2.matchMedia(`(min-width: ${value}px)`).matches) {
3022
+ breakpoint = point;
3023
+ }
3024
+ } else if (value <= containerEl.clientWidth) {
3025
+ breakpoint = point;
3026
+ }
3027
+ }
3028
+ return breakpoint || "max";
3029
+ }
3030
+ var breakpoints = {
3031
+ setBreakpoint,
3032
+ getBreakpoint
3033
+ };
3034
+ function prepareClasses(entries, prefix) {
3035
+ const resultClasses = [];
3036
+ entries.forEach((item) => {
3037
+ if (typeof item === "object") {
3038
+ Object.keys(item).forEach((classNames) => {
3039
+ if (item[classNames]) {
3040
+ resultClasses.push(prefix + classNames);
3041
+ }
3042
+ });
3043
+ } else if (typeof item === "string") {
3044
+ resultClasses.push(prefix + item);
3045
+ }
3046
+ });
3047
+ return resultClasses;
3048
+ }
3049
+ function addClasses() {
3050
+ const swiper = this;
3051
+ const {
3052
+ classNames,
3053
+ params,
3054
+ rtl,
3055
+ el,
3056
+ device
3057
+ } = swiper;
3058
+ const suffixes = prepareClasses(["initialized", params.direction, {
3059
+ "free-mode": swiper.params.freeMode && params.freeMode.enabled
3060
+ }, {
3061
+ "autoheight": params.autoHeight
3062
+ }, {
3063
+ "rtl": rtl
3064
+ }, {
3065
+ "grid": params.grid && params.grid.rows > 1
3066
+ }, {
3067
+ "grid-column": params.grid && params.grid.rows > 1 && params.grid.fill === "column"
3068
+ }, {
3069
+ "android": device.android
3070
+ }, {
3071
+ "ios": device.ios
3072
+ }, {
3073
+ "css-mode": params.cssMode
3074
+ }, {
3075
+ "centered": params.cssMode && params.centeredSlides
3076
+ }, {
3077
+ "watch-progress": params.watchSlidesProgress
3078
+ }], params.containerModifierClass);
3079
+ classNames.push(...suffixes);
3080
+ el.classList.add(...classNames);
3081
+ swiper.emitContainerClasses();
3082
+ }
3083
+ function removeClasses() {
3084
+ const swiper = this;
3085
+ const {
3086
+ el,
3087
+ classNames
3088
+ } = swiper;
3089
+ el.classList.remove(...classNames);
3090
+ swiper.emitContainerClasses();
3091
+ }
3092
+ var classes = {
3093
+ addClasses,
3094
+ removeClasses
3095
+ };
3096
+ function checkOverflow() {
3097
+ const swiper = this;
3098
+ const {
3099
+ isLocked: wasLocked,
3100
+ params
3101
+ } = swiper;
3102
+ const {
3103
+ slidesOffsetBefore
3104
+ } = params;
3105
+ if (slidesOffsetBefore) {
3106
+ const lastSlideIndex = swiper.slides.length - 1;
3107
+ const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
3108
+ swiper.isLocked = swiper.size > lastSlideRightEdge;
3109
+ } else {
3110
+ swiper.isLocked = swiper.snapGrid.length === 1;
3111
+ }
3112
+ if (params.allowSlideNext === true) {
3113
+ swiper.allowSlideNext = !swiper.isLocked;
3114
+ }
3115
+ if (params.allowSlidePrev === true) {
3116
+ swiper.allowSlidePrev = !swiper.isLocked;
3117
+ }
3118
+ if (wasLocked && wasLocked !== swiper.isLocked) {
3119
+ swiper.isEnd = false;
3120
+ }
3121
+ if (wasLocked !== swiper.isLocked) {
3122
+ swiper.emit(swiper.isLocked ? "lock" : "unlock");
3123
+ }
3124
+ }
3125
+ var checkOverflow$1 = {
3126
+ checkOverflow
3127
+ };
3128
+ var defaults = {
3129
+ init: true,
3130
+ direction: "horizontal",
3131
+ oneWayMovement: false,
3132
+ touchEventsTarget: "wrapper",
3133
+ initialSlide: 0,
3134
+ speed: 300,
3135
+ cssMode: false,
3136
+ updateOnWindowResize: true,
3137
+ resizeObserver: true,
3138
+ nested: false,
3139
+ createElements: false,
3140
+ enabled: true,
3141
+ focusableElements: "input, select, option, textarea, button, video, label",
3142
+ // Overrides
3143
+ width: null,
3144
+ height: null,
3145
+ //
3146
+ preventInteractionOnTransition: false,
3147
+ // ssr
3148
+ userAgent: null,
3149
+ url: null,
3150
+ // To support iOS's swipe-to-go-back gesture (when being used in-app).
3151
+ edgeSwipeDetection: false,
3152
+ edgeSwipeThreshold: 20,
3153
+ // Autoheight
3154
+ autoHeight: false,
3155
+ // Set wrapper width
3156
+ setWrapperSize: false,
3157
+ // Virtual Translate
3158
+ virtualTranslate: false,
3159
+ // Effects
3160
+ effect: "slide",
3161
+ // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
3162
+ // Breakpoints
3163
+ breakpoints: void 0,
3164
+ breakpointsBase: "window",
3165
+ // Slides grid
3166
+ spaceBetween: 0,
3167
+ slidesPerView: 1,
3168
+ slidesPerGroup: 1,
3169
+ slidesPerGroupSkip: 0,
3170
+ slidesPerGroupAuto: false,
3171
+ centeredSlides: false,
3172
+ centeredSlidesBounds: false,
3173
+ slidesOffsetBefore: 0,
3174
+ // in px
3175
+ slidesOffsetAfter: 0,
3176
+ // in px
3177
+ normalizeSlideIndex: true,
3178
+ centerInsufficientSlides: false,
3179
+ // Disable swiper and hide navigation when container not overflow
3180
+ watchOverflow: true,
3181
+ // Round length
3182
+ roundLengths: false,
3183
+ // Touches
3184
+ touchRatio: 1,
3185
+ touchAngle: 45,
3186
+ simulateTouch: true,
3187
+ shortSwipes: true,
3188
+ longSwipes: true,
3189
+ longSwipesRatio: 0.5,
3190
+ longSwipesMs: 300,
3191
+ followFinger: true,
3192
+ allowTouchMove: true,
3193
+ threshold: 5,
3194
+ touchMoveStopPropagation: false,
3195
+ touchStartPreventDefault: true,
3196
+ touchStartForcePreventDefault: false,
3197
+ touchReleaseOnEdges: false,
3198
+ // Unique Navigation Elements
3199
+ uniqueNavElements: true,
3200
+ // Resistance
3201
+ resistance: true,
3202
+ resistanceRatio: 0.85,
3203
+ // Progress
3204
+ watchSlidesProgress: false,
3205
+ // Cursor
3206
+ grabCursor: false,
3207
+ // Clicks
3208
+ preventClicks: true,
3209
+ preventClicksPropagation: true,
3210
+ slideToClickedSlide: false,
3211
+ // loop
3212
+ loop: false,
3213
+ loopedSlides: null,
3214
+ loopPreventsSliding: true,
3215
+ // rewind
3216
+ rewind: false,
3217
+ // Swiping/no swiping
3218
+ allowSlidePrev: true,
3219
+ allowSlideNext: true,
3220
+ swipeHandler: null,
3221
+ // '.swipe-handler',
3222
+ noSwiping: true,
3223
+ noSwipingClass: "swiper-no-swiping",
3224
+ noSwipingSelector: null,
3225
+ // Passive Listeners
3226
+ passiveListeners: true,
3227
+ maxBackfaceHiddenSlides: 10,
3228
+ // NS
3229
+ containerModifierClass: "swiper-",
3230
+ // NEW
3231
+ slideClass: "swiper-slide",
3232
+ slideActiveClass: "swiper-slide-active",
3233
+ slideVisibleClass: "swiper-slide-visible",
3234
+ slideNextClass: "swiper-slide-next",
3235
+ slidePrevClass: "swiper-slide-prev",
3236
+ wrapperClass: "swiper-wrapper",
3237
+ lazyPreloaderClass: "swiper-lazy-preloader",
3238
+ lazyPreloadPrevNext: 0,
3239
+ // Callbacks
3240
+ runCallbacksOnInit: true,
3241
+ // Internals
3242
+ _emitClasses: false
3243
+ };
3244
+ function moduleExtendParams(params, allModulesParams) {
3245
+ return function extendParams(obj) {
3246
+ if (obj === void 0) {
3247
+ obj = {};
3248
+ }
3249
+ const moduleParamName = Object.keys(obj)[0];
3250
+ const moduleParams = obj[moduleParamName];
3251
+ if (typeof moduleParams !== "object" || moduleParams === null) {
3252
+ extend2(allModulesParams, obj);
3253
+ return;
3254
+ }
3255
+ if (params[moduleParamName] === true) {
3256
+ params[moduleParamName] = {
3257
+ enabled: true
3258
+ };
3259
+ }
3260
+ if (moduleParamName === "navigation" && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].prevEl && !params[moduleParamName].nextEl) {
3261
+ params[moduleParamName].auto = true;
3262
+ }
3263
+ if (["pagination", "scrollbar"].indexOf(moduleParamName) >= 0 && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].el) {
3264
+ params[moduleParamName].auto = true;
3265
+ }
3266
+ if (!(moduleParamName in params && "enabled" in moduleParams)) {
3267
+ extend2(allModulesParams, obj);
3268
+ return;
3269
+ }
3270
+ if (typeof params[moduleParamName] === "object" && !("enabled" in params[moduleParamName])) {
3271
+ params[moduleParamName].enabled = true;
3272
+ }
3273
+ if (!params[moduleParamName]) params[moduleParamName] = {
3274
+ enabled: false
3275
+ };
3276
+ extend2(allModulesParams, obj);
3277
+ };
3278
+ }
3279
+ var prototypes = {
3280
+ eventsEmitter,
3281
+ update,
3282
+ translate,
3283
+ transition,
3284
+ slide,
3285
+ loop,
3286
+ grabCursor,
3287
+ events: events$1,
3288
+ breakpoints,
3289
+ checkOverflow: checkOverflow$1,
3290
+ classes
3291
+ };
3292
+ var extendedDefaults = {};
3293
+ var Swiper = class _Swiper {
3294
+ constructor() {
3295
+ let el;
3296
+ let params;
3297
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3298
+ args[_key] = arguments[_key];
3299
+ }
3300
+ if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === "Object") {
3301
+ params = args[0];
3302
+ } else {
3303
+ [el, params] = args;
3304
+ }
3305
+ if (!params) params = {};
3306
+ params = extend2({}, params);
3307
+ if (el && !params.el) params.el = el;
3308
+ const document2 = getDocument();
3309
+ if (params.el && typeof params.el === "string" && document2.querySelectorAll(params.el).length > 1) {
3310
+ const swipers = [];
3311
+ document2.querySelectorAll(params.el).forEach((containerEl) => {
3312
+ const newParams = extend2({}, params, {
3313
+ el: containerEl
3314
+ });
3315
+ swipers.push(new _Swiper(newParams));
3316
+ });
3317
+ return swipers;
3318
+ }
3319
+ const swiper = this;
3320
+ swiper.__swiper__ = true;
3321
+ swiper.support = getSupport();
3322
+ swiper.device = getDevice({
3323
+ userAgent: params.userAgent
3324
+ });
3325
+ swiper.browser = getBrowser();
3326
+ swiper.eventsListeners = {};
3327
+ swiper.eventsAnyListeners = [];
3328
+ swiper.modules = [...swiper.__modules__];
3329
+ if (params.modules && Array.isArray(params.modules)) {
3330
+ swiper.modules.push(...params.modules);
3331
+ }
3332
+ const allModulesParams = {};
3333
+ swiper.modules.forEach((mod) => {
3334
+ mod({
3335
+ params,
3336
+ swiper,
3337
+ extendParams: moduleExtendParams(params, allModulesParams),
3338
+ on: swiper.on.bind(swiper),
3339
+ once: swiper.once.bind(swiper),
3340
+ off: swiper.off.bind(swiper),
3341
+ emit: swiper.emit.bind(swiper)
3342
+ });
3343
+ });
3344
+ const swiperParams = extend2({}, defaults, allModulesParams);
3345
+ swiper.params = extend2({}, swiperParams, extendedDefaults, params);
3346
+ swiper.originalParams = extend2({}, swiper.params);
3347
+ swiper.passedParams = extend2({}, params);
3348
+ if (swiper.params && swiper.params.on) {
3349
+ Object.keys(swiper.params.on).forEach((eventName) => {
3350
+ swiper.on(eventName, swiper.params.on[eventName]);
3351
+ });
3352
+ }
3353
+ if (swiper.params && swiper.params.onAny) {
3354
+ swiper.onAny(swiper.params.onAny);
3355
+ }
3356
+ Object.assign(swiper, {
3357
+ enabled: swiper.params.enabled,
3358
+ el,
3359
+ // Classes
3360
+ classNames: [],
3361
+ // Slides
3362
+ slides: [],
3363
+ slidesGrid: [],
3364
+ snapGrid: [],
3365
+ slidesSizesGrid: [],
3366
+ // isDirection
3367
+ isHorizontal() {
3368
+ return swiper.params.direction === "horizontal";
3369
+ },
3370
+ isVertical() {
3371
+ return swiper.params.direction === "vertical";
3372
+ },
3373
+ // Indexes
3374
+ activeIndex: 0,
3375
+ realIndex: 0,
3376
+ //
3377
+ isBeginning: true,
3378
+ isEnd: false,
3379
+ // Props
3380
+ translate: 0,
3381
+ previousTranslate: 0,
3382
+ progress: 0,
3383
+ velocity: 0,
3384
+ animating: false,
3385
+ cssOverflowAdjustment() {
3386
+ return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;
3387
+ },
3388
+ // Locks
3389
+ allowSlideNext: swiper.params.allowSlideNext,
3390
+ allowSlidePrev: swiper.params.allowSlidePrev,
3391
+ // Touch Events
3392
+ touchEventsData: {
3393
+ isTouched: void 0,
3394
+ isMoved: void 0,
3395
+ allowTouchCallbacks: void 0,
3396
+ touchStartTime: void 0,
3397
+ isScrolling: void 0,
3398
+ currentTranslate: void 0,
3399
+ startTranslate: void 0,
3400
+ allowThresholdMove: void 0,
3401
+ // Form elements to match
3402
+ focusableElements: swiper.params.focusableElements,
3403
+ // Last click time
3404
+ lastClickTime: 0,
3405
+ clickTimeout: void 0,
3406
+ // Velocities
3407
+ velocities: [],
3408
+ allowMomentumBounce: void 0,
3409
+ startMoving: void 0,
3410
+ evCache: []
3411
+ },
3412
+ // Clicks
3413
+ allowClick: true,
3414
+ // Touches
3415
+ allowTouchMove: swiper.params.allowTouchMove,
3416
+ touches: {
3417
+ startX: 0,
3418
+ startY: 0,
3419
+ currentX: 0,
3420
+ currentY: 0,
3421
+ diff: 0
3422
+ },
3423
+ // Images
3424
+ imagesToLoad: [],
3425
+ imagesLoaded: 0
3426
+ });
3427
+ swiper.emit("_swiper");
3428
+ if (swiper.params.init) {
3429
+ swiper.init();
3430
+ }
3431
+ return swiper;
3432
+ }
3433
+ getSlideIndex(slideEl) {
3434
+ const {
3435
+ slidesEl,
3436
+ params
3437
+ } = this;
3438
+ const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3439
+ const firstSlideIndex = elementIndex(slides[0]);
3440
+ return elementIndex(slideEl) - firstSlideIndex;
3441
+ }
3442
+ getSlideIndexByData(index) {
3443
+ return this.getSlideIndex(this.slides.filter((slideEl) => slideEl.getAttribute("data-swiper-slide-index") * 1 === index)[0]);
3444
+ }
3445
+ recalcSlides() {
3446
+ const swiper = this;
3447
+ const {
3448
+ slidesEl,
3449
+ params
3450
+ } = swiper;
3451
+ swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
3452
+ }
3453
+ enable() {
3454
+ const swiper = this;
3455
+ if (swiper.enabled) return;
3456
+ swiper.enabled = true;
3457
+ if (swiper.params.grabCursor) {
3458
+ swiper.setGrabCursor();
3459
+ }
3460
+ swiper.emit("enable");
3461
+ }
3462
+ disable() {
3463
+ const swiper = this;
3464
+ if (!swiper.enabled) return;
3465
+ swiper.enabled = false;
3466
+ if (swiper.params.grabCursor) {
3467
+ swiper.unsetGrabCursor();
3468
+ }
3469
+ swiper.emit("disable");
3470
+ }
3471
+ setProgress(progress, speed) {
3472
+ const swiper = this;
3473
+ progress = Math.min(Math.max(progress, 0), 1);
3474
+ const min = swiper.minTranslate();
3475
+ const max = swiper.maxTranslate();
3476
+ const current = (max - min) * progress + min;
3477
+ swiper.translateTo(current, typeof speed === "undefined" ? 0 : speed);
3478
+ swiper.updateActiveIndex();
3479
+ swiper.updateSlidesClasses();
3480
+ }
3481
+ emitContainerClasses() {
3482
+ const swiper = this;
3483
+ if (!swiper.params._emitClasses || !swiper.el) return;
3484
+ const cls = swiper.el.className.split(" ").filter((className) => {
3485
+ return className.indexOf("swiper") === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
3486
+ });
3487
+ swiper.emit("_containerClasses", cls.join(" "));
3488
+ }
3489
+ getSlideClasses(slideEl) {
3490
+ const swiper = this;
3491
+ if (swiper.destroyed) return "";
3492
+ return slideEl.className.split(" ").filter((className) => {
3493
+ return className.indexOf("swiper-slide") === 0 || className.indexOf(swiper.params.slideClass) === 0;
3494
+ }).join(" ");
3495
+ }
3496
+ emitSlidesClasses() {
3497
+ const swiper = this;
3498
+ if (!swiper.params._emitClasses || !swiper.el) return;
3499
+ const updates = [];
3500
+ swiper.slides.forEach((slideEl) => {
3501
+ const classNames = swiper.getSlideClasses(slideEl);
3502
+ updates.push({
3503
+ slideEl,
3504
+ classNames
3505
+ });
3506
+ swiper.emit("_slideClass", slideEl, classNames);
3507
+ });
3508
+ swiper.emit("_slideClasses", updates);
3509
+ }
3510
+ slidesPerViewDynamic(view, exact) {
3511
+ if (view === void 0) {
3512
+ view = "current";
3513
+ }
3514
+ if (exact === void 0) {
3515
+ exact = false;
3516
+ }
3517
+ const swiper = this;
3518
+ const {
3519
+ params,
3520
+ slides,
3521
+ slidesGrid,
3522
+ slidesSizesGrid,
3523
+ size: swiperSize,
3524
+ activeIndex
3525
+ } = swiper;
3526
+ let spv = 1;
3527
+ if (typeof params.slidesPerView === "number") return params.slidesPerView;
3528
+ if (params.centeredSlides) {
3529
+ let slideSize = slides[activeIndex] ? slides[activeIndex].swiperSlideSize : 0;
3530
+ let breakLoop;
3531
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
3532
+ if (slides[i] && !breakLoop) {
3533
+ slideSize += slides[i].swiperSlideSize;
3534
+ spv += 1;
3535
+ if (slideSize > swiperSize) breakLoop = true;
3536
+ }
3537
+ }
3538
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
3539
+ if (slides[i] && !breakLoop) {
3540
+ slideSize += slides[i].swiperSlideSize;
3541
+ spv += 1;
3542
+ if (slideSize > swiperSize) breakLoop = true;
3543
+ }
3544
+ }
3545
+ } else {
3546
+ if (view === "current") {
3547
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
3548
+ const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
3549
+ if (slideInView) {
3550
+ spv += 1;
3551
+ }
3552
+ }
3553
+ } else {
3554
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
3555
+ const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
3556
+ if (slideInView) {
3557
+ spv += 1;
3558
+ }
3559
+ }
3560
+ }
3561
+ }
3562
+ return spv;
3563
+ }
3564
+ update() {
3565
+ const swiper = this;
3566
+ if (!swiper || swiper.destroyed) return;
3567
+ const {
3568
+ snapGrid,
3569
+ params
3570
+ } = swiper;
3571
+ if (params.breakpoints) {
3572
+ swiper.setBreakpoint();
3573
+ }
3574
+ [...swiper.el.querySelectorAll('[loading="lazy"]')].forEach((imageEl) => {
3575
+ if (imageEl.complete) {
3576
+ processLazyPreloader(swiper, imageEl);
3577
+ }
3578
+ });
3579
+ swiper.updateSize();
3580
+ swiper.updateSlides();
3581
+ swiper.updateProgress();
3582
+ swiper.updateSlidesClasses();
3583
+ function setTranslate2() {
3584
+ const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
3585
+ const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
3586
+ swiper.setTranslate(newTranslate);
3587
+ swiper.updateActiveIndex();
3588
+ swiper.updateSlidesClasses();
3589
+ }
3590
+ let translated;
3591
+ if (params.freeMode && params.freeMode.enabled && !params.cssMode) {
3592
+ setTranslate2();
3593
+ if (params.autoHeight) {
3594
+ swiper.updateAutoHeight();
3595
+ }
3596
+ } else {
3597
+ if ((params.slidesPerView === "auto" || params.slidesPerView > 1) && swiper.isEnd && !params.centeredSlides) {
3598
+ const slides = swiper.virtual && params.virtual.enabled ? swiper.virtual.slides : swiper.slides;
3599
+ translated = swiper.slideTo(slides.length - 1, 0, false, true);
3600
+ } else {
3601
+ translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
3602
+ }
3603
+ if (!translated) {
3604
+ setTranslate2();
3605
+ }
3606
+ }
3607
+ if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
3608
+ swiper.checkOverflow();
3609
+ }
3610
+ swiper.emit("update");
3611
+ }
3612
+ changeDirection(newDirection, needUpdate) {
3613
+ if (needUpdate === void 0) {
3614
+ needUpdate = true;
3615
+ }
3616
+ const swiper = this;
3617
+ const currentDirection = swiper.params.direction;
3618
+ if (!newDirection) {
3619
+ newDirection = currentDirection === "horizontal" ? "vertical" : "horizontal";
3620
+ }
3621
+ if (newDirection === currentDirection || newDirection !== "horizontal" && newDirection !== "vertical") {
3622
+ return swiper;
3623
+ }
3624
+ swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`);
3625
+ swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`);
3626
+ swiper.emitContainerClasses();
3627
+ swiper.params.direction = newDirection;
3628
+ swiper.slides.forEach((slideEl) => {
3629
+ if (newDirection === "vertical") {
3630
+ slideEl.style.width = "";
3631
+ } else {
3632
+ slideEl.style.height = "";
3633
+ }
3634
+ });
3635
+ swiper.emit("changeDirection");
3636
+ if (needUpdate) swiper.update();
3637
+ return swiper;
3638
+ }
3639
+ changeLanguageDirection(direction) {
3640
+ const swiper = this;
3641
+ if (swiper.rtl && direction === "rtl" || !swiper.rtl && direction === "ltr") return;
3642
+ swiper.rtl = direction === "rtl";
3643
+ swiper.rtlTranslate = swiper.params.direction === "horizontal" && swiper.rtl;
3644
+ if (swiper.rtl) {
3645
+ swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`);
3646
+ swiper.el.dir = "rtl";
3647
+ } else {
3648
+ swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`);
3649
+ swiper.el.dir = "ltr";
3650
+ }
3651
+ swiper.update();
3652
+ }
3653
+ mount(element) {
3654
+ const swiper = this;
3655
+ if (swiper.mounted) return true;
3656
+ let el = element || swiper.params.el;
3657
+ if (typeof el === "string") {
3658
+ el = document.querySelector(el);
3659
+ }
3660
+ if (!el) {
3661
+ return false;
3662
+ }
3663
+ el.swiper = swiper;
3664
+ if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === "SWIPER-CONTAINER") {
3665
+ swiper.isElement = true;
3666
+ }
3667
+ const getWrapperSelector = () => {
3668
+ return `.${(swiper.params.wrapperClass || "").trim().split(" ").join(".")}`;
3669
+ };
3670
+ const getWrapper = () => {
3671
+ if (el && el.shadowRoot && el.shadowRoot.querySelector) {
3672
+ const res = el.shadowRoot.querySelector(getWrapperSelector());
3673
+ return res;
3674
+ }
3675
+ return elementChildren(el, getWrapperSelector())[0];
3676
+ };
3677
+ let wrapperEl = getWrapper();
3678
+ if (!wrapperEl && swiper.params.createElements) {
3679
+ wrapperEl = createElement("div", swiper.params.wrapperClass);
3680
+ el.append(wrapperEl);
3681
+ elementChildren(el, `.${swiper.params.slideClass}`).forEach((slideEl) => {
3682
+ wrapperEl.append(slideEl);
3683
+ });
3684
+ }
3685
+ Object.assign(swiper, {
3686
+ el,
3687
+ wrapperEl,
3688
+ slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl,
3689
+ hostEl: swiper.isElement ? el.parentNode.host : el,
3690
+ mounted: true,
3691
+ // RTL
3692
+ rtl: el.dir.toLowerCase() === "rtl" || elementStyle(el, "direction") === "rtl",
3693
+ rtlTranslate: swiper.params.direction === "horizontal" && (el.dir.toLowerCase() === "rtl" || elementStyle(el, "direction") === "rtl"),
3694
+ wrongRTL: elementStyle(wrapperEl, "display") === "-webkit-box"
3695
+ });
3696
+ return true;
3697
+ }
3698
+ init(el) {
3699
+ const swiper = this;
3700
+ if (swiper.initialized) return swiper;
3701
+ const mounted = swiper.mount(el);
3702
+ if (mounted === false) return swiper;
3703
+ swiper.emit("beforeInit");
3704
+ if (swiper.params.breakpoints) {
3705
+ swiper.setBreakpoint();
3706
+ }
3707
+ swiper.addClasses();
3708
+ swiper.updateSize();
3709
+ swiper.updateSlides();
3710
+ if (swiper.params.watchOverflow) {
3711
+ swiper.checkOverflow();
3712
+ }
3713
+ if (swiper.params.grabCursor && swiper.enabled) {
3714
+ swiper.setGrabCursor();
3715
+ }
3716
+ if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
3717
+ swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true);
3718
+ } else {
3719
+ swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
3720
+ }
3721
+ if (swiper.params.loop) {
3722
+ swiper.loopCreate();
3723
+ }
3724
+ swiper.attachEvents();
3725
+ const lazyElements = [...swiper.el.querySelectorAll('[loading="lazy"]')];
3726
+ if (swiper.isElement) {
3727
+ lazyElements.push(...swiper.hostEl.querySelectorAll('[loading="lazy"]'));
3728
+ }
3729
+ lazyElements.forEach((imageEl) => {
3730
+ if (imageEl.complete) {
3731
+ processLazyPreloader(swiper, imageEl);
3732
+ } else {
3733
+ imageEl.addEventListener("load", (e) => {
3734
+ processLazyPreloader(swiper, e.target);
3735
+ });
3736
+ }
3737
+ });
3738
+ preload(swiper);
3739
+ swiper.initialized = true;
3740
+ preload(swiper);
3741
+ swiper.emit("init");
3742
+ swiper.emit("afterInit");
3743
+ return swiper;
3744
+ }
3745
+ destroy(deleteInstance, cleanStyles) {
3746
+ if (deleteInstance === void 0) {
3747
+ deleteInstance = true;
3748
+ }
3749
+ if (cleanStyles === void 0) {
3750
+ cleanStyles = true;
3751
+ }
3752
+ const swiper = this;
3753
+ const {
3754
+ params,
3755
+ el,
3756
+ wrapperEl,
3757
+ slides
3758
+ } = swiper;
3759
+ if (typeof swiper.params === "undefined" || swiper.destroyed) {
3760
+ return null;
3761
+ }
3762
+ swiper.emit("beforeDestroy");
3763
+ swiper.initialized = false;
3764
+ swiper.detachEvents();
3765
+ if (params.loop) {
3766
+ swiper.loopDestroy();
3767
+ }
3768
+ if (cleanStyles) {
3769
+ swiper.removeClasses();
3770
+ el.removeAttribute("style");
3771
+ wrapperEl.removeAttribute("style");
3772
+ if (slides && slides.length) {
3773
+ slides.forEach((slideEl) => {
3774
+ slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
3775
+ slideEl.removeAttribute("style");
3776
+ slideEl.removeAttribute("data-swiper-slide-index");
3777
+ });
3778
+ }
3779
+ }
3780
+ swiper.emit("destroy");
3781
+ Object.keys(swiper.eventsListeners).forEach((eventName) => {
3782
+ swiper.off(eventName);
3783
+ });
3784
+ if (deleteInstance !== false) {
3785
+ swiper.el.swiper = null;
3786
+ deleteProps(swiper);
3787
+ }
3788
+ swiper.destroyed = true;
3789
+ return null;
3790
+ }
3791
+ static extendDefaults(newDefaults) {
3792
+ extend2(extendedDefaults, newDefaults);
3793
+ }
3794
+ static get extendedDefaults() {
3795
+ return extendedDefaults;
3796
+ }
3797
+ static get defaults() {
3798
+ return defaults;
3799
+ }
3800
+ static installModule(mod) {
3801
+ if (!_Swiper.prototype.__modules__) _Swiper.prototype.__modules__ = [];
3802
+ const modules = _Swiper.prototype.__modules__;
3803
+ if (typeof mod === "function" && modules.indexOf(mod) < 0) {
3804
+ modules.push(mod);
3805
+ }
3806
+ }
3807
+ static use(module2) {
3808
+ if (Array.isArray(module2)) {
3809
+ module2.forEach((m) => _Swiper.installModule(m));
3810
+ return _Swiper;
3811
+ }
3812
+ _Swiper.installModule(module2);
3813
+ return _Swiper;
3814
+ }
3815
+ };
3816
+ Object.keys(prototypes).forEach((prototypeGroup) => {
3817
+ Object.keys(prototypes[prototypeGroup]).forEach((protoMethod) => {
3818
+ Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
3819
+ });
3820
+ });
3821
+ Swiper.use([Resize, Observer]);
3822
+ //# sourceMappingURL=swiper.js.map