this.primereact=this.primereact||{},this.primereact.carousel=function(t,e,i,n,s){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=a(e),o=a(s);function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&(n+=-1*this.remainingItems-this.state.numScroll*t,this.isRemainingItemsAdded=!0),this.itemsContainer&&(i.DomHandler.removeClass(this.itemsContainer,"p-items-hidden"),this.changePosition(n),this.itemsContainer.style.transition="transform 500ms ease 0s"),this.props.onPageChange?(this.setState({totalShiftedItems:n}),this.props.onPageChange({page:e})):this.setState({page:e,totalShiftedItems:n})}},{key:"calculatePosition",value:function(){if(this.itemsContainer&&this.responsiveOptions){for(var t=window.innerWidth,e={numVisible:this.props.numVisible,numScroll:this.props.numScroll},i=0;i=t&&(e=n)}var s={};if(this.state.numScroll!==e.numScroll){var a=this.getPage();a=Math.floor(a*this.state.numScroll/e.numScroll);var r=e.numScroll*a*-1;this.isCircular()&&(r-=e.numVisible),s={totalShiftedItems:r,numScroll:e.numScroll},this.props.onPageChange?this.props.onPageChange({page:a}):s=P(P({},s),{},{page:a})}this.state.numVisible!==e.numVisible&&(s=P(P({},s),{},{numVisible:e.numVisible})),Object.keys(s).length&&this.setState(s)}}},{key:"navBackward",value:function(t,e){(this.circular||0!==this.getPage())&&this.step(1,e),this.allowAutoplay=!1,t.cancelable&&t.preventDefault()}},{key:"navForward",value:function(t,e){(this.circular||this.getPage()i?this.navForward(t,e):ethis.swipeThreshold&&(e<0?this.navForward(t):this.navBackward(t))}},{key:"bindDocumentListeners",value:function(){var t=this;this.documentResizeListener||(this.documentResizeListener=function(){t.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentListeners",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"isCircular",value:function(){return this.circular&&this.props.value.length>=this.state.numVisible}},{key:"getPage",value:function(){return this.props.onPageChange?this.props.page:this.state.page}},{key:"getTotalIndicators",value:function(){return this.props.value?Math.ceil((this.props.value.length-this.state.numVisible)/this.state.numScroll)+1:0}},{key:"isAutoplay",value:function(){return this.props.autoplayInterval&&this.allowAutoplay}},{key:"startAutoplay",value:function(){var t=this;this.interval=setInterval((function(){t.step(-1,t.state.page===t.totalIndicators-1?0:t.state.page+1)}),this.props.autoplayInterval)}},{key:"stopAutoplay",value:function(){this.interval&&clearInterval(this.interval)}},{key:"createStyle",value:function(){this.carouselStyle||(this.carouselStyle=i.DomHandler.createInlineStyle(o.default.nonce));var t,e="\n .p-carousel[".concat(this.attributeSelector,"] .p-carousel-item {\n flex: 1 0 ").concat(100/this.state.numVisible,"%\n }\n ");if(this.props.responsiveOptions){this.responsiveOptions=u(t=this.props.responsiveOptions)||c(t)||p(t)||h(),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 n=0;n=this.totalIndicators&&(a=this.totalIndicators-1,this.props.onPageChange?this.props.onPageChange({page:a}):this.setState({page:a}),n=!0),s=a*this.state.numScroll*-1,i&&(s-=this.state.numVisible),a===this.totalIndicators-1&&this.remainingItems>0?(s+=-1*this.remainingItems+this.state.numScroll,this.isRemainingItemsAdded=!0):this.isRemainingItemsAdded=!1,s!==this.state.totalShiftedItems&&(this.setState({totalShiftedItems:s}),n=!0),this.changePosition(s)}i&&(0===this.state.page?s=-1*this.state.numVisible:0===s&&(s=-1*this.props.value.length,this.remainingItems>0&&(this.isRemainingItemsAdded=!0)),s!==this.state.totalShiftedItems&&(this.setState({totalShiftedItems:s}),n=!0)),t.page!==this.props.page&&(this.props.page>t.page&&this.props.page<=this.totalIndicators-1?this.step(-1,this.props.page):this.props.page=n,start:s===n,end:a===n})}));return r.default.createElement(r.default.Fragment,null,i,a,n)}}},{key:"renderHeader",value:function(){return this.props.header?r.default.createElement("div",{className:"p-carousel-header"},this.props.header):null}},{key:"renderFooter",value:function(){return this.props.footer?r.default.createElement("div",{className:"p-carousel-footer"},this.props.footer):null}},{key:"renderContent",value:function(){var t=this,e=this.renderItems(),n=this.isVertical()?this.props.verticalViewPortHeight:"auto",s=this.renderBackwardNavigator(),a=this.renderForwardNavigator(),o=i.classNames("p-carousel-container",this.props.containerClassName);return r.default.createElement("div",{className:o},s,r.default.createElement("div",{className:"p-carousel-items-content",style:{height:n},onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},r.default.createElement("div",{ref:function(e){return t.itemsContainer=e},className:"p-carousel-items-container",onTransitionEnd:this.onTransitionEnd},e)),a)}},{key:"renderBackwardNavigator",value:function(){var t=(!this.circular||this.props.value&&this.props.value.length