!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("rxjs"),require("rxjs/operators"),require("@angular/core"),require("@angular/common"),require("perfect-scrollbar"),require("resize-observer-polyfill")):"function"==typeof define&&define.amd?define("ngx-perfect-scrollbar",["exports","rxjs","rxjs/operators","@angular/core","@angular/common","perfect-scrollbar","resize-observer-polyfill"],e):e((t=t||self)["ngx-perfect-scrollbar"]={},t.rxjs,t.rxjs.operators,t.ng.core,t.ng.common,t.PerfectScrollbar,t.ResizeObserver)}(this,(function(t,e,i,o,s,r,n){"use strict";r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var a=new o.InjectionToken("PERFECT_SCROLLBAR_CONFIG"),l=function(t,e,i,o){this.x=t,this.y=e,this.w=i,this.h=o},p=function(t,e){this.x=t,this.y=e},c=["psScrollY","psScrollX","psScrollUp","psScrollDown","psScrollLeft","psScrollRight","psYReachEnd","psYReachStart","psXReachEnd","psXReachStart"],h=function(){function t(t){void 0===t&&(t={}),this.assign(t)}return t.prototype.assign=function(t){for(var e in void 0===t&&(t={}),t)this[e]=t[e]},t}(),f=function(){function t(t,i,s,r,n){this.zone=t,this.differs=i,this.elementRef=s,this.platformId=r,this.defaults=n,this.instance=null,this.ro=null,this.timeout=null,this.animation=null,this.configDiff=null,this.ngDestroy=new e.Subject,this.disabled=!1,this.psScrollY=new o.EventEmitter,this.psScrollX=new o.EventEmitter,this.psScrollUp=new o.EventEmitter,this.psScrollDown=new o.EventEmitter,this.psScrollLeft=new o.EventEmitter,this.psScrollRight=new o.EventEmitter,this.psYReachEnd=new o.EventEmitter,this.psYReachStart=new o.EventEmitter,this.psXReachEnd=new o.EventEmitter,this.psXReachStart=new o.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;if(!this.disabled&&s.isPlatformBrowser(this.platformId)){var o=new h(this.defaults);o.assign(this.config),this.zone.runOutsideAngular((function(){t.instance=new r(t.elementRef.nativeElement,o)})),this.configDiff||(this.configDiff=this.differs.find(this.config||{}).create(),this.configDiff.diff(this.config||{})),this.zone.runOutsideAngular((function(){t.ro=new n((function(){t.update()})),t.elementRef.nativeElement.children[0]&&t.ro.observe(t.elementRef.nativeElement.children[0]),t.ro.observe(t.elementRef.nativeElement)})),this.zone.runOutsideAngular((function(){c.forEach((function(o){var s=o.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}));e.fromEvent(t.elementRef.nativeElement,s).pipe(i.auditTime(20),i.takeUntil(t.ngDestroy)).subscribe((function(e){t[o].emit(e)}))}))}))}},t.prototype.ngOnDestroy=function(){var t=this;s.isPlatformBrowser(this.platformId)&&(this.ngDestroy.next(),this.ngDestroy.complete(),this.ro&&this.ro.disconnect(),this.timeout&&"undefined"!=typeof window&&window.clearTimeout(this.timeout),this.zone.runOutsideAngular((function(){t.instance&&t.instance.destroy()})),this.instance=null)},t.prototype.ngDoCheck=function(){!this.disabled&&this.configDiff&&s.isPlatformBrowser(this.platformId)&&(this.configDiff.diff(this.config||{})&&(this.ngOnDestroy(),this.ngOnInit()))},t.prototype.ngOnChanges=function(t){t.disabled&&!t.disabled.isFirstChange()&&s.isPlatformBrowser(this.platformId)&&t.disabled.currentValue!==t.disabled.previousValue&&(!0===t.disabled.currentValue?this.ngOnDestroy():!1===t.disabled.currentValue&&this.ngOnInit())},t.prototype.ps=function(){return this.instance},t.prototype.update=function(){var t=this;"undefined"!=typeof window&&(this.timeout&&window.clearTimeout(this.timeout),this.timeout=window.setTimeout((function(){if(!t.disabled&&t.configDiff)try{t.zone.runOutsideAngular((function(){t.instance&&t.instance.update()}))}catch(t){}}),0))},t.prototype.geometry=function(t){return void 0===t&&(t="scroll"),new l(this.elementRef.nativeElement[t+"Left"],this.elementRef.nativeElement[t+"Top"],this.elementRef.nativeElement[t+"Width"],this.elementRef.nativeElement[t+"Height"])},t.prototype.position=function(t){return void 0===t&&(t=!1),!t&&this.instance?new p(this.instance.reach.x||0,this.instance.reach.y||0):new p(this.elementRef.nativeElement.scrollLeft,this.elementRef.nativeElement.scrollTop)},t.prototype.scrollable=function(t){void 0===t&&(t="any");var e=this.elementRef.nativeElement;return"any"===t?e.classList.contains("ps--active-x")||e.classList.contains("ps--active-y"):"both"===t?e.classList.contains("ps--active-x")&&e.classList.contains("ps--active-y"):e.classList.contains("ps--active-"+t)},t.prototype.scrollTo=function(t,e,i){this.disabled||(null==e&&null==i?this.animateScrolling("scrollTop",t,i):(null!=t&&this.animateScrolling("scrollLeft",t,i),null!=e&&this.animateScrolling("scrollTop",e,i)))},t.prototype.scrollToX=function(t,e){this.animateScrolling("scrollLeft",t,e)},t.prototype.scrollToY=function(t,e){this.animateScrolling("scrollTop",t,e)},t.prototype.scrollToTop=function(t,e){this.animateScrolling("scrollTop",t||0,e)},t.prototype.scrollToLeft=function(t,e){this.animateScrolling("scrollLeft",t||0,e)},t.prototype.scrollToRight=function(t,e){var i=this.elementRef.nativeElement.scrollWidth-this.elementRef.nativeElement.clientWidth;this.animateScrolling("scrollLeft",i-(t||0),e)},t.prototype.scrollToBottom=function(t,e){var i=this.elementRef.nativeElement.scrollHeight-this.elementRef.nativeElement.clientHeight;this.animateScrolling("scrollTop",i-(t||0),e)},t.prototype.scrollToElement=function(t,e,i){if("string"==typeof t&&(t=this.elementRef.nativeElement.querySelector(t)),t){var o=t.getBoundingClientRect(),s=this.elementRef.nativeElement.getBoundingClientRect();if(this.elementRef.nativeElement.classList.contains("ps--active-x")){var r=this.elementRef.nativeElement.scrollLeft,n=o.left-s.left+r;this.animateScrolling("scrollLeft",n+(e||0),i)}if(this.elementRef.nativeElement.classList.contains("ps--active-y")){r=this.elementRef.nativeElement.scrollTop,n=o.top-s.top+r;this.animateScrolling("scrollTop",n+(e||0),i)}}},t.prototype.animateScrolling=function(t,e,i){var o=this;if(this.animation&&(window.cancelAnimationFrame(this.animation),this.animation=null),i&&"undefined"!=typeof window){if(e!==this.elementRef.nativeElement[t]){var s=0,r=0,n=performance.now(),a=this.elementRef.nativeElement[t],l=(a-e)/2,p=function(c){r+=Math.PI/(i/(c-n)),s=Math.round(e+l+l*Math.cos(r)),o.elementRef.nativeElement[t]===a&&(r>=Math.PI?o.animateScrolling(t,e,0):(o.elementRef.nativeElement[t]=s,a=o.elementRef.nativeElement[t],n=c,o.animation=window.requestAnimationFrame(p)))};window.requestAnimationFrame(p)}}else this.elementRef.nativeElement[t]=e},t}();f.decorators=[{type:o.Directive,args:[{selector:"[perfectScrollbar]",exportAs:"ngxPerfectScrollbar"}]}],f.ctorParameters=function(){return[{type:o.NgZone},{type:o.KeyValueDiffers},{type:o.ElementRef},{type:Object,decorators:[{type:o.Inject,args:[o.PLATFORM_ID]}]},{type:void 0,decorators:[{type:o.Optional},{type:o.Inject,args:[a]}]}]},f.propDecorators={disabled:[{type:o.Input}],config:[{type:o.Input,args:["perfectScrollbar"]}],psScrollY:[{type:o.Output}],psScrollX:[{type:o.Output}],psScrollUp:[{type:o.Output}],psScrollDown:[{type:o.Output}],psScrollLeft:[{type:o.Output}],psScrollRight:[{type:o.Output}],psYReachEnd:[{type:o.Output}],psYReachStart:[{type:o.Output}],psXReachEnd:[{type:o.Output}],psXReachStart:[{type:o.Output}]};var u=function(){function t(t,i,s){this.zone=t,this.cdRef=i,this.platformId=s,this.states={},this.indicatorX=!1,this.indicatorY=!1,this.interaction=!1,this.scrollPositionX=0,this.scrollPositionY=0,this.scrollDirectionX=0,this.scrollDirectionY=0,this.usePropagationX=!1,this.usePropagationY=!1,this.allowPropagationX=!1,this.allowPropagationY=!1,this.stateTimeout=null,this.ngDestroy=new e.Subject,this.stateUpdate=new e.Subject,this.disabled=!1,this.usePSClass=!0,this.autoPropagation=!1,this.scrollIndicators=!1,this.psScrollY=new o.EventEmitter,this.psScrollX=new o.EventEmitter,this.psScrollUp=new o.EventEmitter,this.psScrollDown=new o.EventEmitter,this.psScrollLeft=new o.EventEmitter,this.psScrollRight=new o.EventEmitter,this.psYReachEnd=new o.EventEmitter,this.psYReachStart=new o.EventEmitter,this.psXReachEnd=new o.EventEmitter,this.psXReachStart=new o.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;s.isPlatformBrowser(this.platformId)&&(this.stateUpdate.pipe(i.takeUntil(this.ngDestroy),i.distinctUntilChanged((function(e,i){return e===i&&!t.stateTimeout}))).subscribe((function(e){t.stateTimeout&&"undefined"!=typeof window&&(window.clearTimeout(t.stateTimeout),t.stateTimeout=null),"x"===e||"y"===e?(t.interaction=!1,"x"===e?(t.indicatorX=!1,t.states.left=!1,t.states.right=!1,t.autoPropagation&&t.usePropagationX&&(t.allowPropagationX=!1)):"y"===e&&(t.indicatorY=!1,t.states.top=!1,t.states.bottom=!1,t.autoPropagation&&t.usePropagationY&&(t.allowPropagationY=!1))):("left"===e||"right"===e?(t.states.left=!1,t.states.right=!1,t.states[e]=!0,t.autoPropagation&&t.usePropagationX&&(t.indicatorX=!0)):"top"!==e&&"bottom"!==e||(t.states.top=!1,t.states.bottom=!1,t.states[e]=!0,t.autoPropagation&&t.usePropagationY&&(t.indicatorY=!0)),t.autoPropagation&&"undefined"!=typeof window&&(t.stateTimeout=window.setTimeout((function(){t.indicatorX=!1,t.indicatorY=!1,t.stateTimeout=null,t.interaction&&(t.states.left||t.states.right)&&(t.allowPropagationX=!0),t.interaction&&(t.states.top||t.states.bottom)&&(t.allowPropagationY=!0),t.cdRef.markForCheck()}),500))),t.cdRef.markForCheck(),t.cdRef.detectChanges()})),this.zone.runOutsideAngular((function(){if(t.directiveRef){var o=t.directiveRef.elementRef.nativeElement;e.fromEvent(o,"wheel").pipe(i.takeUntil(t.ngDestroy)).subscribe((function(e){if(!t.disabled&&t.autoPropagation){var i=e.deltaX,o=e.deltaY;t.checkPropagation(e,i,o)}})),e.fromEvent(o,"touchmove").pipe(i.takeUntil(t.ngDestroy)).subscribe((function(e){if(!t.disabled&&t.autoPropagation){var i=e.touches[0].clientX,o=e.touches[0].clientY,s=i-t.scrollPositionX,r=o-t.scrollPositionY;t.checkPropagation(e,s,r),t.scrollPositionX=i,t.scrollPositionY=o}})),e.merge(e.fromEvent(o,"ps-scroll-x").pipe(i.mapTo("x")),e.fromEvent(o,"ps-scroll-y").pipe(i.mapTo("y")),e.fromEvent(o,"ps-x-reach-end").pipe(i.mapTo("right")),e.fromEvent(o,"ps-y-reach-end").pipe(i.mapTo("bottom")),e.fromEvent(o,"ps-x-reach-start").pipe(i.mapTo("left")),e.fromEvent(o,"ps-y-reach-start").pipe(i.mapTo("top"))).pipe(i.takeUntil(t.ngDestroy)).subscribe((function(e){t.disabled||!t.autoPropagation&&!t.scrollIndicators||t.stateUpdate.next(e)}))}})),window.setTimeout((function(){c.forEach((function(e){t.directiveRef&&(t.directiveRef[e]=t[e])}))}),0))},t.prototype.ngOnDestroy=function(){s.isPlatformBrowser(this.platformId)&&(this.ngDestroy.next(),this.ngDestroy.unsubscribe(),this.stateTimeout&&"undefined"!=typeof window&&window.clearTimeout(this.stateTimeout))},t.prototype.ngDoCheck=function(){if(s.isPlatformBrowser(this.platformId)&&!this.disabled&&this.autoPropagation&&this.directiveRef){var t=this.directiveRef.elementRef.nativeElement;this.usePropagationX=t.classList.contains("ps--active-x"),this.usePropagationY=t.classList.contains("ps--active-y")}},t.prototype.checkPropagation=function(t,e,i){this.interaction=!0;var o=e<0?-1:1,s=i<0?-1:1;(this.usePropagationX&&this.usePropagationY||this.usePropagationX&&(!this.allowPropagationX||this.scrollDirectionX!==o)||this.usePropagationY&&(!this.allowPropagationY||this.scrollDirectionY!==s))&&(t.preventDefault(),t.stopPropagation()),e&&(this.scrollDirectionX=o),i&&(this.scrollDirectionY=s),this.stateUpdate.next("interaction"),this.cdRef.detectChanges()},t}();u.decorators=[{type:o.Component,args:[{selector:"perfect-scrollbar",exportAs:"ngxPerfectScrollbar",template:'