!function(){"use strict";var a=angular.module("ngNotify",[]);a.run(["$templateCache",function(a){a.put("templates/ng-notify/ngNotify.html",'
×
')}]),a.provider("ngNotify",function(){this.$get=["$document","$compile","$rootScope","$timeout","$interval","$templateCache",function(a,b,c,d,e,f){var g,h,i={theme:"pure",position:"bottom",duration:3e3,type:"info",sticky:!1},j={pure:"",prime:"ngn-prime",pastel:"ngn-pastel",pitchy:"ngn-pitchy"},k={infoClass:"ngn-info",errorClass:"ngn-error",successClass:"ngn-success",warnClass:"ngn-warn",grimaceClass:"ngn-grimace"},l={bottom:"ngn-bottom",top:"ngn-top"},m=c.$new(),n=b(f.get("templates/ng-notify/ngNotify.html"))(m);a.find("body").append(n);var o=function(a){var b=(a||i.type)+"Class";return k[b]||k.infoClass},p=function(a){var b=a||i.theme;return j[b]||j.pure},q=function(a){var b=a||i.position;return l[b]||l.bottom},r=function(a){var b=a||i.duration;return angular.isNumber(b)?b:3500},s=function(a){var b=a||i.sticky;return b?!0:!1},t=function(){m.ngNotify={notifyClass:"",notifyMessage:""}},u=function(a){return new u.fn(a)};u.fn=function(a){this.el=a},u.fn.prototype._fade=function(a,b,c,d){var f=25,g=f/c,i=this.el;i.css("opacity",b);var j=function(){b+=a*g,i.css("filter","progid:DXImageTransform.Microsoft.Alpha(Opacity="+100*b+")"),i.css("opacity",b),(0>=b||b>=1)&&(e.cancel(h),0>=b&&i.css("display","none"),d&&d())};h=e(j,f)},u.fn.prototype.fadeIn=function(a,b){this.el.css("filter","progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"),this.el.css("display","block"),this._fade(1,0,a,b)},u.fn.prototype.fadeOut=function(a,b){this._fade(-1,1,a,b)},m.dismiss=function(){v.fadeOut(500,function(){t()})};var v=u(n);return{config:function(a){a=a||{},angular.extend(i,a)},set:function(a,b){if(a){e.cancel(h),d.cancel(g);var c={};"object"==typeof b?c={type:b.type||void 0,theme:b.theme||void 0,position:b.position||void 0,duration:b.duration||void 0,sticky:b.sticky||void 0}:c.type=b;var f=s(c.sticky),i=r(c.duration),j=o(c.type)+" "+p(c.theme)+" "+q(c.position);j+=f?" ngn-sticky":"",m.ngNotify={notifyClass:j,notifyMessage:a},v.fadeIn(200,function(){f||(g=d(function(){m.dismiss()},i))})}},dismiss:function(){m.dismiss()},addTheme:function(a,b){a&&b&&(j[a]=b)},addType:function(a,b){a&&b&&(k[a+"Class"]=b)}}}]})}();