@ptcwebops/ptcw-design 1.6.7 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{esm/core-1c9d4889.js → cjs/core-5a811549.js} +26 -1
  2. package/dist/cjs/{icon-asset_17.cjs.entry.js → icon-asset_16.cjs.entry.js} +44 -38
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/ptc-case-studies-slider.cjs.entry.js +1685 -0
  5. package/dist/cjs/ptc-image-download-strip.cjs.entry.js +29 -0
  6. package/dist/cjs/ptc-jumbotron.cjs.entry.js +1 -1
  7. package/dist/cjs/ptc-news.cjs.entry.js +28 -0
  8. package/dist/cjs/ptc-pricing-tabs.cjs.entry.js +1 -1
  9. package/dist/cjs/ptc-progress-bar_2.cjs.entry.js +11 -1
  10. package/dist/cjs/ptc-readmore.cjs.entry.js +2 -2
  11. package/dist/cjs/ptc-slit-card.cjs.entry.js +36 -0
  12. package/dist/cjs/ptcw-design.cjs.js +1 -1
  13. package/dist/cjs/sequential-bundle-example.cjs.entry.js +1 -1
  14. package/dist/cjs/sequential-bundle.cjs.entry.js +1 -1
  15. package/dist/collection/collection-manifest.json +3 -0
  16. package/dist/collection/components/icon-asset/media/designer.svg +33 -3
  17. package/dist/collection/components/ptc-button/ptc-button.css +18 -0
  18. package/dist/collection/components/ptc-button/ptc-button.js +20 -1
  19. package/dist/collection/components/ptc-case-studies-slider/ptc-case-studies-slider.css +831 -0
  20. package/dist/collection/components/ptc-case-studies-slider/ptc-case-studies-slider.js +91 -0
  21. package/dist/collection/components/ptc-image-download-strip/ptc-image-download-strip.css +49 -0
  22. package/dist/collection/components/ptc-image-download-strip/ptc-image-download-strip.js +51 -0
  23. package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +0 -17
  24. package/dist/collection/components/ptc-news/ptc-news.css +47 -0
  25. package/dist/collection/components/ptc-news/ptc-news.js +169 -0
  26. package/dist/collection/components/ptc-para/ptc-para.css +8 -0
  27. package/dist/collection/components/ptc-para/ptc-para.js +2 -2
  28. package/dist/collection/components/ptc-pricing-tabs/ptc-pricing-tabs.css +0 -17
  29. package/dist/collection/components/ptc-product-card/ptc-product-card.css +22 -1
  30. package/dist/collection/components/ptc-product-card/ptc-product-card.js +3 -2
  31. package/dist/collection/components/ptc-product-list/ptc-product-list.js +23 -0
  32. package/dist/collection/components/ptc-product-sidebar/ptc-product-sidebar.css +6 -1
  33. package/dist/collection/components/ptc-product-sidebar/ptc-product-sidebar.js +18 -2
  34. package/dist/collection/components/ptc-readmore/ptc-readmore.js +2 -2
  35. package/dist/collection/components/ptc-social-share/ptc-social-share.js +32 -4
  36. package/dist/collection/stories/ReadMore.stories.js +100 -0
  37. package/dist/collection/stories/Tooltip.stories.js +112 -0
  38. package/dist/custom-elements/index.d.ts +18 -0
  39. package/dist/custom-elements/index.js +9666 -7875
  40. package/dist/{cjs/core-fd18b67a.js → esm/core-2af05469.js} +14 -3
  41. package/dist/esm/{icon-asset_17.entry.js → icon-asset_16.entry.js} +45 -38
  42. package/dist/esm/loader.js +1 -1
  43. package/dist/esm/ptc-case-studies-slider.entry.js +1681 -0
  44. package/dist/esm/ptc-image-download-strip.entry.js +25 -0
  45. package/dist/esm/ptc-jumbotron.entry.js +1 -1
  46. package/dist/esm/ptc-news.entry.js +24 -0
  47. package/dist/esm/ptc-pricing-tabs.entry.js +1 -1
  48. package/dist/esm/ptc-progress-bar_2.entry.js +11 -1
  49. package/dist/esm/ptc-readmore.entry.js +2 -2
  50. package/dist/esm/ptc-slit-card.entry.js +32 -0
  51. package/dist/esm/ptcw-design.js +1 -1
  52. package/dist/esm/sequential-bundle-example.entry.js +1 -1
  53. package/dist/esm/sequential-bundle.entry.js +1 -1
  54. package/dist/ptcw-design/media/designer.svg +33 -3
  55. package/dist/ptcw-design/{p-9e23fa0e.entry.js → p-1cea4b9e.entry.js} +1 -1
  56. package/dist/ptcw-design/p-4e551e25.entry.js +1 -0
  57. package/dist/ptcw-design/p-5507ef4b.entry.js +1 -0
  58. package/dist/ptcw-design/p-575de112.js +1 -0
  59. package/dist/ptcw-design/{p-b1a63c48.entry.js → p-7753a23d.entry.js} +1 -1
  60. package/dist/ptcw-design/p-aa942e3b.entry.js +1 -0
  61. package/dist/ptcw-design/p-b5d7c48e.entry.js +1 -0
  62. package/dist/ptcw-design/p-c5fadad0.entry.js +1 -0
  63. package/dist/ptcw-design/{p-9cb33f7d.entry.js → p-d9f4813a.entry.js} +1 -1
  64. package/dist/ptcw-design/{p-48c53295.entry.js → p-f1f1b19d.entry.js} +1 -1
  65. package/dist/ptcw-design/p-fe438f03.entry.js +1 -0
  66. package/dist/ptcw-design/ptcw-design.css +1 -1
  67. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  68. package/dist/types/components/ptc-button/ptc-button.d.ts +4 -0
  69. package/dist/types/components/ptc-case-studies-slider/ptc-case-studies-slider.d.ts +14 -0
  70. package/dist/types/components/ptc-image-download-strip/ptc-image-download-strip.d.ts +9 -0
  71. package/dist/types/components/ptc-news/ptc-news.d.ts +35 -0
  72. package/dist/types/components/ptc-para/ptc-para.d.ts +1 -1
  73. package/dist/types/components/ptc-product-list/ptc-product-list.d.ts +1 -0
  74. package/dist/types/components/ptc-product-sidebar/ptc-product-sidebar.d.ts +1 -0
  75. package/dist/types/components/ptc-social-share/ptc-social-share.d.ts +5 -1
  76. package/dist/types/components.d.ts +135 -8
  77. package/package.json +1 -1
  78. package/readme.md +1 -1
  79. package/dist/ptcw-design/p-2c23c489.entry.js +0 -1
  80. package/dist/ptcw-design/p-69dddd51.js +0 -1
  81. package/dist/ptcw-design/p-c26920ef.entry.js +0 -1
