@realsee/dnalogel 2.1.0-alpha.12 → 2.1.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -15,8 +15,9 @@ import Hammer from 'hammerjs';
15
15
  import classNames from 'classnames';
16
16
  import objectAssignDeep from 'object-assign-deep';
17
17
  import anime from 'animejs';
18
- import { Swiper, SwiperSlide } from 'swiper/svelte';
19
- import { Autoplay } from 'swiper';
18
+ import { Swiper as Swiper$1, SwiperSlide } from 'swiper/svelte';
19
+ import { getWindow, getDocument } from 'ssr-window';
20
+ import { $, addClass, removeClass, hasClass, toggleClass, attr as attr$1, removeAttr, transform, transition as transition$1, on, off, trigger, transitionEnd as transitionEnd$1, outerWidth, outerHeight, styles, offset, css, each, html, text as text$1, is, index, eq, append as append$1, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, filter, remove } from 'dom7';
20
21
  import 'swiper/css';
21
22
  import 'swiper/css/autoplay';
22
23
 
@@ -21921,6 +21922,4107 @@ class Polyline extends SvelteComponent {
21921
21922
  }
21922
21923
  }
21923
21924
 
21925
+ const Methods = {
21926
+ addClass,
21927
+ removeClass,
21928
+ hasClass,
21929
+ toggleClass,
21930
+ attr: attr$1,
21931
+ removeAttr,
21932
+ transform,
21933
+ transition: transition$1,
21934
+ on,
21935
+ off,
21936
+ trigger,
21937
+ transitionEnd: transitionEnd$1,
21938
+ outerWidth,
21939
+ outerHeight,
21940
+ styles,
21941
+ offset,
21942
+ css,
21943
+ each,
21944
+ html,
21945
+ text: text$1,
21946
+ is,
21947
+ index,
21948
+ eq,
21949
+ append: append$1,
21950
+ prepend,
21951
+ next,
21952
+ nextAll,
21953
+ prev,
21954
+ prevAll,
21955
+ parent,
21956
+ parents,
21957
+ closest,
21958
+ find,
21959
+ children,
21960
+ filter,
21961
+ remove
21962
+ };
21963
+ Object.keys(Methods).forEach(methodName => {
21964
+ Object.defineProperty($.fn, methodName, {
21965
+ value: Methods[methodName],
21966
+ writable: true
21967
+ });
21968
+ });
21969
+
21970
+ function deleteProps(obj) {
21971
+ const object = obj;
21972
+ Object.keys(object).forEach(key => {
21973
+ try {
21974
+ object[key] = null;
21975
+ } catch (e) {// no getter for object
21976
+ }
21977
+
21978
+ try {
21979
+ delete object[key];
21980
+ } catch (e) {// something got wrong
21981
+ }
21982
+ });
21983
+ }
21984
+
21985
+ function nextTick(callback, delay = 0) {
21986
+ return setTimeout(callback, delay);
21987
+ }
21988
+
21989
+ function now() {
21990
+ return Date.now();
21991
+ }
21992
+
21993
+ function getComputedStyle$1(el) {
21994
+ const window = getWindow();
21995
+ let style;
21996
+
21997
+ if (window.getComputedStyle) {
21998
+ style = window.getComputedStyle(el, null);
21999
+ }
22000
+
22001
+ if (!style && el.currentStyle) {
22002
+ style = el.currentStyle;
22003
+ }
22004
+
22005
+ if (!style) {
22006
+ style = el.style;
22007
+ }
22008
+
22009
+ return style;
22010
+ }
22011
+
22012
+ function getTranslate(el, axis = 'x') {
22013
+ const window = getWindow();
22014
+ let matrix;
22015
+ let curTransform;
22016
+ let transformMatrix;
22017
+ const curStyle = getComputedStyle$1(el);
22018
+
22019
+ if (window.WebKitCSSMatrix) {
22020
+ curTransform = curStyle.transform || curStyle.webkitTransform;
22021
+
22022
+ if (curTransform.split(',').length > 6) {
22023
+ curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');
22024
+ } // Some old versions of Webkit choke when 'none' is passed; pass
22025
+ // empty string instead in this case
22026
+
22027
+
22028
+ transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
22029
+ } else {
22030
+ transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
22031
+ matrix = transformMatrix.toString().split(',');
22032
+ }
22033
+
22034
+ if (axis === 'x') {
22035
+ // Latest Chrome and webkits Fix
22036
+ if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix
22037
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers
22038
+ else curTransform = parseFloat(matrix[4]);
22039
+ }
22040
+
22041
+ if (axis === 'y') {
22042
+ // Latest Chrome and webkits Fix
22043
+ if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix
22044
+ else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers
22045
+ else curTransform = parseFloat(matrix[5]);
22046
+ }
22047
+
22048
+ return curTransform || 0;
22049
+ }
22050
+
22051
+ function isObject(o) {
22052
+ return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';
22053
+ }
22054
+
22055
+ function isNode(node) {
22056
+ // eslint-disable-next-line
22057
+ if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {
22058
+ return node instanceof HTMLElement;
22059
+ }
22060
+
22061
+ return node && (node.nodeType === 1 || node.nodeType === 11);
22062
+ }
22063
+
22064
+ function extend(...args) {
22065
+ const to = Object(args[0]);
22066
+ const noExtend = ['__proto__', 'constructor', 'prototype'];
22067
+
22068
+ for (let i = 1; i < args.length; i += 1) {
22069
+ const nextSource = args[i];
22070
+
22071
+ if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {
22072
+ const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);
22073
+
22074
+ for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
22075
+ const nextKey = keysArray[nextIndex];
22076
+ const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
22077
+
22078
+ if (desc !== undefined && desc.enumerable) {
22079
+ if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
22080
+ if (nextSource[nextKey].__swiper__) {
22081
+ to[nextKey] = nextSource[nextKey];
22082
+ } else {
22083
+ extend(to[nextKey], nextSource[nextKey]);
22084
+ }
22085
+ } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
22086
+ to[nextKey] = {};
22087
+
22088
+ if (nextSource[nextKey].__swiper__) {
22089
+ to[nextKey] = nextSource[nextKey];
22090
+ } else {
22091
+ extend(to[nextKey], nextSource[nextKey]);
22092
+ }
22093
+ } else {
22094
+ to[nextKey] = nextSource[nextKey];
22095
+ }
22096
+ }
22097
+ }
22098
+ }
22099
+ }
22100
+
22101
+ return to;
22102
+ }
22103
+
22104
+ function setCSSProperty(el, varName, varValue) {
22105
+ el.style.setProperty(varName, varValue);
22106
+ }
22107
+
22108
+ function animateCSSModeScroll({
22109
+ swiper,
22110
+ targetPosition,
22111
+ side
22112
+ }) {
22113
+ const window = getWindow();
22114
+ const startPosition = -swiper.translate;
22115
+ let startTime = null;
22116
+ let time;
22117
+ const duration = swiper.params.speed;
22118
+ swiper.wrapperEl.style.scrollSnapType = 'none';
22119
+ window.cancelAnimationFrame(swiper.cssModeFrameID);
22120
+ const dir = targetPosition > startPosition ? 'next' : 'prev';
22121
+
22122
+ const isOutOfBound = (current, target) => {
22123
+ return dir === 'next' && current >= target || dir === 'prev' && current <= target;
22124
+ };
22125
+
22126
+ const animate = () => {
22127
+ time = new Date().getTime();
22128
+
22129
+ if (startTime === null) {
22130
+ startTime = time;
22131
+ }
22132
+
22133
+ const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);
22134
+ const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;
22135
+ let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);
22136
+
22137
+ if (isOutOfBound(currentPosition, targetPosition)) {
22138
+ currentPosition = targetPosition;
22139
+ }
22140
+
22141
+ swiper.wrapperEl.scrollTo({
22142
+ [side]: currentPosition
22143
+ });
22144
+
22145
+ if (isOutOfBound(currentPosition, targetPosition)) {
22146
+ swiper.wrapperEl.style.overflow = 'hidden';
22147
+ swiper.wrapperEl.style.scrollSnapType = '';
22148
+ setTimeout(() => {
22149
+ swiper.wrapperEl.style.overflow = '';
22150
+ swiper.wrapperEl.scrollTo({
22151
+ [side]: currentPosition
22152
+ });
22153
+ });
22154
+ window.cancelAnimationFrame(swiper.cssModeFrameID);
22155
+ return;
22156
+ }
22157
+
22158
+ swiper.cssModeFrameID = window.requestAnimationFrame(animate);
22159
+ };
22160
+
22161
+ animate();
22162
+ }
22163
+
22164
+ let support;
22165
+
22166
+ function calcSupport() {
22167
+ const window = getWindow();
22168
+ const document = getDocument();
22169
+ return {
22170
+ smoothScroll: document.documentElement && 'scrollBehavior' in document.documentElement.style,
22171
+ touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),
22172
+ passiveListener: function checkPassiveListener() {
22173
+ let supportsPassive = false;
22174
+
22175
+ try {
22176
+ const opts = Object.defineProperty({}, 'passive', {
22177
+ // eslint-disable-next-line
22178
+ get() {
22179
+ supportsPassive = true;
22180
+ }
22181
+
22182
+ });
22183
+ window.addEventListener('testPassiveListener', null, opts);
22184
+ } catch (e) {// No support
22185
+ }
22186
+
22187
+ return supportsPassive;
22188
+ }(),
22189
+ gestures: function checkGestures() {
22190
+ return 'ongesturestart' in window;
22191
+ }()
22192
+ };
22193
+ }
22194
+
22195
+ function getSupport() {
22196
+ if (!support) {
22197
+ support = calcSupport();
22198
+ }
22199
+
22200
+ return support;
22201
+ }
22202
+
22203
+ let deviceCached;
22204
+
22205
+ function calcDevice({
22206
+ userAgent
22207
+ } = {}) {
22208
+ const support = getSupport();
22209
+ const window = getWindow();
22210
+ const platform = window.navigator.platform;
22211
+ const ua = userAgent || window.navigator.userAgent;
22212
+ const device = {
22213
+ ios: false,
22214
+ android: false
22215
+ };
22216
+ const screenWidth = window.screen.width;
22217
+ const screenHeight = window.screen.height;
22218
+ const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
22219
+
22220
+ let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
22221
+ const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
22222
+ const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
22223
+ const windows = platform === 'Win32';
22224
+ let macos = platform === 'MacIntel'; // iPadOs 13 fix
22225
+
22226
+ const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];
22227
+
22228
+ if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {
22229
+ ipad = ua.match(/(Version)\/([\d.]+)/);
22230
+ if (!ipad) ipad = [0, 1, '13_0_0'];
22231
+ macos = false;
22232
+ } // Android
22233
+
22234
+
22235
+ if (android && !windows) {
22236
+ device.os = 'android';
22237
+ device.android = true;
22238
+ }
22239
+
22240
+ if (ipad || iphone || ipod) {
22241
+ device.os = 'ios';
22242
+ device.ios = true;
22243
+ } // Export object
22244
+
22245
+
22246
+ return device;
22247
+ }
22248
+
22249
+ function getDevice(overrides = {}) {
22250
+ if (!deviceCached) {
22251
+ deviceCached = calcDevice(overrides);
22252
+ }
22253
+
22254
+ return deviceCached;
22255
+ }
22256
+
22257
+ let browser;
22258
+
22259
+ function calcBrowser() {
22260
+ const window = getWindow();
22261
+
22262
+ function isSafari() {
22263
+ const ua = window.navigator.userAgent.toLowerCase();
22264
+ return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
22265
+ }
22266
+
22267
+ return {
22268
+ isSafari: isSafari(),
22269
+ isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
22270
+ };
22271
+ }
22272
+
22273
+ function getBrowser() {
22274
+ if (!browser) {
22275
+ browser = calcBrowser();
22276
+ }
22277
+
22278
+ return browser;
22279
+ }
22280
+
22281
+ function Resize({
22282
+ swiper,
22283
+ on,
22284
+ emit
22285
+ }) {
22286
+ const window = getWindow();
22287
+ let observer = null;
22288
+ let animationFrame = null;
22289
+
22290
+ const resizeHandler = () => {
22291
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
22292
+ emit('beforeResize');
22293
+ emit('resize');
22294
+ };
22295
+
22296
+ const createObserver = () => {
22297
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
22298
+ observer = new ResizeObserver(entries => {
22299
+ animationFrame = window.requestAnimationFrame(() => {
22300
+ const {
22301
+ width,
22302
+ height
22303
+ } = swiper;
22304
+ let newWidth = width;
22305
+ let newHeight = height;
22306
+ entries.forEach(({
22307
+ contentBoxSize,
22308
+ contentRect,
22309
+ target
22310
+ }) => {
22311
+ if (target && target !== swiper.el) return;
22312
+ newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
22313
+ newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
22314
+ });
22315
+
22316
+ if (newWidth !== width || newHeight !== height) {
22317
+ resizeHandler();
22318
+ }
22319
+ });
22320
+ });
22321
+ observer.observe(swiper.el);
22322
+ };
22323
+
22324
+ const removeObserver = () => {
22325
+ if (animationFrame) {
22326
+ window.cancelAnimationFrame(animationFrame);
22327
+ }
22328
+
22329
+ if (observer && observer.unobserve && swiper.el) {
22330
+ observer.unobserve(swiper.el);
22331
+ observer = null;
22332
+ }
22333
+ };
22334
+
22335
+ const orientationChangeHandler = () => {
22336
+ if (!swiper || swiper.destroyed || !swiper.initialized) return;
22337
+ emit('orientationchange');
22338
+ };
22339
+
22340
+ on('init', () => {
22341
+ if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {
22342
+ createObserver();
22343
+ return;
22344
+ }
22345
+
22346
+ window.addEventListener('resize', resizeHandler);
22347
+ window.addEventListener('orientationchange', orientationChangeHandler);
22348
+ });
22349
+ on('destroy', () => {
22350
+ removeObserver();
22351
+ window.removeEventListener('resize', resizeHandler);
22352
+ window.removeEventListener('orientationchange', orientationChangeHandler);
22353
+ });
22354
+ }
22355
+
22356
+ function Observer({
22357
+ swiper,
22358
+ extendParams,
22359
+ on,
22360
+ emit
22361
+ }) {
22362
+ const observers = [];
22363
+ const window = getWindow();
22364
+
22365
+ const attach = (target, options = {}) => {
22366
+ const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
22367
+ const observer = new ObserverFunc(mutations => {
22368
+ // The observerUpdate event should only be triggered
22369
+ // once despite the number of mutations. Additional
22370
+ // triggers are redundant and are very costly
22371
+ if (mutations.length === 1) {
22372
+ emit('observerUpdate', mutations[0]);
22373
+ return;
22374
+ }
22375
+
22376
+ const observerUpdate = function observerUpdate() {
22377
+ emit('observerUpdate', mutations[0]);
22378
+ };
22379
+
22380
+ if (window.requestAnimationFrame) {
22381
+ window.requestAnimationFrame(observerUpdate);
22382
+ } else {
22383
+ window.setTimeout(observerUpdate, 0);
22384
+ }
22385
+ });
22386
+ observer.observe(target, {
22387
+ attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
22388
+ childList: typeof options.childList === 'undefined' ? true : options.childList,
22389
+ characterData: typeof options.characterData === 'undefined' ? true : options.characterData
22390
+ });
22391
+ observers.push(observer);
22392
+ };
22393
+
22394
+ const init = () => {
22395
+ if (!swiper.params.observer) return;
22396
+
22397
+ if (swiper.params.observeParents) {
22398
+ const containerParents = swiper.$el.parents();
22399
+
22400
+ for (let i = 0; i < containerParents.length; i += 1) {
22401
+ attach(containerParents[i]);
22402
+ }
22403
+ } // Observe container
22404
+
22405
+
22406
+ attach(swiper.$el[0], {
22407
+ childList: swiper.params.observeSlideChildren
22408
+ }); // Observe wrapper
22409
+
22410
+ attach(swiper.$wrapperEl[0], {
22411
+ attributes: false
22412
+ });
22413
+ };
22414
+
22415
+ const destroy = () => {
22416
+ observers.forEach(observer => {
22417
+ observer.disconnect();
22418
+ });
22419
+ observers.splice(0, observers.length);
22420
+ };
22421
+
22422
+ extendParams({
22423
+ observer: false,
22424
+ observeParents: false,
22425
+ observeSlideChildren: false
22426
+ });
22427
+ on('init', init);
22428
+ on('destroy', destroy);
22429
+ }
22430
+
22431
+ /* eslint-disable no-underscore-dangle */
22432
+ var eventsEmitter = {
22433
+ on(events, handler, priority) {
22434
+ const self = this;
22435
+ if (!self.eventsListeners || self.destroyed) return self;
22436
+ if (typeof handler !== 'function') return self;
22437
+ const method = priority ? 'unshift' : 'push';
22438
+ events.split(' ').forEach(event => {
22439
+ if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
22440
+ self.eventsListeners[event][method](handler);
22441
+ });
22442
+ return self;
22443
+ },
22444
+
22445
+ once(events, handler, priority) {
22446
+ const self = this;
22447
+ if (!self.eventsListeners || self.destroyed) return self;
22448
+ if (typeof handler !== 'function') return self;
22449
+
22450
+ function onceHandler(...args) {
22451
+ self.off(events, onceHandler);
22452
+
22453
+ if (onceHandler.__emitterProxy) {
22454
+ delete onceHandler.__emitterProxy;
22455
+ }
22456
+
22457
+ handler.apply(self, args);
22458
+ }
22459
+
22460
+ onceHandler.__emitterProxy = handler;
22461
+ return self.on(events, onceHandler, priority);
22462
+ },
22463
+
22464
+ onAny(handler, priority) {
22465
+ const self = this;
22466
+ if (!self.eventsListeners || self.destroyed) return self;
22467
+ if (typeof handler !== 'function') return self;
22468
+ const method = priority ? 'unshift' : 'push';
22469
+
22470
+ if (self.eventsAnyListeners.indexOf(handler) < 0) {
22471
+ self.eventsAnyListeners[method](handler);
22472
+ }
22473
+
22474
+ return self;
22475
+ },
22476
+
22477
+ offAny(handler) {
22478
+ const self = this;
22479
+ if (!self.eventsListeners || self.destroyed) return self;
22480
+ if (!self.eventsAnyListeners) return self;
22481
+ const index = self.eventsAnyListeners.indexOf(handler);
22482
+
22483
+ if (index >= 0) {
22484
+ self.eventsAnyListeners.splice(index, 1);
22485
+ }
22486
+
22487
+ return self;
22488
+ },
22489
+
22490
+ off(events, handler) {
22491
+ const self = this;
22492
+ if (!self.eventsListeners || self.destroyed) return self;
22493
+ if (!self.eventsListeners) return self;
22494
+ events.split(' ').forEach(event => {
22495
+ if (typeof handler === 'undefined') {
22496
+ self.eventsListeners[event] = [];
22497
+ } else if (self.eventsListeners[event]) {
22498
+ self.eventsListeners[event].forEach((eventHandler, index) => {
22499
+ if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
22500
+ self.eventsListeners[event].splice(index, 1);
22501
+ }
22502
+ });
22503
+ }
22504
+ });
22505
+ return self;
22506
+ },
22507
+
22508
+ emit(...args) {
22509
+ const self = this;
22510
+ if (!self.eventsListeners || self.destroyed) return self;
22511
+ if (!self.eventsListeners) return self;
22512
+ let events;
22513
+ let data;
22514
+ let context;
22515
+
22516
+ if (typeof args[0] === 'string' || Array.isArray(args[0])) {
22517
+ events = args[0];
22518
+ data = args.slice(1, args.length);
22519
+ context = self;
22520
+ } else {
22521
+ events = args[0].events;
22522
+ data = args[0].data;
22523
+ context = args[0].context || self;
22524
+ }
22525
+
22526
+ data.unshift(context);
22527
+ const eventsArray = Array.isArray(events) ? events : events.split(' ');
22528
+ eventsArray.forEach(event => {
22529
+ if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
22530
+ self.eventsAnyListeners.forEach(eventHandler => {
22531
+ eventHandler.apply(context, [event, ...data]);
22532
+ });
22533
+ }
22534
+
22535
+ if (self.eventsListeners && self.eventsListeners[event]) {
22536
+ self.eventsListeners[event].forEach(eventHandler => {
22537
+ eventHandler.apply(context, data);
22538
+ });
22539
+ }
22540
+ });
22541
+ return self;
22542
+ }
22543
+
22544
+ };
22545
+
22546
+ function updateSize() {
22547
+ const swiper = this;
22548
+ let width;
22549
+ let height;
22550
+ const $el = swiper.$el;
22551
+
22552
+ if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
22553
+ width = swiper.params.width;
22554
+ } else {
22555
+ width = $el[0].clientWidth;
22556
+ }
22557
+
22558
+ if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
22559
+ height = swiper.params.height;
22560
+ } else {
22561
+ height = $el[0].clientHeight;
22562
+ }
22563
+
22564
+ if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
22565
+ return;
22566
+ } // Subtract paddings
22567
+
22568
+
22569
+ width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10);
22570
+ height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10);
22571
+ if (Number.isNaN(width)) width = 0;
22572
+ if (Number.isNaN(height)) height = 0;
22573
+ Object.assign(swiper, {
22574
+ width,
22575
+ height,
22576
+ size: swiper.isHorizontal() ? width : height
22577
+ });
22578
+ }
22579
+
22580
+ function updateSlides() {
22581
+ const swiper = this;
22582
+
22583
+ function getDirectionLabel(property) {
22584
+ if (swiper.isHorizontal()) {
22585
+ return property;
22586
+ } // prettier-ignore
22587
+
22588
+
22589
+ return {
22590
+ 'width': 'height',
22591
+ 'margin-top': 'margin-left',
22592
+ 'margin-bottom ': 'margin-right',
22593
+ 'margin-left': 'margin-top',
22594
+ 'margin-right': 'margin-bottom',
22595
+ 'padding-left': 'padding-top',
22596
+ 'padding-right': 'padding-bottom',
22597
+ 'marginRight': 'marginBottom'
22598
+ }[property];
22599
+ }
22600
+
22601
+ function getDirectionPropertyValue(node, label) {
22602
+ return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
22603
+ }
22604
+
22605
+ const params = swiper.params;
22606
+ const {
22607
+ $wrapperEl,
22608
+ size: swiperSize,
22609
+ rtlTranslate: rtl,
22610
+ wrongRTL
22611
+ } = swiper;
22612
+ const isVirtual = swiper.virtual && params.virtual.enabled;
22613
+ const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
22614
+ const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
22615
+ const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
22616
+ let snapGrid = [];
22617
+ const slidesGrid = [];
22618
+ const slidesSizesGrid = [];
22619
+ let offsetBefore = params.slidesOffsetBefore;
22620
+
22621
+ if (typeof offsetBefore === 'function') {
22622
+ offsetBefore = params.slidesOffsetBefore.call(swiper);
22623
+ }
22624
+
22625
+ let offsetAfter = params.slidesOffsetAfter;
22626
+
22627
+ if (typeof offsetAfter === 'function') {
22628
+ offsetAfter = params.slidesOffsetAfter.call(swiper);
22629
+ }
22630
+
22631
+ const previousSnapGridLength = swiper.snapGrid.length;
22632
+ const previousSlidesGridLength = swiper.slidesGrid.length;
22633
+ let spaceBetween = params.spaceBetween;
22634
+ let slidePosition = -offsetBefore;
22635
+ let prevSlideSize = 0;
22636
+ let index = 0;
22637
+
22638
+ if (typeof swiperSize === 'undefined') {
22639
+ return;
22640
+ }
22641
+
22642
+ if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
22643
+ spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
22644
+ }
22645
+
22646
+ swiper.virtualSize = -spaceBetween; // reset margins
22647
+
22648
+ if (rtl) slides.css({
22649
+ marginLeft: '',
22650
+ marginBottom: '',
22651
+ marginTop: ''
22652
+ });else slides.css({
22653
+ marginRight: '',
22654
+ marginBottom: '',
22655
+ marginTop: ''
22656
+ }); // reset cssMode offsets
22657
+
22658
+ if (params.centeredSlides && params.cssMode) {
22659
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', '');
22660
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', '');
22661
+ }
22662
+
22663
+ const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
22664
+
22665
+ if (gridEnabled) {
22666
+ swiper.grid.initSlides(slidesLength);
22667
+ } // Calc slides
22668
+
22669
+
22670
+ let slideSize;
22671
+ const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {
22672
+ return typeof params.breakpoints[key].slidesPerView !== 'undefined';
22673
+ }).length > 0;
22674
+
22675
+ for (let i = 0; i < slidesLength; i += 1) {
22676
+ slideSize = 0;
22677
+ const slide = slides.eq(i);
22678
+
22679
+ if (gridEnabled) {
22680
+ swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel);
22681
+ }
22682
+
22683
+ if (slide.css('display') === 'none') continue; // eslint-disable-line
22684
+
22685
+ if (params.slidesPerView === 'auto') {
22686
+ if (shouldResetSlideSize) {
22687
+ slides[i].style[getDirectionLabel('width')] = ``;
22688
+ }
22689
+
22690
+ const slideStyles = getComputedStyle(slide[0]);
22691
+ const currentTransform = slide[0].style.transform;
22692
+ const currentWebKitTransform = slide[0].style.webkitTransform;
22693
+
22694
+ if (currentTransform) {
22695
+ slide[0].style.transform = 'none';
22696
+ }
22697
+
22698
+ if (currentWebKitTransform) {
22699
+ slide[0].style.webkitTransform = 'none';
22700
+ }
22701
+
22702
+ if (params.roundLengths) {
22703
+ slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
22704
+ } else {
22705
+ // eslint-disable-next-line
22706
+ const width = getDirectionPropertyValue(slideStyles, 'width');
22707
+ const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');
22708
+ const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');
22709
+ const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');
22710
+ const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');
22711
+ const boxSizing = slideStyles.getPropertyValue('box-sizing');
22712
+
22713
+ if (boxSizing && boxSizing === 'border-box') {
22714
+ slideSize = width + marginLeft + marginRight;
22715
+ } else {
22716
+ const {
22717
+ clientWidth,
22718
+ offsetWidth
22719
+ } = slide[0];
22720
+ slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
22721
+ }
22722
+ }
22723
+
22724
+ if (currentTransform) {
22725
+ slide[0].style.transform = currentTransform;
22726
+ }
22727
+
22728
+ if (currentWebKitTransform) {
22729
+ slide[0].style.webkitTransform = currentWebKitTransform;
22730
+ }
22731
+
22732
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
22733
+ } else {
22734
+ slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
22735
+ if (params.roundLengths) slideSize = Math.floor(slideSize);
22736
+
22737
+ if (slides[i]) {
22738
+ slides[i].style[getDirectionLabel('width')] = `${slideSize}px`;
22739
+ }
22740
+ }
22741
+
22742
+ if (slides[i]) {
22743
+ slides[i].swiperSlideSize = slideSize;
22744
+ }
22745
+
22746
+ slidesSizesGrid.push(slideSize);
22747
+
22748
+ if (params.centeredSlides) {
22749
+ slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
22750
+ if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
22751
+ if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
22752
+ if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
22753
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
22754
+ if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
22755
+ slidesGrid.push(slidePosition);
22756
+ } else {
22757
+ if (params.roundLengths) slidePosition = Math.floor(slidePosition);
22758
+ if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
22759
+ slidesGrid.push(slidePosition);
22760
+ slidePosition = slidePosition + slideSize + spaceBetween;
22761
+ }
22762
+
22763
+ swiper.virtualSize += slideSize + spaceBetween;
22764
+ prevSlideSize = slideSize;
22765
+ index += 1;
22766
+ }
22767
+
22768
+ swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
22769
+
22770
+ if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
22771
+ $wrapperEl.css({
22772
+ width: `${swiper.virtualSize + params.spaceBetween}px`
22773
+ });
22774
+ }
22775
+
22776
+ if (params.setWrapperSize) {
22777
+ $wrapperEl.css({
22778
+ [getDirectionLabel('width')]: `${swiper.virtualSize + params.spaceBetween}px`
22779
+ });
22780
+ }
22781
+
22782
+ if (gridEnabled) {
22783
+ swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
22784
+ } // Remove last grid elements depending on width
22785
+
22786
+
22787
+ if (!params.centeredSlides) {
22788
+ const newSlidesGrid = [];
22789
+
22790
+ for (let i = 0; i < snapGrid.length; i += 1) {
22791
+ let slidesGridItem = snapGrid[i];
22792
+ if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
22793
+
22794
+ if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
22795
+ newSlidesGrid.push(slidesGridItem);
22796
+ }
22797
+ }
22798
+
22799
+ snapGrid = newSlidesGrid;
22800
+
22801
+ if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
22802
+ snapGrid.push(swiper.virtualSize - swiperSize);
22803
+ }
22804
+ }
22805
+
22806
+ if (snapGrid.length === 0) snapGrid = [0];
22807
+
22808
+ if (params.spaceBetween !== 0) {
22809
+ const key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');
22810
+ slides.filter((_, slideIndex) => {
22811
+ if (!params.cssMode) return true;
22812
+
22813
+ if (slideIndex === slides.length - 1) {
22814
+ return false;
22815
+ }
22816
+
22817
+ return true;
22818
+ }).css({
22819
+ [key]: `${spaceBetween}px`
22820
+ });
22821
+ }
22822
+
22823
+ if (params.centeredSlides && params.centeredSlidesBounds) {
22824
+ let allSlidesSize = 0;
22825
+ slidesSizesGrid.forEach(slideSizeValue => {
22826
+ allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
22827
+ });
22828
+ allSlidesSize -= params.spaceBetween;
22829
+ const maxSnap = allSlidesSize - swiperSize;
22830
+ snapGrid = snapGrid.map(snap => {
22831
+ if (snap < 0) return -offsetBefore;
22832
+ if (snap > maxSnap) return maxSnap + offsetAfter;
22833
+ return snap;
22834
+ });
22835
+ }
22836
+
22837
+ if (params.centerInsufficientSlides) {
22838
+ let allSlidesSize = 0;
22839
+ slidesSizesGrid.forEach(slideSizeValue => {
22840
+ allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
22841
+ });
22842
+ allSlidesSize -= params.spaceBetween;
22843
+
22844
+ if (allSlidesSize < swiperSize) {
22845
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
22846
+ snapGrid.forEach((snap, snapIndex) => {
22847
+ snapGrid[snapIndex] = snap - allSlidesOffset;
22848
+ });
22849
+ slidesGrid.forEach((snap, snapIndex) => {
22850
+ slidesGrid[snapIndex] = snap + allSlidesOffset;
22851
+ });
22852
+ }
22853
+ }
22854
+
22855
+ Object.assign(swiper, {
22856
+ slides,
22857
+ snapGrid,
22858
+ slidesGrid,
22859
+ slidesSizesGrid
22860
+ });
22861
+
22862
+ if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {
22863
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);
22864
+ setCSSProperty(swiper.wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);
22865
+ const addToSnapGrid = -swiper.snapGrid[0];
22866
+ const addToSlidesGrid = -swiper.slidesGrid[0];
22867
+ swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);
22868
+ swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);
22869
+ }
22870
+
22871
+ if (slidesLength !== previousSlidesLength) {
22872
+ swiper.emit('slidesLengthChange');
22873
+ }
22874
+
22875
+ if (snapGrid.length !== previousSnapGridLength) {
22876
+ if (swiper.params.watchOverflow) swiper.checkOverflow();
22877
+ swiper.emit('snapGridLengthChange');
22878
+ }
22879
+
22880
+ if (slidesGrid.length !== previousSlidesGridLength) {
22881
+ swiper.emit('slidesGridLengthChange');
22882
+ }
22883
+
22884
+ if (params.watchSlidesProgress) {
22885
+ swiper.updateSlidesOffset();
22886
+ }
22887
+
22888
+ if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {
22889
+ const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
22890
+ const hasClassBackfaceClassAdded = swiper.$el.hasClass(backFaceHiddenClass);
22891
+
22892
+ if (slidesLength <= params.maxBackfaceHiddenSlides) {
22893
+ if (!hasClassBackfaceClassAdded) swiper.$el.addClass(backFaceHiddenClass);
22894
+ } else if (hasClassBackfaceClassAdded) {
22895
+ swiper.$el.removeClass(backFaceHiddenClass);
22896
+ }
22897
+ }
22898
+ }
22899
+
22900
+ function updateAutoHeight(speed) {
22901
+ const swiper = this;
22902
+ const activeSlides = [];
22903
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
22904
+ let newHeight = 0;
22905
+ let i;
22906
+
22907
+ if (typeof speed === 'number') {
22908
+ swiper.setTransition(speed);
22909
+ } else if (speed === true) {
22910
+ swiper.setTransition(swiper.params.speed);
22911
+ }
22912
+
22913
+ const getSlideByIndex = index => {
22914
+ if (isVirtual) {
22915
+ return swiper.slides.filter(el => parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index)[0];
22916
+ }
22917
+
22918
+ return swiper.slides.eq(index)[0];
22919
+ }; // Find slides currently in view
22920
+
22921
+
22922
+ if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
22923
+ if (swiper.params.centeredSlides) {
22924
+ (swiper.visibleSlides || $([])).each(slide => {
22925
+ activeSlides.push(slide);
22926
+ });
22927
+ } else {
22928
+ for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
22929
+ const index = swiper.activeIndex + i;
22930
+ if (index > swiper.slides.length && !isVirtual) break;
22931
+ activeSlides.push(getSlideByIndex(index));
22932
+ }
22933
+ }
22934
+ } else {
22935
+ activeSlides.push(getSlideByIndex(swiper.activeIndex));
22936
+ } // Find new height from highest slide in view
22937
+
22938
+
22939
+ for (i = 0; i < activeSlides.length; i += 1) {
22940
+ if (typeof activeSlides[i] !== 'undefined') {
22941
+ const height = activeSlides[i].offsetHeight;
22942
+ newHeight = height > newHeight ? height : newHeight;
22943
+ }
22944
+ } // Update Height
22945
+
22946
+
22947
+ if (newHeight || newHeight === 0) swiper.$wrapperEl.css('height', `${newHeight}px`);
22948
+ }
22949
+
22950
+ function updateSlidesOffset() {
22951
+ const swiper = this;
22952
+ const slides = swiper.slides;
22953
+
22954
+ for (let i = 0; i < slides.length; i += 1) {
22955
+ slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;
22956
+ }
22957
+ }
22958
+
22959
+ function updateSlidesProgress(translate = this && this.translate || 0) {
22960
+ const swiper = this;
22961
+ const params = swiper.params;
22962
+ const {
22963
+ slides,
22964
+ rtlTranslate: rtl,
22965
+ snapGrid
22966
+ } = swiper;
22967
+ if (slides.length === 0) return;
22968
+ if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
22969
+ let offsetCenter = -translate;
22970
+ if (rtl) offsetCenter = translate; // Visible Slides
22971
+
22972
+ slides.removeClass(params.slideVisibleClass);
22973
+ swiper.visibleSlidesIndexes = [];
22974
+ swiper.visibleSlides = [];
22975
+
22976
+ for (let i = 0; i < slides.length; i += 1) {
22977
+ const slide = slides[i];
22978
+ let slideOffset = slide.swiperSlideOffset;
22979
+
22980
+ if (params.cssMode && params.centeredSlides) {
22981
+ slideOffset -= slides[0].swiperSlideOffset;
22982
+ }
22983
+
22984
+ const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween);
22985
+ const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + params.spaceBetween);
22986
+ const slideBefore = -(offsetCenter - slideOffset);
22987
+ const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
22988
+ const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
22989
+
22990
+ if (isVisible) {
22991
+ swiper.visibleSlides.push(slide);
22992
+ swiper.visibleSlidesIndexes.push(i);
22993
+ slides.eq(i).addClass(params.slideVisibleClass);
22994
+ }
22995
+
22996
+ slide.progress = rtl ? -slideProgress : slideProgress;
22997
+ slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
22998
+ }
22999
+
23000
+ swiper.visibleSlides = $(swiper.visibleSlides);
23001
+ }
23002
+
23003
+ function updateProgress(translate) {
23004
+ const swiper = this;
23005
+
23006
+ if (typeof translate === 'undefined') {
23007
+ const multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line
23008
+
23009
+ translate = swiper && swiper.translate && swiper.translate * multiplier || 0;
23010
+ }
23011
+
23012
+ const params = swiper.params;
23013
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
23014
+ let {
23015
+ progress,
23016
+ isBeginning,
23017
+ isEnd
23018
+ } = swiper;
23019
+ const wasBeginning = isBeginning;
23020
+ const wasEnd = isEnd;
23021
+
23022
+ if (translatesDiff === 0) {
23023
+ progress = 0;
23024
+ isBeginning = true;
23025
+ isEnd = true;
23026
+ } else {
23027
+ progress = (translate - swiper.minTranslate()) / translatesDiff;
23028
+ isBeginning = progress <= 0;
23029
+ isEnd = progress >= 1;
23030
+ }
23031
+
23032
+ Object.assign(swiper, {
23033
+ progress,
23034
+ isBeginning,
23035
+ isEnd
23036
+ });
23037
+ if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);
23038
+
23039
+ if (isBeginning && !wasBeginning) {
23040
+ swiper.emit('reachBeginning toEdge');
23041
+ }
23042
+
23043
+ if (isEnd && !wasEnd) {
23044
+ swiper.emit('reachEnd toEdge');
23045
+ }
23046
+
23047
+ if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
23048
+ swiper.emit('fromEdge');
23049
+ }
23050
+
23051
+ swiper.emit('progress', progress);
23052
+ }
23053
+
23054
+ function updateSlidesClasses() {
23055
+ const swiper = this;
23056
+ const {
23057
+ slides,
23058
+ params,
23059
+ $wrapperEl,
23060
+ activeIndex,
23061
+ realIndex
23062
+ } = swiper;
23063
+ const isVirtual = swiper.virtual && params.virtual.enabled;
23064
+ slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`);
23065
+ let activeSlide;
23066
+
23067
+ if (isVirtual) {
23068
+ activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index="${activeIndex}"]`);
23069
+ } else {
23070
+ activeSlide = slides.eq(activeIndex);
23071
+ } // Active classes
23072
+
23073
+
23074
+ activeSlide.addClass(params.slideActiveClass);
23075
+
23076
+ if (params.loop) {
23077
+ // Duplicate to all looped slides
23078
+ if (activeSlide.hasClass(params.slideDuplicateClass)) {
23079
+ $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass);
23080
+ } else {
23081
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${realIndex}"]`).addClass(params.slideDuplicateActiveClass);
23082
+ }
23083
+ } // Next Slide
23084
+
23085
+
23086
+ let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass);
23087
+
23088
+ if (params.loop && nextSlide.length === 0) {
23089
+ nextSlide = slides.eq(0);
23090
+ nextSlide.addClass(params.slideNextClass);
23091
+ } // Prev Slide
23092
+
23093
+
23094
+ let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass);
23095
+
23096
+ if (params.loop && prevSlide.length === 0) {
23097
+ prevSlide = slides.eq(-1);
23098
+ prevSlide.addClass(params.slidePrevClass);
23099
+ }
23100
+
23101
+ if (params.loop) {
23102
+ // Duplicate to all looped slides
23103
+ if (nextSlide.hasClass(params.slideDuplicateClass)) {
23104
+ $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass);
23105
+ } else {
23106
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicateNextClass);
23107
+ }
23108
+
23109
+ if (prevSlide.hasClass(params.slideDuplicateClass)) {
23110
+ $wrapperEl.children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass);
23111
+ } else {
23112
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`).addClass(params.slideDuplicatePrevClass);
23113
+ }
23114
+ }
23115
+
23116
+ swiper.emitSlidesClasses();
23117
+ }
23118
+
23119
+ function updateActiveIndex(newActiveIndex) {
23120
+ const swiper = this;
23121
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
23122
+ const {
23123
+ slidesGrid,
23124
+ snapGrid,
23125
+ params,
23126
+ activeIndex: previousIndex,
23127
+ realIndex: previousRealIndex,
23128
+ snapIndex: previousSnapIndex
23129
+ } = swiper;
23130
+ let activeIndex = newActiveIndex;
23131
+ let snapIndex;
23132
+
23133
+ if (typeof activeIndex === 'undefined') {
23134
+ for (let i = 0; i < slidesGrid.length; i += 1) {
23135
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
23136
+ if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
23137
+ activeIndex = i;
23138
+ } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
23139
+ activeIndex = i + 1;
23140
+ }
23141
+ } else if (translate >= slidesGrid[i]) {
23142
+ activeIndex = i;
23143
+ }
23144
+ } // Normalize slideIndex
23145
+
23146
+
23147
+ if (params.normalizeSlideIndex) {
23148
+ if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
23149
+ }
23150
+ }
23151
+
23152
+ if (snapGrid.indexOf(translate) >= 0) {
23153
+ snapIndex = snapGrid.indexOf(translate);
23154
+ } else {
23155
+ const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
23156
+ snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
23157
+ }
23158
+
23159
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
23160
+
23161
+ if (activeIndex === previousIndex) {
23162
+ if (snapIndex !== previousSnapIndex) {
23163
+ swiper.snapIndex = snapIndex;
23164
+ swiper.emit('snapIndexChange');
23165
+ }
23166
+
23167
+ return;
23168
+ } // Get real index
23169
+
23170
+
23171
+ const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);
23172
+ Object.assign(swiper, {
23173
+ snapIndex,
23174
+ realIndex,
23175
+ previousIndex,
23176
+ activeIndex
23177
+ });
23178
+ swiper.emit('activeIndexChange');
23179
+ swiper.emit('snapIndexChange');
23180
+
23181
+ if (previousRealIndex !== realIndex) {
23182
+ swiper.emit('realIndexChange');
23183
+ }
23184
+
23185
+ if (swiper.initialized || swiper.params.runCallbacksOnInit) {
23186
+ swiper.emit('slideChange');
23187
+ }
23188
+ }
23189
+
23190
+ function updateClickedSlide(e) {
23191
+ const swiper = this;
23192
+ const params = swiper.params;
23193
+ const slide = $(e).closest(`.${params.slideClass}`)[0];
23194
+ let slideFound = false;
23195
+ let slideIndex;
23196
+
23197
+ if (slide) {
23198
+ for (let i = 0; i < swiper.slides.length; i += 1) {
23199
+ if (swiper.slides[i] === slide) {
23200
+ slideFound = true;
23201
+ slideIndex = i;
23202
+ break;
23203
+ }
23204
+ }
23205
+ }
23206
+
23207
+ if (slide && slideFound) {
23208
+ swiper.clickedSlide = slide;
23209
+
23210
+ if (swiper.virtual && swiper.params.virtual.enabled) {
23211
+ swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);
23212
+ } else {
23213
+ swiper.clickedIndex = slideIndex;
23214
+ }
23215
+ } else {
23216
+ swiper.clickedSlide = undefined;
23217
+ swiper.clickedIndex = undefined;
23218
+ return;
23219
+ }
23220
+
23221
+ if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
23222
+ swiper.slideToClickedSlide();
23223
+ }
23224
+ }
23225
+
23226
+ var update = {
23227
+ updateSize,
23228
+ updateSlides,
23229
+ updateAutoHeight,
23230
+ updateSlidesOffset,
23231
+ updateSlidesProgress,
23232
+ updateProgress,
23233
+ updateSlidesClasses,
23234
+ updateActiveIndex,
23235
+ updateClickedSlide
23236
+ };
23237
+
23238
+ function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') {
23239
+ const swiper = this;
23240
+ const {
23241
+ params,
23242
+ rtlTranslate: rtl,
23243
+ translate,
23244
+ $wrapperEl
23245
+ } = swiper;
23246
+
23247
+ if (params.virtualTranslate) {
23248
+ return rtl ? -translate : translate;
23249
+ }
23250
+
23251
+ if (params.cssMode) {
23252
+ return translate;
23253
+ }
23254
+
23255
+ let currentTranslate = getTranslate($wrapperEl[0], axis);
23256
+ if (rtl) currentTranslate = -currentTranslate;
23257
+ return currentTranslate || 0;
23258
+ }
23259
+
23260
+ function setTranslate(translate, byController) {
23261
+ const swiper = this;
23262
+ const {
23263
+ rtlTranslate: rtl,
23264
+ params,
23265
+ $wrapperEl,
23266
+ wrapperEl,
23267
+ progress
23268
+ } = swiper;
23269
+ let x = 0;
23270
+ let y = 0;
23271
+ const z = 0;
23272
+
23273
+ if (swiper.isHorizontal()) {
23274
+ x = rtl ? -translate : translate;
23275
+ } else {
23276
+ y = translate;
23277
+ }
23278
+
23279
+ if (params.roundLengths) {
23280
+ x = Math.floor(x);
23281
+ y = Math.floor(y);
23282
+ }
23283
+
23284
+ if (params.cssMode) {
23285
+ wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
23286
+ } else if (!params.virtualTranslate) {
23287
+ $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`);
23288
+ }
23289
+
23290
+ swiper.previousTranslate = swiper.translate;
23291
+ swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress
23292
+
23293
+ let newProgress;
23294
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
23295
+
23296
+ if (translatesDiff === 0) {
23297
+ newProgress = 0;
23298
+ } else {
23299
+ newProgress = (translate - swiper.minTranslate()) / translatesDiff;
23300
+ }
23301
+
23302
+ if (newProgress !== progress) {
23303
+ swiper.updateProgress(translate);
23304
+ }
23305
+
23306
+ swiper.emit('setTranslate', swiper.translate, byController);
23307
+ }
23308
+
23309
+ function minTranslate() {
23310
+ return -this.snapGrid[0];
23311
+ }
23312
+
23313
+ function maxTranslate() {
23314
+ return -this.snapGrid[this.snapGrid.length - 1];
23315
+ }
23316
+
23317
+ function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
23318
+ const swiper = this;
23319
+ const {
23320
+ params,
23321
+ wrapperEl
23322
+ } = swiper;
23323
+
23324
+ if (swiper.animating && params.preventInteractionOnTransition) {
23325
+ return false;
23326
+ }
23327
+
23328
+ const minTranslate = swiper.minTranslate();
23329
+ const maxTranslate = swiper.maxTranslate();
23330
+ let newTranslate;
23331
+ if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress
23332
+
23333
+ swiper.updateProgress(newTranslate);
23334
+
23335
+ if (params.cssMode) {
23336
+ const isH = swiper.isHorizontal();
23337
+
23338
+ if (speed === 0) {
23339
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
23340
+ } else {
23341
+ if (!swiper.support.smoothScroll) {
23342
+ animateCSSModeScroll({
23343
+ swiper,
23344
+ targetPosition: -newTranslate,
23345
+ side: isH ? 'left' : 'top'
23346
+ });
23347
+ return true;
23348
+ }
23349
+
23350
+ wrapperEl.scrollTo({
23351
+ [isH ? 'left' : 'top']: -newTranslate,
23352
+ behavior: 'smooth'
23353
+ });
23354
+ }
23355
+
23356
+ return true;
23357
+ }
23358
+
23359
+ if (speed === 0) {
23360
+ swiper.setTransition(0);
23361
+ swiper.setTranslate(newTranslate);
23362
+
23363
+ if (runCallbacks) {
23364
+ swiper.emit('beforeTransitionStart', speed, internal);
23365
+ swiper.emit('transitionEnd');
23366
+ }
23367
+ } else {
23368
+ swiper.setTransition(speed);
23369
+ swiper.setTranslate(newTranslate);
23370
+
23371
+ if (runCallbacks) {
23372
+ swiper.emit('beforeTransitionStart', speed, internal);
23373
+ swiper.emit('transitionStart');
23374
+ }
23375
+
23376
+ if (!swiper.animating) {
23377
+ swiper.animating = true;
23378
+
23379
+ if (!swiper.onTranslateToWrapperTransitionEnd) {
23380
+ swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
23381
+ if (!swiper || swiper.destroyed) return;
23382
+ if (e.target !== this) return;
23383
+ swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
23384
+ swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
23385
+ swiper.onTranslateToWrapperTransitionEnd = null;
23386
+ delete swiper.onTranslateToWrapperTransitionEnd;
23387
+
23388
+ if (runCallbacks) {
23389
+ swiper.emit('transitionEnd');
23390
+ }
23391
+ };
23392
+ }
23393
+
23394
+ swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
23395
+ swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
23396
+ }
23397
+ }
23398
+
23399
+ return true;
23400
+ }
23401
+
23402
+ var translate = {
23403
+ getTranslate: getSwiperTranslate,
23404
+ setTranslate,
23405
+ minTranslate,
23406
+ maxTranslate,
23407
+ translateTo
23408
+ };
23409
+
23410
+ function setTransition(duration, byController) {
23411
+ const swiper = this;
23412
+
23413
+ if (!swiper.params.cssMode) {
23414
+ swiper.$wrapperEl.transition(duration);
23415
+ }
23416
+
23417
+ swiper.emit('setTransition', duration, byController);
23418
+ }
23419
+
23420
+ function transitionEmit({
23421
+ swiper,
23422
+ runCallbacks,
23423
+ direction,
23424
+ step
23425
+ }) {
23426
+ const {
23427
+ activeIndex,
23428
+ previousIndex
23429
+ } = swiper;
23430
+ let dir = direction;
23431
+
23432
+ if (!dir) {
23433
+ if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
23434
+ }
23435
+
23436
+ swiper.emit(`transition${step}`);
23437
+
23438
+ if (runCallbacks && activeIndex !== previousIndex) {
23439
+ if (dir === 'reset') {
23440
+ swiper.emit(`slideResetTransition${step}`);
23441
+ return;
23442
+ }
23443
+
23444
+ swiper.emit(`slideChangeTransition${step}`);
23445
+
23446
+ if (dir === 'next') {
23447
+ swiper.emit(`slideNextTransition${step}`);
23448
+ } else {
23449
+ swiper.emit(`slidePrevTransition${step}`);
23450
+ }
23451
+ }
23452
+ }
23453
+
23454
+ function transitionStart(runCallbacks = true, direction) {
23455
+ const swiper = this;
23456
+ const {
23457
+ params
23458
+ } = swiper;
23459
+ if (params.cssMode) return;
23460
+
23461
+ if (params.autoHeight) {
23462
+ swiper.updateAutoHeight();
23463
+ }
23464
+
23465
+ transitionEmit({
23466
+ swiper,
23467
+ runCallbacks,
23468
+ direction,
23469
+ step: 'Start'
23470
+ });
23471
+ }
23472
+
23473
+ function transitionEnd(runCallbacks = true, direction) {
23474
+ const swiper = this;
23475
+ const {
23476
+ params
23477
+ } = swiper;
23478
+ swiper.animating = false;
23479
+ if (params.cssMode) return;
23480
+ swiper.setTransition(0);
23481
+ transitionEmit({
23482
+ swiper,
23483
+ runCallbacks,
23484
+ direction,
23485
+ step: 'End'
23486
+ });
23487
+ }
23488
+
23489
+ var transition = {
23490
+ setTransition,
23491
+ transitionStart,
23492
+ transitionEnd
23493
+ };
23494
+
23495
+ function slideTo(index = 0, speed = this.params.speed, runCallbacks = true, internal, initial) {
23496
+ if (typeof index !== 'number' && typeof index !== 'string') {
23497
+ throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof index}] given.`);
23498
+ }
23499
+
23500
+ if (typeof index === 'string') {
23501
+ /**
23502
+ * The `index` argument converted from `string` to `number`.
23503
+ * @type {number}
23504
+ */
23505
+ const indexAsNumber = parseInt(index, 10);
23506
+ /**
23507
+ * Determines whether the `index` argument is a valid `number`
23508
+ * after being converted from the `string` type.
23509
+ * @type {boolean}
23510
+ */
23511
+
23512
+ const isValidNumber = isFinite(indexAsNumber);
23513
+
23514
+ if (!isValidNumber) {
23515
+ throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`);
23516
+ } // Knowing that the converted `index` is a valid number,
23517
+ // we can update the original argument's value.
23518
+
23519
+
23520
+ index = indexAsNumber;
23521
+ }
23522
+
23523
+ const swiper = this;
23524
+ let slideIndex = index;
23525
+ if (slideIndex < 0) slideIndex = 0;
23526
+ const {
23527
+ params,
23528
+ snapGrid,
23529
+ slidesGrid,
23530
+ previousIndex,
23531
+ activeIndex,
23532
+ rtlTranslate: rtl,
23533
+ wrapperEl,
23534
+ enabled
23535
+ } = swiper;
23536
+
23537
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
23538
+ return false;
23539
+ }
23540
+
23541
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
23542
+ let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
23543
+ if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
23544
+ const translate = -snapGrid[snapIndex]; // Normalize slideIndex
23545
+
23546
+ if (params.normalizeSlideIndex) {
23547
+ for (let i = 0; i < slidesGrid.length; i += 1) {
23548
+ const normalizedTranslate = -Math.floor(translate * 100);
23549
+ const normalizedGrid = Math.floor(slidesGrid[i] * 100);
23550
+ const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
23551
+
23552
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
23553
+ if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
23554
+ slideIndex = i;
23555
+ } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
23556
+ slideIndex = i + 1;
23557
+ }
23558
+ } else if (normalizedTranslate >= normalizedGrid) {
23559
+ slideIndex = i;
23560
+ }
23561
+ }
23562
+ } // Directions locks
23563
+
23564
+
23565
+ if (swiper.initialized && slideIndex !== activeIndex) {
23566
+ if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
23567
+ return false;
23568
+ }
23569
+
23570
+ if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
23571
+ if ((activeIndex || 0) !== slideIndex) return false;
23572
+ }
23573
+ }
23574
+
23575
+ if (slideIndex !== (previousIndex || 0) && runCallbacks) {
23576
+ swiper.emit('beforeSlideChangeStart');
23577
+ } // Update progress
23578
+
23579
+
23580
+ swiper.updateProgress(translate);
23581
+ let direction;
23582
+ if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index
23583
+
23584
+ if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
23585
+ swiper.updateActiveIndex(slideIndex); // Update Height
23586
+
23587
+ if (params.autoHeight) {
23588
+ swiper.updateAutoHeight();
23589
+ }
23590
+
23591
+ swiper.updateSlidesClasses();
23592
+
23593
+ if (params.effect !== 'slide') {
23594
+ swiper.setTranslate(translate);
23595
+ }
23596
+
23597
+ if (direction !== 'reset') {
23598
+ swiper.transitionStart(runCallbacks, direction);
23599
+ swiper.transitionEnd(runCallbacks, direction);
23600
+ }
23601
+
23602
+ return false;
23603
+ }
23604
+
23605
+ if (params.cssMode) {
23606
+ const isH = swiper.isHorizontal();
23607
+ const t = rtl ? translate : -translate;
23608
+
23609
+ if (speed === 0) {
23610
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
23611
+
23612
+ if (isVirtual) {
23613
+ swiper.wrapperEl.style.scrollSnapType = 'none';
23614
+ swiper._immediateVirtual = true;
23615
+ }
23616
+
23617
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
23618
+
23619
+ if (isVirtual) {
23620
+ requestAnimationFrame(() => {
23621
+ swiper.wrapperEl.style.scrollSnapType = '';
23622
+ swiper._swiperImmediateVirtual = false;
23623
+ });
23624
+ }
23625
+ } else {
23626
+ if (!swiper.support.smoothScroll) {
23627
+ animateCSSModeScroll({
23628
+ swiper,
23629
+ targetPosition: t,
23630
+ side: isH ? 'left' : 'top'
23631
+ });
23632
+ return true;
23633
+ }
23634
+
23635
+ wrapperEl.scrollTo({
23636
+ [isH ? 'left' : 'top']: t,
23637
+ behavior: 'smooth'
23638
+ });
23639
+ }
23640
+
23641
+ return true;
23642
+ }
23643
+
23644
+ swiper.setTransition(speed);
23645
+ swiper.setTranslate(translate);
23646
+ swiper.updateActiveIndex(slideIndex);
23647
+ swiper.updateSlidesClasses();
23648
+ swiper.emit('beforeTransitionStart', speed, internal);
23649
+ swiper.transitionStart(runCallbacks, direction);
23650
+
23651
+ if (speed === 0) {
23652
+ swiper.transitionEnd(runCallbacks, direction);
23653
+ } else if (!swiper.animating) {
23654
+ swiper.animating = true;
23655
+
23656
+ if (!swiper.onSlideToWrapperTransitionEnd) {
23657
+ swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
23658
+ if (!swiper || swiper.destroyed) return;
23659
+ if (e.target !== this) return;
23660
+ swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
23661
+ swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
23662
+ swiper.onSlideToWrapperTransitionEnd = null;
23663
+ delete swiper.onSlideToWrapperTransitionEnd;
23664
+ swiper.transitionEnd(runCallbacks, direction);
23665
+ };
23666
+ }
23667
+
23668
+ swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
23669
+ swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
23670
+ }
23671
+
23672
+ return true;
23673
+ }
23674
+
23675
+ function slideToLoop(index = 0, speed = this.params.speed, runCallbacks = true, internal) {
23676
+ if (typeof index === 'string') {
23677
+ /**
23678
+ * The `index` argument converted from `string` to `number`.
23679
+ * @type {number}
23680
+ */
23681
+ const indexAsNumber = parseInt(index, 10);
23682
+ /**
23683
+ * Determines whether the `index` argument is a valid `number`
23684
+ * after being converted from the `string` type.
23685
+ * @type {boolean}
23686
+ */
23687
+
23688
+ const isValidNumber = isFinite(indexAsNumber);
23689
+
23690
+ if (!isValidNumber) {
23691
+ throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`);
23692
+ } // Knowing that the converted `index` is a valid number,
23693
+ // we can update the original argument's value.
23694
+
23695
+
23696
+ index = indexAsNumber;
23697
+ }
23698
+
23699
+ const swiper = this;
23700
+ let newIndex = index;
23701
+
23702
+ if (swiper.params.loop) {
23703
+ newIndex += swiper.loopedSlides;
23704
+ }
23705
+
23706
+ return swiper.slideTo(newIndex, speed, runCallbacks, internal);
23707
+ }
23708
+
23709
+ /* eslint no-unused-vars: "off" */
23710
+ function slideNext(speed = this.params.speed, runCallbacks = true, internal) {
23711
+ const swiper = this;
23712
+ const {
23713
+ animating,
23714
+ enabled,
23715
+ params
23716
+ } = swiper;
23717
+ if (!enabled) return swiper;
23718
+ let perGroup = params.slidesPerGroup;
23719
+
23720
+ if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
23721
+ perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
23722
+ }
23723
+
23724
+ const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
23725
+
23726
+ if (params.loop) {
23727
+ if (animating && params.loopPreventsSlide) return false;
23728
+ swiper.loopFix(); // eslint-disable-next-line
23729
+
23730
+ swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
23731
+ }
23732
+
23733
+ if (params.rewind && swiper.isEnd) {
23734
+ return swiper.slideTo(0, speed, runCallbacks, internal);
23735
+ }
23736
+
23737
+ return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
23738
+ }
23739
+
23740
+ /* eslint no-unused-vars: "off" */
23741
+ function slidePrev(speed = this.params.speed, runCallbacks = true, internal) {
23742
+ const swiper = this;
23743
+ const {
23744
+ params,
23745
+ animating,
23746
+ snapGrid,
23747
+ slidesGrid,
23748
+ rtlTranslate,
23749
+ enabled
23750
+ } = swiper;
23751
+ if (!enabled) return swiper;
23752
+
23753
+ if (params.loop) {
23754
+ if (animating && params.loopPreventsSlide) return false;
23755
+ swiper.loopFix(); // eslint-disable-next-line
23756
+
23757
+ swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
23758
+ }
23759
+
23760
+ const translate = rtlTranslate ? swiper.translate : -swiper.translate;
23761
+
23762
+ function normalize(val) {
23763
+ if (val < 0) return -Math.floor(Math.abs(val));
23764
+ return Math.floor(val);
23765
+ }
23766
+
23767
+ const normalizedTranslate = normalize(translate);
23768
+ const normalizedSnapGrid = snapGrid.map(val => normalize(val));
23769
+ let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
23770
+
23771
+ if (typeof prevSnap === 'undefined' && params.cssMode) {
23772
+ let prevSnapIndex;
23773
+ snapGrid.forEach((snap, snapIndex) => {
23774
+ if (normalizedTranslate >= snap) {
23775
+ // prevSnap = snap;
23776
+ prevSnapIndex = snapIndex;
23777
+ }
23778
+ });
23779
+
23780
+ if (typeof prevSnapIndex !== 'undefined') {
23781
+ prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
23782
+ }
23783
+ }
23784
+
23785
+ let prevIndex = 0;
23786
+
23787
+ if (typeof prevSnap !== 'undefined') {
23788
+ prevIndex = slidesGrid.indexOf(prevSnap);
23789
+ if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
23790
+
23791
+ if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
23792
+ prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;
23793
+ prevIndex = Math.max(prevIndex, 0);
23794
+ }
23795
+ }
23796
+
23797
+ if (params.rewind && swiper.isBeginning) {
23798
+ const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
23799
+ return swiper.slideTo(lastIndex, speed, runCallbacks, internal);
23800
+ }
23801
+
23802
+ return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
23803
+ }
23804
+
23805
+ /* eslint no-unused-vars: "off" */
23806
+ function slideReset(speed = this.params.speed, runCallbacks = true, internal) {
23807
+ const swiper = this;
23808
+ return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
23809
+ }
23810
+
23811
+ /* eslint no-unused-vars: "off" */
23812
+ function slideToClosest(speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) {
23813
+ const swiper = this;
23814
+ let index = swiper.activeIndex;
23815
+ const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
23816
+ const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
23817
+ const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
23818
+
23819
+ if (translate >= swiper.snapGrid[snapIndex]) {
23820
+ // The current translate is on or after the current snap index, so the choice
23821
+ // is between the current index and the one after it.
23822
+ const currentSnap = swiper.snapGrid[snapIndex];
23823
+ const nextSnap = swiper.snapGrid[snapIndex + 1];
23824
+
23825
+ if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
23826
+ index += swiper.params.slidesPerGroup;
23827
+ }
23828
+ } else {
23829
+ // The current translate is before the current snap index, so the choice
23830
+ // is between the current index and the one before it.
23831
+ const prevSnap = swiper.snapGrid[snapIndex - 1];
23832
+ const currentSnap = swiper.snapGrid[snapIndex];
23833
+
23834
+ if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {
23835
+ index -= swiper.params.slidesPerGroup;
23836
+ }
23837
+ }
23838
+
23839
+ index = Math.max(index, 0);
23840
+ index = Math.min(index, swiper.slidesGrid.length - 1);
23841
+ return swiper.slideTo(index, speed, runCallbacks, internal);
23842
+ }
23843
+
23844
+ function slideToClickedSlide() {
23845
+ const swiper = this;
23846
+ const {
23847
+ params,
23848
+ $wrapperEl
23849
+ } = swiper;
23850
+ const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
23851
+ let slideToIndex = swiper.clickedIndex;
23852
+ let realIndex;
23853
+
23854
+ if (params.loop) {
23855
+ if (swiper.animating) return;
23856
+ realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
23857
+
23858
+ if (params.centeredSlides) {
23859
+ if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
23860
+ swiper.loopFix();
23861
+ slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index();
23862
+ nextTick(() => {
23863
+ swiper.slideTo(slideToIndex);
23864
+ });
23865
+ } else {
23866
+ swiper.slideTo(slideToIndex);
23867
+ }
23868
+ } else if (slideToIndex > swiper.slides.length - slidesPerView) {
23869
+ swiper.loopFix();
23870
+ slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index();
23871
+ nextTick(() => {
23872
+ swiper.slideTo(slideToIndex);
23873
+ });
23874
+ } else {
23875
+ swiper.slideTo(slideToIndex);
23876
+ }
23877
+ } else {
23878
+ swiper.slideTo(slideToIndex);
23879
+ }
23880
+ }
23881
+
23882
+ var slide = {
23883
+ slideTo,
23884
+ slideToLoop,
23885
+ slideNext,
23886
+ slidePrev,
23887
+ slideReset,
23888
+ slideToClosest,
23889
+ slideToClickedSlide
23890
+ };
23891
+
23892
+ function loopCreate() {
23893
+ const swiper = this;
23894
+ const document = getDocument();
23895
+ const {
23896
+ params,
23897
+ $wrapperEl
23898
+ } = swiper; // Remove duplicated slides
23899
+
23900
+ const $selector = $wrapperEl.children().length > 0 ? $($wrapperEl.children()[0].parentNode) : $wrapperEl;
23901
+ $selector.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove();
23902
+ let slides = $selector.children(`.${params.slideClass}`);
23903
+
23904
+ if (params.loopFillGroupWithBlank) {
23905
+ const blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;
23906
+
23907
+ if (blankSlidesNum !== params.slidesPerGroup) {
23908
+ for (let i = 0; i < blankSlidesNum; i += 1) {
23909
+ const blankNode = $(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`);
23910
+ $selector.append(blankNode);
23911
+ }
23912
+
23913
+ slides = $selector.children(`.${params.slideClass}`);
23914
+ }
23915
+ }
23916
+
23917
+ if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;
23918
+ swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
23919
+ swiper.loopedSlides += params.loopAdditionalSlides;
23920
+
23921
+ if (swiper.loopedSlides > slides.length && swiper.params.loopedSlidesLimit) {
23922
+ swiper.loopedSlides = slides.length;
23923
+ }
23924
+
23925
+ const prependSlides = [];
23926
+ const appendSlides = [];
23927
+ slides.each((el, index) => {
23928
+ const slide = $(el);
23929
+ slide.attr('data-swiper-slide-index', index);
23930
+ });
23931
+
23932
+ for (let i = 0; i < swiper.loopedSlides; i += 1) {
23933
+ const index = i - Math.floor(i / slides.length) * slides.length;
23934
+ appendSlides.push(slides.eq(index)[0]);
23935
+ prependSlides.unshift(slides.eq(slides.length - index - 1)[0]);
23936
+ }
23937
+
23938
+ for (let i = 0; i < appendSlides.length; i += 1) {
23939
+ $selector.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
23940
+ }
23941
+
23942
+ for (let i = prependSlides.length - 1; i >= 0; i -= 1) {
23943
+ $selector.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
23944
+ }
23945
+ }
23946
+
23947
+ function loopFix() {
23948
+ const swiper = this;
23949
+ swiper.emit('beforeLoopFix');
23950
+ const {
23951
+ activeIndex,
23952
+ slides,
23953
+ loopedSlides,
23954
+ allowSlidePrev,
23955
+ allowSlideNext,
23956
+ snapGrid,
23957
+ rtlTranslate: rtl
23958
+ } = swiper;
23959
+ let newIndex;
23960
+ swiper.allowSlidePrev = true;
23961
+ swiper.allowSlideNext = true;
23962
+ const snapTranslate = -snapGrid[activeIndex];
23963
+ const diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding
23964
+
23965
+ if (activeIndex < loopedSlides) {
23966
+ newIndex = slides.length - loopedSlides * 3 + activeIndex;
23967
+ newIndex += loopedSlides;
23968
+ const slideChanged = swiper.slideTo(newIndex, 0, false, true);
23969
+
23970
+ if (slideChanged && diff !== 0) {
23971
+ swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
23972
+ }
23973
+ } else if (activeIndex >= slides.length - loopedSlides) {
23974
+ // Fix For Positive Oversliding
23975
+ newIndex = -slides.length + activeIndex + loopedSlides;
23976
+ newIndex += loopedSlides;
23977
+ const slideChanged = swiper.slideTo(newIndex, 0, false, true);
23978
+
23979
+ if (slideChanged && diff !== 0) {
23980
+ swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
23981
+ }
23982
+ }
23983
+
23984
+ swiper.allowSlidePrev = allowSlidePrev;
23985
+ swiper.allowSlideNext = allowSlideNext;
23986
+ swiper.emit('loopFix');
23987
+ }
23988
+
23989
+ function loopDestroy() {
23990
+ const swiper = this;
23991
+ const {
23992
+ $wrapperEl,
23993
+ params,
23994
+ slides
23995
+ } = swiper;
23996
+ $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove();
23997
+ slides.removeAttr('data-swiper-slide-index');
23998
+ }
23999
+
24000
+ var loop = {
24001
+ loopCreate,
24002
+ loopFix,
24003
+ loopDestroy
24004
+ };
24005
+
24006
+ function setGrabCursor(moving) {
24007
+ const swiper = this;
24008
+ if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
24009
+ const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;
24010
+ el.style.cursor = 'move';
24011
+ el.style.cursor = moving ? 'grabbing' : 'grab';
24012
+ }
24013
+
24014
+ function unsetGrabCursor() {
24015
+ const swiper = this;
24016
+
24017
+ if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
24018
+ return;
24019
+ }
24020
+
24021
+ swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';
24022
+ }
24023
+
24024
+ var grabCursor = {
24025
+ setGrabCursor,
24026
+ unsetGrabCursor
24027
+ };
24028
+
24029
+ function closestElement(selector, base = this) {
24030
+ function __closestFrom(el) {
24031
+ if (!el || el === getDocument() || el === getWindow()) return null;
24032
+ if (el.assignedSlot) el = el.assignedSlot;
24033
+ const found = el.closest(selector);
24034
+
24035
+ if (!found && !el.getRootNode) {
24036
+ return null;
24037
+ }
24038
+
24039
+ return found || __closestFrom(el.getRootNode().host);
24040
+ }
24041
+
24042
+ return __closestFrom(base);
24043
+ }
24044
+
24045
+ function onTouchStart(event) {
24046
+ const swiper = this;
24047
+ const document = getDocument();
24048
+ const window = getWindow();
24049
+ const data = swiper.touchEventsData;
24050
+ const {
24051
+ params,
24052
+ touches,
24053
+ enabled
24054
+ } = swiper;
24055
+ if (!enabled) return;
24056
+
24057
+ if (swiper.animating && params.preventInteractionOnTransition) {
24058
+ return;
24059
+ }
24060
+
24061
+ if (!swiper.animating && params.cssMode && params.loop) {
24062
+ swiper.loopFix();
24063
+ }
24064
+
24065
+ let e = event;
24066
+ if (e.originalEvent) e = e.originalEvent;
24067
+ let $targetEl = $(e.target);
24068
+
24069
+ if (params.touchEventsTarget === 'wrapper') {
24070
+ if (!$targetEl.closest(swiper.wrapperEl).length) return;
24071
+ }
24072
+
24073
+ data.isTouchEvent = e.type === 'touchstart';
24074
+ if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
24075
+ if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
24076
+ if (data.isTouched && data.isMoved) return; // change target el for shadow root component
24077
+
24078
+ const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; // eslint-disable-next-line
24079
+
24080
+ const eventPath = event.composedPath ? event.composedPath() : event.path;
24081
+
24082
+ if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
24083
+ $targetEl = $(eventPath[0]);
24084
+ }
24085
+
24086
+ const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
24087
+ const isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element
24088
+
24089
+ if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, $targetEl[0]) : $targetEl.closest(noSwipingSelector)[0])) {
24090
+ swiper.allowClick = true;
24091
+ return;
24092
+ }
24093
+
24094
+ if (params.swipeHandler) {
24095
+ if (!$targetEl.closest(params.swipeHandler)[0]) return;
24096
+ }
24097
+
24098
+ touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
24099
+ touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
24100
+ const startX = touches.currentX;
24101
+ const startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
24102
+
24103
+ const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
24104
+ const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
24105
+
24106
+ if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
24107
+ if (edgeSwipeDetection === 'prevent') {
24108
+ event.preventDefault();
24109
+ } else {
24110
+ return;
24111
+ }
24112
+ }
24113
+
24114
+ Object.assign(data, {
24115
+ isTouched: true,
24116
+ isMoved: false,
24117
+ allowTouchCallbacks: true,
24118
+ isScrolling: undefined,
24119
+ startMoving: undefined
24120
+ });
24121
+ touches.startX = startX;
24122
+ touches.startY = startY;
24123
+ data.touchStartTime = now();
24124
+ swiper.allowClick = true;
24125
+ swiper.updateSize();
24126
+ swiper.swipeDirection = undefined;
24127
+ if (params.threshold > 0) data.allowThresholdMove = false;
24128
+
24129
+ if (e.type !== 'touchstart') {
24130
+ let preventDefault = true;
24131
+
24132
+ if ($targetEl.is(data.focusableElements)) {
24133
+ preventDefault = false;
24134
+
24135
+ if ($targetEl[0].nodeName === 'SELECT') {
24136
+ data.isTouched = false;
24137
+ }
24138
+ }
24139
+
24140
+ if (document.activeElement && $(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) {
24141
+ document.activeElement.blur();
24142
+ }
24143
+
24144
+ const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
24145
+
24146
+ if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) {
24147
+ e.preventDefault();
24148
+ }
24149
+ }
24150
+
24151
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {
24152
+ swiper.freeMode.onTouchStart();
24153
+ }
24154
+
24155
+ swiper.emit('touchStart', e);
24156
+ }
24157
+
24158
+ function onTouchMove(event) {
24159
+ const document = getDocument();
24160
+ const swiper = this;
24161
+ const data = swiper.touchEventsData;
24162
+ const {
24163
+ params,
24164
+ touches,
24165
+ rtlTranslate: rtl,
24166
+ enabled
24167
+ } = swiper;
24168
+ if (!enabled) return;
24169
+ let e = event;
24170
+ if (e.originalEvent) e = e.originalEvent;
24171
+
24172
+ if (!data.isTouched) {
24173
+ if (data.startMoving && data.isScrolling) {
24174
+ swiper.emit('touchMoveOpposite', e);
24175
+ }
24176
+
24177
+ return;
24178
+ }
24179
+
24180
+ if (data.isTouchEvent && e.type !== 'touchmove') return;
24181
+ const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
24182
+ const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
24183
+ const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
24184
+
24185
+ if (e.preventedByNestedSwiper) {
24186
+ touches.startX = pageX;
24187
+ touches.startY = pageY;
24188
+ return;
24189
+ }
24190
+
24191
+ if (!swiper.allowTouchMove) {
24192
+ if (!$(e.target).is(data.focusableElements)) {
24193
+ swiper.allowClick = false;
24194
+ }
24195
+
24196
+ if (data.isTouched) {
24197
+ Object.assign(touches, {
24198
+ startX: pageX,
24199
+ startY: pageY,
24200
+ currentX: pageX,
24201
+ currentY: pageY
24202
+ });
24203
+ data.touchStartTime = now();
24204
+ }
24205
+
24206
+ return;
24207
+ }
24208
+
24209
+ if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
24210
+ if (swiper.isVertical()) {
24211
+ // Vertical
24212
+ if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
24213
+ data.isTouched = false;
24214
+ data.isMoved = false;
24215
+ return;
24216
+ }
24217
+ } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
24218
+ return;
24219
+ }
24220
+ }
24221
+
24222
+ if (data.isTouchEvent && document.activeElement) {
24223
+ if (e.target === document.activeElement && $(e.target).is(data.focusableElements)) {
24224
+ data.isMoved = true;
24225
+ swiper.allowClick = false;
24226
+ return;
24227
+ }
24228
+ }
24229
+
24230
+ if (data.allowTouchCallbacks) {
24231
+ swiper.emit('touchMove', e);
24232
+ }
24233
+
24234
+ if (e.targetTouches && e.targetTouches.length > 1) return;
24235
+ touches.currentX = pageX;
24236
+ touches.currentY = pageY;
24237
+ const diffX = touches.currentX - touches.startX;
24238
+ const diffY = touches.currentY - touches.startY;
24239
+ if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
24240
+
24241
+ if (typeof data.isScrolling === 'undefined') {
24242
+ let touchAngle;
24243
+
24244
+ if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
24245
+ data.isScrolling = false;
24246
+ } else {
24247
+ // eslint-disable-next-line
24248
+ if (diffX * diffX + diffY * diffY >= 25) {
24249
+ touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
24250
+ data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
24251
+ }
24252
+ }
24253
+ }
24254
+
24255
+ if (data.isScrolling) {
24256
+ swiper.emit('touchMoveOpposite', e);
24257
+ }
24258
+
24259
+ if (typeof data.startMoving === 'undefined') {
24260
+ if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
24261
+ data.startMoving = true;
24262
+ }
24263
+ }
24264
+
24265
+ if (data.isScrolling) {
24266
+ data.isTouched = false;
24267
+ return;
24268
+ }
24269
+
24270
+ if (!data.startMoving) {
24271
+ return;
24272
+ }
24273
+
24274
+ swiper.allowClick = false;
24275
+
24276
+ if (!params.cssMode && e.cancelable) {
24277
+ e.preventDefault();
24278
+ }
24279
+
24280
+ if (params.touchMoveStopPropagation && !params.nested) {
24281
+ e.stopPropagation();
24282
+ }
24283
+
24284
+ if (!data.isMoved) {
24285
+ if (params.loop && !params.cssMode) {
24286
+ swiper.loopFix();
24287
+ }
24288
+
24289
+ data.startTranslate = swiper.getTranslate();
24290
+ swiper.setTransition(0);
24291
+
24292
+ if (swiper.animating) {
24293
+ swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
24294
+ }
24295
+
24296
+ data.allowMomentumBounce = false; // Grab Cursor
24297
+
24298
+ if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
24299
+ swiper.setGrabCursor(true);
24300
+ }
24301
+
24302
+ swiper.emit('sliderFirstMove', e);
24303
+ }
24304
+
24305
+ swiper.emit('sliderMove', e);
24306
+ data.isMoved = true;
24307
+ let diff = swiper.isHorizontal() ? diffX : diffY;
24308
+ touches.diff = diff;
24309
+ diff *= params.touchRatio;
24310
+ if (rtl) diff = -diff;
24311
+ swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
24312
+ data.currentTranslate = diff + data.startTranslate;
24313
+ let disableParentSwiper = true;
24314
+ let resistanceRatio = params.resistanceRatio;
24315
+
24316
+ if (params.touchReleaseOnEdges) {
24317
+ resistanceRatio = 0;
24318
+ }
24319
+
24320
+ if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {
24321
+ disableParentSwiper = false;
24322
+ if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
24323
+ } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
24324
+ disableParentSwiper = false;
24325
+ if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
24326
+ }
24327
+
24328
+ if (disableParentSwiper) {
24329
+ e.preventedByNestedSwiper = true;
24330
+ } // Directions locks
24331
+
24332
+
24333
+ if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
24334
+ data.currentTranslate = data.startTranslate;
24335
+ }
24336
+
24337
+ if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
24338
+ data.currentTranslate = data.startTranslate;
24339
+ }
24340
+
24341
+ if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
24342
+ data.currentTranslate = data.startTranslate;
24343
+ } // Threshold
24344
+
24345
+
24346
+ if (params.threshold > 0) {
24347
+ if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
24348
+ if (!data.allowThresholdMove) {
24349
+ data.allowThresholdMove = true;
24350
+ touches.startX = touches.currentX;
24351
+ touches.startY = touches.currentY;
24352
+ data.currentTranslate = data.startTranslate;
24353
+ touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
24354
+ return;
24355
+ }
24356
+ } else {
24357
+ data.currentTranslate = data.startTranslate;
24358
+ return;
24359
+ }
24360
+ }
24361
+
24362
+ if (!params.followFinger || params.cssMode) return; // Update active index in free mode
24363
+
24364
+ if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
24365
+ swiper.updateActiveIndex();
24366
+ swiper.updateSlidesClasses();
24367
+ }
24368
+
24369
+ if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) {
24370
+ swiper.freeMode.onTouchMove();
24371
+ } // Update progress
24372
+
24373
+
24374
+ swiper.updateProgress(data.currentTranslate); // Update translate
24375
+
24376
+ swiper.setTranslate(data.currentTranslate);
24377
+ }
24378
+
24379
+ function onTouchEnd(event) {
24380
+ const swiper = this;
24381
+ const data = swiper.touchEventsData;
24382
+ const {
24383
+ params,
24384
+ touches,
24385
+ rtlTranslate: rtl,
24386
+ slidesGrid,
24387
+ enabled
24388
+ } = swiper;
24389
+ if (!enabled) return;
24390
+ let e = event;
24391
+ if (e.originalEvent) e = e.originalEvent;
24392
+
24393
+ if (data.allowTouchCallbacks) {
24394
+ swiper.emit('touchEnd', e);
24395
+ }
24396
+
24397
+ data.allowTouchCallbacks = false;
24398
+
24399
+ if (!data.isTouched) {
24400
+ if (data.isMoved && params.grabCursor) {
24401
+ swiper.setGrabCursor(false);
24402
+ }
24403
+
24404
+ data.isMoved = false;
24405
+ data.startMoving = false;
24406
+ return;
24407
+ } // Return Grab Cursor
24408
+
24409
+
24410
+ if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
24411
+ swiper.setGrabCursor(false);
24412
+ } // Time diff
24413
+
24414
+
24415
+ const touchEndTime = now();
24416
+ const timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click
24417
+
24418
+ if (swiper.allowClick) {
24419
+ const pathTree = e.path || e.composedPath && e.composedPath();
24420
+ swiper.updateClickedSlide(pathTree && pathTree[0] || e.target);
24421
+ swiper.emit('tap click', e);
24422
+
24423
+ if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
24424
+ swiper.emit('doubleTap doubleClick', e);
24425
+ }
24426
+ }
24427
+
24428
+ data.lastClickTime = now();
24429
+ nextTick(() => {
24430
+ if (!swiper.destroyed) swiper.allowClick = true;
24431
+ });
24432
+
24433
+ if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
24434
+ data.isTouched = false;
24435
+ data.isMoved = false;
24436
+ data.startMoving = false;
24437
+ return;
24438
+ }
24439
+
24440
+ data.isTouched = false;
24441
+ data.isMoved = false;
24442
+ data.startMoving = false;
24443
+ let currentPos;
24444
+
24445
+ if (params.followFinger) {
24446
+ currentPos = rtl ? swiper.translate : -swiper.translate;
24447
+ } else {
24448
+ currentPos = -data.currentTranslate;
24449
+ }
24450
+
24451
+ if (params.cssMode) {
24452
+ return;
24453
+ }
24454
+
24455
+ if (swiper.params.freeMode && params.freeMode.enabled) {
24456
+ swiper.freeMode.onTouchEnd({
24457
+ currentPos
24458
+ });
24459
+ return;
24460
+ } // Find current slide
24461
+
24462
+
24463
+ let stopIndex = 0;
24464
+ let groupSize = swiper.slidesSizesGrid[0];
24465
+
24466
+ for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
24467
+ const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
24468
+
24469
+ if (typeof slidesGrid[i + increment] !== 'undefined') {
24470
+ if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
24471
+ stopIndex = i;
24472
+ groupSize = slidesGrid[i + increment] - slidesGrid[i];
24473
+ }
24474
+ } else if (currentPos >= slidesGrid[i]) {
24475
+ stopIndex = i;
24476
+ groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
24477
+ }
24478
+ }
24479
+
24480
+ let rewindFirstIndex = null;
24481
+ let rewindLastIndex = null;
24482
+
24483
+ if (params.rewind) {
24484
+ if (swiper.isBeginning) {
24485
+ rewindLastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;
24486
+ } else if (swiper.isEnd) {
24487
+ rewindFirstIndex = 0;
24488
+ }
24489
+ } // Find current slide size
24490
+
24491
+
24492
+ const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
24493
+ const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
24494
+
24495
+ if (timeDiff > params.longSwipesMs) {
24496
+ // Long touches
24497
+ if (!params.longSwipes) {
24498
+ swiper.slideTo(swiper.activeIndex);
24499
+ return;
24500
+ }
24501
+
24502
+ if (swiper.swipeDirection === 'next') {
24503
+ if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);
24504
+ }
24505
+
24506
+ if (swiper.swipeDirection === 'prev') {
24507
+ if (ratio > 1 - params.longSwipesRatio) {
24508
+ swiper.slideTo(stopIndex + increment);
24509
+ } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {
24510
+ swiper.slideTo(rewindLastIndex);
24511
+ } else {
24512
+ swiper.slideTo(stopIndex);
24513
+ }
24514
+ }
24515
+ } else {
24516
+ // Short swipes
24517
+ if (!params.shortSwipes) {
24518
+ swiper.slideTo(swiper.activeIndex);
24519
+ return;
24520
+ }
24521
+
24522
+ const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
24523
+
24524
+ if (!isNavButtonTarget) {
24525
+ if (swiper.swipeDirection === 'next') {
24526
+ swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);
24527
+ }
24528
+
24529
+ if (swiper.swipeDirection === 'prev') {
24530
+ swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);
24531
+ }
24532
+ } else if (e.target === swiper.navigation.nextEl) {
24533
+ swiper.slideTo(stopIndex + increment);
24534
+ } else {
24535
+ swiper.slideTo(stopIndex);
24536
+ }
24537
+ }
24538
+ }
24539
+
24540
+ function onResize() {
24541
+ const swiper = this;
24542
+ const {
24543
+ params,
24544
+ el
24545
+ } = swiper;
24546
+ if (el && el.offsetWidth === 0) return; // Breakpoints
24547
+
24548
+ if (params.breakpoints) {
24549
+ swiper.setBreakpoint();
24550
+ } // Save locks
24551
+
24552
+
24553
+ const {
24554
+ allowSlideNext,
24555
+ allowSlidePrev,
24556
+ snapGrid
24557
+ } = swiper; // Disable locks on resize
24558
+
24559
+ swiper.allowSlideNext = true;
24560
+ swiper.allowSlidePrev = true;
24561
+ swiper.updateSize();
24562
+ swiper.updateSlides();
24563
+ swiper.updateSlidesClasses();
24564
+
24565
+ if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {
24566
+ swiper.slideTo(swiper.slides.length - 1, 0, false, true);
24567
+ } else {
24568
+ swiper.slideTo(swiper.activeIndex, 0, false, true);
24569
+ }
24570
+
24571
+ if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
24572
+ swiper.autoplay.run();
24573
+ } // Return locks after resize
24574
+
24575
+
24576
+ swiper.allowSlidePrev = allowSlidePrev;
24577
+ swiper.allowSlideNext = allowSlideNext;
24578
+
24579
+ if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
24580
+ swiper.checkOverflow();
24581
+ }
24582
+ }
24583
+
24584
+ function onClick(e) {
24585
+ const swiper = this;
24586
+ if (!swiper.enabled) return;
24587
+
24588
+ if (!swiper.allowClick) {
24589
+ if (swiper.params.preventClicks) e.preventDefault();
24590
+
24591
+ if (swiper.params.preventClicksPropagation && swiper.animating) {
24592
+ e.stopPropagation();
24593
+ e.stopImmediatePropagation();
24594
+ }
24595
+ }
24596
+ }
24597
+
24598
+ function onScroll() {
24599
+ const swiper = this;
24600
+ const {
24601
+ wrapperEl,
24602
+ rtlTranslate,
24603
+ enabled
24604
+ } = swiper;
24605
+ if (!enabled) return;
24606
+ swiper.previousTranslate = swiper.translate;
24607
+
24608
+ if (swiper.isHorizontal()) {
24609
+ swiper.translate = -wrapperEl.scrollLeft;
24610
+ } else {
24611
+ swiper.translate = -wrapperEl.scrollTop;
24612
+ } // eslint-disable-next-line
24613
+
24614
+
24615
+ if (swiper.translate === 0) swiper.translate = 0;
24616
+ swiper.updateActiveIndex();
24617
+ swiper.updateSlidesClasses();
24618
+ let newProgress;
24619
+ const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
24620
+
24621
+ if (translatesDiff === 0) {
24622
+ newProgress = 0;
24623
+ } else {
24624
+ newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
24625
+ }
24626
+
24627
+ if (newProgress !== swiper.progress) {
24628
+ swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
24629
+ }
24630
+
24631
+ swiper.emit('setTranslate', swiper.translate, false);
24632
+ }
24633
+
24634
+ let dummyEventAttached = false;
24635
+
24636
+ function dummyEventListener() {}
24637
+
24638
+ const events = (swiper, method) => {
24639
+ const document = getDocument();
24640
+ const {
24641
+ params,
24642
+ touchEvents,
24643
+ el,
24644
+ wrapperEl,
24645
+ device,
24646
+ support
24647
+ } = swiper;
24648
+ const capture = !!params.nested;
24649
+ const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
24650
+ const swiperMethod = method; // Touch Events
24651
+
24652
+ if (!support.touch) {
24653
+ el[domMethod](touchEvents.start, swiper.onTouchStart, false);
24654
+ document[domMethod](touchEvents.move, swiper.onTouchMove, capture);
24655
+ document[domMethod](touchEvents.end, swiper.onTouchEnd, false);
24656
+ } else {
24657
+ const passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? {
24658
+ passive: true,
24659
+ capture: false
24660
+ } : false;
24661
+ el[domMethod](touchEvents.start, swiper.onTouchStart, passiveListener);
24662
+ el[domMethod](touchEvents.move, swiper.onTouchMove, support.passiveListener ? {
24663
+ passive: false,
24664
+ capture
24665
+ } : capture);
24666
+ el[domMethod](touchEvents.end, swiper.onTouchEnd, passiveListener);
24667
+
24668
+ if (touchEvents.cancel) {
24669
+ el[domMethod](touchEvents.cancel, swiper.onTouchEnd, passiveListener);
24670
+ }
24671
+ } // Prevent Links Clicks
24672
+
24673
+
24674
+ if (params.preventClicks || params.preventClicksPropagation) {
24675
+ el[domMethod]('click', swiper.onClick, true);
24676
+ }
24677
+
24678
+ if (params.cssMode) {
24679
+ wrapperEl[domMethod]('scroll', swiper.onScroll);
24680
+ } // Resize handler
24681
+
24682
+
24683
+ if (params.updateOnWindowResize) {
24684
+ swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
24685
+ } else {
24686
+ swiper[swiperMethod]('observerUpdate', onResize, true);
24687
+ }
24688
+ };
24689
+
24690
+ function attachEvents() {
24691
+ const swiper = this;
24692
+ const document = getDocument();
24693
+ const {
24694
+ params,
24695
+ support
24696
+ } = swiper;
24697
+ swiper.onTouchStart = onTouchStart.bind(swiper);
24698
+ swiper.onTouchMove = onTouchMove.bind(swiper);
24699
+ swiper.onTouchEnd = onTouchEnd.bind(swiper);
24700
+
24701
+ if (params.cssMode) {
24702
+ swiper.onScroll = onScroll.bind(swiper);
24703
+ }
24704
+
24705
+ swiper.onClick = onClick.bind(swiper);
24706
+
24707
+ if (support.touch && !dummyEventAttached) {
24708
+ document.addEventListener('touchstart', dummyEventListener);
24709
+ dummyEventAttached = true;
24710
+ }
24711
+
24712
+ events(swiper, 'on');
24713
+ }
24714
+
24715
+ function detachEvents() {
24716
+ const swiper = this;
24717
+ events(swiper, 'off');
24718
+ }
24719
+
24720
+ var events$1 = {
24721
+ attachEvents,
24722
+ detachEvents
24723
+ };
24724
+
24725
+ const isGridEnabled = (swiper, params) => {
24726
+ return swiper.grid && params.grid && params.grid.rows > 1;
24727
+ };
24728
+
24729
+ function setBreakpoint() {
24730
+ const swiper = this;
24731
+ const {
24732
+ activeIndex,
24733
+ initialized,
24734
+ loopedSlides = 0,
24735
+ params,
24736
+ $el
24737
+ } = swiper;
24738
+ const breakpoints = params.breakpoints;
24739
+ if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters
24740
+
24741
+ const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
24742
+ if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
24743
+ const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
24744
+ const breakpointParams = breakpointOnlyParams || swiper.originalParams;
24745
+ const wasMultiRow = isGridEnabled(swiper, params);
24746
+ const isMultiRow = isGridEnabled(swiper, breakpointParams);
24747
+ const wasEnabled = params.enabled;
24748
+
24749
+ if (wasMultiRow && !isMultiRow) {
24750
+ $el.removeClass(`${params.containerModifierClass}grid ${params.containerModifierClass}grid-column`);
24751
+ swiper.emitContainerClasses();
24752
+ } else if (!wasMultiRow && isMultiRow) {
24753
+ $el.addClass(`${params.containerModifierClass}grid`);
24754
+
24755
+ if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {
24756
+ $el.addClass(`${params.containerModifierClass}grid-column`);
24757
+ }
24758
+
24759
+ swiper.emitContainerClasses();
24760
+ } // Toggle navigation, pagination, scrollbar
24761
+
24762
+
24763
+ ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
24764
+ const wasModuleEnabled = params[prop] && params[prop].enabled;
24765
+ const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;
24766
+
24767
+ if (wasModuleEnabled && !isModuleEnabled) {
24768
+ swiper[prop].disable();
24769
+ }
24770
+
24771
+ if (!wasModuleEnabled && isModuleEnabled) {
24772
+ swiper[prop].enable();
24773
+ }
24774
+ });
24775
+ const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
24776
+ const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
24777
+
24778
+ if (directionChanged && initialized) {
24779
+ swiper.changeDirection();
24780
+ }
24781
+
24782
+ extend(swiper.params, breakpointParams);
24783
+ const isEnabled = swiper.params.enabled;
24784
+ Object.assign(swiper, {
24785
+ allowTouchMove: swiper.params.allowTouchMove,
24786
+ allowSlideNext: swiper.params.allowSlideNext,
24787
+ allowSlidePrev: swiper.params.allowSlidePrev
24788
+ });
24789
+
24790
+ if (wasEnabled && !isEnabled) {
24791
+ swiper.disable();
24792
+ } else if (!wasEnabled && isEnabled) {
24793
+ swiper.enable();
24794
+ }
24795
+
24796
+ swiper.currentBreakpoint = breakpoint;
24797
+ swiper.emit('_beforeBreakpoint', breakpointParams);
24798
+
24799
+ if (needsReLoop && initialized) {
24800
+ swiper.loopDestroy();
24801
+ swiper.loopCreate();
24802
+ swiper.updateSlides();
24803
+ swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);
24804
+ }
24805
+
24806
+ swiper.emit('breakpoint', breakpointParams);
24807
+ }
24808
+
24809
+ function getBreakpoint(breakpoints, base = 'window', containerEl) {
24810
+ if (!breakpoints || base === 'container' && !containerEl) return undefined;
24811
+ let breakpoint = false;
24812
+ const window = getWindow();
24813
+ const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
24814
+ const points = Object.keys(breakpoints).map(point => {
24815
+ if (typeof point === 'string' && point.indexOf('@') === 0) {
24816
+ const minRatio = parseFloat(point.substr(1));
24817
+ const value = currentHeight * minRatio;
24818
+ return {
24819
+ value,
24820
+ point
24821
+ };
24822
+ }
24823
+
24824
+ return {
24825
+ value: point,
24826
+ point
24827
+ };
24828
+ });
24829
+ points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
24830
+
24831
+ for (let i = 0; i < points.length; i += 1) {
24832
+ const {
24833
+ point,
24834
+ value
24835
+ } = points[i];
24836
+
24837
+ if (base === 'window') {
24838
+ if (window.matchMedia(`(min-width: ${value}px)`).matches) {
24839
+ breakpoint = point;
24840
+ }
24841
+ } else if (value <= containerEl.clientWidth) {
24842
+ breakpoint = point;
24843
+ }
24844
+ }
24845
+
24846
+ return breakpoint || 'max';
24847
+ }
24848
+
24849
+ var breakpoints = {
24850
+ setBreakpoint,
24851
+ getBreakpoint
24852
+ };
24853
+
24854
+ function prepareClasses(entries, prefix) {
24855
+ const resultClasses = [];
24856
+ entries.forEach(item => {
24857
+ if (typeof item === 'object') {
24858
+ Object.keys(item).forEach(classNames => {
24859
+ if (item[classNames]) {
24860
+ resultClasses.push(prefix + classNames);
24861
+ }
24862
+ });
24863
+ } else if (typeof item === 'string') {
24864
+ resultClasses.push(prefix + item);
24865
+ }
24866
+ });
24867
+ return resultClasses;
24868
+ }
24869
+
24870
+ function addClasses() {
24871
+ const swiper = this;
24872
+ const {
24873
+ classNames,
24874
+ params,
24875
+ rtl,
24876
+ $el,
24877
+ device,
24878
+ support
24879
+ } = swiper; // prettier-ignore
24880
+
24881
+ const suffixes = prepareClasses(['initialized', params.direction, {
24882
+ 'pointer-events': !support.touch
24883
+ }, {
24884
+ 'free-mode': swiper.params.freeMode && params.freeMode.enabled
24885
+ }, {
24886
+ 'autoheight': params.autoHeight
24887
+ }, {
24888
+ 'rtl': rtl
24889
+ }, {
24890
+ 'grid': params.grid && params.grid.rows > 1
24891
+ }, {
24892
+ 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'
24893
+ }, {
24894
+ 'android': device.android
24895
+ }, {
24896
+ 'ios': device.ios
24897
+ }, {
24898
+ 'css-mode': params.cssMode
24899
+ }, {
24900
+ 'centered': params.cssMode && params.centeredSlides
24901
+ }, {
24902
+ 'watch-progress': params.watchSlidesProgress
24903
+ }], params.containerModifierClass);
24904
+ classNames.push(...suffixes);
24905
+ $el.addClass([...classNames].join(' '));
24906
+ swiper.emitContainerClasses();
24907
+ }
24908
+
24909
+ function removeClasses() {
24910
+ const swiper = this;
24911
+ const {
24912
+ $el,
24913
+ classNames
24914
+ } = swiper;
24915
+ $el.removeClass(classNames.join(' '));
24916
+ swiper.emitContainerClasses();
24917
+ }
24918
+
24919
+ var classes = {
24920
+ addClasses,
24921
+ removeClasses
24922
+ };
24923
+
24924
+ function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {
24925
+ const window = getWindow();
24926
+ let image;
24927
+
24928
+ function onReady() {
24929
+ if (callback) callback();
24930
+ }
24931
+
24932
+ const isPicture = $(imageEl).parent('picture')[0];
24933
+
24934
+ if (!isPicture && (!imageEl.complete || !checkForComplete)) {
24935
+ if (src) {
24936
+ image = new window.Image();
24937
+ image.onload = onReady;
24938
+ image.onerror = onReady;
24939
+
24940
+ if (sizes) {
24941
+ image.sizes = sizes;
24942
+ }
24943
+
24944
+ if (srcset) {
24945
+ image.srcset = srcset;
24946
+ }
24947
+
24948
+ if (src) {
24949
+ image.src = src;
24950
+ }
24951
+ } else {
24952
+ onReady();
24953
+ }
24954
+ } else {
24955
+ // image already loaded...
24956
+ onReady();
24957
+ }
24958
+ }
24959
+
24960
+ function preloadImages() {
24961
+ const swiper = this;
24962
+ swiper.imagesToLoad = swiper.$el.find('img');
24963
+
24964
+ function onReady() {
24965
+ if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
24966
+ if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
24967
+
24968
+ if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
24969
+ if (swiper.params.updateOnImagesReady) swiper.update();
24970
+ swiper.emit('imagesReady');
24971
+ }
24972
+ }
24973
+
24974
+ for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
24975
+ const imageEl = swiper.imagesToLoad[i];
24976
+ swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);
24977
+ }
24978
+ }
24979
+
24980
+ var images = {
24981
+ loadImage,
24982
+ preloadImages
24983
+ };
24984
+
24985
+ function checkOverflow() {
24986
+ const swiper = this;
24987
+ const {
24988
+ isLocked: wasLocked,
24989
+ params
24990
+ } = swiper;
24991
+ const {
24992
+ slidesOffsetBefore
24993
+ } = params;
24994
+
24995
+ if (slidesOffsetBefore) {
24996
+ const lastSlideIndex = swiper.slides.length - 1;
24997
+ const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
24998
+ swiper.isLocked = swiper.size > lastSlideRightEdge;
24999
+ } else {
25000
+ swiper.isLocked = swiper.snapGrid.length === 1;
25001
+ }
25002
+
25003
+ if (params.allowSlideNext === true) {
25004
+ swiper.allowSlideNext = !swiper.isLocked;
25005
+ }
25006
+
25007
+ if (params.allowSlidePrev === true) {
25008
+ swiper.allowSlidePrev = !swiper.isLocked;
25009
+ }
25010
+
25011
+ if (wasLocked && wasLocked !== swiper.isLocked) {
25012
+ swiper.isEnd = false;
25013
+ }
25014
+
25015
+ if (wasLocked !== swiper.isLocked) {
25016
+ swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
25017
+ }
25018
+ }
25019
+
25020
+ var checkOverflow$1 = {
25021
+ checkOverflow
25022
+ };
25023
+
25024
+ var defaults = {
25025
+ init: true,
25026
+ direction: 'horizontal',
25027
+ touchEventsTarget: 'wrapper',
25028
+ initialSlide: 0,
25029
+ speed: 300,
25030
+ cssMode: false,
25031
+ updateOnWindowResize: true,
25032
+ resizeObserver: true,
25033
+ nested: false,
25034
+ createElements: false,
25035
+ enabled: true,
25036
+ focusableElements: 'input, select, option, textarea, button, video, label',
25037
+ // Overrides
25038
+ width: null,
25039
+ height: null,
25040
+ //
25041
+ preventInteractionOnTransition: false,
25042
+ // ssr
25043
+ userAgent: null,
25044
+ url: null,
25045
+ // To support iOS's swipe-to-go-back gesture (when being used in-app).
25046
+ edgeSwipeDetection: false,
25047
+ edgeSwipeThreshold: 20,
25048
+ // Autoheight
25049
+ autoHeight: false,
25050
+ // Set wrapper width
25051
+ setWrapperSize: false,
25052
+ // Virtual Translate
25053
+ virtualTranslate: false,
25054
+ // Effects
25055
+ effect: 'slide',
25056
+ // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
25057
+ // Breakpoints
25058
+ breakpoints: undefined,
25059
+ breakpointsBase: 'window',
25060
+ // Slides grid
25061
+ spaceBetween: 0,
25062
+ slidesPerView: 1,
25063
+ slidesPerGroup: 1,
25064
+ slidesPerGroupSkip: 0,
25065
+ slidesPerGroupAuto: false,
25066
+ centeredSlides: false,
25067
+ centeredSlidesBounds: false,
25068
+ slidesOffsetBefore: 0,
25069
+ // in px
25070
+ slidesOffsetAfter: 0,
25071
+ // in px
25072
+ normalizeSlideIndex: true,
25073
+ centerInsufficientSlides: false,
25074
+ // Disable swiper and hide navigation when container not overflow
25075
+ watchOverflow: true,
25076
+ // Round length
25077
+ roundLengths: false,
25078
+ // Touches
25079
+ touchRatio: 1,
25080
+ touchAngle: 45,
25081
+ simulateTouch: true,
25082
+ shortSwipes: true,
25083
+ longSwipes: true,
25084
+ longSwipesRatio: 0.5,
25085
+ longSwipesMs: 300,
25086
+ followFinger: true,
25087
+ allowTouchMove: true,
25088
+ threshold: 0,
25089
+ touchMoveStopPropagation: false,
25090
+ touchStartPreventDefault: true,
25091
+ touchStartForcePreventDefault: false,
25092
+ touchReleaseOnEdges: false,
25093
+ // Unique Navigation Elements
25094
+ uniqueNavElements: true,
25095
+ // Resistance
25096
+ resistance: true,
25097
+ resistanceRatio: 0.85,
25098
+ // Progress
25099
+ watchSlidesProgress: false,
25100
+ // Cursor
25101
+ grabCursor: false,
25102
+ // Clicks
25103
+ preventClicks: true,
25104
+ preventClicksPropagation: true,
25105
+ slideToClickedSlide: false,
25106
+ // Images
25107
+ preloadImages: true,
25108
+ updateOnImagesReady: true,
25109
+ // loop
25110
+ loop: false,
25111
+ loopAdditionalSlides: 0,
25112
+ loopedSlides: null,
25113
+ loopedSlidesLimit: true,
25114
+ loopFillGroupWithBlank: false,
25115
+ loopPreventsSlide: true,
25116
+ // rewind
25117
+ rewind: false,
25118
+ // Swiping/no swiping
25119
+ allowSlidePrev: true,
25120
+ allowSlideNext: true,
25121
+ swipeHandler: null,
25122
+ // '.swipe-handler',
25123
+ noSwiping: true,
25124
+ noSwipingClass: 'swiper-no-swiping',
25125
+ noSwipingSelector: null,
25126
+ // Passive Listeners
25127
+ passiveListeners: true,
25128
+ maxBackfaceHiddenSlides: 10,
25129
+ // NS
25130
+ containerModifierClass: 'swiper-',
25131
+ // NEW
25132
+ slideClass: 'swiper-slide',
25133
+ slideBlankClass: 'swiper-slide-invisible-blank',
25134
+ slideActiveClass: 'swiper-slide-active',
25135
+ slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
25136
+ slideVisibleClass: 'swiper-slide-visible',
25137
+ slideDuplicateClass: 'swiper-slide-duplicate',
25138
+ slideNextClass: 'swiper-slide-next',
25139
+ slideDuplicateNextClass: 'swiper-slide-duplicate-next',
25140
+ slidePrevClass: 'swiper-slide-prev',
25141
+ slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
25142
+ wrapperClass: 'swiper-wrapper',
25143
+ // Callbacks
25144
+ runCallbacksOnInit: true,
25145
+ // Internals
25146
+ _emitClasses: false
25147
+ };
25148
+
25149
+ function moduleExtendParams(params, allModulesParams) {
25150
+ return function extendParams(obj = {}) {
25151
+ const moduleParamName = Object.keys(obj)[0];
25152
+ const moduleParams = obj[moduleParamName];
25153
+
25154
+ if (typeof moduleParams !== 'object' || moduleParams === null) {
25155
+ extend(allModulesParams, obj);
25156
+ return;
25157
+ }
25158
+
25159
+ if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) {
25160
+ params[moduleParamName] = {
25161
+ auto: true
25162
+ };
25163
+ }
25164
+
25165
+ if (!(moduleParamName in params && 'enabled' in moduleParams)) {
25166
+ extend(allModulesParams, obj);
25167
+ return;
25168
+ }
25169
+
25170
+ if (params[moduleParamName] === true) {
25171
+ params[moduleParamName] = {
25172
+ enabled: true
25173
+ };
25174
+ }
25175
+
25176
+ if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
25177
+ params[moduleParamName].enabled = true;
25178
+ }
25179
+
25180
+ if (!params[moduleParamName]) params[moduleParamName] = {
25181
+ enabled: false
25182
+ };
25183
+ extend(allModulesParams, obj);
25184
+ };
25185
+ }
25186
+
25187
+ /* eslint no-param-reassign: "off" */
25188
+ const prototypes = {
25189
+ eventsEmitter,
25190
+ update,
25191
+ translate,
25192
+ transition,
25193
+ slide,
25194
+ loop,
25195
+ grabCursor,
25196
+ events: events$1,
25197
+ breakpoints,
25198
+ checkOverflow: checkOverflow$1,
25199
+ classes,
25200
+ images
25201
+ };
25202
+ const extendedDefaults = {};
25203
+
25204
+ class Swiper {
25205
+ constructor(...args) {
25206
+ let el;
25207
+ let params;
25208
+
25209
+ if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
25210
+ params = args[0];
25211
+ } else {
25212
+ [el, params] = args;
25213
+ }
25214
+
25215
+ if (!params) params = {};
25216
+ params = extend({}, params);
25217
+ if (el && !params.el) params.el = el;
25218
+
25219
+ if (params.el && $(params.el).length > 1) {
25220
+ const swipers = [];
25221
+ $(params.el).each(containerEl => {
25222
+ const newParams = extend({}, params, {
25223
+ el: containerEl
25224
+ });
25225
+ swipers.push(new Swiper(newParams));
25226
+ }); // eslint-disable-next-line no-constructor-return
25227
+
25228
+ return swipers;
25229
+ } // Swiper Instance
25230
+
25231
+
25232
+ const swiper = this;
25233
+ swiper.__swiper__ = true;
25234
+ swiper.support = getSupport();
25235
+ swiper.device = getDevice({
25236
+ userAgent: params.userAgent
25237
+ });
25238
+ swiper.browser = getBrowser();
25239
+ swiper.eventsListeners = {};
25240
+ swiper.eventsAnyListeners = [];
25241
+ swiper.modules = [...swiper.__modules__];
25242
+
25243
+ if (params.modules && Array.isArray(params.modules)) {
25244
+ swiper.modules.push(...params.modules);
25245
+ }
25246
+
25247
+ const allModulesParams = {};
25248
+ swiper.modules.forEach(mod => {
25249
+ mod({
25250
+ swiper,
25251
+ extendParams: moduleExtendParams(params, allModulesParams),
25252
+ on: swiper.on.bind(swiper),
25253
+ once: swiper.once.bind(swiper),
25254
+ off: swiper.off.bind(swiper),
25255
+ emit: swiper.emit.bind(swiper)
25256
+ });
25257
+ }); // Extend defaults with modules params
25258
+
25259
+ const swiperParams = extend({}, defaults, allModulesParams); // Extend defaults with passed params
25260
+
25261
+ swiper.params = extend({}, swiperParams, extendedDefaults, params);
25262
+ swiper.originalParams = extend({}, swiper.params);
25263
+ swiper.passedParams = extend({}, params); // add event listeners
25264
+
25265
+ if (swiper.params && swiper.params.on) {
25266
+ Object.keys(swiper.params.on).forEach(eventName => {
25267
+ swiper.on(eventName, swiper.params.on[eventName]);
25268
+ });
25269
+ }
25270
+
25271
+ if (swiper.params && swiper.params.onAny) {
25272
+ swiper.onAny(swiper.params.onAny);
25273
+ } // Save Dom lib
25274
+
25275
+
25276
+ swiper.$ = $; // Extend Swiper
25277
+
25278
+ Object.assign(swiper, {
25279
+ enabled: swiper.params.enabled,
25280
+ el,
25281
+ // Classes
25282
+ classNames: [],
25283
+ // Slides
25284
+ slides: $(),
25285
+ slidesGrid: [],
25286
+ snapGrid: [],
25287
+ slidesSizesGrid: [],
25288
+
25289
+ // isDirection
25290
+ isHorizontal() {
25291
+ return swiper.params.direction === 'horizontal';
25292
+ },
25293
+
25294
+ isVertical() {
25295
+ return swiper.params.direction === 'vertical';
25296
+ },
25297
+
25298
+ // Indexes
25299
+ activeIndex: 0,
25300
+ realIndex: 0,
25301
+ //
25302
+ isBeginning: true,
25303
+ isEnd: false,
25304
+ // Props
25305
+ translate: 0,
25306
+ previousTranslate: 0,
25307
+ progress: 0,
25308
+ velocity: 0,
25309
+ animating: false,
25310
+ // Locks
25311
+ allowSlideNext: swiper.params.allowSlideNext,
25312
+ allowSlidePrev: swiper.params.allowSlidePrev,
25313
+ // Touch Events
25314
+ touchEvents: function touchEvents() {
25315
+ const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
25316
+ const desktop = ['pointerdown', 'pointermove', 'pointerup'];
25317
+ swiper.touchEventsTouch = {
25318
+ start: touch[0],
25319
+ move: touch[1],
25320
+ end: touch[2],
25321
+ cancel: touch[3]
25322
+ };
25323
+ swiper.touchEventsDesktop = {
25324
+ start: desktop[0],
25325
+ move: desktop[1],
25326
+ end: desktop[2]
25327
+ };
25328
+ return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
25329
+ }(),
25330
+ touchEventsData: {
25331
+ isTouched: undefined,
25332
+ isMoved: undefined,
25333
+ allowTouchCallbacks: undefined,
25334
+ touchStartTime: undefined,
25335
+ isScrolling: undefined,
25336
+ currentTranslate: undefined,
25337
+ startTranslate: undefined,
25338
+ allowThresholdMove: undefined,
25339
+ // Form elements to match
25340
+ focusableElements: swiper.params.focusableElements,
25341
+ // Last click time
25342
+ lastClickTime: now(),
25343
+ clickTimeout: undefined,
25344
+ // Velocities
25345
+ velocities: [],
25346
+ allowMomentumBounce: undefined,
25347
+ isTouchEvent: undefined,
25348
+ startMoving: undefined
25349
+ },
25350
+ // Clicks
25351
+ allowClick: true,
25352
+ // Touches
25353
+ allowTouchMove: swiper.params.allowTouchMove,
25354
+ touches: {
25355
+ startX: 0,
25356
+ startY: 0,
25357
+ currentX: 0,
25358
+ currentY: 0,
25359
+ diff: 0
25360
+ },
25361
+ // Images
25362
+ imagesToLoad: [],
25363
+ imagesLoaded: 0
25364
+ });
25365
+ swiper.emit('_swiper'); // Init
25366
+
25367
+ if (swiper.params.init) {
25368
+ swiper.init();
25369
+ } // Return app instance
25370
+ // eslint-disable-next-line no-constructor-return
25371
+
25372
+
25373
+ return swiper;
25374
+ }
25375
+
25376
+ enable() {
25377
+ const swiper = this;
25378
+ if (swiper.enabled) return;
25379
+ swiper.enabled = true;
25380
+
25381
+ if (swiper.params.grabCursor) {
25382
+ swiper.setGrabCursor();
25383
+ }
25384
+
25385
+ swiper.emit('enable');
25386
+ }
25387
+
25388
+ disable() {
25389
+ const swiper = this;
25390
+ if (!swiper.enabled) return;
25391
+ swiper.enabled = false;
25392
+
25393
+ if (swiper.params.grabCursor) {
25394
+ swiper.unsetGrabCursor();
25395
+ }
25396
+
25397
+ swiper.emit('disable');
25398
+ }
25399
+
25400
+ setProgress(progress, speed) {
25401
+ const swiper = this;
25402
+ progress = Math.min(Math.max(progress, 0), 1);
25403
+ const min = swiper.minTranslate();
25404
+ const max = swiper.maxTranslate();
25405
+ const current = (max - min) * progress + min;
25406
+ swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
25407
+ swiper.updateActiveIndex();
25408
+ swiper.updateSlidesClasses();
25409
+ }
25410
+
25411
+ emitContainerClasses() {
25412
+ const swiper = this;
25413
+ if (!swiper.params._emitClasses || !swiper.el) return;
25414
+ const cls = swiper.el.className.split(' ').filter(className => {
25415
+ return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
25416
+ });
25417
+ swiper.emit('_containerClasses', cls.join(' '));
25418
+ }
25419
+
25420
+ getSlideClasses(slideEl) {
25421
+ const swiper = this;
25422
+ if (swiper.destroyed) return '';
25423
+ return slideEl.className.split(' ').filter(className => {
25424
+ return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
25425
+ }).join(' ');
25426
+ }
25427
+
25428
+ emitSlidesClasses() {
25429
+ const swiper = this;
25430
+ if (!swiper.params._emitClasses || !swiper.el) return;
25431
+ const updates = [];
25432
+ swiper.slides.each(slideEl => {
25433
+ const classNames = swiper.getSlideClasses(slideEl);
25434
+ updates.push({
25435
+ slideEl,
25436
+ classNames
25437
+ });
25438
+ swiper.emit('_slideClass', slideEl, classNames);
25439
+ });
25440
+ swiper.emit('_slideClasses', updates);
25441
+ }
25442
+
25443
+ slidesPerViewDynamic(view = 'current', exact = false) {
25444
+ const swiper = this;
25445
+ const {
25446
+ params,
25447
+ slides,
25448
+ slidesGrid,
25449
+ slidesSizesGrid,
25450
+ size: swiperSize,
25451
+ activeIndex
25452
+ } = swiper;
25453
+ let spv = 1;
25454
+
25455
+ if (params.centeredSlides) {
25456
+ let slideSize = slides[activeIndex].swiperSlideSize;
25457
+ let breakLoop;
25458
+
25459
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
25460
+ if (slides[i] && !breakLoop) {
25461
+ slideSize += slides[i].swiperSlideSize;
25462
+ spv += 1;
25463
+ if (slideSize > swiperSize) breakLoop = true;
25464
+ }
25465
+ }
25466
+
25467
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
25468
+ if (slides[i] && !breakLoop) {
25469
+ slideSize += slides[i].swiperSlideSize;
25470
+ spv += 1;
25471
+ if (slideSize > swiperSize) breakLoop = true;
25472
+ }
25473
+ }
25474
+ } else {
25475
+ // eslint-disable-next-line
25476
+ if (view === 'current') {
25477
+ for (let i = activeIndex + 1; i < slides.length; i += 1) {
25478
+ const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
25479
+
25480
+ if (slideInView) {
25481
+ spv += 1;
25482
+ }
25483
+ }
25484
+ } else {
25485
+ // previous
25486
+ for (let i = activeIndex - 1; i >= 0; i -= 1) {
25487
+ const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
25488
+
25489
+ if (slideInView) {
25490
+ spv += 1;
25491
+ }
25492
+ }
25493
+ }
25494
+ }
25495
+
25496
+ return spv;
25497
+ }
25498
+
25499
+ update() {
25500
+ const swiper = this;
25501
+ if (!swiper || swiper.destroyed) return;
25502
+ const {
25503
+ snapGrid,
25504
+ params
25505
+ } = swiper; // Breakpoints
25506
+
25507
+ if (params.breakpoints) {
25508
+ swiper.setBreakpoint();
25509
+ }
25510
+
25511
+ swiper.updateSize();
25512
+ swiper.updateSlides();
25513
+ swiper.updateProgress();
25514
+ swiper.updateSlidesClasses();
25515
+
25516
+ function setTranslate() {
25517
+ const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
25518
+ const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
25519
+ swiper.setTranslate(newTranslate);
25520
+ swiper.updateActiveIndex();
25521
+ swiper.updateSlidesClasses();
25522
+ }
25523
+
25524
+ let translated;
25525
+
25526
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled) {
25527
+ setTranslate();
25528
+
25529
+ if (swiper.params.autoHeight) {
25530
+ swiper.updateAutoHeight();
25531
+ }
25532
+ } else {
25533
+ if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
25534
+ translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
25535
+ } else {
25536
+ translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
25537
+ }
25538
+
25539
+ if (!translated) {
25540
+ setTranslate();
25541
+ }
25542
+ }
25543
+
25544
+ if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
25545
+ swiper.checkOverflow();
25546
+ }
25547
+
25548
+ swiper.emit('update');
25549
+ }
25550
+
25551
+ changeDirection(newDirection, needUpdate = true) {
25552
+ const swiper = this;
25553
+ const currentDirection = swiper.params.direction;
25554
+
25555
+ if (!newDirection) {
25556
+ // eslint-disable-next-line
25557
+ newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
25558
+ }
25559
+
25560
+ if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
25561
+ return swiper;
25562
+ }
25563
+
25564
+ swiper.$el.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`).addClass(`${swiper.params.containerModifierClass}${newDirection}`);
25565
+ swiper.emitContainerClasses();
25566
+ swiper.params.direction = newDirection;
25567
+ swiper.slides.each(slideEl => {
25568
+ if (newDirection === 'vertical') {
25569
+ slideEl.style.width = '';
25570
+ } else {
25571
+ slideEl.style.height = '';
25572
+ }
25573
+ });
25574
+ swiper.emit('changeDirection');
25575
+ if (needUpdate) swiper.update();
25576
+ return swiper;
25577
+ }
25578
+
25579
+ changeLanguageDirection(direction) {
25580
+ const swiper = this;
25581
+ if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;
25582
+ swiper.rtl = direction === 'rtl';
25583
+ swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;
25584
+
25585
+ if (swiper.rtl) {
25586
+ swiper.$el.addClass(`${swiper.params.containerModifierClass}rtl`);
25587
+ swiper.el.dir = 'rtl';
25588
+ } else {
25589
+ swiper.$el.removeClass(`${swiper.params.containerModifierClass}rtl`);
25590
+ swiper.el.dir = 'ltr';
25591
+ }
25592
+
25593
+ swiper.update();
25594
+ }
25595
+
25596
+ mount(el) {
25597
+ const swiper = this;
25598
+ if (swiper.mounted) return true; // Find el
25599
+
25600
+ const $el = $(el || swiper.params.el);
25601
+ el = $el[0];
25602
+
25603
+ if (!el) {
25604
+ return false;
25605
+ }
25606
+
25607
+ el.swiper = swiper;
25608
+
25609
+ const getWrapperSelector = () => {
25610
+ return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;
25611
+ };
25612
+
25613
+ const getWrapper = () => {
25614
+ if (el && el.shadowRoot && el.shadowRoot.querySelector) {
25615
+ const res = $(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items
25616
+
25617
+ res.children = options => $el.children(options);
25618
+
25619
+ return res;
25620
+ }
25621
+
25622
+ if (!$el.children) {
25623
+ return $($el).children(getWrapperSelector());
25624
+ }
25625
+
25626
+ return $el.children(getWrapperSelector());
25627
+ }; // Find Wrapper
25628
+
25629
+
25630
+ let $wrapperEl = getWrapper();
25631
+
25632
+ if ($wrapperEl.length === 0 && swiper.params.createElements) {
25633
+ const document = getDocument();
25634
+ const wrapper = document.createElement('div');
25635
+ $wrapperEl = $(wrapper);
25636
+ wrapper.className = swiper.params.wrapperClass;
25637
+ $el.append(wrapper);
25638
+ $el.children(`.${swiper.params.slideClass}`).each(slideEl => {
25639
+ $wrapperEl.append(slideEl);
25640
+ });
25641
+ }
25642
+
25643
+ Object.assign(swiper, {
25644
+ $el,
25645
+ el,
25646
+ $wrapperEl,
25647
+ wrapperEl: $wrapperEl[0],
25648
+ mounted: true,
25649
+ // RTL
25650
+ rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',
25651
+ rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
25652
+ wrongRTL: $wrapperEl.css('display') === '-webkit-box'
25653
+ });
25654
+ return true;
25655
+ }
25656
+
25657
+ init(el) {
25658
+ const swiper = this;
25659
+ if (swiper.initialized) return swiper;
25660
+ const mounted = swiper.mount(el);
25661
+ if (mounted === false) return swiper;
25662
+ swiper.emit('beforeInit'); // Set breakpoint
25663
+
25664
+ if (swiper.params.breakpoints) {
25665
+ swiper.setBreakpoint();
25666
+ } // Add Classes
25667
+
25668
+
25669
+ swiper.addClasses(); // Create loop
25670
+
25671
+ if (swiper.params.loop) {
25672
+ swiper.loopCreate();
25673
+ } // Update size
25674
+
25675
+
25676
+ swiper.updateSize(); // Update slides
25677
+
25678
+ swiper.updateSlides();
25679
+
25680
+ if (swiper.params.watchOverflow) {
25681
+ swiper.checkOverflow();
25682
+ } // Set Grab Cursor
25683
+
25684
+
25685
+ if (swiper.params.grabCursor && swiper.enabled) {
25686
+ swiper.setGrabCursor();
25687
+ }
25688
+
25689
+ if (swiper.params.preloadImages) {
25690
+ swiper.preloadImages();
25691
+ } // Slide To Initial Slide
25692
+
25693
+
25694
+ if (swiper.params.loop) {
25695
+ swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true);
25696
+ } else {
25697
+ swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
25698
+ } // Attach events
25699
+
25700
+
25701
+ swiper.attachEvents(); // Init Flag
25702
+
25703
+ swiper.initialized = true; // Emit
25704
+
25705
+ swiper.emit('init');
25706
+ swiper.emit('afterInit');
25707
+ return swiper;
25708
+ }
25709
+
25710
+ destroy(deleteInstance = true, cleanStyles = true) {
25711
+ const swiper = this;
25712
+ const {
25713
+ params,
25714
+ $el,
25715
+ $wrapperEl,
25716
+ slides
25717
+ } = swiper;
25718
+
25719
+ if (typeof swiper.params === 'undefined' || swiper.destroyed) {
25720
+ return null;
25721
+ }
25722
+
25723
+ swiper.emit('beforeDestroy'); // Init Flag
25724
+
25725
+ swiper.initialized = false; // Detach events
25726
+
25727
+ swiper.detachEvents(); // Destroy loop
25728
+
25729
+ if (params.loop) {
25730
+ swiper.loopDestroy();
25731
+ } // Cleanup styles
25732
+
25733
+
25734
+ if (cleanStyles) {
25735
+ swiper.removeClasses();
25736
+ $el.removeAttr('style');
25737
+ $wrapperEl.removeAttr('style');
25738
+
25739
+ if (slides && slides.length) {
25740
+ slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index');
25741
+ }
25742
+ }
25743
+
25744
+ swiper.emit('destroy'); // Detach emitter events
25745
+
25746
+ Object.keys(swiper.eventsListeners).forEach(eventName => {
25747
+ swiper.off(eventName);
25748
+ });
25749
+
25750
+ if (deleteInstance !== false) {
25751
+ swiper.$el[0].swiper = null;
25752
+ deleteProps(swiper);
25753
+ }
25754
+
25755
+ swiper.destroyed = true;
25756
+ return null;
25757
+ }
25758
+
25759
+ static extendDefaults(newDefaults) {
25760
+ extend(extendedDefaults, newDefaults);
25761
+ }
25762
+
25763
+ static get extendedDefaults() {
25764
+ return extendedDefaults;
25765
+ }
25766
+
25767
+ static get defaults() {
25768
+ return defaults;
25769
+ }
25770
+
25771
+ static installModule(mod) {
25772
+ if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];
25773
+ const modules = Swiper.prototype.__modules__;
25774
+
25775
+ if (typeof mod === 'function' && modules.indexOf(mod) < 0) {
25776
+ modules.push(mod);
25777
+ }
25778
+ }
25779
+
25780
+ static use(module) {
25781
+ if (Array.isArray(module)) {
25782
+ module.forEach(m => Swiper.installModule(m));
25783
+ return Swiper;
25784
+ }
25785
+
25786
+ Swiper.installModule(module);
25787
+ return Swiper;
25788
+ }
25789
+
25790
+ }
25791
+
25792
+ Object.keys(prototypes).forEach(prototypeGroup => {
25793
+ Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {
25794
+ Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
25795
+ });
25796
+ });
25797
+ Swiper.use([Resize, Observer]);
25798
+
25799
+ /* eslint no-underscore-dangle: "off" */
25800
+ function Autoplay({
25801
+ swiper,
25802
+ extendParams,
25803
+ on,
25804
+ emit
25805
+ }) {
25806
+ let timeout;
25807
+ swiper.autoplay = {
25808
+ running: false,
25809
+ paused: false
25810
+ };
25811
+ extendParams({
25812
+ autoplay: {
25813
+ enabled: false,
25814
+ delay: 3000,
25815
+ waitForTransition: true,
25816
+ disableOnInteraction: true,
25817
+ stopOnLastSlide: false,
25818
+ reverseDirection: false,
25819
+ pauseOnMouseEnter: false
25820
+ }
25821
+ });
25822
+
25823
+ function run() {
25824
+ if (!swiper.size) {
25825
+ swiper.autoplay.running = false;
25826
+ swiper.autoplay.paused = false;
25827
+ return;
25828
+ }
25829
+
25830
+ const $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
25831
+ let delay = swiper.params.autoplay.delay;
25832
+
25833
+ if ($activeSlideEl.attr('data-swiper-autoplay')) {
25834
+ delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
25835
+ }
25836
+
25837
+ clearTimeout(timeout);
25838
+ timeout = nextTick(() => {
25839
+ let autoplayResult;
25840
+
25841
+ if (swiper.params.autoplay.reverseDirection) {
25842
+ if (swiper.params.loop) {
25843
+ swiper.loopFix();
25844
+ autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
25845
+ emit('autoplay');
25846
+ } else if (!swiper.isBeginning) {
25847
+ autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);
25848
+ emit('autoplay');
25849
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
25850
+ autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
25851
+ emit('autoplay');
25852
+ } else {
25853
+ stop();
25854
+ }
25855
+ } else if (swiper.params.loop) {
25856
+ swiper.loopFix();
25857
+ autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
25858
+ emit('autoplay');
25859
+ } else if (!swiper.isEnd) {
25860
+ autoplayResult = swiper.slideNext(swiper.params.speed, true, true);
25861
+ emit('autoplay');
25862
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
25863
+ autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true);
25864
+ emit('autoplay');
25865
+ } else {
25866
+ stop();
25867
+ }
25868
+
25869
+ if (swiper.params.cssMode && swiper.autoplay.running) run();else if (autoplayResult === false) {
25870
+ run();
25871
+ }
25872
+ }, delay);
25873
+ }
25874
+
25875
+ function start() {
25876
+ if (typeof timeout !== 'undefined') return false;
25877
+ if (swiper.autoplay.running) return false;
25878
+ swiper.autoplay.running = true;
25879
+ emit('autoplayStart');
25880
+ run();
25881
+ return true;
25882
+ }
25883
+
25884
+ function stop() {
25885
+ if (!swiper.autoplay.running) return false;
25886
+ if (typeof timeout === 'undefined') return false;
25887
+
25888
+ if (timeout) {
25889
+ clearTimeout(timeout);
25890
+ timeout = undefined;
25891
+ }
25892
+
25893
+ swiper.autoplay.running = false;
25894
+ emit('autoplayStop');
25895
+ return true;
25896
+ }
25897
+
25898
+ function pause(speed) {
25899
+ if (!swiper.autoplay.running) return;
25900
+ if (swiper.autoplay.paused) return;
25901
+ if (timeout) clearTimeout(timeout);
25902
+ swiper.autoplay.paused = true;
25903
+
25904
+ if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
25905
+ swiper.autoplay.paused = false;
25906
+ run();
25907
+ } else {
25908
+ ['transitionend', 'webkitTransitionEnd'].forEach(event => {
25909
+ swiper.$wrapperEl[0].addEventListener(event, onTransitionEnd);
25910
+ });
25911
+ }
25912
+ }
25913
+
25914
+ function onVisibilityChange() {
25915
+ const document = getDocument();
25916
+
25917
+ if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
25918
+ pause();
25919
+ }
25920
+
25921
+ if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
25922
+ run();
25923
+ swiper.autoplay.paused = false;
25924
+ }
25925
+ }
25926
+
25927
+ function onTransitionEnd(e) {
25928
+ if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;
25929
+ if (e.target !== swiper.$wrapperEl[0]) return;
25930
+ ['transitionend', 'webkitTransitionEnd'].forEach(event => {
25931
+ swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd);
25932
+ });
25933
+ swiper.autoplay.paused = false;
25934
+
25935
+ if (!swiper.autoplay.running) {
25936
+ stop();
25937
+ } else {
25938
+ run();
25939
+ }
25940
+ }
25941
+
25942
+ function onMouseEnter() {
25943
+ if (swiper.params.autoplay.disableOnInteraction) {
25944
+ stop();
25945
+ } else {
25946
+ emit('autoplayPause');
25947
+ pause();
25948
+ }
25949
+
25950
+ ['transitionend', 'webkitTransitionEnd'].forEach(event => {
25951
+ swiper.$wrapperEl[0].removeEventListener(event, onTransitionEnd);
25952
+ });
25953
+ }
25954
+
25955
+ function onMouseLeave() {
25956
+ if (swiper.params.autoplay.disableOnInteraction) {
25957
+ return;
25958
+ }
25959
+
25960
+ swiper.autoplay.paused = false;
25961
+ emit('autoplayResume');
25962
+ run();
25963
+ }
25964
+
25965
+ function attachMouseEvents() {
25966
+ if (swiper.params.autoplay.pauseOnMouseEnter) {
25967
+ swiper.$el.on('mouseenter', onMouseEnter);
25968
+ swiper.$el.on('mouseleave', onMouseLeave);
25969
+ }
25970
+ }
25971
+
25972
+ function detachMouseEvents() {
25973
+ swiper.$el.off('mouseenter', onMouseEnter);
25974
+ swiper.$el.off('mouseleave', onMouseLeave);
25975
+ }
25976
+
25977
+ on('init', () => {
25978
+ if (swiper.params.autoplay.enabled) {
25979
+ start();
25980
+ const document = getDocument();
25981
+ document.addEventListener('visibilitychange', onVisibilityChange);
25982
+ attachMouseEvents();
25983
+ }
25984
+ });
25985
+ on('beforeTransitionStart', (_s, speed, internal) => {
25986
+ if (swiper.autoplay.running) {
25987
+ if (internal || !swiper.params.autoplay.disableOnInteraction) {
25988
+ swiper.autoplay.pause(speed);
25989
+ } else {
25990
+ stop();
25991
+ }
25992
+ }
25993
+ });
25994
+ on('sliderFirstMove', () => {
25995
+ if (swiper.autoplay.running) {
25996
+ if (swiper.params.autoplay.disableOnInteraction) {
25997
+ stop();
25998
+ } else {
25999
+ pause();
26000
+ }
26001
+ }
26002
+ });
26003
+ on('touchEnd', () => {
26004
+ if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
26005
+ run();
26006
+ }
26007
+ });
26008
+ on('destroy', () => {
26009
+ detachMouseEvents();
26010
+
26011
+ if (swiper.autoplay.running) {
26012
+ stop();
26013
+ }
26014
+
26015
+ const document = getDocument();
26016
+ document.removeEventListener('visibilitychange', onVisibilityChange);
26017
+ });
26018
+ Object.assign(swiper.autoplay, {
26019
+ pause,
26020
+ run,
26021
+ start,
26022
+ stop
26023
+ });
26024
+ }
26025
+
21924
26026
  /* src/PanoTagPlugin/Components/Common/MediaItem.svelte generated by Svelte v3.50.1 */
21925
26027
 
21926
26028
  function add_css$e(target) {
@@ -22286,7 +26388,7 @@ function create_if_block_1$6(ctx) {
22286
26388
  let swiper;
22287
26389
  let current;
22288
26390
 
22289
- swiper = new Swiper({
26391
+ swiper = new Swiper$1({
22290
26392
  props: {
22291
26393
  style: "height: 100%",
22292
26394
  modules: [Autoplay],