swiper
Version:
Most modern mobile touch slider and framework with hardware accelerated transitions
13 lines (12 loc) • 183 kB
JavaScript
/**
* Swiper Custom Element 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
*/
!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 a(){const e="undefined"!=typeof window?window:{};return t(e,r),e}function n(e=""){return e.trim().split(" ").filter(e=>!!e.trim())}function l(e,t=0){return setTimeout(e,t)}function o(){return Date.now()}function d(e,t="x"){const s=a();let i,r,n;const l=function(e){const t=a();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=l.transform||l.webkitTransform,r.split(",").length>6&&(r=r.split(", ").map(e=>e.replace(",",".")).join(", ")),n=new s.WebKitCSSMatrix("none"===r?"":r)):(n=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=n.toString().split(",")),"x"===t&&(r=s.WebKitCSSMatrix?n.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===t&&(r=s.WebKitCSSMatrix?n.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),r||0}function p(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 u(...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],a=Object.getOwnPropertyDescriptor(r,i);void 0!==a&&a.enumerable&&(p(t[i])&&p(r[i])?r[i].__swiper__?t[i]=r[i]:u(t[i],r[i]):!p(t[i])&&p(r[i])?(t[i]={},r[i].__swiper__?t[i]=r[i]:u(t[i],r[i])):t[i]=r[i])}}}return t}function m(e,t,s){e.style.setProperty(t,s)}function h({swiper:e,targetPosition:t,side:s}){const i=a(),r=-e.translate;let n,l=null;const o=e.params.speed;e.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(e.cssModeFrameID);const d=t>r?"next":"prev",p=(e,t)=>"next"===d&&e>=t||"prev"===d&&e<=t,c=()=>{n=(new Date).getTime(),null===l&&(l=n);const a=Math.max(Math.min((n-l)/o,1),0),d=.5-Math.cos(a*Math.PI)/2;let u=r+d*(t-r);if(p(u,t)&&(u=t),e.wrapperEl.scrollTo({[s]:u}),p(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(c)};c()}function f(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function g(e,t=""){const s=a(),i=[...e.children];return s.HTMLSlotElement&&e instanceof HTMLSlotElement&&i.push(...e.assignedElements()),t?i.filter(e=>e.matches(t)):i}function v(e){try{return void console.warn(e)}catch(e){}}function w(e,t=[]){const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:n(t)),s}function b(e){const t=a(),s=i(),r=e.getBoundingClientRect(),n=s.body,l=e.clientTop||n.clientTop||0,o=e.clientLeft||n.clientLeft||0,d=e===t?t.scrollY:e.scrollTop,p=e===t?t.scrollX:e.scrollLeft;return{top:r.top+d-l,left:r.left+p-o}}function y(e,t){return a().getComputedStyle(e,null).getPropertyValue(t)}function x(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function E(e,t){const s=[];let i=e.parentElement;for(;i;)t?i.matches(t)&&s.push(i):s.push(i),i=i.parentElement;return s}function S(e,t){t&&e.addEventListener("transitionend",function s(i){i.target===e&&(t.call(e,i),e.removeEventListener("transitionend",s))})}function T(e,t,s){const i=a();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}function M(e){return(Array.isArray(e)?e:[e]).filter(e=>!!e)}function C(e){return t=>Math.abs(t)>0&&e.browser&&e.browser.need3dFix&&Math.abs(t)%90==0?t+.001:t}function P(e,t=""){"undefined"!=typeof trustedTypes?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:e=>e}).createHTML(t):e.innerHTML=t}let z,L,k;function A(){return z||(z=function(){const e=a(),t=i();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),z}function I(e={}){return L||(L=function({userAgent:e}={}){const t=A(),s=a(),i=s.navigator.platform,r=e||s.navigator.userAgent,n={ios:!1,android:!1},l=s.screen.width,o=s.screen.height,d=r.match(/(Android);?[\s\/]+([\d.]+)?/);let p=r.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const c=r.match(/(iPod)(.*OS\s([\d_]+))?/),u=!p&&r.match(/(iPhone\sOS|iOS)\s([\d_]+)/),m="Win32"===i;let h="MacIntel"===i;return!p&&h&&t.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${l}x${o}`)>=0&&(p=r.match(/(Version)\/([\d.]+)/),p||(p=[0,1,"13_0_0"]),h=!1),d&&!m&&(n.os="android",n.android=!0),(p||u||c)&&(n.os="ios",n.ios=!0),n}(e)),L}function $(){return k||(k=function(){const e=a(),t=I();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),n=i();return{isSafari:s||n,needPerspectiveFix:s,need3dFix:n||r&&t.ios,isWebView:r}}()),k}var O={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 D=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const _=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};const G=(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()}},B=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},X=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,a=[s-t];return a.push(...Array.from({length:t}).map((e,t)=>s+i+t)),void e.slides.forEach((t,s)=>{a.includes(t.column)&&B(e,s)})}const a=r+i-1;if(e.params.rewind||e.params.loop)for(let i=r-t;i<=a+t;i+=1){const t=(i%s+s)%s;(t<r||t>a)&&B(e,t)}else for(let i=Math.max(r-t,0);i<=Math.min(a+t,s-1);i+=1)i!==r&&(i>a||i<r)&&B(e,i)};var N={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(y(i,"padding-left")||0,10)-parseInt(y(i,"padding-right")||0,10),s=s-parseInt(y(i,"padding-top")||0,10)-parseInt(y(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:a,wrongRTL:n}=e,l=e.virtual&&s.virtual.enabled,o=l?e.virtual.slides.length:e.slides.length,d=g(r,`.${e.params.slideClass}, swiper-slide`),p=l?e.virtual.slides.length:d.length;let c=[];const u=[],h=[];let f=s.slidesOffsetBefore;"function"==typeof f&&(f=s.slidesOffsetBefore.call(e));let v=s.slidesOffsetAfter;"function"==typeof v&&(v=s.slidesOffsetAfter.call(e));const w=e.snapGrid.length,b=e.slidesGrid.length,x=e.size-f-v;let E=s.spaceBetween,S=-f,M=0,C=0;if(void 0===x)return;"string"==typeof E&&E.indexOf("%")>=0?E=parseFloat(E.replace("%",""))/100*x:"string"==typeof E&&(E=parseFloat(E)),e.virtualSize=-E-f-v,d.forEach(e=>{a?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""}),s.centeredSlides&&s.cssMode&&(m(i,"--swiper-centered-offset-before",""),m(i,"--swiper-centered-offset-after",""));const P=s.grid&&s.grid.rows>1&&e.grid;let z;P?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<p;i+=1){z=0;const r=d[i];if(!r||(P&&e.grid.updateSlide(i,r,d),"none"!==y(r,"display"))){if(l&&"auto"===s.slidesPerView)s.virtual.slidesPerViewAutoSlideSize&&(z=s.virtual.slidesPerViewAutoSlideSize),z&&r&&(s.roundLengths&&(z=Math.floor(z)),r.style[e.getDirectionLabel("width")]=`${z}px`);else if("auto"===s.slidesPerView){L&&(r.style[e.getDirectionLabel("width")]="");const i=getComputedStyle(r),a=r.style.transform,n=r.style.webkitTransform;if(a&&(r.style.transform="none"),n&&(r.style.webkitTransform="none"),s.roundLengths)z=e.isHorizontal()?T(r,"width",!0):T(r,"height",!0);else{const e=t(i,"width"),s=t(i,"padding-left"),a=t(i,"padding-right"),n=t(i,"margin-left"),l=t(i,"margin-right"),o=i.getPropertyValue("box-sizing");if(o&&"border-box"===o)z=e+n+l;else{const{clientWidth:t,offsetWidth:i}=r;z=e+s+a+n+l+(i-t)}}a&&(r.style.transform=a),n&&(r.style.webkitTransform=n),s.roundLengths&&(z=Math.floor(z))}else z=(x-(s.slidesPerView-1)*E)/s.slidesPerView,s.roundLengths&&(z=Math.floor(z)),r&&(r.style[e.getDirectionLabel("width")]=`${z}px`);r&&(r.swiperSlideSize=z),h.push(z),s.centeredSlides?(S=S+z/2+M/2+E,0===M&&0!==i&&(S=S-x/2-E),0===i&&(S=S-x/2-E),Math.abs(S)<.001&&(S=0),s.roundLengths&&(S=Math.floor(S)),C%s.slidesPerGroup===0&&c.push(S),u.push(S)):(s.roundLengths&&(S=Math.floor(S)),(C-Math.min(e.params.slidesPerGroupSkip,C))%e.params.slidesPerGroup===0&&c.push(S),u.push(S),S=S+z+E),e.virtualSize+=z+E,M=z,C+=1}}if(e.virtualSize=Math.max(e.virtualSize,x)+v,a&&n&&("slide"===s.effect||"coverflow"===s.effect)&&(i.style.width=`${e.virtualSize+E}px`),s.setWrapperSize&&(i.style[e.getDirectionLabel("width")]=`${e.virtualSize+E}px`),P&&e.grid.updateWrapperSize(z,c),!s.centeredSlides){const t=[];for(let i=0;i<c.length;i+=1){let r=c[i];s.roundLengths&&(r=Math.floor(r)),c[i]<=e.virtualSize-x&&t.push(r)}c=t,Math.floor(e.virtualSize-x)-Math.floor(c[c.length-1])>1&&c.push(e.virtualSize-x)}if(l&&s.loop){const t=h[0]+E;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)c.push(c[c.length-1]+r)}for(let i=0;i<e.virtual.slidesBefore+e.virtual.slidesAfter;i+=1)1===s.slidesPerGroup&&c.push(c[c.length-1]+t),u.push(u[u.length-1]+t),e.virtualSize+=t}if(0===c.length&&(c=[0]),0!==E){const t=e.isHorizontal()&&a?"marginLeft":e.getDirectionLabel("marginRight");d.filter((e,t)=>!(s.cssMode&&!s.loop)||t!==d.length-1).forEach(e=>{e.style[t]=`${E}px`})}if(s.centeredSlides&&s.centeredSlidesBounds){let e=0;h.forEach(t=>{e+=t+(E||0)}),e-=E;const t=e>x?e-x:0;c=c.map(e=>e<=0?-f:e>t?t+v:e)}if(s.centerInsufficientSlides){let e=0;h.forEach(t=>{e+=t+(E||0)}),e-=E;const t=(f||0)+(v||0);if(e+t<x){const s=(x-e-t)/2;c.forEach((e,t)=>{c[t]=e-s}),u.forEach((e,t)=>{u[t]=e+s})}}if(Object.assign(e,{slides:d,snapGrid:c,slidesGrid:u,slidesSizesGrid:h}),s.centeredSlides&&s.cssMode&&!s.centeredSlidesBounds){m(i,"--swiper-centered-offset-before",-c[0]+"px"),m(i,"--swiper-centered-offset-after",e.size/2-h[h.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(p!==o&&e.emit("slidesLengthChange"),c.length!==w&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),u.length!==b&&e.emit("slidesGridLengthChange"),s.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(l||s.cssMode||"slide"!==s.effect&&"fade"!==s.effect)){const t=`${s.containerModifierClass}backface-hidden`,i=e.el.classList.contains(t);p<=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,a=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=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(n(e))}else s.push(n(t.activeIndex));for(r=0;r<s.length;r+=1)if(void 0!==s[r]){const e=s[r].offsetHeight;a=e>a?e:a}(a||0===a)&&(t.wrapperEl.style.height=`${a}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:a}=t;if(0===i.length)return;void 0===i[0].swiperSlideOffset&&t.updateSlidesOffset();let n=-e;r&&(n=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let l=s.spaceBetween;"string"==typeof l&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*t.size:"string"==typeof l&&(l=parseFloat(l));for(let e=0;e<i.length;e+=1){const o=i[e];let d=o.swiperSlideOffset;s.cssMode&&s.centeredSlides&&(d-=i[0].swiperSlideOffset);const p=(n+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),c=(n-a[0]+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),u=-(n-d),m=u+t.slidesSizesGrid[e],h=u>=0&&u<=t.size-t.slidesSizesGrid[e],f=u>=0&&u<t.size-1||m>1&&m<=t.size||u<=0&&m>=t.size;f&&(t.visibleSlides.push(o),t.visibleSlidesIndexes.push(e)),D(o,f,s.slideVisibleClass),D(o,h,s.slideFullyVisibleClass),o.progress=r?-p:p,o.originalProgress=r?-c:c}},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:a,isEnd:n,progressLoop:l}=t;const o=a,d=n;if(0===i)r=0,a=!0,n=!0;else{r=(e-t.minTranslate())/i;const s=Math.abs(e-t.minTranslate())<1,l=Math.abs(e-t.maxTranslate())<1;a=s||r<=0,n=l||r>=1,s&&(r=0),l&&(r=1)}if(s.loop){const s=t.getSlideIndexByData(0),i=t.getSlideIndexByData(t.slides.length-1),r=t.slidesGrid[s],a=t.slidesGrid[i],n=t.slidesGrid[t.slidesGrid.length-1],o=Math.abs(e);l=o>=r?(o-r)/n:(o+n-a)/n,l>1&&(l-=1)}Object.assign(t,{progress:r,progressLoop:l,isBeginning:a,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),a&&!o&&t.emit("reachBeginning toEdge"),n&&!d&&t.emit("reachEnd toEdge"),(o&&!a||d&&!n)&&t.emit("fromEdge"),t.emit("progress",r)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:i,activeIndex:r}=e,a=e.virtual&&s.virtual.enabled,n=e.grid&&s.grid&&s.grid.rows>1,l=e=>g(i,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let o,d,p;if(a)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),o=l(`[data-swiper-slide-index="${t}"]`)}else o=l(`[data-swiper-slide-index="${r}"]`);else n?(o=t.find(e=>e.column===r),p=t.find(e=>e.column===r+1),d=t.find(e=>e.column===r-1)):o=t[r];o&&(n||(p=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}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!p&&(p=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}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&0===!d&&(d=t[t.length-1]))),t.forEach(e=>{_(e,e===o,s.slideActiveClass),_(e,e===p,s.slideNextClass),_(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:a,realIndex:n,snapIndex:l}=t;let o,d=e;const p=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)o=i.indexOf(s);else{const e=Math.min(r.slidesPerGroupSkip,d);o=e+Math.floor((d-e)/r.slidesPerGroup)}if(o>=i.length&&(o=i.length-1),d===a&&!t.params.loop)return void(o!==l&&(t.snapIndex=o,t.emit("snapIndexChange")));if(d===a&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=p(d));const c=t.grid&&r.grid&&r.grid.rows>1;let u;if(t.virtual&&r.virtual.enabled&&r.loop)u=p(d);else if(c){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:l,snapIndex:o,previousRealIndex:n,realIndex:u,previousIndex:a,activeIndex:d}),t.initialized&&X(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(n!==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 a,n=!1;if(r)for(let e=0;e<s.slides.length;e+=1)if(s.slides[e]===r){n=!0,a=e;break}if(!r||!n)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=a,i.slideToClickedSlide&&void 0!==s.clickedIndex&&s.clickedIndex!==s.activeIndex&&s.slideToClickedSlide()}};var R={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 a=d(r,e);return a+=this.cssOverflowAdjustment(),s&&(a=-a),a||0},setTranslate:function(e,t){const s=this,{rtlTranslate:i,params:r,wrapperEl:a,progress:n}=s;let l,o=0,d=0;s.isHorizontal()?o=i?-e:e:d=e,r.roundLengths&&(o=Math.floor(o),d=Math.floor(d)),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?o:d,r.cssMode?a[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-o:-d:r.virtualTranslate||(s.isHorizontal()?o-=s.cssOverflowAdjustment():d-=s.cssOverflowAdjustment(),a.style.transform=`translate3d(${o}px, ${d}px, 0px)`);const p=s.maxTranslate()-s.minTranslate();l=0===p?0:(e-s.minTranslate())/p,l!==n&&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 a=this,{params:n,wrapperEl:l}=a;if(a.animating&&n.preventInteractionOnTransition)return!1;const o=a.minTranslate(),d=a.maxTranslate();let p;if(p=i&&e>o?o:i&&e<d?d:e,a.updateProgress(p),n.cssMode){const e=a.isHorizontal();if(0===t)l[e?"scrollLeft":"scrollTop"]=-p;else{if(!a.support.smoothScroll)return h({swiper:a,targetPosition:-p,side:e?"left":"top"}),!0;l.scrollTo({[e?"left":"top"]:-p,behavior:"smooth"})}return!0}return 0===t?(a.setTransition(0),a.setTranslate(p),s&&(a.emit("beforeTransitionStart",t,r),a.emit("transitionEnd"))):(a.setTransition(t),a.setTranslate(p),s&&(a.emit("beforeTransitionStart",t,r),a.emit("transitionStart")),a.animating||(a.animating=!0,a.onTranslateToWrapperTransitionEnd||(a.onTranslateToWrapperTransitionEnd=function(e){a&&!a.destroyed&&e.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onTranslateToWrapperTransitionEnd),a.onTranslateToWrapperTransitionEnd=null,delete a.onTranslateToWrapperTransitionEnd,a.animating=!1,s&&a.emit("transitionEnd"))}),a.wrapperEl.addEventListener("transitionend",a.onTranslateToWrapperTransitionEnd))),!0}};function H({swiper:e,runCallbacks:t,direction:s,step:i}){const{activeIndex:r,previousIndex:a}=e;let n=s;n||(n=r>a?"next":r<a?"prev":"reset"),e.emit(`transition${i}`),t&&"reset"===n?e.emit(`slideResetTransition${i}`):t&&r!==a&&(e.emit(`slideChangeTransition${i}`),"next"===n?e.emit(`slideNextTransition${i}`):e.emit(`slidePrevTransition${i}`))}var Y={slideTo:function(e=0,t,s=!0,i,r){"string"==typeof e&&(e=parseInt(e,10));const a=this;let n=e;n<0&&(n=0);const{params:l,snapGrid:o,slidesGrid:d,previousIndex:p,activeIndex:c,rtlTranslate:u,wrapperEl:m,enabled:f}=a;if(!f&&!i&&!r||a.destroyed||a.animating&&l.preventInteractionOnTransition)return!1;void 0===t&&(t=a.params.speed);const g=Math.min(a.params.slidesPerGroupSkip,n);let v=g+Math.floor((n-g)/a.params.slidesPerGroup);v>=o.length&&(v=o.length-1);const w=-o[v];if(l.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?n=e:t>=s&&t<i&&(n=e+1):t>=s&&(n=e)}if(a.initialized&&n!==c){if(!a.allowSlideNext&&(u?w>a.translate&&w>a.minTranslate():w<a.translate&&w<a.minTranslate()))return!1;if(!a.allowSlidePrev&&w>a.translate&&w>a.maxTranslate()&&(c||0)!==n)return!1}let b;n!==(p||0)&&s&&a.emit("beforeSlideChangeStart"),a.updateProgress(w),b=n>c?"next":n<c?"prev":"reset";const y=a.virtual&&a.params.virtual.enabled;if(!(y&&r)&&(u&&-w===a.translate||!u&&w===a.translate))return a.updateActiveIndex(n),l.autoHeight&&a.updateAutoHeight(),a.updateSlidesClasses(),"slide"!==l.effect&&a.setTranslate(w),"reset"!==b&&(a.transitionStart(s,b),a.transitionEnd(s,b)),!1;if(l.cssMode){const e=a.isHorizontal(),s=u?w:-w;if(0===t)y&&(a.wrapperEl.style.scrollSnapType="none",a._immediateVirtual=!0),y&&!a._cssModeVirtualInitialSet&&a.params.initialSlide>0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{m[e?"scrollLeft":"scrollTop"]=s})):m[e?"scrollLeft":"scrollTop"]=s,y&&requestAnimationFrame(()=>{a.wrapperEl.style.scrollSnapType="",a._immediateVirtual=!1});else{if(!a.support.smoothScroll)return h({swiper:a,targetPosition:s,side:e?"left":"top"}),!0;m.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}const x=$().isSafari;return y&&!r&&x&&a.isElement&&a.virtual.update(!1,!1,n),a.setTransition(t),a.setTranslate(w),a.updateActiveIndex(n),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,i),a.transitionStart(s,b),0===t?a.transitionEnd(s,b):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(e){a&&!a.destroyed&&e.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(s,b))}),a.wrapperEl.addEventListener("transitionend",a.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 a=r.grid&&r.params.grid&&r.params.grid.rows>1;let n=e;if(r.params.loop)if(r.virtual&&r.params.virtual.enabled)n+=r.virtual.slidesBefore;else{let e;if(a){const t=n*r.params.grid.rows;e=r.slides.find(e=>1*e.getAttribute("data-swiper-slide-index")===t).column}else e=r.getSlideIndexByData(n);const t=a?Math.ceil(r.slides.length/r.params.grid.rows):r.slides.length,{centeredSlides:s,slidesOffsetBefore:l,slidesOffsetAfter:o}=r.params,d=s||!!l||!!o;let p=r.params.slidesPerView;"auto"===p?p=r.slidesPerViewDynamic():(p=Math.ceil(parseFloat(r.params.slidesPerView,10)),d&&p%2==0&&(p+=1));let c=t-e<p;if(d&&(c=c||e<Math.ceil(p/2)),i&&d&&"auto"!==r.params.slidesPerView&&!a&&(c=!1),c){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(a){const e=n*r.params.grid.rows;n=r.slides.find(t=>1*t.getAttribute("data-swiper-slide-index")===e).column}else n=r.getSlideIndexByData(n)}return requestAnimationFrame(()=>{r.slideTo(n,t,s,i)}),r},slideNext:function(e,t=!0,s){const i=this,{enabled:r,params:a,animating:n}=i;if(!r||i.destroyed)return i;void 0===e&&(e=i.params.speed);let l=a.slidesPerGroup;"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(l=Math.max(i.slidesPerViewDynamic("current",!0),1));const o=i.activeIndex<a.slidesPerGroupSkip?1:l,d=i.virtual&&a.virtual.enabled;if(a.loop){if(n&&!d&&a.loopPreventsSliding)return!1;if(i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft,i.activeIndex===i.slides.length-1&&a.cssMode)return requestAnimationFrame(()=>{i.slideTo(i.activeIndex+o,e,t,s)}),!0}return a.rewind&&i.isEnd?i.slideTo(0,e,t,s):i.slideTo(i.activeIndex+o,e,t,s)},slidePrev:function(e,t=!0,s){const i=this,{params:r,snapGrid:a,slidesGrid:n,rtlTranslate:l,enabled:o,animating:d}=i;if(!o||i.destroyed)return i;void 0===e&&(e=i.params.speed);const p=i.virtual&&r.virtual.enabled;if(r.loop){if(d&&!p&&r.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}function c(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=c(l?i.translate:-i.translate),m=a.map(e=>c(e)),h=r.freeMode&&r.freeMode.enabled;let f=a[m.indexOf(u)-1];if(void 0===f&&(r.cssMode||h)){let e;a.forEach((t,s)=>{u>=t&&(e=s)}),void 0!==e&&(f=h?a[e]:a[e>0?e-1:e])}let g=0;if(void 0!==f&&(g=n.indexOf(f),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 a=r.activeIndex;const n=Math.min(r.params.slidesPerGroupSkip,a),l=n+Math.floor((a-n)/r.params.slidesPerGroup),o=r.rtlTranslate?r.translate:-r.translate;if(o>=r.snapGrid[l]){const e=r.snapGrid[l];o-e>(r.snapGrid[l+1]-e)*i&&(a+=r.params.slidesPerGroup)}else{const e=r.snapGrid[l-1];o-e<=(r.snapGrid[l]-e)*i&&(a-=r.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,r.slidesGrid.length-1),r.slideTo(a,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,a=e.getSlideIndexWhenGrid(e.clickedIndex);const n=e.isElement?"swiper-slide":`.${t.slideClass}`,o=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):a>(o?(e.slides.length-i)/2-(e.params.grid.rows-1):e.slides.length-i)?(e.loopFix(),a=e.getSlideIndex(g(s,`${n}[data-swiper-slide-index="${r}"]`)[0]),l(()=>{e.slideTo(a)})):e.slideTo(a)}else e.slideTo(a)}};var V={loopCreate:function(e,t){const s=this,{params:i,slidesEl:r}=s;if(!i.loop||s.virtual&&s.params.virtual.enabled)return;const a=()=>{g(r,`.${i.slideClass}, swiper-slide`).forEach((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})},n=s.grid&&i.grid&&i.grid.rows>1;i.loopAddBlankSlides&&(i.slidesPerGroup>1||n)&&(()=>{const e=g(r,`.${i.slideBlankClass}`);e.forEach(e=>{e.remove()}),e.length>0&&(s.recalcSlides(),s.updateSlides())})();const l=i.slidesPerGroup*(n?i.grid.rows:1),o=s.slides.length%l!==0,d=n&&s.slides.length%i.grid.rows!==0,p=e=>{for(let t=0;t<e;t+=1){const e=s.isElement?w("swiper-slide",[i.slideBlankClass]):w("div",[i.slideClass,i.slideBlankClass]);s.slidesEl.append(e)}};if(o){if(i.loopAddBlankSlides){p(l-s.slides.length%l),s.recalcSlides(),s.updateSlides()}else v("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)");a()}else if(d){if(i.loopAddBlankSlides){p(i.grid.rows-s.slides.length%i.grid.rows),s.recalcSlides(),s.updateSlides()}else v("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)");a()}else a();const c=i.centeredSlides||!!i.slidesOffsetBefore||!!i.slidesOffsetAfter;s.loopFix({slideRealIndex:e,direction:c?void 0:"next",initial:t})},loopFix:function({slideRealIndex:e,slideTo:t=!0,direction:s,setTranslate:i,activeSlideIndex:r,initial:a,byController:n,byMousewheel:l}={}){const o=this;if(!o.params.loop)return;o.emit("beforeLoopFix");const{slides:d,allowSlidePrev:p,allowSlideNext:c,slidesEl:u,params:m}=o,{centeredSlides:h,slidesOffsetBefore:f,slidesOffsetAfter:g,initialSlide:w}=m,b=h||!!f||!!g;if(o.allowSlidePrev=!0,o.allowSlideNext=!0,o.virtual&&m.virtual.enabled)return t&&(b||0!==o.snapIndex?b&&o.snapIndex<m.slidesPerView?o.slideTo(o.virtual.slides.length+o.snapIndex,0,!1,!0):o.snapIndex===o.snapGrid.length-1&&o.slideTo(o.virtual.slidesBefore,0,!1,!0):o.slideTo(o.virtual.slides.length,0,!1,!0)),o.allowSlidePrev=p,o.allowSlideNext=c,void o.emit("loopFix");let y=m.slidesPerView;"auto"===y?y=o.slidesPerViewDynamic():(y=Math.ceil(parseFloat(m.slidesPerView,10)),b&&y%2==0&&(y+=1));const x=m.slidesPerGroupAuto?y:m.slidesPerGroup;let E=b?Math.max(x,Math.ceil(y/2)):x;E%x!==0&&(E+=x-E%x),E+=m.loopAdditionalSlides,o.loopedSlides=E;const S=o.grid&&m.grid&&m.grid.rows>1;d.length<y+E||"cards"===o.params.effect&&d.length<y+2*E?v("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"):S&&"row"===m.grid.fill&&v("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const T=[],M=[],C=S?Math.ceil(d.length/m.grid.rows):d.length,P=a&&C-w<y&&!b;let z=P?w:o.activeIndex;void 0===r?r=o.getSlideIndex(d.find(e=>e.classList.contains(m.slideActiveClass))):z=r;const L="next"===s||!s,k="prev"===s||!s;let A=0,I=0;const $=(S?d[r].column:r)+(b&&void 0===i?-y/2+.5:0);if($<E){A=Math.max(E-$,x);for(let e=0;e<E-$;e+=1){const t=e-Math.floor(e/C)*C;if(S){const e=C-t-1;for(let t=d.length-1;t>=0;t-=1)d[t].column===e&&T.push(t)}else T.push(C-t-1)}}else if($+y>C-E){I=Math.max($-(C-2*E),x),P&&(I=Math.max(I,y-C+w+1));for(let e=0;e<I;e+=1){const t=e-Math.floor(e/C)*C;S?d.forEach((e,s)=>{e.column===t&&M.push(s)}):M.push(t)}}if(o.__preventObserver__=!0,requestAnimationFrame(()=>{o.__preventObserver__=!1}),"cards"===o.params.effect&&d.length<y+2*E&&(M.includes(r)&&M.splice(M.indexOf(r),1),T.includes(r)&&T.splice(T.indexOf(r),1)),k&&T.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}),o.recalcSlides(),"auto"===m.slidesPerView?o.updateSlides():S&&(T.length>0&&k||M.length>0&&L)&&o.slides.forEach((e,t)=>{o.grid.updateSlide(t,e,o.slides)}),m.watchSlidesProgress&&o.updateSlidesOffset(),t)if(T.length>0&&k){if(void 0===e){const e=o.slidesGrid[z],t=o.slidesGrid[z+A]-e;l?o.setTranslate(o.translate-t):(o.slideTo(z+Math.ceil(A),0,!1,!0),i&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else if(i){const e=S?T.length/m.grid.rows:T.length;o.slideTo(o.activeIndex+e,0,!1,!0),o.touchEventsData.currentTranslate=o.translate}}else if(M.length>0&&L)if(void 0===e){const e=o.slidesGrid[z],t=o.slidesGrid[z-I]-e;l?o.setTranslate(o.translate-t):(o.slideTo(z-I,0,!1,!0),i&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else{const e=S?M.length/m.grid.rows:M.length;o.slideTo(o.activeIndex-e,0,!1,!0)}if(o.allowSlidePrev=p,o.allowSlideNext=c,o.controller&&o.controller.control&&!n){const a={slideRealIndex:e,direction:s,setTranslate:i,activeSlideIndex:r,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach(e=>{!e.destroyed&&e.params.loop&&e.loopFix({...a,slideTo:e.params.slidesPerView===m.slidesPerView&&t})}):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix({...a,slideTo:o.controller.control.params.slidesPerView===m.slidesPerView&&t})}o.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 q(e,t,s){const i=a(),{params:r}=e,n=r.edgeSwipeDetection,l=r.edgeSwipeThreshold;return!n||!(s<=l||s>=i.innerWidth-l)||"prevent"===n&&(t.preventDefault(),!0)}function F(e){const t=this,s=i();let r=e;r.originalEvent&&(r=r.originalEvent);const n=t.touchEventsData;if("pointerdown"===r.type){if(null!==n.pointerId&&n.pointerId!==r.pointerId)return;n.pointerId=r.pointerId}else"touchstart"===r.type&&1===r.targetTouches.length&&(n.touchId=r.targetTouches[0].identifier);if("touchstart"===r.type)return void q(t,r,r.targetTouches[0].pageX);const{params:l,touches:d,enabled:p}=t;if(!p)return;if(!l.simulateTouch&&"mouse"===r.pointerType)return;if(t.animating&&l.preventInteractionOnTransition)return;!t.animating&&l.cssMode&&l.loop&&t.loopFix();let c=r.target;if("wrapper"===l.touchEventsTarget&&!function(e,t){const s=a();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}(c,t.wrapperEl))return;if("which"in r&&3===r.which)return;if("button"in r&&r.button>0)return;if(n.isTouched&&n.isMoved)return;const u=!!l.noSwipingClass&&""!==l.noSwipingClass,m=r.composedPath?r.composedPath():r.path;u&&r.target&&r.target.shadowRoot&&m&&(c=m[0]);const h=l.noSwipingSelector?l.noSwipingSelector:`.${l.noSwipingClass}`,f=!(!r.target||!r.target.shadowRoot);if(l.noSwiping&&(f?function(e,t=this){return function t(s){if(!s||s===i()||s===a())return null;s.assignedSlot&&(s=s.assignedSlot);const r=s.closest(e);return r||s.getRootNode?r||t(s.getRootNode().host):null}(t)}(h,c):c.closest(h)))return void(t.allowClick=!0);if(l.swipeHandler&&!c.closest(l.swipeHandler))return;d.currentX=r.pageX,d.currentY=r.pageY;const g=d.currentX,v=d.currentY;if(!q(t,r,g))return;Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),d.startX=g,d.startY=v,n.touchStartTime=o(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,l.threshold>0&&(n.allowThresholdMove=!1);let w=!0;c.matches(n.focusableElements)&&(w=!1,"SELECT"===c.nodeName&&(n.isTouched=!1)),s.activeElement&&s.activeElement.matches(n.focusableElements)&&s.activeElement!==c&&("mouse"===r.pointerType||"mouse"!==r.pointerType&&!c.matches(n.focusableElements))&&s.activeElement.blur();const b=w&&t.allowTouchMove&&l.touchStartPreventDefault;!l.touchStartForcePreventDefault&&!b||c.isContentEditable||r.preventDefault(),l.freeMode&&l.freeMode.enabled&&t.freeMode&&t.animating&&!l.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function j(e){const t=i(),s=this,r=s.touchEventsData,{params:a,touches:n,rtlTranslate:l,enabled:d}=s;if(!d)return;if(!a.simulateTouch&&"mouse"===e.pointerType)return;let p,c=e;if(c.originalEvent&&(c=c.originalEvent),"pointermove"===c.type){if(null!==r.touchId)return;if(c.pointerId!==r.pointerId)return}if("touchmove"===c.type){if(p=[...c.changedTouches].find(e=>e.identifier===r.touchId),!p||p.identifier!==r.touchId)return}else p=c;if(!r.isTouched)return void(r.startMoving&&r.isScrolling&&s.emit("touchMoveOpposite",c));const u=p.pageX,m=p.pageY;if(c.preventedByNestedSwiper)return n.startX=u,void(n.startY=m);if(!s.allowTouchMove)return c.target.matches(r.focusableElements)||(s.allowClick=!1),void(r.isTouched&&(Object.assign(n,{startX:u,startY:m,currentX:u,currentY:m}),r.touchStartTime=o()));if(a.touchReleaseOnEdges&&!a.loop)if(s.isVertical()){if(m<n.startY&&s.translate<=s.maxTranslate()||m>n.startY&&s.translate>=s.minTranslate())return r.isTouched=!1,void(r.isMoved=!1)}else{if(l&&(u>n.startX&&-s.translate<=s.maxTranslate()||u<n.startX&&-s.translate>=s.minTranslate()))return;if(!l&&(u<n.startX&&s.translate<=s.maxTranslate()||u>n.startX&&s.translate>=s.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==c.target&&"mouse"!==c.pointerType&&t.activeElement.blur(),t.activeElement&&c.target===t.activeElement&&c.target.matches(r.focusableElements))return r.isMoved=!0,void(s.allowClick=!1);r.allowTouchCallbacks&&s.emit("touchMove",c),n.previousX=n.currentX,n.previousY=n.currentY,n.currentX=u,n.currentY=m;const h=n.currentX-n.startX,f=n.currentY-n.startY;if(s.params.threshold&&Math.sqrt(h**2+f**2)<s.params.threshold)return;if(void 0===r.isScrolling){let e;s.isHorizontal()&&n.currentY===n.startY||s.isVertical()&&n.currentX===n.startX?r.isScrolling=!1:h*h+f*f>=25&&(e=180*Math.atan2(Math.abs(f),Math.abs(h))/Math.PI,r.isScrolling=s.isHorizontal()?e>a.touchAngle:90-e>a.touchAngle)}if(r.isScrolling&&s.emit("touchMoveOpposite",c),void 0===r.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(r.startMoving=!0)),r.isScrolling||"touchmove"===c.type&&r.preventTouchMoveFromPointerMove)return void(r.isTouched=!1);if(!r.startMoving)return;s.allowClick=!1,!a.cssMode&&c.cancelable&&c.preventDefault(),a.touchMoveStopPropagation&&!a.nested&&c.stopPropagation();let g=s.isHorizontal()?h:f,v=s.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;a.oneWayMovement&&(g=Math.abs(g)*(l?1:-1),v=Math.abs(v)*(l?1:-1)),n.diff=g,g*=a.touchRatio,l&&(g=-g,v=-v);const w=s.touchesDirection;s.swipeDirection=g>0?"prev":"next",s.touchesDirection=v>0?"prev":"next";const b=s.params.loop&&!a.cssMode,y="next"===s.touchesDirection&&s.allowSlideNext||"prev"===s.touchesDirection&&s.allowSlidePrev;if(!r.isMoved){if(b&&y&&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,!a.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",c)}if((new Date).getTime(),!1!==a._loopSwapReset&&r.isMoved&&r.allowThresholdMove&&w!==s.touchesDirection&&b&&y&&Math.abs(g)>=1)return Object.assign(n,{startX:u,startY:m,currentX:u,currentY:m,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,void(r.startTranslate=r.currentTranslate);s.emit("sliderMove",c),r.isMoved=!0,r.currentTranslate=g+r.startTranslate;let x=!0,E=a.resistanceRatio;if(a.touchReleaseOnEdges&&(E=0),g>0?(b&&y&&r.allowThresholdMove&&r.currentTranslate>(a.centeredSlides?s.minTranslate()-s.slidesSizesGrid[s.activeIndex+1]-("auto"!==a.slidesPerView&&s.slides.length-a.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()&&(x=!1,a.resistance&&(r.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+r.startTranslate+g)**E))):g<0&&(b&&y&&r.allowThresholdMove&&r.currentTranslate<(a.centeredSlides?s.maxTranslate()+s.slidesSizesGrid[s.slidesSizesGrid.length-1]+s.params.spaceBetween+("auto"!==a.slidesPerView&&s.slides.length-a.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"===a.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(a.slidesPerView,10)))}),r.currentTranslate<s.maxTranslate()&&(x=!1,a.resistance&&(r.currentTranslate=s.maxTranslate()+1-(s.maxTranslate()-r.startTranslate-g)**E))),x&&(c.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),a.threshold>0){if(!(Math.abs(g)>a.threshold||r.allowThresholdMove))return void(r.currentTranslate=r.startTranslate);if(!r.allowThresholdMove)return r.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,r.currentTranslate=r.startTranslate,void(n.diff=s.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}a.followFinger&&!a.cssMode&&((a.freeMode&&a.freeMode.enabled&&s.freeMode||a.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),a.freeMode&&a.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(r.currentTranslate),s.setTranslate(r.currentTranslate))}function W(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:a,touches:n,rtlTranslate:d,slidesGrid:p,enabled:c}=t;if(!c)return;if(!a.simulateTouch&&"mouse"===r.pointerType)return;if(s.allowTouchCallbacks&&t.emit("touchEnd",r),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&a.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);a.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const u=o(),m=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),m<300&&u-s.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(s.lastClickTime=o(),l(()=>{t.destroyed||(t.allowClick=!0)}),!s.isTouched||!s.isMoved||!t.swipeDirection||0===n.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=a.followFinger?d?t.translate:-t.translate:-s.currentTranslate,a.cssMode)return;if(a.freeMode&&a.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});const f=h>=-t.maxTranslate()&&!t.params.loop;let g=0,v=t.slidesSizesGrid[0];for(let e=0;e<p.length;e+=e<a.slidesPerGroupSkip?1:a.slidesPerGroup){const t=e<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;void 0!==p[e+t]?(f||h>=p[e]&&h<p[e+t])&&(g=e,v=p[e+t]-p[e]):(f||h>=p[e])&&(g=e,v=p[p.length-1]-p[p.length-2])}let w=null,b=null;a.rewind&&(t.isBeginning?b=a.virtual&&a.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(w=0));const y=(h-p[g])/v,x=g<a.slidesPerGroupSkip-1?1:a.slidesPerGroup;if(m>a.longSwipesMs){if(!a.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(y>=a.longSwipesRatio?t.slideTo(a.rewind&&t.isEnd?w:g+x):t.slideTo(g)),"prev"===t.swipeDirection&&(y>1-a.longSwipesRatio?t.slideTo(g+x):null!==b&&y<0&&Math.abs(y)>a.longSwipesRatio?t.slideTo(b):t.slideTo(g))}else{if(!a.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+x):t.slideTo(g):("next"===t.swipeDirection&&t.slideTo(null!==w?w:g+x),"prev"===t.swipeDirection&&t.slideTo(null!==b?b:g))}}function U(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:r,snapGrid:a}=e,n=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const l=n&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||l?e.params.loop&&!n?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&&a!==e.snapGrid&&e.checkOverflow()}function K(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function Z(){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 a=e.maxTranslate()-e.minTranslate();r=0===a?0:(e.translate-e.minTranslate())/a,r!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function Q(e){const t=this;G(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function J(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const ee=(e,t)=>{const s=i(),{params:r,el:a,wrapperEl:n,device:l}=e,o=!!r.nested,d="on"===t?"addEventListener":"removeEventListener",p=t;a&&"