(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.ProgressBar=a()}})(function(){var a;return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;cq?q:g,r=n-(q-l);l>=q?(o(c,j,r),b.stop(!0)):(b._applyFilter("beforeTween"),l(a/=.5)?.5*Math.pow(a,2):-.5*((a-=2)*a-2)},o=function(a){return Math.pow(a,3)},a=function(a){return Math.pow(a-1,3)+1},c=function(a){return 1>(a/=.5)?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},f=function(a){return Math.pow(a,4)},s=function(a){return-(Math.pow(a-1,4)-1)},l=function(a){return 1>(a/=.5)?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},h=function(a){return Math.pow(a,5)},p=function(a){return Math.pow(a-1,5)+1},d=function(a){return 1>(a/=.5)?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},v=function(a){return 1-Math.cos(a*(Math.PI/2))},y=function(a){return Math.sin(a*(Math.PI/2))},B=function(a){return-.5*(Math.cos(Math.PI*a)-1)},m=function(a){return 0===a?0:Math.pow(2,10*(a-1))},g=function(a){return 1===a?1:1-Math.pow(2,-10*a)},b=function(a){return 0===a?0:1===a?1:1>(a/=.5)?.5*Math.pow(2,10*(a-1)):.5*(2-Math.pow(2,-10*--a))},w=function(a){return-(Math.sqrt(1-a*a)-1)},G=function(a){return Math.sqrt(1-Math.pow(a-1,2))},H=function(a){return 1>(a/=.5)?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},j=function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},J=function(a){var b=1.70158;return a*a*((b+1)*a-b)},k=function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},K=function(a){var b=1.70158;return 1>(a/=.5)?.5*(a*a*((1+(b*=1.525))*a-b)):.5*((a-=2)*a*((1+(b*=1.525))*a+b)+2)},x=function(a){return-1*Math.pow(4,-8*a)*Math.sin((6*a-1)*(2*Math.PI)/2)+1},L=function(a){var b=1.70158;return 1>(a/=.5)?.5*(a*a*((1+(b*=1.525))*a-b)):.5*((a-=2)*a*((1+(b*=1.525))*a+b)+2)},E=function(a){var b=1.70158;return a*a*((b+1)*a-b)},F=function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},A=function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},I=function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?2-(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},C=function(a){return 1>(a/=.5)?.5*Math.pow(a,4):-.5*((a-=2)*Math.pow(a,3)-2)},D=function(a){return Math.pow(a,4)},q=function(a){return Math.pow(a,.25)}},function(a,b){var c;c=function(){return this}();try{c=c||new Function("return this")()}catch(a){"object"==typeof window&&(c=window)}a.exports=c},function(H,t,n){"use strict";function e(a){return parseInt(a,16)}function d(a){var b=a._currentState;[b,a._originalState,a._targetState].forEach(y),a._tokenData=g(b)}function J(a){var c=a._currentState,d=a._originalState,e=a._targetState,f=a._easing,g=a._tokenData;M(f,g),[c,d,e].forEach(function(a){return b(a,g)})}function E(a){var b=a._currentState,c=a._originalState,d=a._targetState,e=a._easing,f=a._tokenData;[b,c,d].forEach(function(a){return j(a,f)}),k(e,f)}function F(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function A(a){for(var b,c=1;cl;l++){if(j=A(h)-b,v(j)v(k))break;h-=j/k}if((h=b)<(f=0))return f;if(h>(g=1))return g;for(;fj?f=h:g=h,h=.5*(g-f)+f}return h}(m,n))}n.r(t);var R={};n.r(R),n.d(R,"doesApply",function(){return P}),n.d(R,"tweenCreated",function(){return d}),n.d(R,"beforeTween",function(){return J}),n.d(R,"afterTween",function(){return E});var r,T,U=n(0),o=/(\d|-|\.)/,a=/([^\-0-9.]+)/g,c=/[0-9.-]+/g,f=(r=c.source,T=/,\s*/.source,new RegExp("rgb\\(".concat(r).concat(T).concat(r).concat(T).concat(r,"\\)"),"g")),s=/^.*\(/,l=/#([0-9]|[a-f]){3,6}/gi,h=function(a,b){return a.map(function(a,c){return"_".concat(b,"_").concat(c)})},p=function(a){return"rgb(".concat((b=a,3===(b=b.replace(/#/,"")).length&&(b=(b=b.split(""))[0]+b[0]+b[1]+b[1]+b[2]+b[2]),[e(b.substr(0,2)),e(b.substr(2,2)),e(b.substr(4,2))]).join(","),")");var b},v=function(a,b,c){var d=b.match(a),e=b.replace(a,"VAL");return d&&d.forEach(function(a){return e=e.replace("VAL",c(a))}),e},y=function(a){for(var b in a){var c=a[b];"string"==typeof c&&c.match(l)&&(a[b]=v(l,c,p))}},V=function(a){var b=a.match(c).map(Math.floor),d=a.match(s)[0];return"".concat(d).concat(b.join(","),")")},m=function(a){return a.match(c)},g=function(b){var c,d,f={};for(var g in b){var j=b[g];"string"==typeof j&&(f[g]={formatString:(c=j,d=void 0,d=c.match(a),d?(1===d.length||c.charAt(0).match(o))&&d.unshift(""):d=["",""],d.join("VAL")),chunkNames:h(m(j),g)})}return f},b=function(a,b){var c=function(c){m(a[c]).forEach(function(d,e){return a[b[c].chunkNames[e]]=+d}),delete a[c]};for(var d in b)c(d)},w=function(a,b){var c={};return b.forEach(function(b){c[b]=a[b],delete a[b]}),c},O=function(a,b){return b.map(function(b){return a[b]})},S=function(a,b){return b.forEach(function(b){return a=a.replace("VAL",+b.toFixed(4))}),a},j=function(a,b){for(var c in b){var d=b[c],g=d.chunkNames,h=d.formatString,j=S(h,O(w(a,g),g));a[c]=v(f,j,V)}},M=function(a,b){var c=function(c){var d=b[c].chunkNames,e=a[c];if("string"==typeof e){var f=e.split(" "),g=f[f.length-1];d.forEach(function(b,c){return a[b]=f[c]||g})}else d.forEach(function(b){return a[b]=e});delete a[c]};for(var d in b)c(d)},k=function(a,b){for(var c in b){var d=b[c].chunkNames,f=a[d[0]];a[c]="string"==typeof f?d.map(function(b){var c=a[b];return delete a[b],c}).join(" "):f}},P=function(a){var b=a._currentState;return Object.keys(b).some(function(a){return"string"==typeof b[a]})},x=new U.a,D=U.a.filters,q=function(b,d,g,e){var h=4a.strokeWidth&&(c=a.trailWidth);var d=50-c/2;return e.render(this._pathTemplate,{radius:d,"2radius":2*d})},f.prototype._trailString=function b(a){return this._pathString(a)},b.exports=f},{"./shape":7,"./utils":9}],3:[function(a,b,c){var d=a("./shape"),e=a("./utils"),f=function c(a,b){this._pathTemplate=b.vertical?"M {center},100 L {center},0":"M 0,{center} L 100,{center}",d.apply(this,arguments)};f.prototype=new d,f.prototype.constructor=f,f.prototype._initializeSvg=function c(a,b){var d=b.vertical?"0 0 "+b.strokeWidth+" 100":"0 0 100 "+b.strokeWidth;a.setAttribute("viewBox",d),a.setAttribute("preserveAspectRatio","none")},f.prototype._pathString=function b(a){return e.render(this._pathTemplate,{center:a.strokeWidth/2})},f.prototype._trailString=function b(a){return this._pathString(a)},b.exports=f},{"./shape":7,"./utils":9}],4:[function(a,b,c){b.exports={Line:a("./line"),Circle:a("./circle"),SemiCircle:a("./semicircle"),Square:a("./square"),Path:a("./path"),Shape:a("./shape"),utils:a("./utils")}},{"./circle":2,"./line":3,"./path":5,"./semicircle":6,"./shape":7,"./square":8,"./utils":9}],5:[function(a,b,c){var d=a("shifty"),e=a("./utils"),f=d.Tweenable,g={easeIn:"easeInCubic",easeOut:"easeOutCubic",easeInOut:"easeInOutCubic"},h=function c(a,b){if(!(this instanceof c))throw new Error("Constructor was called without new keyword");b=e.extend({delay:0,duration:800,easing:"linear",from:{},to:{},step:function(){}},b);var d;d=e.isString(a)?document.querySelector(a):a,this.path=d,this._opts=b,this._tweenable=null;var f=this.path.getTotalLength();this.path.style.strokeDasharray=f+" "+f,this.set(0)};h.prototype.value=function a(){var b=this._getComputedDashOffset(),c=this.path.getTotalLength(),d=1-b/c;return parseFloat(d.toFixed(6),10)},h.prototype.set=function b(a){this.stop(),this.path.style.strokeDashoffset=this._progressToOffset(a);var c=this._opts.step;if(e.isFunction(c)){var d=this._easing(this._opts.easing),f=this._calculateTo(a,d),g=this._opts.shape||this;c(f,g,this._opts.attachment)}},h.prototype.stop=function a(){this._stopTween(),this.path.style.strokeDashoffset=this._getComputedDashOffset()},h.prototype.animate=function d(a,b,c){b=b||{},e.isFunction(b)&&(c=b,b={});var g=e.extend({},b),h=e.extend({},this._opts);b=e.extend(h,b);var i=this._easing(b.easing),j=this._resolveFromAndTo(a,i,g);this.stop(),this.path.getBoundingClientRect();var k=this._getComputedDashOffset(),l=this._progressToOffset(a),m=this;this._tweenable=new f,this._tweenable.tween({from:e.extend({offset:k},j.from),to:e.extend({offset:l},j.to),duration:b.duration,delay:b.delay,easing:i,step:function(a){m.path.style.strokeDashoffset=a.offset;var c=b.shape||m;b.step(a,c,b.attachment)}}).then(function(a){e.isFunction(c)&&c()}).catch(function(a){throw console.error("Error in tweening:",a),a})},h.prototype._getComputedDashOffset=function a(){var b=window.getComputedStyle(this.path,null);return parseFloat(b.getPropertyValue("stroke-dashoffset"),10)},h.prototype._progressToOffset=function b(a){var c=this.path.getTotalLength();return c-a*c},h.prototype._resolveFromAndTo=function d(a,b,c){return c.from&&c.to?{from:c.from,to:c.to}:{from:this._calculateFrom(b),to:this._calculateTo(a,b)}},h.prototype._calculateFrom=function b(a){return d.interpolate(this._opts.from,this._opts.to,this.value(),a)},h.prototype._calculateTo=function c(a,b){return d.interpolate(this._opts.from,this._opts.to,a,b)},h.prototype._stopTween=function a(){null!==this._tweenable&&(this._tweenable.stop(!0),this._tweenable=null)},h.prototype._easing=function b(a){return g.hasOwnProperty(a)?g[a]:a},b.exports=h},{"./utils":9,shifty:1}],6:[function(a,b,c){var d=a("./shape"),e=a("./circle"),f=a("./utils"),g=function c(a,b){this._pathTemplate="M 50,50 m -{radius},0 a {radius},{radius} 0 1 1 {2radius},0",this.containerAspectRatio=2,d.apply(this,arguments)};g.prototype=new d,g.prototype.constructor=g,g.prototype._initializeSvg=function c(a,b){a.setAttribute("viewBox","0 0 100 50")},g.prototype._initializeTextContainer=function d(a,b,c){a.text.style&&(c.style.top="auto",c.style.bottom="0",a.text.alignToBottom?f.setStyle(c,"transform","translate(-50%, 0)"):f.setStyle(c,"transform","translate(-50%, 50%)"))},g.prototype._pathString=e.prototype._pathString,g.prototype._trailString=e.prototype._trailString,b.exports=g},{"./circle":2,"./shape":7,"./utils":9}],7:[function(a,b,c){var d=a("./path"),e=a("./utils"),f="Object is destroyed",g=function c(a,b){if(!(this instanceof c))throw new Error("Constructor was called without new keyword");if(0!==arguments.length){this._opts=e.extend({color:"#555",strokeWidth:1,trailColor:null,trailWidth:null,fill:null,text:{style:{color:null,position:"absolute",left:"50%",top:"50%",padding:0,margin:0,transform:{prefix:!0,value:"translate(-50%, -50%)"}},autoStyleContainer:!0,alignToBottom:!0,value:null,className:"progressbar-text"},svgStyle:{display:"block",width:"100%"},warnings:!1},b,!0),e.isObject(b)&&void 0!==b.svgStyle&&(this._opts.svgStyle=b.svgStyle),e.isObject(b)&&e.isObject(b.text)&&void 0!==b.text.style&&(this._opts.text.style=b.text.style);var f,g=this._createSvgView(this._opts);if(f=e.isString(a)?document.querySelector(a):a,!f)throw new Error("Container does not exist: "+a);this._container=f,this._container.appendChild(g.svg),this._opts.warnings&&this._warnContainerAspectRatio(this._container),this._opts.svgStyle&&e.setStyles(g.svg,this._opts.svgStyle),this.svg=g.svg,this.path=g.path,this.trail=g.trail,this.text=null;var h=e.extend({attachment:void 0,shape:this},this._opts);this._progressPath=new d(g.path,h),e.isObject(this._opts.text)&&null!==this._opts.text.value&&this.setText(this._opts.text.value)}};g.prototype.animate=function d(a,b,c){if(null===this._progressPath)throw new Error(f);this._progressPath.animate(a,b,c)},g.prototype.stop=function a(){if(null===this._progressPath)throw new Error(f);void 0===this._progressPath||this._progressPath.stop()},g.prototype.pause=function a(){if(null===this._progressPath)throw new Error(f);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.pause()},g.prototype.resume=function a(){if(null===this._progressPath)throw new Error(f);void 0!==this._progressPath&&this._progressPath._tweenable&&this._progressPath._tweenable.resume()},g.prototype.destroy=function a(){if(null===this._progressPath)throw new Error(f);this.stop(),this.svg.parentNode.removeChild(this.svg),this.svg=null,this.path=null,this.trail=null,this._progressPath=null,null!==this.text&&(this.text.parentNode.removeChild(this.text),this.text=null)},g.prototype.set=function b(a){if(null===this._progressPath)throw new Error(f);this._progressPath.set(a)},g.prototype.value=function a(){if(null===this._progressPath)throw new Error(f);return void 0===this._progressPath?0:this._progressPath.value()},g.prototype.setText=function b(a){if(null===this._progressPath)throw new Error(f);null===this.text&&(this.text=this._createTextContainer(this._opts,this._container),this._container.appendChild(this.text)),e.isObject(a)?(e.removeChildren(this.text),this.text.appendChild(a)):this.text.innerHTML=a},g.prototype._createSvgView=function b(a){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");this._initializeSvg(c,a);var d=null;(a.trailColor||a.trailWidth)&&(d=this._createTrail(a),c.appendChild(d));var e=this._createPath(a);return c.appendChild(e),{svg:c,path:e,trail:d}},g.prototype._initializeSvg=function c(a,b){a.setAttribute("viewBox","0 0 100 100")},g.prototype._createPath=function b(a){var c=this._pathString(a);return this._createPathElement(c,a)},g.prototype._createTrail=function b(a){var c=this._trailString(a),d=e.extend({},a);return d.trailColor||(d.trailColor="#eee"),d.trailWidth||(d.trailWidth=d.strokeWidth),d.color=d.trailColor,d.strokeWidth=d.trailWidth,d.fill=null,this._createPathElement(c,d)},g.prototype._createPathElement=function c(a,b){var d=document.createElementNS("http://www.w3.org/2000/svg","path");return d.setAttribute("d",a),d.setAttribute("stroke",b.color),d.setAttribute("stroke-width",b.strokeWidth),b.fill?d.setAttribute("fill",b.fill):d.setAttribute("fill-opacity","0"),d},g.prototype._createTextContainer=function c(a,b){var d=document.createElement("div");d.className=a.text.className;var f=a.text.style;return f&&(a.text.autoStyleContainer&&(b.style.position="relative"),e.setStyles(d,f),!f.color&&(d.style.color=a.color)),this._initializeTextContainer(a,b,d),d},g.prototype._initializeTextContainer=function(a,b,c){},g.prototype._pathString=function b(a){throw new Error("Override this function for each progress bar")},g.prototype._trailString=function b(a){throw new Error("Override this function for each progress bar")},g.prototype._warnContainerAspectRatio=function b(a){if(this.containerAspectRatio){var c=window.getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("width"),10),f=parseFloat(c.getPropertyValue("height"),10);e.floatEquals(this.containerAspectRatio,d/f)||(console.warn("Incorrect aspect ratio of container","#"+a.id,"detected:",c.getPropertyValue("width")+"(width)","/",c.getPropertyValue("height")+"(height)","=",d/f),console.warn("Aspect ratio of should be",this.containerAspectRatio))}},b.exports=g},{"./path":5,"./utils":9}],8:[function(a,b,c){var d=a("./shape"),e=a("./utils"),f=function c(a,b){this._pathTemplate="M 0,{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{strokeWidth}",this._trailTemplate="M {startMargin},{halfOfStrokeWidth} L {width},{halfOfStrokeWidth} L {width},{width} L {halfOfStrokeWidth},{width} L {halfOfStrokeWidth},{halfOfStrokeWidth}",d.apply(this,arguments)};f.prototype=new d,f.prototype.constructor=f,f.prototype._pathString=function b(a){var c=100-a.strokeWidth/2;return e.render(this._pathTemplate,{width:c,strokeWidth:a.strokeWidth,halfOfStrokeWidth:a.strokeWidth/2})},f.prototype._trailString=function b(a){var c=100-a.strokeWidth/2;return e.render(this._trailTemplate,{width:c,strokeWidth:a.strokeWidth,halfOfStrokeWidth:a.strokeWidth/2,startMargin:a.strokeWidth/2-a.trailWidth/2})},b.exports=f},{"./shape":7,"./utils":9}],9:[function(a,b,c){function d(a,b,c){for(var e in a=a||{},b=b||{},c=c||!1,b)if(b.hasOwnProperty(e)){var f=a[e],g=b[e];a[e]=c&&l(f)&&l(g)?d(f,g,c):g}return a}function e(a,b){var c=a;for(var d in b)if(b.hasOwnProperty(d)){var e=b[d],f="\\{"+d+"\\}",g=new RegExp(f,"g");c=c.replace(g,e)}return c}function f(a,b,c){for(var d,e=a.style,f=0;f