angular-responsive-carousel
Advanced tools
Comparing version 1.4.11 to 1.5.11
@@ -365,5 +365,7 @@ (function (global, factory) { | ||
this.initialPositionX = 0; | ||
this.newContainerPositionIndex = 0; // The index of the new position relative to the active index, for example -1 or +1 | ||
/* The index of the new position relative to the active index, for example -1 or +1 */ | ||
this.newContainerPositionIndex = 0; | ||
this.preliminarySlideCounter = 0; | ||
this.slideCounter = 0; // Scrolling Index (counter) | ||
/* Scrolling Index (counter) */ | ||
this.slideCounter = 0; | ||
this.previousSlideCounter = 0; | ||
@@ -377,19 +379,8 @@ this.isContentImages = true; | ||
_this.isTouchstart = true; | ||
if (_this.isSlideInProgress) { | ||
return; | ||
} | ||
var touches = event.touches; | ||
if (touches) { | ||
_this.startX = touches[0].clientX - _this.getCarouselElementPosition()['left']; | ||
} | ||
else { | ||
_this.startX = event.clientX - _this.getCarouselElementPosition()['left']; | ||
} | ||
_this.startX = _this.getStartX(event); | ||
_this.containerInitialPositionX = _this.getElementPosition()['left'] - _this.getCarouselElementPosition()['left']; | ||
_this.isMoveInProgress = true; | ||
_this.stopTransformContainer(); | ||
}; | ||
this.handleHorizontalSwipe = function (event) { | ||
if (_this.isSlideInProgress) { | ||
return; | ||
} | ||
var touches = event.touches; | ||
@@ -407,3 +398,3 @@ if (touches) { | ||
this.handleTouchend = function (event) { | ||
if (_this.isSlideInProgress || !_this.isTouchstart) { | ||
if (!_this.isTouchstart) { | ||
_this.isTouchstart = false; | ||
@@ -561,2 +552,20 @@ return; | ||
}); | ||
Carousel.prototype.stopTransformContainer = function () { | ||
this.transformPositionX(this.containerInitialPositionX, 0); | ||
this.setSlideCounter(); | ||
this.isSlideInProgress = false; | ||
this.newContainerPositionIndex = 0; | ||
this.isSlideLengthLimited = undefined; | ||
}; | ||
Carousel.prototype.getStartX = function (event) { | ||
var touches = event.touches; | ||
var startX; | ||
if (touches) { | ||
startX = touches[0].clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
else { | ||
startX = event.clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
return startX; | ||
}; | ||
/* Move */ | ||
@@ -587,2 +596,3 @@ Carousel.prototype.moveContainer = function () { | ||
}; | ||
/* Offset the container to show the last cell completely */ | ||
Carousel.prototype.getContainerPositionCorrection = function () { | ||
@@ -689,5 +699,3 @@ var correction = 0; | ||
if (length === void 0) { length = 1; } | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
this.newContainerPositionIndex = 0; | ||
this.direction = 'left'; | ||
@@ -698,5 +706,3 @@ this.handleSlide(length); | ||
if (length === void 0) { length = 1; } | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
this.newContainerPositionIndex = 0; | ||
this.direction = 'right'; | ||
@@ -709,41 +715,57 @@ this.handleSlide(length); | ||
}; | ||
Carousel.prototype.handleSlide = function (slideLength) { | ||
if (slideLength === void 0) { slideLength = undefined; } | ||
this.slideLength = this.getSlideLength(); | ||
this.slideLength = slideLength ? slideLength : this.limitSlideLength(this.slideLength); | ||
if (this.direction === 'left' && !this.isSlideInProgress) { | ||
this.preliminarySlideCounter = this.slideCounter + this.slideLength; | ||
if (!this.detectLastSlide(this.slideCounter + this.slideLength)) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex - this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
this.isContainerLocked = this.preliminarySlideCounter > this.overflowCellsLimit; | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
Carousel.prototype.handleSlide = function (customSlideLength) { | ||
if (customSlideLength === void 0) { customSlideLength = undefined; } | ||
var isUsingButton = customSlideLength; | ||
if (isUsingButton && this.isSlideInProgress) { | ||
return; | ||
} | ||
this.slideLength = customSlideLength ? customSlideLength : this.limitSlideLength(this.getSlideLength()); | ||
if (this.direction === 'left') { | ||
this.handleLeftSlide(); | ||
} | ||
if (this.direction === 'right') { | ||
this.handleRightSlide(); | ||
} | ||
this.alignContainer(); | ||
}; | ||
Carousel.prototype.handleLeftSlide = function () { | ||
this.preliminarySlideCounter = this.slideCounter + this.slideLength; | ||
var isLastSlide = this.detectLastSlide(this.slideCounter + this.slideLength); | ||
if (!isLastSlide) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex - this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
this.isContainerLocked = this.preliminarySlideCounter > this.overflowCellsLimit; | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
} | ||
} | ||
if (this.direction === 'right' && !this.isSlideInProgress) { | ||
if (this.slideCounter - this.slideLength < 0) { | ||
this.slideLength = this.slideCounter; | ||
} | ||
this.preliminarySlideCounter = this.slideCounter - this.slideLength; | ||
if (!this.isFirstCell) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex + this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
if (this.preliminarySlideCounter > this.overflowCellsLimit) { | ||
this.isContainerLocked = true; | ||
} | ||
else { | ||
this.isContainerLocked = false; | ||
} | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
else { | ||
this.slideLength = 0; | ||
} | ||
}; | ||
Carousel.prototype.handleRightSlide = function () { | ||
if (this.slideCounter - this.slideLength < 0) { | ||
this.slideLength = this.slideCounter; | ||
} | ||
this.preliminarySlideCounter = this.slideCounter - this.slideLength; | ||
if (!this.isFirstCell) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex + this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
if (this.preliminarySlideCounter > this.overflowCellsLimit) { | ||
this.isContainerLocked = true; | ||
} | ||
else { | ||
this.isContainerLocked = false; | ||
} | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
} | ||
} | ||
this.alignContainer(); | ||
else { | ||
this.slideLength = 0; | ||
} | ||
}; | ||
@@ -758,2 +780,6 @@ Carousel.prototype.getSlideLength = function () { | ||
}; | ||
/* | ||
* Limits the length of the slide during calls to the next() and prev() | ||
* methods if the specified position is outside the cell length | ||
*/ | ||
Carousel.prototype.limitSlideLength = function (slideLength) { | ||
@@ -915,3 +941,3 @@ if (slideLength > 1) { | ||
this.objectFit = 'cover'; | ||
this.minSwipeDistance = 50; | ||
this.minSwipeDistance = 10; | ||
this.transitionDuration = 200; | ||
@@ -918,0 +944,0 @@ this.transitionTimingFunction = 'ease'; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular-responsive-carousel",["exports","@angular/core","@angular/common"],e):e((t=t||self)["angular-responsive-carousel"]={},t.ng.core,t.ng.common)}(this,(function(t,e,i){"use strict";var n=function(){function t(t){var e=this;this.eventType=void 0,this.handlers={},this.startX=0,this.startY=0,this.lastTap=0,this.doubleTapMinTimeout=300,this.tapMinTimeout=200,this.touchstartTime=0,this.i=0,this.isMousedown=!1,this._touchListeners={touchstart:"handleTouchstart",touchmove:"handleTouchmove",touchend:"handleTouchend"},this._mouseListeners={mousedown:"handleMousedown",mousemove:"handleMousemove",mouseup:"handleMouseup",wheel:"handleWheel"},this._otherListeners={resize:"handleResize"},this.handleTouchstart=function(t){e.elementPosition=e.getElementPosition(),e.touchstartTime=(new Date).getTime(),void 0===e.eventType&&e.getTouchstartPosition(t),e.runHandler("touchstart",t)},this.handleTouchmove=function(t){var i=t.touches;switch(e.detectPan(i)&&e.runHandler("pan",t),e.detectPinch(t)&&e.runHandler("pinch",t),e.detectLinearSwipe(t)){case"horizontal-swipe":t.swipeType="horizontal-swipe",e.runHandler("horizontal-swipe",t);break;case"vertical-swipe":t.swipeType="vertical-swipe",e.runHandler("vertical-swipe",t)}(e.detectLinearSwipe(t)||"horizontal-swipe"===e.eventType||"vertical-swipe"===e.eventType)&&e.handleLinearSwipe(t)},this.handleTouchend=function(t){var i=t.touches;e.detectDoubleTap()&&e.runHandler("double-tap",t),e.detectTap(),e.runHandler("touchend",t),e.eventType="touchend",i&&0===i.length&&(e.eventType=void 0,e.i=0)},this.handleMousedown=function(t){e.isMousedown=!0,e.elementPosition=e.getElementPosition(),e.touchstartTime=(new Date).getTime(),void 0===e.eventType&&e.getMousedownPosition(t),e.runHandler("mousedown",t)},this.handleMousemove=function(t){if(e.isMousedown){switch(e.runHandler("pan",t),e.detectLinearSwipe(t)){case"horizontal-swipe":t.swipeType="horizontal-swipe",e.runHandler("horizontal-swipe",t);break;case"vertical-swipe":t.swipeType="vertical-swipe",e.runHandler("vertical-swipe",t)}(e.detectLinearSwipe(t)||"horizontal-swipe"===e.eventType||"vertical-swipe"===e.eventType)&&e.handleLinearSwipe(t)}},this.handleMouseup=function(t){e.detectTap(),e.isMousedown=!1,e.runHandler("mouseup",t),e.eventType=void 0,e.i=0},this.handleWheel=function(t){e.runHandler("wheel",t)},this.handleResize=function(t){e.runHandler("resize",t)},this.properties=t,this.element=this.properties.element,this.elementPosition=this.getElementPosition(),this.toggleEventListeners("addEventListener")}return Object.defineProperty(t.prototype,"touchListeners",{get:function(){return this.properties.touchListeners?this.properties.touchListeners:this._touchListeners},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mouseListeners",{get:function(){return this.properties.mouseListeners?this.properties.mouseListeners:this._mouseListeners},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"otherListeners",{get:function(){return this.properties.otherListeners?this.properties.otherListeners:this._otherListeners},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.toggleEventListeners("removeEventListener")},t.prototype.toggleEventListeners=function(t){var e;for(var i in e="mouse and touch"===this.properties.listeners?Object.assign(this.touchListeners,this.mouseListeners):this.detectTouchScreen()?this.touchListeners:this.mouseListeners,this.properties.resize&&(e=Object.assign(e,this.otherListeners)),e){var n=e[i];"resize"===i?("addEventListener"===t&&window.addEventListener(i,this[n],!1),"removeEventListener"===t&&window.removeEventListener(i,this[n],!1)):"mouseup"===i||"mousemove"===i?("addEventListener"===t&&document.addEventListener(i,this[n],!1),"removeEventListener"===t&&document.removeEventListener(i,this[n],!1)):("addEventListener"===t&&this.element.addEventListener(i,this[n],!1),"removeEventListener"===t&&this.element.removeEventListener(i,this[n],!1))}},t.prototype.addEventListeners=function(t,e){window.addEventListener(t,this[e],!1)},t.prototype.removeEventListeners=function(t,e){window.removeEventListener(t,this[e],!1)},t.prototype.handleLinearSwipe=function(t){this.i++,this.i>3&&(this.eventType=this.getLinearSwipeType(t)),"horizontal-swipe"===this.eventType&&this.runHandler("horizontal-swipe",t),"vertical-swipe"===this.eventType&&this.runHandler("vertical-swipe",t)},t.prototype.runHandler=function(t,e){this.handlers[t]&&this.handlers[t](e)},t.prototype.detectPan=function(t){return 1===t.length&&!this.eventType||"pan"===this.eventType},t.prototype.detectDoubleTap=function(){var t=this;if(null==this.eventType){var e=(new Date).getTime(),i=e-this.lastTap;if(clearTimeout(this.doubleTapTimeout),i<this.doubleTapMinTimeout&&i>0)return!0;this.doubleTapTimeout=setTimeout((function(){clearTimeout(t.doubleTapTimeout)}),this.doubleTapMinTimeout),this.lastTap=e}},t.prototype.detectTap=function(){if(null==this.eventType){var t=(new Date).getTime()-this.touchstartTime;t>0&&(t<this.tapMinTimeout?this.runHandler("tap",event):this.runHandler("longtap",event))}},t.prototype.detectPinch=function(t){return 2===t.touches.length&&void 0===this.eventType||"pinch"===this.eventType},t.prototype.detectLinearSwipe=function(t){var e=t.touches;if(e){if(1===e.length&&!this.eventType||"horizontal-swipe"===this.eventType||"vertical-swipe"===this.eventType)return this.getLinearSwipeType(t)}else if(!this.eventType||"horizontal-swipe"===this.eventType||"vertical-swipe"===this.eventType)return this.getLinearSwipeType(t)},t.prototype.getLinearSwipeType=function(t){if("horizontal-swipe"!==this.eventType&&"vertical-swipe"!==this.eventType){var e=Math.abs(this.moveLeft(0,t)-this.startX);return 3*Math.abs(this.moveTop(0,t)-this.startY)>e?"vertical-swipe":"horizontal-swipe"}return this.eventType},t.prototype.getElementPosition=function(){return this.element.getBoundingClientRect()},t.prototype.getTouchstartPosition=function(t){this.startX=t.touches[0].clientX-this.elementPosition.left,this.startY=t.touches[0].clientY-this.elementPosition.top},t.prototype.getMousedownPosition=function(t){this.startX=t.clientX-this.elementPosition.left,this.startY=t.clientY-this.elementPosition.top},t.prototype.moveLeft=function(t,e){var i=e.touches;return i?i[t].clientX-this.elementPosition.left:e.clientX-this.elementPosition.left},t.prototype.moveTop=function(t,e){var i=e.touches;return i?i[t].clientY-this.elementPosition.top:e.clientY-this.elementPosition.top},t.prototype.detectTouchScreen=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");return"ontouchstart"in window||function(t){return window.matchMedia(t).matches}(["(",t.join("touch-enabled),("),"heartz",")"].join(""))},t.prototype.on=function(t,e){t&&(this.handlers[t]=e)},t}(),o=function(){function t(t){var e=this;this.initialPositionX=0,this.newContainerPositionIndex=0,this.preliminarySlideCounter=0,this.slideCounter=0,this.previousSlideCounter=0,this.isContentImages=!0,this.isLazyLoad=!0,this.isContainerLocked=!0,this.alignCells="left",this.initialContainerPosition=0,this.handleTouchstart=function(t){if(e.isTouchstart=!0,!e.isSlideInProgress){var i=t.touches;e.startX=i?i[0].clientX-e.getCarouselElementPosition().left:t.clientX-e.getCarouselElementPosition().left,e.containerInitialPositionX=e.getElementPosition().left-e.getCarouselElementPosition().left,e.isMoveInProgress=!0}},this.handleHorizontalSwipe=function(t){if(!e.isSlideInProgress){var i=t.touches;e.moveX=i?i[0].clientX-e.getCarouselElementPosition().left:t.clientX-e.getCarouselElementPosition().left,e.distanceAbs=e.getDistanceAbs(),e.direction=e.getDirection(),e.moveContainer()}},this.handleTouchend=function(t){!e.isSlideInProgress&&e.isTouchstart?(e.isMoveInProgress=!1,e.detectSlide()?e.handleSlide():(e.newContainerPositionIndex=0,e.alignContainer()),e.startX=e.moveX=e.distanceAbs=void 0,e.isTouchstart=!1):e.isTouchstart=!1},this.element=t.element,this.properties=t,this.cells=this.element.children,this.visibleWidth=this.properties.visibleWidth||this.element.parentElement.clientWidth,this.setContainerWidth(),this.alignContainer(0)}return Object.defineProperty(t.prototype,"cellLength",{get:function(){return this.images?this.images.length:this.cells.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalContainerCellsCount",{get:function(){if(this.images){var t=this.visibleCellsCount+2*this.overflowCellsLimit;return t>this.images.length&&(t=this.images.length),t}return this.cellLength},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFirstCell",{get:function(){return 0===this.slideCounter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastCellIndex",{get:function(){return this.images.length?this.images.length-1:this.cells.length-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overflowCellsLimit",{get:function(){return this.images&&this.isImagesLessCellLimit?Math.floor((this.images.length-this.visibleCellsCount)/2):this.properties.overflowCellsLimit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isImagesLessCellLimit",{get:function(){return 2*this.properties.overflowCellsLimit+this.visibleCellsCount>this.images.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellLimit",{get:function(){return this.visibleCellsCount+2*this.overflowCellsLimit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"images",{get:function(){return this.properties.images},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return this.properties.margin},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minSwipeDistance",{get:function(){return this.properties.minSwipeDistance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitionDuration",{get:function(){return this.properties.transitionDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitionTimingFunction",{get:function(){return this.properties.transitionTimingFunction},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullCellWidth",{get:function(){return this.properties.cellWidth+this.margin},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleCellsCount",{get:function(){return Math.ceil(this.visibleWidth/this.fullCellWidth)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lapCounter",{get:function(){return Math.floor(this.slideCounter/this.totalContainerCellsCount)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleCellsOverflowContainer",{get:function(){return this.visibleCellsCount*this.fullCellWidth-this.margin>this.visibleWidth},enumerable:!1,configurable:!0}),t.prototype.moveContainer=function(){var t=this.getMovePositionX();this.transformPositionX(t,0)},t.prototype.getMovePositionX=function(){var t=this.getDistance();return this.containerInitialPositionX-t},t.prototype.alignContainer=function(t){void 0===t&&(t=this.transitionDuration);var e=this.getContainerPosition();this.transformPositionX(e,t),this.setInitialContainerPosition(e)},t.prototype.getContainerPosition=function(){var t=this.getContainerPositionCorrection();return this.isContainerPositionCorrection=0!=t,this.initialContainerPosition+this.newContainerPositionIndex*this.fullCellWidth+t},t.prototype.setInitialContainerPosition=function(t){var e=this.getContainerPositionCorrection();this.initialContainerPosition=t-e},t.prototype.getContainerPositionCorrection=function(){var t=0;return this.properties.loop?0:((this.cellLength-this.preliminarySlideCounter<this.visibleCellsCount||this.isSlideLengthLimited)&&(this.visibleWidth<this.totalContainerCellsCount*this.fullCellWidth&&(t=-(this.visibleCellsCount*this.fullCellWidth-this.visibleWidth-this.margin)),t>=-this.margin&&(t=0)),t)},t.prototype.quicklyPositionContainer=function(){var t=this.getContainerPositionCorrection(),e=this.getNewContainerPosition()+t;this.transformPositionX(e,0),this.setInitialContainerPosition(e)},t.prototype.getNewContainerPosition=function(){return this.slideCounter>this.overflowCellsLimit&&"left"===this.alignCells?(this.lineUpCells(),-this.overflowCellsLimit*this.fullCellWidth):this.slideCounter<=this.overflowCellsLimit?(this.previousSlideCounter>this.overflowCellsLimit&&this.lineUpCells(),-this.slideCounter*this.fullCellWidth):void 0},t.prototype.setContainerWidth=function(){var t=this.getContainerWidth();this.element.style.width=t+"px"},t.prototype.getContainerWidth=function(){var t=this.totalContainerCellsCount*this.fullCellWidth,e=this.cellLength*this.fullCellWidth;return e<t&&(t=e),t},t.prototype.getFile=function(t){var e=this.getFileIndex(t),i=this.images[e];return i&&!i.type&&(i.type="image"),{image:this.images[e],imageIndex:e}},t.prototype.getFileIndex=function(t){var e,i=this.getPositionIndex(t),n=(this.totalContainerCellsCount,this.slideCounter);if(!this.isContainerLocked)return n<=this.overflowCellsLimit?t:(e=i+(n-this.overflowCellsLimit),this.images&&this.properties.loop&&(e%=this.images.length),e);"left"===this.alignCells&&(e=n>this.overflowCellsLimit?i+(n-this.overflowCellsLimit):t);return!(e>this.lastCellIndex&&!this.properties.loop)&&e},t.prototype.transformPositionX=function(t,e){void 0===e&&(e=this.transitionDuration),this.element.style.transition="transform "+e+"ms "+this.transitionTimingFunction,this.element.style.transform="translateX("+t+"px)"},t.prototype.detectSlide=function(){return this.distanceAbs>=this.minSwipeDistance},t.prototype.next=function(t){void 0===t&&(t=1),this.isSlideInProgress||(this.direction="left",this.handleSlide(t))},t.prototype.prev=function(t){void 0===t&&(t=1),this.isSlideInProgress||(this.direction="right",this.handleSlide(t))},t.prototype.select=function(t){this.slideCounter=t,this.quicklyPositionContainer()},t.prototype.handleSlide=function(t){void 0===t&&(t=void 0),this.slideLength=this.getSlideLength(),this.slideLength=t||this.limitSlideLength(this.slideLength),"left"!==this.direction||this.isSlideInProgress||(this.preliminarySlideCounter=this.slideCounter+this.slideLength,this.detectLastSlide(this.slideCounter+this.slideLength)||(this.newContainerPositionIndex=this.newContainerPositionIndex-this.slideLength,this.isSlideInProgress=!0,this.isLazyLoad&&(this.isContainerLocked=this.preliminarySlideCounter>this.overflowCellsLimit,this.detectContainerUnlock()&&(this.isContainerLocked=!1)))),"right"!==this.direction||this.isSlideInProgress||(this.slideCounter-this.slideLength<0&&(this.slideLength=this.slideCounter),this.preliminarySlideCounter=this.slideCounter-this.slideLength,this.isFirstCell||(this.newContainerPositionIndex=this.newContainerPositionIndex+this.slideLength,this.isSlideInProgress=!0,this.isLazyLoad&&(this.preliminarySlideCounter>this.overflowCellsLimit?this.isContainerLocked=!0:this.isContainerLocked=!1,this.detectContainerUnlock()&&(this.isContainerLocked=!1)))),this.alignContainer()},t.prototype.getSlideLength=function(){var t=this.getContainerPositionCorrection(),e=Math.floor((this.distanceAbs+t)/this.fullCellWidth);return this.distanceAbs%this.fullCellWidth>=this.minSwipeDistance&&e++,e},t.prototype.limitSlideLength=function(t){if(t>1)for(var e=0;e<t;e++){var i=this.slideCounter+(t-e);if(!this.detectLastSlide(i)){t-=e,this.isSlideLengthLimited=e>0;break}}return t},t.prototype.detectLastSlide=function(t){return!this.properties.loop&&this.cellLength-t<this.visibleCellsCount},t.prototype.isNextArrowDisabled=function(){return this.visibleCellsOverflowContainer?this.detectLastSlide(this.slideCounter+1)&&this.isContainerPositionCorrection:this.detectLastSlide(this.slideCounter+1)},t.prototype.isPrevArrowDisabled=function(){return 0===this.slideCounter},t.prototype.detectContainerUnlock=function(){return this.cellLength-this.preliminarySlideCounter<this.visibleCellsCount+this.overflowCellsLimit},t.prototype.handleSlideEnd=function(){this.isSlideInProgress&&(this.transformSlideEnd(),this.isSlideInProgress=!1,this.newContainerPositionIndex=0,this.isSlideLengthLimited=void 0)},t.prototype.transformSlideEnd=function(){this.isLazyLoad&&(this.setSlideCounter(),(this.images||!this.images&&this.properties.loop)&&this.quicklyPositionContainer()),this.previousSlideCounter=this.slideCounter},t.prototype.setSlideCounter=function(){"left"===this.direction&&(this.slideCounter=this.slideCounter+this.slideLength),"right"===this.direction&&(this.slideCounter=this.slideCounter-this.slideLength),this.direction=void 0,this.slideLength=0},t.prototype.resetTransition=function(){this.element.style.transition=""},t.prototype.getElementPosition=function(){return this.element.getBoundingClientRect()},t.prototype.getCarouselElementPosition=function(){return this.properties.container.getBoundingClientRect()},t.prototype.getDistance=function(){return this.startX-this.moveX},t.prototype.getDistanceAbs=function(){return Math.abs(this.startX-this.moveX)},t.prototype.getDirection=function(){var t=Math.sign(this.startX-this.moveX);return-1===t?"right":1===t?"left":void 0},t.prototype.lineUpCells=function(){for(var t=this.element.children,e=0;e<t.length;e++){var i=t[e],n=this.getCellPositionX(e);i.style.transform="translateX("+n+"px)",i.style.width=this.properties.cellWidth+"px"}},t.prototype.getCellPositionX=function(t){return this.getPositionIndex(t)*this.fullCellWidth},t.prototype.getPositionIndex=function(t){var e,i=this.slideCounter,n=this.totalContainerCellsCount,o=i-this.overflowCellsLimit;return o>n&&(o%=n),o<0?t:((e=t-o)<0&&(e=n+e),e)},t.prototype.getCenterPositionIndex=function(){return(this.totalContainerCellsCount-1)/2},t.prototype.autoplay=function(){var t=this;this.autoplayId=setInterval((function(){t.next()}),this.properties.autoplayInterval)},t.prototype.stopAutoplay=function(){this.autoplayId&&clearInterval(this.autoplayId)},t.prototype.destroy=function(){this.stopAutoplay()},t}(),s=function(){function t(t,i){var n=this;this.elementRef=t,this.ref=i,this.minTimeout=30,this._cellWidth=200,this.events=new e.EventEmitter,this.height=200,this.loop=!1,this.autoplay=!1,this.autoplayInterval=5e3,this.pauseOnHover=!0,this.dots=!1,this.margin=10,this.objectFit="cover",this.minSwipeDistance=50,this.transitionDuration=200,this.transitionTimingFunction="ease",this.counterSeparator=" / ",this.overflowCellsLimit=3,this.listeners="mouse and touch",this.cellsToScroll=1,this.arrows=!0,this.arrowsTheme="light",this.hostClassCarousel=!0,this.handleTouchstart=function(t){n.touches.addEventListeners("mousemove","handleMousemove"),n.carousel.handleTouchstart(t),n.isMoving=!0},this.handleHorizontalSwipe=function(t){t.preventDefault(),n.carousel.handleHorizontalSwipe(t)},this.handleTouchend=function(t){t.touches;n.carousel.handleTouchend(t),n.touches.removeEventListeners("mousemove","handleMousemove"),n.isMoving=!1}}return Object.defineProperty(t.prototype,"isContainerLocked",{get:function(){return this.carousel.isContainerLocked},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"slideCounter",{get:function(){return this.carousel.slideCounter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSlideCounter",{get:function(){return this.carousel.previousSlideCounter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lapCounter",{get:function(){return this.carousel.lapCounter},enumerable:!1,configurable:!0}),t.prototype.lineUpCells=function(){this.carousel.lineUpCells()},t.prototype.quicklyPositionContainer=function(){this.carousel.quicklyPositionContainer()},Object.defineProperty(t.prototype,"isLandscape",{get:function(){return window.innerWidth>window.innerHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSafari",{get:function(){var t=navigator.userAgent.toLowerCase();if(-1!==t.indexOf("safari"))return!(t.indexOf("chrome")>-1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"counter",{get:function(){return(this.loop?this.slideCounter%this.cellLength:this.slideCounter)+1+this.counterSeparator+this.cellLength},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellsElement",{get:function(){return this.elementRef.nativeElement.querySelector(".carousel-cells")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"images",{get:function(){return this._images},set:function(t){this._images=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellWidth",{set:function(t){t&&(this._cellWidth=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCounter",{get:function(){return this._isCounter&&this.cellLength>1},set:function(t){t&&(this._isCounter=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeDotIndex",{get:function(){return this.slideCounter%this.cellLength},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellLimit",{get:function(){if(this.carousel)return this.carousel.cellLimit},enumerable:!1,configurable:!0}),t.prototype.onWindowResize=function(t){this.landscapeMode=this.isLandscape,this.ref.detectChanges(),this.initCarousel(),this.carousel.lineUpCells()},t.prototype.onMousemove=function(t){this.autoplay&&this.pauseOnHover&&this.carousel.stopAutoplay()},t.prototype.onMouseleave=function(t){this.autoplay&&this.pauseOnHover&&this.carousel.autoplay()},t.prototype.ngOnInit=function(){this.isNgContent=this.cellsElement.children.length>0,this.touches=new n({element:this.cellsElement,listeners:this.listeners,mouseListeners:{mousedown:"handleMousedown",mouseup:"handleMouseup"}}),this.touches.on("touchstart",this.handleTouchstart),this.touches.on("horizontal-swipe",this.handleHorizontalSwipe),this.touches.on("touchend",this.handleTouchend),this.touches.on("mousedown",this.handleTouchstart),this.touches.on("mouseup",this.handleTouchend),this.initCarousel(),this.setDimensions(),this.autoplay&&this.carousel.autoplay()},t.prototype.ngAfterViewInit=function(){this.cellLength=this.getCellLength(),this.dotsArr=Array(this.cellLength).fill(1),this.ref.detectChanges(),this.carousel.lineUpCells(),this.detectDomChanges()},t.prototype.ngOnChanges=function(t){(t.width||t.height||t.images)&&(this.setDimensions(),this.initCarousel(),this.carousel.lineUpCells(),this.ref.detectChanges())},t.prototype.ngOnDestroy=function(){this.touches.destroy(),this.carousel.destroy()},t.prototype.initCarousel=function(){this.carousel=new o({element:this.elementRef.nativeElement.querySelector(".carousel-cells"),container:this.elementRef.nativeElement,images:this.images,cellWidth:this.getCellWidth(),loop:this.loop,autoplayInterval:this.autoplayInterval,overflowCellsLimit:this.overflowCellsLimit,visibleWidth:this.width,margin:this.margin,minSwipeDistance:this.minSwipeDistance,transitionDuration:this.transitionDuration,transitionTimingFunction:this.transitionTimingFunction,videoProperties:this.videoProperties})},t.prototype.detectDomChanges=function(){var t=this;new MutationObserver((function(e){t.onDomChanges()})).observe(this.elementRef.nativeElement,{attributes:!0,childList:!0,characterData:!0})},t.prototype.onDomChanges=function(){this.cellLength=this.getCellLength(),this.carousel.lineUpCells(),this.ref.detectChanges()},t.prototype.setDimensions=function(){this.hostStyleHeight=this.height+"px",this.hostStyleWidth=this.width+"px"},t.prototype.getFile=function(t){return this.carousel.getFile(t)},t.prototype.handleTransitionendCellContainer=function(t){this.carousel.handleSlideEnd()},t.prototype.toggleVideo=function(t){event.preventDefault(),this.videoProperties.noPlay||(t.paused?(t.play(),this.isVideoPlaying=!0):(t.pause(),this.isVideoPlaying=!1),this.ref.detectChanges())},t.prototype.getCurrentIndex=function(){return this.carousel.slideCounter},t.prototype.getCellWidth=function(){var t=this.elementRef.nativeElement.clientWidth;return this.cellsToShow?(t-(this.cellsToShow>1?this.margin:0)*(this.cellsToShow-1))/this.cellsToShow:"100%"===this._cellWidth?t:this._cellWidth},t.prototype.next=function(){this.carousel.next(this.cellsToScroll),this.carousel.stopAutoplay()},t.prototype.prev=function(){this.carousel.prev(this.cellsToScroll),this.carousel.stopAutoplay()},t.prototype.select=function(t){this.carousel.select(t)},t.prototype.isNextArrowDisabled=function(){return this.carousel.isNextArrowDisabled()},t.prototype.isPrevArrowDisabled=function(){return this.carousel.isPrevArrowDisabled()},t.prototype.getCellLength=function(){return this.images?this.images.length:this.cellsElement.children.length},t}();s.decorators=[{type:e.Component,args:[{selector:"carousel, [carousel]",exportAs:"carousel",template:'<div class="carousel-counter" *ngIf="isCounter">{{counter}}</div>\n\n<div class="carousel-container" [class.carousel-moving]="isMoving">\n\t<div class="carousel-cells" #cells (transitionend)="handleTransitionendCellContainer($event)">\n\t\t<ng-content></ng-content>\n\n\t\t<ng-template ngFor let-image [ngForOf]="images" let-i="index">\n\t\t\t<div class="carousel-cell" \n\t\t\t\t*ngIf="i < cellLimit" \n\t\t\t\t[style.width]="getCellWidth()+\'px\'"\n\t\t\t\t[style.border-radius]="borderRadius+\'px\'">\n\n\t\t\t\t\x3c!-- Image --\x3e\n\t\t\t\t<img \n\t\t\t\t\t*ngIf="getFile(i) && getFile(i)[\'image\']" \n\t\t\t\t\t[src]="getFile(i)[\'image\'][\'path\']"\n\t\t\t\t\t[style.object-fit]="objectFit"\n\t\t\t\t\tdraggable="false" />\n\n\t\t\t\t\x3c!-- Video --\x3e\n\t\t\t\t<ng-template [ngIf]="getFile(i) && getFile(i)[\'type\'] === \'video\'">\n\t\t\t\t\t<div class="carousel-play" (click)="toggleVideo(video)"></div>\n\n\t\t\t\t\t<video #video\n\t\t\t\t\t\t[loop]="videoProperties.loop"\n\t\t\t\t\t\t[muted]="videoProperties.muted"\n\t\t\t\t\t\t[controls]="isSafari"\n\t\t\t\t\t\t[style.object-fit]="objectFit"\n\t\t\t\t\t\t[style.border-radius]="borderRadius+\'px\'">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<source [src]="getFile(i)[\'path\']" type="video/mp4">\n\t\t\t\t\t</video>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t</ng-template>\n\t</div>\n\n\t<div class="carousel-dots" *ngIf="dots">\n\t\t<div class="carousel-dot" [class.carousel-dot-active]="i === activeDotIndex" *ngFor="let dot of dotsArr; index as i"></div>\n\t</div>\n</div>\n\n<div class="carousel-arrows" \n\t[class.carousel-arrows-outside]="arrowsOutside" \n\t[class.carousel-dark-arrows]="arrowsTheme === \'dark\'"\n\t*ngIf="arrows">\n\t\n\t<div class="carousel-arrow carousel-arrow-prev" [class.carousel-arrow-disabled]="isPrevArrowDisabled()" (click)="prev()"></div>\n\t<div class="carousel-arrow carousel-arrow-next" [class.carousel-arrow-disabled]="isNextArrowDisabled()" (click)="next()"></div>\n</div>',styles:[":host{-moz-user-select:none;-webkit-user-select:none;box-sizing:border-box;display:block;height:100%;left:0;position:relative;top:0;transform-origin:top left;user-select:none;width:100%;z-index:10000}:host .carousel-container{cursor:grab;height:100%;overflow:hidden;width:100%}:host .carousel-container.carousel-moving{cursor:grabbing}:host .carousel-counter{background-color:rgba(23,37,68,.3);border-radius:13px;color:#fff;font-size:11px;line-height:normal;padding:5px 7px;position:absolute;right:24px;text-align:right;top:8px;transition:opacity .2s;z-index:30}:host ::ng-deep .carousel-cells{display:block;height:100%;transition:transform .2s;width:100%}:host ::ng-deep .carousel-cells .carousel-cell.swiper-prev-image{transform:translate3d(-100%,0,0)}:host ::ng-deep .carousel-cells .carousel-cell.swiper-next-image{transform:translate3d(100%,0,0)}:host ::ng-deep .carousel-cells .carousel-cell{height:100%;overflow:hidden;position:absolute;width:100%}:host ::ng-deep .carousel-cells .carousel-cell img,:host ::ng-deep .carousel-cells .carousel-cell video{height:100%;object-fit:contain;position:relative;width:100%}:host ::ng-deep .carousel-cells .carousel-cell img.swiper-hide{display:none}:host ::ng-deep .carousel-cells .carousel-cell .carousel-play{bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}:host .carousel-arrow{background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:31px;border-radius:100px;box-shadow:0 0 5px rgba(0,0,0,.15);cursor:pointer;height:40px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:10}:host .carousel-arrow-prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0Ij48cGF0aCBkPSJNMTUuNDEgMTYuNTlMMTAuODMgMTJsNC41OC00LjU5TDE0IDZsLTYgNiA2IDYgMS40MS0xLjQxeiIvPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==);left:10px}:host .carousel-arrow-next{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0Ij48cGF0aCBkPSJNOC41OSAxNi41OUwxMy4xNyAxMiA4LjU5IDcuNDEgMTAgNmw2IDYtNiA2LTEuNDEtMS40MXoiLz48cGF0aCBkPSJNMCAwaDI0djI0SDBWMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=);right:10px}:host .carousel-arrows-outside .carousel-arrow-prev{left:-60px}:host .carousel-arrows-outside .carousel-arrow-next{right:-60px}:host .carousel-dark-arrows .carousel-arrow{filter:invert(1)}:host .carousel-arrow-disabled{cursor:default;opacity:.5}:host .carousel-dots{bottom:0;left:0;position:absolute;right:0;text-align:center;z-index:10}:host .carousel-dots .carousel-dot{border:2px solid #fff;border-radius:100px;display:inline-block;height:8px;margin:4px;width:8px}:host .carousel-dots .carousel-dot-active{background-color:#fff}"]}]}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},s.propDecorators={images:[{type:e.Input}],events:[{type:e.Output}],height:[{type:e.Input}],width:[{type:e.Input}],loop:[{type:e.Input}],autoplay:[{type:e.Input}],autoplayInterval:[{type:e.Input}],pauseOnHover:[{type:e.Input}],dots:[{type:e.Input}],borderRadius:[{type:e.Input}],margin:[{type:e.Input}],objectFit:[{type:e.Input}],minSwipeDistance:[{type:e.Input}],transitionDuration:[{type:e.Input}],transitionTimingFunction:[{type:e.Input}],videoProperties:[{type:e.Input}],counterSeparator:[{type:e.Input}],overflowCellsLimit:[{type:e.Input}],listeners:[{type:e.Input}],cellsToShow:[{type:e.Input}],cellsToScroll:[{type:e.Input}],cellWidth:[{type:e.Input,args:["cellWidth"]}],isCounter:[{type:e.Input,args:["counter"]}],arrows:[{type:e.Input}],arrowsOutside:[{type:e.Input}],arrowsTheme:[{type:e.Input}],hostClassCarousel:[{type:e.HostBinding,args:["class.carousel"]}],hostStyleHeight:[{type:e.HostBinding,args:["style.height"]}],hostStyleWidth:[{type:e.HostBinding,args:["style.width"]}],onWindowResize:[{type:e.HostListener,args:["window:resize",["$event"]]}],onMousemove:[{type:e.HostListener,args:["mousemove",["$event"]]}],onMouseleave:[{type:e.HostListener,args:["mouseleave",["$event"]]}]};var r=function(){};r.decorators=[{type:e.NgModule,args:[{declarations:[s],imports:[i.CommonModule],exports:[s],providers:[],bootstrap:[],entryComponents:[s]}]}],t.CarouselComponent=s,t.IvyCarouselModule=r,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular-responsive-carousel",["exports","@angular/core","@angular/common"],e):e((t=t||self)["angular-responsive-carousel"]={},t.ng.core,t.ng.common)}(this,(function(t,e,i){"use strict";var n=function(){function t(t){var e=this;this.eventType=void 0,this.handlers={},this.startX=0,this.startY=0,this.lastTap=0,this.doubleTapMinTimeout=300,this.tapMinTimeout=200,this.touchstartTime=0,this.i=0,this.isMousedown=!1,this._touchListeners={touchstart:"handleTouchstart",touchmove:"handleTouchmove",touchend:"handleTouchend"},this._mouseListeners={mousedown:"handleMousedown",mousemove:"handleMousemove",mouseup:"handleMouseup",wheel:"handleWheel"},this._otherListeners={resize:"handleResize"},this.handleTouchstart=function(t){e.elementPosition=e.getElementPosition(),e.touchstartTime=(new Date).getTime(),void 0===e.eventType&&e.getTouchstartPosition(t),e.runHandler("touchstart",t)},this.handleTouchmove=function(t){var i=t.touches;switch(e.detectPan(i)&&e.runHandler("pan",t),e.detectPinch(t)&&e.runHandler("pinch",t),e.detectLinearSwipe(t)){case"horizontal-swipe":t.swipeType="horizontal-swipe",e.runHandler("horizontal-swipe",t);break;case"vertical-swipe":t.swipeType="vertical-swipe",e.runHandler("vertical-swipe",t)}(e.detectLinearSwipe(t)||"horizontal-swipe"===e.eventType||"vertical-swipe"===e.eventType)&&e.handleLinearSwipe(t)},this.handleTouchend=function(t){var i=t.touches;e.detectDoubleTap()&&e.runHandler("double-tap",t),e.detectTap(),e.runHandler("touchend",t),e.eventType="touchend",i&&0===i.length&&(e.eventType=void 0,e.i=0)},this.handleMousedown=function(t){e.isMousedown=!0,e.elementPosition=e.getElementPosition(),e.touchstartTime=(new Date).getTime(),void 0===e.eventType&&e.getMousedownPosition(t),e.runHandler("mousedown",t)},this.handleMousemove=function(t){if(e.isMousedown){switch(e.runHandler("pan",t),e.detectLinearSwipe(t)){case"horizontal-swipe":t.swipeType="horizontal-swipe",e.runHandler("horizontal-swipe",t);break;case"vertical-swipe":t.swipeType="vertical-swipe",e.runHandler("vertical-swipe",t)}(e.detectLinearSwipe(t)||"horizontal-swipe"===e.eventType||"vertical-swipe"===e.eventType)&&e.handleLinearSwipe(t)}},this.handleMouseup=function(t){e.detectTap(),e.isMousedown=!1,e.runHandler("mouseup",t),e.eventType=void 0,e.i=0},this.handleWheel=function(t){e.runHandler("wheel",t)},this.handleResize=function(t){e.runHandler("resize",t)},this.properties=t,this.element=this.properties.element,this.elementPosition=this.getElementPosition(),this.toggleEventListeners("addEventListener")}return Object.defineProperty(t.prototype,"touchListeners",{get:function(){return this.properties.touchListeners?this.properties.touchListeners:this._touchListeners},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mouseListeners",{get:function(){return this.properties.mouseListeners?this.properties.mouseListeners:this._mouseListeners},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"otherListeners",{get:function(){return this.properties.otherListeners?this.properties.otherListeners:this._otherListeners},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.toggleEventListeners("removeEventListener")},t.prototype.toggleEventListeners=function(t){var e;for(var i in e="mouse and touch"===this.properties.listeners?Object.assign(this.touchListeners,this.mouseListeners):this.detectTouchScreen()?this.touchListeners:this.mouseListeners,this.properties.resize&&(e=Object.assign(e,this.otherListeners)),e){var n=e[i];"resize"===i?("addEventListener"===t&&window.addEventListener(i,this[n],!1),"removeEventListener"===t&&window.removeEventListener(i,this[n],!1)):"mouseup"===i||"mousemove"===i?("addEventListener"===t&&document.addEventListener(i,this[n],!1),"removeEventListener"===t&&document.removeEventListener(i,this[n],!1)):("addEventListener"===t&&this.element.addEventListener(i,this[n],!1),"removeEventListener"===t&&this.element.removeEventListener(i,this[n],!1))}},t.prototype.addEventListeners=function(t,e){window.addEventListener(t,this[e],!1)},t.prototype.removeEventListeners=function(t,e){window.removeEventListener(t,this[e],!1)},t.prototype.handleLinearSwipe=function(t){this.i++,this.i>3&&(this.eventType=this.getLinearSwipeType(t)),"horizontal-swipe"===this.eventType&&this.runHandler("horizontal-swipe",t),"vertical-swipe"===this.eventType&&this.runHandler("vertical-swipe",t)},t.prototype.runHandler=function(t,e){this.handlers[t]&&this.handlers[t](e)},t.prototype.detectPan=function(t){return 1===t.length&&!this.eventType||"pan"===this.eventType},t.prototype.detectDoubleTap=function(){var t=this;if(null==this.eventType){var e=(new Date).getTime(),i=e-this.lastTap;if(clearTimeout(this.doubleTapTimeout),i<this.doubleTapMinTimeout&&i>0)return!0;this.doubleTapTimeout=setTimeout((function(){clearTimeout(t.doubleTapTimeout)}),this.doubleTapMinTimeout),this.lastTap=e}},t.prototype.detectTap=function(){if(null==this.eventType){var t=(new Date).getTime()-this.touchstartTime;t>0&&(t<this.tapMinTimeout?this.runHandler("tap",event):this.runHandler("longtap",event))}},t.prototype.detectPinch=function(t){return 2===t.touches.length&&void 0===this.eventType||"pinch"===this.eventType},t.prototype.detectLinearSwipe=function(t){var e=t.touches;if(e){if(1===e.length&&!this.eventType||"horizontal-swipe"===this.eventType||"vertical-swipe"===this.eventType)return this.getLinearSwipeType(t)}else if(!this.eventType||"horizontal-swipe"===this.eventType||"vertical-swipe"===this.eventType)return this.getLinearSwipeType(t)},t.prototype.getLinearSwipeType=function(t){if("horizontal-swipe"!==this.eventType&&"vertical-swipe"!==this.eventType){var e=Math.abs(this.moveLeft(0,t)-this.startX);return 3*Math.abs(this.moveTop(0,t)-this.startY)>e?"vertical-swipe":"horizontal-swipe"}return this.eventType},t.prototype.getElementPosition=function(){return this.element.getBoundingClientRect()},t.prototype.getTouchstartPosition=function(t){this.startX=t.touches[0].clientX-this.elementPosition.left,this.startY=t.touches[0].clientY-this.elementPosition.top},t.prototype.getMousedownPosition=function(t){this.startX=t.clientX-this.elementPosition.left,this.startY=t.clientY-this.elementPosition.top},t.prototype.moveLeft=function(t,e){var i=e.touches;return i?i[t].clientX-this.elementPosition.left:e.clientX-this.elementPosition.left},t.prototype.moveTop=function(t,e){var i=e.touches;return i?i[t].clientY-this.elementPosition.top:e.clientY-this.elementPosition.top},t.prototype.detectTouchScreen=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");return"ontouchstart"in window||function(t){return window.matchMedia(t).matches}(["(",t.join("touch-enabled),("),"heartz",")"].join(""))},t.prototype.on=function(t,e){t&&(this.handlers[t]=e)},t}(),o=function(){function t(t){var e=this;this.initialPositionX=0,this.newContainerPositionIndex=0,this.preliminarySlideCounter=0,this.slideCounter=0,this.previousSlideCounter=0,this.isContentImages=!0,this.isLazyLoad=!0,this.isContainerLocked=!0,this.alignCells="left",this.initialContainerPosition=0,this.handleTouchstart=function(t){e.isTouchstart=!0,e.startX=e.getStartX(t),e.containerInitialPositionX=e.getElementPosition().left-e.getCarouselElementPosition().left,e.isMoveInProgress=!0,e.stopTransformContainer()},this.handleHorizontalSwipe=function(t){var i=t.touches;e.moveX=i?i[0].clientX-e.getCarouselElementPosition().left:t.clientX-e.getCarouselElementPosition().left,e.distanceAbs=e.getDistanceAbs(),e.direction=e.getDirection(),e.moveContainer()},this.handleTouchend=function(t){e.isTouchstart?(e.isMoveInProgress=!1,e.detectSlide()?e.handleSlide():(e.newContainerPositionIndex=0,e.alignContainer()),e.startX=e.moveX=e.distanceAbs=void 0,e.isTouchstart=!1):e.isTouchstart=!1},this.element=t.element,this.properties=t,this.cells=this.element.children,this.visibleWidth=this.properties.visibleWidth||this.element.parentElement.clientWidth,this.setContainerWidth(),this.alignContainer(0)}return Object.defineProperty(t.prototype,"cellLength",{get:function(){return this.images?this.images.length:this.cells.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalContainerCellsCount",{get:function(){if(this.images){var t=this.visibleCellsCount+2*this.overflowCellsLimit;return t>this.images.length&&(t=this.images.length),t}return this.cellLength},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFirstCell",{get:function(){return 0===this.slideCounter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastCellIndex",{get:function(){return this.images.length?this.images.length-1:this.cells.length-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overflowCellsLimit",{get:function(){return this.images&&this.isImagesLessCellLimit?Math.floor((this.images.length-this.visibleCellsCount)/2):this.properties.overflowCellsLimit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isImagesLessCellLimit",{get:function(){return 2*this.properties.overflowCellsLimit+this.visibleCellsCount>this.images.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellLimit",{get:function(){return this.visibleCellsCount+2*this.overflowCellsLimit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"images",{get:function(){return this.properties.images},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return this.properties.margin},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minSwipeDistance",{get:function(){return this.properties.minSwipeDistance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitionDuration",{get:function(){return this.properties.transitionDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitionTimingFunction",{get:function(){return this.properties.transitionTimingFunction},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullCellWidth",{get:function(){return this.properties.cellWidth+this.margin},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleCellsCount",{get:function(){return Math.ceil(this.visibleWidth/this.fullCellWidth)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lapCounter",{get:function(){return Math.floor(this.slideCounter/this.totalContainerCellsCount)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleCellsOverflowContainer",{get:function(){return this.visibleCellsCount*this.fullCellWidth-this.margin>this.visibleWidth},enumerable:!1,configurable:!0}),t.prototype.stopTransformContainer=function(){this.transformPositionX(this.containerInitialPositionX,0),this.setSlideCounter(),this.isSlideInProgress=!1,this.newContainerPositionIndex=0,this.isSlideLengthLimited=void 0},t.prototype.getStartX=function(t){var e=t.touches;return e?e[0].clientX-this.getCarouselElementPosition().left:t.clientX-this.getCarouselElementPosition().left},t.prototype.moveContainer=function(){var t=this.getMovePositionX();this.transformPositionX(t,0)},t.prototype.getMovePositionX=function(){var t=this.getDistance();return this.containerInitialPositionX-t},t.prototype.alignContainer=function(t){void 0===t&&(t=this.transitionDuration);var e=this.getContainerPosition();this.transformPositionX(e,t),this.setInitialContainerPosition(e)},t.prototype.getContainerPosition=function(){var t=this.getContainerPositionCorrection();return this.isContainerPositionCorrection=0!=t,this.initialContainerPosition+this.newContainerPositionIndex*this.fullCellWidth+t},t.prototype.setInitialContainerPosition=function(t){var e=this.getContainerPositionCorrection();this.initialContainerPosition=t-e},t.prototype.getContainerPositionCorrection=function(){var t=0;return this.properties.loop?0:((this.cellLength-this.preliminarySlideCounter<this.visibleCellsCount||this.isSlideLengthLimited)&&(this.visibleWidth<this.totalContainerCellsCount*this.fullCellWidth&&(t=-(this.visibleCellsCount*this.fullCellWidth-this.visibleWidth-this.margin)),t>=-this.margin&&(t=0)),t)},t.prototype.quicklyPositionContainer=function(){var t=this.getContainerPositionCorrection(),e=this.getNewContainerPosition()+t;this.transformPositionX(e,0),this.setInitialContainerPosition(e)},t.prototype.getNewContainerPosition=function(){return this.slideCounter>this.overflowCellsLimit&&"left"===this.alignCells?(this.lineUpCells(),-this.overflowCellsLimit*this.fullCellWidth):this.slideCounter<=this.overflowCellsLimit?(this.previousSlideCounter>this.overflowCellsLimit&&this.lineUpCells(),-this.slideCounter*this.fullCellWidth):void 0},t.prototype.setContainerWidth=function(){var t=this.getContainerWidth();this.element.style.width=t+"px"},t.prototype.getContainerWidth=function(){var t=this.totalContainerCellsCount*this.fullCellWidth,e=this.cellLength*this.fullCellWidth;return e<t&&(t=e),t},t.prototype.getFile=function(t){var e=this.getFileIndex(t),i=this.images[e];return i&&!i.type&&(i.type="image"),{image:this.images[e],imageIndex:e}},t.prototype.getFileIndex=function(t){var e,i=this.getPositionIndex(t),n=(this.totalContainerCellsCount,this.slideCounter);if(!this.isContainerLocked)return n<=this.overflowCellsLimit?t:(e=i+(n-this.overflowCellsLimit),this.images&&this.properties.loop&&(e%=this.images.length),e);"left"===this.alignCells&&(e=n>this.overflowCellsLimit?i+(n-this.overflowCellsLimit):t);return!(e>this.lastCellIndex&&!this.properties.loop)&&e},t.prototype.transformPositionX=function(t,e){void 0===e&&(e=this.transitionDuration),this.element.style.transition="transform "+e+"ms "+this.transitionTimingFunction,this.element.style.transform="translateX("+t+"px)"},t.prototype.detectSlide=function(){return this.distanceAbs>=this.minSwipeDistance},t.prototype.next=function(t){void 0===t&&(t=1),this.newContainerPositionIndex=0,this.direction="left",this.handleSlide(t)},t.prototype.prev=function(t){void 0===t&&(t=1),this.newContainerPositionIndex=0,this.direction="right",this.handleSlide(t)},t.prototype.select=function(t){this.slideCounter=t,this.quicklyPositionContainer()},t.prototype.handleSlide=function(t){void 0===t&&(t=void 0),t&&this.isSlideInProgress||(this.slideLength=t||this.limitSlideLength(this.getSlideLength()),"left"===this.direction&&this.handleLeftSlide(),"right"===this.direction&&this.handleRightSlide(),this.alignContainer())},t.prototype.handleLeftSlide=function(){this.preliminarySlideCounter=this.slideCounter+this.slideLength,this.detectLastSlide(this.slideCounter+this.slideLength)?this.slideLength=0:(this.newContainerPositionIndex=this.newContainerPositionIndex-this.slideLength,this.isSlideInProgress=!0,this.isLazyLoad&&(this.isContainerLocked=this.preliminarySlideCounter>this.overflowCellsLimit,this.detectContainerUnlock()&&(this.isContainerLocked=!1)))},t.prototype.handleRightSlide=function(){this.slideCounter-this.slideLength<0&&(this.slideLength=this.slideCounter),this.preliminarySlideCounter=this.slideCounter-this.slideLength,this.isFirstCell?this.slideLength=0:(this.newContainerPositionIndex=this.newContainerPositionIndex+this.slideLength,this.isSlideInProgress=!0,this.isLazyLoad&&(this.preliminarySlideCounter>this.overflowCellsLimit?this.isContainerLocked=!0:this.isContainerLocked=!1,this.detectContainerUnlock()&&(this.isContainerLocked=!1)))},t.prototype.getSlideLength=function(){var t=this.getContainerPositionCorrection(),e=Math.floor((this.distanceAbs+t)/this.fullCellWidth);return this.distanceAbs%this.fullCellWidth>=this.minSwipeDistance&&e++,e},t.prototype.limitSlideLength=function(t){if(t>1)for(var e=0;e<t;e++){var i=this.slideCounter+(t-e);if(!this.detectLastSlide(i)){t-=e,this.isSlideLengthLimited=e>0;break}}return t},t.prototype.detectLastSlide=function(t){return!this.properties.loop&&this.cellLength-t<this.visibleCellsCount},t.prototype.isNextArrowDisabled=function(){return this.visibleCellsOverflowContainer?this.detectLastSlide(this.slideCounter+1)&&this.isContainerPositionCorrection:this.detectLastSlide(this.slideCounter+1)},t.prototype.isPrevArrowDisabled=function(){return 0===this.slideCounter},t.prototype.detectContainerUnlock=function(){return this.cellLength-this.preliminarySlideCounter<this.visibleCellsCount+this.overflowCellsLimit},t.prototype.handleSlideEnd=function(){this.isSlideInProgress&&(this.transformSlideEnd(),this.isSlideInProgress=!1,this.newContainerPositionIndex=0,this.isSlideLengthLimited=void 0)},t.prototype.transformSlideEnd=function(){this.isLazyLoad&&(this.setSlideCounter(),(this.images||!this.images&&this.properties.loop)&&this.quicklyPositionContainer()),this.previousSlideCounter=this.slideCounter},t.prototype.setSlideCounter=function(){"left"===this.direction&&(this.slideCounter=this.slideCounter+this.slideLength),"right"===this.direction&&(this.slideCounter=this.slideCounter-this.slideLength),this.direction=void 0,this.slideLength=0},t.prototype.resetTransition=function(){this.element.style.transition=""},t.prototype.getElementPosition=function(){return this.element.getBoundingClientRect()},t.prototype.getCarouselElementPosition=function(){return this.properties.container.getBoundingClientRect()},t.prototype.getDistance=function(){return this.startX-this.moveX},t.prototype.getDistanceAbs=function(){return Math.abs(this.startX-this.moveX)},t.prototype.getDirection=function(){var t=Math.sign(this.startX-this.moveX);return-1===t?"right":1===t?"left":void 0},t.prototype.lineUpCells=function(){for(var t=this.element.children,e=0;e<t.length;e++){var i=t[e],n=this.getCellPositionX(e);i.style.transform="translateX("+n+"px)",i.style.width=this.properties.cellWidth+"px"}},t.prototype.getCellPositionX=function(t){return this.getPositionIndex(t)*this.fullCellWidth},t.prototype.getPositionIndex=function(t){var e,i=this.slideCounter,n=this.totalContainerCellsCount,o=i-this.overflowCellsLimit;return o>n&&(o%=n),o<0?t:((e=t-o)<0&&(e=n+e),e)},t.prototype.getCenterPositionIndex=function(){return(this.totalContainerCellsCount-1)/2},t.prototype.autoplay=function(){var t=this;this.autoplayId=setInterval((function(){t.next()}),this.properties.autoplayInterval)},t.prototype.stopAutoplay=function(){this.autoplayId&&clearInterval(this.autoplayId)},t.prototype.destroy=function(){this.stopAutoplay()},t}(),s=function(){function t(t,i){var n=this;this.elementRef=t,this.ref=i,this.minTimeout=30,this._cellWidth=200,this.events=new e.EventEmitter,this.height=200,this.loop=!1,this.autoplay=!1,this.autoplayInterval=5e3,this.pauseOnHover=!0,this.dots=!1,this.margin=10,this.objectFit="cover",this.minSwipeDistance=10,this.transitionDuration=200,this.transitionTimingFunction="ease",this.counterSeparator=" / ",this.overflowCellsLimit=3,this.listeners="mouse and touch",this.cellsToScroll=1,this.arrows=!0,this.arrowsTheme="light",this.hostClassCarousel=!0,this.handleTouchstart=function(t){n.touches.addEventListeners("mousemove","handleMousemove"),n.carousel.handleTouchstart(t),n.isMoving=!0},this.handleHorizontalSwipe=function(t){t.preventDefault(),n.carousel.handleHorizontalSwipe(t)},this.handleTouchend=function(t){t.touches;n.carousel.handleTouchend(t),n.touches.removeEventListeners("mousemove","handleMousemove"),n.isMoving=!1}}return Object.defineProperty(t.prototype,"isContainerLocked",{get:function(){return this.carousel.isContainerLocked},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"slideCounter",{get:function(){return this.carousel.slideCounter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSlideCounter",{get:function(){return this.carousel.previousSlideCounter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lapCounter",{get:function(){return this.carousel.lapCounter},enumerable:!1,configurable:!0}),t.prototype.lineUpCells=function(){this.carousel.lineUpCells()},t.prototype.quicklyPositionContainer=function(){this.carousel.quicklyPositionContainer()},Object.defineProperty(t.prototype,"isLandscape",{get:function(){return window.innerWidth>window.innerHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSafari",{get:function(){var t=navigator.userAgent.toLowerCase();if(-1!==t.indexOf("safari"))return!(t.indexOf("chrome")>-1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"counter",{get:function(){return(this.loop?this.slideCounter%this.cellLength:this.slideCounter)+1+this.counterSeparator+this.cellLength},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellsElement",{get:function(){return this.elementRef.nativeElement.querySelector(".carousel-cells")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"images",{get:function(){return this._images},set:function(t){this._images=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellWidth",{set:function(t){t&&(this._cellWidth=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCounter",{get:function(){return this._isCounter&&this.cellLength>1},set:function(t){t&&(this._isCounter=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeDotIndex",{get:function(){return this.slideCounter%this.cellLength},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cellLimit",{get:function(){if(this.carousel)return this.carousel.cellLimit},enumerable:!1,configurable:!0}),t.prototype.onWindowResize=function(t){this.landscapeMode=this.isLandscape,this.ref.detectChanges(),this.initCarousel(),this.carousel.lineUpCells()},t.prototype.onMousemove=function(t){this.autoplay&&this.pauseOnHover&&this.carousel.stopAutoplay()},t.prototype.onMouseleave=function(t){this.autoplay&&this.pauseOnHover&&this.carousel.autoplay()},t.prototype.ngOnInit=function(){this.isNgContent=this.cellsElement.children.length>0,this.touches=new n({element:this.cellsElement,listeners:this.listeners,mouseListeners:{mousedown:"handleMousedown",mouseup:"handleMouseup"}}),this.touches.on("touchstart",this.handleTouchstart),this.touches.on("horizontal-swipe",this.handleHorizontalSwipe),this.touches.on("touchend",this.handleTouchend),this.touches.on("mousedown",this.handleTouchstart),this.touches.on("mouseup",this.handleTouchend),this.initCarousel(),this.setDimensions(),this.autoplay&&this.carousel.autoplay()},t.prototype.ngAfterViewInit=function(){this.cellLength=this.getCellLength(),this.dotsArr=Array(this.cellLength).fill(1),this.ref.detectChanges(),this.carousel.lineUpCells(),this.detectDomChanges()},t.prototype.ngOnChanges=function(t){(t.width||t.height||t.images)&&(this.setDimensions(),this.initCarousel(),this.carousel.lineUpCells(),this.ref.detectChanges())},t.prototype.ngOnDestroy=function(){this.touches.destroy(),this.carousel.destroy()},t.prototype.initCarousel=function(){this.carousel=new o({element:this.elementRef.nativeElement.querySelector(".carousel-cells"),container:this.elementRef.nativeElement,images:this.images,cellWidth:this.getCellWidth(),loop:this.loop,autoplayInterval:this.autoplayInterval,overflowCellsLimit:this.overflowCellsLimit,visibleWidth:this.width,margin:this.margin,minSwipeDistance:this.minSwipeDistance,transitionDuration:this.transitionDuration,transitionTimingFunction:this.transitionTimingFunction,videoProperties:this.videoProperties})},t.prototype.detectDomChanges=function(){var t=this;new MutationObserver((function(e){t.onDomChanges()})).observe(this.elementRef.nativeElement,{attributes:!0,childList:!0,characterData:!0})},t.prototype.onDomChanges=function(){this.cellLength=this.getCellLength(),this.carousel.lineUpCells(),this.ref.detectChanges()},t.prototype.setDimensions=function(){this.hostStyleHeight=this.height+"px",this.hostStyleWidth=this.width+"px"},t.prototype.getFile=function(t){return this.carousel.getFile(t)},t.prototype.handleTransitionendCellContainer=function(t){this.carousel.handleSlideEnd()},t.prototype.toggleVideo=function(t){event.preventDefault(),this.videoProperties.noPlay||(t.paused?(t.play(),this.isVideoPlaying=!0):(t.pause(),this.isVideoPlaying=!1),this.ref.detectChanges())},t.prototype.getCurrentIndex=function(){return this.carousel.slideCounter},t.prototype.getCellWidth=function(){var t=this.elementRef.nativeElement.clientWidth;return this.cellsToShow?(t-(this.cellsToShow>1?this.margin:0)*(this.cellsToShow-1))/this.cellsToShow:"100%"===this._cellWidth?t:this._cellWidth},t.prototype.next=function(){this.carousel.next(this.cellsToScroll),this.carousel.stopAutoplay()},t.prototype.prev=function(){this.carousel.prev(this.cellsToScroll),this.carousel.stopAutoplay()},t.prototype.select=function(t){this.carousel.select(t)},t.prototype.isNextArrowDisabled=function(){return this.carousel.isNextArrowDisabled()},t.prototype.isPrevArrowDisabled=function(){return this.carousel.isPrevArrowDisabled()},t.prototype.getCellLength=function(){return this.images?this.images.length:this.cellsElement.children.length},t}();s.decorators=[{type:e.Component,args:[{selector:"carousel, [carousel]",exportAs:"carousel",template:'<div class="carousel-counter" *ngIf="isCounter">{{counter}}</div>\n\n<div class="carousel-container" [class.carousel-moving]="isMoving">\n\t<div class="carousel-cells" #cells (transitionend)="handleTransitionendCellContainer($event)">\n\t\t<ng-content></ng-content>\n\n\t\t<ng-template ngFor let-image [ngForOf]="images" let-i="index">\n\t\t\t<div class="carousel-cell" \n\t\t\t\t*ngIf="i < cellLimit" \n\t\t\t\t[style.width]="getCellWidth()+\'px\'"\n\t\t\t\t[style.border-radius]="borderRadius+\'px\'">\n\n\t\t\t\t\x3c!-- Image --\x3e\n\t\t\t\t<img \n\t\t\t\t\t*ngIf="getFile(i) && getFile(i)[\'image\']" \n\t\t\t\t\t[src]="getFile(i)[\'image\'][\'path\']"\n\t\t\t\t\t[style.object-fit]="objectFit"\n\t\t\t\t\tdraggable="false" />\n\n\t\t\t\t\x3c!-- Video --\x3e\n\t\t\t\t<ng-template [ngIf]="getFile(i) && getFile(i)[\'type\'] === \'video\'">\n\t\t\t\t\t<div class="carousel-play" (click)="toggleVideo(video)"></div>\n\n\t\t\t\t\t<video #video\n\t\t\t\t\t\t[loop]="videoProperties.loop"\n\t\t\t\t\t\t[muted]="videoProperties.muted"\n\t\t\t\t\t\t[controls]="isSafari"\n\t\t\t\t\t\t[style.object-fit]="objectFit"\n\t\t\t\t\t\t[style.border-radius]="borderRadius+\'px\'">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<source [src]="getFile(i)[\'path\']" type="video/mp4">\n\t\t\t\t\t</video>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t</ng-template>\n\t</div>\n\n\t<div class="carousel-dots" *ngIf="dots">\n\t\t<div class="carousel-dot" [class.carousel-dot-active]="i === activeDotIndex" *ngFor="let dot of dotsArr; index as i"></div>\n\t</div>\n</div>\n\n<div class="carousel-arrows" \n\t[class.carousel-arrows-outside]="arrowsOutside" \n\t[class.carousel-dark-arrows]="arrowsTheme === \'dark\'"\n\t*ngIf="arrows">\n\t\n\t<div class="carousel-arrow carousel-arrow-prev" [class.carousel-arrow-disabled]="isPrevArrowDisabled()" (click)="prev()"></div>\n\t<div class="carousel-arrow carousel-arrow-next" [class.carousel-arrow-disabled]="isNextArrowDisabled()" (click)="next()"></div>\n</div>',styles:[":host{-moz-user-select:none;-webkit-user-select:none;box-sizing:border-box;display:block;height:100%;left:0;position:relative;top:0;transform-origin:top left;user-select:none;width:100%;z-index:10000}:host .carousel-container{cursor:grab;height:100%;overflow:hidden;width:100%}:host .carousel-container.carousel-moving{cursor:grabbing}:host .carousel-counter{background-color:rgba(23,37,68,.3);border-radius:13px;color:#fff;font-size:11px;line-height:normal;padding:5px 7px;position:absolute;right:24px;text-align:right;top:8px;transition:opacity .2s;z-index:30}:host ::ng-deep .carousel-cells{display:block;height:100%;transition:transform .2s;width:100%}:host ::ng-deep .carousel-cells .carousel-cell.swiper-prev-image{transform:translate3d(-100%,0,0)}:host ::ng-deep .carousel-cells .carousel-cell.swiper-next-image{transform:translate3d(100%,0,0)}:host ::ng-deep .carousel-cells .carousel-cell{height:100%;overflow:hidden;position:absolute;width:100%}:host ::ng-deep .carousel-cells .carousel-cell img,:host ::ng-deep .carousel-cells .carousel-cell video{height:100%;object-fit:contain;position:relative;width:100%}:host ::ng-deep .carousel-cells .carousel-cell img.swiper-hide{display:none}:host ::ng-deep .carousel-cells .carousel-cell .carousel-play{bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}:host .carousel-arrow{background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:31px;border-radius:100px;box-shadow:0 0 5px rgba(0,0,0,.15);cursor:pointer;height:40px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:10}:host .carousel-arrow-prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0Ij48cGF0aCBkPSJNMTUuNDEgMTYuNTlMMTAuODMgMTJsNC41OC00LjU5TDE0IDZsLTYgNiA2IDYgMS40MS0xLjQxeiIvPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==);left:10px}:host .carousel-arrow-next{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0Ij48cGF0aCBkPSJNOC41OSAxNi41OUwxMy4xNyAxMiA4LjU5IDcuNDEgMTAgNmw2IDYtNiA2LTEuNDEtMS40MXoiLz48cGF0aCBkPSJNMCAwaDI0djI0SDBWMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=);right:10px}:host .carousel-arrows-outside .carousel-arrow-prev{left:-60px}:host .carousel-arrows-outside .carousel-arrow-next{right:-60px}:host .carousel-dark-arrows .carousel-arrow{filter:invert(1)}:host .carousel-arrow-disabled{cursor:default;opacity:.5}:host .carousel-dots{bottom:0;left:0;position:absolute;right:0;text-align:center;z-index:10}:host .carousel-dots .carousel-dot{border:2px solid #fff;border-radius:100px;display:inline-block;height:8px;margin:4px;width:8px}:host .carousel-dots .carousel-dot-active{background-color:#fff}"]}]}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},s.propDecorators={images:[{type:e.Input}],events:[{type:e.Output}],height:[{type:e.Input}],width:[{type:e.Input}],loop:[{type:e.Input}],autoplay:[{type:e.Input}],autoplayInterval:[{type:e.Input}],pauseOnHover:[{type:e.Input}],dots:[{type:e.Input}],borderRadius:[{type:e.Input}],margin:[{type:e.Input}],objectFit:[{type:e.Input}],minSwipeDistance:[{type:e.Input}],transitionDuration:[{type:e.Input}],transitionTimingFunction:[{type:e.Input}],videoProperties:[{type:e.Input}],counterSeparator:[{type:e.Input}],overflowCellsLimit:[{type:e.Input}],listeners:[{type:e.Input}],cellsToShow:[{type:e.Input}],cellsToScroll:[{type:e.Input}],cellWidth:[{type:e.Input,args:["cellWidth"]}],isCounter:[{type:e.Input,args:["counter"]}],arrows:[{type:e.Input}],arrowsOutside:[{type:e.Input}],arrowsTheme:[{type:e.Input}],hostClassCarousel:[{type:e.HostBinding,args:["class.carousel"]}],hostStyleHeight:[{type:e.HostBinding,args:["style.height"]}],hostStyleWidth:[{type:e.HostBinding,args:["style.width"]}],onWindowResize:[{type:e.HostListener,args:["window:resize",["$event"]]}],onMousemove:[{type:e.HostListener,args:["mousemove",["$event"]]}],onMouseleave:[{type:e.HostListener,args:["mouseleave",["$event"]]}]};var r=function(){};r.decorators=[{type:e.NgModule,args:[{declarations:[s],imports:[i.CommonModule],exports:[s],providers:[],bootstrap:[],entryComponents:[s]}]}],t.CarouselComponent=s,t.IvyCarouselModule=r,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=angular-responsive-carousel.umd.min.js.map |
@@ -19,3 +19,3 @@ import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, Output } from '@angular/core'; | ||
this.objectFit = 'cover'; | ||
this.minSwipeDistance = 50; | ||
this.minSwipeDistance = 10; | ||
this.transitionDuration = 200; | ||
@@ -321,2 +321,2 @@ this.transitionTimingFunction = 'ease'; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fyb3VzZWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5ndWxhci1yZXNwb25zaXZlLWNhcm91c2VsL3NyYy9saWIvY2Fyb3VzZWwuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxpQkFBaUIsRUFBRSxTQUFTLEVBQUUsVUFBVSxFQUFhLFlBQVksRUFBRSxXQUFXLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQTJCLE1BQU0sZUF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AgIHJldHVybiB0aGlzLl9jZWxsV2lkdGg7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBuZXh0KCkge1xuICAgICAgICB0aGlzLmNhcm91c2VsLm5leHQodGhpcy5jZWxsc1RvU2Nyb2xsKTtcbiAgICAgICAgdGhpcy5jYXJvdXNlbC5zdG9wQXV0b3BsYXkoKTtcbiAgICB9XG5cbiAgICBwcmV2KCkge1xuICAgICAgICB0aGlzLmNhcm91c2VsLnByZXYodGhpcy5jZWxsc1RvU2Nyb2xsKTtcbiAgICAgICAgdGhpcy5jYXJvdXNlbC5zdG9wQXV0b3BsYXkoKTtcbiAgICB9XG5cbiAgICBzZWxlY3QoaW5kZXg6IG51bWJlcikge1xuICAgICAgICB0aGlzLmNhcm91c2VsLnNlbGVjdChpbmRleCk7XG4gICAgfVxuXG4gICAgaXNOZXh0QXJyb3dEaXNhYmxlZCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY2Fyb3VzZWwuaXNOZXh0QXJyb3dEaXNhYmxlZCgpO1xuICAgIH1cblxuICAgIGlzUHJldkFycm93RGlzYWJsZWQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNhcm91c2VsLmlzUHJldkFycm93RGlzYWJsZWQoKTtcbiAgICB9XG5cbiAgICBnZXRDZWxsTGVuZ3RoKCkge1xuICAgICAgICBpZiAodGhpcy5pbWFnZXMpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmltYWdlcy5sZW5ndGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5jZWxsc0VsZW1lbnQuY2hpbGRyZW4ubGVuZ3RoO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fyb3VzZWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvYW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gICAgICAgICAgICByZXR1cm4gdGhpcy5jZWxsc0VsZW1lbnQuY2hpbGRyZW4ubGVuZ3RoO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ== |
export class Carousel { | ||
constructor(properties) { | ||
this.initialPositionX = 0; | ||
this.newContainerPositionIndex = 0; // The index of the new position relative to the active index, for example -1 or +1 | ||
/* The index of the new position relative to the active index, for example -1 or +1 */ | ||
this.newContainerPositionIndex = 0; | ||
this.preliminarySlideCounter = 0; | ||
this.slideCounter = 0; // Scrolling Index (counter) | ||
/* Scrolling Index (counter) */ | ||
this.slideCounter = 0; | ||
this.previousSlideCounter = 0; | ||
@@ -15,19 +17,8 @@ this.isContentImages = true; | ||
this.isTouchstart = true; | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
const touches = event.touches; | ||
if (touches) { | ||
this.startX = touches[0].clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
else { | ||
this.startX = event.clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
this.startX = this.getStartX(event); | ||
this.containerInitialPositionX = this.getElementPosition()['left'] - this.getCarouselElementPosition()['left']; | ||
this.isMoveInProgress = true; | ||
this.stopTransformContainer(); | ||
}; | ||
this.handleHorizontalSwipe = (event) => { | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
const touches = event.touches; | ||
@@ -45,3 +36,3 @@ if (touches) { | ||
this.handleTouchend = (event) => { | ||
if (this.isSlideInProgress || !this.isTouchstart) { | ||
if (!this.isTouchstart) { | ||
this.isTouchstart = false; | ||
@@ -135,2 +126,20 @@ return; | ||
} | ||
stopTransformContainer() { | ||
this.transformPositionX(this.containerInitialPositionX, 0); | ||
this.setSlideCounter(); | ||
this.isSlideInProgress = false; | ||
this.newContainerPositionIndex = 0; | ||
this.isSlideLengthLimited = undefined; | ||
} | ||
getStartX(event) { | ||
const touches = event.touches; | ||
let startX; | ||
if (touches) { | ||
startX = touches[0].clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
else { | ||
startX = event.clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
return startX; | ||
} | ||
/* Move */ | ||
@@ -160,2 +169,3 @@ moveContainer() { | ||
} | ||
/* Offset the container to show the last cell completely */ | ||
getContainerPositionCorrection() { | ||
@@ -260,5 +270,3 @@ let correction = 0; | ||
next(length = 1) { | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
this.newContainerPositionIndex = 0; | ||
this.direction = 'left'; | ||
@@ -268,5 +276,3 @@ this.handleSlide(length); | ||
prev(length = 1) { | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
this.newContainerPositionIndex = 0; | ||
this.direction = 'right'; | ||
@@ -279,40 +285,56 @@ this.handleSlide(length); | ||
} | ||
handleSlide(slideLength = undefined) { | ||
this.slideLength = this.getSlideLength(); | ||
this.slideLength = slideLength ? slideLength : this.limitSlideLength(this.slideLength); | ||
if (this.direction === 'left' && !this.isSlideInProgress) { | ||
this.preliminarySlideCounter = this.slideCounter + this.slideLength; | ||
if (!this.detectLastSlide(this.slideCounter + this.slideLength)) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex - this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
this.isContainerLocked = this.preliminarySlideCounter > this.overflowCellsLimit; | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
handleSlide(customSlideLength = undefined) { | ||
let isUsingButton = customSlideLength; | ||
if (isUsingButton && this.isSlideInProgress) { | ||
return; | ||
} | ||
this.slideLength = customSlideLength ? customSlideLength : this.limitSlideLength(this.getSlideLength()); | ||
if (this.direction === 'left') { | ||
this.handleLeftSlide(); | ||
} | ||
if (this.direction === 'right') { | ||
this.handleRightSlide(); | ||
} | ||
this.alignContainer(); | ||
} | ||
handleLeftSlide() { | ||
this.preliminarySlideCounter = this.slideCounter + this.slideLength; | ||
let isLastSlide = this.detectLastSlide(this.slideCounter + this.slideLength); | ||
if (!isLastSlide) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex - this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
this.isContainerLocked = this.preliminarySlideCounter > this.overflowCellsLimit; | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
} | ||
} | ||
if (this.direction === 'right' && !this.isSlideInProgress) { | ||
if (this.slideCounter - this.slideLength < 0) { | ||
this.slideLength = this.slideCounter; | ||
} | ||
this.preliminarySlideCounter = this.slideCounter - this.slideLength; | ||
if (!this.isFirstCell) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex + this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
if (this.preliminarySlideCounter > this.overflowCellsLimit) { | ||
this.isContainerLocked = true; | ||
} | ||
else { | ||
this.isContainerLocked = false; | ||
} | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
else { | ||
this.slideLength = 0; | ||
} | ||
} | ||
handleRightSlide() { | ||
if (this.slideCounter - this.slideLength < 0) { | ||
this.slideLength = this.slideCounter; | ||
} | ||
this.preliminarySlideCounter = this.slideCounter - this.slideLength; | ||
if (!this.isFirstCell) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex + this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
if (this.preliminarySlideCounter > this.overflowCellsLimit) { | ||
this.isContainerLocked = true; | ||
} | ||
else { | ||
this.isContainerLocked = false; | ||
} | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
} | ||
} | ||
this.alignContainer(); | ||
else { | ||
this.slideLength = 0; | ||
} | ||
} | ||
@@ -327,2 +349,6 @@ getSlideLength() { | ||
} | ||
/* | ||
* Limits the length of the slide during calls to the next() and prev() | ||
* methods if the specified position is outside the cell length | ||
*/ | ||
limitSlideLength(slideLength) { | ||
@@ -465,2 +491,2 @@ if (slideLength > 1) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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GVDZWxsc0NvdW50ICogdGhpcy5mdWxsQ2VsbFdpZHRoIC0gdGhpcy52aXNpYmxlV2lkdGggLSB0aGlzLm1hcmdpbik7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGlmIChjb3JyZWN0aW9uID49IC0gdGhpcy5tYXJnaW4pIHtcclxuICAgICAgICAgICAgICAgIGNvcnJlY3Rpb24gPSAwO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gY29ycmVjdGlvbjtcclxuICAgIH1cclxuXHJcbiAgICAvKiBRdWlja2x5IGNlbnRlciAqL1xyXG4gICAgcXVpY2tseVBvc2l0aW9uQ29udGFpbmVyKCkge1xyXG4gICAgICAgIGxldCBjb3JyZWN0aW9uID0gdGhpcy5nZXRDb250YWluZXJQb3NpdGlvbkNvcnJlY3Rpb24oKTtcclxuICAgICAgICBjb25zdCBpbml0aWFsUG9zaXRpb24gPSB0aGlzLmdldE5ld0NvbnRhaW5lclBvc2l0aW9uKCkgKyBjb3JyZWN0aW9uO1xyXG4gICAgICAgIHRoaXMudHJhbnNmb3JtUG9zaXRpb25YKGluaXRpYWxQb3NpdGlvbiwgMCk7XHJcbiAgICAgICAgdGhpcy5zZXRJbml0aWFsQ29udGFpbmVyUG9zaXRpb24oaW5pdGlhbFBvc2l0aW9uKTtcclxuICAgIH1cclxuXHJcbiAgICBnZXROZXdDb250YWluZXJQb3NpdGlvbigpIHtcclxuICAgICAgICBpZiAodGhpcy5zbGlkZUNvdW50ZXIgPiB0aGlzLm92ZXJmbG93Q2VsbHNMaW1pdCkge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5hbGlnbkNlbGxzID09PSBcImxlZnRcIikge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5saW5lVXBDZWxscygpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIC0odGhpcy5vdmVyZmxvd0NlbGxzTGltaXQgKiB0aGlzLmZ1bGxDZWxs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pbWl0O1xyXG4gICAgICAgICAgICAgICAgaW1hZ2VJbmRleCA9IHBvc2l0aW9uSW5kZXggKyBjZWxsTGltaXRPdmVyZmxvdztcclxuXHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5pbWFnZXMgJiYgdGhpcy5wcm9wZXJ0aWVzLmxvb3ApIHtcclxuICAgICAgICAgICAgICAgICAgICBpbWFnZUluZGV4ID0gaW1hZ2VJbmRleCAlIHRoaXMuaW1hZ2VzLmxlbmd0aDtcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gaW1hZ2VJbmRleDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHRoaXMuYWxpZ25DZWxscyA9PT0gXCJsZWZ0XCIpIHtcclxuICAgICAgICAgICAgaWYgKGNvdW50ZXIgPiB0aGlzLm92ZXJmbG93Q2VsbHNMaW1pdCkge1xyXG4gICAgICAgICAgICAgICAgbGV0IGNlbGxMaW1pdE92ZXJmbG93ID0gY291bnRlciAtIHRoaXMub3ZlcmZsb3dDZWxsc0xpbWl0O1xyXG4gICAgICAgICAgICAgICAgaW1hZ2VJbmRleCA9IHBvc2l0aW9uSW5kZXggKyBjZWxsTGltaXRPdmVyZmxvdztcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGltYWdlSW5kZXggPSBjZWxsSW5kZXg7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmIChpbWFnZUluZGV4ID4gdGhpcy5sYXN0Q2VsbEluZGV4ICYmICF0aGlzLnByb3BlcnRpZXMubG9vcCkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gaW1hZ2VJbmRleDtcclxuICAgIH1cclxuXHJcbiAgICB0cmFuc2Zvcm1Qb3NpdGlvblgodmFsdWUsIGR1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lY3RDb250YWluZXJVbmxvY2soKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmlzQ29udGFpbmVyTG9ja2VkID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAodGhpcy5kaXJlY3Rpb24gPT09ICdyaWdodCcgJiYgIXRoaXMuaXNTbGlkZUluUHJvZ3Jlc3MpIHtcclxuICAgICAgICAgICAgaWYgKHRoaXMuc2xpZGVDb3VudGVyIC0gdGhpcy5zbGlkZUxlbmd0aCA8IDApIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuc2xpZGVMZW5ndGggPSB0aGlzLnNsaWRlQ291bnRlcjtcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgdGhpcy5wcmVsaW1pbmFyeVNsaWRlQ291bnRlciA9IHRoaXMuc2xpZGVDb3VudGVyIC0gdGhpcy5zbGlkZUxlbmd0aDtcclxuXHJcbiAgICAgICAgICAgIGlmICghdGhpcy5pc0ZpcnN0Q2VsbCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5uZXdDb250YWluZXJQb3NpdGlvbkluZGV4ID0gdGhpcy5uZXdDb250YWluZXJQb3NpdGlvbkluZGV4ICsgdGhpcy5zbGlkZUxlbmd0aDtcclxuICAgICAgICAgICAgICAgIHRoaXMuaXNTbGlkZUluUHJvZ3Jlc3MgPSB0cnVlO1xyXG5cclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmlzTGF6eUxvYWQpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wcmVsaW1pbmFyeVNsaWRlQ291bnRlciA+IHRoaXMub3ZlcmZsb3dDZWxsc0xpbWl0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaXNDb250YWluZXJMb2NrZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaXNDb250YWluZXJMb2NrZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmRldGVjdENvbnRhaW5lclVubG9jaygpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaXNDb250YWluZXJMb2NrZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHRoaXMuYWxpZ25Db250YWluZXIoKTtcclxuICAgIH1cclxuXHJcbiAgICBnZXRTbGlkZUxlbmd0aCgpIHtcclxuICAgICAgICBsZXQgY29ycmVjdGlvbiA9IHRoaXMuZ2V0Q29udGFpbmVyUG9zaXRpb25Db3JyZWN0aW9uKCk7XHJcbiAgICAgICAgbGV0IGxlbmd0aCA9IE1hdGguZmxvb3IoKHRoaXMuZGlzdGFuY2VBYnMgKyBjb3JyZWN0aW9uKSAvIHRoaXMuZnVsbENlbGxXaWR0aCk7XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmRpc3RhbmNlQWJzICUgdGhpcy5mdWxsQ2VsbFdpZHRoID49IHRoaXMubWluU3dpcGVEaXN0YW5jZSkge1xyXG4gICAgICAgICAgICBsZW5ndGgrKztcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGxlbmd0aDtcclxuICAgIH1cclxuXHJcbiAgICBsaW1pdFNsaWRlTGVuZ3RoKHNsaWRlTGVuZ3RoOiBudW1iZXIpIHtcclxuICAgICAgICBpZiAoc2xpZGVMZW5ndGggPiAxKSB7XHJcblxyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNsaWRlTGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGxldCBuZXdTbGlkZUNvdW50ZXIgPSB0aGlzLnNsaWRlQ291bnRlciArIChzbGlkZUxlbmd0aCAtIGkpO1xyXG5cclxuICAgICAgICAgICAgICAgIGlmICghdGhpcy5kZXRlY3RMYXN0U2xpZGUobmV3U2xpZGVDb3VudGVyKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHNsaWRlTGVuZ3RoID0gc2xpZGVMZW5ndGggLSBpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaXNTbGlkZUxlbmd0aExpbWl0ZWQgPSBpID4gMDtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gc2xpZGVMZW5ndGg7XHJcbiAgICB9XHJcblxyXG4gICAgZGV0ZWN0TGFzdFNsaWRlKHNsaWRlQ291bnRlcjogbnVtYmVyKSB7XHJcbiAgICAgICAgaWYgKHRoaXMucHJvcGVydGllcy5sb29wKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gKHRoaXMuY2VsbExlbmd0aCAtIHNsaWRlQ291bnRlcikgPCB0aGlzLnZpc2libGVDZWxsc0NvdW50O1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBpc05leHRBcnJvd0Rpc2FibGVkKCkge1xyXG4gICAgICAgIGlmICh0aGlzLnZpc2libGVDZWxsc092ZXJmbG93Q29udGFpbmVyKSB7XHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmRldGVjdExhc3RTbGlkZSh0aGlzLnNsaWRlQ291bnRlciArIDEpICYmIHRoaXMuaXNDb250YWluZXJQb3NpdGlvbkNvcnJlY3Rpb247XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGV0ZWN0TGFzdFNsaWRlKHRoaXMuc2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yXG4gICAgfVxyXG5cclxuICAgIGdldERpc3RhbmNlQWJzKCkge1xyXG4gICAgICAgIHJldHVybiBNYXRoLmFicyh0aGlzLnN0YXJ0WCAtIHRoaXMubW92ZVgpO1xyXG4gICAgfVxyXG5cclxuICAgIGdldERpcmVjdGlvbigpIHtcclxuICAgICAgICBjb25zdCBkaXJlY3Rpb24gPSBNYXRoLnNpZ24odGhpcy5zdGFydFggLSB0aGlzLm1vdmVYKTtcclxuXHJcbiAgICAgICAgaWYgKGRpcmVjdGlvbiA9PT0gLTEpIHtcclxuICAgICAgICAgICAgcmV0dXJuICdyaWdodCc7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChkaXJlY3Rpb24gPT09IDEpIHtcclxuICAgICAgICAgICAgcmV0dXJuICdsZWZ0JztcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgbGluZVVwQ2VsbHMoKSB7XHJcbiAgICAgICAgY29uc3QgY2VsbHMgPSB0aGlzLmVsZW1lbnQuY2hpbGRyZW47XHJcblxyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2VsbHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgbGV0IGNlbGwgPSBjZWxsc1tpXTtcclxuICAgICAgICAgICAgbGV0IHBvc2l0aW9uWCA9IHRoaXMuZ2V0Q2VsbFBvc2l0aW9uWChpKTtcclxuICAgICAgICAgICAgKGNlbGwgYXMgSFRNTEVsZW1lbnQpLnN0eWxlLnRyYW5zZm9ybSA9ICd0cmFuc2xhdGVYKCcgKyBwb3NpdGlvblggKyAncHgpJztcclxuXHJcbiAgICAgICAgICAgIC8vIG5vdGljZVxyXG4gICAgICAgICAgICAoY2VsbCBhcyBIVE1MRWxlbWVudCkuc3R5bGUud2lkdGggPSB0aGlzLnByb3BlcnRpZXMuY2VsbFdpZHRoKydweCc7XHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuXHJcbiAgICBnZXRDZWxsUG9zaXRpb25YKGluZGV4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vbnRhaW5lckxvY2tlZDogYm9vbGVhbiA9IHRydWU7XHJcbiAgICBhbGlnbkNlbGxzOiBcImxlZnRcIiB8IFwiY2VudGVyXCIgPSBcImxlZnRcIjtcclxuICAgIGluaXRpYWxDb250YWluZXJQb3NpdGlvbjogbnVtYmVyID0gMDtcclxuICAgIGF1dG9wbGF5SWQ6IGFueTtcclxuXHJcbiAgICBnZXQgY2VsbExlbmd0aCgpIHtcclxuICAgICAgICBpZiAodGhpcy5pbWFnZXMpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW1hZ2VzLmxlbmd0aDtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5jZWxscy5sZW5ndGg7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGdldCB0b3RhbENvbnRhaW5lckNlbGxzQ291bnQoKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuaW1hZ2VzKSB7XHJcbiAgICAgICAgICAgIGxldCBjZWxsTGVuZ3RoID0gdGhpcy52aXNpYmxlQ2VsbHNDb3VudCArIHRoaXMub3ZlcmZsb3dDZWxsc0xpbWl0ICogMjtcclxuICAgICAgICAgICAgaWYgKGNlbGxMZW5ndGggPiB0aGlzLmltYWdlcy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgIGNlbGxMZW5ndGggPSB0aGlzLmltYWdlcy5sZW5ndGg7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGNlbGxMZW5ndGg7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY2VsbExlbmd0aDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0IGlzRmlyc3RDZWxsKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLnNsaWRlQ291bnRlciA9PT0gMDtcclxuICAgIH1cclxuXHJcbiAgICBnZXQgbGFzdENlbGxJbmRle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lzLnNsaWRlQ291bnRlciAqIHRoaXMuZnVsbENlbGxXaWR0aCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHNldENvbnRhaW5lcldpZHRoKCkge1xyXG4gICAgICAgIGNvbnN0IGNvbnRhaW5lcldpZHRoID0gdGhpcy5nZXRDb250YWluZXJXaWR0aCgpO1xyXG4gICAgICAgIHRoaXMuZWxlbWVudC5zdHlsZS53aWR0aCA9IGNvbnRhaW5lcldpZHRoICsgXCJweFwiO1xyXG4gICAgfVxyXG5cclxuICAgIGdldENvbnRhaW5lcldpZHRoKCkge1xyXG4gICAgICAgIGxldCBjb250YWluZXJXaWR0aCA9IHRoaXMudG90YWxDb250YWluZXJDZWxsc0NvdW50ICogdGhpcy5mdWxsQ2VsbFdpZHRoO1xyXG4gICAgICAgIGxldCB0b3RhbEltYWdlV2lkdGggPSB0aGlzLmNlbGxMZW5ndGggKiB0aGlzLmZ1bGxDZWxsV2lkdGg7XHJcblxyXG4gICAgICAgIGlmICh0b3RhbEltYWdlV2lkdGggPCBjb250YWluZXJXaWR0aCkge1xyXG4gICAgICAgICAgICBjb250YWluZXJXaWR0aCA9IHRvdGFsSW1hZ2VXaWR0aDtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBjb250YWluZXJXaWR0aDtcclxuICAgIH1cclxuXHJcbiAgICBnZXRGaWxlKGNlbGxJbmRleCkge1xyXG4gICAgICAgIGxldCBpbWFnZUluZGV4ID0gdGhpcy5nZXRGaWxlSW5kZXgoY2VsbEluZGV4KTsgXHJcbiAgICAgICAgbGV0IGZpbGUgPSB0aGlzLmltYWdlc1tpbWFnZUluZGV4XTtcclxuXHJcbiAgICAgICAgaWYgKGZpbGUgJiYgIWZpbGUudHlwZSkge1xyXG4gICAgICAgICAgICBmaWxlLnR5cGUgPSAnaW1hZ2UnO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgaW1hZ2U6IHRoaXMuaW1hZ2VzW2ltYWdlSW5kZXhdLFxyXG4gICAgICAgICAgICBpbWFnZUluZGV4XHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuXHJcbiAgICBnZXRGaWxlSW5kZXgoY2VsbEluZGV4OiBudW1iZXIpIHtcclxuICAgICAgICBjb25zdCBwb3NpdGlvbkluZGV4ID0gdGhpcy5nZXRQb3NpdGlvbkluZGV4KGNlbGxJbmRleCk7XHJcbiAgICAgICAgY29uc3QgbnVtYmVyTGVmdENlbGxzID0gKHRoaXMudG90YWxDb250YWluZXJDZWxsc0NvdW50IC0gMSkgLyAyO1xyXG4gICAgICAgIGxldCBpbWFnZUluZGV4O1xyXG4gICAgICAgIGxldCBjb3VudGVyID0gdGhpcy5zbGlkZUNvdW50ZXI7XHJcblxyXG4gICAgICAgIGlmICghdGhpcy5pc0NvbnRhaW5lckxvY2tlZCkge1xyXG4gICAgICAgICAgICBpZiAoY291bnRlciA8PSB0aGlzLm92ZXJmbG93Q2VsbHNMaW1pdCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNlbGxJbmRleDtcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGxldCBjZWxsTGltaXRPdmVyZmxvdyA9IGNvdW50ZXIgLSB0aGlzLm92ZXJmbG93Q2VsbHNMaW1pdDtcclxuICAgICAgICAgICAgICAgIGltYWdlSW5kZXggPSBwb3NpdGlvbkluZGV4ICsgY2VsbExpbWl0T3ZlcmZsb3c7XHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuaW1hZ2VzICYmIHRoaXMucHJvcGVydGllcy5sb29wKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaW1hZ2VJbmRleCA9IGltYWdlSW5kZXggJSB0aGlzLmltYWdlcy5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGltYWdlSW5kZXg7XHJcbiAgICAgICAgICAgI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yVW5sb2NrKCkpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmlzQ29udGFpbmVyTG9ja2VkID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLnNsaWRlTGVuZ3RoID0gMDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgaGFuZGxlUmlnaHRTbGlkZSgpIHtcclxuICAgICAgICBpZiAodGhpcy5zbGlkZUNvdW50ZXIgLSB0aGlzLnNsaWRlTGVuZ3RoIDwgMCkge1xyXG4gICAgICAgICAgICB0aGlzLnNsaWRlTGVuZ3RoID0gdGhpcy5zbGlkZUNvdW50ZXI7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICB0aGlzLnByZWxpbWluYXJ5U2xpZGVDb3VudGVyID0gdGhpcy5zbGlkZUNvdW50ZXIgLSB0aGlzLnNsaWRlTGVuZ3RoO1xyXG5cclxuICAgICAgICBpZiAoIXRoaXMuaXNGaXJzdENlbGwpIHtcclxuICAgICAgICAgICAgdGhpcy5uZXdDb250YWluZXJQb3NpdGlvbkluZGV4ID0gdGhpcy5uZXdDb250YWluZXJQb3NpdGlvbkluZGV4ICsgdGhpcy5zbGlkZUxlbmd0aDtcclxuICAgICAgICAgICAgdGhpcy5pc1NsaWRlSW5Qcm9ncmVzcyA9IHRydWU7XHJcblxyXG4gICAgICAgICAgICBpZiAodGhpcy5pc0xhenlMb2FkKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wcmVsaW1pbmFyeVNsaWRlQ291bnRlciA+IHRoaXMub3ZlcmZsb3dDZWxsc0xpbWl0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pc0NvbnRhaW5lckxvY2tlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaXNDb250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B7XHJcbiAgICAgICAgaWYgKHNsaWRlTGVuZ3RoID4gMSkge1xyXG5cclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzbGlkZUxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBsZXQgbmV3U2xpZGVDb3VudGVyID0gdGhpcy5zbGlkZUNvdW50ZXIgKyAoc2xpZGVMZW5ndGggLSBpKTtcclxuXHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuZGV0ZWN0TGFzdFNsaWRlKG5ld1NsaWRlQ291bnRlcikpIHtcclxuICAgICAgICAgICAgICAgICAgICBzbGlkZUxlbmd0aCA9IHNsaWRlTGVuZ3RoIC0gaTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmlzU2xpZGVMZW5ndGhMaW1pdGVkID0gaSA+IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHNsaWRlTGVuZ3RoO1xyXG4gICAgfVxyXG5cclxuICAgIGRldGVjdExhc3RTbGlkZShzbGlkZUNvdW50ZXI6IG51bWJlcikge1xyXG4gICAgICAgIGlmICh0aGlzLnByb3BlcnRpZXMubG9vcCkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcmV0dXJuICh0aGlzLmNlbGxMZW5ndGggLSBzbGlkZUNvdW50ZXIpIDwgdGhpcy52aXNpYmxlQ2VsbHNDb3VudDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgaXNOZXh0QXJyb3dEaXNhYmxlZCgpIHtcclxuICAgICAgICBpZiAodGhpcy52aXNpYmxlQ2VsbHNPdmVyZmxvd0NvbnRhaW5lcikge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kZXRlY3RMYXN0U2xpZG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ICAgICAgcmV0dXJuIHRoaXMucHJvcGVydGllcy5jb250YWluZXIuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0RGlzdGFuY2UoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnRYIC0gdGhpcy5tb3ZlWDtcclxuICAgIH1cclxuXHJcbiAgICBnZXREaXN0YW5jZUFicygpIHtcclxuICAgICAgICByZXR1cm4gTWF0aC5hYnModGhpcy5zdGFydFggLSB0aGlzLm1vdmVYKTtcclxuICAgIH1cclxuXHJcbiAgICBnZXREaXJlY3Rpb24oKSB7XHJcbiAgICAgICAgY29uc3QgZGlyZWN0aW9uID0gTWF0aC5zaWduKHRoaXMuc3RhcnRYIC0gdGhpcy5tb3ZlWCk7XHJcblxyXG4gICAgICAgIGlmIChkaXJlY3Rpb24gPT09IC0xKSB7XHJcbiAgICAgICAgICAgIHJldHVybiAncmlnaHQnO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZGlyZWN0aW9uID09PSAxKSB7XHJcbiAgICAgICAgICAgIHJldHVybiAnbGVmdCc7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGxpbmVVcENlbGxzKCkge1xyXG4gICAgICAgIGNvbnN0IGNlbGxzID0gdGhpcy5lbGVtZW50LmNoaWxkcmVuO1xyXG5cclxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNlbGxzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGxldCBjZWxsID0gY2VsbHNbaV07XHJcbiAgICAgICAgICAgIGxldCBwb3NpdGlvblggPSB0aGlzLmdldENlbGxQb3NpdGlvblgoaSk7XHJcbiAgICAgICAgICAgIChjZWxsIGFzIEhUTUxFbGVtZW50KS5zdHlsZS50cmFuc2Zvcm0gPSAndHJhbnNsYXRlWCgnICsgcG9zaXRpb25YICsgJ3B4KSc7XHJcblxyXG4gICAgICAgICAgICAvLyBub3RpY2VcclxuICAgICAgICAgICAgKGNlbGwgYXMgSFRNTEVsZW1lbnQpLnN0eWxlLndpZHRoID0gdGhpcy5wcm9wZXJ0aWVzLmNlbGxXaWR0aCsncHgnO1xyXG4gICAgICAgIH07XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0Q2VsbFBvc2l0aW9uWChpbmRleCkge1xyXG4gICAgICAgIGxldCBwb3NpdGlvbkluZGV4ID0gdGhpcy5nZXRQb3NpdGlvbkluZGV4KGluZGV4KTtcclxuICAgICAgICByZXR1cm4gcG9zaXRpb25JbmRleCAqIHRoaXMuZnVsbENlbGxXaWR0aDtcclxuICAgIH1cclxuXHJcbiAgICBnZXRQb3NpdGlvbkluZGV4KGNlbGxJbmRleCkge1xyXG4gICAgICAgIGxldCBjb3VudGVyID0gdGhpcy5zbGlkZUNvdW50ZXI7XHJcbiAgICAgICAgbGV0IGNlbGxMZW5ndGggPSB0aGlzLnRvdGFsQ29udGFpbmVyQ2VsbHNDb3VudDtcclxuICAgICAgICBsZXQgc2xpZGVDb3VudGVyID0gY291bnRlciAtIHRoaXMub3ZlcmZsb3dDZWxsc0xpbWl0O1xyXG4gICAgICAgIGxldCBwb3NpdGlvbkluZGV4O1xyXG5cclxuICAgICAgICBpZiAoc2xpZGVDb3VudGVyID4gY2VsbExlbmd0aCkge1xyXG4gICAgICAgICAgICBzbGlkZUNvdW50ZXIgPSBzbGlkZUNvdW50ZXIgJSBjZWxsTGVuZ3RoO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKHNsaWRlQ291bnRlciA8IDApIHtcclxuICAgICAgICAgICAgcmV0dXJuIGNlbGxJbmRleDtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICBwb3NpdGlvbkluZGV4ID0gY2VsbEluZGV4IC0gc2xpZGVDb3VudGVyO1xyXG4gICAgICAgICAgICBpZiAocG9zaXRpb25JbmRleCA8IDApIHtcclxuICAgICAgICAgICAgICAgIHBvc2l0aW9uSW5kZXggPSBjZWxsTGVuZ3RoICsgcG9zaXRpb25JbmRleDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uSW5kZXg7XHJcbiAgICB9XHJcblxyXG4gICAgZ2V0Q2VudGVyUG9zaXRpb25JbmRleCgpIHtcclxuICAgICAgICByZXR1cm4gKHRoaXMudG90YWxDb250YWluZXJDZWxsc0NvdW50IC0gMSkgLyAyO1xyXG4gICAgfVxyXG5cclxuICAgIGF1dG9wbGF5KCkge1xyXG4gICAgICAgIHRoaXMuYXV0b3BsYXlJZCA9IHNldEludGVydmFsKCgpID0+IHtcclxuICAgICAgICAgICAgdGhpcy5uZXh0KCk7IFxyXG4gICAgICAgIH0sIHRoaXMucHJvcGVydGllcy5hdXRvcGxheUludGVydmFsKTtcclxuICAgIH1cclxuXHJcbiAgICBzdG9wQXV0b3BsYXkoKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuYXV0b3BsYXlJZCkge1xyXG4gICAgICAgICAgICBjbGVhckludGVydmFsKHRoaXMuYXV0b3BsYXlJZCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGRlc3Ryb3koKSB7XHJcbiAgICAgICAgdGhpcy5zdG9wQXV0b3BsYXkoKTtcclxuICAgIH1cclxufSJdfQ== |
@@ -346,5 +346,7 @@ import { EventEmitter, Component, ElementRef, ChangeDetectorRef, Input, Output, HostBinding, HostListener, NgModule } from '@angular/core'; | ||
this.initialPositionX = 0; | ||
this.newContainerPositionIndex = 0; // The index of the new position relative to the active index, for example -1 or +1 | ||
/* The index of the new position relative to the active index, for example -1 or +1 */ | ||
this.newContainerPositionIndex = 0; | ||
this.preliminarySlideCounter = 0; | ||
this.slideCounter = 0; // Scrolling Index (counter) | ||
/* Scrolling Index (counter) */ | ||
this.slideCounter = 0; | ||
this.previousSlideCounter = 0; | ||
@@ -358,19 +360,8 @@ this.isContentImages = true; | ||
this.isTouchstart = true; | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
const touches = event.touches; | ||
if (touches) { | ||
this.startX = touches[0].clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
else { | ||
this.startX = event.clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
this.startX = this.getStartX(event); | ||
this.containerInitialPositionX = this.getElementPosition()['left'] - this.getCarouselElementPosition()['left']; | ||
this.isMoveInProgress = true; | ||
this.stopTransformContainer(); | ||
}; | ||
this.handleHorizontalSwipe = (event) => { | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
const touches = event.touches; | ||
@@ -388,3 +379,3 @@ if (touches) { | ||
this.handleTouchend = (event) => { | ||
if (this.isSlideInProgress || !this.isTouchstart) { | ||
if (!this.isTouchstart) { | ||
this.isTouchstart = false; | ||
@@ -478,2 +469,20 @@ return; | ||
} | ||
stopTransformContainer() { | ||
this.transformPositionX(this.containerInitialPositionX, 0); | ||
this.setSlideCounter(); | ||
this.isSlideInProgress = false; | ||
this.newContainerPositionIndex = 0; | ||
this.isSlideLengthLimited = undefined; | ||
} | ||
getStartX(event) { | ||
const touches = event.touches; | ||
let startX; | ||
if (touches) { | ||
startX = touches[0].clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
else { | ||
startX = event.clientX - this.getCarouselElementPosition()['left']; | ||
} | ||
return startX; | ||
} | ||
/* Move */ | ||
@@ -503,2 +512,3 @@ moveContainer() { | ||
} | ||
/* Offset the container to show the last cell completely */ | ||
getContainerPositionCorrection() { | ||
@@ -603,5 +613,3 @@ let correction = 0; | ||
next(length = 1) { | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
this.newContainerPositionIndex = 0; | ||
this.direction = 'left'; | ||
@@ -611,5 +619,3 @@ this.handleSlide(length); | ||
prev(length = 1) { | ||
if (this.isSlideInProgress) { | ||
return; | ||
} | ||
this.newContainerPositionIndex = 0; | ||
this.direction = 'right'; | ||
@@ -622,40 +628,56 @@ this.handleSlide(length); | ||
} | ||
handleSlide(slideLength = undefined) { | ||
this.slideLength = this.getSlideLength(); | ||
this.slideLength = slideLength ? slideLength : this.limitSlideLength(this.slideLength); | ||
if (this.direction === 'left' && !this.isSlideInProgress) { | ||
this.preliminarySlideCounter = this.slideCounter + this.slideLength; | ||
if (!this.detectLastSlide(this.slideCounter + this.slideLength)) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex - this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
this.isContainerLocked = this.preliminarySlideCounter > this.overflowCellsLimit; | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
handleSlide(customSlideLength = undefined) { | ||
let isUsingButton = customSlideLength; | ||
if (isUsingButton && this.isSlideInProgress) { | ||
return; | ||
} | ||
this.slideLength = customSlideLength ? customSlideLength : this.limitSlideLength(this.getSlideLength()); | ||
if (this.direction === 'left') { | ||
this.handleLeftSlide(); | ||
} | ||
if (this.direction === 'right') { | ||
this.handleRightSlide(); | ||
} | ||
this.alignContainer(); | ||
} | ||
handleLeftSlide() { | ||
this.preliminarySlideCounter = this.slideCounter + this.slideLength; | ||
let isLastSlide = this.detectLastSlide(this.slideCounter + this.slideLength); | ||
if (!isLastSlide) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex - this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
this.isContainerLocked = this.preliminarySlideCounter > this.overflowCellsLimit; | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
} | ||
} | ||
if (this.direction === 'right' && !this.isSlideInProgress) { | ||
if (this.slideCounter - this.slideLength < 0) { | ||
this.slideLength = this.slideCounter; | ||
} | ||
this.preliminarySlideCounter = this.slideCounter - this.slideLength; | ||
if (!this.isFirstCell) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex + this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
if (this.preliminarySlideCounter > this.overflowCellsLimit) { | ||
this.isContainerLocked = true; | ||
} | ||
else { | ||
this.isContainerLocked = false; | ||
} | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
else { | ||
this.slideLength = 0; | ||
} | ||
} | ||
handleRightSlide() { | ||
if (this.slideCounter - this.slideLength < 0) { | ||
this.slideLength = this.slideCounter; | ||
} | ||
this.preliminarySlideCounter = this.slideCounter - this.slideLength; | ||
if (!this.isFirstCell) { | ||
this.newContainerPositionIndex = this.newContainerPositionIndex + this.slideLength; | ||
this.isSlideInProgress = true; | ||
if (this.isLazyLoad) { | ||
if (this.preliminarySlideCounter > this.overflowCellsLimit) { | ||
this.isContainerLocked = true; | ||
} | ||
else { | ||
this.isContainerLocked = false; | ||
} | ||
if (this.detectContainerUnlock()) { | ||
this.isContainerLocked = false; | ||
} | ||
} | ||
} | ||
this.alignContainer(); | ||
else { | ||
this.slideLength = 0; | ||
} | ||
} | ||
@@ -670,2 +692,6 @@ getSlideLength() { | ||
} | ||
/* | ||
* Limits the length of the slide during calls to the next() and prev() | ||
* methods if the specified position is outside the cell length | ||
*/ | ||
limitSlideLength(slideLength) { | ||
@@ -824,3 +850,3 @@ if (slideLength > 1) { | ||
this.objectFit = 'cover'; | ||
this.minSwipeDistance = 50; | ||
this.minSwipeDistance = 10; | ||
this.transitionDuration = 200; | ||
@@ -827,0 +853,0 @@ this.transitionTimingFunction = 'ease'; |
@@ -32,3 +32,2 @@ export interface Properties { | ||
isMoveInProgress: boolean; | ||
isTransitionInProgress: boolean; | ||
isTouchstart: boolean; | ||
@@ -63,2 +62,4 @@ isSlideLengthLimited: boolean; | ||
handleTouchstart: (event: any) => void; | ||
stopTransformContainer(): void; | ||
getStartX(event: any): any; | ||
handleHorizontalSwipe: (event: any) => void; | ||
@@ -86,3 +87,5 @@ handleTouchend: (event: any) => void; | ||
select(index: number): void; | ||
handleSlide(slideLength?: number): void; | ||
handleSlide(customSlideLength?: number): void; | ||
handleLeftSlide(): void; | ||
handleRightSlide(): void; | ||
getSlideLength(): number; | ||
@@ -89,0 +92,0 @@ limitSlideLength(slideLength: number): number; |
{ | ||
"name": "angular-responsive-carousel", | ||
"version": "1.4.11", | ||
"version": "1.5.11", | ||
"description": "Carousel for Angular. A simple solution for horizontal scrolling images with lazy loading.", | ||
@@ -16,5 +16,3 @@ "repository": { | ||
"Angular", | ||
"Angular 2", | ||
"ngx", | ||
"ng2", | ||
"Carousel", | ||
@@ -21,0 +19,0 @@ "Swiper", |
@@ -64,3 +64,3 @@ # Carousel for Angular | ||
| cellWidth | number, '100%' | 200 | Cell width. | | ||
| cellsToShow | number | | The number of carousel cells in the visible area. | | ||
| cellsToShow | number | | The number of cells to display, regardless of the width of the container. | | ||
| cellsToScroll | number | 1 | The number of carousel cells to scroll per arrow click. | | ||
@@ -74,5 +74,5 @@ | loop | boolean | false | Infinite loop. | | ||
| margin | number | 10 | Cell spacing. | | ||
| minSwipeDistance | number | 50 | Minimum distance for swipe. | | ||
| transitionDuration | number | 200 | Animation duration. | | ||
| transitionTimingFunction | 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'linear' | 'ease' | Smooth animation function. | | ||
| minSwipeDistance | number | 10 | Minimum distance for swipe. | | ||
| transitionDuration | number | 300 | Animation duration. | | ||
| transitionTimingFunction | 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'linear' | 'ease-in-out' | Smooth animation function. | | ||
| counter | boolean | false | Counter. | | ||
@@ -93,4 +93,2 @@ | counterSeparator | string | " / " | Counter separator. | | ||
`slidesToShow` - the number of cells to display, regardless of the width of the container. | ||
`centerMode` - center the cells inside the container (Pro version). | ||
@@ -100,4 +98,2 @@ | ||
`adaptiveHeight` - the height of the container is set based on the height of the tallest cell currently visible. | ||
`groupCells` - the cells will behave as grouped, the group will include the number of visible cells that fit into the container area. | ||
`adaptiveHeight` - the height of the container is set based on the height of the tallest cell currently visible. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
541279
4109
95