!function(){"use strict";angular.module("toaster",[]).constant("toasterConfig",{limit:0,"tap-to-dismiss":!0,"close-button":!1,"close-html":'<button class="toast-close-button" type="button">×</button>',"newest-on-top":!0,"time-out":5e3,"icon-classes":{error:"toast-error",info:"toast-info",wait:"toast-wait",success:"toast-success",warning:"toast-warning"},"body-output-type":"","body-template":"toasterBodyTmpl.html","icon-class":"toast-info","position-class":"toast-top-right","title-class":"toast-title","message-class":"toast-message","prevent-duplicates":!1,"mouseover-timer-stop":!0}).service("toaster",["$rootScope","toasterConfig",function(t,e){functiono(t){returnfunction(e,o,s,i,n,a,r,c,l){angular.isString(e)?this.pop(t,e,o,s,i,n,a,r,c,l):this.pop(angular.extend(e,{type:t}))}}this.pop=function(e,o,s,i,n,a,r,c,l,u){if(angular.isObject(e)){vard=e;this.toast={type:d.type,title:d.title,body:d.body,timeout:d.timeout,bodyOutputType:d.bodyOutputType,clickHandler:d.clickHandler,showCloseButton:d.showCloseButton,closeHtml:d.closeHtml,uid:d.toastId,onHideCallback:d.onHideCallback,directiveData:d.directiveData},l=d.toastId,r=d.toasterId}elsethis.toast={type:e,title:o,body:s,timeout:i,bodyOutputType:n,clickHandler:a,showCloseButton:c,uid:l,onHideCallback:u};t.$emit("toaster-newToast",r,l)},this.clear=function(e,o){t.$emit("toaster-clearToasts",e,o)};for(varsine["icon-classes"])this[s]=o(s)}]).factory("toasterEventRegistry",["$rootScope",function(t){vare,o=null,s=null,i=[],n=[];returne={setup:function(){o||(o=t.$on("toaster-newToast",function(t,e,o){for(vars=0,n=i.length;n>s;s++)i[s](t,e,o)})),s||(s=t.$on("toaster-clearToasts",function(t,e,o){for(vars=0,i=n.length;i>s;s++)n[s](t,e,o)}))},subscribeToNewToastEvent:function(t){i.push(t)},subscribeToClearToastsEvent:function(t){n.push(t)},unsubscribeToNewToastEvent:function(t){vare=i.indexOf(t);e>=0&&i.splice(e,1),0===i.length&&(o(),o=null)},unsubscribeToClearToastsEvent:function(t){vare=n.indexOf(t);e>=0&&n.splice(e,1),0===n.length&&(s(),s=null)}},{setup:e.setup,subscribeToNewToastEvent:e.subscribeToNewToastEvent,subscribeToClearToastsEvent:e.subscribeToClearToastsEvent,unsubscribeToNewToastEvent:e.unsubscribeToNewToastEvent,unsubscribeToClearToastsEvent:e.unsubscribeToClearToastsEvent}}]).directive("directiveTemplate",["$compile","$injector",function(t,e){return{restrict:"A",scope:{directiveName:"@directiveName",directiveData:"@directiveData"},replace:!0,link:function(o,s,i){o.$watch("directiveName",function(n){if(angular.isUndefined(n)||n.length<=0)thrownewError("A valid directive name must be provided via the toast body argument when using bodyOutputType: directive");vara=e.has(i.$normalize(n)+"Directive");if(!a)thrownewError(n+" could not be found.");o.directiveData&&(o.directiveData=angular.fromJson(o.directiveData));varr=t("<div "+n+"></div>")(o);s.append(r)})}}}]).directive("toasterContainer",["$parse","$rootScope","$interval","$sce","toasterConfig","toaster","toasterEventRegistry",function(t,e,o,s,i,n,a){return{replace:!0,restrict:"EA",scope:!0,link:function(e,r,c){functionl(t,s){t.timeoutPromise=o(function(){e.removeToast(t.id)},s,1)}functionu(o,i){if(o.type=v["icon-classes"][o.type],o.type||(o.type=v["icon-class"]),v["prevent-duplicates"]===!0)if(p(i)){if(e.toasters.length>0&&e.toasters[e.toasters.length-1].body===o.body)return}else{varn,a;for(n=0,a=e.toasters.length;a>n;n++)e.toasters[n].uid===i&&(d(n),n--,a=e.toasters.length)}o.id=++f,p(i)||(o.uid=i);varr=v["close-button"];if("boolean"==typeofo.showCloseButton);elseif("boolean"==typeofr)o.showCloseButton=r;elseif("object"==typeofr){varc=r[o.type];"undefined"!=typeofc&&null!==c&&(o.showCloseButton=c)}elseo.showCloseButton=!1;switch(o.showCloseButton&&(o.closeHtml=s.trustAsHtml(o.closeHtml||e.config.closeHtml)),o.bodyOutputType=o.bodyOutputType||v["body-output-type"],o.bodyOutputType){case"trustedHtml":o.html=s.trustAsHtml(o.body);break;case"template":o.bodyTemplate=o.body||v["body-template"];break;case"templateWithData":varl=t(o.body||v["body-template"]),u=l(e);o.bodyTemplate=u.template,