{"version":3,"sources":["webpack:///./Scripts/slider.js"],"names":["element","sliders","classNames","mouseHover","document","getSelected","slider","value","current","selected","Math","floor","currentSelected","slides","length","positionSlide","array","a","b","slide","diff","width","left","top","right","bottom","visible","infinite","i","clones","clone","cloneNode","wasVisible","autoimage","check","slideContainer","appendChild","push","getSlide","positionSlides","j","style","filter","e","updateSlider","resize","fullWidth","body","clientWidth","marginLeft","marginRight","rewindOnResize","maxHeight","containerRect","getBoundingClientRect","rect","height","frame","visibleCount","prevCtrl","classList","add","remove","nextCtrl","indicatorContainer","slidesToScrollAuto","slidesToScroll","oldSlidesToScroll","addIndicatorClick","index","item","addEventListener","gotoSelectedSlide","indicators","display","createElement","selectedIndicator","ceil","round","initialized","animating","timerId","setInterval","v0","v1","t","changed","clearInterval","window","requestAnimationFrame","animateSlider","intervalTime","nextSlide","previusSlide","addSlide","position","addSlider","hasAttribute","parseInt","getAttribute","interval","keyboard","pause","swipe","indicator","getElementsByClassName","intervalTimerId","pauseInterval","children","onclick","which","preventDefault","manager","Hammer","Manager","TouchMouseInput","event","Swipe","on","type","slideRect","checkSize","update","handle","matchheight"],"mappings":"0FAAA,4BAEeA,cACX,IAAIC,EAAU,GAEVC,EACa,SADbA,EAEkB,WAFlBA,EAGkB,WAHlBA,EAIO,WAJPA,EAKgB,iBALhBA,EAMU,wBANVA,EAOU,wBAPVA,EAQY,sBAEZC,EAAc,iBAAkBC,SAAY,CAAC,aAAc,cAAgB,CAAC,YAAa,YAUzFC,EAAc,SAAUC,EAAQC,EAAQ,EAAGC,GAAU,GACrD,IAAIC,EAAWC,KAAKC,OAAOH,EAAUF,EAAOM,gBAAkBN,EAAOG,UAAYF,GAASD,EAAOO,OAAOC,OACxG,OAAIL,EAAW,EACQ,GAAZA,EAAgB,EAAIH,EAAOO,OAAOC,OAASL,EAE3CA,GA2BXM,EAAgB,SAAUT,EAAQC,EAAOS,GACzC,IArCiBC,EAAGC,EAqChBT,EAAWJ,EAAYC,EAAQC,GAC/BY,EAA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GAAQ,GAqKAmH,CAAUnH,KAAY,OAenDkF,OAAOjB,iBAAiB,UAAU,SAAU5B,IAL/B,SAAUE,GACnB,IAAK,IAAIjB,EAAI,EAAGA,EAAI3B,EAAQa,OAAQc,IAChCgB,EAAa3C,EAAQ2B,GAAIiB,GAI7B6E,EAAO,MAZP1B,EAAUhG,GAEhBI,SAAS6B,UAAU0F,SACnBvH,SAASwH,YAAYF","file":"20.7d0e9ccb74b8bbc99894.js","sourcesContent":["import Hammer from 'hammerjs';\r\n\r\nexport default element => {\r\n let sliders = [];\r\n \r\n let classNames = {\r\n activeSlide: 'active',\r\n disabledNextCtrl: 'disabled',\r\n disabledPrevCtrl: 'disabled',\r\n frame: 'carousel',\r\n slideContainer: 'carousel-inner',\r\n prevCtrl: 'carousel-control-prev',\r\n nextCtrl: 'carousel-control-next',\r\n indicators: 'carousel-indicators'\r\n };\r\n let mouseHover = ('onmouseleave' in document) ? ['mouseenter', 'mouseleave'] : ['mouseover', 'mouseout'];\r\n\r\n let lerp = function (v0, v1, t) {\r\n return v0 * (1 - t) + v1 * t\r\n };\r\n\r\n let aabb = function (a, b) {\r\n return (a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top);\r\n };\r\n\r\n let getSelected = function (slider, value = 0, current = true) {\r\n var selected = Math.floor((current ? slider.currentSelected : slider.selected) + value) % slider.slides.length;\r\n if (selected < 0)\r\n return selected == 0 ? 0 : slider.slides.length + selected;\r\n else\r\n return selected;\r\n };\r\n\r\n let getSlide = function (slider, selected) {\r\n if (slider.slides[selected].visible) {\r\n if (!slider.infinite)\r\n return null;\r\n for (var i = 0; i < slider.slides[selected].clones.length; i++) {\r\n if (!slider.slides[selected].clones[i].visible)\r\n return slider.slides[selected].clones[i];\r\n }\r\n var clone = {\r\n element: slider.slides[selected].element.cloneNode(true),\r\n visible: true,\r\n wasVisible: false,\r\n left: 0,\r\n width: slider.slides[selected].width\r\n };\r\n document.autoimage.check(clone.element);\r\n slider.slideContainer.appendChild(clone.element);\r\n slider.slides[selected].clones.push(clone);\r\n return clone;\r\n } else {\r\n return slider.slides[selected];\r\n }\r\n };\r\n\r\n let positionSlide = function (slider, value, array) {\r\n var selected = getSelected(slider, value);\r\n var slide = slider.slides[selected];\r\n var diff = ((slider.currentSelected - Math.floor(slider.currentSelected))) * slide.width;\r\n\r\n var left = slider.left;\r\n if (value < 0) {\r\n slider.left -= slide.width;\r\n left = slider.left;\r\n } else {\r\n slider.left += slide.width;\r\n }\r\n left -= diff;\r\n\r\n var test = aabb({left: 0, top: 0, right: slider.width, bottom: 1}, {left: left, top: 0, right: left + slide.width, bottom: 1});\r\n if (!test)\r\n return false;\r\n\r\n slide = getSlide(slider, selected);\r\n if (slide == null)\r\n return false;\r\n slide.left = left;\r\n slide.visible = true;\r\n array.push(slide);\r\n\r\n return true;\r\n };\r\n\r\n let positionSlides = function (slider) {\r\n for (var i = 0; i < slider.slides.length; i++) {\r\n slider.slides[i].wasVisible = slider.slides[i].visible; \r\n slider.slides[i].visible = false;\r\n for (var j = 0; j < slider.slides[i].clones.length; j++) {\r\n slider.slides[i].clones[j].wasVisible = slider.slides[i].clones[j].visible; \r\n slider.slides[i].clones[j].visible = false;\r\n }\r\n }\r\n var array = [];\r\n slider.left = 0;\r\n for (var i = -1; i > -100 && positionSlide(slider, i, array); i--)\r\n continue;\r\n slider.left = 0; \r\n for (var i = 0; i < 100 && positionSlide(slider, i, array); i++)\r\n continue;\r\n\r\n for (var i = 0; i < slider.slides.length; i++) {\r\n if (!slider.slides[i].visible && slider.slides[i].visible != slider.slides[i].wasVisible)\r\n slider.slides[i].element.style.left = (-(slider.width * 2)) + \"px\";\r\n for (var j = 0; j < slider.slides[i].clones.length; j++)\r\n if (!slider.slides[i].clones[j].visible && slider.slides[i].clones[j].visible != slider.slides[i].clones[j].wasVisible)\r\n slider.slides[i].clones[j].element.style.left = (-(slider.width * 2)) + \"px\";\r\n }\r\n\r\n if (slider.selected == slider.slides.length - 1) {\r\n array = array.filter(e => e != slider.slides[0]);\r\n }\r\n\r\n for (var i = 0; i < array.length; i++)\r\n array[i].element.style.left = array[i].left + \"px\";\r\n };\r\n\r\n let animateSlider = function (slider, resize = false) {\r\n if (resize && !slider.animating) {\r\n slider.currentSelected = slider.selected;\r\n positionSlides(slider);\r\n return;\r\n }\r\n\r\n if (slider.timerId != 0)\r\n return;\r\n\r\n slider.timerId = setInterval( function () {\r\n var changed = false;\r\n\r\n if (slider.selected != slider.currentSelected) {\r\n slider.currentSelected = lerp(slider.selected, slider.currentSelected, 0.9);\r\n if (slider.currentSelected > slider.selected - 0.0001 && slider.currentSelected < slider.selected + 0.0001)\r\n slider.currentSelected = slider.selected;\r\n changed = true; \r\n }\r\n\r\n if (!changed) {\r\n clearInterval(slider.timerId);\r\n slider.timerId = 0;\r\n positionSlides(slider);\r\n return;\r\n }\r\n\r\n if (slider.animating)\r\n return;\r\n\r\n slider.animating = true;\r\n\r\n window.requestAnimationFrame(function () { \r\n slider.animating = false;\r\n positionSlides(slider);\r\n });\r\n }, 1000 / 60);\r\n };\r\n\r\n let updateSlider = function (slider, resize = false) {\r\n if (resize) {\r\n if (slider.fullWidth) {\r\n slider.element.style.width = document.body.clientWidth + \"px\";\r\n slider.element.style.marginLeft = (-(document.body.clientWidth / 2)) + \"px\";\r\n slider.element.style.marginRight = (-(document.body.clientWidth / 2)) + \"px\";\r\n }\r\n\r\n if (slider.rewindOnResize)\r\n slider.selected = 0;\r\n var maxHeight = 0;\r\n var left = 0;\r\n var containerRect = slider.slideContainer.getBoundingClientRect();\r\n slider.width = containerRect.right - containerRect.left;\r\n for (var i = 0; i < slider.slides.length; i++) {\r\n var rect = slider.slides[i].element.getBoundingClientRect();\r\n var width = rect.right - rect.left;\r\n var height = rect.bottom - rect.top;\r\n if (height > maxHeight)\r\n maxHeight = height;\r\n slider.slides[i].left = left; \r\n slider.slides[i].width = width;\r\n slider.slides[i].height = height;\r\n left += width;\r\n }\r\n slider.frame.style.height = maxHeight + \"px\";\r\n\r\n var width = 0;\r\n slider.visibleCount = 0;\r\n do {\r\n slider.visibleCount++;\r\n width += slider.slides[0].width;\r\n } while (width > 0 && (width + slider.slides[0].width * 0.9) <= slider.width);\r\n }\r\n\r\n if (!slider.infinite) {\r\n if (slider.selected > slider.slides.length - slider.visibleCount)\r\n slider.selected = slider.slides.length - slider.visibleCount;\r\n else if (slider.selected < 0)\r\n slider.selected = 0;\r\n\r\n if (slider.prevCtrl) {\r\n if (slider.selected == 0)\r\n slider.prevCtrl.classList.add(classNames.disabledPrevCtrl);\r\n else\r\n slider.prevCtrl.classList.remove(classNames.disabledPrevCtrl);\r\n }\r\n\r\n if (slider.nextCtrl) {\r\n if (slider.selected >= slider.slides.length - slider.visibleCount)\r\n slider.nextCtrl.classList.add(classNames.disabledNextCtrl);\r\n else\r\n slider.nextCtrl.classList.remove(classNames.disabledNextCtrl);\r\n }\r\n }\r\n\r\n /*for (var i = 0; i < slider.slides.length; i++)\r\n slider.slides[i].element.classList.remove(classNames.activeSlide);\r\n\r\n var selected = getSelected(slider, 0, false);\r\n slider.slides[selected].element.classList.add(classNames.activeSlide); */\r\n\r\n if (slider.indicatorContainer) {\r\n if (slider.slidesToScrollAuto && resize) {\r\n slider.slidesToScroll = slider.visibleCount;\r\n }\r\n\r\n if (slider.slidesToScroll != slider.oldSlidesToScroll) {\r\n var addIndicatorClick = function (index, slider, item) {\r\n item.addEventListener('click', function (e) {\r\n var selected = getSelected(slider, 0, false);\r\n if (index * slider.slidesToScroll < selected) {\r\n slider.selected -= selected - index * slider.slidesToScroll;\r\n } else {\r\n slider.selected += index * slider.slidesToScroll - selected;\r\n }\r\n gotoSelectedSlide(slider);\r\n });\r\n }\r\n for (var i = 0; i < slider.indicators.length; i++)\r\n slider.indicators[i].style.display = \"none\";\r\n for (var i = 0; i < slider.slides.length / slider.slidesToScroll; i++) {\r\n if (i < slider.indicators.length) {\r\n slider.indicators[i].style.display = \"\";\r\n continue;\r\n }\r\n var item = document.createElement('li');\r\n slider.indicators.push(item);\r\n slider.indicatorContainer.appendChild(item);\r\n addIndicatorClick(i, slider, item);\r\n }\r\n slider.indicatorContainer.style.display = (slider.slides.length / slider.slidesToScroll) <= 1 ? \"none\" : \"\";\r\n slider.oldSlidesToScroll = slider.slidesToScroll;\r\n }\r\n }\r\n\r\n if (slider.indicators.length > 0) {\r\n var selected = getSelected(slider, 0, false);\r\n var selectedIndicator = (selected / slider.slidesToScroll) % slider.indicators.length;\r\n if (!slider.infinite && selected + slider.slidesToScroll >= slider.indicators.length)\r\n selectedIndicator = Math.ceil(selectedIndicator);\r\n else\r\n selectedIndicator = Math.round(selectedIndicator);\r\n \r\n for (var i = 0; i < slider.indicators.length; i++)\r\n if (i == selectedIndicator)\r\n slider.indicators[i].classList.add(classNames.activeSlide);\r\n else\r\n slider.indicators[i].classList.remove(classNames.activeSlide);\r\n }\r\n\r\n if (slider.initialized) {\r\n animateSlider(slider, resize);\r\n } else {\r\n positionSlides(slider);\r\n slider.initialized = true;\r\n }\r\n };\r\n\r\n let checkSize = function (slider) {\r\n var changed = false;\r\n for (var i = 0; i < slider.slides.length && !changed; i++) {\r\n var slideRect = slider.slides[i].element.getBoundingClientRect(); \r\n if (slider.slides[i].height != slideRect.bottom - slideRect.top)\r\n changed = true;\r\n }\r\n if (changed)\r\n updateSlider(slider, true);\r\n };\r\n\r\n let gotoSelectedSlide = function (slider, resize = false) {\r\n slider.intervalTime = 0;\r\n\r\n updateSlider(slider, resize);\r\n };\r\n\r\n let nextSlide = function (slider, resize = false) {\r\n if (slider.slides.length == slider.visibleCount)\r\n return;\r\n\r\n slider.selected += slider.slidesToScroll;\r\n\r\n gotoSelectedSlide(slider, resize);\r\n };\r\n\r\n let previusSlide = function (slider, resize = false) {\r\n if (slider.slides.length == slider.visibleCount)\r\n return;\r\n\r\n slider.selected -= slider.slidesToScroll;\r\n\r\n gotoSelectedSlide(slider, resize);\r\n };\r\n\r\n let addSlide = function (slider, element) {\r\n element.style.position = \"absolute\";\r\n var slide = {\r\n element: element,\r\n left: 0,\r\n visible: true,\r\n wasVisible: false,\r\n width: 0,\r\n height: 0,\r\n clones: [],\r\n\r\n };\r\n slider.slides.push(slide);\r\n };\r\n\r\n let addSlider = function (element) {\r\n var slider = {\r\n element: element,\r\n slidesToScroll: element.hasAttribute('data-slides-to-scroll') ? parseInt(element.getAttribute('data-slides-to-scroll')) : 1,\r\n infinite: element.hasAttribute('data-infinite') ? parseInt(element.getAttribute('data-infinite')) != 0 : false,\r\n interval: element.hasAttribute('data-interval') ? parseInt(element.getAttribute('data-interval')) : 0,\r\n keyboard: element.hasAttribute('data-keyboard') ? parseInt(element.getAttribute('data-keyboard')) != 0 : false,\r\n pause: element.hasAttribute('data-pause') ? parseInt(element.getAttribute('data-pause')) != 0 : false,\r\n swipe: element.hasAttribute('data-swipe') ? parseInt(element.getAttribute('data-swipe')) != 0 : false,\r\n indicator: element.hasAttribute('data-indicator') ? parseInt(element.getAttribute('data-indicator')) != 0 : false,\r\n rewindOnResize: element.hasAttribute('data-rewind-on-resize') ? parseInt(element.getAttribute('data-rewind-on-resize')) != 0 : false,\r\n fullWidth: element.hasAttribute('data-fullwidth') ? parseInt(element.getAttribute('data-fullwidth')) != 0 : false,\r\n frame: element.getElementsByClassName(classNames.frame)[0],\r\n slideContainer: null,\r\n prevCtrl: element.getElementsByClassName(classNames.prevCtrl)[0],\r\n nextCtrl: element.getElementsByClassName(classNames.nextCtrl)[0],\r\n indicatorContainer: element.getElementsByClassName(classNames.indicators)[0],\r\n slides: [],\r\n indicators: [],\r\n left: 0,\r\n width: 0,\r\n selected: 0,\r\n currentSelected: 0,\r\n timerId: 0,\r\n intervalTimerId: 0,\r\n animating: false,\r\n initialized: false,\r\n swipe: { },\r\n oldSlidesToScroll: 0,\r\n slidesToScrollAuto: false,\r\n visibleCount: 0,\r\n intervalTime: 0,\r\n pauseInterval: false\r\n };\r\n slider.slideContainer = slider.frame.getElementsByClassName(classNames.slideContainer)[0];\r\n slider.slidesToScrollAuto = slider.slidesToScroll == 0;\r\n\r\n if (slider.fullWidth) {\r\n /*\r\n width: 99.5vw;\r\n position: relative;\r\n left: 50%;\r\n right: 50%;\r\n margin-left: -50vw;\r\n margin-right: -50vw;\r\n */\r\n slider.element.style.position = \"relative\";\r\n slider.element.style.left = \"50%\";\r\n slider.element.style.right = \"50%\";\r\n }\r\n\r\n for (var i = 0; i < slider.slideContainer.children.length; i++)\r\n addSlide(slider, slider.slideContainer.children[i]);\r\n\r\n if (slider.slides.length == 0)\r\n return;\r\n\r\n if (slider.prevCtrl)\r\n slider.prevCtrl.onclick = function () { previusSlide(slider); return false; }\r\n\r\n if (slider.nextCtrl)\r\n slider.nextCtrl.onclick = function () { nextSlide(slider); return false; }\r\n\r\n if (slider.interval) {\r\n if (slider.pause) {\r\n element.addEventListener(mouseHover[0], function() { slider.pauseInterval = true; }, false);\r\n element.addEventListener(mouseHover[1], function() { slider.pauseInterval = false; }, false);\r\n element.addEventListener('touchstart', function() { slider.pauseInterval = true; }, false);\r\n element.addEventListener('touchend', function() { slider.pauseInterval = false; }, false);\r\n }\r\n slider.intervalTimerId = setInterval(function() { \r\n if (slider.pauseInterval)\r\n return;\r\n slider.intervalTime++;\r\n if (slider.intervalTime >= slider.interval * 10) {\r\n //nextSlide(slider); \r\n //slider.intervalTime = 0;\r\n slider.selected += slider.slidesToScroll;\r\n if (slider.selected > slider.slides.length - slider.visibleCount)\r\n slider.selected = slider.selected - slider.slides.length;\r\n\r\n gotoSelectedSlide(slider);\r\n }\r\n }, 100);\r\n }\r\n\r\n if (slider.keyboard) {\r\n window.addEventListener('keydown', function (e) {\r\n switch (e.which) {\r\n case 39:\r\n nextSlide(slider);\r\n break;\r\n case 37:\r\n previusSlide(slider);\r\n break;\r\n }\r\n }, false);\r\n }\r\n\r\n if (slider.swipe) {\r\n slider.element.addEventListener(\"mousedown\", function (e) { e.preventDefault(); });\r\n slider.swipe.manager = new Hammer.Manager(slider.slideContainer, {\r\n 'touchAction': 'pan-y pan-x',\r\n 'inputClass': Hammer.TouchMouseInput\r\n });\r\n slider.swipe.event = new Hammer.Swipe();\r\n slider.swipe.manager.add(slider.swipe.event);\r\n slider.swipe.manager.on('swipeleft swiperight', function (e) {\r\n switch (e.type) {\r\n case \"swipeleft\":\r\n nextSlide(slider);\r\n break;\r\n case \"swiperight\":\r\n previusSlide(slider);\r\n break;\r\n }\r\n }); \r\n }\r\n\r\n gotoSelectedSlide(slider, true);\r\n\r\n sliders.push(slider);\r\n\r\n setInterval(function() { checkSize(slider); }, 100);\r\n };\r\n\r\n let init = function () {\r\n addSlider(element);\r\n\r\n\t\tdocument.autoimage.handle();\r\n\t\tdocument.matchheight.update();\r\n };\r\n\r\n let update = function (resize) {\r\n for (var i = 0; i < sliders.length; i++)\r\n updateSlider(sliders[i], resize);\r\n };\r\n\r\n window.addEventListener(\"resize\", function (e) {\r\n update(true);\r\n });\r\n\r\n init();\r\n};"],"sourceRoot":""}