UNPKG

swiper

Version:

Most modern mobile touch slider and framework with hardware accelerated transitions

13 lines (12 loc) 68.2 kB
/** * Swiper 12.0.1 * Most modern mobile touch slider and framework with hardware accelerated transitions * https://swiperjs.com * * Copyright 2014-2025 Vladimir Kharlampidi * * Released under the MIT License * * Released on: September 11, 2025 */ var Swiper=function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(s={},i={}){const r=["__proto__","constructor","prototype"];Object.keys(i).filter(e=>r.indexOf(e)<0).forEach(r=>{void 0===s[r]?s[r]=i[r]:e(i[r])&&e(s[r])&&Object.keys(i[r]).length>0&&t(s[r],i[r])})}const s={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function i(){const e="undefined"!=typeof document?document:{};return t(e,s),e}const r={document:s,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function n(){const e="undefined"!=typeof window?window:{};return t(e,r),e}function a(e,t=0){return setTimeout(e,t)}function o(){return Date.now()}function l(e,t="x"){const s=n();let i,r,a;const o=function(e){const t=n();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(r=o.transform||o.webkitTransform,r.split(",").length>6&&(r=r.split(", ").map(e=>e.replace(",",".")).join(", ")),a=new s.WebKitCSSMatrix("none"===r?"":r)):(a=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=a.toString().split(",")),"x"===t&&(r=s.WebKitCSSMatrix?a.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===t&&(r=s.WebKitCSSMatrix?a.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),r||0}function d(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function c(e){return"undefined"!=typeof window&&void 0!==window.HTMLElement?e instanceof HTMLElement:e&&(1===e.nodeType||11===e.nodeType)}function p(...e){const t=Object(e[0]),s=["__proto__","constructor","prototype"];for(let i=1;i<e.length;i+=1){const r=e[i];if(null!=r&&!c(r)){const e=Object.keys(Object(r)).filter(e=>s.indexOf(e)<0);for(let s=0,i=e.length;s<i;s+=1){const i=e[s],n=Object.getOwnPropertyDescriptor(r,i);void 0!==n&&n.enumerable&&(d(t[i])&&d(r[i])?r[i].__swiper__?t[i]=r[i]:p(t[i],r[i]):!d(t[i])&&d(r[i])?(t[i]={},r[i].__swiper__?t[i]=r[i]:p(t[i],r[i])):t[i]=r[i])}}}return t}function u(e,t,s){e.style.setProperty(t,s)}function f({swiper:e,targetPosition:t,side:s}){const i=n(),r=-e.translate;let a,o=null;const l=e.params.speed;e.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(e.cssModeFrameID);const d=t>r?"next":"prev",c=(e,t)=>"next"===d&&e>=t||"prev"===d&&e<=t,p=()=>{a=(new Date).getTime(),null===o&&(o=a);const n=Math.max(Math.min((a-o)/l,1),0),d=.5-Math.cos(n*Math.PI)/2;let u=r+d*(t-r);if(c(u,t)&&(u=t),e.wrapperEl.scrollTo({[s]:u}),c(u,t))return e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[s]:u})}),void i.cancelAnimationFrame(e.cssModeFrameID);e.cssModeFrameID=i.requestAnimationFrame(p)};p()}function h(e,t=""){const s=n(),i=[...e.children];return s.HTMLSlotElement&&e instanceof HTMLSlotElement&&i.push(...e.assignedElements()),t?i.filter(e=>e.matches(t)):i}function m(e){try{return void console.warn(e)}catch(e){}}function g(e,t=[]){const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:function(e=""){return e.trim().split(" ").filter(e=>!!e.trim())}(t)),s}function v(e,t){return n().getComputedStyle(e,null).getPropertyValue(t)}function w(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function S(e,t,s){const i=n();return s?e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom")):e.offsetWidth}let T,b,x;function y(){return T||(T=function(){const e=n(),t=i();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),T}function E(e={}){return b||(b=function({userAgent:e}={}){const t=y(),s=n(),i=s.navigator.platform,r=e||s.navigator.userAgent,a={ios:!1,android:!1},o=s.screen.width,l=s.screen.height,d=r.match(/(Android);?[\s\/]+([\d.]+)?/);let c=r.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const p=r.match(/(iPod)(.*OS\s([\d_]+))?/),u=!c&&r.match(/(iPhone\sOS|iOS)\s([\d_]+)/),f="Win32"===i;let h="MacIntel"===i;return!c&&h&&t.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${l}`)>=0&&(c=r.match(/(Version)\/([\d.]+)/),c||(c=[0,1,"13_0_0"]),h=!1),d&&!f&&(a.os="android",a.android=!0),(c||u||p)&&(a.os="ios",a.ios=!0),a}(e)),b}function M(){return x||(x=function(){const e=n(),t=E();let s=!1;function i(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(i()){const t=String(e.navigator.userAgent);if(t.includes("Version/")){const[e,i]=t.split("Version/")[1].split(" ")[0].split(".").map(e=>Number(e));s=e<16||16===e&&i<2}}const r=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),a=i();return{isSafari:s||a,needPerspectiveFix:s,need3dFix:a||r&&t.ios,isWebView:r}}()),x}var P={on(e,t,s){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;const r=s?"unshift":"push";return e.split(" ").forEach(e=>{i.eventsListeners[e]||(i.eventsListeners[e]=[]),i.eventsListeners[e][r](t)}),i},once(e,t,s){const i=this;if(!i.eventsListeners||i.destroyed)return i;if("function"!=typeof t)return i;function r(...s){i.off(e,r),r.__emitterProxy&&delete r.__emitterProxy,t.apply(i,s)}return r.__emitterProxy=t,i.on(e,r,s)},onAny(e,t){const s=this;if(!s.eventsListeners||s.destroyed)return s;if("function"!=typeof e)return s;const i=t?"unshift":"push";return s.eventsAnyListeners.indexOf(e)<0&&s.eventsAnyListeners[i](e),s},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const s=t.eventsAnyListeners.indexOf(e);return s>=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed?s:s.eventsListeners?(e.split(" ").forEach(e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach((i,r)=>{(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&s.eventsListeners[e].splice(r,1)})}),s):s},emit(...e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsListeners)return t;let s,i,r;"string"==typeof e[0]||Array.isArray(e[0])?(s=e[0],i=e.slice(1,e.length),r=t):(s=e[0].events,i=e[0].data,r=e[0].context||t),i.unshift(r);return(Array.isArray(s)?s:s.split(" ")).forEach(e=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(t=>{t.apply(r,[e,...i])}),t.eventsListeners&&t.eventsListeners[e]&&t.eventsListeners[e].forEach(e=>{e.apply(r,i)})}),t}};const C=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const I=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const L=(e,t)=>{if(!e||e.destroyed||!e.params)return;const s=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(s){let t=s.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(s.shadowRoot?t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{s.shadowRoot&&(t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&t.remove())})),t&&t.remove()}},k=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},O=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const i="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),r=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=r,n=[s-t];return n.push(...Array.from({length:t}).map((e,t)=>s+i+t)),void e.slides.forEach((t,s)=>{n.includes(t.column)&&k(e,s)})}const n=r+i-1;if(e.params.rewind||e.params.loop)for(let i=r-t;i<=n+t;i+=1){const t=(i%s+s)%s;(t<r||t>n)&&k(e,t)}else for(let i=Math.max(r-t,0);i<=Math.min(n+t,s-1);i+=1)i!==r&&(i>n||i<r)&&k(e,i)};var A={updateSize:function(){const e=this;let t,s;const i=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:i.clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:i.clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(v(i,"padding-left")||0,10)-parseInt(v(i,"padding-right")||0,10),s=s-parseInt(v(i,"padding-top")||0,10)-parseInt(v(i,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t,s){return parseFloat(t.getPropertyValue(e.getDirectionLabel(s))||0)}const s=e.params,{wrapperEl:i,slidesEl:r,rtlTranslate:n,wrongRTL:a}=e,o=e.virtual&&s.virtual.enabled,l=o?e.virtual.slides.length:e.slides.length,d=h(r,`.${e.params.slideClass}, swiper-slide`),c=o?e.virtual.slides.length:d.length;let p=[];const f=[],m=[];let g=s.slidesOffsetBefore;"function"==typeof g&&(g=s.slidesOffsetBefore.call(e));let w=s.slidesOffsetAfter;"function"==typeof w&&(w=s.slidesOffsetAfter.call(e));const T=e.snapGrid.length,b=e.slidesGrid.length,x=e.size-g-w;let y=s.spaceBetween,E=-g,M=0,P=0;if(void 0===x)return;"string"==typeof y&&y.indexOf("%")>=0?y=parseFloat(y.replace("%",""))/100*x:"string"==typeof y&&(y=parseFloat(y)),e.virtualSize=-y-g-w,d.forEach(e=>{n?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""}),s.centeredSlides&&s.cssMode&&(u(i,"--swiper-centered-offset-before",""),u(i,"--swiper-centered-offset-after",""));const C=s.grid&&s.grid.rows>1&&e.grid;let I;C?e.grid.initSlides(d):e.grid&&e.grid.unsetSlides();const L="auto"===s.slidesPerView&&s.breakpoints&&Object.keys(s.breakpoints).filter(e=>void 0!==s.breakpoints[e].slidesPerView).length>0;for(let i=0;i<c;i+=1){I=0;const r=d[i];if(!r||(C&&e.grid.updateSlide(i,r,d),"none"!==v(r,"display"))){if(o&&"auto"===s.slidesPerView)s.virtual.slidesPerViewAutoSlideSize&&(I=s.virtual.slidesPerViewAutoSlideSize),I&&r&&(s.roundLengths&&(I=Math.floor(I)),r.style[e.getDirectionLabel("width")]=`${I}px`);else if("auto"===s.slidesPerView){L&&(r.style[e.getDirectionLabel("width")]="");const i=getComputedStyle(r),n=r.style.transform,a=r.style.webkitTransform;if(n&&(r.style.transform="none"),a&&(r.style.webkitTransform="none"),s.roundLengths)I=e.isHorizontal()?S(r,"width",!0):S(r,"height",!0);else{const e=t(i,"width"),s=t(i,"padding-left"),n=t(i,"padding-right"),a=t(i,"margin-left"),o=t(i,"margin-right"),l=i.getPropertyValue("box-sizing");if(l&&"border-box"===l)I=e+a+o;else{const{clientWidth:t,offsetWidth:i}=r;I=e+s+n+a+o+(i-t)}}n&&(r.style.transform=n),a&&(r.style.webkitTransform=a),s.roundLengths&&(I=Math.floor(I))}else I=(x-(s.slidesPerView-1)*y)/s.slidesPerView,s.roundLengths&&(I=Math.floor(I)),r&&(r.style[e.getDirectionLabel("width")]=`${I}px`);r&&(r.swiperSlideSize=I),m.push(I),s.centeredSlides?(E=E+I/2+M/2+y,0===M&&0!==i&&(E=E-x/2-y),0===i&&(E=E-x/2-y),Math.abs(E)<.001&&(E=0),s.roundLengths&&(E=Math.floor(E)),P%s.slidesPerGroup===0&&p.push(E),f.push(E)):(s.roundLengths&&(E=Math.floor(E)),(P-Math.min(e.params.slidesPerGroupSkip,P))%e.params.slidesPerGroup===0&&p.push(E),f.push(E),E=E+I+y),e.virtualSize+=I+y,M=I,P+=1}}if(e.virtualSize=Math.max(e.virtualSize,x)+w,n&&a&&("slide"===s.effect||"coverflow"===s.effect)&&(i.style.width=`${e.virtualSize+y}px`),s.setWrapperSize&&(i.style[e.getDirectionLabel("width")]=`${e.virtualSize+y}px`),C&&e.grid.updateWrapperSize(I,p),!s.centeredSlides){const t=[];for(let i=0;i<p.length;i+=1){let r=p[i];s.roundLengths&&(r=Math.floor(r)),p[i]<=e.virtualSize-x&&t.push(r)}p=t,Math.floor(e.virtualSize-x)-Math.floor(p[p.length-1])>1&&p.push(e.virtualSize-x)}if(o&&s.loop){const t=m[0]+y;if(s.slidesPerGroup>1){const i=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/s.slidesPerGroup),r=t*s.slidesPerGroup;for(let e=0;e<i;e+=1)p.push(p[p.length-1]+r)}for(let i=0;i<e.virtual.slidesBefore+e.virtual.slidesAfter;i+=1)1===s.slidesPerGroup&&p.push(p[p.length-1]+t),f.push(f[f.length-1]+t),e.virtualSize+=t}if(0===p.length&&(p=[0]),0!==y){const t=e.isHorizontal()&&n?"marginLeft":e.getDirectionLabel("marginRight");d.filter((e,t)=>!(s.cssMode&&!s.loop)||t!==d.length-1).forEach(e=>{e.style[t]=`${y}px`})}if(s.centeredSlides&&s.centeredSlidesBounds){let e=0;m.forEach(t=>{e+=t+(y||0)}),e-=y;const t=e>x?e-x:0;p=p.map(e=>e<=0?-g:e>t?t+w:e)}if(s.centerInsufficientSlides){let e=0;m.forEach(t=>{e+=t+(y||0)}),e-=y;const t=(g||0)+(w||0);if(e+t<x){const s=(x-e-t)/2;p.forEach((e,t)=>{p[t]=e-s}),f.forEach((e,t)=>{f[t]=e+s})}}if(Object.assign(e,{slides:d,snapGrid:p,slidesGrid:f,slidesSizesGrid:m}),s.centeredSlides&&s.cssMode&&!s.centeredSlidesBounds){u(i,"--swiper-centered-offset-before",-p[0]+"px"),u(i,"--swiper-centered-offset-after",e.size/2-m[m.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(e=>e+t),e.slidesGrid=e.slidesGrid.map(e=>e+s)}if(c!==l&&e.emit("slidesLengthChange"),p.length!==T&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),f.length!==b&&e.emit("slidesGridLengthChange"),s.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(o||s.cssMode||"slide"!==s.effect&&"fade"!==s.effect)){const t=`${s.containerModifierClass}backface-hidden`,i=e.el.classList.contains(t);c<=s.maxBackfaceHiddenSlides?i||e.el.classList.add(t):i&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,s=[],i=t.virtual&&t.params.virtual.enabled;let r,n=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const a=e=>i?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(e=>{s.push(e)});else for(r=0;r<Math.ceil(t.params.slidesPerView);r+=1){const e=t.activeIndex+r;if(e>t.slides.length&&!i)break;s.push(a(e))}else s.push(a(t.activeIndex));for(r=0;r<s.length;r+=1)if(void 0!==s[r]){const e=s[r].offsetHeight;n=e>n?e:n}(n||0===n)&&(t.wrapperEl.style.height=`${n}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let i=0;i<t.length;i+=1)t[i].swiperSlideOffset=(e.isHorizontal()?t[i].offsetLeft:t[i].offsetTop)-s-e.cssOverflowAdjustment()},updateSlidesProgress:function(e=this&&this.translate||0){const t=this,s=t.params,{slides:i,rtlTranslate:r,snapGrid:n}=t;if(0===i.length)return;void 0===i[0].swiperSlideOffset&&t.updateSlidesOffset();let a=-e;r&&(a=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let o=s.spaceBetween;"string"==typeof o&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*t.size:"string"==typeof o&&(o=parseFloat(o));for(let e=0;e<i.length;e+=1){const l=i[e];let d=l.swiperSlideOffset;s.cssMode&&s.centeredSlides&&(d-=i[0].swiperSlideOffset);const c=(a+(s.centeredSlides?t.minTranslate():0)-d)/(l.swiperSlideSize+o),p=(a-n[0]+(s.centeredSlides?t.minTranslate():0)-d)/(l.swiperSlideSize+o),u=-(a-d),f=u+t.slidesSizesGrid[e],h=u>=0&&u<=t.size-t.slidesSizesGrid[e],m=u>=0&&u<t.size-1||f>1&&f<=t.size||u<=0&&f>=t.size;m&&(t.visibleSlides.push(l),t.visibleSlidesIndexes.push(e)),C(l,m,s.slideVisibleClass),C(l,h,s.slideFullyVisibleClass),l.progress=r?-c:c,l.originalProgress=r?-p:p}},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,i=t.maxTranslate()-t.minTranslate();let{progress:r,isBeginning:n,isEnd:a,progressLoop:o}=t;const l=n,d=a;if(0===i)r=0,n=!0,a=!0;else{r=(e-t.minTranslate())/i;const s=Math.abs(e-t.minTranslate())<1,o=Math.abs(e-t.maxTranslate())<1;n=s||r<=0,a=o||r>=1,s&&(r=0),o&&(r=1)}if(s.loop){const s=t.getSlideIndexByData(0),i=t.getSlideIndexByData(t.slides.length-1),r=t.slidesGrid[s],n=t.slidesGrid[i],a=t.slidesGrid[t.slidesGrid.length-1],l=Math.abs(e);o=l>=r?(l-r)/a:(l+a-n)/a,o>1&&(o-=1)}Object.assign(t,{progress:r,progressLoop:o,isBeginning:n,isEnd:a}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),n&&!l&&t.emit("reachBeginning toEdge"),a&&!d&&t.emit("reachEnd toEdge"),(l&&!n||d&&!a)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:i,activeIndex:r}=e,n=e.virtual&&s.virtual.enabled,a=e.grid&&s.grid&&s.grid.rows>1,o=e=>h(i,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let l,d,c;if(n)if(s.loop){let t=r-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),l=o(`[data-swiper-slide-index="${t}"]`)}else l=o(`[data-swiper-slide-index="${r}"]`);else a?(l=t.find(e=>e.column===r),c=t.find(e=>e.column===r+1),d=t.find(e=>e.column===r-1)):l=t[r];l&&(a||(c=function(e,t){const s=[];for(;e.nextElementSibling;){const i=e.nextElementSibling;t?i.matches(t)&&s.push(i):s.push(i),e=i}return s}(l,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!c&&(c=t[0]),d=function(e,t){const s=[];for(;e.previousElementSibling;){const i=e.previousElementSibling;t?i.matches(t)&&s.push(i):s.push(i),e=i}return s}(l,`.${s.slideClass}, swiper-slide`)[0],s.loop&&0===!d&&(d=t[t.length-1]))),t.forEach(e=>{I(e,e===l,s.slideActiveClass),I(e,e===c,s.slideNextClass),I(e,e===d,s.slidePrevClass)}),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:i,params:r,activeIndex:n,realIndex:a,snapIndex:o}=t;let l,d=e;const c=e=>{let s=e-t.virtual.slidesBefore;return s<0&&(s=t.virtual.slides.length+s),s>=t.virtual.slides.length&&(s-=t.virtual.slides.length),s};if(void 0===d&&(d=function(e){const{slidesGrid:t,params:s}=e,i=e.rtlTranslate?e.translate:-e.translate;let r;for(let e=0;e<t.length;e+=1)void 0!==t[e+1]?i>=t[e]&&i<t[e+1]-(t[e+1]-t[e])/2?r=e:i>=t[e]&&i<t[e+1]&&(r=e+1):i>=t[e]&&(r=e);return s.normalizeSlideIndex&&(r<0||void 0===r)&&(r=0),r}(t)),i.indexOf(s)>=0)l=i.indexOf(s);else{const e=Math.min(r.slidesPerGroupSkip,d);l=e+Math.floor((d-e)/r.slidesPerGroup)}if(l>=i.length&&(l=i.length-1),d===n&&!t.params.loop)return void(l!==o&&(t.snapIndex=l,t.emit("snapIndexChange")));if(d===n&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=c(d));const p=t.grid&&r.grid&&r.grid.rows>1;let u;if(t.virtual&&r.virtual.enabled&&r.loop)u=c(d);else if(p){const e=t.slides.find(e=>e.column===d);let s=parseInt(e.getAttribute("data-swiper-slide-index"),10);Number.isNaN(s)&&(s=Math.max(t.slides.indexOf(e),0)),u=Math.floor(s/r.grid.rows)}else if(t.slides[d]){const e=t.slides[d].getAttribute("data-swiper-slide-index");u=e?parseInt(e,10):d}else u=d;Object.assign(t,{previousSnapIndex:o,snapIndex:l,previousRealIndex:a,realIndex:u,previousIndex:n,activeIndex:d}),t.initialized&&O(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(a!==u&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const s=this,i=s.params;let r=e.closest(`.${i.slideClass}, swiper-slide`);!r&&s.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(e=>{!r&&e.matches&&e.matches(`.${i.slideClass}, swiper-slide`)&&(r=e)});let n,a=!1;if(r)for(let e=0;e<s.slides.length;e+=1)if(s.slides[e]===r){a=!0,n=e;break}if(!r||!a)return s.clickedSlide=void 0,void(s.clickedIndex=void 0);s.clickedSlide=r,s.virtual&&s.params.virtual.enabled?s.clickedIndex=parseInt(r.getAttribute("data-swiper-slide-index"),10):s.clickedIndex=n,i.slideToClickedSlide&&void 0!==s.clickedIndex&&s.clickedIndex!==s.activeIndex&&s.slideToClickedSlide()}};var z={getTranslate:function(e=(this.isHorizontal()?"x":"y")){const{params:t,rtlTranslate:s,translate:i,wrapperEl:r}=this;if(t.virtualTranslate)return s?-i:i;if(t.cssMode)return i;let n=l(r,e);return n+=this.cssOverflowAdjustment(),s&&(n=-n),n||0},setTranslate:function(e,t){const s=this,{rtlTranslate:i,params:r,wrapperEl:n,progress:a}=s;let o,l=0,d=0;s.isHorizontal()?l=i?-e:e:d=e,r.roundLengths&&(l=Math.floor(l),d=Math.floor(d)),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?l:d,r.cssMode?n[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-l:-d:r.virtualTranslate||(s.isHorizontal()?l-=s.cssOverflowAdjustment():d-=s.cssOverflowAdjustment(),n.style.transform=`translate3d(${l}px, ${d}px, 0px)`);const c=s.maxTranslate()-s.minTranslate();o=0===c?0:(e-s.minTranslate())/c,o!==a&&s.updateProgress(e),s.emit("setTranslate",s.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e=0,t=this.params.speed,s=!0,i=!0,r){const n=this,{params:a,wrapperEl:o}=n;if(n.animating&&a.preventInteractionOnTransition)return!1;const l=n.minTranslate(),d=n.maxTranslate();let c;if(c=i&&e>l?l:i&&e<d?d:e,n.updateProgress(c),a.cssMode){const e=n.isHorizontal();if(0===t)o[e?"scrollLeft":"scrollTop"]=-c;else{if(!n.support.smoothScroll)return f({swiper:n,targetPosition:-c,side:e?"left":"top"}),!0;o.scrollTo({[e?"left":"top"]:-c,behavior:"smooth"})}return!0}return 0===t?(n.setTransition(0),n.setTranslate(c),s&&(n.emit("beforeTransitionStart",t,r),n.emit("transitionEnd"))):(n.setTransition(t),n.setTranslate(c),s&&(n.emit("beforeTransitionStart",t,r),n.emit("transitionStart")),n.animating||(n.animating=!0,n.onTranslateToWrapperTransitionEnd||(n.onTranslateToWrapperTransitionEnd=function(e){n&&!n.destroyed&&e.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onTranslateToWrapperTransitionEnd),n.onTranslateToWrapperTransitionEnd=null,delete n.onTranslateToWrapperTransitionEnd,n.animating=!1,s&&n.emit("transitionEnd"))}),n.wrapperEl.addEventListener("transitionend",n.onTranslateToWrapperTransitionEnd))),!0}};function G({swiper:e,runCallbacks:t,direction:s,step:i}){const{activeIndex:r,previousIndex:n}=e;let a=s;a||(a=r>n?"next":r<n?"prev":"reset"),e.emit(`transition${i}`),t&&"reset"===a?e.emit(`slideResetTransition${i}`):t&&r!==n&&(e.emit(`slideChangeTransition${i}`),"next"===a?e.emit(`slideNextTransition${i}`):e.emit(`slidePrevTransition${i}`))}var _={slideTo:function(e=0,t,s=!0,i,r){"string"==typeof e&&(e=parseInt(e,10));const n=this;let a=e;a<0&&(a=0);const{params:o,snapGrid:l,slidesGrid:d,previousIndex:c,activeIndex:p,rtlTranslate:u,wrapperEl:h,enabled:m}=n;if(!m&&!i&&!r||n.destroyed||n.animating&&o.preventInteractionOnTransition)return!1;void 0===t&&(t=n.params.speed);const g=Math.min(n.params.slidesPerGroupSkip,a);let v=g+Math.floor((a-g)/n.params.slidesPerGroup);v>=l.length&&(v=l.length-1);const w=-l[v];if(o.normalizeSlideIndex)for(let e=0;e<d.length;e+=1){const t=-Math.floor(100*w),s=Math.floor(100*d[e]),i=Math.floor(100*d[e+1]);void 0!==d[e+1]?t>=s&&t<i-(i-s)/2?a=e:t>=s&&t<i&&(a=e+1):t>=s&&(a=e)}if(n.initialized&&a!==p){if(!n.allowSlideNext&&(u?w>n.translate&&w>n.minTranslate():w<n.translate&&w<n.minTranslate()))return!1;if(!n.allowSlidePrev&&w>n.translate&&w>n.maxTranslate()&&(p||0)!==a)return!1}let S;a!==(c||0)&&s&&n.emit("beforeSlideChangeStart"),n.updateProgress(w),S=a>p?"next":a<p?"prev":"reset";const T=n.virtual&&n.params.virtual.enabled;if(!(T&&r)&&(u&&-w===n.translate||!u&&w===n.translate))return n.updateActiveIndex(a),o.autoHeight&&n.updateAutoHeight(),n.updateSlidesClasses(),"slide"!==o.effect&&n.setTranslate(w),"reset"!==S&&(n.transitionStart(s,S),n.transitionEnd(s,S)),!1;if(o.cssMode){const e=n.isHorizontal(),s=u?w:-w;if(0===t)T&&(n.wrapperEl.style.scrollSnapType="none",n._immediateVirtual=!0),T&&!n._cssModeVirtualInitialSet&&n.params.initialSlide>0?(n._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{h[e?"scrollLeft":"scrollTop"]=s})):h[e?"scrollLeft":"scrollTop"]=s,T&&requestAnimationFrame(()=>{n.wrapperEl.style.scrollSnapType="",n._immediateVirtual=!1});else{if(!n.support.smoothScroll)return f({swiper:n,targetPosition:s,side:e?"left":"top"}),!0;h.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}const b=M().isSafari;return T&&!r&&b&&n.isElement&&n.virtual.update(!1,!1,a),n.setTransition(t),n.setTranslate(w),n.updateActiveIndex(a),n.updateSlidesClasses(),n.emit("beforeTransitionStart",t,i),n.transitionStart(s,S),0===t?n.transitionEnd(s,S):n.animating||(n.animating=!0,n.onSlideToWrapperTransitionEnd||(n.onSlideToWrapperTransitionEnd=function(e){n&&!n.destroyed&&e.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onSlideToWrapperTransitionEnd),n.onSlideToWrapperTransitionEnd=null,delete n.onSlideToWrapperTransitionEnd,n.transitionEnd(s,S))}),n.wrapperEl.addEventListener("transitionend",n.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e=0,t,s=!0,i){if("string"==typeof e){e=parseInt(e,10)}const r=this;if(r.destroyed)return;void 0===t&&(t=r.params.speed);const n=r.grid&&r.params.grid&&r.params.grid.rows>1;let a=e;if(r.params.loop)if(r.virtual&&r.params.virtual.enabled)a+=r.virtual.slidesBefore;else{let e;if(n){const t=a*r.params.grid.rows;e=r.slides.find(e=>1*e.getAttribute("data-swiper-slide-index")===t).column}else e=r.getSlideIndexByData(a);const t=n?Math.ceil(r.slides.length/r.params.grid.rows):r.slides.length,{centeredSlides:s,slidesOffsetBefore:o,slidesOffsetAfter:l}=r.params,d=s||!!o||!!l;let c=r.params.slidesPerView;"auto"===c?c=r.slidesPerViewDynamic():(c=Math.ceil(parseFloat(r.params.slidesPerView,10)),d&&c%2==0&&(c+=1));let p=t-e<c;if(d&&(p=p||e<Math.ceil(c/2)),i&&d&&"auto"!==r.params.slidesPerView&&!n&&(p=!1),p){const s=d?e<r.activeIndex?"prev":"next":e-r.activeIndex-1<r.params.slidesPerView?"next":"prev";r.loopFix({direction:s,slideTo:!0,activeSlideIndex:"next"===s?e+1:e-t+1,slideRealIndex:"next"===s?r.realIndex:void 0})}if(n){const e=a*r.params.grid.rows;a=r.slides.find(t=>1*t.getAttribute("data-swiper-slide-index")===e).column}else a=r.getSlideIndexByData(a)}return requestAnimationFrame(()=>{r.slideTo(a,t,s,i)}),r},slideNext:function(e,t=!0,s){const i=this,{enabled:r,params:n,animating:a}=i;if(!r||i.destroyed)return i;void 0===e&&(e=i.params.speed);let o=n.slidesPerGroup;"auto"===n.slidesPerView&&1===n.slidesPerGroup&&n.slidesPerGroupAuto&&(o=Math.max(i.slidesPerViewDynamic("current",!0),1));const l=i.activeIndex<n.slidesPerGroupSkip?1:o,d=i.virtual&&n.virtual.enabled;if(n.loop){if(a&&!d&&n.loopPreventsSliding)return!1;if(i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft,i.activeIndex===i.slides.length-1&&n.cssMode)return requestAnimationFrame(()=>{i.slideTo(i.activeIndex+l,e,t,s)}),!0}return n.rewind&&i.isEnd?i.slideTo(0,e,t,s):i.slideTo(i.activeIndex+l,e,t,s)},slidePrev:function(e,t=!0,s){const i=this,{params:r,snapGrid:n,slidesGrid:a,rtlTranslate:o,enabled:l,animating:d}=i;if(!l||i.destroyed)return i;void 0===e&&(e=i.params.speed);const c=i.virtual&&r.virtual.enabled;if(r.loop){if(d&&!c&&r.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=p(o?i.translate:-i.translate),f=n.map(e=>p(e)),h=r.freeMode&&r.freeMode.enabled;let m=n[f.indexOf(u)-1];if(void 0===m&&(r.cssMode||h)){let e;n.forEach((t,s)=>{u>=t&&(e=s)}),void 0!==e&&(m=h?n[e]:n[e>0?e-1:e])}let g=0;if(void 0!==m&&(g=a.indexOf(m),g<0&&(g=i.activeIndex-1),"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(g=g-i.slidesPerViewDynamic("previous",!0)+1,g=Math.max(g,0))),r.rewind&&i.isBeginning){const r=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(r,e,t,s)}return r.loop&&0===i.activeIndex&&r.cssMode?(requestAnimationFrame(()=>{i.slideTo(g,e,t,s)}),!0):i.slideTo(g,e,t,s)},slideReset:function(e,t=!0,s){const i=this;if(!i.destroyed)return void 0===e&&(e=i.params.speed),i.slideTo(i.activeIndex,e,t,s)},slideToClosest:function(e,t=!0,s,i=.5){const r=this;if(r.destroyed)return;void 0===e&&(e=r.params.speed);let n=r.activeIndex;const a=Math.min(r.params.slidesPerGroupSkip,n),o=a+Math.floor((n-a)/r.params.slidesPerGroup),l=r.rtlTranslate?r.translate:-r.translate;if(l>=r.snapGrid[o]){const e=r.snapGrid[o];l-e>(r.snapGrid[o+1]-e)*i&&(n+=r.params.slidesPerGroup)}else{const e=r.snapGrid[o-1];l-e<=(r.snapGrid[o]-e)*i&&(n-=r.params.slidesPerGroup)}return n=Math.max(n,0),n=Math.min(n,r.slidesGrid.length-1),r.slideTo(n,e,t,s)},slideToClickedSlide:function(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:s}=e,i="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let r,n=e.getSlideIndexWhenGrid(e.clickedIndex);const o=e.isElement?"swiper-slide":`.${t.slideClass}`,l=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;r=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?e.slideToLoop(r):n>(l?(e.slides.length-i)/2-(e.params.grid.rows-1):e.slides.length-i)?(e.loopFix(),n=e.getSlideIndex(h(s,`${o}[data-swiper-slide-index="${r}"]`)[0]),a(()=>{e.slideTo(n)})):e.slideTo(n)}else e.slideTo(n)}};var D={loopCreate:function(e,t){const s=this,{params:i,slidesEl:r}=s;if(!i.loop||s.virtual&&s.params.virtual.enabled)return;const n=()=>{h(r,`.${i.slideClass}, swiper-slide`).forEach((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})},a=s.grid&&i.grid&&i.grid.rows>1;i.loopAddBlankSlides&&(i.slidesPerGroup>1||a)&&(()=>{const e=h(r,`.${i.slideBlankClass}`);e.forEach(e=>{e.remove()}),e.length>0&&(s.recalcSlides(),s.updateSlides())})();const o=i.slidesPerGroup*(a?i.grid.rows:1),l=s.slides.length%o!==0,d=a&&s.slides.length%i.grid.rows!==0,c=e=>{for(let t=0;t<e;t+=1){const e=s.isElement?g("swiper-slide",[i.slideBlankClass]):g("div",[i.slideClass,i.slideBlankClass]);s.slidesEl.append(e)}};if(l){if(i.loopAddBlankSlides){c(o-s.slides.length%o),s.recalcSlides(),s.updateSlides()}else m("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");n()}else if(d){if(i.loopAddBlankSlides){c(i.grid.rows-s.slides.length%i.grid.rows),s.recalcSlides(),s.updateSlides()}else m("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");n()}else n();const p=i.centeredSlides||!!i.slidesOffsetBefore||!!i.slidesOffsetAfter;s.loopFix({slideRealIndex:e,direction:p?void 0:"next",initial:t})},loopFix:function({slideRealIndex:e,slideTo:t=!0,direction:s,setTranslate:i,activeSlideIndex:r,initial:n,byController:a,byMousewheel:o}={}){const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:d,allowSlidePrev:c,allowSlideNext:p,slidesEl:u,params:f}=l,{centeredSlides:h,slidesOffsetBefore:g,slidesOffsetAfter:v,initialSlide:w}=f,S=h||!!g||!!v;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&f.virtual.enabled)return t&&(S||0!==l.snapIndex?S&&l.snapIndex<f.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0):l.slideTo(l.virtual.slides.length,0,!1,!0)),l.allowSlidePrev=c,l.allowSlideNext=p,void l.emit("loopFix");let T=f.slidesPerView;"auto"===T?T=l.slidesPerViewDynamic():(T=Math.ceil(parseFloat(f.slidesPerView,10)),S&&T%2==0&&(T+=1));const b=f.slidesPerGroupAuto?T:f.slidesPerGroup;let x=S?Math.max(b,Math.ceil(T/2)):b;x%b!==0&&(x+=b-x%b),x+=f.loopAdditionalSlides,l.loopedSlides=x;const y=l.grid&&f.grid&&f.grid.rows>1;d.length<T+x||"cards"===l.params.effect&&d.length<T+2*x?m("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):y&&"row"===f.grid.fill&&m("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const E=[],M=[],P=y?Math.ceil(d.length/f.grid.rows):d.length,C=n&&P-w<T&&!S;let I=C?w:l.activeIndex;void 0===r?r=l.getSlideIndex(d.find(e=>e.classList.contains(f.slideActiveClass))):I=r;const L="next"===s||!s,k="prev"===s||!s;let O=0,A=0;const z=(y?d[r].column:r)+(S&&void 0===i?-T/2+.5:0);if(z<x){O=Math.max(x-z,b);for(let e=0;e<x-z;e+=1){const t=e-Math.floor(e/P)*P;if(y){const e=P-t-1;for(let t=d.length-1;t>=0;t-=1)d[t].column===e&&E.push(t)}else E.push(P-t-1)}}else if(z+T>P-x){A=Math.max(z-(P-2*x),b),C&&(A=Math.max(A,T-P+w+1));for(let e=0;e<A;e+=1){const t=e-Math.floor(e/P)*P;y?d.forEach((e,s)=>{e.column===t&&M.push(s)}):M.push(t)}}if(l.__preventObserver__=!0,requestAnimationFrame(()=>{l.__preventObserver__=!1}),"cards"===l.params.effect&&d.length<T+2*x&&(M.includes(r)&&M.splice(M.indexOf(r),1),E.includes(r)&&E.splice(E.indexOf(r),1)),k&&E.forEach(e=>{d[e].swiperLoopMoveDOM=!0,u.prepend(d[e]),d[e].swiperLoopMoveDOM=!1}),L&&M.forEach(e=>{d[e].swiperLoopMoveDOM=!0,u.append(d[e]),d[e].swiperLoopMoveDOM=!1}),l.recalcSlides(),"auto"===f.slidesPerView?l.updateSlides():y&&(E.length>0&&k||M.length>0&&L)&&l.slides.forEach((e,t)=>{l.grid.updateSlide(t,e,l.slides)}),f.watchSlidesProgress&&l.updateSlidesOffset(),t)if(E.length>0&&k){if(void 0===e){const e=l.slidesGrid[I],t=l.slidesGrid[I+O]-e;o?l.setTranslate(l.translate-t):(l.slideTo(I+Math.ceil(O),0,!1,!0),i&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-t,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-t))}else if(i){const e=y?E.length/f.grid.rows:E.length;l.slideTo(l.activeIndex+e,0,!1,!0),l.touchEventsData.currentTranslate=l.translate}}else if(M.length>0&&L)if(void 0===e){const e=l.slidesGrid[I],t=l.slidesGrid[I-A]-e;o?l.setTranslate(l.translate-t):(l.slideTo(I-A,0,!1,!0),i&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-t,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-t))}else{const e=y?M.length/f.grid.rows:M.length;l.slideTo(l.activeIndex-e,0,!1,!0)}if(l.allowSlidePrev=c,l.allowSlideNext=p,l.controller&&l.controller.control&&!a){const n={slideRealIndex:e,direction:s,setTranslate:i,activeSlideIndex:r,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach(e=>{!e.destroyed&&e.params.loop&&e.loopFix({...n,slideTo:e.params.slidesPerView===f.slidesPerView&&t})}):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...n,slideTo:l.controller.control.params.slidesPerView===f.slidesPerView&&t})}l.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:s}=e;if(!t.loop||!s||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const i=[];e.slides.forEach(e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;i[t]=e}),e.slides.forEach(e=>{e.removeAttribute("data-swiper-slide-index")}),i.forEach(e=>{s.append(e)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}};function V(e,t,s){const i=n(),{params:r}=e,a=r.edgeSwipeDetection,o=r.edgeSwipeThreshold;return!a||!(s<=o||s>=i.innerWidth-o)||"prevent"===a&&(t.preventDefault(),!0)}function B(e){const t=this,s=i();let r=e;r.originalEvent&&(r=r.originalEvent);const a=t.touchEventsData;if("pointerdown"===r.type){if(null!==a.pointerId&&a.pointerId!==r.pointerId)return;a.pointerId=r.pointerId}else"touchstart"===r.type&&1===r.targetTouches.length&&(a.touchId=r.targetTouches[0].identifier);if("touchstart"===r.type)return void V(t,r,r.targetTouches[0].pageX);const{params:l,touches:d,enabled:c}=t;if(!c)return;if(!l.simulateTouch&&"mouse"===r.pointerType)return;if(t.animating&&l.preventInteractionOnTransition)return;!t.animating&&l.cssMode&&l.loop&&t.loopFix();let p=r.target;if("wrapper"===l.touchEventsTarget&&!function(e,t){const s=n();let i=t.contains(e);!i&&s.HTMLSlotElement&&t instanceof HTMLSlotElement&&(i=[...t.assignedElements()].includes(e),i||(i=function(e,t){const s=[t];for(;s.length>0;){const t=s.shift();if(e===t)return!0;s.push(...t.children,...t.shadowRoot?t.shadowRoot.children:[],...t.assignedElements?t.assignedElements():[])}}(e,t)));return i}(p,t.wrapperEl))return;if("which"in r&&3===r.which)return;if("button"in r&&r.button>0)return;if(a.isTouched&&a.isMoved)return;const u=!!l.noSwipingClass&&""!==l.noSwipingClass,f=r.composedPath?r.composedPath():r.path;u&&r.target&&r.target.shadowRoot&&f&&(p=f[0]);const h=l.noSwipingSelector?l.noSwipingSelector:`.${l.noSwipingClass}`,m=!(!r.target||!r.target.shadowRoot);if(l.noSwiping&&(m?function(e,t=this){return function t(s){if(!s||s===i()||s===n())return null;s.assignedSlot&&(s=s.assignedSlot);const r=s.closest(e);return r||s.getRootNode?r||t(s.getRootNode().host):null}(t)}(h,p):p.closest(h)))return void(t.allowClick=!0);if(l.swipeHandler&&!p.closest(l.swipeHandler))return;d.currentX=r.pageX,d.currentY=r.pageY;const g=d.currentX,v=d.currentY;if(!V(t,r,g))return;Object.assign(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),d.startX=g,d.startY=v,a.touchStartTime=o(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,l.threshold>0&&(a.allowThresholdMove=!1);let w=!0;p.matches(a.focusableElements)&&(w=!1,"SELECT"===p.nodeName&&(a.isTouched=!1)),s.activeElement&&s.activeElement.matches(a.focusableElements)&&s.activeElement!==p&&("mouse"===r.pointerType||"mouse"!==r.pointerType&&!p.matches(a.focusableElements))&&s.activeElement.blur();const S=w&&t.allowTouchMove&&l.touchStartPreventDefault;!l.touchStartForcePreventDefault&&!S||p.isContentEditable||r.preventDefault(),l.freeMode&&l.freeMode.enabled&&t.freeMode&&t.animating&&!l.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function N(e){const t=i(),s=this,r=s.touchEventsData,{params:n,touches:a,rtlTranslate:l,enabled:d}=s;if(!d)return;if(!n.simulateTouch&&"mouse"===e.pointerType)return;let c,p=e;if(p.originalEvent&&(p=p.originalEvent),"pointermove"===p.type){if(null!==r.touchId)return;if(p.pointerId!==r.pointerId)return}if("touchmove"===p.type){if(c=[...p.changedTouches].find(e=>e.identifier===r.touchId),!c||c.identifier!==r.touchId)return}else c=p;if(!r.isTouched)return void(r.startMoving&&r.isScrolling&&s.emit("touchMoveOpposite",p));const u=c.pageX,f=c.pageY;if(p.preventedByNestedSwiper)return a.startX=u,void(a.startY=f);if(!s.allowTouchMove)return p.target.matches(r.focusableElements)||(s.allowClick=!1),void(r.isTouched&&(Object.assign(a,{startX:u,startY:f,currentX:u,currentY:f}),r.touchStartTime=o()));if(n.touchReleaseOnEdges&&!n.loop)if(s.isVertical()){if(f<a.startY&&s.translate<=s.maxTranslate()||f>a.startY&&s.translate>=s.minTranslate())return r.isTouched=!1,void(r.isMoved=!1)}else{if(l&&(u>a.startX&&-s.translate<=s.maxTranslate()||u<a.startX&&-s.translate>=s.minTranslate()))return;if(!l&&(u<a.startX&&s.translate<=s.maxTranslate()||u>a.startX&&s.translate>=s.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==p.target&&"mouse"!==p.pointerType&&t.activeElement.blur(),t.activeElement&&p.target===t.activeElement&&p.target.matches(r.focusableElements))return r.isMoved=!0,void(s.allowClick=!1);r.allowTouchCallbacks&&s.emit("touchMove",p),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=u,a.currentY=f;const h=a.currentX-a.startX,m=a.currentY-a.startY;if(s.params.threshold&&Math.sqrt(h**2+m**2)<s.params.threshold)return;if(void 0===r.isScrolling){let e;s.isHorizontal()&&a.currentY===a.startY||s.isVertical()&&a.currentX===a.startX?r.isScrolling=!1:h*h+m*m>=25&&(e=180*Math.atan2(Math.abs(m),Math.abs(h))/Math.PI,r.isScrolling=s.isHorizontal()?e>n.touchAngle:90-e>n.touchAngle)}if(r.isScrolling&&s.emit("touchMoveOpposite",p),void 0===r.startMoving&&(a.currentX===a.startX&&a.currentY===a.startY||(r.startMoving=!0)),r.isScrolling||"touchmove"===p.type&&r.preventTouchMoveFromPointerMove)return void(r.isTouched=!1);if(!r.startMoving)return;s.allowClick=!1,!n.cssMode&&p.cancelable&&p.preventDefault(),n.touchMoveStopPropagation&&!n.nested&&p.stopPropagation();let g=s.isHorizontal()?h:m,v=s.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;n.oneWayMovement&&(g=Math.abs(g)*(l?1:-1),v=Math.abs(v)*(l?1:-1)),a.diff=g,g*=n.touchRatio,l&&(g=-g,v=-v);const w=s.touchesDirection;s.swipeDirection=g>0?"prev":"next",s.touchesDirection=v>0?"prev":"next";const S=s.params.loop&&!n.cssMode,T="next"===s.touchesDirection&&s.allowSlideNext||"prev"===s.touchesDirection&&s.allowSlidePrev;if(!r.isMoved){if(S&&T&&s.loopFix({direction:s.swipeDirection}),r.startTranslate=s.getTranslate(),s.setTransition(0),s.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});s.wrapperEl.dispatchEvent(e)}r.allowMomentumBounce=!1,!n.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",p)}if((new Date).getTime(),!1!==n._loopSwapReset&&r.isMoved&&r.allowThresholdMove&&w!==s.touchesDirection&&S&&T&&Math.abs(g)>=1)return Object.assign(a,{startX:u,startY:f,currentX:u,currentY:f,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,void(r.startTranslate=r.currentTranslate);s.emit("sliderMove",p),r.isMoved=!0,r.currentTranslate=g+r.startTranslate;let b=!0,x=n.resistanceRatio;if(n.touchReleaseOnEdges&&(x=0),g>0?(S&&T&&r.allowThresholdMove&&r.currentTranslate>(n.centeredSlides?s.minTranslate()-s.slidesSizesGrid[s.activeIndex+1]-("auto"!==n.slidesPerView&&s.slides.length-n.slidesPerView>=2?s.slidesSizesGrid[s.activeIndex+1]+s.params.spaceBetween:0)-s.params.spaceBetween:s.minTranslate())&&s.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>s.minTranslate()&&(b=!1,n.resistance&&(r.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+r.startTranslate+g)**x))):g<0&&(S&&T&&r.allowThresholdMove&&r.currentTranslate<(n.centeredSlides?s.maxTranslate()+s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween+("auto"!==n.slidesPerView&&s.slides.length-n.slidesPerView>=2?s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween:0):s.maxTranslate())&&s.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:s.slides.length-("auto"===n.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(n.slidesPerView,10)))}),r.currentTranslate<s.maxTranslate()&&(b=!1,n.resistance&&(r.currentTranslate=s.maxTranslate()+1-(s.maxTranslate()-r.startTranslate-g)**x))),b&&(p.preventedByNestedSwiper=!0),!s.allowSlideNext&&"next"===s.swipeDirection&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!s.allowSlidePrev&&"prev"===s.swipeDirection&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),s.allowSlidePrev||s.allowSlideNext||(r.currentTranslate=r.startTranslate),n.threshold>0){if(!(Math.abs(g)>n.threshold||r.allowThresholdMove))return void(r.currentTranslate=r.startTranslate);if(!r.allowThresholdMove)return r.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,r.currentTranslate=r.startTranslate,void(a.diff=s.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY)}n.followFinger&&!n.cssMode&&((n.freeMode&&n.freeMode.enabled&&s.freeMode||n.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),n.freeMode&&n.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(r.currentTranslate),s.setTranslate(r.currentTranslate))}function F(e){const t=this,s=t.touchEventsData;let i,r=e;r.originalEvent&&(r=r.originalEvent);if("touchend"===r.type||"touchcancel"===r.type){if(i=[...r.changedTouches].find(e=>e.identifier===s.touchId),!i||i.identifier!==s.touchId)return}else{if(null!==s.touchId)return;if(r.pointerId!==s.pointerId)return;i=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)){if(!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return}s.pointerId=null,s.touchId=null;const{params:n,touches:l,rtlTranslate:d,slidesGrid:c,enabled:p}=t;if(!p)return;if(!n.simulateTouch&&"mouse"===r.pointerType)return;if(s.allowTouchCallbacks&&t.emit("touchEnd",r),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&n.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);n.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const u=o(),f=u-s.touchStartTime;if(t.allowClick){const e=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(e&&e[0]||r.target,e),t.emit("tap click",r),f<300&&u-s.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(s.lastClickTime=o(),a(()=>{t.destroyed||(t.allowClick=!0)}),!s.isTouched||!s.isMoved||!t.swipeDirection||0===l.diff&&!s.loopSwapReset||s.currentTranslate===s.startTranslate&&!s.loopSwapReset)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let h;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,h=n.followFinger?d?t.translate:-t.translate:-s.currentTranslate,n.cssMode)return;if(n.freeMode&&n.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});const m=h>=-t.maxTranslate()&&!t.params.loop;let g=0,v=t.slidesSizesGrid[0];for(let e=0;e<c.length;e+=e<n.slidesPerGroupSkip?1:n.slidesPerGroup){const t=e<n.slidesPerGroupSkip-1?1:n.slidesPerGroup;void 0!==c[e+t]?(m||h>=c[e]&&h<c[e+t])&&(g=e,v=c[e+t]-c[e]):(m||h>=c[e])&&(g=e,v=c[c.length-1]-c[c.length-2])}let w=null,S=null;n.rewind&&(t.isBeginning?S=n.virtual&&n.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(w=0));const T=(h-c[g])/v,b=g<n.slidesPerGroupSkip-1?1:n.slidesPerGroup;if(f>n.longSwipesMs){if(!n.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(T>=n.longSwipesRatio?t.slideTo(n.rewind&&t.isEnd?w:g+b):t.slideTo(g)),"prev"===t.swipeDirection&&(T>1-n.longSwipesRatio?t.slideTo(g+b):null!==S&&T<0&&Math.abs(T)>n.longSwipesRatio?t.slideTo(S):t.slideTo(g))}else{if(!n.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(g+b):t.slideTo(g):("next"===t.swipeDirection&&t.slideTo(null!==w?w:g+b),"prev"===t.swipeDirection&&t.slideTo(null!==S?S:g))}}function $(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:r,snapGrid:n}=e,a=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const o=a&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||o?e.params.loop&&!a?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=r,e.allowSlideNext=i,e.params.watchOverflow&&n!==e.snapGrid&&e.checkOverflow()}function H(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function R(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:i}=e;if(!i)return;let r;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const n=e.maxTranslate()-e.minTranslate();r=0===n?0:(e.translate-e.minTranslate())/n,r!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function j(e){const t=this;L(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function W(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const X=(e,t)=>{const s=i(),{params:r,el:n,wrapperEl:a,device:o}=e,l=!!r.nested,d="on"===t?"addEventListener":"removeEventListener",c=t;n&&"string"!=typeof n&&(s[d]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:l}),n[d]("touchstart",e.onTouchStart,{passive:!1}),n[d]("pointerdown",e.onTouchStart,{passive:!1}),s[d]("touchmove",e.onTouchMove,{passive:!1,capture:l}),s[d]("pointermove",e.onTouchMove,{passive:!1,capture:l}),s[d]("touchend",e.onTouchEnd,{passive:!0}),s[d]("pointerup",e.onTouchEnd,{passive:!0}),s[d]("pointercancel",e.onTouchEnd,{passive:!0}),s[d]("touchcancel",e.onTouchEnd,{passive:!0}),s[d]("pointerout",e.onTouchEnd,{passive:!0}),s[d]("pointerleave",e.onTouchEnd,{passive:!0}),s[d]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&n[d]("click",e.onClick,!0),r.cssMode&&a[d]("scroll",e.onScroll),r.updateOnWindowResize?e[c](o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate",$,!0):e[c]("observerUpdate",$,!0),n[d]("load",e.onLoad,{capture:!0}))};const Y=(e,t)=>e.grid&&t.grid&&t