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AC9C8C,EAAeF,EAAoB5C,cAAc,gBACjD+C,GAAa,OAAcD,GAG7BD,EAAU5C,iBAAiB,SAAUE,IACjCA,EAAM6C,iBACND,EAAWrC,MAAM,GAIb,EAQJuC,CAAcL,EAAoB,G","sources":["webpack:///./Features/Shared/Features/ImageModal/Scripts/imageModal.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./Features/Components/ImageBlock/Scripts/imageBlock.ts"],"sourcesContent":["interface IUseImageModal {\r\n open: () => void;\r\n}\r\n\r\nexport const useImageModal = (modal: HTMLDialogElement): IUseImageModal => {\r\n const closeButton = modal.querySelector('.image-modal__close-button') as HTMLButtonElement;\r\n \r\n const open = (): void => {\r\n modal.showModal();\r\n modal.focus();\r\n\r\n const modalImage = modal.querySelector('.image-modal__image') as HTMLImageElement;\r\n const modalCaption: HTMLElement | null = modal.querySelector('.image-modal__caption');\r\n\r\n if (modalCaption) {\r\n modalImage.style.maxHeight = `calc(100% - ${modalCaption.offsetHeight}px)`;\r\n }\r\n\r\n document.body.classList.add('has-full-screen-modal');\r\n }\r\n \r\n const close = (): void => {\r\n document.body.classList.remove('has-full-screen-modal');\r\n }\r\n \r\n const initialize = (): void => {\r\n closeButton.addEventListener('click', (): void => {\r\n modal.close();\r\n });\r\n\r\n modal.addEventListener('click', (event: MouseEvent): void => {\r\n if (event.target instanceof Element && event.target === modal) {\r\n modal.close();\r\n }\r\n });\r\n\r\n modal.addEventListener('close', (): void => {\r\n close();\r\n });\r\n }\r\n \r\n initialize();\r\n \r\n return {\r\n open\r\n }\r\n};\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { useImageModal } from \"@features/Shared/Features/ImageModal/Scripts/imageModal\";\r\n\r\nexport const useImageBlock = (blockContentElement: HTMLDivElement): void => {\r\n const imageLink = blockContentElement.querySelector('.image-block__image-link') as HTMLAnchorElement;\r\n const modalElement = blockContentElement.querySelector('.image-modal') as HTMLDialogElement;\r\n const imageModal = useImageModal(modalElement);\r\n \r\n const initialize = (): void => {\r\n imageLink.addEventListener('click', (event: MouseEvent) => {\r\n event.preventDefault();\r\n imageModal.open();\r\n });\r\n }\r\n\r\n initialize();\r\n};\r\n\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n const imageBlockContentElements = document.querySelectorAll('.image-block__content--has-lightbox') as NodeListOf;\r\n\r\n if (imageBlockContentElements.length > 0) {\r\n imageBlockContentElements.forEach((blockContentElement) => {\r\n useImageBlock(blockContentElement);\r\n })\r\n }\r\n});\r\n"],"names":["useImageModal","modal","closeButton","querySelector","addEventListener","close","event","target","Element","document","body","classList","remove","open","showModal","focus","modalImage","modalCaption","style","maxHeight","offsetHeight","add","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","imageBlockContentElements","querySelectorAll","length","forEach","blockContentElement","imageLink","modalElement","imageModal","preventDefault","useImageBlock"],"sourceRoot":""}