UNPKG

ngx-toastr-egit-fix

Version:
16 lines (14 loc) 24.7 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/animations"),require("rxjs"),require("@angular/platform-browser"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-toastr-egit-fix",["exports","@angular/core","@angular/animations","rxjs","@angular/platform-browser","@angular/common"],e):e((t=t||self)["ngx-toastr-egit-fix"]={},t.ng.core,t.ng.animations,t.rxjs,t.ng.platformBrowser,t.ng.common)}(this,(function(t,e,i,o,n,s){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var a=function(){return(a=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function u(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}function c(t,e){return function(i,o){e(i,o,t)}}function l(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}var p=function(){function t(t){this.el=t}return t.prototype.getContainerElement=function(){return this.el.nativeElement},t.ctorParameters=function(){return[{type:e.ElementRef}]},t=u([e.Directive({selector:"[toastContainer]",exportAs:"toastContainer"})],t)}(),h=function(){function t(){}return t=u([e.NgModule({declarations:[p],exports:[p]})],t)}(),d=function(){function t(t,e,i,n,s,r){var a=this;this.toastId=t,this.config=e,this.message=i,this.title=n,this.toastType=s,this.toastRef=r,this._onTap=new o.Subject,this._onAction=new o.Subject,this.toastRef.afterClosed().subscribe((function(){a._onAction.complete(),a._onTap.complete()}))}return t.prototype.triggerTap=function(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()},t.prototype.onTap=function(){return this._onTap.asObservable()},t.prototype.triggerAction=function(t){this._onAction.next(t)},t.prototype.onAction=function(){return this._onAction.asObservable()},t}(),f={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},m=new e.InjectionToken("ToastConfig"),v=function(){function t(t,e){this.component=t,this.injector=e}return t.prototype.attach=function(t,e){return this._attachedHost=t,t.attach(this,e)},t.prototype.detach=function(){var t=this._attachedHost;if(t)return this._attachedHost=void 0,t.detach()},Object.defineProperty(t.prototype,"isAttached",{get:function(){return null!=this._attachedHost},enumerable:!0,configurable:!0}),t.prototype.setAttachedHost=function(t){this._attachedHost=t},t}(),g=function(){function t(){}return t.prototype.attach=function(t,e){return this._attachedPortal=t,this.attachComponentPortal(t,e)},t.prototype.detach=function(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)},t.prototype.setDisposeFn=function(t){this._disposeFn=t},t}(),y=function(t){function e(e,i,o){var n=t.call(this)||this;return n._hostDomElement=e,n._componentFactoryResolver=i,n._appRef=o,n}return function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.attachComponentPortal=function(t,e){var i,o=this,n=this._componentFactoryResolver.resolveComponentFactory(t.component);return i=n.create(t.injector),this._appRef.attachView(i.hostView),this.setDisposeFn((function(){o._appRef.detachView(i.hostView),i.destroy()})),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i},e.prototype._getComponentRootNode=function(t){return t.hostView.rootNodes[0]},e}(g),T=function(){function t(t){this._document=t}return t.prototype.ngOnDestroy=function(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)},t.prototype.getContainerElement=function(){return this._containerElement||this._createContainer(),this._containerElement},t.prototype._createContainer=function(){var t=this._document.createElement("div");t.classList.add("overlay-container"),this._document.body.appendChild(t),this._containerElement=t},t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[s.DOCUMENT]}]}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(s.DOCUMENT))},token:t,providedIn:"root"}),t=u([e.Injectable({providedIn:"root"}),c(0,e.Inject(s.DOCUMENT))],t)}(),b=function(){function t(t){this._portalHost=t}return t.prototype.attach=function(t,e){return void 0===e&&(e=!0),this._portalHost.attach(t,e)},t.prototype.detach=function(){return this._portalHost.detach()},t}(),C=function(){function t(t,e,i,o){this._overlayContainer=t,this._componentFactoryResolver=e,this._appRef=i,this._document=o,this._paneElements=new Map}return t.prototype.create=function(t,e){return this._createOverlayRef(this.getPaneElement(t,e))},t.prototype.getPaneElement=function(t,e){return void 0===t&&(t=""),this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]},t.prototype._createPaneElement=function(t,e){var i=this._document.createElement("div");return i.id="toast-container",i.classList.add(t),i.classList.add("toast-container"),e?e.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i},t.prototype._createPortalHost=function(t){return new y(t,this._componentFactoryResolver,this._appRef)},t.prototype._createOverlayRef=function(t){return new b(this._createPortalHost(t))},t.ctorParameters=function(){return[{type:T},{type:e.ComponentFactoryResolver},{type:e.ApplicationRef},{type:void 0,decorators:[{type:e.Inject,args:[s.DOCUMENT]}]}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(T),e.ɵɵinject(e.ComponentFactoryResolver),e.ɵɵinject(e.ApplicationRef),e.ɵɵinject(s.DOCUMENT))},token:t,providedIn:"root"}),t=u([e.Injectable({providedIn:"root"}),c(3,e.Inject(s.DOCUMENT))],t)}(),_=function(){function t(t){this._overlayRef=t,this.duplicatesCount=0,this._afterClosed=new o.Subject,this._activate=new o.Subject,this._manualClose=new o.Subject,this._resetTimeout=new o.Subject,this._countDuplicate=new o.Subject}return t.prototype.manualClose=function(){this._manualClose.next(),this._manualClose.complete()},t.prototype.manualClosed=function(){return this._manualClose.asObservable()},t.prototype.timeoutReset=function(){return this._resetTimeout.asObservable()},t.prototype.countDuplicate=function(){return this._countDuplicate.asObservable()},t.prototype.close=function(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()},t.prototype.afterClosed=function(){return this._afterClosed.asObservable()},t.prototype.isInactive=function(){return this._activate.isStopped},t.prototype.activate=function(){this._activate.next(),this._activate.complete()},t.prototype.afterActivate=function(){return this._activate.asObservable()},t.prototype.onDuplicate=function(t,e){t&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)},t}(),O=function(){function t(t,e){this._toastPackage=t,this._parentInjector=e}return t.prototype.get=function(t,e,i){return t===d?this._toastPackage:this._parentInjector.get(t,e,i)},t}(),I=function(){function t(t,e,i,o,n){this.overlay=e,this._injector=i,this.sanitizer=o,this.ngZone=n,this.currentlyActive=0,this.toasts=[],this.index=0,this.toastrConfig=a({},t.default,t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=a({},t.default.iconClasses,t.config.iconClasses))}return t.prototype.show=function(t,e,i,o){return void 0===i&&(i={}),void 0===o&&(o=""),this._preBuildNotification(o,t,e,this.applyConfig(i))},t.prototype.success=function(t,e,i){void 0===i&&(i={});var o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,t,e,this.applyConfig(i))},t.prototype.error=function(t,e,i){void 0===i&&(i={});var o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,t,e,this.applyConfig(i))},t.prototype.info=function(t,e,i){void 0===i&&(i={});var o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,t,e,this.applyConfig(i))},t.prototype.warning=function(t,e,i){void 0===i&&(i={});var o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,t,e,this.applyConfig(i))},t.prototype.clear=function(t){var e,i;try{for(var o=l(this.toasts),n=o.next();!n.done;n=o.next()){var s=n.value;if(void 0!==t){if(s.toastId===t)return void s.toastRef.manualClose()}else s.toastRef.manualClose()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}},t.prototype.remove=function(t){var e=this._findToast(t);if(!e)return!1;if(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length)return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){var i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0},t.prototype.findDuplicate=function(t,e,i){var o,n;try{for(var s=l(this.toasts),r=s.next();!r.done;r=s.next()){var a=r.value;if(a.message===t)return a.toastRef.onDuplicate(e,i),a}}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return null},t.prototype.applyConfig=function(t){return void 0===t&&(t={}),a({},this.toastrConfig,t)},t.prototype._findToast=function(t){for(var e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null},t.prototype._preBuildNotification=function(t,e,i,o){var n=this;return o.onActivateTick?this.ngZone.run((function(){return n._buildNotification(t,e,i,o)})):this._buildNotification(t,e,i,o)},t.prototype._buildNotification=function(t,i,o,n){var s=this;if(!n.toastComponent)throw new Error("toastComponent required");var r=this.findDuplicate(i,this.toastrConfig.resetTimeoutOnDuplicate&&n.timeOut>0,this.toastrConfig.countDuplicates);if(i&&this.toastrConfig.preventDuplicates&&null!==r)return r;this.previousToastMessage=i;var a=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(a=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));var u=this.overlay.create(n.positionClass,this.overlayContainer);this.index=this.index+1;var c=i;i&&n.enableHtml&&(c=this.sanitizer.sanitize(e.SecurityContext.HTML,i));var l=new _(u),p=new d(this.index,n,c,o,t,l),h=new O(p,this._injector),f=new v(n.toastComponent,h),m=u.attach(f,this.toastrConfig.newestOnTop);l.componentInstance=m._component;var g={toastId:this.index,message:i||"",toastRef:l,onShown:l.afterActivate(),onHidden:l.afterClosed(),onTap:p.onTap(),onAction:p.onAction(),portal:m};return a||setTimeout((function(){g.toastRef.activate(),s.currentlyActive=s.currentlyActive+1})),this.toasts.push(g),g},t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[m]}]},{type:C},{type:e.Injector},{type:n.DomSanitizer},{type:e.NgZone}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(m),e.ɵɵinject(C),e.ɵɵinject(e.INJECTOR),e.ɵɵinject(n.DomSanitizer),e.ɵɵinject(e.NgZone))},token:t,providedIn:"root"}),t=u([e.Injectable({providedIn:"root"}),c(0,e.Inject(m))],t)}(),w=function(){function t(t,e,i){var o=this;this.toastrService=t,this.toastPackage=e,this.ngZone=i,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=e.toastType+" "+e.config.toastClass,this.sub=e.toastRef.afterActivate().subscribe((function(){o.activateToast()})),this.sub1=e.toastRef.manualClosed().subscribe((function(){o.remove()})),this.sub2=e.toastRef.timeoutReset().subscribe((function(){o.resetTimeout()})),this.sub3=e.toastRef.countDuplicate().subscribe((function(t){o.duplicatesCount=t}))}return Object.defineProperty(t.prototype,"displayStyle",{get:function(){if("inactive"===this.state.value)return"none"},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)},t.prototype.activateToast=function(){var t=this;this.state=a({},this.state,{value:"active"}),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout((function(){return t.remove()}),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval((function(){return t.updateProgress()}),10))},t.prototype.updateProgress=function(){if(0!==this.width&&100!==this.width&&this.options.timeOut){var t=(new Date).getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}},t.prototype.resetTimeout=function(){var t=this;clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=a({},this.state,{value:"active"}),this.outsideTimeout((function(){return t.remove()}),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval((function(){return t.updateProgress()}),10)},t.prototype.remove=function(){var t=this;"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=a({},this.state,{value:"removed"}),this.outsideTimeout((function(){return t.toastrService.remove(t.toastPackage.toastId)}),+this.toastPackage.config.easeTime))},t.prototype.tapToast=function(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())},t.prototype.stickAround=function(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)},t.prototype.delayedHideToast=function(){var t=this;!0!==this.options.disableTimeOut&&"extendedTimeOut"!==this.options.disableTimeOut&&0!==this.options.extendedTimeOut&&"removed"!==this.state.value&&(this.outsideTimeout((function(){return t.remove()}),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval((function(){return t.updateProgress()}),10))},t.prototype.outsideTimeout=function(t,e){var i=this;this.ngZone?this.ngZone.runOutsideAngular((function(){return i.timeout=setTimeout((function(){return i.runInsideAngular(t)}),e)})):this.timeout=setTimeout((function(){return t()}),e)},t.prototype.outsideInterval=function(t,e){var i=this;this.ngZone?this.ngZone.runOutsideAngular((function(){return i.intervalId=setInterval((function(){return i.runInsideAngular(t)}),e)})):this.intervalId=setInterval((function(){return t()}),e)},t.prototype.runInsideAngular=function(t){this.ngZone?this.ngZone.run((function(){return t()})):t()},t.ctorParameters=function(){return[{type:I},{type:d},{type:e.NgZone}]},u([e.HostBinding("class")],t.prototype,"toastClasses",void 0),u([e.HostBinding("@flyInOut")],t.prototype,"state",void 0),u([e.HostBinding("style.display")],t.prototype,"displayStyle",null),u([e.HostListener("click")],t.prototype,"tapToast",null),u([e.HostListener("mouseenter")],t.prototype,"stickAround",null),u([e.HostListener("mouseleave")],t.prototype,"delayedHideToast",null),t=u([e.Component({selector:"[toast-component]",template:'\n <button *ngIf="options.closeButton" (click)="remove()" class="toast-close-button" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>\n <div *ngIf="title" [class]="options.titleClass" [attr.aria-label]="title">\n {{ title }} <ng-container *ngIf="duplicatesCount">[{{ duplicatesCount + 1 }}]</ng-container>\n </div>\n <div *ngIf="message && options.enableHtml" role="alertdialog" aria-live="polite"\n [class]="options.messageClass" [innerHTML]="message">\n </div>\n <div *ngIf="message && !options.enableHtml" role="alertdialog" aria-live="polite"\n [class]="options.messageClass" [attr.aria-label]="message">\n {{ message }}\n </div>\n <div *ngIf="options.progressBar">\n <div class="toast-progress" [style.width]="width + \'%\'"></div>\n </div>\n ',animations:[i.trigger("flyInOut",[i.state("inactive",i.style({opacity:0})),i.state("active",i.style({opacity:1})),i.state("removed",i.style({opacity:0})),i.transition("inactive => active",i.animate("{{ easeTime }}ms {{ easing }}")),i.transition("active => removed",i.animate("{{ easeTime }}ms {{ easing }}"))])],preserveWhitespaces:!1})],t)}(),D=a({},f,{toastComponent:w}),j=function(){function t(){}var i;return i=t,t.forRoot=function(t){return void 0===t&&(t={}),{ngModule:i,providers:[{provide:m,useValue:{default:D,config:t}}]}},t=i=u([e.NgModule({imports:[s.CommonModule],declarations:[w],exports:[w],entryComponents:[w]})],t)}(),R=function(){function t(){}return t.forRoot=function(t){return void 0===t&&(t={}),{ngModule:j,providers:[{provide:m,useValue:{default:f,config:t}}]}},t=u([e.NgModule({imports:[s.CommonModule]})],t)}(),x=function(){function t(t,e,i){var o=this;this.toastrService=t,this.toastPackage=e,this.appRef=i,this.width=-1,this.toastClasses="",this.state="inactive",this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=e.toastType+" "+e.config.toastClass,this.sub=e.toastRef.afterActivate().subscribe((function(){o.activateToast()})),this.sub1=e.toastRef.manualClosed().subscribe((function(){o.remove()})),this.sub2=e.toastRef.timeoutReset().subscribe((function(){o.resetTimeout()})),this.sub3=e.toastRef.countDuplicate().subscribe((function(t){o.duplicatesCount=t}))}return Object.defineProperty(t.prototype,"displayStyle",{get:function(){if("inactive"===this.state)return"none"},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)},t.prototype.activateToast=function(){var t=this;this.state="active",!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.timeout=setTimeout((function(){t.remove()}),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval((function(){return t.updateProgress()}),10))),this.options.onActivateTick&&this.appRef.tick()},t.prototype.updateProgress=function(){if(0!==this.width&&100!==this.width&&this.options.timeOut){var t=(new Date).getTime(),e=this.hideTime-t;this.width=e/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}},t.prototype.resetTimeout=function(){var t=this;clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout((function(){return t.remove()}),this.originalTimeout),this.hideTime=(new Date).getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval((function(){return t.updateProgress()}),10))},t.prototype.remove=function(){var t=this;"removed"!==this.state&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout((function(){return t.toastrService.remove(t.toastPackage.toastId)})))},t.prototype.tapToast=function(){"removed"!==this.state&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())},t.prototype.stickAround=function(){"removed"!==this.state&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)},t.prototype.delayedHideToast=function(){var t=this;!0!==this.options.disableTimeOut&&"extendedTimeOut"!==this.options.disableTimeOut&&0!==this.options.extendedTimeOut&&"removed"!==this.state&&(this.timeout=setTimeout((function(){return t.remove()}),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval((function(){return t.updateProgress()}),10)))},t.ctorParameters=function(){return[{type:I},{type:d},{type:e.ApplicationRef}]},u([e.HostBinding("class")],t.prototype,"toastClasses",void 0),u([e.HostBinding("style.display")],t.prototype,"displayStyle",null),u([e.HostListener("click")],t.prototype,"tapToast",null),u([e.HostListener("mouseenter")],t.prototype,"stickAround",null),u([e.HostListener("mouseleave")],t.prototype,"delayedHideToast",null),t=u([e.Component({selector:"[toast-component]",template:'\n <button *ngIf="options.closeButton" (click)="remove()" class="toast-close-button" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>\n <div *ngIf="title" [class]="options.titleClass" [attr.aria-label]="title">\n {{ title }} <ng-container *ngIf="duplicatesCount">[{{ duplicatesCount + 1 }}]</ng-container>\n </div>\n <div *ngIf="message && options.enableHtml" role="alert" aria-live="polite"\n [class]="options.messageClass" [innerHTML]="message">\n </div>\n <div *ngIf="message && !options.enableHtml" role="alert" aria-live="polite"\n [class]="options.messageClass" [attr.aria-label]="message">\n {{ message }}\n </div>\n <div *ngIf="options.progressBar">\n <div class="toast-progress" [style.width]="width + \'%\'"></div>\n </div>\n '})],t)}(),A=a({},f,{toastComponent:x}),P=function(){function t(){}var i;return i=t,t.forRoot=function(t){return void 0===t&&(t={}),{ngModule:i,providers:[{provide:m,useValue:{default:A,config:t}}]}},t=i=u([e.NgModule({imports:[s.CommonModule],declarations:[x],exports:[x],entryComponents:[x]})],t)}();t.BasePortalHost=g,t.ComponentPortal=v,t.DefaultGlobalConfig=D,t.DefaultNoAnimationsGlobalConfig=A,t.DefaultNoComponentGlobalConfig=f,t.Overlay=C,t.OverlayContainer=T,t.OverlayRef=b,t.TOAST_CONFIG=m,t.Toast=w,t.ToastContainerDirective=p,t.ToastContainerModule=h,t.ToastInjector=O,t.ToastNoAnimation=x,t.ToastNoAnimationModule=P,t.ToastPackage=d,t.ToastRef=_,t.ToastrComponentlessModule=R,t.ToastrModule=j,t.ToastrService=I,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=ngx-toastr-egit-fix.umd.min.js.map