"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/**
 * @license 
 * Copyright (c) 2017, Immo Schulz-Gerlach, www.isg-software.de 
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are 
 * permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
 * of conditions and the following disclaimer in the documentation and/or other materials
 * provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
 * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
!function($){function e(e){var t=e.valueInput;if("object"===(void 0===t?"undefined":_typeof(t))){if("function"==typeof t.val)return t;throw new Error("option 'valueInput' is an object, but does not have a 'val' method, i.e. it's obviously not a jQuery result object.")}return"string"==typeof t?$(t):null}var t={};$.fn.setupProgressPie=function(t,r){var n=this;$(this).each(function(){var e=$(this).data($.fn.setupProgressPie.dataKey);if(r||"object"!==(void 0===e?"undefined":_typeof(e))){var n=$.extend({},$.fn.progressPie.defaults,{update:!0},t);$(this).data($.fn.setupProgressPie.dataKey,n)}else $.extend(e,t)});var o=$.extend({},$.fn.progressPie.defaults,t),i=e(o);if(null!==i){if("string"!=typeof o.valueInputEvents)throw new Error("'valueInputEvents' has to be a string (space-separated list of event names)!");i.on(o.valueInputEvents,function(){$(n).progressPie()})}return this},$.fn.setupProgressPie.dataKey="$.fn.setupProgressPie",$.fn.progressPie=function(r){function n(e,t){if("number"==typeof e)return e;if(Array.isArray(e)&&e.length>0){if(1===e.length)return e[0];for(var r=t;r>=e.length;)r-=2;return e[r]}return 0}function o(e){return void 0===t[e]&&(t[e]=0),e+ ++t[e]}function i(e){return.02*Math.PI*e}function a(e,t){var r=eval,n=r(e);if("function"==typeof n)return n(t);throw new Error("The value of the colorFunctionAttr attribute is NOT a function: "+e)}function s(e){var t=eval,r=t(N+"."+e);if("function"==typeof r||"object"===(void 0===r?"undefined":_typeof(r))&&"function"==typeof r.draw)return r;throw new Error(e+" is not the name of a function or object in namespace "+N+"!")}function u(e){var t;if("function"==typeof e||"object"===(void 0===e?"undefined":_typeof(e))&&"function"==typeof e.draw)t=e;else{if("string"!=typeof e)throw new Error("contentPlugin option must either be a function or an object with method named 'draw' or the name of such a function or object in the namespace "+N+"!");t=s(e)}return t}function l(e){return Array.isArray(e)?$.map(e,u):[u(e)]}function d(e,t){return null===e?null:Array.isArray(e)?e[t]:0===t&&"object"===(void 0===e?"undefined":_typeof(e))?e:null}function p(e,t){return.02*Math.PI*e*t}function f(e,t,r,n,o,i){var a=document.createElementNS(R,"animate");a.setAttribute("attributeName",t),a.setAttribute("attributeType",r),a.setAttribute("from",n),a.setAttribute("to",o),a.setAttribute("fill","freeze");for(var s in i)a.setAttribute(s,i[s]);e.appendChild(a)}function c(e,t,r){var n,o;if("number"==typeof t)n=t;else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new Error("illegal option: 'strokeDashes' is neither number (count) nor object!");n=t.count,o=t.length}if(void 0===n)throw new Error("illegal option: 'strokeDashes' does not specify the 'count' property!");if(void 0===o)o=r/n/2;else if("string"==typeof o){o=o.trim();var i="%"===o.substring(o.length-1);o=Number.parseInt(o,10),i&&(o=r*o/100)}if(o*n>=r)throw new Error("Illegal options: strokeDashCount * strokeDashLength >= circumference, can't set stroke-dasharray!");var a=(r-o*n)/n,s="object"===(void 0===t?"undefined":_typeof(t))&&t.centered?1*o/2:0;"object"===(void 0===t?"undefined":_typeof(t))&&t.inverted?(e.style.strokeDasharray=a+"px, "+o+"px",e.style.strokeDashoffset=a+s+"px"):(e.style.strokeDasharray=o+"px, "+a+"px",0!==s&&(e.style.strokeDashoffset=s+"px"))}function g(e,t){if("string"==typeof t){var r=document.createElementNS(R,"title");$(r).text(t),e.appendChild(r)}}function v(e,t,r,n,o,a,s,u,l,d,v,m,h,y,b,A,S,C,P){"number"==typeof r&&(r=Math.min(r,t)),"number"==typeof u&&(u=Math.min(u,t));var E=-1;if("number"==typeof r&&"number"==typeof u&&r>0&&u>0&&r!==u&&s&&(d===x.RingAlign.CENTER||d===x.RingAlign.INNER)){var w=Math.max(u,r),k=Math.min(u,r);E=d===x.RingAlign.CENTER?t-w/2:t-w+k/2}var M,N,_=!1;if("number"==typeof r){N=document.createElementNS(R,"circle"),N.setAttribute("cx",0),N.setAttribute("cy",0),E>0&&r<u?M=E:(M=t-r/2,s||d!==x.RingAlign.INNER||(M-=u)),N.setAttribute("r",M),N.setAttribute("transform","rotate(-90)"),o&&c(N,o,2*Math.PI*M),_="string"==typeof n;var I=_?n:b;"string"==typeof I&&(N.style.stroke=I),"string"==typeof a&&(N.style.fill=a),N.style.strokeWidth=r,N.setAttribute("class",v),g(N,S),e.appendChild(N)}var O=u||(s||"number"!=typeof r?t:t-r);if(E>0&&u<r?M=E:(M=t-O/2,s||"number"!=typeof r||d!==x.RingAlign.OUTER||(M-=r)),100!==h||C||"string"!=typeof b){if(h>0&&h<100||(C||void 0===b)&&(0===h||100===h)){var D=document.createElementNS(R,"path"),j=h;if(C){var T=h-y,B=p(M,T),F=T<0,K,V;F?(j=y,K="0px",V=-B+"px"):(K=B+"px",V="0px");var z=p(M,j);D.setAttribute("stroke-dasharray",z+"px "+z+"px"),D.setAttribute("stroke-dashoffset",K),f(D,"stroke-dashoffset","CSS",K,V,C),l&&0===h&&f(D,"stroke-linecap","CSS","round","butt",C),A&&A!==b&&(f(D,"stroke","CSS",A,b,C),!_&&N&&(N.style.stroke=A,f(N,"stroke","CSS",A,b,C)))}var U=i(j),W=100===j?-1e-5:Math.sin(U)*M,L=Math.cos(U-Math.PI)*M,G=j>50?"1":"0",Y="1",Q=-M,X="M0,"+Q;if(X+=" A"+M+","+M+" 0 "+G+",1 "+W+","+L,D.setAttribute("d",X),D.style.fill="none","string"==typeof b&&(D.style.stroke=b),D.style.strokeWidth=O,D.style.strokeLinecap=l&&h>0?"round":"butt",P){var q=!1===P.clockwise,H="string"==typeof P?P:"string"==typeof P.duration?P.duration:"1s",J=document.createElementNS(R,"animateTransform");J.setAttribute("attributeName","transform"),J.setAttribute("attributeType","XML"),J.setAttribute("type","rotate"),J.setAttribute("from","0"),J.setAttribute("to",q?"-360":"360"),J.setAttribute("dur",H),J.setAttribute("repeatDur","indefinite"),D.appendChild(J)}D.setAttribute("class",m),g(D,S),e.appendChild(D)}}else{var Z=document.createElementNS(R,"circle");Z.setAttribute("cx",0),Z.setAttribute("cy",0),Z.setAttribute("r",M),Z.style.stroke=b,Z.style.strokeWidth=O,Z.style.fill="none",Z.setAttribute("class",m),g(Z,S),e.appendChild(Z)}}function m(t,r){var n,o=e(r);if(null!==o){if(n=o.val(),void 0!==r.valueData||void 0!==r.valueAttr||void 0!==r.valueSelector)throw new Error("options 'valueInput', 'valueData', 'valueAttr' and 'valueSelector' are mutually exclusive, i.e. at least three must be undefined!")}else if("string"==typeof r.valueData){if(n=t.data(r.valueData),void 0!==r.valueAttr||void 0!==r.valueSelector)throw new Error("options 'valueData', 'valueAttr' and 'valueSelector' are mutually exclusive, i.e. at least two must be undefined!")}else{if(void 0!==r.valueData)throw new Error("option 'valueData' is not of type 'string'!");if("string"==typeof r.valueAttr){if(n=t.attr(r.valueAttr),void 0!==r.valueSelector)throw new Error("options 'valueAttr' and 'valueSelector' are mutually exclusive, i.e. at least one must be undefined!")}else{if(void 0!==r.valueAttr)throw new Error("option 'valueAttr' is not of type 'string'!");void 0!==r.valueSelector&&(n=$(r.valueSelector,t).text())}}return void 0===n&&(n=t.text()),n}function h(e,t){return Math.max(0,Math.min(100,t.valueAdapter(e)))}function y(e,t){var r=t.mode,n=t.color,o=void 0===n?"undefined":_typeof(n);if("undefined"!==o&&"string"!==o&&"function"!==o)throw new Error("option 'color' has to be either a function or a string, but is of type '"+o+"'!");return"function"===o?r=_.USER_COLOR_FUNC:("undefined"===o&&"string"==typeof t.colorAttr&&(n=e.attr(t.colorAttr)),"string"==typeof n?r=_.USER_COLOR_CONST:"string"==typeof t.colorFunctionAttr&&"string"==typeof(n=e.attr(t.colorFunctionAttr))&&(r=_.DATA_ATTR_FUNC)),{mode:r,color:n}}function b(e,t,r){return e===_.CSS?void 0:e===_.MASK?_.MASK.color:e===_.IMASK?_.IMASK.color:e===_.GREY?_.GREY.color:e===_.GREEN?x.colorByPercent(100):e===_.RED?x.colorByPercent(0):e===_.COLOR||void 0===t?x.colorByPercent(r):e===_.USER_COLOR_CONST?t:e===_.USER_COLOR_FUNC?t(r):e===_.DATA_ATTR_FUNC?a(t,r):"black"}function A(e,t,r){return e===_.CSS?void 0:"string"==typeof t.backgroundColor?t.backgroundColor:"function"==typeof t.backgroundColor?t.backgroundColor(r):e===_.IMASK?_.MASK.color:"none"}function S(e,t){return void 0===e.ringWidth||t&&t.fullSize}function C(e,t,r,o,i,a){var s=document.createElementNS(R,"rect");e.appendChild(s);var u=t+n(r,3),l=t+n(r,0),d=u+t+n(r,1),p=l+t+n(r,2);"number"==typeof a&&"none"!==o&&(s.setAttribute("stroke-width",a),d-=a,p-=a,u-=a/2,l-=a/2),s.setAttribute("x","-"+u),s.setAttribute("y","-"+l),s.setAttribute("width",d),s.setAttribute("height",p),s.setAttribute("stroke",o),s.setAttribute("fill",i)}function P(e,t){var r=document.createElementNS(R,"svg"),n=e+t.getPadding(3)+t.getMargin(3),o=e+t.getPadding(0)+t.getMargin(0),i=n+e+t.getPadding(1)+t.getMargin(1),a=o+e+t.getPadding(2)+t.getMargin(2),s=i,u=a;return"number"==typeof t.scale&&(s*=t.scale,u*=t.scale),r.setAttribute("width",Math.ceil(s)),r.setAttribute("height",Math.ceil(u)),r.setAttribute("viewBox","-"+n+" -"+o+" "+i+" "+a),r}function E(e,t,r){var n={};if(n.raw=m(e,t),"function"==typeof t.optionsByRawValue){var o=t.optionsByRawValue(n.raw);void 0!==o&&null!==o&&($.extend(t,o),n.raw=m(e,t))}n.p=h(n.raw,t);var i=0===r?x.prevValueDataName:x.prevInnerValueDataName;if(r>1&&(i+=r),n.prevP=e.data(i),n.isInitialValue=void 0===n.prevP,e.data(i,n.p),"number"!=typeof n.prevP&&(n.prevP=0),"function"==typeof t.optionsByPercent){var a=t.optionsByPercent(n.p);void 0!==a&&null!==a&&($.extend(t,a),n.raw=m(e,t),n.p=h(n.raw,t))}return n}var w={getMargin:function e(t){return n(this.margin,t)},getPadding:function e(t){return n(this.padding,t)}},k=$.extend({},$.fn.progressPie.defaults,r,w),M=void 0===r,R="http://www.w3.org/2000/svg",N="jQuery.fn.progressPie.contentPlugin",x=$.fn.progressPie,_=$.extend({USER_COLOR_CONST:{},USER_COLOR_FUNC:{},DATA_ATTR_FUNC:{}},x.Mode);return $(this).each(function(){var e=$(this),t=$.extend({},k);if(M){var r=$(this).data($.fn.setupProgressPie.dataKey);"object"===(void 0===r?"undefined":_typeof(r))&&(t=$.extend({},r,w))}var n=$("svg",e);if(!n.length||t.update){n.length&&t.update&&(n.remove(),t.separator="");var i=E(e,t,0),a=Math.ceil("number"==typeof t.size?t.size:e.height());0===a&&(a=20),a*=t.sizeFactor;var s=a/2,p=s,f=y(e,t),c=b(f.mode,f.color,i.p),m=A(f.mode,t,i.p),h;(!0===t.animateColor||void 0===t.animateColor&&!i.isInitialValue)&&(h=b(f.mode,f.color,i.prevP));var N=x.smilSupported()?!0===t.animate?x.defaultAnimationAttributes:"object"===_typeof(t.animate)?$.extend({},x.defaultAnimationAttributes,t.animate):null:null,_=null,I=!1;if(t.contentPlugin){_=l(t.contentPlugin);for(var O={color:c,percentValue:i.p,rawValue:i.raw,pieOpts:t},D=0;D<_.length;D++){var j=_[D],T=d(t.contentPluginOptions,D),B=O;null!==T&&"object"===(void 0===T?"undefined":_typeof(T))&&(B=$.extend({},O,T)),"object"===(void 0===j?"undefined":_typeof(j))&&"function"==typeof j.hidesChartIfFullSize&&(I=I||t.mode!==x.Mode.MASK&&t.mode!==x.Mode.IMASK&&S(t,T)&&j.hidesChartIfFullSize(B))}}var F=P(s,t),K=document.createElementNS(R,"defs");f.mode!==x.Mode.CSS&&(F.style.verticalAlign=t.verticalAlign),e.is(":empty")?e.append(F):t.prepend?e.prepend(F,t.separator):e.append(t.separator,F),g(F,t.globalTitle);var V=null,z=F;if(!I){t.mode!==x.Mode.MASK&&t.mode!==x.Mode.IMASK||(z=document.createElementNS(R,"mask"),K.appendChild(z),V=o("pie"),z.setAttribute("id",V),t.mode===x.Mode.IMASK&&C(z,s,t.padding,"none",m));var U=t.cssClassForegroundPie,W=t.cssClassBackgroundCircle;"object"===_typeof(t.inner)&&(U+=" "+t.cssClassOuter,W+=" "+t.cssClassOuter),v(z,s,t.strokeWidth,t.strokeColor,t.strokeDashes,m,t.overlap,t.ringWidth,t.ringEndsRounded,t.ringAlign,W,U,i.p,i.prevP,c,h,t.title,N,t.rotation)}for(var L="number"==typeof t.ringWidth?t.ringWidth:"number"==typeof t.strokeWidth?t.strokeWidth:0,G=t.inner,Y=0;"object"===(void 0===G?"undefined":_typeof(G));){Y++,G=$.extend({},G),void 0===G.valueAdapter&&(G.valueAdapter=x.defaults.valueAdapter),void 0===G.overlap&&(G.overlap=x.defaults.overlap),void 0===G.ringAlign&&(G.ringAlign=t.ringAlign);var Q=E(e,G,Y),X=t.cssClassInner;Y>1&&(X+=Y),f=y(e,G),s="number"==typeof G.size?G.size*t.sizeFactor/2:.6*s;var q=b(f.mode,f.color,Q.p),H=null;(!0===G.animateColor||void 0===G.animateColor&&(!0===t.animateColor||void 0===t.animateColor&&Q.isInitialValue))&&(H=b(f.mode,f.color,Q.prevP)),!1!==G.animate&&x.smilSupported()?!0===G.animate&&null===N?N=x.defaultAnimationAttributes:"object"===_typeof(G.animate)&&(N=null===N?$.extend({},x.defaultAnimationAttributes,G.animate):$.extend({},N,G.animate)):N=null,I||v(z,s,G.strokeWidth,G.strokeColor,G.strokeDashes,m,G.overlap,G.ringWidth,G.ringEndsRounded,G.ringAlign,t.cssClassBackgroundCircle+" "+X,t.cssClassForegroundPie+" "+X,Q.p,Q.prevP,q,H,G.title,N),L="number"==typeof G.ringWidth?G.ringWidth:0,G=G.inner}if(null!==_){var J=s;L<s&&(J-=L);for(var Z={newSvgElement:function e(t){var r=document.createElementNS(R,t);return ne.appendChild(r),r},newSvgSubelement:function e(t,r){var n=document.createElementNS(R,r);return t.appendChild(n),n},newDefElement:function e(t){var r=document.createElementNS(R,t);return K.appendChild(r),r},createId:o,isFullSize:function e(){return S(t,this)},getBackgroundRadius:function e(t){var r=this.isFullSize()?this.totalRadius:this.radius;if(!t){r-="number"==typeof this.margin?this.margin:this.isFullSize()?this.pieOpts.defaultContentPluginBackgroundMarginFullSize:this.pieOpts.defaultContentPluginBackgroundMarginInsideRing}return r},addBackground:function e(t){if(this.backgroundColor){var r=this.newSvgElement("circle");r.setAttribute("cx","0"),r.setAttribute("cy","0"),r.setAttribute("r",t),r.setAttribute("fill",this.backgroundColor)}},addBackgroundRect:function e(r,n,o){C(ne,p,t.padding,r,n,o)},getContentPlugin:u,radius:J,totalRadius:p,color:c,percentValue:i.p,rawValue:i.raw,pieOpts:t},ee=!0,te=0;te<_.length;te++){var re=_[te],ne=document.createElementNS(R,"g"),oe="function"==typeof re?re:re.draw,ie=Z,ae=d(t.contentPluginOptions,te);null!==ae&&"object"===(void 0===ae?"undefined":_typeof(ae))&&(ie=$.extend({},Z,ae)),oe(ie),"boolean"==typeof re.inBackground&&re.inBackground||"function"==typeof re.inBackground&&re.inBackground(ie)?($(F).prepend(ne),null!==V&&ee&&(ne.setAttribute("mask","url(#"+V+")"),ee=!1)):$(F).append(ne),K.hasChildNodes()&&$(F).prepend(K)}if(null!==V&&ee)throw new Error("MASK mode could not be applied since no content plug-in drew a background to be masked! You need do specify at least one content plug-in which draws into the background!")}}}),this},$.fn.progressPie.Mode={GREY:{color:"#888"},RED:{value:200},GREEN:{value:200},COLOR:{},CSS:{},MASK:{color:"white"},IMASK:{color:"black"}},$.fn.progressPie.colorByPercent=function(e,t){var r=$.fn.progressPie.Mode.GREEN.value,n=$.fn.progressPie.Mode.RED.value,o=e>50?r:Math.floor(r*e/50),i=e<50?n:Math.floor(n*(100-e)/50),a=i+","+o+",0";return"number"==typeof t?"rgba("+a+","+t+")":"rgb("+a+")"},$.fn.progressPie.smilSupported=function(){return void 0===$.fn.progressPie.smilSupported.cache&&($.fn.progressPie.smilSupported.cache=/SVGAnimate/.test(document.createElementNS("http://www.w3.org/2000/svg","animate").toString())),$.fn.progressPie.smilSupported.cache},$.fn.progressPie.RingAlign={OUTER:{},CENTER:{},INNER:{}},$.fn.progressPie.defaults={mode:$.fn.progressPie.Mode.GREY,margin:0,padding:0,strokeWidth:2,overlap:!0,ringAlign:$.fn.progressPie.RingAlign.OUTER,prepend:!0,separator:"&nbsp;",verticalAlign:"bottom",update:!1,valueAdapter:function e(t){return"string"==typeof t?parseFloat(t):"number"==typeof t?t:0},valueInputEvents:"change",ringEndsRounded:!1,sizeFactor:1,scale:1,defaultContentPluginBackgroundMarginFullSize:0,defaultContentPluginBackgroundMarginInsideRing:1,cssClassBackgroundCircle:"progresspie-background",cssClassForegroundPie:"progresspie-foreground",cssClassOuter:"progresspie-outer",cssClassInner:"progresspie-inner"},$.fn.progressPie.defaultAnimationAttributes={dur:"1s",calcMode:"spline",keySplines:"0.23 1 0.32 1",keyTimes:"0;1"},$.fn.progressPie.contentPlugin={},$.fn.progressPie.prevValueDataName="_progresspieSVG_prevValue",$.fn.progressPie.prevInnerValueDataName="_progresspieSVG_prevInnerValue"}(jQuery);