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E,SAAU1C,EAAqC0H,EAASC,EAAcC,GAAY,GACpF,IAAIC,EAEJ,OAAO,YAAyCC,GAE5C,MAAMC,EAAUzB,KACV0B,EAAQ,WACVH,EAAU,KACLD,GAAWF,EAAKO,MAAMF,EAASD,EACxC,EACMI,EAAUN,IAAcC,EAC9BM,aAAaN,GACbA,EAAUhG,OAAOuG,WAAWJ,EAAOL,GAC/BO,GAASR,EAAKO,MAAMF,EAASD,EACrC,CACJ,C,kCCpBM,SAAUvI,EAAcT,GAC1B,GAA4B,YAAxBW,SAAS4I,WACT,OAAOvJ,IAEPW,SAASyB,iBAAiB,mBAAoBpC,EAEtD,C","sources":["webpack://@sazka/web/./js/app/landing-page/widgets/_cards-with-img-carousel.ts","webpack://@sazka/web/../../libs/utils/carousel/use-flickity-dots.ts","webpack://@sazka/web/../../libs/utils/carousel/flickity-patched.ts","webpack://@sazka/web/../../libs/utils/debounce.ts","webpack://@sazka/web/../../libs/utils/document-ready.ts"],"sourcesContent":["import { debounce } from \"@sazka/utils/debounce\";\r\nimport { FlickityPatched } from \"@sazka/utils/carousel/flickity-patched\";\r\nimport { documentReady } from \"@sazka/utils/document-ready\";\r\n\r\nconst onImagesLoaded = (container, callback) => {\r\n    const images = container.querySelectorAll(\"img\");\r\n    let imagesCount = images.length;\r\n\r\n    if (!imagesCount) {\r\n        callback();\r\n        return;\r\n    }\r\n\r\n    images.forEach((el) => {\r\n        if (el.complete) {\r\n            imagesCount--;\r\n            if (imagesCount === 0) {\r\n                callback();\r\n            }\r\n            return;\r\n        }\r\n\r\n        el.onload = () => {\r\n            imagesCount--;\r\n            if (imagesCount === 0) {\r\n                callback();\r\n            }\r\n        };\r\n    });\r\n};\r\n\r\ndocumentReady(() => {\r\n    const roots = document.querySelectorAll(\".lp-cards-img-carousel\");\r\n    if (!roots.length) {\r\n        return;\r\n    }\r\n\r\n    roots.forEach((el) => {\r\n        const root = el;\r\n        let flickity = null;\r\n        const cardsCount = root.querySelectorAll(\".lp-card-img-carousel\").length;\r\n        let slidesCount = 2;\r\n\r\n        serviceFlickity();\r\n\r\n        const resizeHandler = debounce(function () {\r\n            serviceFlickity();\r\n        }, 100);\r\n\r\n        window.addEventListener(\"resize\", resizeHandler);\r\n        onImagesLoaded(root, serviceFlickity);\r\n\r\n        function initFlickity() {\r\n            flickity = new FlickityPatched(root.querySelector(\".lp-cards-img-carousel__container\"), {\r\n                prevNextButtons: false,\r\n                autoPlay: false,\r\n                pageDots: false,\r\n                contain: true,\r\n                groupCells: true,\r\n                cellAlign: \"left\",\r\n            });\r\n        }\r\n\r\n        function disableButtons() {\r\n            const previousButton = root.querySelector(\".flickity-button__wrapper.previous\");\r\n            const nextButton = root.querySelector(\".flickity-button__wrapper.next\");\r\n\r\n            if (flickity.selectedIndex > 0) {\r\n                previousButton.classList.remove(\"disabled\");\r\n            } else {\r\n                previousButton.classList.add(\"disabled\");\r\n            }\r\n\r\n            if (flickity.selectedIndex >= slidesCount - 1) {\r\n                nextButton.classList.add(\"disabled\");\r\n            } else {\r\n                nextButton.classList.remove(\"disabled\");\r\n            }\r\n        }\r\n\r\n        function initButtons() {\r\n            const previousButton = root.querySelector(\".flickity-button.previous\");\r\n            const nextButton = root.querySelector(\".flickity-button.next\");\r\n\r\n            // previous\r\n            previousButton.addEventListener(\"click\", function () {\r\n                flickity.previous();\r\n                if (flickity.selectedIndex < slidesCount - 1) {\r\n                    nextButton.parentElement.classList.remove(\"disabled\");\r\n                }\r\n                if (flickity.selectedIndex <= 0) {\r\n                    previousButton.parentElement.classList.add(\"disabled\");\r\n                }\r\n            });\r\n\r\n            // next\r\n            nextButton.addEventListener(\"click\", function () {\r\n                flickity.next();\r\n                if (flickity.selectedIndex > 0) {\r\n                    previousButton.parentElement.classList.remove(\"disabled\");\r\n                }\r\n                if (flickity.selectedIndex >= slidesCount - 1) {\r\n                    nextButton.parentElement.classList.add(\"disabled\");\r\n                }\r\n            });\r\n\r\n            flickity.on(\"select\", function () {\r\n                slidesCount = flickity.slides.length;\r\n                disableButtons();\r\n            });\r\n        }\r\n\r\n        function serviceFlickity() {\r\n            const mediaQueryMax = window.matchMedia(\"(max-width: 897px)\").matches;\r\n            const mediaQueryMin = window.matchMedia(\"(min-width: 897px)\").matches;\r\n\r\n            const cards = root.querySelectorAll(\".lp-card-img-carousel\") as NodeListOf<HTMLElement>;\r\n\r\n            if ((!flickity && mediaQueryMax) || (!flickity && cardsCount > 3)) {\r\n                initFlickity();\r\n                initButtons();\r\n                cards.forEach((el) => el.classList.add(\"is-equal\"));\r\n            } else if ((!flickity?.isActive && mediaQueryMax) || (!flickity?.isActive && cardsCount > 3)) {\r\n                flickity._create();\r\n                initButtons();\r\n            } else if (mediaQueryMin && flickity?.isActive && cardsCount <= 3) {\r\n                try {\r\n                    flickity.destroy();\r\n                    root.querySelectorAll(\".flickity-button\").forEach((btn) =>\r\n                        btn.parentElement.classList.toggle(\"has-buttons\")\r\n                    );\r\n                } catch (e) {}\r\n            }\r\n\r\n            if (flickity?.isActive) {\r\n                cards.forEach((el) => {\r\n                    el.style.height = \"auto\";\r\n                });\r\n                flickity.resize();\r\n                cards.forEach((el) => {\r\n                    el.style.height = \"100%\";\r\n                });\r\n            } else {\r\n                cards.forEach((el) => {\r\n                    el.style.height = \"\";\r\n                });\r\n            }\r\n        }\r\n    });\r\n});\r\n","/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { FlickityDotsOptions } from \"./flickity-dots-options\";\r\nimport { FlickityPatched } from \"./flickity-patched\";\r\n\r\nconst PATH_ATTRS_MAP = {\r\n    \"clip-rule\": \"evenodd\",\r\n    \"fill-rule\": \"evenodd\",\r\n};\r\n\r\nconst SVG_ATTRS_MAP = {\r\n    viewBox: \"0 0 24 24\",\r\n    width: \"24\",\r\n    height: \"24\",\r\n};\r\n\r\nconst DS_ARROW_CLASS = \"ds-carousel-indicator__arrow\";\r\n\r\nconst BTN_CLASSES = [\"button\", \"button--sm\", \"button--text\"];\r\n\r\nconst defaultDotsOptions: FlickityDotsOptions = {\r\n    rootEl: null,\r\n    dots: null,\r\n    theme: \"light\",\r\n    next: null,\r\n    prev: null,\r\n    nextIcon:\r\n        \"M6.257 2.331a1 1 0 0 1 1.412-.074l10 9a1 1 0 0 1 0 1.486l-10 9a1 1 0 1 1-1.338-1.486L15.505 12 6.331 3.743a1 1 0 0 1-.074-1.412Z\",\r\n    prevIcon:\r\n        \"M17.743 2.331a1 1 0 0 1-.074 1.412L8.495 12l9.174 8.257a1 1 0 1 1-1.338 1.486l-10-9a1 1 0 0 1 0-1.486l10-9a1 1 0 0 1 1.412.074Z\",\r\n    useDsClasses: true,\r\n    useCustomPrevNextButtons: false,\r\n};\r\n\r\n/**\r\n * When calling init method with config object\r\n * it will render dots at the rootEl you define\r\n */\r\nexport function useFlickityDots(carousel: FlickityPatched, options: FlickityDotsOptions) {\r\n    const carouselInstance = carousel;\r\n    if (Object.keys(options).length === 0) return;\r\n    const config = Object.assign(defaultDotsOptions, options);\r\n\r\n    if (config.useDsClasses && (carouselInstance as any).isInitActivated) {\r\n        const indicatorClass = [\"ds-carousel-indicator\"];\r\n\r\n        if (config.theme === \"dark\") indicatorClass.push(\"is-dark\");\r\n\r\n        config.rootEl.classList.add(...indicatorClass);\r\n\r\n        initPrevButton();\r\n        initDots();\r\n        initNextButton();\r\n    }\r\n\r\n    config.rootEl.append(\r\n        config.prev || getElementFromInstance(\"prev\"),\r\n        config.dots || getElementFromInstance(\"dots\"),\r\n        config.next || getElementFromInstance(\"next\")\r\n    );\r\n\r\n    if (!getElementFromInstance(\"prev\") || !getElementFromInstance(\"next\")) {\r\n        [...config.rootEl.childNodes].filter((child) => child.nodeType === 3).map((el) => el.remove());\r\n    }\r\n\r\n    /**\r\n     * Destroy custom dots\r\n     */\r\n    function destroy() {\r\n        if (config.rootEl.children.length > 0) config.rootEl.replaceChildren();\r\n    }\r\n\r\n    function initPrevButton() {\r\n        if (!(carouselInstance as any).options.prevNextButtons && config.useCustomPrevNextButtons) {\r\n            initButton(config.prev, \"prev\", config.prevIcon);\r\n        }\r\n    }\r\n\r\n    function initNextButton() {\r\n        if (!(carouselInstance as any).options.prevNextButtons && config.useCustomPrevNextButtons) {\r\n            initButton(config.next, \"next\", config.nextIcon);\r\n        }\r\n    }\r\n\r\n    function initButton(btn: HTMLElement, btnType: \"prev\" | \"next\", icon: string) {\r\n        if (btn) {\r\n            btn?.classList.add(`${DS_ARROW_CLASS}`, `${DS_ARROW_CLASS}--${btnType}`, ...BTN_CLASSES);\r\n            setAttributes(btn?.querySelector(\".flickity-button-icon\"), SVG_ATTRS_MAP);\r\n            btn?.querySelector<SVGPathElement>(\".arrow\").setAttribute(\"d\", icon);\r\n        } else {\r\n            const carouselBtn = getElementFromInstance(btnType);\r\n            const arrow = carouselBtn.querySelector(\".arrow\");\r\n            const svgElem = carouselBtn.querySelector(\".flickity-button-icon\");\r\n\r\n            setAttributes(svgElem, SVG_ATTRS_MAP);\r\n            setAttributes(arrow, PATH_ATTRS_MAP);\r\n            arrow.setAttribute(\"d\", icon);\r\n            arrow.removeAttribute(\"transform\");\r\n            carouselBtn.classList.add(`${DS_ARROW_CLASS}`, `${DS_ARROW_CLASS}--${btnType}`, ...BTN_CLASSES);\r\n        }\r\n    }\r\n\r\n    function initDots() {\r\n        if (config.dots) {\r\n            config.dots.classList.add(\"ds-carousel-indicator__dots\");\r\n        } else {\r\n            const dots = getElementFromInstance(\"dots\");\r\n            dots.classList.add(\"ds-carousel-indicator__dots\");\r\n        }\r\n    }\r\n\r\n    function getElementFromInstance(elType: \"prev\" | \"next\" | \"dots\") {\r\n        switch (elType) {\r\n            case \"prev\":\r\n                return (\r\n                    (carouselInstance as any).options.prevNextButtons &&\r\n                    ((carouselInstance as any).prevButton.element as HTMLElement)\r\n                );\r\n            case \"dots\":\r\n                return (\r\n                    (carouselInstance as any).options.pageDots &&\r\n                    ((carouselInstance as any).pageDots.holder as HTMLElement)\r\n                );\r\n            case \"next\":\r\n                return (\r\n                    (carouselInstance as any).options.prevNextButtons &&\r\n                    ((carouselInstance as any).nextButton.element as HTMLElement)\r\n                );\r\n        }\r\n    }\r\n\r\n    function setAttributes(el: Element, attrs: Record<string, any>) {\r\n        for (const key in attrs) {\r\n            el.setAttribute(key, attrs[key]);\r\n        }\r\n    }\r\n\r\n    return {\r\n        destroy,\r\n    };\r\n}\r\n","import Flickity from \"flickity\";\r\nimport { FlickityDotsOptions } from \"./flickity-dots-options\";\r\nimport { useFlickityDots } from \"./use-flickity-dots\";\r\n\r\nexport interface FlickityPatchedOptions extends Flickity.Options {\r\n    dotsOptions?: FlickityDotsOptions;\r\n}\r\n\r\n/**\r\n * @deprecated Instead use KeenSlider in new components\r\n */\r\nexport class FlickityPatched extends Flickity {\r\n    dots: ReturnType<typeof useFlickityDots>;\r\n    dotsRoot: HTMLElement = null;\r\n\r\n    constructor(selector: string | Element, options?: FlickityPatchedOptions) {\r\n        super(selector, options);\r\n        this.dotsRoot = options?.dotsOptions?.rootEl;\r\n\r\n        this.on(\"dragStart\", () => {\r\n            (this.cells as any[]).forEach((slide) => (slide.element.style.pointerEvents = \"none\"));\r\n        });\r\n        this.on(\"dragEnd\", () => (this.cells as any[]).forEach((slide) => (slide.element.style.pointerEvents = \"all\")));\r\n        this.on(\"destroy\", () => {\r\n            if (this.dots) this.dots.destroy();\r\n        });\r\n\r\n        if (options.dotsOptions) {\r\n            this.dots = useFlickityDots(this, options.dotsOptions);\r\n        }\r\n    }\r\n\r\n    // The following two methods fix the error that Flickity throws when there is different parent for dotsOptions and Carousel\r\n    deactivatePageDots() {\r\n        try {\r\n            // Try to call flicity deactivatePageDots first\r\n            Object.getPrototypeOf(Object.getPrototypeOf(this)).deactivatePageDots();\r\n        } catch (e) {\r\n            console.warn(\"Flickity deactivatePageDots failed calling its override.\");\r\n            const superDeactivatePageDot = (this as any).pageDots.deactivate.bind({\r\n                holder: this.dotsRoot.querySelector(\".flickity-page-dots\"),\r\n                unbindStartEvent: () => {\r\n                    // Could not figure out what this was supposed to do. So there is just console.log to prevent TS error.\r\n                    console.log(\"unbidStart\");\r\n                },\r\n                parent: { element: this.dotsRoot },\r\n            });\r\n            superDeactivatePageDot();\r\n        }\r\n    }\r\n\r\n    deactivatePrevNextButtons() {\r\n        try {\r\n            // Try to call flicity deactivatePrevNextButtons first\r\n            Object.getPrototypeOf(Object.getPrototypeOf(this)).deactivatePrevNextButtons();\r\n        } catch (e) {\r\n            console.warn(\"Flickity deactivatePrevNextButtons failed calling its override.\");\r\n            const superDeactivatePrevButton = (this as any).prevButton.deactivate.bind({\r\n                element: (this as any).prevButton.element,\r\n                unbindStartEvent: () => {\r\n                    // Could not figure out what this was supposed to do. So there is just console.log to prevent TS error.\r\n                    console.log(\"unbidStart\");\r\n                },\r\n                parent: { element: this.dotsRoot },\r\n            });\r\n            const superDeactivateNextButton = (this as any).prevButton.deactivate.bind({\r\n                element: (this as any).nextButton.element,\r\n                unbindStartEvent: () => {\r\n                    // Could not figure out what this was supposed to do. So there is just console.log to prevent TS error.\r\n                    console.log(\"unbidStart\");\r\n                },\r\n                parent: { element: this.dotsRoot },\r\n            });\r\n            superDeactivatePrevButton();\r\n            superDeactivateNextButton();\r\n        }\r\n    }\r\n\r\n    // FIX iOS 15 issues - when dragging, page moves\r\n    // see https://github.com/metafizzy/flickity/issues/1177#issuecomment-981194285\r\n    // can be removed when flickity fixes https://github.com/metafizzy/flickity/issues/1196\r\n    resize() {\r\n        if (!(this as any).isAnimating) {\r\n            super.resize();\r\n        }\r\n    }\r\n}\r\n","/**\r\n * Debounce function - use like this:\r\n * var handler = debounce(function(){ do the work}, 100);\r\n * $(window).scroll(handler);\r\n * @param func callback function\r\n * @param wait time in milliseconds to wait\r\n * @param immediate\r\n */\r\n\r\ntype CallbackFunction = (...args: any[]) => any;\r\n\r\nexport function debounce<T extends CallbackFunction>(func: T, wait: number, immediate = false) {\r\n    let timeout: number | null;\r\n\r\n    return function (this: ThisParameterType<T>, ...args: Parameters<T>) {\r\n        /* eslint-disable @typescript-eslint/no-this-alias */\r\n        const context = this;\r\n        const later = function () {\r\n            timeout = null;\r\n            if (!immediate) func.apply(context, args);\r\n        };\r\n        const callNow = immediate && !timeout;\r\n        clearTimeout(timeout as number);\r\n        timeout = window.setTimeout(later, wait);\r\n        if (callNow) func.apply(context, args);\r\n    };\r\n}\r\n","/**\r\n * Vanila JS variant to jQuery $(() => {}).\r\n * @param {callback} callback\r\n * @example - documentReady(() => {}).\r\n * This function is binding to document.ready\r\n * */\r\nexport function documentReady(callback: () => void) {\r\n    if (document.readyState !== \"loading\") {\r\n        return callback();\r\n    } else {\r\n        document.addEventListener(\"DOMContentLoaded\", callback);\r\n    }\r\n}\r\n"],"names":["onImagesLoaded","container","callback","images","querySelectorAll","imagesCount","length","forEach","el","complete","onload","documentReady","roots","document","root","flickity","cardsCount","slidesCount","serviceFlickity","resizeHandler","debounce","initFlickity","FlickityPatched","querySelector","prevNextButtons","autoPlay","pageDots","contain","groupCells","cellAlign","disableButtons","previousButton","nextButton","selectedIndex","classList","remove","add","initButtons","addEventListener","previous","parentElement","next","on","slides","_flickity","_flickity2","_flickity3","_flickity4","mediaQueryMax","window","matchMedia","matches","mediaQueryMin","cards","isActive","_create","destroy","btn","toggle","e","style","height","resize","PATH_ATTRS_MAP","SVG_ATTRS_MAP","viewBox","width","DS_ARROW_CLASS","BTN_CLASSES","defaultDotsOptions","rootEl","dots","theme","prev","nextIcon","prevIcon","useDsClasses","useCustomPrevNextButtons","useFlickityDots","carousel","options","carouselInstance","Object","keys","config","assign","isInitActivated","indicatorClass","push","initPrevButton","initDots","initNextButton","children","replaceChildren","initButton","btnType","icon","setAttributes","setAttribute","carouselBtn","getElementFromInstance","arrow","svgElem","removeAttribute","elType","prevButton","element","holder","attrs","key","append","childNodes","filter","child","nodeType","map","Flickity","constructor","selector","_options$dotsOptions","super","_defineProperty","this","dotsRoot","dotsOptions","cells","slide","pointerEvents","deactivatePageDots","getPrototypeOf","console","warn","superDeactivatePageDot","deactivate","bind","unbindStartEvent","log","parent","deactivatePrevNextButtons","superDeactivatePrevButton","superDeactivateNextButton","isAnimating","func","wait","immediate","timeout","args","context","later","apply","callNow","clearTimeout","setTimeout","readyState"],"sourceRoot":""}