var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
webpackJsonp([28],{0:function(s,v,q){q(1558)},1081:function(s,v){(function(q){s.exports=q}).call(v,{})},1512:function(s,v,q){var x;(function(){var k=this,d=k.Chart,c=function(b){this.canvas=b.canvas;this.ctx=b;var m=function(b,m){return b["offset"+m]?b["offset"+m]:document.defaultView.getComputedStyle(b).getPropertyValue(m)},r=this.width=m(b.canvas,"Width"),m=this.height=m(b.canvas,"Height");b.canvas.width=r;b.canvas.height=m;r=this.width=b.canvas.width;m=this.height=b.canvas.height;this.aspectRatio=
this.width/this.height;a.retinaScale(this);return this};c.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,
maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,
tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}};c.types={};var a=c.helpers={},e=a.each=function(b,m,r){var a=Array.prototype.slice.call(arguments,3);if(b)if(b.length===+b.length){var c;for(c=0;c<b.length;c++)m.apply(r,[b[c],c].concat(a))}else for(c in b)m.apply(r,[b[c],c].concat(a))},f=a.clone=function(b){var m=
{};e(b,function(r,a){b.hasOwnProperty(a)&&(m[a]=r)});return m},g=a.extend=function(b){e(Array.prototype.slice.call(arguments,1),function(m){e(m,function(r,a){m.hasOwnProperty(a)&&(b[a]=r)})});return b},I=a.merge=function(b,m){var a=Array.prototype.slice.call(arguments,0);a.unshift({});return g.apply(null,a)},J=a.indexOf=function(b,m){if(Array.prototype.indexOf)return b.indexOf(m);for(var a=0;a<b.length;a++)if(b[a]===m)return a;return-1};a.where=function(b,m){var r=[];a.each(b,function(b){m(b)&&r.push(b)});
return r};a.findNextWhere=function(b,m,a){a||(a=-1);for(a+=1;a<b.length;a++){var c=b[a];if(m(c))return c}};a.findPreviousWhere=function(b,m,a){a||(a=b.length);for(a-=1;0<=a;a--){var c=b[a];if(m(c))return c}};var G=a.inherits=function(b){var m=this,a=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return m.apply(this,arguments)},c=function(){this.constructor=a};c.prototype=m.prototype;a.prototype=new c;a.extend=G;b&&g(a.prototype,b);a.__super__=m.prototype;return a},C=a.noop=function(){},
w=a.uid=function(){var b=0;return function(){return"chart-"+b++}}(),A=a.warn=function(b){window.console&&"function"==typeof window.console.warn&&console.warn(b)},D=a.amd=q(1081),u=a.isNumber=function(b){return!isNaN(parseFloat(b))&&isFinite(b)},y=a.max=function(b){return Math.max.apply(Math,b)},t=a.min=function(b){return Math.min.apply(Math,b)};a.cap=function(b,a,c){if(u(a)){if(b>a)return a}else if(u(c)&&b<c)return c;return b};var E=a.getDecimalPlaces=function(b){return 0!==b%1&&u(b)?b.toString().split(".")[1].length:
0},z=a.radians=function(b){return b*(Math.PI/180)};a.getAngleFromPoint=function(b,a){var c=a.x-b.x,e=a.y-b.y,d=Math.sqrt(c*c+e*e),h=2*Math.PI+Math.atan2(e,c);0>c&&0>e&&(h+=2*Math.PI);return{angle:h,distance:d}};var h=a.aliasPixel=function(b){return 0===b%2?0:0.5};a.splineCurve=function(b,a,c,e){var d=Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2)),h=Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2)),f=e*d/(d+h);e=e*h/(d+h);return{inner:{x:a.x-f*(c.x-b.x),y:a.y-f*(c.y-b.y)},outer:{x:a.x+e*(c.x-
b.x),y:a.y+e*(c.y-b.y)}}};var K=a.calculateOrderOfMagnitude=function(b){return Math.floor(Math.log(b)/Math.LN10)};a.calculateScaleRange=function(b,a,c,e,d){a=Math.floor(a/(1.5*c));c=2>=a;var h=y(b),f=t(b);h===f&&(h+=0.5,0.5<=f&&!e?f-=0.5:h+=0.5);b=Math.abs(h-f);b=K(b);h=Math.ceil(h/(1*Math.pow(10,b)))*Math.pow(10,b);e=e?0:Math.floor(f/(1*Math.pow(10,b)))*Math.pow(10,b);for(var h=h-e,f=Math.pow(10,b),l=Math.round(h/f);(l>a||2*l<a)&&!c;)if(l>a)f*=2,l=Math.round(h/f),0!==l%1&&(c=!0);else if(d&&0<=b)if(0===
f/2%1)f/=2,l=Math.round(h/f);else break;else f/=2,l=Math.round(h/f);c&&(l=2,f=h/l);return{steps:l,stepValue:f,min:e,max:e+l*f}};var l=a.template=function(b,a){if(b instanceof Function)return b(a);var c={},c=!/\W/.test(b)?c[b]=c[b]:new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+
"');}return p.join('');");return a?c(a):c};a.generateLabels=function(b,a,c,h){var d=Array(a);labelTemplateString&&e(d,function(a,m){d[m]=l(b,{value:c+h*(m+1)})});return d};var n=a.easingEffects={linear:function(b){return b},easeInQuad:function(b){return b*b},easeOutQuad:function(b){return-1*b*(b-2)},easeInOutQuad:function(b){return 1>(b/=0.5)?0.5*b*b:-0.5*(--b*(b-2)-1)},easeInCubic:function(b){return b*b*b},easeOutCubic:function(b){return 1*((b=b/1-1)*b*b+1)},easeInOutCubic:function(b){return 1>(b/=
0.5)?0.5*b*b*b:0.5*((b-=2)*b*b+2)},easeInQuart:function(b){return b*b*b*b},easeOutQuart:function(b){return-1*((b=b/1-1)*b*b*b-1)},easeInOutQuart:function(b){return 1>(b/=0.5)?0.5*b*b*b*b:-0.5*((b-=2)*b*b*b-2)},easeInQuint:function(b){return 1*(b/=1)*b*b*b*b},easeOutQuint:function(b){return 1*((b=b/1-1)*b*b*b*b+1)},easeInOutQuint:function(b){return 1>(b/=0.5)?0.5*b*b*b*b*b:0.5*((b-=2)*b*b*b*b+2)},easeInSine:function(b){return-1*Math.cos(b/1*(Math.PI/2))+1},easeOutSine:function(b){return 1*Math.sin(b/
1*(Math.PI/2))},easeInOutSine:function(b){return-0.5*(Math.cos(Math.PI*b/1)-1)},easeInExpo:function(b){return 0===b?1:1*Math.pow(2,10*(b/1-1))},easeOutExpo:function(b){return 1===b?1:1*(-Math.pow(2,-10*b/1)+1)},easeInOutExpo:function(b){return 0===b?0:1===b?1:1>(b/=0.5)?0.5*Math.pow(2,10*(b-1)):0.5*(-Math.pow(2,-10*--b)+2)},easeInCirc:function(b){return 1<=b?b:-1*(Math.sqrt(1-(b/=1)*b)-1)},easeOutCirc:function(b){return 1*Math.sqrt(1-(b=b/1-1)*b)},easeInOutCirc:function(b){return 1>(b/=0.5)?-0.5*
(Math.sqrt(1-b*b)-1):0.5*(Math.sqrt(1-(b-=2)*b)+1)},easeInElastic:function(b){var a=1.70158,c=0,e=1;if(0===b)return 0;if(1==(b/=1))return 1;c||(c=0.3);e<Math.abs(1)?(e=1,a=c/4):a=c/(2*Math.PI)*Math.asin(1/e);return-(e*Math.pow(2,10*(b-=1))*Math.sin((1*b-a)*2*Math.PI/c))},easeOutElastic:function(b){var a=1.70158,c=0,e=1;if(0===b)return 0;if(1==(b/=1))return 1;c||(c=0.3);e<Math.abs(1)?(e=1,a=c/4):a=c/(2*Math.PI)*Math.asin(1/e);return e*Math.pow(2,-10*b)*Math.sin((1*b-a)*2*Math.PI/c)+1},easeInOutElastic:function(b){var a=
1.70158,c=0,e=1;if(0===b)return 0;if(2==(b/=0.5))return 1;c||(c=1*0.3*1.5);e<Math.abs(1)?(e=1,a=c/4):a=c/(2*Math.PI)*Math.asin(1/e);return 1>b?-0.5*e*Math.pow(2,10*(b-=1))*Math.sin((1*b-a)*2*Math.PI/c):0.5*e*Math.pow(2,-10*(b-=1))*Math.sin((1*b-a)*2*Math.PI/c)+1},easeInBack:function(b){return 1*(b/=1)*b*(2.70158*b-1.70158)},easeOutBack:function(b){return 1*((b=b/1-1)*b*(2.70158*b+1.70158)+1)},easeInOutBack:function(b){var a=1.70158;return 1>(b/=0.5)?0.5*b*b*(((a*=1.525)+1)*b-a):0.5*((b-=2)*b*(((a*=
1.525)+1)*b+a)+2)},easeInBounce:function(b){return 1-n.easeOutBounce(1-b)},easeOutBounce:function(b){return(b/=1)<1/2.75?1*7.5625*b*b:b<2/2.75?1*(7.5625*(b-=1.5/2.75)*b+0.75):b<2.5/2.75?1*(7.5625*(b-=2.25/2.75)*b+0.9375):1*(7.5625*(b-=2.625/2.75)*b+0.984375)},easeInOutBounce:function(b){return 0.5>b?0.5*n.easeInBounce(2*b):0.5*n.easeOutBounce(2*b-1)+0.5}},p=a.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||
window.msRequestAnimationFrame||function(b){return window.setTimeout(b,1E3/60)}}(),L=a.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(b){return window.clearTimeout(b,1E3/60)}}();a.animationLoop=function(b,a,c,e,d,h){var f=0,l=n[c]||n.linear,g=function(){f++;var c=f/a,r=l(c);b.call(h,r,c,f);e.call(h,r,c);f<a?h.animationFrame=p(g):d.apply(h)};p(g)};
a.getRelativePosition=function(b){var a;a=b.originalEvent||b;var c=(b.currentTarget||b.srcElement).getBoundingClientRect();a.touches?(b=a.touches[0].clientX-c.left,a=a.touches[0].clientY-c.top):(b=a.clientX-c.left,a=a.clientY-c.top);return{x:b,y:a}};var M=a.addEvent=function(b,a,c){b.addEventListener?b.addEventListener(a,c):b.attachEvent?b.attachEvent("on"+a,c):b["on"+a]=c},N=a.removeEvent=function(b,a,c){b.removeEventListener?b.removeEventListener(a,c,!1):b.detachEvent?b.detachEvent("on"+a,c):b["on"+
a]=C};a.bindEvents=function(b,a,c){b.events||(b.events={});e(a,function(a){b.events[a]=function(){c.apply(b,arguments)};M(b.chart.canvas,a,b.events[a])})};var O=a.unbindEvents=function(b,a){e(a,function(a,c){N(b.chart.canvas,c,a)})},P=a.getMaximumWidth=function(b){return b.parentNode.clientWidth},Q=a.getMaximumHeight=function(b){return b.parentNode.clientHeight};a.getMaximumSize=a.getMaximumWidth;var R=a.retinaScale=function(b){var a=b.ctx,c=b.canvas.width;b=b.canvas.height;window.devicePixelRatio&&
(a.canvas.style.width=c+"px",a.canvas.style.height=b+"px",a.canvas.height=b*window.devicePixelRatio,a.canvas.width=c*window.devicePixelRatio,a.scale(window.devicePixelRatio,window.devicePixelRatio))},S=a.clear=function(b){b.ctx.clearRect(0,0,b.width,b.height)},B=a.fontString=function(b,a,c){return a+" "+b+"px "+c},F=a.longestText=function(b,a,c,h){h=h||Infinity;b.font=a;var d=0;e(c,function(a){a=Infinity>h&&a.length>h?a.slice(0,h)+"...":a;a=b.measureText(a).width;d=a>d?a:d});return d},H=a.drawRoundedRectangle=
function(b,a,c,e,h,d){b.beginPath();b.moveTo(a+d,c);b.lineTo(a+e-d,c);b.quadraticCurveTo(a+e,c,a+e,c+d);b.lineTo(a+e,c+h-d);b.quadraticCurveTo(a+e,c+h,a+e-d,c+h);b.lineTo(a+d,c+h);b.quadraticCurveTo(a,c+h,a,c+h-d);b.lineTo(a,c+d);b.quadraticCurveTo(a,c,a+d,c);b.closePath()};c.instances={};c.Type=function(b,a,e){this.options=a;this.chart=e;this.id=w();c.instances[this.id]=this;a.responsive&&this.resize();this.initialize.call(this,b)};g(c.Type.prototype,{initialize:function(){return this},clear:function(){S(this.chart);
return this},stop:function(){L(this.animationFrame);return this},resize:function(b){this.stop();var a=this.chart.canvas,c=P(this.chart.canvas),e=this.options.maintainAspectRatio?c/this.chart.aspectRatio:Q(this.chart.canvas);a.width=this.chart.width=c;a.height=this.chart.height=e;R(this.chart);"function"===typeof b&&b.apply(this,Array.prototype.slice.call(arguments,1));return this},reflow:C,render:function(b){b&&this.reflow();this.options.animation&&!b?a.animationLoop(this.draw,this.options.animationSteps,
this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this));return this},generateLegend:function(){return l(this.options.legendTemplate,this)},destroy:function(){this.clear();O(this,this.events);var b=this.chart.canvas;b.width=this.chart.width;b.height=this.chart.height;b.style.removeProperty?(b.style.removeProperty("width"),b.style.removeProperty("height")):(b.style.removeAttribute("width"),b.style.removeAttribute("height"));
delete c.instances[this.id]},showTooltip:function(b,h){"undefined"===typeof this.activeElements&&(this.activeElements=[]);if(function(b){var a=!1;if(b.length!==this.activeElements.length)return a=!0;e(b,function(b,c){b!==this.activeElements[c]&&(a=!0)},this);return a}.call(this,b)||h){this.activeElements=b;this.draw();this.options.customTooltips&&this.options.customTooltips(!1);if(0<b.length)if(this.datasets&&1<this.datasets.length){for(var d,f,g=this.datasets.length-1;0<=g&&!(d=this.datasets[g].points||
this.datasets[g].bars||this.datasets[g].segments,f=J(d,b[0]),-1!==f);g--);var n=[],p=[];d=function(b){var c=[],e,d=[],h=[],m,l,g;a.each(this.datasets,function(b){e=b.points||b.bars||b.segments;e[f]&&e[f].hasValue()&&c.push(e[f])});a.each(c,function(b){d.push(b.x);h.push(b.y);n.push(a.template(this.options.multiTooltipTemplate,b));p.push({fill:b._saved.fillColor||b.fillColor,stroke:b._saved.strokeColor||b.strokeColor})},this);g=t(h);m=y(h);l=t(d);b=y(d);return{x:l>this.chart.width/2?l:b,y:(g+m)/2}}.call(this,
f);(new c.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,
cornerRadius:this.options.tooltipCornerRadius,labels:n,legendColors:p,legendColorBackground:this.options.multiTooltipKeyBackground,title:b[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips})).draw()}else e(b,function(b){var a=b.tooltipPosition();(new c.Tooltip({x:Math.round(a.x),y:Math.round(a.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,
fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:l(this.options.tooltipTemplate,b),chart:this.chart,custom:this.options.customTooltips})).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}});c.Type.extend=function(b){var a=this,e=function(){return a.apply(this,arguments)};e.prototype=f(a.prototype);g(e.prototype,
b);e.extend=c.Type.extend;if(b.name||a.prototype.name){var d=b.name||a.prototype.name,h=c.defaults[a.prototype.name]?f(c.defaults[a.prototype.name]):{};c.defaults[d]=g(h,b.defaults);c.types[d]=e;c.prototype[d]=function(b,a){var h=I(c.defaults.global,c.defaults[d],a||{});return new e(b,h,this)}}else A("Name not provided for this chart, so it hasn't been registered");return a};c.Element=function(b){g(this,b);this.initialize.apply(this,arguments);this.save()};g(c.Element.prototype,{initialize:function(){},
restore:function(b){b?e(b,function(b){this[b]=this._saved[b]},this):g(this,this._saved);return this},save:function(){this._saved=f(this);delete this._saved._saved;return this},update:function(b){e(b,function(b,a){this._saved[a]=this[a];this[a]=b},this);return this},transition:function(b,a){e(b,function(b,c){this[c]=(b-this._saved[c])*a+this._saved[c]},this);return this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return u(this.value)}});c.Element.extend=G;c.Point=c.Element.extend({display:!0,
inRange:function(b,a){var c=this.hitDetectionRadius+this.radius;return Math.pow(b-this.x,2)+Math.pow(a-this.y,2)<Math.pow(c,2)},draw:function(){if(this.display){var b=this.ctx;b.beginPath();b.arc(this.x,this.y,this.radius,0,2*Math.PI);b.closePath();b.strokeStyle=this.strokeColor;b.lineWidth=this.strokeWidth;b.fillStyle=this.fillColor;b.fill();b.stroke()}}});c.Arc=c.Element.extend({inRange:function(b,c){var e=a.getAngleFromPoint(this,{x:b,y:c}),d=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;
return e.angle>=this.startAngle&&e.angle<=this.endAngle&&d},tooltipPosition:function(){var b=this.startAngle+(this.endAngle-this.startAngle)/2,a=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(b)*a,y:this.y+Math.sin(b)*a}},draw:function(b){b=this.ctx;b.beginPath();b.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle);b.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0);b.closePath();b.strokeStyle=this.strokeColor;b.lineWidth=this.strokeWidth;
b.fillStyle=this.fillColor;b.fill();b.lineJoin="bevel";this.showStroke&&b.stroke()}});c.Rectangle=c.Element.extend({draw:function(){var b=this.ctx,a=this.width/2,c=this.x-a,a=this.x+a,e=this.base-(this.base-this.y),d=this.strokeWidth/2;this.showStroke&&(c+=d,a-=d,e+=d);b.beginPath();b.fillStyle=this.fillColor;b.strokeStyle=this.strokeColor;b.lineWidth=this.strokeWidth;b.moveTo(c,this.base);b.lineTo(c,e);b.lineTo(a,e);b.lineTo(a,this.base);b.fill();this.showStroke&&b.stroke()},height:function(){return this.base-
this.y},inRange:function(b,a){return this.y<this.base?b>=this.x-this.width/2&&b<=this.x+this.width/2&&a>=this.y&&a<=this.base:b>=this.x-this.width/2&&b<=this.x+this.width/2&&a>=this.base&&a<=this.y}});c.Tooltip=c.Element.extend({draw:function(){var b=this.chart.ctx;b.font=B(this.fontSize,this.fontStyle,this.fontFamily);this.xAlign="center";this.yAlign="above";var a=this.caretPadding=2,c=b.measureText(this.text).width+2*this.xPadding,e=this.fontSize+2*this.yPadding,d=e+this.caretHeight+a;this.x+c/
2>this.chart.width?this.xAlign="left":0>this.x-c/2&&(this.xAlign="right");0>this.y-d&&(this.yAlign="below");var h=this.x-c/2,d=this.y-d;b.fillStyle=this.fillColor;if(this.custom)this.custom(this);else{switch(this.yAlign){case "above":b.beginPath();b.moveTo(this.x,this.y-a);b.lineTo(this.x+this.caretHeight,this.y-(a+this.caretHeight));b.lineTo(this.x-this.caretHeight,this.y-(a+this.caretHeight));b.closePath();b.fill();break;case "below":d=this.y+a+this.caretHeight,b.beginPath(),b.moveTo(this.x,this.y+
a),b.lineTo(this.x+this.caretHeight,this.y+a+this.caretHeight),b.lineTo(this.x-this.caretHeight,this.y+a+this.caretHeight),b.closePath(),b.fill()}switch(this.xAlign){case "left":h=this.x-c+(this.cornerRadius+this.caretHeight);break;case "right":h=this.x-(this.cornerRadius+this.caretHeight)}H(b,h,d,c,e,this.cornerRadius);b.fill();b.fillStyle=this.textColor;b.textAlign="center";b.textBaseline="middle";b.fillText(this.text,h+c/2,d+e/2)}}});c.MultiTooltip=c.Element.extend({initialize:function(){this.font=
B(this.fontSize,this.fontStyle,this.fontFamily);this.titleFont=B(this.titleFontSize,this.titleFontStyle,this.titleFontFamily);this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize;this.ctx.font=this.titleFont;var b=this.ctx.measureText(this.title).width,a=F(this.ctx,this.font,this.labels)+this.fontSize+3;this.width=y([a,b])+2*this.xPadding;b=this.height/2;0>this.y-b?this.y=b:this.y+b>this.chart.height&&(this.y=this.chart.height-
b);this.x=this.x>this.chart.width/2?this.x-(this.xOffset+this.width):this.x+this.xOffset},getLineHeight:function(b){var a=this.y-this.height/2+this.yPadding;return 0===b?a+this.titleFontSize/2:a+(1.5*this.fontSize*(b-1)+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{H(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var b=this.ctx;b.fillStyle=this.fillColor;b.fill();b.closePath();b.textAlign="left";b.textBaseline="middle";
b.fillStyle=this.titleTextColor;b.font=this.titleFont;b.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0));b.font=this.font;a.each(this.labels,function(a,c){b.fillStyle=this.textColor;b.fillText(a,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(c+1));b.fillStyle=this.legendColorBackground;b.fillRect(this.x+this.xPadding,this.getLineHeight(c+1)-this.fontSize/2,this.fontSize,this.fontSize);b.fillStyle=this.legendColors[c].fill;b.fillRect(this.x+this.xPadding,this.getLineHeight(c+
1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}});c.Scale=c.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var b=E(this.stepValue),a=0;a<=this.steps;a++)this.yLabels.push(l(this.templateString,{value:(this.min+a*this.stepValue).toFixed(b)}));this.yLabelWidth=this.display&&this.showLabels?F(this.ctx,this.font,this.yLabels):0},addXLabel:function(b){this.xLabels.push(b);this.valuesCount++;this.fit()},removeXLabel:function(){this.xLabels.shift();
this.valuesCount--;this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0;this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height;this.startPoint+=this.padding;this.endPoint-=this.padding;var b=this.endPoint-this.startPoint,a;this.calculateYRange(b);this.buildYLabels();for(this.calculateXLabelRotation();b>this.endPoint-this.startPoint;)b=this.endPoint-this.startPoint,a=this.yLabelWidth,this.calculateYRange(b),this.buildYLabels(),a<this.yLabelWidth&&this.calculateXLabelRotation()},
calculateXLabelRotation:function(){this.ctx.font=this.font;var b=this.xLabels[0],a=this.xLabels[this.xLabels.length-1],c=this.ctx.measureText(b).width,e=this.ctx.measureText(a).width;this.xScalePaddingRight=e/2+3;this.xScalePaddingLeft=c/2>this.yLabelWidth+10?c/2:this.yLabelWidth+10;this.xLabelRotation=0;this.xLabelLimit=Infinity;if(this.display){var d=F(this.ctx,this.font,this.xLabels),e=0,h;this.xLabelWidth=d;for(var f=Math.floor(this.calculateX(1)-this.calculateX(0))-6,l=this.endPoint-this.startPoint;this.xLabelWidth>
f&&90>=this.xLabelRotation&&0<=this.xLabelRotation;)e<l/2||5>this.LabelLimit?(this.xLabelRotation++,h=Math.cos(z(this.xLabelRotation)),e=h*c,e+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=e+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2):(this.xLabelLimit=Infinity>this.xLabelLimit?this.xLabelLimit-1:Math.max.apply(null,this.xLabels.map(function(b){return b.length}))-1,d=F(this.ctx,this.font,this.xLabels,this.xLabelLimit),b.length>this.xLabelLimit&&(c=this.ctx.measureText(b.slice(0,
this.xLabelLimit)+"...").width),a.length>this.xLabelLimit&&(e=this.ctx.measureText(a.slice(0,this.xLabelLimit)+"...").width)),e=Math.sin(z(this.xLabelRotation))*d+3,this.xLabelWidth=h*d;0<this.xLabelRotation&&(this.endPoint-=e)}else this.xLabelWidth=0,this.xScalePaddingLeft=this.xScalePaddingRight=this.padding},calculateYRange:C,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(b){var a=this.drawingArea()/(this.min-this.max);return this.endPoint-a*(b-this.min)},calculateX:function(b){var a=
(this.width-(this.xScalePaddingLeft+this.xScalePaddingRight))/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1);b=a*b+this.xScalePaddingLeft;this.offsetGridLines&&(b+=a/2);return Math.round(b)},update:function(b){a.extend(this,b);this.fit()},draw:function(){var b=this.ctx,c=(this.endPoint-this.startPoint)/this.steps,d=Math.round(this.xScalePaddingLeft);this.display&&(b.fillStyle=this.textColor,b.font=this.font,e(this.yLabels,function(e,h){var f=this.endPoint-c*h,l=Math.round(f),g=this.showHorizontalLines;
b.textAlign="right";b.textBaseline="middle";this.showLabels&&b.fillText(e,d-10,f);0===h&&!g&&(g=!0);g&&b.beginPath();0<h?(b.lineWidth=this.gridLineWidth,b.strokeStyle=this.gridLineColor):(b.lineWidth=this.lineWidth,b.strokeStyle=this.lineColor);l+=a.aliasPixel(b.lineWidth);g&&(b.moveTo(d,l),b.lineTo(this.width,l),b.stroke(),b.closePath());b.lineWidth=this.lineWidth;b.strokeStyle=this.lineColor;b.beginPath();b.moveTo(d-5,l);b.lineTo(d,l);b.stroke();b.closePath()},this),e(this.xLabels,function(a,c){var e=
this.calculateX(c)+h(this.lineWidth),d=this.calculateX(c-(this.offsetGridLines?0.5:0))+h(this.lineWidth),f=0<this.xLabelRotation,l=this.showVerticalLines;0===c&&!l&&(l=!0);l&&b.beginPath();0<c?(b.lineWidth=this.gridLineWidth,b.strokeStyle=this.gridLineColor):(b.lineWidth=this.lineWidth,b.strokeStyle=this.lineColor);l&&(b.moveTo(d,this.endPoint),b.lineTo(d,this.startPoint-3),b.stroke(),b.closePath());b.lineWidth=this.lineWidth;b.strokeStyle=this.lineColor;b.beginPath();b.moveTo(d,this.endPoint);b.lineTo(d,
this.endPoint+5);b.stroke();b.closePath();b.save();b.translate(e,f?this.endPoint+12:this.endPoint+8);b.rotate(-1*z(this.xLabelRotation));b.font=this.font;b.textAlign=f?"right":"center";b.textBaseline=f?"middle":"top";a.length>this.xLabelLimit?b.fillText(a.slice(0,this.xLabelLimit)+"...",0,0):b.fillText(a,0,0);b.restore()},this))}});c.RadialScale=c.Element.extend({initialize:function(){this.size=t([this.height,this.width]);this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):
this.size/2},calculateCenterOffset:function(b){return(b-this.min)*(this.drawingArea/(this.max-this.min))},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize();this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var b=E(this.stepValue),a=0;a<=this.steps;a++)this.yLabels.push(l(this.templateString,{value:(this.min+a*this.stepValue).toFixed(b)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},
setScaleSize:function(){var b=t([this.height/2-this.pointLabelFontSize-5,this.width/2]),a,c,e,d=this.width,h,f=0,g;this.ctx.font=B(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);for(c=0;c<this.valuesCount;c++)a=this.getPointPosition(c,b),e=this.ctx.measureText(l(this.templateString,{value:this.labels[c]})).width+5,0===c||c===this.valuesCount/2?(e/=2,a.x+e>d&&(d=a.x+e,h=c),a.x-e<f&&(f=a.x-e,g=c)):c<this.valuesCount/2?a.x+e>d&&(d=a.x+e,h=c):c>this.valuesCount/2&&a.x-e<f&&
(f=a.x-e,g=c);a=f;d=Math.ceil(d-this.width);h=this.getIndexAngle(h);g=this.getIndexAngle(g);h=d/Math.sin(h+Math.PI/2);g=a/Math.sin(g+Math.PI/2);h=u(h)?h:0;g=u(g)?g:0;this.drawingArea=b-(g+h)/2;this.setCenterPoint(g,h)},setCenterPoint:function(b,a){this.xCenter=(b+this.drawingArea+(this.width-a-this.drawingArea))/2;this.yCenter=this.height/2},getIndexAngle:function(b){return b*(2*Math.PI/this.valuesCount)-Math.PI/2},getPointPosition:function(b,a){var c=this.getIndexAngle(b);return{x:Math.cos(c)*a+
this.xCenter,y:Math.sin(c)*a+this.yCenter}},draw:function(){if(this.display){var b=this.ctx;e(this.yLabels,function(a,c){if(0<c){var e=c*(this.drawingArea/this.steps),d=this.yCenter-e;if(0<this.lineWidth){b.strokeStyle=this.lineColor;b.lineWidth=this.lineWidth;if(this.lineArc)b.beginPath(),b.arc(this.xCenter,this.yCenter,e,0,2*Math.PI);else{b.beginPath();for(var h=0;h<this.valuesCount;h++)e=this.getPointPosition(h,this.calculateCenterOffset(this.min+c*this.stepValue)),0===h?b.moveTo(e.x,e.y):b.lineTo(e.x,
e.y)}b.closePath();b.stroke()}this.showLabels&&(b.font=B(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop&&(e=b.measureText(a).width,b.fillStyle=this.backdropColor,b.fillRect(this.xCenter-e/2-this.backdropPaddingX,d-this.fontSize/2-this.backdropPaddingY,e+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)),b.textAlign="center",b.textBaseline="middle",b.fillStyle=this.fontColor,b.fillText(a,this.xCenter,d))}},this);if(!this.lineArc){b.lineWidth=this.angleLineWidth;b.strokeStyle=
this.angleLineColor;for(var a=this.valuesCount-1;0<=a;a--){if(0<this.angleLineWidth){var c=this.getPointPosition(a,this.calculateCenterOffset(this.max));b.beginPath();b.moveTo(this.xCenter,this.yCenter);b.lineTo(c.x,c.y);b.stroke();b.closePath()}c=this.getPointPosition(a,this.calculateCenterOffset(this.max)+5);b.font=B(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);b.fillStyle=this.pointLabelFontColor;var d=this.labels.length,h=this.labels.length/2,f=h/2,l=a<f||a>d-f,
d=a===f||a===d-f;b.textAlign=0===a?"center":a===h?"center":a<h?"left":"right";b.textBaseline=d?"middle":l?"bottom":"top";b.fillText(this.labels[a],c.x,c.y)}}}}});a.addEvent(window,"resize",function(){var b;return function(){clearTimeout(b);b=setTimeout(function(){e(c.instances,function(b){if(b.options.responsive)try{b.resize(b.render,!0)}catch(a){console.log(a.message)}})},50)}}());D?!(x=function(){return c}.call(v,q,v,s),void 0!==x&&(s.exports=x)):"object"===typeof s&&s.exports&&(s.exports=c);k.Chart=
c;c.noConflict=function(){k.Chart=d;return c}}).call(this);(function(){var k=this.Chart,d=k.helpers;k.Type.extend({name:"Bar",defaults:{scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},
initialize:function(c){var a=this.options;this.ScaleClass=k.Scale.extend({offsetGridLines:!0,calculateBarX:function(c,d,g){var k=this.calculateBaseWidth();g=this.calculateX(g)-k/2;c=this.calculateBarWidth(c);return g+c*d+d*a.barDatasetSpacing+c/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*a.barValueSpacing},calculateBarWidth:function(c){return(this.calculateBaseWidth()-(c-1)*a.barDatasetSpacing)/c}});this.datasets=[];this.options.showTooltips&&d.bindEvents(this,
this.options.tooltipEvents,function(a){a="mouseout"!==a.type?this.getBarsAtEvent(a):[];this.eachBars(function(a){a.restore(["fillColor","strokeColor"])});d.each(a,function(a){a.fillColor=a.highlightFill;a.strokeColor=a.highlightStroke});this.showTooltip(a)});this.BarClass=k.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx});d.each(c.datasets,function(a,f){var g={label:a.label||null,fillColor:a.fillColor,strokeColor:a.strokeColor,bars:[]};
this.datasets.push(g);d.each(a.data,function(d,f){g.bars.push(new this.BarClass({value:d,label:c.labels[f],datasetLabel:a.label,strokeColor:a.strokeColor,fillColor:a.fillColor,highlightFill:a.highlightFill||a.fillColor,highlightStroke:a.highlightStroke||a.strokeColor}))},this)},this);this.buildScale(c.labels);this.BarClass.prototype.base=this.calculateBarBase();this.eachBars(function(a,c,g){d.extend(a,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,
g,c),y:this.calculateBarBase()});a.save()},this);this.render()},calculateBarBase:function(){var c=this.scale.endPoint;if(this.scale.beginAtZero||(0<=this.scale.min?1:-1)!=(0<=this.scale.max?1:-1))c=this.scale.calculateY(0);else if(0>(0<=this.scale.min?1:-1)&&0>(0<=this.scale.max?1:-1))c=this.scale.startPoint;return c},update:function(){this.scale.update();d.each(this.activeElements,function(c){c.restore(["fillColor","strokeColor"])});this.eachBars(function(c){c.save()});this.render()},eachBars:function(c){d.each(this.datasets,
function(a,e){d.each(a.bars,c,this,e)},this)},getBarsAtEvent:function(c){var a=[];c=d.getRelativePosition(c);for(var e=function(c){a.push(c.bars[f])},f,g=0;g<this.datasets.length;g++)for(f=0;f<this.datasets[g].bars.length;f++)if(this.datasets[g].bars[f].inRange(c.x,c.y))return d.each(this.datasets,e),a;return a},buildScale:function(c){var a=this,e=function(){var c=[];a.eachBars(function(a){c.push(a.value)});return c},f=function(){var c=e().reduce(function(a,c){return a.concat(c)},[]);return a.options.scaleBeginAtZero&&
0<=Math.min.apply(null,c)};c={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:c.length,beginAtZero:f(),integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(a){a=d.calculateScaleRange(e(),a,this.fontSize,f(),this.integersOnly);d.extend(this,a)},xLabels:c,font:d.fontString(this.options.scaleFontSize,
this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:
0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&d.extend(c,{calculateYRange:d.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth});this.scale=new this.ScaleClass(c)},addData:function(c,a){d.each(c,function(c,d){this.datasets[d].bars.push(new this.BarClass({value:c,label:a,x:this.scale.calculateBarX(this.datasets.length,
d,this.scale.valuesCount+1),y:this.calculateBarBase(),width:this.scale.calculateBarWidth(this.datasets.length),base:this.calculateBarBase(),strokeColor:this.datasets[d].strokeColor,fillColor:this.datasets[d].fillColor}))},this);this.scale.addXLabel(a);this.update()},removeData:function(){this.scale.removeXLabel();d.each(this.datasets,function(c){c.bars.shift()},this);this.update()},reflow:function(){d.extend(this.BarClass.prototype,{y:this.calculateBarBase(),base:this.calculateBarBase()});var c=d.extend({height:this.chart.height,
width:this.chart.width});this.scale.update(c)},draw:function(c){var a=c||1;this.clear();this.scale.draw(a);d.each(this.datasets,function(c,f){d.each(c.bars,function(c,d){c.hasValue()&&(c.base=this.calculateBarBase(),c.transition({x:this.scale.calculateBarX(this.datasets.length,f,d),y:this.scale.calculateY(c.value),width:this.scale.calculateBarWidth(this.datasets.length)},a).draw())},this)},this)}})}).call(this);(function(){var k=this.Chart,d=k.helpers,c={segmentShowStroke:!0,segmentStrokeColor:"#fff",
segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};k.Type.extend({name:"Doughnut",defaults:c,initialize:function(a){this.segments=[];this.outerRadius=(d.min([this.chart.width,this.chart.height])-
this.options.segmentStrokeWidth/2)/2;this.SegmentArc=k.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2});this.options.showTooltips&&d.bindEvents(this,this.options.tooltipEvents,function(a){a="mouseout"!==a.type?this.getSegmentsAtEvent(a):[];d.each(this.segments,function(a){a.restore(["fillColor"])});d.each(a,function(a){a.fillColor=a.highlightColor});this.showTooltip(a)});this.calculateTotal(a);d.each(a,function(a,c){this.addData(a,c,!0)},this);this.render()},getSegmentsAtEvent:function(a){var c=
[],f=d.getRelativePosition(a);d.each(this.segments,function(a){a.inRange(f.x,f.y)&&c.push(a)},this);return c},addData:function(a,c,d){this.segments.splice(c||this.segments.length,0,new this.SegmentArc({value:a.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:a.color,highlightColor:a.highlight||a.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,
strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(a.value),label:a.label}));d||(this.reflow(),this.update())},calculateCircumference:function(a){return 2*Math.PI*(Math.abs(a)/this.total)},calculateTotal:function(a){this.total=0;d.each(a,function(a){this.total+=Math.abs(a.value)},this)},update:function(){this.calculateTotal(this.segments);d.each(this.activeElements,function(a){a.restore(["fillColor"])});d.each(this.segments,
function(a){a.save()});this.render()},removeData:function(a){a=d.isNumber(a)?a:this.segments.length-1;this.segments.splice(a,1);this.reflow();this.update()},reflow:function(){d.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2});this.outerRadius=(d.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2;d.each(this.segments,function(a){a.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},
draw:function(a){var c=a?a:1;this.clear();d.each(this.segments,function(a,d){a.transition({circumference:this.calculateCircumference(a.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},c);a.endAngle=a.startAngle+a.circumference;a.draw();0===d&&(a.startAngle=1.5*Math.PI);d<this.segments.length-1&&(this.segments[d+1].startAngle=a.endAngle)},this)}});k.types.Doughnut.extend({name:"Pie",defaults:d.merge(c,{percentageInnerCutout:0})})}).call(this);
(function(){var k=this.Chart,d=k.helpers;k.Type.extend({name:"Line",defaults:{scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,bezierCurve:!0,bezierCurveTension:0.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},
initialize:function(c){this.PointClass=k.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(a){return Math.pow(a-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}});this.datasets=[];this.options.showTooltips&&d.bindEvents(this,this.options.tooltipEvents,function(a){a="mouseout"!==a.type?this.getPointsAtEvent(a):[];this.eachPoints(function(a){a.restore(["fillColor",
"strokeColor"])});d.each(a,function(a){a.fillColor=a.highlightFill;a.strokeColor=a.highlightStroke});this.showTooltip(a)});d.each(c.datasets,function(a){var e={label:a.label||null,fillColor:a.fillColor,strokeColor:a.strokeColor,pointColor:a.pointColor,pointStrokeColor:a.pointStrokeColor,points:[]};this.datasets.push(e);d.each(a.data,function(d,g){e.points.push(new this.PointClass({value:d,label:c.labels[g],datasetLabel:a.label,strokeColor:a.pointStrokeColor,fillColor:a.pointColor,highlightFill:a.pointHighlightFill||
a.pointColor,highlightStroke:a.pointHighlightStroke||a.pointStrokeColor}))},this);this.buildScale(c.labels);this.eachPoints(function(a,c){d.extend(a,{x:this.scale.calculateX(c),y:this.scale.endPoint});a.save()},this)},this);this.render()},update:function(){this.scale.update();d.each(this.activeElements,function(c){c.restore(["fillColor","strokeColor"])});this.eachPoints(function(c){c.save()});this.render()},eachPoints:function(c){d.each(this.datasets,function(a){d.each(a.points,c,this)},this)},getPointsAtEvent:function(c){var a=
[],e=d.getRelativePosition(c);d.each(this.datasets,function(c){d.each(c.points,function(c){c.inRange(e.x,e.y)&&a.push(c)})},this);return a},buildScale:function(c){var a=this,e=function(){var c=[];a.eachPoints(function(a){c.push(a.value)});return c};c={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,
valuesCount:c.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(a){a=d.calculateScaleRange(e(),a,this.fontSize,this.beginAtZero,this.integersOnly);d.extend(this,a)},xLabels:c,font:d.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,
gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&d.extend(c,{calculateYRange:d.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,
max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth});this.scale=new k.Scale(c)},addData:function(c,a){d.each(c,function(c,d){this.datasets[d].points.push(new this.PointClass({value:c,label:a,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[d].pointStrokeColor,fillColor:this.datasets[d].pointColor}))},this);this.scale.addXLabel(a);this.update()},removeData:function(){this.scale.removeXLabel();d.each(this.datasets,function(c){c.points.shift()},
this);this.update()},reflow:function(){var c=d.extend({height:this.chart.height,width:this.chart.width});this.scale.update(c)},draw:function(c){var a=c||1;this.clear();var e=this.chart.ctx,f=function(a){return null!==a.value};this.scale.draw(a);d.each(this.datasets,function(c){var k=d.where(c.points,f);d.each(c.points,function(c,d){c.hasValue()&&c.transition({y:this.scale.calculateY(c.value),x:this.scale.calculateX(d)},a)},this);this.options.bezierCurve&&d.each(k,function(a,c){var e=0<c&&c<k.length-
1?this.options.bezierCurveTension:0;a.controlPoints=d.splineCurve(d.findPreviousWhere(k,f,c)||a,a,d.findNextWhere(k,f,c)||a,e);a.controlPoints.outer.y>this.scale.endPoint?a.controlPoints.outer.y=this.scale.endPoint:a.controlPoints.outer.y<this.scale.startPoint&&(a.controlPoints.outer.y=this.scale.startPoint);a.controlPoints.inner.y>this.scale.endPoint?a.controlPoints.inner.y=this.scale.endPoint:a.controlPoints.inner.y<this.scale.startPoint&&(a.controlPoints.inner.y=this.scale.startPoint)},this);e.lineWidth=
this.options.datasetStrokeWidth;e.strokeStyle=c.strokeColor;e.beginPath();d.each(k,function(a,c){if(0===c)e.moveTo(a.x,a.y);else if(this.options.bezierCurve){var g=d.findPreviousWhere(k,f,c)||a;e.bezierCurveTo(g.controlPoints.outer.x,g.controlPoints.outer.y,a.controlPoints.inner.x,a.controlPoints.inner.y,a.x,a.y)}else e.lineTo(a.x,a.y)},this);e.stroke();this.options.datasetFill&&0<k.length&&(e.lineTo(k[k.length-1].x,this.scale.endPoint),e.lineTo(k[0].x,this.scale.endPoint),e.fillStyle=c.fillColor,
e.closePath(),e.fill());d.each(k,function(a){a.draw()})},this)}})}).call(this);(function(){var k=this.Chart,d=k.helpers;k.Type.extend({name:"PolarArea",defaults:{scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'},
initialize:function(c){this.segments=[];this.SegmentArc=k.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2});this.scale=new k.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,
showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:c.length});
this.updateScaleRange(c);this.scale.update();d.each(c,function(a,c){this.addData(a,c,!0)},this);this.options.showTooltips&&d.bindEvents(this,this.options.tooltipEvents,function(a){a="mouseout"!==a.type?this.getSegmentsAtEvent(a):[];d.each(this.segments,function(a){a.restore(["fillColor"])});d.each(a,function(a){a.fillColor=a.highlightColor});this.showTooltip(a)});this.render()},getSegmentsAtEvent:function(c){var a=[],e=d.getRelativePosition(c);d.each(this.segments,function(c){c.inRange(e.x,e.y)&&
a.push(c)},this);return a},addData:function(c,a,d){this.segments.splice(a||this.segments.length,0,new this.SegmentArc({fillColor:c.color,highlightColor:c.highlight||c.color,label:c.label,value:c.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(c.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI}));d||(this.reflow(),this.update())},removeData:function(c){c=d.isNumber(c)?c:this.segments.length-1;this.segments.splice(c,
1);this.reflow();this.update()},calculateTotal:function(c){this.total=0;d.each(c,function(a){this.total+=a.value},this);this.scale.valuesCount=this.segments.length},updateScaleRange:function(c){var a=[];d.each(c,function(c){a.push(c.value)});c=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:d.calculateScaleRange(a,d.min([this.chart.width,
this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);d.extend(this.scale,c,{size:d.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments);d.each(this.segments,function(c){c.save()});this.reflow();this.render()},reflow:function(){d.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2});this.updateScaleRange(this.segments);
this.scale.update();d.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2});d.each(this.segments,function(c){c.update({outerRadius:this.scale.calculateCenterOffset(c.value)})},this)},draw:function(c){var a=c||1;this.clear();d.each(this.segments,function(c,d){c.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(c.value)},a);c.endAngle=c.startAngle+c.circumference;0===d&&(c.startAngle=1.5*Math.PI);d<this.segments.length-1&&(this.segments[d+
1].startAngle=c.endAngle);c.draw()},this);this.scale.draw()}})}).call(this);(function(){var k=this.Chart,d=k.helpers;k.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,
datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},initialize:function(c){this.PointClass=k.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx});
this.datasets=[];this.buildScale(c);this.options.showTooltips&&d.bindEvents(this,this.options.tooltipEvents,function(a){a="mouseout"!==a.type?this.getPointsAtEvent(a):[];this.eachPoints(function(a){a.restore(["fillColor","strokeColor"])});d.each(a,function(a){a.fillColor=a.highlightFill;a.strokeColor=a.highlightStroke});this.showTooltip(a)});d.each(c.datasets,function(a){var e={label:a.label||null,fillColor:a.fillColor,strokeColor:a.strokeColor,pointColor:a.pointColor,pointStrokeColor:a.pointStrokeColor,
points:[]};this.datasets.push(e);d.each(a.data,function(d,g){var k;this.scale.animation||(k=this.scale.getPointPosition(g,this.scale.calculateCenterOffset(d)));e.points.push(new this.PointClass({value:d,label:c.labels[g],datasetLabel:a.label,x:this.options.animation?this.scale.xCenter:k.x,y:this.options.animation?this.scale.yCenter:k.y,strokeColor:a.pointStrokeColor,fillColor:a.pointColor,highlightFill:a.pointHighlightFill||a.pointColor,highlightStroke:a.pointHighlightStroke||a.pointStrokeColor}))},
this)},this);this.render()},eachPoints:function(c){d.each(this.datasets,function(a){d.each(a.points,c,this)},this)},getPointsAtEvent:function(c){c=d.getRelativePosition(c);c=d.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},c);var a=Math.round((c.angle-1.5*Math.PI)/(2*Math.PI/this.scale.valuesCount)),e=[];if(a>=this.scale.valuesCount||0>a)a=0;c.distance<=this.scale.drawingArea&&d.each(this.datasets,function(c){e.push(c.points[a])});return e},buildScale:function(c){this.scale=new k.RadialScale({display:this.options.showScale,
fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,
angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:c.labels,
valuesCount:c.datasets[0].data.length});this.scale.setScaleSize();this.updateScaleRange(c.datasets);this.scale.buildYLabels()},updateScaleRange:function(c){var a=function(){var a=[];d.each(c,function(c){c.data?a=a.concat(c.data):d.each(c.points,function(c){a.push(c.value)})});return a}(),a=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:
d.calculateScaleRange(a,d.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);d.extend(this.scale,a)},addData:function(c,a){this.scale.valuesCount++;d.each(c,function(c,d){var g=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(c));this.datasets[d].points.push(new this.PointClass({value:c,label:a,x:g.x,y:g.y,strokeColor:this.datasets[d].pointStrokeColor,fillColor:this.datasets[d].pointColor}))},
this);this.scale.labels.push(a);this.reflow();this.update()},removeData:function(){this.scale.valuesCount--;this.scale.labels.shift();d.each(this.datasets,function(c){c.points.shift()},this);this.reflow();this.update()},update:function(){this.eachPoints(function(c){c.save()});this.reflow();this.render()},reflow:function(){d.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:d.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2});this.updateScaleRange(this.datasets);
this.scale.setScaleSize();this.scale.buildYLabels()},draw:function(c){var a=c||1,e=this.chart.ctx;this.clear();this.scale.draw();d.each(this.datasets,function(c){d.each(c.points,function(c,d){c.hasValue()&&c.transition(this.scale.getPointPosition(d,this.scale.calculateCenterOffset(c.value)),a)},this);e.lineWidth=this.options.datasetStrokeWidth;e.strokeStyle=c.strokeColor;e.beginPath();d.each(c.points,function(a,c){0===c?e.moveTo(a.x,a.y):e.lineTo(a.x,a.y)},this);e.closePath();e.stroke();e.fillStyle=
c.fillColor;e.fill();d.each(c.points,function(a){a.hasValue()&&a.draw()})},this)}})}).call(this)},1558:function(s,v,q){var x=q(1512),k=q(1006);YUI.add("squarespace-chartjs-helpers",function(d){function c(){w.map(function(a){return null===a.node.getDOMNode()?a:null}).filter(function(a){return a}).forEach(function(a){a.destroy()})}function a(a,c,d){var e={"default":[[121,121,121],[191,191,191],[229,229,229],[156,156,156],[0,0,0]],Muted:[[52,43,43],[112,105,100],[156,148,131],[212,207,198],[240,226,
208]],Primary:[[240,82,59],[247,180,19],[36,128,196],[144,187,98],[134,95,144]],Warm:[[153,0,0],[226,71,45],[233,148,48],[248,220,171],[251,243,171]],Cool:[[16,44,99],[7,75,230],[81,146,235],[158,173,211],[225,220,252]],"Tea Party":[[115,13,3],[182,125,44],[234,195,148],[231,144,72],[64,2,18]],Highway:[[176,201,217],[166,166,166],[89,72,57],[191,108,59],[230,134,50]],Shops:[[227,227,230],[69,78,89],[95,205,217],[113,153,138],[213,230,69]],Suburbs:[[73,33,48],[227,227,227],[69,84,115],[206,208,159],
[236,101,102]],"DB-Nine":[[134,135,136],[168,182,111],[169,143,119],[227,126,94],[100,138,189]],"M-Three":[[98,140,187],[209,191,78],[90,98,105],[13,76,136],[188,199,208]],Thunderbird:[[217,60,73],[103,189,218],[231,231,192],[227,170,179],[177,202,123]]};a in e||(a="default");a=e[a];return"rgba("+a[c%a.length]+","+{dark:1,medium:0.75,light:0.5,xlight:0.2,off:0}[d]+")"}function e(a){return{scaleFontFamily:a.getComputedStyle("font-family"),scaleFontSize:parseInt(a.getComputedStyle("font-size"),10),
scaleFontStyle:a.getComputedStyle("font-style"),tooltipFontFamily:a.getComputedStyle("font-family"),tooltipFontSize:0.8*parseInt(a.getComputedStyle("font-size"),10),tooltipFontStyle:a.getComputedStyle("font-style"),tooltipTitleFontFamily:a.getComputedStyle("font-family"),tooltipTitleFontSize:parseInt(a.getComputedStyle("font-size"),10),tooltipTitleFontStyle:"bold",scaleLabel:"<%= '  ' + value%>"}}function f(a,c){if(c){var e=a.sampleLabels;a.sampleLabels=a.seriesLabels;a.seriesLabels=e;a.data=d.Array(a.data[0]).map(function(c,
e){return d.Array(a.data).map(function(a){return a[e]})})}var f=Math.min(a.data.length,a.sampleLabels.length),e=Math.min(a.data[0].length,a.seriesLabels.length);a.sampleLabels=a.sampleLabels.slice(0,f);a.seriesLabels=a.seriesLabels.slice(0,e);a.data=a.data.slice(0,f);for(f=0;f<a.data.length;f++)a.data[f]=a.data[f].slice(0,e);return a}function g(a,c,d){c=d.sampleLabels.length-a.datasets[0][c].length;return(a=d.seriesLabels.length-a.datasets.length)||c&&a}function s(a,c,e){var f=a.datasets.length,g=
e.seriesLabels.length-f;if(0<g)for(var k=a.datasets[f-1],f=0;f<g;f++)a.datasets.push(d.clone(k));else 0>g&&(a.datasets=a.datasets.slice(0,e.seriesLabels.length));f=a.datasets[0][c].length;g=e.sampleLabels.length-f;if(0<g){k=f;for(f=0;f<g;f++){var q=d.Array(e.seriesLabels).map(function(){return 0});a.addData(q,e.sampleLabels[k++])}}else if(0>g)for(f=0;f>g;f--)a.removeData();for(g=0;g<e.sampleLabels.length;g++)a.scale.xLabels[g]=e.sampleLabels[g];for(g=0;g<a.datasets.length;g++){a.datasets[g].label=
e.seriesLabels[g];for(f=0;f<a.datasets[g][c].length;f++){k=e.data[f][g];if(isNaN(k)||null===k||void 0===k)k=0;a.datasets[g][c][f].value=[k];a.datasets[g][c][f].label=e.sampleLabels[f]}}a.update()}function q(a,c){return function(e){var f;f=""+('<ul class="'+d.Escape.html(e.name.toLowerCase())+'-legend">');for(var g=0;g<e[a].length;g++)f+='<li><span style="background-color:'+e[a][g][c]+'"></span>',e[a][g].label&&(f+=d.Escape.html(e[a][g].label)),f+="</li>";return f+"</ul>"}}function v(a){0==d.Array(a.data).reduce(function(a,
c){return a+(0<c.length?c[0]:0)},0)&&(a.data=d.Array(a.data).map(function(a){return d.Array(a).map(function(a,c){return 0==c?1:a})}));return a}function C(){d.one(d.config.win).after("resize",function(){clearTimeout(z);z=setTimeout(function(){w.forEach(function(a){a.resize()})},50)})}var w=[],A=function(a,c,e,g,k){this.node=a;this._options=k||{};"CANVAS"!=a.get("tagName")&&(a=a.one("canvas"));this._canvas=a;this._narrow=!1;this._palette=e;this._flip=g;this._data=f(d.clone(c,!0),this._flip);this._makeChart();
this.generateLegend();this.resize();w.push(this)};A.prototype={destroy:function(){this._chart.destroy();w.remove(this)},resize:function(){var a=this._canvas.getDOMNode();a?0<a.parentNode.clientWidth&&(this._chart.stop(),this._chart.resize(this._chart.render,!0),500>a.parentNode.clientWidth?("Bar"===this._chart.name&&!this._narrow&&(this._options=d.merge(this._options,{barValueSpacing:5,barDatasetSpacing:1}),this._rebuildChart()),this.node.addClass("narrow-chart"),this._narrow=!0):("Bar"===this._chart.name&&
this._narrow&&(this._options=d.merge(this._options,{barValueSpacing:20,barDatasetSpacing:5}),this._rebuildChart()),this.node.removeClass("narrow-chart"),this._narrow=!1)):c()},generateLegend:function(){this.node.all(".legend-content").each(function(a){a.empty();a.append(this._chart.generateLegend())},this)},_rebuildChart:function(){this._chart.destroy();this._makeChart()}};var D=d.namespace("ChartJS").BarChart=d.extend(function(){D.superclass.constructor.apply(this,arguments)},A,{_makeChart:function(){for(var c=
d.merge(e(this.node),{barShowStroke:!0,datasetStrokeWidth:3,animationSteps:25,barValueSpacing:20,barDatasetSpacing:5,legendTemplate:q("datasets","fillColor")},this._options),f={labels:this._data.sampleLabels,datasets:[]},g=0;g<this._data.seriesLabels.length;g++){for(var k=[],p=0;p<this._data.sampleLabels.length;p++)k.push(this._data.data[p][g]);f.datasets.push({label:this._data.seriesLabels[g],data:k,fillColor:a(this._palette,g,"dark"),strokeColor:"rgba(0,0,0,0)",highlightFill:a(this._palette,g,"medium"),
highlightStroke:"rgba(0,0,0,0)"})}this._canvas.empty();g=this._canvas.getDOMNode().getContext("2d");this._chart=(new x(g)).Bar(f,c)},sync:function(a){this._data=a?f(d.clone(a,!0),this._flip):t(k.CHART_BAR);g(this._chart,"bars",this._data)?this._rebuildChart():s(this._chart,"bars",this._data);this.generateLegend();this.resize()}}),u=d.namespace("ChartJS").LineChart=d.extend(function(){u.superclass.constructor.apply(this,arguments)},A,{_makeChart:function(){for(var c=d.merge(e(this.node),{datasetFill:!1,
animationSteps:25,legendTemplate:q("datasets","strokeColor")},this._options),f={labels:this._data.sampleLabels,datasets:[]},g=0;g<this._data.seriesLabels.length;g++){for(var k=[],p=0;p<this._data.sampleLabels.length;p++)k.push(this._data.data[p][g]);f.datasets.push({label:this._data.seriesLabels[g],data:k,fillColor:"rgba(0,0,0,0)",strokeColor:a(this._palette,g,"dark"),pointColor:a(this._palette,g,"dark"),pointStrokeColor:"#fff",pointHighlightFill:"#fff",pointHighlightStroke:a(this._palette,g,"medium")})}g=
this._canvas.getDOMNode().getContext("2d");this._chart=(new x(g)).Line(f,c)},sync:function(a){this._data=a?f(d.clone(a,!0),this._flip):t(k.CHART_LINE);g(this._chart,"points",this._data)?this._rebuildChart():s(this._chart,"points",this._data);this.generateLegend();this.resize()}}),y=d.namespace("ChartJS").PieChart=d.extend(function(){y.superclass.constructor.apply(this,arguments)},A,{_makeChart:function(){for(var c=d.merge(e(this.node),{datasetFill:!1,percentageInnerCutout:60,animationSteps:25,legendTemplate:q("segments",
"fillColor")},this._options),f=[],g=0;g<this._data.sampleLabels.length;g++)f.push({label:this._data.sampleLabels[g],value:this._data.data[g][0],color:a(this._palette,g,"dark"),highlight:a(this._palette,g,"medium")});g=this._canvas.getDOMNode().getContext("2d");this._chart=(new x(g)).Pie(f,c)},sync:function(c){this._data=c?v(f(d.clone(c,!0),this._flip)):t(k.CHART_PIE);c=this._chart;var e=this._data,g=c.segments.length,n=e.sampleLabels.length-g;if(0<n)for(var p=0;p<n;p++)c.addData({value:0,label:e.sampleLabels[g],
color:a(this._palette,g,"dark"),highlight:a(this._palette,g,"medium")}),g++;else if(0>n)for(p=0;p>n;p--)c.removeData();for(n=0;n<c.segments.length;n++)c.segments[n].value=e.data[n][0],c.segments[n].label=e.sampleLabels[n];c.update();this.generateLegend();this.resize()}}),t=d.namespace("ChartJS").getDefaultChartData=function(a){switch(parseInt(a,10)){case k.CHART_BAR:return{data:[[150],[250],[150]],sampleLabels:["New York","Las Vegas","San Francisco"],seriesLabels:["Population"]};case k.CHART_LINE:return{data:[[150,
100],[250,200],[150,350]],sampleLabels:["New York","Las Vegas","San Francisco"],seriesLabels:["Population","GDP"]};case k.CHART_PIE:return{data:[[150],[200],[150]],sampleLabels:["New York","Las Vegas","San Francisco"],seriesLabels:["Population"]}}};d.namespace("ChartJS").createChart=function(a,c,d,e,f){a=parseInt(a,10);if(!d||!d.data||0==d.data.length)d=t(a);a:{switch(a){case k.CHART_BAR:a=D;break a;case k.CHART_LINE:a=u;break a;case k.CHART_PIE:a=y;break a}a=void 0}return new a(c,d,e,f)};var E=d.namespace("ChartJS").initializeCharts=
function(){d.all(".sqs-block.chart-block .chart-block-container").each(function(a){c();if(!(0<=w.map(function(a){return a.node}).indexOf(a))){var e=a.getAttribute("data-settings")||"{}";try{var f=JSON.parse(e.replace(/\&quot;/g,'"'));new d.ChartJS.createChart(f.chartType,a,f.dataTable,f.palette,f.flip)}catch(g){if(g instanceof SyntaxError)console.error("Failed to render chart. Parse error.");else throw g;}}})},z;d.config.win.Squarespace.onInitialize(d,function(){E();C()});d.config.win.Squarespace.onDestroy(d,
function(){clearTimeout(z);w.forEach(function(a){a.destroy()})})},"1.0",{requires:[]})}});

}