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,mBAAmBC,UAAUC,IAAI,kBAEnE,EAgBA1B,EAAgBC,MAAMnB,E","sources":["webpack:///./modules/ThumbnailSlider.ts"],"sourcesContent":["/// \r\nimport Slider from './Slider';\r\n\r\nimport {\r\n copyObject, debounce,\r\n} from '../helpers/helperFunctions';\r\n\r\nconst moduleSelector = '[data-module=\"ThumbnailSlider\"]';\r\n\r\nconst defaultSliderOptions: LazyTinySliderSettings = {\r\n container: '.nx-tabs-slider__content',\r\n items: 1,\r\n slideBy: 'page',\r\n navContainer: '.nx-thumbnail-tabs__slider',\r\n navAsThumbnails: true,\r\n mouseDrag: true,\r\n nav: true,\r\n controls: false,\r\n loop: false,\r\n preventScrollOnTouch: 'auto',\r\n responsive: {\r\n 768: {\r\n items: 10\r\n }\r\n }\r\n};\r\n\r\nclass InitThumbnailSlider extends Slider {\r\n constructor(public element: HTMLElement, options: TinySliderSettings) {\r\n super(element, options)\r\n }\r\n}\r\n\r\nexport default class ThumbnailSlider {\r\n tabSliderWrapper: HTMLElement;\r\n tabSliderClass: string;\r\n slider;\r\n navContent: string;\r\n tabContentWrapper: HTMLElement;\r\n tabRowEl: HTMLElement;\r\n container: HTMLElement;\r\n navContainer: HTMLElement;\r\n options;\r\n getImageHeight;\r\n\r\n static setup(selector: string = moduleSelector): void {\r\n\r\n Array.from(document.querySelectorAll(selector)).filter((node: HTMLElement) => !node.dataset.moduleInitialized).forEach((element: HTMLElement) => {\r\n new ThumbnailSlider(element);\r\n element.dataset.moduleInitialized = 'true';\r\n });\r\n }\r\n\r\n constructor(public element: HTMLElement, options: TinySliderSettings = copyObject(defaultSliderOptions)) {\r\n this.options = options;\r\n this.container = element.querySelector(defaultSliderOptions.container) as HTMLElement;\r\n\r\n this.updateDefOptions()\r\n .initThumbnail();\r\n this.initIconSectionWidth();\r\n this.fullWidthClass();\r\n\r\n // window.onresize = () => {\r\n // // this.updateDefOptions()\r\n // // .initThumbnail();\r\n // this.initIconSectionWidth();\r\n // this.fullWidthClass();\r\n // };\r\n\r\n window.addEventListener('resize', debounce(() => {\r\n this.initIconSectionWidth();\r\n this.fullWidthClass();\r\n }, 350));\r\n }\r\n\r\n private initIconSectionWidth() {\r\n Array.from(document.querySelectorAll('.nx-image-tabs__icon')).forEach((element: HTMLElement) => {\r\n const elementBefore = element.querySelector('.nx-span-img__height') as HTMLElement;\r\n elementBefore.style.width = (`${element.clientWidth}` + \"px\");\r\n });\r\n }\r\n\r\n updateDefOptions(): ThumbnailSlider {\r\n this.options.navContainer = this.element.querySelector(`${defaultSliderOptions.navContainer}`) as HTMLElement\r\n return this;\r\n }\r\n\r\n initThumbnail(): ThumbnailSlider {\r\n new InitThumbnailSlider(this.container, this.options);\r\n return this;\r\n }\r\n\r\n fullWidthClass() {\r\n const getImageElWrapper = this.element.querySelector('.nx-image-tabs__slider');\r\n if (getImageElWrapper) {\r\n getImageElWrapper.closest('.nx-tab-wrapper').classList.add('nx-u-full-width');\r\n }\r\n }\r\n}\r\n\r\n// Hot Module Replacement\r\nif (module.hot) {\r\n let nodesCache: HMRNodes[] = Array.from(document.querySelectorAll(moduleSelector)).map((element: Node) => ({ nodeToReplace: element, nodeOrigin: element.cloneNode(true) }));\r\n\r\n ThumbnailSlider.setup(moduleSelector);\r\n\r\n module.hot.accept(() => {\r\n ThumbnailSlider.setup(moduleSelector);\r\n });\r\n module.hot.dispose(() => {\r\n nodesCache.forEach(({ nodeToReplace, nodeOrigin }) => { nodeToReplace = nodeToReplace.parentElement.replaceChild(nodeOrigin.cloneNode(true), nodeToReplace) });\r\n });\r\n} else {\r\n ThumbnailSlider.setup(moduleSelector);\r\n}"],"names":["moduleSelector","defaultSliderOptions","container","items","slideBy","navContainer","navAsThumbnails","mouseDrag","nav","controls","loop","preventScrollOnTouch","responsive","InitThumbnailSlider","constructor","element","options","super","ThumbnailSlider","setup","selector","Array","from","document","querySelectorAll","filter","node","dataset","moduleInitialized","forEach","this","querySelector","updateDefOptions","initThumbnail","initIconSectionWidth","fullWidthClass","window","addEventListener","style","width","clientWidth","getImageElWrapper","closest","classList","add"],"sourceRoot":""}