!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("primeng/api"),require("primeng/ripple"),require("@angular/common"),require("primeng/utils")):"function"==typeof define&&define.amd?define("primeng/carousel",["exports","@angular/core","primeng/api","primeng/ripple","@angular/common","primeng/utils"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).primeng=t.primeng||{},t.primeng.carousel={}),t.ng.core,t.primeng.api,t.primeng.ripple,t.ng.common,t.primeng.utils)}(this,(function(t,e,i,n,s,o){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */Object.create;function a(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,s,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(s)throw s.error}}return a}function l(){for(var t=[],e=0;ethis._page&&t<=this.totalDots()-1?this.step(-1,t):t=this.totalDots()&&(i=this.totalDots()-1,this._page=i,this.onPage.emit({page:this.page})),e=i*this._numScroll*-1,t&&(e-=this._numVisible),i===this.totalDots()-1&&this.remainingItems>0?(e+=-1*this.remainingItems+this._numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,e!==this.totalShiftedItems&&(this.totalShiftedItems=e),this._oldNumScroll=this._numScroll,this.prevState.numScroll=this._numScroll,this.prevState.numVisible=this._numVisible,this.prevState.value=this._value,this.totalDots()>0&&this.itemsContainer&&this.itemsContainer.nativeElement&&(this.itemsContainer.nativeElement.style.transform=this.isVertical()?"translate3d(0, "+e*(100/this._numVisible)+"%, 0)":"translate3d("+e*(100/this._numVisible)+"%, 0, 0)"),this.isCreated=!0,this.autoplayInterval&&this.isAutoplay()&&this.startAutoplay()}t&&(0===this.page?e=-1*this._numVisible:0===e&&(e=-1*this.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),e!==this.totalShiftedItems&&(this.totalShiftedItems=e))},t.prototype.createStyle=function(){this.carouselStyle||(this.carouselStyle=document.createElement("style"),this.carouselStyle.type="text/css",document.body.appendChild(this.carouselStyle));var t="\n #"+this.id+" .p-carousel-item {\n\t\t\t\tflex: 1 0 "+100/this.numVisible+"%\n\t\t\t}\n ";if(this.responsiveOptions){this.responsiveOptions.sort((function(t,e){var i=t.breakpoint,n=e.breakpoint;return-1*(null==i&&null!=n?-1:null!=i&&null==n?1:null==i&&null==n?0:"string"==typeof i&&"string"==typeof n?i.localeCompare(n,void 0,{numeric:!0}):in?1:0)}));for(var e=0;e=t&&(e=n)}if(this._numScroll!==e.numScroll){var s=this._page;s=Math.floor(s*this._numScroll/e.numScroll);var o=e.numScroll*this.page*-1;this.isCircular()&&(o-=e.numVisible),this.totalShiftedItems=o,this._numScroll=e.numScroll,this._page=s,this.onPage.emit({page:this.page})}this._numVisible!==e.numVisible&&(this._numVisible=e.numVisible,this.setCloneItems()),this.cd.markForCheck()}},t.prototype.setCloneItems=function(){var t,e;this.clonedItemsForStarting=[],this.clonedItemsForFinishing=[],this.isCircular()&&((t=this.clonedItemsForStarting).push.apply(t,l(this.value.slice(-1*this._numVisible))),(e=this.clonedItemsForFinishing).push.apply(e,l(this.value.slice(0,this._numVisible))))},t.prototype.firstIndex=function(){return this.isCircular()?-1*(this.totalShiftedItems+this.numVisible):-1*this.totalShiftedItems},t.prototype.lastIndex=function(){return this.firstIndex()+this.numVisible-1},t.prototype.totalDots=function(){return this.value?Math.ceil((this.value.length-this._numVisible)/this._numScroll)+1:0},t.prototype.totalDotsArray=function(){var t=this.totalDots();return t<=0?[]:Array(t).fill(0)},t.prototype.isVertical=function(){return"vertical"===this.orientation},t.prototype.isCircular=function(){return this.circular&&this.value&&this.value.length>=this.numVisible},t.prototype.isAutoplay=function(){return this.autoplayInterval&&this.allowAutoplay},t.prototype.isForwardNavDisabled=function(){return this.isEmpty()||this._page>=this.totalDots()-1&&!this.isCircular()},t.prototype.isBackwardNavDisabled=function(){return this.isEmpty()||this._page<=0&&!this.isCircular()},t.prototype.isEmpty=function(){return!this.value||0===this.value.length},t.prototype.navForward=function(t,e){(this.isCircular()||this._pagei?this.navForward(t,e):e0&&(i+=-1*this.remainingItems-this._numScroll*t,this.isRemainingItemsAdded=!0),this.itemsContainer&&(this.itemsContainer.nativeElement.style.transform=this.isVertical()?"translate3d(0, "+i*(100/this._numVisible)+"%, 0)":"translate3d("+i*(100/this._numVisible)+"%, 0, 0)",this.itemsContainer.nativeElement.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=i,this._page=e,this.onPage.emit({page:this.page})},t.prototype.startAutoplay=function(){var t=this;this.interval=setInterval((function(){t.totalDots()>0&&(t.page===t.totalDots()-1?t.step(-1,0):t.step(-1,t.page+1))}),this.autoplayInterval)},t.prototype.stopAutoplay=function(){this.interval&&clearInterval(this.interval)},t.prototype.onTransitionEnd=function(){this.itemsContainer&&(this.itemsContainer.nativeElement.style.transition="",0!==this.page&&this.page!==this.totalDots()-1||!this.isCircular()||(this.itemsContainer.nativeElement.style.transform=this.isVertical()?"translate3d(0, "+this.totalShiftedItems*(100/this._numVisible)+"%, 0)":"translate3d("+this.totalShiftedItems*(100/this._numVisible)+"%, 0, 0)"))},t.prototype.onTouchStart=function(t){var e=t.changedTouches[0];this.startPos={x:e.pageX,y:e.pageY}},t.prototype.onTouchMove=function(t){t.cancelable&&t.preventDefault()},t.prototype.onTouchEnd=function(t){var e=t.changedTouches[0];this.isVertical()?this.changePageOnTouch(t,e.pageY-this.startPos.y):this.changePageOnTouch(t,e.pageX-this.startPos.x)},t.prototype.changePageOnTouch=function(t,e){Math.abs(e)>this.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))},t.prototype.bindDocumentListeners=function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(e){t.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))},t.prototype.unbindDocumentListeners=function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},t.prototype.ngOnDestroy=function(){this.responsiveOptions&&this.unbindDocumentListeners(),this.autoplayInterval&&this.stopAutoplay()},t}();r.decorators=[{type:e.Component,args:[{selector:"p-carousel",template:'\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\n\t\t\t\t\t
  • \n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t
\n ',changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,styles:[".p-carousel,.p-carousel-content{-ms-flex-direction:column;display:-ms-flexbox;display:flex;flex-direction:column}.p-carousel-content{overflow:auto}.p-carousel-next,.p-carousel-prev{-ms-flex-align:center;-ms-flex-item-align:center;-ms-flex-negative:0;-ms-flex-pack:center;-ms-flex-positive:0;align-items:center;align-self:center;display:-ms-flexbox;display:flex;flex-grow:0;flex-shrink:0;justify-content:center;overflow:hidden;position:relative}.p-carousel-container{-ms-flex-direction:row;display:-ms-flexbox;display:flex;flex-direction:row}.p-carousel-items-content{overflow:hidden;width:100%}.p-carousel-indicators,.p-carousel-items-container{-ms-flex-direction:row;display:-ms-flexbox;display:flex;flex-direction:row}.p-carousel-indicators{-ms-flex-pack:center;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-content:center}.p-carousel-indicator>button{-ms-flex-align:center;-ms-flex-pack:center;align-items:center;display:-ms-flexbox;display:flex;justify-content:center}.p-carousel-vertical .p-carousel-container{-ms-flex-direction:column;flex-direction:column}.p-carousel-vertical .p-carousel-items-container{-ms-flex-direction:column;flex-direction:column;height:100%}.p-items-hidden .p-carousel-item{visibility:hidden}.p-items-hidden .p-carousel-item.p-carousel-item-active{visibility:visible}"]}]}],r.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:e.ChangeDetectorRef}]},r.propDecorators={page:[{type:e.Input}],numVisible:[{type:e.Input}],numScroll:[{type:e.Input}],responsiveOptions:[{type:e.Input}],orientation:[{type:e.Input}],verticalViewPortHeight:[{type:e.Input}],contentClass:[{type:e.Input}],indicatorsContentClass:[{type:e.Input}],value:[{type:e.Input}],circular:[{type:e.Input}],autoplayInterval:[{type:e.Input}],style:[{type:e.Input}],styleClass:[{type:e.Input}],onPage:[{type:e.Output}],itemsContainer:[{type:e.ViewChild,args:["itemsContainer"]}],headerFacet:[{type:e.ContentChild,args:[i.Header]}],footerFacet:[{type:e.ContentChild,args:[i.Footer]}],templates:[{type:e.ContentChildren,args:[i.PrimeTemplate]}]};var u=function(){};u.decorators=[{type:e.NgModule,args:[{imports:[s.CommonModule,i.SharedModule,n.RippleModule],exports:[s.CommonModule,r,i.SharedModule],declarations:[r]}]}],t.Carousel=r,t.CarouselModule=u,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-carousel.umd.min.js.map