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QF,KAAKoC,kBACLpC,KAAKiC,6BACLjC,KAAKyB,8BAAgC,EACrCzB,KAAKJ,YAAYsC,cAAclC,KAAKmC,kCAAkCnC,KAAKyB,+BAEnF,CAEA,cAAAM,GAEI/B,KAAKqC,uBAAuBrC,KAAKyB,8BACjCzB,KAAKuB,iBACLvB,KAAKW,2BACT,CAEA,kCAAA2B,CAAmCC,GAG/BvC,KAAKY,oBAAsBZ,KAAKJ,YAAY4C,cAAc,EAAAC,YAAYC,qBAAqB,EAAAC,eAAeC,yBAAyBC,OACnI7C,KAAKgB,oBAAsBhB,KAAKJ,YAAY4C,cAAc,EAAAC,YAAYC,qBAAqB,EAAAC,eAAeC,yBAAyBE,OAEnI/C,MAAMuC,mCAAmCC,GACzCvC,KAAK+B,gBACT,CAEA,OAAAgB,GACIhD,MAAMgD,SACV,E,qIClHG,SAASC,KACZ,IAAAC,8BAA6D,EAAAxD,+BACzD,EAAAgD,YAAYC,qBAAqB,EAAAC,eAAelD,+BAA+BA,gCAC/EyD,EACR,CAEA,SAASA,EAAsCC,GAC3C,IAAIC,EAAuBD,EAAeE,aAAa,EAAAV,eAAeW,mBAAmBC,sBACrFC,EAA4B,EAAAC,aAAaF,qBAAqBG,aAAeN,EAAwB,EAAAK,aAAaF,qBAAqBG,WAAa,EAAAD,aAAaF,qBAAqBI,SACtLC,EAAoC,IAAI,EAAAnE,+BAA+B0D,EAAgBK,GACrFK,OAAQV,EAAeE,aAAa,EAAAV,eAAelD,+BAA+BA,gCAAkC,kCAAoCmE,CAClK,C","sources":["webpack://LoBSiteTemplates/./src/components/selectableCarousel/singlePagingSelectableCarousel.ts","webpack://LoBSiteTemplates/./src/components/selectableCarousel/singlePagingSelectableCarouselInitialiser.ts"],"sourcesContent":["import { AttributeEnums } from \"../../shared/utilities/enums/attributeEnums\";\r\nimport { CustomEventEnums } from \"../../shared/utilities/enums/customEventEnums\";\r\nimport { UtilityEnums } from \"../../shared/utilities/enums/utillityEnums\";\r\nimport { HelperUtils } from \"../../shared/utilities/helperUtils\";\r\nimport { BasePagingSelectableCarousel, IBasePagingSelectableCarousel } from \"./basePagingSelectableCarousel\";\r\nimport { SelectableCarousel, ISelectableCarousel } from \"./selectableCarousel\";\r\n\r\n\r\nexport interface ISinglePagingSelectableCarousel extends IBasePagingSelectableCarousel {\r\n    moveToPosition:()=>void;\r\n}\r\n\r\nexport class SinglePagingSelectableCarousel extends BasePagingSelectableCarousel implements ISinglePagingSelectableCarousel {\r\n\r\n    private readonly _moveCarouselToNextPosition;\r\n    private readonly _moveCarouselToPrevPosition;\r\n    private readonly _reinitialiseCarousel;\r\n\r\n    public currentPage: number;\r\n\r\n    constructor(public htmlElement: Element, carouselOrientation: UtilityEnums.ComponentOrientation, topLevelHtmlElement?: HTMLElement) {\r\n        super(htmlElement, carouselOrientation, topLevelHtmlElement);\r\n\r\n        this._moveCarouselToNextPosition = this.moveCarouselToNextPosition.bind(this);\r\n        this._moveCarouselToPrevPosition = this.moveCarouselToPrevPosition.bind(this);\r\n        this._reinitialiseCarousel = this.reinitialiseCarousel.bind(this);\r\n\r\n        this.attachCarouselPageNextClickEventListener();\r\n        this.attachCarouselPagePrevClickEventListener();\r\n        this.attachViewportDimensionsChangedEventListener();\r\n\r\n        this.setCarouselShowHideArrows();\r\n    }\r\n\r\n    //Carousel Events  \r\n    attachCarouselPagePrevClickEventListener(): void {\r\n        console.log('SinglePagingSelectableCarousel: attachCarouselPagePrevClickEventListener');\r\n        this.carouselPrevElement.addEventListener('click', this._moveCarouselToPrevPosition);\r\n    }\r\n\r\n    removeCarouselPagePrevClickEventListener(): void {\r\n        this.carouselPrevElement.removeEventListener('click', this._moveCarouselToPrevPosition);\r\n    }\r\n\r\n    attachCarouselPageNextClickEventListener(): void {\r\n        console.log('SinglePagingSelectableCarousel: attachCarouselPageNextClickEventListener');\r\n        this.carouselNextElement.addEventListener('click', this._moveCarouselToNextPosition);\r\n    }\r\n\r\n    removeCarouselPageNextClickEventListener(): void {\r\n        this.carouselNextElement.removeEventListener('click', this._moveCarouselToNextPosition);\r\n    }\r\n\r\n    attachViewportDimensionsChangedEventListener(): void {\r\n        console.log('SinglePagingSelectableCarousel: attachViewportDimensionsChangedEventListener');\r\n        document.addEventListener(CustomEventEnums.ViewportDimensionsChangedEvent, this._reinitialiseCarousel);\r\n    }\r\n\r\n    removeViewportDimensionsChangedEventListener(): void {\r\n        document.removeEventListener(CustomEventEnums.ViewportDimensionsChangedEvent, this._reinitialiseCarousel);\r\n    }\r\n\r\n    getCellsPerPage(): number {\r\n        return 1;\r\n    };\r\n\r\n    setCurrentPage(): void {\r\n        this.currentPage = this.carouselCurrentSelectedIndex + 1;\r\n    }\r\n\r\n    getInitialPage(): number {\r\n        return this.carouselCurrentSelectedIndex + 1;\r\n    }\r\n\r\n    reinitialiseCarousel(): void {\r\n        console.log('SinglePagingSelectableCarousel: reinitialiseCarousel');\r\n        this.totalOccupiedCells = this.occupiedCellsElements.length;\r\n        this.initialiseCarouselCurrentSelectedIndex();\r\n        this.setCurrentPage();\r\n        this.setCarouselShowHideArrows();\r\n        this.moveToPosition();\r\n    };\r\n\r\n    moveCarouselToPrevPosition(): void {\r\n        console.log('SinglePagingSelectableCarousel: moveCarouselToPrevPosition');\r\n        if (this.hasPrevButton()) {\r\n            this.setAllMediaTilesToInactive();\r\n            this.carouselCurrentSelectedIndex -= 1;\r\n            this.htmlElement.dispatchEvent(this.selectedCarouselCellSelectedEvent(this.carouselCurrentSelectedIndex));\r\n        }\r\n    }\r\n\r\n    moveCarouselToNextPosition(): void {\r\n        console.log('SinglePagingSelectableCarousel: moveCarouselToNextPosition');\r\n        if (this.hasNextButton()) {\r\n            this.setAllMediaTilesToInactive();\r\n            this.carouselCurrentSelectedIndex += 1;\r\n            this.htmlElement.dispatchEvent(this.selectedCarouselCellSelectedEvent(this.carouselCurrentSelectedIndex));\r\n        }\r\n    }\r\n\r\n    moveToPosition(): void {\r\n        console.log('SinglePagingSelectableCarousel: moveToPosition');\r\n        this.moveCarouselToPosition(this.carouselCurrentSelectedIndex);\r\n        this.setCurrentPage();\r\n        this.setCarouselShowHideArrows();\r\n    }\r\n\r\n    updateCarouselCurrentSelectedIndex(index: number) {\r\n        console.log('SinglePagingSelectableCarousel: updateCarouselCurrentSelectedIndex - index ' + index.toString());\r\n\r\n        this.carouselPrevElement = this.htmlElement.querySelector(HelperUtils.addDataAttributeTags(AttributeEnums.PagingSelectableCarousel.Prev));\r\n        this.carouselNextElement = this.htmlElement.querySelector(HelperUtils.addDataAttributeTags(AttributeEnums.PagingSelectableCarousel.Next));\r\n\r\n        super.updateCarouselCurrentSelectedIndex(index);\r\n        this.moveToPosition();\r\n    }\r\n\r\n    dispose(): void {\r\n        super.dispose();\r\n    }\r\n}","import { initialiseInstanceComponents } from \"../../shared/instanceComponentInitialiser\";\r\nimport { AttributeEnums } from \"../../shared/utilities/enums/attributeEnums\";\r\nimport { UtilityEnums } from \"../../shared/utilities/enums/utillityEnums\";\r\nimport { HelperUtils } from \"../../shared/utilities/helperUtils\";\r\nimport { SinglePagingSelectableCarousel } from \"../selectableCarousel/singlePagingSelectableCarousel\";\r\n\r\nexport function initialiseSinglePagingSelectableCarousel() {\r\n    initialiseInstanceComponents<SinglePagingSelectableCarousel>(SinglePagingSelectableCarousel,\r\n        HelperUtils.addDataAttributeTags(AttributeEnums.SinglePagingSelectableCarousel.SinglePagingSelectableCarousel),\r\n        singlePagingSelectableCarouselFactory);\r\n}\r\n\r\nfunction singlePagingSelectableCarouselFactory(currentElement: Element): void {\r\n    let componentOrientation = currentElement.getAttribute(AttributeEnums.SelectableCarousel.ComponentOrientation);\r\n    let componentOrientationEnum = (UtilityEnums.ComponentOrientation.Horizontal === componentOrientation) ? UtilityEnums.ComponentOrientation.Horizontal : UtilityEnums.ComponentOrientation.Vertical;\r\n    let newSinglePagingSelectableCarousel = new SinglePagingSelectableCarousel(currentElement, componentOrientationEnum);\r\n    (<any>window)[currentElement.getAttribute(AttributeEnums.SinglePagingSelectableCarousel.SinglePagingSelectableCarousel) + 'SinglePagingSelectableCarousel'] = newSinglePagingSelectableCarousel;\r\n}"],"names":["SinglePagingSelectableCarousel","BasePagingSelectableCarousel","constructor","htmlElement","carouselOrientation","topLevelHtmlElement","super","this","_moveCarouselToNextPosition","moveCarouselToNextPosition","bind","_moveCarouselToPrevPosition","moveCarouselToPrevPosition","_reinitialiseCarousel","reinitialiseCarousel","attachCarouselPageNextClickEventListener","attachCarouselPagePrevClickEventListener","attachViewportDimensionsChangedEventListener","setCarouselShowHideArrows","carouselPrevElement","addEventListener","removeCarouselPagePrevClickEventListener","removeEventListener","carouselNextElement","removeCarouselPageNextClickEventListener","document","CustomEventEnums","ViewportDimensionsChangedEvent","removeViewportDimensionsChangedEventListener","getCellsPerPage","setCurrentPage","currentPage","carouselCurrentSelectedIndex","getInitialPage","totalOccupiedCells","occupiedCellsElements","length","initialiseCarouselCurrentSelectedIndex","moveToPosition","hasPrevButton","setAllMediaTilesToInactive","dispatchEvent","selectedCarouselCellSelectedEvent","hasNextButton","moveCarouselToPosition","updateCarouselCurrentSelectedIndex","index","querySelector","HelperUtils","addDataAttributeTags","AttributeEnums","PagingSelectableCarousel","Prev","Next","dispose","initialiseSinglePagingSelectableCarousel","initialiseInstanceComponents","singlePagingSelectableCarouselFactory","currentElement","componentOrientation","getAttribute","SelectableCarousel","ComponentOrientation","componentOrientationEnum","UtilityEnums","Horizontal","Vertical","newSinglePagingSelectableCarousel","window"],"sourceRoot":""}