!function(t){"use strict";var s={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},e=s[Modernizr.prefixed("transition")],i={transitions:Modernizr.csstransitions};ABB.UIProgressButtonCircle=function(s,e){this.el=s,this.options=t.extend({},e),this._init()},ABB.UIProgressButtonCircle.prototype._init=function(){this.button=this.el.querySelector("button"),this.progressEl=new ABB.SVGEl(this.el.querySelector("svg.progress-circle")),this.successEl=new ABB.SVGEl(this.el.querySelector("svg.checkmark")),this.errorEl=new ABB.SVGEl(this.el.querySelector("svg.cross")),this._initEvents(),this._enable()},ABB.UIProgressButtonCircle.prototype._initEvents=function(){var t=this;this.button.addEventListener("click",function(){t._submit()})},ABB.UIProgressButtonCircle.prototype._submit=function(){t(this.el).addClass("loading");var s=this,n=function(t){i.transitions&&this.removeEventListener(e,n),this.setAttribute("disabled",""),"function"==typeof s.options.callback?s.options.callback(s):(s.setProgress(1),s.stop())};i.transitions?this.button.addEventListener(e,n):n()},ABB.UIProgressButtonCircle.prototype.stop=function(s){var e=this,i=function(){if(e.progressEl.draw(0),"number"==typeof s){var i=s>=0?"success":"error",n=s>=0?e.successEl:e.errorEl;n.draw(1),t(e.el).addClass(i),setTimeout(function(){t(e.el).removeClass(i),n.draw(0),e._enable()},e.options.statusTime)}else e._enable();t(e.el).removeClass("loading")};setTimeout(i,300)},ABB.UIProgressButtonCircle.prototype.setProgress=function(t){this.progressEl.draw(t)},ABB.UIProgressButtonCircle.prototype._enable=function(){this.button.removeAttribute("disabled")}}(jQuery);