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EAAQ+C,aAElD,CAGAK,kBAAAA,GACI,IAEIlD,OAAOmD,eAAenD,OAAOmD,eAAeR,OAAOO,oBACvD,CAAE,MAAOE,GACLC,QAAQC,KAAK,4DACb,MAAMC,EAA0BZ,KAAapF,SAASiG,WAAWC,KAAK,CAClE9B,OAAQgB,KAAKC,SAAS1B,cAAc,uBACpCwC,iBAAkBA,KAEdL,QAAQM,IAAI,aAAa,EAE7BC,OAAQ,CAAEvF,QAASsE,KAAKC,YAE5BW,GACJ,CACJ,CAEAM,yBAAAA,GACI,IAEI7D,OAAOmD,eAAenD,OAAOmD,eAAeR,OAAOkB,2BACvD,CAAE,MAAOT,GACLC,QAAQC,KAAK,mEACb,MAAMQ,EAA6BnB,KAAajB,WAAW8B,WAAWC,KAAK,CACvEpF,QAAUsE,KAAajB,WAAWrD,QAClCqF,iBAAkBA,KAEdL,QAAQM,IAAI,aAAa,EAE7BC,OAAQ,CAAEvF,QAASsE,KAAKC,YAEtBmB,EAA6BpB,KAAajB,WAAW8B,WAAWC,KAAK,CACvEpF,QAAUsE,KAAaf,WAAWvD,QAClCqF,iBAAkBA,KAEdL,QAAQM,IAAI,aAAa,EAE7BC,OAAQ,CAAEvF,QAASsE,KAAKC,YAE5BkB,IACAC,GACJ,CACJ,CAKAC,MAAAA,GACUrB,KAAasB,aACfxB,MAAMuB,QAEd,E,kBC1EE,SAAUlH,EAAqCoH,EAASC,EAAcC,GAAY,GACpF,IAAIC,EAEJ,OAAO,YAAyCC,GAE5C,MAAMC,EAAU5B,KACV6B,EAAQ,WACVH,EAAU,KACLD,GAAWF,EAAKO,MAAMF,EAASD,EACxC,EACMI,EAAUN,IAAcC,EAC9BM,aAAaN,GACbA,EAAUxG,OAAO+G,WAAWJ,EAAOL,GAC/BO,GAASR,EAAKO,MAAMF,EAASD,EACrC,CACJ,C","sources":["webpack://@sazka/web/./js/app/landing-page/widgets/_cards-with-img.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"],"sourcesContent":["import { debounce } from \"@sazka/utils/debounce\";\r\nimport { FlickityPatched } from \"@sazka/utils/carousel/flickity-patched\";\r\n\r\n$(() => {\r\n if (!$(\".lp-cards-img\").length) {\r\n return;\r\n }\r\n let flickities = [];\r\n\r\n const resizeHandler = debounce(function () {\r\n serviceFlickity();\r\n }, 100);\r\n\r\n $(window).on(\"resize\", resizeHandler);\r\n\r\n function initFlickity() {\r\n $(\".lp-cards-img .lp-cards-img__cards-container\").each((index, elem) => {\r\n flickities.push(\r\n new FlickityPatched(elem, {\r\n autoPlay: false,\r\n pageDots: false,\r\n draggable: true,\r\n prevNextButtons: true,\r\n wrapAround: true,\r\n percentPosition: true,\r\n cellAlign: \"center\",\r\n })\r\n );\r\n });\r\n }\r\n\r\n function serviceFlickity() {\r\n if (window.matchMedia(\"(max-width: 897px)\").matches) {\r\n if (!flickities.length) {\r\n initFlickity();\r\n } else {\r\n flickities.forEach((flickity) => {\r\n if (!flickity.isActive) {\r\n flickity._create();\r\n }\r\n });\r\n }\r\n flickities.forEach((flickity) => {\r\n const $buttons = $(flickity.element).find(\".flickity-button\");\r\n $(flickity.element).prev().append($buttons);\r\n });\r\n } else if (window.matchMedia(\"(min-width: 897px)\").matches && flickities.length) {\r\n try {\r\n $(\".lp-cards-img .flickity-button\").remove();\r\n flickities.forEach((flickity) => {\r\n flickity.destroy();\r\n });\r\n flickities = [];\r\n } catch {}\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"],"names":["$","length","flickities","resizeHandler","debounce","serviceFlickity","initFlickity","each","index","elem","push","FlickityPatched","autoPlay","pageDots","draggable","prevNextButtons","wrapAround","percentPosition","cellAlign","window","matchMedia","matches","forEach","flickity","isActive","_create","$buttons","element","find","prev","append","remove","destroy","on","PATH_ATTRS_MAP","SVG_ATTRS_MAP","viewBox","width","height","DS_ARROW_CLASS","BTN_CLASSES","defaultDotsOptions","rootEl","dots","theme","next","nextIcon","prevIcon","useDsClasses","useCustomPrevNextButtons","useFlickityDots","carousel","options","carouselInstance","Object","keys","config","assign","isInitActivated","indicatorClass","classList","add","initPrevButton","initDots","initNextButton","children","replaceChildren","initButton","btn","btnType","icon","setAttributes","querySelector","setAttribute","carouselBtn","getElementFromInstance","arrow","svgElem","removeAttribute","elType","prevButton","holder","nextButton","el","attrs","key","childNodes","filter","child","nodeType","map","Flickity","constructor","selector","_options$dotsOptions","super","_defineProperty","this","dotsRoot","dotsOptions","cells","slide","style","pointerEvents","deactivatePageDots","getPrototypeOf","e","console","warn","superDeactivatePageDot","deactivate","bind","unbindStartEvent","log","parent","deactivatePrevNextButtons","superDeactivatePrevButton","superDeactivateNextButton","resize","isAnimating","func","wait","immediate","timeout","args","context","later","apply","callNow","clearTimeout","setTimeout"],"sourceRoot":""}