{"version":3,"sources":["webpack:///./Scripts/Actions/LightboxImages.action.js","webpack:///./Scripts/Components/LightboxImages.js"],"names":["show","visible","type","LIGHTBOX_IMAGES_SHOW","payload","customStyles","content","background","padding","border","overlay","zIndex","LightboxSettings","showStatus","showIndicators","useKeyboardArrows","thumbWidth","autoPlay","autoFocus","interval","emulateTouch","renderThumbnails","children","map","item","index","props","imageElement","find","ele","src","key","style","backgroundImage","className","dispatch","useDispatch","useSelector","state","lightboxImages","onClose","useCallback","onClickThumbnail","LIGHTBOX_IMAGES_SET_CURRENT_IMAGE","setCurrentIndex","images","length","Fragment","data-src","href","itemProp","onClick","e","preventDefault","rel","dangerouslySetInnerHTML","__html","html","image","ariaHideApp","preventScroll","isOpen","onRequestClose","shouldCloseOnOverlayClick","selectedItem","renderThumbs","value"],"mappings":"yLAKO,MAOMA,EAAQC,IAAD,CAChBC,KAAMC,KACNC,QAAS,CACLH,a,+MCRR,MAAMI,EAAe,CACnBC,QAAS,CACPC,WAAY,OACZC,QAAS,EACTC,OAAQ,QAEVC,QAAS,CACPH,WAAY,qBACZI,OAAQ,OAGNC,EAAmB,CACvBC,YAAY,EACZC,gBAAgB,EAChBC,mBAAmB,EACnBC,WAAY,GACZC,UAAU,EACVC,WAAW,EACXC,SAAU,IACVC,cAAc,GAGVC,EAAoBC,GACTA,EAASC,KAAI,CAACC,EAAMC,KACjC,IAAKD,IAASA,EAAKE,QAAUF,EAAKE,MAAMJ,SACtC,OAIF,MAAMK,EAAeH,EAAKE,MAAMJ,SAASM,MAAMC,GAAqB,QAAbA,EAAI3B,OAC3D,OAAKyB,GAAiBA,EAAaD,OAAUC,EAAaD,MAAMI,IAK9D,uBACEC,IAAKN,EACLO,MAAO,CACLC,gBAAiB,OAASN,EAAaD,MAAMI,IAAM,KAErDI,UAAU,0BAVd,KA2GJ,EAzFwBR,IACtB,MAAMS,GAAWC,WACX,QAAEnC,EAAF,MAAWwB,IAAUY,SAAaC,GAAUA,EAAMC,iBAClDC,GAAUC,k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import {\n LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\n LIGHTBOX_IMAGES_SHOW,\n} from '../constants';\n\nexport const setCurrentIndex = (index) => ({\n type: LIGHTBOX_IMAGES_SET_CURRENT_IMAGE,\n payload: {\n index,\n },\n});\n\nexport const show = (visible) => ({\n type: LIGHTBOX_IMAGES_SHOW,\n payload: {\n visible,\n },\n});\n","import React, { Fragment, useCallback } from 'react';\nimport Modal from 'react-modal';\nimport 'react-responsive-carousel/lib/styles/carousel.min.css';\nimport { Carousel as Lightbox } from 'react-responsive-carousel';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { show, setCurrentIndex } from '../Actions/LightboxImages.action';\n\nconst customStyles = {\n content: {\n background: 'none',\n padding: 0,\n border: 'none',\n },\n overlay: {\n background: 'rgba(0, 0, 0, 0.8)',\n zIndex: 2003,\n },\n};\nconst LightboxSettings = {\n showStatus: false,\n showIndicators: false,\n useKeyboardArrows: true,\n thumbWidth: 50,\n autoPlay: true,\n autoFocus: true,\n interval: 3000,\n emulateTouch: true,\n};\n\nconst renderThumbnails = (children) => {\n const images = children.map((item, index) => {\n if (!item || !item.props || !item.props.children) {\n return undefined;\n }\n\n // find img to get source\n const imageElement = item.props.children.find((ele) => ele.type === 'img');\n if (!imageElement || !imageElement.props || !imageElement.props.src) {\n return undefined;\n }\n\n return (\n \n );\n });\n\n return images;\n};\n\nconst LightboxImages = (props) => {\n const dispatch = useDispatch();\n const { visible, index } = useSelector((state) => state.lightboxImages);\n const onClose = useCallback(() => dispatch(show(false)), [dispatch]);\n const onClickThumbnail = (index) => {\n dispatch(show(true));\n dispatch(setCurrentIndex(index));\n };\n\n return !props.images || props.images.length < 1 ? (\n \n ) : (\n \n
\n
\n
\n {\n e.preventDefault();\n onClickThumbnail(0);\n }}\n className=\"product-image\"\n rel=\"nofollow\"\n dangerouslySetInnerHTML={{\n __html: props.images[0].html,\n }}\n >\n
\n
\n
\n
\n {props.images.map(\n (image, index) =>\n index > 0 && (\n \n {\n e.preventDefault();\n onClickThumbnail(index);\n }}\n className=\"product-image\"\n rel=\"nofollow\"\n dangerouslySetInnerHTML={{\n __html: props.images[index].html,\n }}\n >\n
\n )\n )}\n
\n
\n \n \n \n {props.images.map((value, index) => (\n
\n \n \n
\n ))}\n \n \n
\n );\n};\n\nexport default LightboxImages;\n"],"sourceRoot":""}