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B,EAAAA,cAACyB,EAAS,CACRP,aAAcA,EACdQ,aAAcE,EAAOrC,OACrB6B,YAAaA,IAEX,C","sources":["webpack:///./Scripts/Haki/Utils/scroll.js","webpack:///./Scripts/Haki/Components/ImageSlider/Components/Indicator/Bar.js","webpack:///./Scripts/Haki/Components/ImageSlider/Components/Indicator/Chevron.js","webpack:///./Scripts/Haki/Components/ImageSlider/Components/Indicator/Controls.js","webpack:///./Scripts/Haki/Components/ImageSlider/Components/Indicator.js","webpack:///./Scripts/Haki/Components/ImageSlider/Components/Images.js","webpack:///./Scripts/Haki/Components/ImageSlider/ImageSlider.js","webpack:///./Scripts/Haki/Utils/css.utils.js","webpack:///./Scripts/Haki/Hooks/useElementSize.js"],"sourcesContent":["export const isScrolledIntoView = (element) => {\n let docViewTop = window.scrollTop();\n let docViewBottom = docViewTop + window.innerHeight;\n\n let elemTop = element.offsetTop;\n let elemBottom = elemTop + element.innerHeight;\n \n return elemBottom <= docViewBottom && elemTop >= docViewTop;\n};\n\nexport const isEndOfList = (direction, current, length) =>\n(direction < 0 && current === 1) || (direction > 0 && current === length);\n\nlet debounceTimer;\n\nexport const debounce = (callback, time) => {\n window.clearTimeout(debounceTimer);\n debounceTimer = window.setTimeout(callback, time);\n};\n","import React from 'react';\n\nconst Bar = () => (\n
\n
\n
\n);\n\nexport default Bar;\n","import React from 'react';\n\nconst Chevron = ({ direction, isEnabled, onClick }) => {\n const dir = direction === 'left' ? -1 : 1;\n const enabled = isEnabled ? 'En' : 'Dis';\n const handleClick = () => onClick && onClick(dir);\n\n return (\n \n \n \n \n \n );\n};\n\nexport default Chevron;\n","import React from 'react';\nimport Chevron from './Chevron';\n\nconst Controls = ({ currentSlide, imagesAmount, handleSlide }) => {\n const handleChevronClick = (dir) => handleSlide(dir);\n\n const indicatorText = `${currentSlide} / ${imagesAmount}`;\n\n const isLeftEnabled = currentSlide !== 1;\n const isRightEnabled = currentSlide !== imagesAmount;\n\n return (\n
\n \n {indicatorText}\n \n
\n );\n};\n\nexport default Controls;\n","import React from 'react';\nimport { isEndOfList } from '../../../Utils/scroll';\nimport Bar from './Indicator/Bar';\nimport Controls from './Indicator/Controls';\n\nconst Indicator = ({ currentSlide, imagesLength, handleSlide }) => {\n const onSlide = (direction) =>\n !isEndOfList(direction, currentSlide, imagesLength) &&\n handleSlide(direction);\n\n return (\n
\n \n \n
\n );\n};\n\nexport default Indicator;\n","import React, { useEffect, useRef, forwardRef } from 'react';\nimport { debounce, isEndOfList } from '../../../Utils/scroll';\n\nconst Images = forwardRef(({ images, currentSlide, handleSlide }, ref) => {\n const wheelTimeout = useRef();\n\n const imagesLength = images.length;\n\n useEffect(() => {\n const cancelWheel = (e) => wheelTimeout.current && e.preventDefault();\n document.body.addEventListener('wheel', cancelWheel, { passive: false });\n\n return () => document.body.removeEventListener('wheel', cancelWheel);\n }, []);\n\n const preventDefault = () => {\n clearTimeout(wheelTimeout.current);\n wheelTimeout.current = setTimeout(() => {\n wheelTimeout.current = false;\n }, 250);\n };\n\n const scroll = (deltaY) => {\n const direction = Math.sign(deltaY);\n if (deltaY === 0 || isEndOfList(direction, currentSlide, imagesLength))\n return;\n\n handleSlide(direction);\n };\n\n const handleWheel = ({ deltaY }) => {\n preventDefault();\n debounce(() => scroll(deltaY), 100);\n };\n\n let deltaX = 0;\n let startX = 0;\n\n const handleTouchStart = (e) => {\n if (e.touches.length > 1) return;\n\n const { clientX } = e.touches[0];\n startX = clientX;\n };\n\n const handleTouchMove = (e) => {\n const { clientX } = e.touches[0];\n deltaX = startX - clientX;\n debounce(() => scroll(deltaX), 100);\n };\n\n const handleTouchEnd = (e) => {\n const { touches } = e;\n };\n\n const getImages = (() =>\n images.map(({ src }, k) => ))();\n\n return (\n \n {getImages}\n \n );\n});\n\nexport default Images;\n","import React, { useState, useEffect, useRef } from 'react';\nimport Indicator from './Components/Indicator';\nimport { setCSSProperty } from '../../Utils/css.utils';\nimport { useElementSize } from '../../Hooks/useElementSize.js';\nimport Images from './Components/Images';\n\nconst ImageSlider = ({ images }) => {\n if (!images || images.length < 1) return null;\n\n const barWidth = 100 / images.length;\n const sliderContainerClass = '.image-slider-container';\n const sliderContainer = document.querySelector(sliderContainerClass);\n const imageSlider = document.querySelector('.image-slider');\n\n const [currentSlide, setCurrentSlide] = useState(1);\n\n const setCSSPropertySlider = (prop, val) =>\n setCSSProperty(sliderContainerClass, prop, val);\n\n const sliderRef = useRef();\n let sliderWidth = useElementSize(sliderRef);\n\n useEffect(() => setCSSPropertySlider('bar-width', `${barWidth}%`));\n\n useEffect(() => {\n if (!(sliderContainer || imageSlider)) return;\n\n const slide = currentSlide - 1;\n setCSSPropertySlider('bar-left', `${slide * barWidth}%`);\n\n imageSlider.scrollTo({\n left: slide * sliderWidth,\n behavior: 'smooth',\n });\n }, [currentSlide]);\n\n const handleSlide = (slide) => setCurrentSlide(currentSlide + slide);\n\n return (\n
\n \n \n
\n );\n};\n\nexport default ImageSlider;\n","export const setCSSProperty = (element, prop, val) =>\n document.querySelector(element).style.setProperty(`--${prop}`, val);\n","import { useState, useEffect } from 'react';\n\nexport const useElementSize = (elementRef) => {\n const [elementWidth, setElementWidth] = useState(0);\n\n useEffect(() => {\n if (!elementRef) return;\n if (!elementRef.current) return;\n\n setElementWidth(elementRef.current.clientWidth);\n\n const handleResize = () => \n setElementWidth(elementRef.current.clientWidth);\n \n\n window.addEventListener('resize', handleResize);\n handleResize();\n\n return () => window.removeEventListener('resize', handleResize);\n }, [elementRef]);\n\n return elementWidth;\n};\n"],"names":["isEndOfList","direction","current","length","debounceTimer","debounce","callback","time","window","clearTimeout","setTimeout","Bar","React","className","Chevron","isEnabled","onClick","dir","enabled","handleClick","width","height","viewBox","fill","xmlns","d","stroke","strokeLinecap","strokeLinejoin","Controls","currentSlide","imagesAmount","handleSlide","handleChevronClick","indicatorText","isLeftEnabled","isRightEnabled","Indicator","imagesLength","forwardRef","images","ref","wheelTimeout","useRef","useEffect","cancelWheel","e","preventDefault","document","body","addEventListener","passive","removeEventListener","scroll","deltaY","Math","sign","deltaX","startX","getImages","map","src","k","itemProp","key","id","onWheel","handleWheel","onTouchMove","clientX","touches","onTouchStart","onTouchEnd","ImageSlider","barWidth","sliderContainerClass","sliderContainer","querySelector","imageSlider","setCurrentSlide","useState","setCSSPropertySlider","prop","val","setCSSProperty","element","style","setProperty","sliderRef","sliderWidth","elementRef","elementWidth","setElementWidth","clientWidth","handleResize","useElementSize","slide","scrollTo","left","behavior","Images"],"sourceRoot":""}