{"version":3,"file":"cardCarousel-d36af510.js","sources":["../../../../../../src/scripts/modules/cardCarousel.ts"],"sourcesContent":["import { Component } from '@verndale/core';\nimport Swiper from 'swiper';\nimport { Navigation } from 'swiper/modules';\n\n// import Swiper and modules styles\nimport 'swiper/css';\n\nSwiper.use([Navigation]);\n\nclass CardCarousel extends Component {\n setupDefaults() {\n this.dom = {\n sliderContainer: this.el.querySelector('.swiper-container'),\n prevBtn: this.el.querySelector('.swiper-button-prev'),\n nextBtn: this.el.querySelector('.swiper-button-next'),\n cards: this.el.querySelectorAll('.card-carousel__card'),\n controlsContainer: this.el.querySelector('.card-carousel__controls-container')\n };\n this.initSlider();\n }\n\n initSlider() {\n const { sliderContainer, nextBtn, prevBtn, cards, controlsContainer } = this.dom;\n\n if ((cards as NodeList).length < 2) (controlsContainer as HTMLElement).style.display = 'none';\n\n new Swiper(sliderContainer as HTMLElement, {\n // Default parameters\n slidesPerView: 1,\n spaceBetween: 10,\n loop: false,\n navigation: {\n nextEl: nextBtn as HTMLElement,\n prevEl: prevBtn as HTMLElement\n },\n // Responsive breakpoints\n breakpoints: {\n // when window width is >= 480px\n 480: {\n slidesPerView: 2,\n spaceBetween: 20\n },\n // when window width is >= 640px\n 640: {\n slidesPerView: 3,\n spaceBetween: 20\n }\n }\n });\n }\n}\n\nexport default CardCarousel;\n"],"names":["Swiper","Navigation","CardCarousel","Component","sliderContainer","nextBtn","prevBtn","cards","controlsContainer"],"mappings":"iKAOAA,EAAO,IAAI,CAACC,CAAU,CAAC,EAEvB,MAAMC,UAAqBC,CAAU,CACnC,eAAgB,CACd,KAAK,IAAM,CACT,gBAAiB,KAAK,GAAG,cAA2B,mBAAmB,EACvE,QAAS,KAAK,GAAG,cAA2B,qBAAqB,EACjE,QAAS,KAAK,GAAG,cAA2B,qBAAqB,EACjE,MAAO,KAAK,GAAG,iBAAiB,sBAAsB,EACtD,kBAAmB,KAAK,GAAG,cAA2B,oCAAoC,CAAA,EAE5F,KAAK,WAAW,CAClB,CAEA,YAAa,CACX,KAAM,CAAE,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,MAAAC,EAAO,kBAAAC,GAAsB,KAAK,IAExED,EAAmB,OAAS,IAAIC,EAAkC,MAAM,QAAU,QAEvF,IAAIR,EAAOI,EAAgC,CAEzC,cAAe,EACf,aAAc,GACd,KAAM,GACN,WAAY,CACV,OAAQC,EACR,OAAQC,CACV,EAEA,YAAa,CAEX,IAAK,CACH,cAAe,EACf,aAAc,EAChB,EAEA,IAAK,CACH,cAAe,EACf,aAAc,EAChB,CACF,CAAA,CACD,CACH,CACF"}