/*https://github.com/im4aLL/svgPathAnimation @author: me@habibhadi.com*/ function SvgAnimation(a){this.svg=$(a.elem),this.increaseBy=void 0!==a.increaseBy?a.increaseBy:5,this.timeout=void 0!==a.timeout?a.timeout:1,this.reverse=void 0!==a.reverse?a.reverse:!1,this.currentPath=1,this.totalPath=0,this.init()}SvgAnimation.prototype.animate=function(a){"function"==typeof a?this.runAnimation(a):this.runAnimation()},SvgAnimation.prototype.init=function(){var a=this.reverse;this.svg.find("path").each(function(b,c){var e=$(c),f=c.getTotalLength();e.attr("stroke-dasharray",f+" "+f).attr("stroke-dashoffset",a===!0?-f:f)})},SvgAnimation.prototype.runAnimation=function(a){this.totalPath=this.svg.find("path").length;var b={currentPath:this.currentPath,totalPath:this.totalPath,pathElem:this.svg.find("path:eq("+(this.currentPath-1)+")")};this.pathAnimation(a,b)},SvgAnimation.prototype.pathAnimation=function(a,b){var c=this,d=b.pathElem,e=parseFloat(d.attr("stroke-dashoffset")),f=this.increaseBy,g=setInterval(function(){if(c.reverse===!0&&e>=0||c.reverse===!1&&0>=e){if(clearInterval(g),"function"==typeof a&&a.call(this,{obj:d,current:b.currentPath,total:c.totalPath}),b.currentPath++,b.currentPath<=c.totalPath){var h={currentPath:b.currentPath,pathElem:c.svg.find("path:eq("+(b.currentPath-1)+")")};c.pathAnimation(a,h)}}else c.reverse===!0?(e+=f,d.attr("stroke-dashoffset",e>=0?0:e)):(e-=f,d.attr("stroke-dashoffset",0>=e?0:e))},this.timeout)};