@@ -0,0 +1,1681 @@
1
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-8e63c32d.js';
2
+ import { e as elementChildren, c as createElement, a as elementOuterSize, b as elementParents, d as elementIndex, g as getDocument, i as isObject, n as now, f as elementTransitionEnd, h as getSlideTransformEl, S as Swiper } from './core-2af05469.js';
3
+
4
+ function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
5
+ if (swiper.params.createElements) {
6
+ Object.keys(checkProps).forEach(key => {
7
+ if (!params[key] && params.auto === true) {
8
+ let element = elementChildren(swiper.el, `.${checkProps[key]}`)[0];
9
+ if (!element) {
10
+ element = createElement('div', checkProps[key]);
11
+ element.className = checkProps[key];
12
+ swiper.el.append(element);
13
+ }
14
+ params[key] = element;
15
+ originalParams[key] = element;
16
+ }
17
+ });
18
+ }
19
+ return params;
20
+ }
21
+
22
+ function Navigation({
23
+ swiper,
24
+ extendParams,
25
+ on,
26
+ emit
27
+ }) {
28
+ extendParams({
29
+ navigation: {
30
+ nextEl: null,
31
+ prevEl: null,
32
+ hideOnClick: false,
33
+ disabledClass: 'swiper-button-disabled',
34
+ hiddenClass: 'swiper-button-hidden',
35
+ lockClass: 'swiper-button-lock',
36
+ navigationDisabledClass: 'swiper-navigation-disabled'
37
+ }
38
+ });
39
+ swiper.navigation = {
40
+ nextEl: null,
41
+ prevEl: null
42
+ };
43
+ const makeElementsArray = el => {
44
+ if (!Array.isArray(el)) el = [el].filter(e => !!e);
45
+ return el;
46
+ };
47
+ function getEl(el) {
48
+ let res;
49
+ if (el && typeof el === 'string' && swiper.isElement) {
50
+ res = swiper.el.shadowRoot.querySelector(el);
51
+ if (res) return res;
52
+ }
53
+ if (el) {
54
+ if (typeof el === 'string') res = [...document.querySelectorAll(el)];
55
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
56
+ res = swiper.el.querySelector(el);
57
+ }
58
+ }
59
+ if (el && !res) return el;
60
+ // if (Array.isArray(res) && res.length === 1) res = res[0];
61
+ return res;
62
+ }
63
+ function toggleEl(el, disabled) {
64
+ const params = swiper.params.navigation;
65
+ el = makeElementsArray(el);
66
+ el.forEach(subEl => {
67
+ if (subEl) {
68
+ subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
69
+ if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
70
+ if (swiper.params.watchOverflow && swiper.enabled) {
71
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
72
+ }
73
+ }
74
+ });
75
+ }
76
+ function update() {
77
+ // Update Navigation Buttons
78
+ const {
79
+ nextEl,
80
+ prevEl
81
+ } = swiper.navigation;
82
+ if (swiper.params.loop) {
83
+ toggleEl(prevEl, false);
84
+ toggleEl(nextEl, false);
85
+ return;
86
+ }
87
+ toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
88
+ toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
89
+ }
90
+ function onPrevClick(e) {
91
+ e.preventDefault();
92
+ if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
93
+ swiper.slidePrev();
94
+ emit('navigationPrev');
95
+ }
96
+ function onNextClick(e) {
97
+ e.preventDefault();
98
+ if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
99
+ swiper.slideNext();
100
+ emit('navigationNext');
101
+ }
102
+ function init() {
103
+ const params = swiper.params.navigation;
104
+ swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
105
+ nextEl: 'swiper-button-next',
106
+ prevEl: 'swiper-button-prev'
107
+ });
108
+ if (!(params.nextEl || params.prevEl)) return;
109
+ let nextEl = getEl(params.nextEl);
110
+ let prevEl = getEl(params.prevEl);
111
+ Object.assign(swiper.navigation, {
112
+ nextEl,
113
+ prevEl
114
+ });
115
+ nextEl = makeElementsArray(nextEl);
116
+ prevEl = makeElementsArray(prevEl);
117
+ const initButton = (el, dir) => {
118
+ if (el) {
119
+ el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
120
+ }
121
+ if (!swiper.enabled && el) {
122
+ el.classList.add(...params.lockClass.split(' '));
123
+ }
124
+ };
125
+ nextEl.forEach(el => initButton(el, 'next'));
126
+ prevEl.forEach(el => initButton(el, 'prev'));
127
+ }
128
+ function destroy() {
129
+ let {
130
+ nextEl,
131
+ prevEl
132
+ } = swiper.navigation;
133
+ nextEl = makeElementsArray(nextEl);
134
+ prevEl = makeElementsArray(prevEl);
135
+ const destroyButton = (el, dir) => {
136
+ el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
137
+ el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
138
+ };
139
+ nextEl.forEach(el => destroyButton(el, 'next'));
140
+ prevEl.forEach(el => destroyButton(el, 'prev'));
141
+ }
142
+ on('init', () => {
143
+ if (swiper.params.navigation.enabled === false) {
144
+ // eslint-disable-next-line
145
+ disable();
146
+ } else {
147
+ init();
148
+ update();
149
+ }
150
+ });
151
+ on('toEdge fromEdge lock unlock', () => {
152
+ update();
153
+ });
154
+ on('destroy', () => {
155
+ destroy();
156
+ });
157
+ on('enable disable', () => {
158
+ let {
159
+ nextEl,
160
+ prevEl
161
+ } = swiper.navigation;
162
+ nextEl = makeElementsArray(nextEl);
163
+ prevEl = makeElementsArray(prevEl);
164
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.navigation.lockClass));
165
+ });
166
+ on('click', (_s, e) => {
167
+ let {
168
+ nextEl,
169
+ prevEl
170
+ } = swiper.navigation;
171
+ nextEl = makeElementsArray(nextEl);
172
+ prevEl = makeElementsArray(prevEl);
173
+ const targetEl = e.target;
174
+ if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {
175
+ if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
176
+ let isHidden;
177
+ if (nextEl.length) {
178
+ isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
179
+ } else if (prevEl.length) {
180
+ isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
181
+ }
182
+ if (isHidden === true) {
183
+ emit('navigationShow');
184
+ } else {
185
+ emit('navigationHide');
186
+ }
187
+ [...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
188
+ }
189
+ });
190
+ const enable = () => {
191
+ swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
192
+ init();
193
+ update();
194
+ };
195
+ const disable = () => {
196
+ swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
197
+ destroy();
198
+ };
199
+ Object.assign(swiper.navigation, {
200
+ enable,
201
+ disable,
202
+ update,
203
+ init,
204
+ destroy
205
+ });
206
+ }
207
+
208
+ function classesToSelector(classes = '') {
209
+ return `.${classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line
210
+ .replace(/ /g, '.')}`;
211
+ }
212
+
213
+ function Pagination({
214
+ swiper,
215
+ extendParams,
216
+ on,
217
+ emit
218
+ }) {
219
+ const pfx = 'swiper-pagination';
220
+ extendParams({
221
+ pagination: {
222
+ el: null,
223
+ bulletElement: 'span',
224
+ clickable: false,
225
+ hideOnClick: false,
226
+ renderBullet: null,
227
+ renderProgressbar: null,
228
+ renderFraction: null,
229
+ renderCustom: null,
230
+ progressbarOpposite: false,
231
+ type: 'bullets',
232
+ // 'bullets' or 'progressbar' or 'fraction' or 'custom'
233
+ dynamicBullets: false,
234
+ dynamicMainBullets: 1,
235
+ formatFractionCurrent: number => number,
236
+ formatFractionTotal: number => number,
237
+ bulletClass: `${pfx}-bullet`,
238
+ bulletActiveClass: `${pfx}-bullet-active`,
239
+ modifierClass: `${pfx}-`,
240
+ currentClass: `${pfx}-current`,
241
+ totalClass: `${pfx}-total`,
242
+ hiddenClass: `${pfx}-hidden`,
243
+ progressbarFillClass: `${pfx}-progressbar-fill`,
244
+ progressbarOppositeClass: `${pfx}-progressbar-opposite`,
245
+ clickableClass: `${pfx}-clickable`,
246
+ lockClass: `${pfx}-lock`,
247
+ horizontalClass: `${pfx}-horizontal`,
248
+ verticalClass: `${pfx}-vertical`,
249
+ paginationDisabledClass: `${pfx}-disabled`
250
+ }
251
+ });
252
+ swiper.pagination = {
253
+ el: null,
254
+ bullets: []
255
+ };
256
+ let bulletSize;
257
+ let dynamicBulletIndex = 0;
258
+ const makeElementsArray = el => {
259
+ if (!Array.isArray(el)) el = [el].filter(e => !!e);
260
+ return el;
261
+ };
262
+ function isPaginationDisabled() {
263
+ return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0;
264
+ }
265
+ function setSideBullets(bulletEl, position) {
266
+ const {
267
+ bulletActiveClass
268
+ } = swiper.params.pagination;
269
+ if (!bulletEl) return;
270
+ bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
271
+ if (bulletEl) {
272
+ bulletEl.classList.add(`${bulletActiveClass}-${position}`);
273
+ bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
274
+ if (bulletEl) {
275
+ bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
276
+ }
277
+ }
278
+ }
279
+ function onBulletClick(e) {
280
+ const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
281
+ if (!bulletEl) {
282
+ return;
283
+ }
284
+ e.preventDefault();
285
+ const index = elementIndex(bulletEl) * swiper.params.slidesPerGroup;
286
+ if (swiper.params.loop) {
287
+ if (swiper.realIndex === index) return;
288
+ if (index < swiper.loopedSlides || index > swiper.slides.length - swiper.loopedSlides) {
289
+ swiper.loopFix({
290
+ direction: index < swiper.loopedSlides ? 'prev' : 'next',
291
+ activeSlideIndex: index,
292
+ slideTo: false
293
+ });
294
+ }
295
+ swiper.slideToLoop(index);
296
+ } else {
297
+ swiper.slideTo(index);
298
+ }
299
+ }
300
+ function update() {
301
+ // Render || Update Pagination bullets/items
302
+ const rtl = swiper.rtl;
303
+ const params = swiper.params.pagination;
304
+ if (isPaginationDisabled()) return;
305
+ let el = swiper.pagination.el;
306
+ el = makeElementsArray(el);
307
+ // Current/Total
308
+ let current;
309
+ const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
310
+ const total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
311
+ if (swiper.params.loop) {
312
+ current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
313
+ } else if (typeof swiper.snapIndex !== 'undefined') {
314
+ current = swiper.snapIndex;
315
+ } else {
316
+ current = swiper.activeIndex || 0;
317
+ }
318
+ // Types
319
+ if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
320
+ const bullets = swiper.pagination.bullets;
321
+ let firstIndex;
322
+ let lastIndex;
323
+ let midIndex;
324
+ if (params.dynamicBullets) {
325
+ bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true);
326
+ el.forEach(subEl => {
327
+ subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
328
+ });
329
+ if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
330
+ dynamicBulletIndex += current - (swiper.previousIndex || 0);
331
+ if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
332
+ dynamicBulletIndex = params.dynamicMainBullets - 1;
333
+ } else if (dynamicBulletIndex < 0) {
334
+ dynamicBulletIndex = 0;
335
+ }
336
+ }
337
+ firstIndex = Math.max(current - dynamicBulletIndex, 0);
338
+ lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
339
+ midIndex = (lastIndex + firstIndex) / 2;
340
+ }
341
+ bullets.forEach(bulletEl => {
342
+ const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat();
343
+ bulletEl.classList.remove(...classesToRemove);
344
+ });
345
+ if (el.length > 1) {
346
+ bullets.forEach(bullet => {
347
+ const bulletIndex = elementIndex(bullet);
348
+ if (bulletIndex === current) {
349
+ bullet.classList.add(...params.bulletActiveClass.split(' '));
350
+ }
351
+ if (params.dynamicBullets) {
352
+ if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
353
+ bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
354
+ }
355
+ if (bulletIndex === firstIndex) {
356
+ setSideBullets(bullet, 'prev');
357
+ }
358
+ if (bulletIndex === lastIndex) {
359
+ setSideBullets(bullet, 'next');
360
+ }
361
+ }
362
+ });
363
+ } else {
364
+ const bullet = bullets[current];
365
+ if (bullet) {
366
+ bullet.classList.add(...params.bulletActiveClass.split(' '));
367
+ }
368
+ if (params.dynamicBullets) {
369
+ const firstDisplayedBullet = bullets[firstIndex];
370
+ const lastDisplayedBullet = bullets[lastIndex];
371
+ for (let i = firstIndex; i <= lastIndex; i += 1) {
372
+ if (bullets[i]) {
373
+ bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
374
+ }
375
+ }
376
+ setSideBullets(firstDisplayedBullet, 'prev');
377
+ setSideBullets(lastDisplayedBullet, 'next');
378
+ }
379
+ }
380
+ if (params.dynamicBullets) {
381
+ const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
382
+ const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
383
+ const offsetProp = rtl ? 'right' : 'left';
384
+ bullets.forEach(bullet => {
385
+ bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
386
+ });
387
+ }
388
+ }
389
+ el.forEach((subEl, subElIndex) => {
390
+ if (params.type === 'fraction') {
391
+ subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
392
+ fractionEl.textContent = params.formatFractionCurrent(current + 1);
393
+ });
394
+ subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
395
+ totalEl.textContent = params.formatFractionTotal(total);
396
+ });
397
+ }
398
+ if (params.type === 'progressbar') {
399
+ let progressbarDirection;
400
+ if (params.progressbarOpposite) {
401
+ progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
402
+ } else {
403
+ progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
404
+ }
405
+ const scale = (current + 1) / total;
406
+ let scaleX = 1;
407
+ let scaleY = 1;
408
+ if (progressbarDirection === 'horizontal') {
409
+ scaleX = scale;
410
+ } else {
411
+ scaleY = scale;
412
+ }
413
+ subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
414
+ progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
415
+ progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
416
+ });
417
+ }
418
+ if (params.type === 'custom' && params.renderCustom) {
419
+ subEl.innerHTML = params.renderCustom(swiper, current + 1, total);
420
+ if (subElIndex === 0) emit('paginationRender', subEl);
421
+ } else {
422
+ if (subElIndex === 0) emit('paginationRender', subEl);
423
+ emit('paginationUpdate', subEl);
424
+ }
425
+ if (swiper.params.watchOverflow && swiper.enabled) {
426
+ subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
427
+ }
428
+ });
429
+ }
430
+ function render() {
431
+ // Render Container
432
+ const params = swiper.params.pagination;
433
+ if (isPaginationDisabled()) return;
434
+ const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
435
+ let el = swiper.pagination.el;
436
+ el = makeElementsArray(el);
437
+ let paginationHTML = '';
438
+ if (params.type === 'bullets') {
439
+ let numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
440
+ if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
441
+ numberOfBullets = slidesLength;
442
+ }
443
+ for (let i = 0; i < numberOfBullets; i += 1) {
444
+ if (params.renderBullet) {
445
+ paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
446
+ } else {
447
+ paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`;
448
+ }
449
+ }
450
+ }
451
+ if (params.type === 'fraction') {
452
+ if (params.renderFraction) {
453
+ paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
454
+ } else {
455
+ paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
456
+ }
457
+ }
458
+ if (params.type === 'progressbar') {
459
+ if (params.renderProgressbar) {
460
+ paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
461
+ } else {
462
+ paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
463
+ }
464
+ }
465
+ swiper.pagination.bullets = [];
466
+ el.forEach(subEl => {
467
+ if (params.type !== 'custom') {
468
+ subEl.innerHTML = paginationHTML || '';
469
+ }
470
+ if (params.type === 'bullets') {
471
+ swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
472
+ }
473
+ });
474
+ if (params.type !== 'custom') {
475
+ emit('paginationRender', el[0]);
476
+ }
477
+ }
478
+ function init() {
479
+ swiper.params.pagination = createElementIfNotDefined(swiper, swiper.originalParams.pagination, swiper.params.pagination, {
480
+ el: 'swiper-pagination'
481
+ });
482
+ const params = swiper.params.pagination;
483
+ if (!params.el) return;
484
+ let el;
485
+ if (typeof params.el === 'string' && swiper.isElement) {
486
+ el = swiper.el.shadowRoot.querySelector(params.el);
487
+ }
488
+ if (!el && typeof params.el === 'string') {
489
+ el = [...document.querySelectorAll(params.el)];
490
+ }
491
+ if (!el) {
492
+ el = params.el;
493
+ }
494
+ if (!el || el.length === 0) return;
495
+ if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
496
+ el = [...swiper.el.querySelectorAll(params.el)];
497
+ // check if it belongs to another nested Swiper
498
+ if (el.length > 1) {
499
+ el = el.filter(subEl => {
500
+ if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
501
+ return true;
502
+ })[0];
503
+ }
504
+ }
505
+ if (Array.isArray(el) && el.length === 1) el = el[0];
506
+ Object.assign(swiper.pagination, {
507
+ el
508
+ });
509
+ el = makeElementsArray(el);
510
+ el.forEach(subEl => {
511
+ if (params.type === 'bullets' && params.clickable) {
512
+ subEl.classList.add(params.clickableClass);
513
+ }
514
+ subEl.classList.add(params.modifierClass + params.type);
515
+ subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
516
+ if (params.type === 'bullets' && params.dynamicBullets) {
517
+ subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
518
+ dynamicBulletIndex = 0;
519
+ if (params.dynamicMainBullets < 1) {
520
+ params.dynamicMainBullets = 1;
521
+ }
522
+ }
523
+ if (params.type === 'progressbar' && params.progressbarOpposite) {
524
+ subEl.classList.add(params.progressbarOppositeClass);
525
+ }
526
+ if (params.clickable) {
527
+ subEl.addEventListener('click', onBulletClick);
528
+ }
529
+ if (!swiper.enabled) {
530
+ subEl.classList.add(params.lockClass);
531
+ }
532
+ });
533
+ }
534
+ function destroy() {
535
+ const params = swiper.params.pagination;
536
+ if (isPaginationDisabled()) return;
537
+ let el = swiper.pagination.el;
538
+ if (el) {
539
+ el = makeElementsArray(el);
540
+ el.forEach(subEl => {
541
+ subEl.classList.remove(params.hiddenClass);
542
+ subEl.classList.remove(params.modifierClass + params.type);
543
+ subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
544
+ if (params.clickable) {
545
+ subEl.removeEventListener('click', onBulletClick);
546
+ }
547
+ });
548
+ }
549
+ if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
550
+ }
551
+ on('init', () => {
552
+ if (swiper.params.pagination.enabled === false) {
553
+ // eslint-disable-next-line
554
+ disable();
555
+ } else {
556
+ init();
557
+ render();
558
+ update();
559
+ }
560
+ });
561
+ on('activeIndexChange', () => {
562
+ if (typeof swiper.snapIndex === 'undefined') {
563
+ update();
564
+ }
565
+ });
566
+ on('snapIndexChange', () => {
567
+ update();
568
+ });
569
+ on('snapGridLengthChange', () => {
570
+ render();
571
+ update();
572
+ });
573
+ on('destroy', () => {
574
+ destroy();
575
+ });
576
+ on('enable disable', () => {
577
+ let {
578
+ el
579
+ } = swiper.pagination;
580
+ if (el) {
581
+ el = makeElementsArray(el);
582
+ el.forEach(subEl => subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass));
583
+ }
584
+ });
585
+ on('lock unlock', () => {
586
+ update();
587
+ });
588
+ on('click', (_s, e) => {
589
+ const targetEl = e.target;
590
+ let {
591
+ el
592
+ } = swiper.pagination;
593
+ if (!Array.isArray(el)) el = [el].filter(element => !!element);
594
+ if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) {
595
+ if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;
596
+ const isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass);
597
+ if (isHidden === true) {
598
+ emit('paginationShow');
599
+ } else {
600
+ emit('paginationHide');
601
+ }
602
+ el.forEach(subEl => subEl.classList.toggle(swiper.params.pagination.hiddenClass));
603
+ }
604
+ });
605
+ const enable = () => {
606
+ swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass);
607
+ let {
608
+ el
609
+ } = swiper.pagination;
610
+ if (el) {
611
+ el = makeElementsArray(el);
612
+ el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
613
+ }
614
+ init();
615
+ render();
616
+ update();
617
+ };
618
+ const disable = () => {
619
+ swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass);
620
+ let {
621
+ el
622
+ } = swiper.pagination;
623
+ if (el) {
624
+ el = makeElementsArray(el);
625
+ el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
626
+ }
627
+ destroy();
628
+ };
629
+ Object.assign(swiper.pagination, {
630
+ enable,
631
+ disable,
632
+ render,
633
+ update,
634
+ init,
635
+ destroy
636
+ });
637
+ }
638
+
639
+ /* eslint no-underscore-dangle: "off" */
640
+ function Autoplay({
641
+ swiper,
642
+ extendParams,
643
+ on,
644
+ emit,
645
+ params
646
+ }) {
647
+ swiper.autoplay = {
648
+ running: false,
649
+ paused: false,
650
+ timeLeft: 0
651
+ };
652
+ extendParams({
653
+ autoplay: {
654
+ enabled: false,
655
+ delay: 3000,
656
+ waitForTransition: true,
657
+ disableOnInteraction: true,
658
+ stopOnLastSlide: false,
659
+ reverseDirection: false,
660
+ pauseOnMouseEnter: false
661
+ }
662
+ });
663
+ let timeout;
664
+ let raf;
665
+ let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
666
+ let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
667
+ let autoplayTimeLeft;
668
+ let autoplayStartTime = new Date().getTime;
669
+ let wasPaused;
670
+ let isTouched;
671
+ let pausedByTouch;
672
+ let touchStartTimeout;
673
+ let slideChanged;
674
+ let pausedByInteraction;
675
+ function onTransitionEnd(e) {
676
+ if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
677
+ if (e.target !== swiper.wrapperEl) return;
678
+ swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
679
+ resume();
680
+ }
681
+ const calcTimeLeft = () => {
682
+ if (swiper.destroyed || !swiper.autoplay.running) return;
683
+ if (swiper.autoplay.paused) {
684
+ wasPaused = true;
685
+ } else if (wasPaused) {
686
+ autoplayDelayCurrent = autoplayTimeLeft;
687
+ wasPaused = false;
688
+ }
689
+ const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime();
690
+ swiper.autoplay.timeLeft = timeLeft;
691
+ emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal);
692
+ raf = requestAnimationFrame(() => {
693
+ calcTimeLeft();
694
+ });
695
+ };
696
+ const getSlideDelay = () => {
697
+ let activeSlideEl;
698
+ if (swiper.virtual && swiper.params.virtual.enabled) {
699
+ activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];
700
+ } else {
701
+ activeSlideEl = swiper.slides[swiper.activeIndex];
702
+ }
703
+ if (!activeSlideEl) return undefined;
704
+ const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
705
+ return currentSlideDelay;
706
+ };
707
+ const run = delayForce => {
708
+ if (swiper.destroyed || !swiper.autoplay.running) return;
709
+ cancelAnimationFrame(raf);
710
+ calcTimeLeft();
711
+ let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;
712
+ autoplayDelayTotal = swiper.params.autoplay.delay;
713
+ autoplayDelayCurrent = swiper.params.autoplay.delay;
714
+ const currentSlideDelay = getSlideDelay();
715
+ if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {
716
+ delay = currentSlideDelay;
717
+ autoplayDelayTotal = currentSlideDelay;
718
+ autoplayDelayCurrent = currentSlideDelay;
719
+ }
720
+ autoplayTimeLeft = delay;
721
+ const speed = swiper.params.speed;
722
+ const proceed = () => {
723
+ if (!swiper || swiper.destroyed) return;
724
+ if (swiper.params.autoplay.reverseDirection) {
725
+ if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) {
726
+ swiper.slidePrev(speed, true, true);
727
+ emit('autoplay');
728
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
729
+ swiper.slideTo(swiper.slides.length - 1, speed, true, true);
730
+ emit('autoplay');
731
+ }
732
+ } else {
733
+ if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) {
734
+ swiper.slideNext(speed, true, true);
735
+ emit('autoplay');
736
+ } else if (!swiper.params.autoplay.stopOnLastSlide) {
737
+ swiper.slideTo(0, speed, true, true);
738
+ emit('autoplay');
739
+ }
740
+ }
741
+ if (swiper.params.cssMode) {
742
+ autoplayStartTime = new Date().getTime();
743
+ requestAnimationFrame(() => {
744
+ run();
745
+ });
746
+ }
747
+ };
748
+ if (delay > 0) {
749
+ clearTimeout(timeout);
750
+ timeout = setTimeout(() => {
751
+ proceed();
752
+ }, delay);
753
+ } else {
754
+ requestAnimationFrame(() => {
755
+ proceed();
756
+ });
757
+ }
758
+
759
+ // eslint-disable-next-line
760
+ return delay;
761
+ };
762
+ const start = () => {
763
+ swiper.autoplay.running = true;
764
+ run();
765
+ emit('autoplayStart');
766
+ };
767
+ const stop = () => {
768
+ swiper.autoplay.running = false;
769
+ clearTimeout(timeout);
770
+ cancelAnimationFrame(raf);
771
+ emit('autoplayStop');
772
+ };
773
+ const pause = (internal, reset) => {
774
+ if (swiper.destroyed || !swiper.autoplay.running) return;
775
+ clearTimeout(timeout);
776
+ if (!internal) {
777
+ pausedByInteraction = true;
778
+ }
779
+ const proceed = () => {
780
+ emit('autoplayPause');
781
+ if (swiper.params.autoplay.waitForTransition) {
782
+ swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd);
783
+ } else {
784
+ resume();
785
+ }
786
+ };
787
+ swiper.autoplay.paused = true;
788
+ if (reset) {
789
+ if (slideChanged) {
790
+ autoplayTimeLeft = swiper.params.autoplay.delay;
791
+ }
792
+ slideChanged = false;
793
+ proceed();
794
+ return;
795
+ }
796
+ const delay = autoplayTimeLeft || swiper.params.autoplay.delay;
797
+ autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime);
798
+ if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return;
799
+ if (autoplayTimeLeft < 0) autoplayTimeLeft = 0;
800
+ proceed();
801
+ };
802
+ const resume = () => {
803
+ if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return;
804
+ autoplayStartTime = new Date().getTime();
805
+ if (pausedByInteraction) {
806
+ pausedByInteraction = false;
807
+ run(autoplayTimeLeft);
808
+ } else {
809
+ run();
810
+ }
811
+ swiper.autoplay.paused = false;
812
+ emit('autoplayResume');
813
+ };
814
+ const onVisibilityChange = () => {
815
+ if (swiper.destroyed || !swiper.autoplay.running) return;
816
+ const document = getDocument();
817
+ if (document.visibilityState === 'hidden') {
818
+ pausedByInteraction = true;
819
+ pause(true);
820
+ }
821
+ if (document.visibilityState === 'visible') {
822
+ resume();
823
+ }
824
+ };
825
+ const onPointerEnter = e => {
826
+ if (e.pointerType !== 'mouse') return;
827
+ pausedByInteraction = true;
828
+ pause(true);
829
+ };
830
+ const onPointerLeave = e => {
831
+ if (e.pointerType !== 'mouse') return;
832
+ if (swiper.autoplay.paused) {
833
+ resume();
834
+ }
835
+ };
836
+ const attachMouseEvents = () => {
837
+ if (swiper.params.autoplay.pauseOnMouseEnter) {
838
+ swiper.el.addEventListener('pointerenter', onPointerEnter);
839
+ swiper.el.addEventListener('pointerleave', onPointerLeave);
840
+ }
841
+ };
842
+ const detachMouseEvents = () => {
843
+ swiper.el.removeEventListener('pointerenter', onPointerEnter);
844
+ swiper.el.removeEventListener('pointerleave', onPointerLeave);
845
+ };
846
+ const attachDocumentEvents = () => {
847
+ const document = getDocument();
848
+ document.addEventListener('visibilitychange', onVisibilityChange);
849
+ };
850
+ const detachDocumentEvents = () => {
851
+ const document = getDocument();
852
+ document.removeEventListener('visibilitychange', onVisibilityChange);
853
+ };
854
+ on('init', () => {
855
+ if (swiper.params.autoplay.enabled) {
856
+ attachMouseEvents();
857
+ attachDocumentEvents();
858
+ autoplayStartTime = new Date().getTime();
859
+ start();
860
+ }
861
+ });
862
+ on('destroy', () => {
863
+ detachMouseEvents();
864
+ detachDocumentEvents();
865
+ if (swiper.autoplay.running) {
866
+ stop();
867
+ }
868
+ });
869
+ on('beforeTransitionStart', (_s, speed, internal) => {
870
+ if (swiper.destroyed || !swiper.autoplay.running) return;
871
+ if (internal || !swiper.params.autoplay.disableOnInteraction) {
872
+ pause(true, true);
873
+ } else {
874
+ stop();
875
+ }
876
+ });
877
+ on('sliderFirstMove', () => {
878
+ if (swiper.destroyed || !swiper.autoplay.running) return;
879
+ if (swiper.params.autoplay.disableOnInteraction) {
880
+ stop();
881
+ return;
882
+ }
883
+ isTouched = true;
884
+ pausedByTouch = false;
885
+ pausedByInteraction = false;
886
+ touchStartTimeout = setTimeout(() => {
887
+ pausedByInteraction = true;
888
+ pausedByTouch = true;
889
+ pause(true);
890
+ }, 200);
891
+ });
892
+ on('touchEnd', () => {
893
+ if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return;
894
+ clearTimeout(touchStartTimeout);
895
+ clearTimeout(timeout);
896
+ if (swiper.params.autoplay.disableOnInteraction) {
897
+ pausedByTouch = false;
898
+ isTouched = false;
899
+ return;
900
+ }
901
+ if (pausedByTouch && swiper.params.cssMode) resume();
902
+ pausedByTouch = false;
903
+ isTouched = false;
904
+ });
905
+ on('slideChange', () => {
906
+ if (swiper.destroyed || !swiper.autoplay.running) return;
907
+ slideChanged = true;
908
+ });
909
+ Object.assign(swiper.autoplay, {
910
+ start,
911
+ stop,
912
+ pause,
913
+ resume
914
+ });
915
+ }
916
+
917
+ function Thumb({
918
+ swiper,
919
+ extendParams,
920
+ on
921
+ }) {
922
+ extendParams({
923
+ thumbs: {
924
+ swiper: null,
925
+ multipleActiveThumbs: true,
926
+ autoScrollOffset: 0,
927
+ slideThumbActiveClass: 'swiper-slide-thumb-active',
928
+ thumbsContainerClass: 'swiper-thumbs'
929
+ }
930
+ });
931
+ let initialized = false;
932
+ let swiperCreated = false;
933
+ swiper.thumbs = {
934
+ swiper: null
935
+ };
936
+ function onThumbClick() {
937
+ const thumbsSwiper = swiper.thumbs.swiper;
938
+ if (!thumbsSwiper || thumbsSwiper.destroyed) return;
939
+ const clickedIndex = thumbsSwiper.clickedIndex;
940
+ const clickedSlide = thumbsSwiper.clickedSlide;
941
+ if (clickedSlide && clickedSlide.classList.contains(swiper.params.thumbs.slideThumbActiveClass)) return;
942
+ if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;
943
+ let slideToIndex;
944
+ if (thumbsSwiper.params.loop) {
945
+ slideToIndex = parseInt(thumbsSwiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
946
+ } else {
947
+ slideToIndex = clickedIndex;
948
+ }
949
+ if (swiper.params.loop) {
950
+ swiper.slideToLoop(slideToIndex);
951
+ } else {
952
+ swiper.slideTo(slideToIndex);
953
+ }
954
+ }
955
+ function init() {
956
+ const {
957
+ thumbs: thumbsParams
958
+ } = swiper.params;
959
+ if (initialized) return false;
960
+ initialized = true;
961
+ const SwiperClass = swiper.constructor;
962
+ if (thumbsParams.swiper instanceof SwiperClass) {
963
+ swiper.thumbs.swiper = thumbsParams.swiper;
964
+ Object.assign(swiper.thumbs.swiper.originalParams, {
965
+ watchSlidesProgress: true,
966
+ slideToClickedSlide: false
967
+ });
968
+ Object.assign(swiper.thumbs.swiper.params, {
969
+ watchSlidesProgress: true,
970
+ slideToClickedSlide: false
971
+ });
972
+ swiper.thumbs.swiper.update();
973
+ } else if (isObject(thumbsParams.swiper)) {
974
+ const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper);
975
+ Object.assign(thumbsSwiperParams, {
976
+ watchSlidesProgress: true,
977
+ slideToClickedSlide: false
978
+ });
979
+ swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams);
980
+ swiperCreated = true;
981
+ }
982
+ swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
983
+ swiper.thumbs.swiper.on('tap', onThumbClick);
984
+ return true;
985
+ }
986
+ function update(initial) {
987
+ const thumbsSwiper = swiper.thumbs.swiper;
988
+ if (!thumbsSwiper || thumbsSwiper.destroyed) return;
989
+ const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
990
+
991
+ // Activate thumbs
992
+ let thumbsToActivate = 1;
993
+ const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
994
+ if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
995
+ thumbsToActivate = swiper.params.slidesPerView;
996
+ }
997
+ if (!swiper.params.thumbs.multipleActiveThumbs) {
998
+ thumbsToActivate = 1;
999
+ }
1000
+ thumbsToActivate = Math.floor(thumbsToActivate);
1001
+ thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
1002
+ if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
1003
+ for (let i = 0; i < thumbsToActivate; i += 1) {
1004
+ elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
1005
+ slideEl.classList.add(thumbActiveClass);
1006
+ });
1007
+ }
1008
+ } else {
1009
+ for (let i = 0; i < thumbsToActivate; i += 1) {
1010
+ if (thumbsSwiper.slides[swiper.realIndex + i]) {
1011
+ thumbsSwiper.slides[swiper.realIndex + i].classList.add(thumbActiveClass);
1012
+ }
1013
+ }
1014
+ }
1015
+ const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
1016
+ const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
1017
+ if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
1018
+ const currentThumbsIndex = thumbsSwiper.activeIndex;
1019
+ let newThumbsIndex;
1020
+ let direction;
1021
+ if (thumbsSwiper.params.loop) {
1022
+ const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0];
1023
+ newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
1024
+ direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
1025
+ } else {
1026
+ newThumbsIndex = swiper.realIndex;
1027
+ direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';
1028
+ }
1029
+ if (useOffset) {
1030
+ newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;
1031
+ }
1032
+ if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
1033
+ if (thumbsSwiper.params.centeredSlides) {
1034
+ if (newThumbsIndex > currentThumbsIndex) {
1035
+ newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
1036
+ } else {
1037
+ newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
1038
+ }
1039
+ }
1040
+ thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
1041
+ }
1042
+ }
1043
+ }
1044
+ on('beforeInit', () => {
1045
+ const {
1046
+ thumbs
1047
+ } = swiper.params;
1048
+ if (!thumbs || !thumbs.swiper) return;
1049
+ if (typeof thumbs.swiper === 'string' || thumbs.swiper instanceof HTMLElement) {
1050
+ const document = getDocument();
1051
+ const getThumbsElementAndInit = () => {
1052
+ const thumbsElement = typeof thumbs.swiper === 'string' ? document.querySelector(thumbs.swiper) : thumbs.swiper;
1053
+ if (thumbsElement && thumbsElement.swiper) {
1054
+ thumbs.swiper = thumbsElement.swiper;
1055
+ init();
1056
+ update(true);
1057
+ } else if (thumbsElement) {
1058
+ const onThumbsSwiper = e => {
1059
+ thumbs.swiper = e.detail[0];
1060
+ thumbsElement.removeEventListener('init', onThumbsSwiper);
1061
+ init();
1062
+ update(true);
1063
+ thumbs.swiper.update();
1064
+ swiper.update();
1065
+ };
1066
+ thumbsElement.addEventListener('init', onThumbsSwiper);
1067
+ }
1068
+ return thumbsElement;
1069
+ };
1070
+ const watchForThumbsToAppear = () => {
1071
+ if (swiper.destroyed) return;
1072
+ const thumbsElement = getThumbsElementAndInit();
1073
+ if (!thumbsElement) {
1074
+ requestAnimationFrame(watchForThumbsToAppear);
1075
+ }
1076
+ };
1077
+ requestAnimationFrame(watchForThumbsToAppear);
1078
+ } else {
1079
+ init();
1080
+ update(true);
1081
+ }
1082
+ });
1083
+ on('slideChange update resize observerUpdate', () => {
1084
+ update();
1085
+ });
1086
+ on('setTransition', (_s, duration) => {
1087
+ const thumbsSwiper = swiper.thumbs.swiper;
1088
+ if (!thumbsSwiper || thumbsSwiper.destroyed) return;
1089
+ thumbsSwiper.setTransition(duration);
1090
+ });
1091
+ on('beforeDestroy', () => {
1092
+ const thumbsSwiper = swiper.thumbs.swiper;
1093
+ if (!thumbsSwiper || thumbsSwiper.destroyed) return;
1094
+ if (swiperCreated) {
1095
+ thumbsSwiper.destroy();
1096
+ }
1097
+ });
1098
+ Object.assign(swiper.thumbs, {
1099
+ init,
1100
+ update
1101
+ });
1102
+ }
1103
+
1104
+ function freeMode({
1105
+ swiper,
1106
+ extendParams,
1107
+ emit,
1108
+ once
1109
+ }) {
1110
+ extendParams({
1111
+ freeMode: {
1112
+ enabled: false,
1113
+ momentum: true,
1114
+ momentumRatio: 1,
1115
+ momentumBounce: true,
1116
+ momentumBounceRatio: 1,
1117
+ momentumVelocityRatio: 1,
1118
+ sticky: false,
1119
+ minimumVelocity: 0.02
1120
+ }
1121
+ });
1122
+ function onTouchStart() {
1123
+ const translate = swiper.getTranslate();
1124
+ swiper.setTranslate(translate);
1125
+ swiper.setTransition(0);
1126
+ swiper.touchEventsData.velocities.length = 0;
1127
+ swiper.freeMode.onTouchEnd({
1128
+ currentPos: swiper.rtl ? swiper.translate : -swiper.translate
1129
+ });
1130
+ }
1131
+ function onTouchMove() {
1132
+ const {
1133
+ touchEventsData: data,
1134
+ touches
1135
+ } = swiper;
1136
+ // Velocity
1137
+ if (data.velocities.length === 0) {
1138
+ data.velocities.push({
1139
+ position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
1140
+ time: data.touchStartTime
1141
+ });
1142
+ }
1143
+ data.velocities.push({
1144
+ position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
1145
+ time: now()
1146
+ });
1147
+ }
1148
+ function onTouchEnd({
1149
+ currentPos
1150
+ }) {
1151
+ const {
1152
+ params,
1153
+ wrapperEl,
1154
+ rtlTranslate: rtl,
1155
+ snapGrid,
1156
+ touchEventsData: data
1157
+ } = swiper;
1158
+ // Time diff
1159
+ const touchEndTime = now();
1160
+ const timeDiff = touchEndTime - data.touchStartTime;
1161
+ if (currentPos < -swiper.minTranslate()) {
1162
+ swiper.slideTo(swiper.activeIndex);
1163
+ return;
1164
+ }
1165
+ if (currentPos > -swiper.maxTranslate()) {
1166
+ if (swiper.slides.length < snapGrid.length) {
1167
+ swiper.slideTo(snapGrid.length - 1);
1168
+ } else {
1169
+ swiper.slideTo(swiper.slides.length - 1);
1170
+ }
1171
+ return;
1172
+ }
1173
+ if (params.freeMode.momentum) {
1174
+ if (data.velocities.length > 1) {
1175
+ const lastMoveEvent = data.velocities.pop();
1176
+ const velocityEvent = data.velocities.pop();
1177
+ const distance = lastMoveEvent.position - velocityEvent.position;
1178
+ const time = lastMoveEvent.time - velocityEvent.time;
1179
+ swiper.velocity = distance / time;
1180
+ swiper.velocity /= 2;
1181
+ if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {
1182
+ swiper.velocity = 0;
1183
+ }
1184
+ // this implies that the user stopped moving a finger then released.
1185
+ // There would be no events with distance zero, so the last event is stale.
1186
+ if (time > 150 || now() - lastMoveEvent.time > 300) {
1187
+ swiper.velocity = 0;
1188
+ }
1189
+ } else {
1190
+ swiper.velocity = 0;
1191
+ }
1192
+ swiper.velocity *= params.freeMode.momentumVelocityRatio;
1193
+ data.velocities.length = 0;
1194
+ let momentumDuration = 1000 * params.freeMode.momentumRatio;
1195
+ const momentumDistance = swiper.velocity * momentumDuration;
1196
+ let newPosition = swiper.translate + momentumDistance;
1197
+ if (rtl) newPosition = -newPosition;
1198
+ let doBounce = false;
1199
+ let afterBouncePosition;
1200
+ const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;
1201
+ let needsLoopFix;
1202
+ if (newPosition < swiper.maxTranslate()) {
1203
+ if (params.freeMode.momentumBounce) {
1204
+ if (newPosition + swiper.maxTranslate() < -bounceAmount) {
1205
+ newPosition = swiper.maxTranslate() - bounceAmount;
1206
+ }
1207
+ afterBouncePosition = swiper.maxTranslate();
1208
+ doBounce = true;
1209
+ data.allowMomentumBounce = true;
1210
+ } else {
1211
+ newPosition = swiper.maxTranslate();
1212
+ }
1213
+ if (params.loop && params.centeredSlides) needsLoopFix = true;
1214
+ } else if (newPosition > swiper.minTranslate()) {
1215
+ if (params.freeMode.momentumBounce) {
1216
+ if (newPosition - swiper.minTranslate() > bounceAmount) {
1217
+ newPosition = swiper.minTranslate() + bounceAmount;
1218
+ }
1219
+ afterBouncePosition = swiper.minTranslate();
1220
+ doBounce = true;
1221
+ data.allowMomentumBounce = true;
1222
+ } else {
1223
+ newPosition = swiper.minTranslate();
1224
+ }
1225
+ if (params.loop && params.centeredSlides) needsLoopFix = true;
1226
+ } else if (params.freeMode.sticky) {
1227
+ let nextSlide;
1228
+ for (let j = 0; j < snapGrid.length; j += 1) {
1229
+ if (snapGrid[j] > -newPosition) {
1230
+ nextSlide = j;
1231
+ break;
1232
+ }
1233
+ }
1234
+ if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
1235
+ newPosition = snapGrid[nextSlide];
1236
+ } else {
1237
+ newPosition = snapGrid[nextSlide - 1];
1238
+ }
1239
+ newPosition = -newPosition;
1240
+ }
1241
+ if (needsLoopFix) {
1242
+ once('transitionEnd', () => {
1243
+ swiper.loopFix();
1244
+ });
1245
+ }
1246
+ // Fix duration
1247
+ if (swiper.velocity !== 0) {
1248
+ if (rtl) {
1249
+ momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
1250
+ } else {
1251
+ momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
1252
+ }
1253
+ if (params.freeMode.sticky) {
1254
+ // If freeMode.sticky is active and the user ends a swipe with a slow-velocity
1255
+ // event, then durations can be 20+ seconds to slide one (or zero!) slides.
1256
+ // It's easy to see this when simulating touch with mouse events. To fix this,
1257
+ // limit single-slide swipes to the default slide duration. This also has the
1258
+ // nice side effect of matching slide speed if the user stopped moving before
1259
+ // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
1260
+ // For faster swipes, also apply limits (albeit higher ones).
1261
+ const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
1262
+ const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
1263
+ if (moveDistance < currentSlideSize) {
1264
+ momentumDuration = params.speed;
1265
+ } else if (moveDistance < 2 * currentSlideSize) {
1266
+ momentumDuration = params.speed * 1.5;
1267
+ } else {
1268
+ momentumDuration = params.speed * 2.5;
1269
+ }
1270
+ }
1271
+ } else if (params.freeMode.sticky) {
1272
+ swiper.slideToClosest();
1273
+ return;
1274
+ }
1275
+ if (params.freeMode.momentumBounce && doBounce) {
1276
+ swiper.updateProgress(afterBouncePosition);
1277
+ swiper.setTransition(momentumDuration);
1278
+ swiper.setTranslate(newPosition);
1279
+ swiper.transitionStart(true, swiper.swipeDirection);
1280
+ swiper.animating = true;
1281
+ elementTransitionEnd(wrapperEl, () => {
1282
+ if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
1283
+ emit('momentumBounce');
1284
+ swiper.setTransition(params.speed);
1285
+ setTimeout(() => {
1286
+ swiper.setTranslate(afterBouncePosition);
1287
+ elementTransitionEnd(wrapperEl, () => {
1288
+ if (!swiper || swiper.destroyed) return;
1289
+ swiper.transitionEnd();
1290
+ });
1291
+ }, 0);
1292
+ });
1293
+ } else if (swiper.velocity) {
1294
+ emit('_freeModeNoMomentumRelease');
1295
+ swiper.updateProgress(newPosition);
1296
+ swiper.setTransition(momentumDuration);
1297
+ swiper.setTranslate(newPosition);
1298
+ swiper.transitionStart(true, swiper.swipeDirection);
1299
+ if (!swiper.animating) {
1300
+ swiper.animating = true;
1301
+ elementTransitionEnd(wrapperEl, () => {
1302
+ if (!swiper || swiper.destroyed) return;
1303
+ swiper.transitionEnd();
1304
+ });
1305
+ }
1306
+ } else {
1307
+ swiper.updateProgress(newPosition);
1308
+ }
1309
+ swiper.updateActiveIndex();
1310
+ swiper.updateSlidesClasses();
1311
+ } else if (params.freeMode.sticky) {
1312
+ swiper.slideToClosest();
1313
+ return;
1314
+ } else if (params.freeMode) {
1315
+ emit('_freeModeNoMomentumRelease');
1316
+ }
1317
+ if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {
1318
+ swiper.updateProgress();
1319
+ swiper.updateActiveIndex();
1320
+ swiper.updateSlidesClasses();
1321
+ }
1322
+ }
1323
+ Object.assign(swiper, {
1324
+ freeMode: {
1325
+ onTouchStart,
1326
+ onTouchMove,
1327
+ onTouchEnd
1328
+ }
1329
+ });
1330
+ }
1331
+
1332
+ function Grid({
1333
+ swiper,
1334
+ extendParams
1335
+ }) {
1336
+ extendParams({
1337
+ grid: {
1338
+ rows: 1,
1339
+ fill: 'column'
1340
+ }
1341
+ });
1342
+ let slidesNumberEvenToRows;
1343
+ let slidesPerRow;
1344
+ let numFullColumns;
1345
+ const initSlides = slidesLength => {
1346
+ const {
1347
+ slidesPerView
1348
+ } = swiper.params;
1349
+ const {
1350
+ rows,
1351
+ fill
1352
+ } = swiper.params.grid;
1353
+ slidesPerRow = slidesNumberEvenToRows / rows;
1354
+ numFullColumns = Math.floor(slidesLength / rows);
1355
+ if (Math.floor(slidesLength / rows) === slidesLength / rows) {
1356
+ slidesNumberEvenToRows = slidesLength;
1357
+ } else {
1358
+ slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows;
1359
+ }
1360
+ if (slidesPerView !== 'auto' && fill === 'row') {
1361
+ slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows);
1362
+ }
1363
+ };
1364
+ const updateSlide = (i, slide, slidesLength, getDirectionLabel) => {
1365
+ const {
1366
+ slidesPerGroup,
1367
+ spaceBetween
1368
+ } = swiper.params;
1369
+ const {
1370
+ rows,
1371
+ fill
1372
+ } = swiper.params.grid;
1373
+ // Set slides order
1374
+ let newSlideOrderIndex;
1375
+ let column;
1376
+ let row;
1377
+ if (fill === 'row' && slidesPerGroup > 1) {
1378
+ const groupIndex = Math.floor(i / (slidesPerGroup * rows));
1379
+ const slideIndexInGroup = i - rows * slidesPerGroup * groupIndex;
1380
+ const columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup);
1381
+ row = Math.floor(slideIndexInGroup / columnsInGroup);
1382
+ column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup;
1383
+ newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows;
1384
+ slide.style.order = newSlideOrderIndex;
1385
+ } else if (fill === 'column') {
1386
+ column = Math.floor(i / rows);
1387
+ row = i - column * rows;
1388
+ if (column > numFullColumns || column === numFullColumns && row === rows - 1) {
1389
+ row += 1;
1390
+ if (row >= rows) {
1391
+ row = 0;
1392
+ column += 1;
1393
+ }
1394
+ }
1395
+ } else {
1396
+ row = Math.floor(i / slidesPerRow);
1397
+ column = i - row * slidesPerRow;
1398
+ }
1399
+ slide.style[getDirectionLabel('margin-top')] = row !== 0 ? spaceBetween && `${spaceBetween}px` : '';
1400
+ };
1401
+ const updateWrapperSize = (slideSize, snapGrid, getDirectionLabel) => {
1402
+ const {
1403
+ spaceBetween,
1404
+ centeredSlides,
1405
+ roundLengths
1406
+ } = swiper.params;
1407
+ const {
1408
+ rows
1409
+ } = swiper.params.grid;
1410
+ swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows;
1411
+ swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween;
1412
+ swiper.wrapperEl.style[getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;
1413
+ if (centeredSlides) {
1414
+ const newSlidesGrid = [];
1415
+ for (let i = 0; i < snapGrid.length; i += 1) {
1416
+ let slidesGridItem = snapGrid[i];
1417
+ if (roundLengths) slidesGridItem = Math.floor(slidesGridItem);
1418
+ if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);
1419
+ }
1420
+ snapGrid.splice(0, snapGrid.length);
1421
+ snapGrid.push(...newSlidesGrid);
1422
+ }
1423
+ };
1424
+ swiper.grid = {
1425
+ initSlides,
1426
+ updateSlide,
1427
+ updateWrapperSize
1428
+ };
1429
+ }
1430
+
1431
+ function effectInit(params) {
1432
+ const {
1433
+ effect,
1434
+ swiper,
1435
+ on,
1436
+ setTranslate,
1437
+ setTransition,
1438
+ overwriteParams,
1439
+ perspective,
1440
+ recreateShadows,
1441
+ getEffectParams
1442
+ } = params;
1443
+ on('beforeInit', () => {
1444
+ if (swiper.params.effect !== effect) return;
1445
+ swiper.classNames.push(`${swiper.params.containerModifierClass}${effect}`);
1446
+ if (perspective && perspective()) {
1447
+ swiper.classNames.push(`${swiper.params.containerModifierClass}3d`);
1448
+ }
1449
+ const overwriteParamsResult = overwriteParams ? overwriteParams() : {};
1450
+ Object.assign(swiper.params, overwriteParamsResult);
1451
+ Object.assign(swiper.originalParams, overwriteParamsResult);
1452
+ });
1453
+ on('setTranslate', () => {
1454
+ if (swiper.params.effect !== effect) return;
1455
+ setTranslate();
1456
+ });
1457
+ on('setTransition', (_s, duration) => {
1458
+ if (swiper.params.effect !== effect) return;
1459
+ setTransition(duration);
1460
+ });
1461
+ on('transitionEnd', () => {
1462
+ if (swiper.params.effect !== effect) return;
1463
+ if (recreateShadows) {
1464
+ if (!getEffectParams || !getEffectParams().slideShadows) return;
1465
+ // remove shadows
1466
+ swiper.slides.forEach(slideEl => {
1467
+ slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => shadowEl.remove());
1468
+ });
1469
+ // create new one
1470
+ recreateShadows();
1471
+ }
1472
+ });
1473
+ let requireUpdateOnVirtual;
1474
+ on('virtualUpdate', () => {
1475
+ if (swiper.params.effect !== effect) return;
1476
+ if (!swiper.slides.length) {
1477
+ requireUpdateOnVirtual = true;
1478
+ }
1479
+ requestAnimationFrame(() => {
1480
+ if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) {
1481
+ setTranslate();
1482
+ requireUpdateOnVirtual = false;
1483
+ }
1484
+ });
1485
+ });
1486
+ }
1487
+
1488
+ function effectTarget(effectParams, slideEl) {
1489
+ const transformEl = getSlideTransformEl(slideEl);
1490
+ if (transformEl !== slideEl) {
1491
+ transformEl.style.backfaceVisibility = 'hidden';
1492
+ transformEl.style['-webkit-backface-visibility'] = 'hidden';
1493
+ }
1494
+ return transformEl;
1495
+ }
1496
+
1497
+ function effectVirtualTransitionEnd({
1498
+ swiper,
1499
+ duration,
1500
+ transformElements,
1501
+ allSlides
1502
+ }) {
1503
+ const {
1504
+ activeIndex
1505
+ } = swiper;
1506
+ const getSlide = el => {
1507
+ if (!el.parentElement) {
1508
+ // assume shadow root
1509
+ const slide = swiper.slides.filter(slideEl => slideEl.shadowEl && slideEl.shadowEl === el.parentNode)[0];
1510
+ return slide;
1511
+ }
1512
+ return el.parentElement;
1513
+ };
1514
+ if (swiper.params.virtualTranslate && duration !== 0) {
1515
+ let eventTriggered = false;
1516
+ let transitionEndTarget;
1517
+ if (allSlides) {
1518
+ transitionEndTarget = transformElements;
1519
+ } else {
1520
+ transitionEndTarget = transformElements.filter(transformEl => {
1521
+ const el = transformEl.classList.contains('swiper-slide-transform') ? getSlide(transformEl) : transformEl;
1522
+ return swiper.getSlideIndex(el) === activeIndex;
1523
+ });
1524
+ }
1525
+ transitionEndTarget.forEach(el => {
1526
+ elementTransitionEnd(el, () => {
1527
+ if (eventTriggered) return;
1528
+ if (!swiper || swiper.destroyed) return;
1529
+ eventTriggered = true;
1530
+ swiper.animating = false;
1531
+ const evt = new window.CustomEvent('transitionend', {
1532
+ bubbles: true,
1533
+ cancelable: true
1534
+ });
1535
+ swiper.wrapperEl.dispatchEvent(evt);
1536
+ });
1537
+ });
1538
+ }
1539
+ }
1540
+
1541
+ function EffectFade({
1542
+ swiper,
1543
+ extendParams,
1544
+ on
1545
+ }) {
1546
+ extendParams({
1547
+ fadeEffect: {
1548
+ crossFade: false
1549
+ }
1550
+ });
1551
+ const setTranslate = () => {
1552
+ const {
1553
+ slides
1554
+ } = swiper;
1555
+ const params = swiper.params.fadeEffect;
1556
+ for (let i = 0; i < slides.length; i += 1) {
1557
+ const slideEl = swiper.slides[i];
1558
+ const offset = slideEl.swiperSlideOffset;
1559
+ let tx = -offset;
1560
+ if (!swiper.params.virtualTranslate) tx -= swiper.translate;
1561
+ let ty = 0;
1562
+ if (!swiper.isHorizontal()) {
1563
+ ty = tx;
1564
+ tx = 0;
1565
+ }
1566
+ const slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(slideEl.progress), 0) : 1 + Math.min(Math.max(slideEl.progress, -1), 0);
1567
+ const targetEl = effectTarget(params, slideEl);
1568
+ targetEl.style.opacity = slideOpacity;
1569
+ targetEl.style.transform = `translate3d(${tx}px, ${ty}px, 0px)`;
1570
+ }
1571
+ };
1572
+ const setTransition = duration => {
1573
+ const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
1574
+ transformElements.forEach(el => {
1575
+ el.style.transitionDuration = `${duration}ms`;
1576
+ });
1577
+ effectVirtualTransitionEnd({
1578
+ swiper,
1579
+ duration,
1580
+ transformElements,
1581
+ allSlides: true
1582
+ });
1583
+ };
1584
+ effectInit({
1585
+ effect: 'fade',
1586
+ swiper,
1587
+ on,
1588
+ setTranslate,
1589
+ setTransition,
1590
+ overwriteParams: () => ({
1591
+ slidesPerView: 1,
1592
+ slidesPerGroup: 1,
1593
+ watchSlidesProgress: true,
1594
+ spaceBetween: 0,
1595
+ virtualTranslate: !swiper.params.cssMode
1596
+ })
1597
+ });
1598
+ }
1599
+
1600
+ const ptcCaseStudiesSliderCss = "@font-face{font-family:'swiper-icons';src:url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff;}.swiper,swiper-container{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{transform:translate3d(0px, 0, 0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide,swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform, height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:'';flex-shrink:0;order:9999}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,swiper-container:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@keyframes swiper-preloader-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.swiper-virtual .swiper-slide{-webkit-backface-visibility:hidden;transform:translateZ(0)}.swiper-virtual.swiper-css-mode .swiper-wrapper::after{content:'';position:absolute;left:0;top:0;pointer-events:none}.swiper-virtual.swiper-css-mode.swiper-horizontal .swiper-wrapper::after{height:1px;width:var(--swiper-virtual-size)}.swiper-virtual.swiper-css-mode.swiper-vertical .swiper-wrapper::after{width:1px;height:var(--swiper-virtual-size)}:root{--swiper-navigation-size:44px;}.swiper-button-prev,.swiper-button-next{position:absolute;top:var(--swiper-navigation-top-offset, 50%);width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size) / 2));z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none !important}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none !important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:var(--swiper-navigation-sides-offset, 10px);right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:'prev'}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:var(--swiper-navigation-sides-offset, 10px);left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:'next'}.swiper-button-lock{display:none}:root{}.swiper-pagination{position:absolute;text-align:center;transition:300ms opacity;transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none !important}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal{bottom:var(--swiper-pagination-bottom, 8px);top:var(--swiper-pagination-top, auto);left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(0.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));height:var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));display:inline-block;border-radius:var(--swiper-pagination-bullet-border-radius, 50%);background:var(--swiper-pagination-bullet-inactive-color, #000);opacity:var(--swiper-pagination-bullet-inactive-opacity, 0.2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-webkit-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none !important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color, var(--swiper-theme-color))}.swiper-vertical>.swiper-pagination-bullets,.swiper-pagination-vertical.swiper-pagination-bullets{right:var(--swiper-pagination-right, 8px);left:var(--swiper-pagination-left, auto);top:50%;transform:translate3d(0px, -50%, 0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap, 6px) 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:200ms transform, 200ms top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap, 4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:200ms transform, 200ms left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,:host(.swiper-horizontal.swiper-rtl) .swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:200ms transform, 200ms right}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color, inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color, rgba(0, 0, 0, 0.25));position:absolute;}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color, var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite{width:100%;height:var(--swiper-pagination-progressbar-size, 4px);left:0;top:0}.swiper-vertical>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite{width:var(--swiper-pagination-progressbar-size, 4px);height:100%;left:0;top:0}.swiper-pagination-lock{display:none}:root{}.swiper-scrollbar{border-radius:var(--swiper-scrollbar-border-radius, 10px);position:relative;-ms-touch-action:none;background:var(--swiper-scrollbar-bg-color, rgba(0, 0, 0, 0.1))}.swiper-scrollbar-disabled>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-disabled{display:none !important}.swiper-horizontal>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-horizontal{position:absolute;left:var(--swiper-scrollbar-sides-offset, 1%);bottom:var(--swiper-scrollbar-bottom, 4px);top:var(--swiper-scrollbar-top, auto);z-index:50;height:var(--swiper-scrollbar-size, 4px);width:calc(100% - 2 * var(--swiper-scrollbar-sides-offset, 1%))}.swiper-vertical>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-vertical{position:absolute;left:var(--swiper-scrollbar-left, auto);right:var(--swiper-scrollbar-right, 4px);top:var(--swiper-scrollbar-sides-offset, 1%);z-index:50;width:var(--swiper-scrollbar-size, 4px);height:calc(100% - 2 * var(--swiper-scrollbar-sides-offset, 1%))}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:var(--swiper-scrollbar-drag-bg-color, rgba(0, 0, 0, 0.5));border-radius:var(--swiper-scrollbar-border-radius, 10px);left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center;text-align:center}.swiper-zoom-container>img,.swiper-zoom-container>svg,.swiper-zoom-container>canvas{max-width:100%;max-height:100%;object-fit:contain}.swiper-slide-zoomed{cursor:move;touch-action:none}.swiper .swiper-notification,swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-free-mode>.swiper-wrapper{transition-timing-function:ease-out;margin:0 auto}.swiper-grid>.swiper-wrapper{flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{flex-wrap:wrap;flex-direction:column}.swiper-fade.swiper-free-mode .swiper-slide{transition-timing-function:ease-out}.swiper-fade .swiper-slide{pointer-events:none;transition-property:opacity}.swiper-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-fade .swiper-slide-active,.swiper-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube{overflow:visible}.swiper-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;transform-origin:0 0;width:100%;height:100%}.swiper-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-cube.swiper-rtl .swiper-slide{transform-origin:100% 0}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-next,.swiper-cube .swiper-slide-prev,.swiper-cube .swiper-slide-next+.swiper-slide{pointer-events:auto;visibility:visible}.swiper-cube .swiper-slide-shadow-top,.swiper-cube .swiper-slide-shadow-bottom,.swiper-cube .swiper-slide-shadow-left,.swiper-cube .swiper-slide-shadow-right{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;opacity:0.6;z-index:0}.swiper-cube .swiper-cube-shadow:before{content:'';background:#000;position:absolute;left:0;top:0;bottom:0;right:0;filter:blur(50px)}.swiper-flip{overflow:visible}.swiper-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-flip .swiper-slide-active,.swiper-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-flip .swiper-slide-shadow-top,.swiper-flip .swiper-slide-shadow-bottom,.swiper-flip .swiper-slide-shadow-left,.swiper-flip .swiper-slide-shadow-right{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-creative .swiper-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transition-property:transform, opacity, height}.swiper-cards{overflow:visible}.swiper-cards .swiper-slide{transform-origin:center bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden}:host{display:block;overflow:hidden}:host *{box-sizing:border-box}:host .hide{display:none}:host .case-studies-slides{height:80%;width:100%;padding-bottom:20px;position:relative}@media only screen and (min-width: 768px){:host .case-studies-slides{padding-bottom:0px}}:host .case-studies-slides .swiper-slide{visibility:hidden;display:flex;justify-content:center;align-items:center;padding-bottom:30px}:host .case-studies-slides .swiper-slide.swiper-slide-prev{visibility:hidden}:host .case-studies-slides .swiper-slide.swiper-slide-visible{visibility:visible}:host .case-studies-slides ptc-text-copy-with-background ptc-title .sc-ptc-title-s .sc-ptc-title-s::before,:host .case-studies-slides ptc-text-copy-with-background ptc-title .sc-ptc-title-s .sc-ptc-title-s::after{display:none}:host .case-studies-thumbs{height:20%;box-sizing:border-box;padding:10px 0;background-color:transparent}@media only screen and (min-width: 992px){:host .case-studies-thumbs{display:flex;justify-content:center}}@media only screen and (min-width: 992px){:host .case-studies-thumbs .swiper-wrapper{transform:none !important;justify-content:center}}:host .case-studies-thumbs .swiper-slide{width:auto;height:auto;max-width:8.75rem;opacity:0.4;display:flex;justify-items:center;align-items:center;padding:0 10px}@media only screen and (min-width: 992px){:host .case-studies-thumbs .swiper-slide{max-width:12.5rem}}:host .case-studies-thumbs .swiper-slide img{display:block;width:100%}@-moz-document url-prefix(){:host .case-studies-thumbs .swiper-slide img{min-width:140px}}:host .case-studies-thumbs .swiper-slide::after{content:\"\";height:7.5px;width:100%;position:absolute;bottom:-10px;left:0}:host .case-studies-thumbs .swiper-slide.swiper-slide-thumb-active{opacity:1}:host .case-studies-thumbs .swiper-slide.swiper-slide-thumb-active::after{background-color:var(--color-green-07)}:host .swiper-button-prev,:host .swiper-button-next{display:none}:host .swiper-pagination{display:block;bottom:5px}@media only screen and (min-width: 768px){:host .swiper-pagination{display:none}}:host .swiper-pagination .swiper-pagination-bullet{background:transparent;display:inline-block;height:1rem;width:1rem;outline:none;line-height:0;font-size:0;border:1px solid var(--color-gray-10);padding:5px;cursor:pointer;margin-right:32px !important;position:relative;opacity:1}:host .swiper-pagination .swiper-pagination-bullet::after{content:\"\";display:block;position:absolute;width:37px;height:2px;background-color:var(--color-gray-10);margin-left:10px;margin-top:1px}:host .swiper-pagination .swiper-pagination-bullet:last-child::after{display:none}:host .swiper-pagination .swiper-pagination-bullet.swiper-pagination-bullet-active{background:var(--color-orange-07)}";
1601
+
1602
+ const PtcCaseStudiesSlider = class {
1603
+ constructor(hostRef) {
1604
+ registerInstance(this, hostRef);
1605
+ // SLider List
1606
+ this.caseStudiesThumbs = null;
1607
+ this.caseStudiesSlides = null;
1608
+ }
1609
+ componentDidLoad() {
1610
+ this.initSlider();
1611
+ this.slideChangeHandler();
1612
+ this.renderSlides('swiper-slide-thumb', 'swiper-wrapper-thumbs');
1613
+ this.renderSlides('swiper-slide-content', 'swiper-wrapper-content');
1614
+ }
1615
+ initSlider() {
1616
+ this.caseStudiesThumbs = new Swiper(this.caeStudiesThumbRef, {
1617
+ modules: [Navigation, Pagination, freeMode, Grid],
1618
+ loop: false,
1619
+ slidesPerView: 'auto',
1620
+ freeMode: true,
1621
+ watchSlidesProgress: true,
1622
+ centerInsufficientSlides: true,
1623
+ breakpoints: {
1624
+ 992: {
1625
+ slidesPerView: 7,
1626
+ },
1627
+ }
1628
+ });
1629
+ this.caseStudiesSlides = new Swiper(this.caseStudiesSlidesRef, {
1630
+ modules: [Navigation, Pagination, Thumb, Autoplay, EffectFade],
1631
+ loop: false,
1632
+ grabCursor: true,
1633
+ effect: 'fade',
1634
+ autoplay: {
1635
+ delay: 10000,
1636
+ disableOnInteraction: false,
1637
+ waitForTransition: true,
1638
+ },
1639
+ thumbs: {
1640
+ swiper: this.caseStudiesThumbs,
1641
+ },
1642
+ pagination: {
1643
+ el: this.paginationRef,
1644
+ clickable: true,
1645
+ },
1646
+ });
1647
+ }
1648
+ slideChangeHandler() {
1649
+ this.caseStudiesSlides.on('slideChange', () => {
1650
+ const visibleSlide = this.caseStudiesSlides.slides[this.caseStudiesSlides.activeIndex];
1651
+ const tagName = visibleSlide.querySelector('ptc-text-copy-with-background').shadowRoot;
1652
+ const content = tagName.querySelector('.card-wrap');
1653
+ const parent = tagName.querySelector('.card-wrap').parentNode;
1654
+ parent.removeChild(content);
1655
+ parent.appendChild(content);
1656
+ });
1657
+ }
1658
+ renderSlides(slideName, wrapperName) {
1659
+ const slidesList = Array.from(this.hostElement.querySelectorAll('.' + slideName));
1660
+ if (slidesList.length > 0) {
1661
+ const swiperWrapper = this.hostElement.shadowRoot.querySelector('.' + wrapperName);
1662
+ slidesList.forEach((node, index) => {
1663
+ const cloneNode = node.cloneNode(true);
1664
+ swiperWrapper.appendChild(cloneNode);
1665
+ const imageElement = node.querySelector('img');
1666
+ if (imageElement) {
1667
+ imageElement.addEventListener('click', () => {
1668
+ this.caseStudiesSlides.slideTo(index); // Change the slide to the corresponding index
1669
+ });
1670
+ }
1671
+ });
1672
+ }
1673
+ }
1674
+ render() {
1675
+ return (h(Host, null, h("div", { class: "case-studies-thumbs", ref: el => this.caeStudiesThumbRef = el }, h("span", { class: "hide" }, h("slot", { name: 'thumb-slides' })), h("div", { class: 'swiper-wrapper swiper-wrapper-thumbs' })), h("div", { class: "case-studies-slides", ref: el => this.caseStudiesSlidesRef = el }, h("span", { class: "hide" }, h("slot", { name: 'content-slides' })), h("div", { class: 'swiper-wrapper swiper-wrapper-content' }), h("div", { class: "swiper-pagination", ref: el => this.paginationRef = el }))));
1676
+ }
1677
+ get hostElement() { return getElement(this); }
1678
+ };
1679
+ PtcCaseStudiesSlider.style = ptcCaseStudiesSliderCss;
1680
+
1681
+ export { PtcCaseStudiesSlider as ptc_case_studies_slider };