/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/jj-chart@1.0.3/src/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/**
 * @mtfe/mchart - A JavaScript chart library for Canvas.
 * @date 2018/03/16
 * @version v1.0.3
 * @license ISC
 */
"use strict";!function(t){var e=function(){var e=Object.prototype.toString,n=function(t){return"[object Object]"===e.call(t)},i=function(t,e){return"number"==typeof t&&!isNaN(t)&&(!0!==e||isFinite(t))},r=function(t){return"[object Array]"===e.call(t)},o=function(t){return"[object Function]"===e.call(t)},s=function(t){return"[object String]"===e.call(t)},l={DEVICE_PIXEL_RATIO:t.devicePixelRatio||1,isArray:r,isFunction:o,isObject:n,isString:s,isNumber:i,isNumberIN:function(t){return i(t)&&isFinite(t)},isEmptyObject:function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},defined:function(t){return null!=t},pack:function(){var t={number:[0,i],function:[null,o],object:[null,n],string:["",s],array:[[],r]},e=arguments,a=e[0];!s(a)&&(a="");var l,h,u=e.length,c=t[a];for(h=1;h<u;h++)if(l=e[h],a&&c&&c[1]&&c[1](l))return l;return c&&c[0]}},h=l.extend=function(){var t,e,i=arguments,r=1,a=i.length,s=i[0];for(n(s)||o(s)||(s={});r<a;r++)for(e in t=i[r]){var l=s[e],u=t[e];l!==u&&(u&&n(u)?s[e]=h(l,u):void 0!==u&&(s[e]=u))}return s};return l.Math=function(){var t=Math.pow,e=Math.round,n=Math.log;return{log:function(t,e,i){return e=e||10,void 0===i&&(i=!0),(i?n(t<0?0:t):-n(t>0?0:-t))/n(e)},pow:function(e,n,i){return n=n||10,void 0===i&&(i=!0),i?t(n,e):-t(n,-e)},round:function(n,i){return 0===(i=t(10,i||0))?n:e(n*i)/i}}}.call("undefined"!=typeof window?window:this),l.Numeric=function(){var t=Math.abs,e=Math.log,n=Math.pow,i=Math.round;var r={clamp:function(t,e,n){return(t=t||0)<e?e:t>n?n:t},percentage:function(t,e){var n;return"number"==typeof(n=t)&&n==n&&/^[+\-\s\.\d]+\s*%\s*$/.test(e)?t*(parseFloat(e,10)/100):NaN},interpolate:function(t,e,n,i,r){var a=n-e;return i+(r-i)*((t-e)*(a=a?1/a:0))},toPrecision:function(r,a){return arguments.length<2&&(a=8),Number.prototype.toPrecision?Number(r).toPrecision(a):function(r,a){if(0===r||isNaN(r)||isFinite(r))return""+r;var o,s=~~(e(t(r))/Math.LN10);return a>s?""+(0===(o=n(10,a-s-1))?r:i(r*o)/o):""+(0===(o=n(10,a-s+1))?r:i(r/o)*o)}(r,a)}};return r}.call(void 0!==t?t:this),l.Vector=function(){var t=function(t){return"number"==typeof t&&t==t};function e(){var e,n,i={number:[0,t]},r=Array.prototype.slice.call(arguments,0),a=r[0];for(n=1;n<r.length;n++)if(e=r[n],a&&i[a]&&i[a][1]&&i[a][1](e))return e;return i[a]&&i[a][0]}var n=function(){return arguments.length>=3?new r(arguments[0],arguments[1],arguments[2]):new i(arguments[0],arguments[1])};function i(e,n){if(!t(e)||!t(n))throw new Error("x and y not a number.");return this.x=e,this.y=n,this}function r(t,e,n){this.x=t,this.y=e,this.z=n}return n.prototype={add:function(t){this.x+=e("number",t.x,0),this.y+=e("number",t.y,0)},sub:function(t){return this.x-=e("number",t.x,0),this.y-=e("number",t.y,0),this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},i.prototype=n.prototype,i.prototype.horizontal=function(t){var e=this.x,n=this.y,i=t.x,r=t.y,a=i-e;return!(Math.abs(a)<=.1)&&(r-n)/a<=.1},"object"==typeof module&&module.exports?module.exports=n:"function"==typeof define&&define.amd&&define((function(){return n})),n}.call(void 0!==t?t:window),l.Formatter=function(){var e={String:{},TRouBLe:function(){var t=arguments,e=t.length,n=t[0],o=function(t,e){for(var n=[],i=-1;++i<t;)n.push(a("number",e[i],0));return n},s=function(t){for(var e=[],n=t.length,i=-1;++i<n;)e.push(a("number",t[i],0));return e},l=function(){for(var t=[].slice.call(arguments,0),e=-1,n=t.length,i=[];++e<n;)i=i.concat(t[e]);return i};return!e&&!(n=0)||i(n,!0)&&1===e?[n,n,n,n]:(!r(t[0])&&e&&(n=[].slice.call(t,0)),1===(e=n.length)?o(4,n.concat(n,n,n)):2===e?l(o(2,n),s(n)):3===e?l(s(n),o(1,[n[0]])):s(n.slice(0,4)))}};function n(t){var n=t.defined,i=t.isNumber;return e.String={padding:function(t,e){return t>-1&&t<10?(e=e||"0")+t:t},numberFormat:function(t,e,r){var a=n(r)?i(r=Math.abs(r))?r:2:Math.min((t.toString().split(".")[1]||"").length,20),o=t<0?"-":"",s=String(parseInt(t=Math.abs(t).toFixed(a))),l=s.length>3?s.length%3:0;return e="string"==typeof e?e:",",!isNaN(+t)&&isFinite(t)?[o,l?s.substr(0,l)+e:"",s.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+e),a?"."+Math.abs(t-s).toFixed(a).slice(2):""].join(""):""}},e}var o={deps:function(){var e=Array.prototype.slice.call(arguments,0);return n.apply(t,[].concat(e))}};return"object"==typeof module&&module.exports?module.exports=o:"function"==typeof define&&define.amd&&define((function(){return o})),o}.call(void 0!==t?t:this).deps(l),l.Heap=function(){var t=function(t,e){return t-e};var e=function(t){return new e.init(t)};return e.init=function(e){return t=e||t,this.length=0,this},e.prototype={push:function(e){var n=this.length;return this[n]=e,function(e,n){for(var i=e[n];n>0;){var r=(n+1>>1)-1,a=e[r];if(t(i,a)>=0)break;e[n]=a,e[n=r]=i}}(this,n++),this.length=n},pop:function(){var e=this.length;if(e<=0)return null;var n=this[0],i=this.splice(e-1,1)[0];return(this.length=--e)>0&&(this[0]=i,function(e,n){for(var i=e[n],r=e.length;;){var a=n+1<<1,o=a-1,s=n,l=e[s];if(o<r&&t(l,e[o])>0&&(l=e[s=o]),a<r&&t(l,e[a])>0&&(l=e[s=a]),s===n)break;e[n]=l,e[n=s]=i}}(this,0)),n},peek:function(){return this[0]},splice:[].splice,size:function(){return this.length},empty:function(){return this.length<=0}},e.init.prototype=e.prototype,"object"==typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd&&define((function(){return e})),e}.call("undefined"!=typeof window?window:this),l.KDTree=function(t){var e=function(t,e,n){this.node=t,this.left=null,this.right=null,this.parent=e,this.dim=n};function n(t){var n=new t((function(t,e){return e.distance-t.distance}));function i(t,n,r,a){var o,s,l,h=t.length,u=n%Math.max(1,a.length),c=function(t,e){return t-e};return h?1===h?new e(t[0],r,u):(a.length&&(o=a[u],c=function(t,e){return t[o]-e[o]}),t.sort(c),(l=new e(t[s=t.length>>1],r,u)).left=i(t.slice(0,s),n+1,l,a),l.right=i(t.slice(s+1),n+1,l,a),l):null}var r=function(t,e){return new r.init(t.slice(0),e)};return r.init=function(t,e){return this.build(t,e),this},r.prototype={build:function(t,e){this.dimensions=e||["x","y"],this.root=i(t,0,null,this.dimensions)},nearest:function(t,e,i){var r=this.dimensions,a=r.length;for(i=i||1;!n.empty();)n.pop();function o(t,e){n.push({node:t,distance:e}),n.size()>i&&n.pop()}this.root&&function s(l){var h,u,c={},f=e(t,l.node);if(a?r.forEach((function(e,n){c[e]=n===l.dim?t[e]:l.node[e]})):c=t,h=e(c,l.node),null===l.right&&null===l.left)return(n.size()<i||f<n.peek().distance)&&o(l,f),null;if(s(u=null===l.right?l.left:null===l.left?l.right:(a?t[r[l.dim]]<l.node[r[l.dim]]:t<l.node)?l.left:l.right),(n.size()<i||f<n.peek().distance)&&o(l,f),n.size()<i||Math.abs(h)<n.peek().distance){var d=u===l.left?l.right:l.left;null!==d&&s(d)}}(this.root);for(var s=[],l=0;l<i;l++)n.empty()||null===n[l].node||s.push(n[l].node.node);return s},insert:function(){},remove:function(){},destroy:function(){this.root=null}},r.init.prototype=r.prototype,r}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return n.apply(t,[].concat(e))}}}("undefined"!=typeof window?window:this).deps(l.Heap),l.Geometry=function(t){function e(t,e){var n={distance:function(t,e){var n=t.x,i=t.y,r=e.x,a=e.y;return Math.sqrt((n-r)*(n-r)+(i-a)*(i-a))},line:function(t,e){return this.distance(t,e)<=e.width},circle:function(t,e){var n=e.x-t.x,i=e.y-t.y,r=t.radius+e.radius;return r*r-n*n-i*i<.001},pie:function(t,e){var n=2*Math.PI,i=t.x-e.x,r=t.y-e.y,a=this.distance(t,e)<=e.radius;if(a&&"number"==typeof e.innerRadius&&(a=this.distance(t,e)>=e.innerRadius),a){var o=Math.atan2(r,i)+Math.PI/2;if(o<0&&(o+=n),o>n&&(o-=n),o>=e.startAngle&&o<=e.endAngle)return a}return!1},rect:function(t,e){var n=(t.x-e.x)*(t.x-e.width),i=(t.y-e.y)*(t.y-e.height);return n<=0&&i<=0},polygon:function(t,e){for(var n=0,i=0,r=e.length,a=r-1;i<r;a=i,i++){var o=e[i],s=e[a];if((o.x-t.x)*(t.x-s.x)>=0&&(o.y-t.y)*(t.y-s.y)>=0&&(t.x-o.x)*(s.y-o.y)==(t.y-o.y)*(s.x-o.x))return!0;var l=Math.atan2(o.y-t.y,o.x-t.x)-Math.atan2(s.y-t.y,s.x-t.x);l>=Math.PI?l-=2*Math.PI:l<=-Math.PI&&(l+=2*Math.PI),n+=l}return 0!==Math.round(n/Math.PI)}};return{Intersection:n,Line:{smooth:function(t,e,n,i){var r,a,o,s,l,h,u,c,f,d,p,g=1.5,y=2.5,x=null;return l=e.x,h=e.y,t&&n&&(r=((u=t.x)+g*l)/y,a=((c=t.y)+g*h)/y,o=((f=n.x)+g*l)/y,s=((d=n.y)+g*h)/y,i?(o+=p=(o-r)*(s-h)/(s-a)+l-o,(r+=p)>u&&r>l?o=2*l-(r=Math.max(u,l)):r<u&&r<l&&(o=2*l-(r=Math.min(u,l))),o>f&&o>l?r=2*l-(o=Math.max(f,l)):o<f&&o<l&&(r=2*l-(o=Math.min(f,l)))):(s+=p=(s-a)*(o-l)/(o-r)+h-s,(a+=p)>c&&a>h?s=2*h-(a=Math.max(c,h)):a<c&&a<h&&(s=2*h-(a=Math.min(c,h))),s>d&&s>h?a=2*h-(s=Math.max(d,h)):s<d&&s<h&&(a=2*h-(s=Math.min(d,h)))),e.rightContX=o,e.rightContY=s),t&&(x={x1:t.rightContX||t.x,y1:t.rightContY||t.y,x2:r||l,y2:a||h,x:l,y:h}),x},Dash:{line:function(t,e,n,i,r){var a=n-t,o=i-e,s=Math.sqrt(a*a+o*o),l=Math.atan2(o,a),h=r.length,u=0,c=!0;return function(n){for(n.save(),n.translate(t,e),n.rotate(l),n.moveTo(t=0,0);s>t;)(t+=r[u++%h])>s&&(t=s),n[c?"lineTo":"moveTo"](t,0),c=!c;n.stroke(),n.restore()}},arc:function(t,e,n,i,r,o,s){!function(t,e,n,i,r,o,s){var l=a("number",s&&s[0],1),h=a("number",s&&s[1],2),u=V/i/(2/l),c=r,f=c+u;for(h=V/i/(2/h);f<o;)t.beginPath(),t.arc(e,n,i,c,f,!1),t.stroke(),f=(c=f+h)+u}(t,e,n,i,r,o,{dot:[2,6],dash:[8,6],shortdash:[6,2],shortdot:[2,2],longdash:[16,6]}[s]||[2,6])},solid:function(t,e,n,i,r){t.moveTo(e,n),t.lineTo(i,r),t.stroke()},dot:function(t,e,n,i,r){this.line(e,n,i,r,[2,6])(t)},dash:function(t,e,n,i,r){this.line(e,n,i,r,[8,6])(t)},shortdash:function(t,e,n,i,r){this.line(e,n,i,r,[6,2])(t)},shortdot:function(t,e,n,i,r){this.line(e,n,i,r,[2,2])(t)},shortdashdot:function(t,e,n,i,r){this.line(e,n,i,r,[6,2,2,2])(t)},shortdashdotdot:function(t,e,n,i,r){this.line(e,n,i,r,[6,2,2,2,2,2])(t)},longdash:function(t,e,n,i,r){this.line(e,n,i,r,[16,6])(t)},dashdot:function(t,e,n,i,r){this.line(e,n,i,r,[8,6,2,6])(t)},longdashdot:function(t,e,n,i,r){this.line(e,n,i,r,[16,6,2,6])(t)},longdashdotdot:function(t,e,n,i,r){this.line(e,n,i,r,[16,6,2,6,2,6])(t)}}},Rect:{getRotationBound:function(t,e,n){var i=Math.sin,r=Math.cos,a=Math.abs;if(0===n)return{width:t,height:e};var o=a(i(n=n*Math.PI/180)*t);return{width:a(r(n)*t)+a(i(n)*e),height:o+a(r(n)*e)}}}}}var n={deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[t].concat(n))}};return"object"==typeof module&&module.exports?module.exports=n:"function"==typeof define&&define.amd&&define((function(){return n})),n}("undefined"!=typeof window?window:this).deps(l),l.Color=function(){var t,e=Object.prototype.toString,n=function(t){return null!=t},i=function(t){return"[object Object]"===e.call(t)},r=function(t){return"[object Number]"===e.call(t)},a=function(t,n){var r;for(r in i(t)||"[object Function]"===e.call(t)||(t={}),n){var o=t[r],s=n[r];o!==s&&(s&&i(s)?t[r]=a(o,s):void 0!==s&&(t[r]=s))}return t},o=function(t,e,n){return t<e?e:t>n?n:t},s=/^#(([\da-f])([\da-f])([\da-f])([\da-f]{3})?)$/i,l=/(rgba?)\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d\.]+))?\)/,h=/(hsl?)\((\d+),\s*(\d+)%,\s*(\d+)%\)/,u=function(t){var e,i,o=s.exec(t);if((i=c.LOOKUP_TABLE).hasOwnProperty(t)&&(e=n(i.a)?i:a({a:1},i[t])),o&&(e=o[5]?o[1]:[o[2],o[2],o[3],o[3],o[4],o[4]].join(""),e={r:(e=parseInt(e,16))>>>16&255,g:e>>>8&255,b:255&e,a:1}),(o=l.exec(t))&&(e={r:0|o[2],g:0|o[3],b:0|o[4],a:"rgb"===o[1]?1:parseFloat(o[5],10)},r(e.a)||(e.a=1)),o=h.exec(t)){var u=function(t,e,n){return n<0&&n++,n>1&&n--,n<1/6?t+(e-t)*n*6:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},f=parseFloat(o[2],10)/360%360,d=Math.min(1,Math.max(0,parseFloat(o[3],10)/100)),p=Math.min(1,Math.max(0,parseFloat(o[4],10)/100));if(f<0&&f++,0===d)d=f=p;else{var g=p<.5?p*(d+1):p+d-p*d,y=2*p-g;d=u(y,g,f+1/3),p=u(y,g,f),f=u(y,g,f-1/3)}e={r:~~(256*d),g:~~(256*p),b:~~(256*f),a:1}}return e||(e={r:0,g:0,b:0,a:1}),e},c={};c.RED_MASK=16711680,c.GREEN_MASK=65280,c.BLUE_MASK=255,c.ALPHA_MASK=4278190080,c.LOOKUP_TABLE={aqua:{r:0,g:255,b:255,a:1},lime:{r:0,g:255,b:0,a:1},silver:{r:192,g:192,b:192,a:1},black:{r:0,g:0,b:0,a:1},maroon:{r:128,g:0,b:0,a:1},teal:{r:0,g:128,b:128,a:1},blue:{r:0,g:0,b:255,a:1},navy:{r:0,g:0,b:128,a:1},white:{r:255,g:255,b:255,a:1},fuchsia:{r:255,g:0,b:255,a:1},olive:{r:128,g:128,b:0,a:1},yellow:{r:255,g:255,b:0,a:1},orange:{r:255,g:165,b:0,a:1},gray:{r:128,g:128,b:128,a:1},purple:{r:128,g:0,b:128,a:1},green:{r:0,g:128,b:0,a:1},red:{r:255,g:0,b:0,a:1},pink:{r:255,g:192,b:203,a:1},cyan:{r:0,g:255,b:255,a:1},transparent:{r:255,g:255,b:255,a:0}},c.red=function(t){return(t&c.RED_MASK)>>>16},c.green=function(t){return(t&c.GREEN_MASK)>>>8},c.blue=function(t){return t&c.BLUE_MASK},c.alpha=function(t){return(t&c.ALPHA_MASK)>>>24},a(c,{isColor:function(t){return c.LOOKUP_TABLE.hasOwnProperty(t)||s.exec(t)||l.exec(t)},rgb:function(t){return"rgba("+t.r+","+t.g+","+t.b+")"},rgba:function(t){return"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},hex:function(t){var e;return"#"+(e=function(t){return(t=Math.max(0,Math.min(t,255)).toString(16)).length<2?"0"+t:t})(t.r)+e(t.g)+e(t.b)},toString:function(t){return"rgba("+((t&c.RED_MASK)>>>16)+","+((t&c.GREEN_MASK)>>>8)+","+(t&c.BLUE_MASK)+","+((t&c.ALPHA_MASK)>>>24)/255+")"},interpolate:function(t,e){var n,i,r,a,o,s;return t=u(t),e=u(e),a=e.r-(n=t.r),o=e.g-(i=t.g),s=e.b-(r=t.b),function(t){return c.hex({r:Math.round(n+a*t),g:Math.round(i+o*t),b:Math.round(r+s*t)})}},lerp:(t=function(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}},function(e,n,i){var r=[],a=[],o=Math.min(e.length,n.length)-1,s=1;for(e[o]<e[0]&&(e=e.slice().reverse(),n=n.slice().reverse());s<=o;s++)r.push(t(e[s-1],e[s])),a.push(i(n[s-1],n[s]));return function(t){for(var n,i=1,s=o;i<s;)t<e[n=i+s>>1]?s=n:i=n+1;return a[i-=1](r[i](t))}})});var f=a({},c);return f.parse=function(t){return new f.prototype.init(t)},f.prototype={init:function(t){var e;return this.a=+!(this.r=this.g=this.b=0),c.isColor(t)?(e=u(t),this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a):i(t)&&(t.hasOwnProperty("radialGradient")||t.hasOwnProperty("linearGradient"))&&f.Gradient.parse.call(this,t),this},add:function(t,e){return t<128?2*t*e/255:255-2*(255-t)*(255-e)/255},linear:function(t,e,i,r){var a=f.GRADIENT_CONTEXT;if(n(a)){var o=a.createLinearGradient(this.x1*t,this.y1*e,this.x2*i,this.y2*r);return this.stops.forEach((function(t){o.addColorStop(t[0],t[1])})),o}return null},radial:function(t,e,i){var a=f.GRADIENT_CONTEXT;if(n(a)){t=r(t)?t:0,e=r(e)?e:0,i=r(i)?i:0;var o=this.cx0*i,s=this.cy0*i,l=o+t,h=s+e,u=this.cr0*i+Math.sqrt(o*o+s*s),c=a.createRadialGradient(l,h,0,l,h,u);return this.stops.forEach((function(t){c.addColorStop(t[0],t[1])})),c}return null}},f.prototype.init.prototype=f.prototype,a(f.prototype,c),a(f.prototype,{rgba:function(){return c.rgba(this)},rgb:function(){return c.rgb(this)},alpha:function(t){return arguments.length?(this.a=Math.max(0,Math.min(1,t)),this):this.a},hex:function(){return c.hex(this)},hsl:function(){},interpolate:function(t){return c.interpolate(this,t)},value:function(){return this.a<<24|this.r<<16|this.g<<8|this.b}}),f.GRADIENT_CONTEXT=null,f.Gradient={parse:function(t){var i,a,s,l,h,u,f,d,p,g,y=[];n(i=t.radialGradient)&&(this.cx0=a=o(r(a=(i=i||{}).cx)?a:1,0,1),this.cy0=s=o(r(s=i.cy)?s:1,0,1),this.cr0=l=o(r(l=i.r)?l:0,0,1)),n(h=t.linearGradient)&&(this.x1=u=o(r(u=(h=h||{}).x1)?u:0,0,1),this.y1=f=o(r(f=h.y1)?f:0,0,1),this.x2=d=o(r(d=h.x2)?d:0,0,1),this.y2=p=o(r(p=h.y2)?p:0,0,1)),g=t.stops,"[object Array]"===e.call(g)&&t.stops.forEach((function(t){var e=r(t[0])?t[0]:1,n=c.isColor(t[1])?t[1]:"#000";y.push([o(e,0,1),n])})),this.stops=y,this.color=y.length?y[y.length-1][1]:"#000"}},"object"==typeof module&&module.exports?module.exports=f:"function"==typeof define&&define.amd&&define([],(function(){return f})),f}(),l.Text=function(t){var e,n,i,r,a,o=t.document,s=Math.sin,l=Math.cos,h=Math.abs,u=Object.prototype.toString,c=function(t){return"[object Array]"===u.call(t)},f={_cache:{width:{},height:{}},context:function(t){f._context=t},getWidth:function(t,e){var n=(e=e||{}).fontFamily||"sans-serif",i=e.fontSize||"12px",r=e.fontWeight||"normal",a=[e.fontStyle||"normal",r,i+"/"+(e.lineHeight||"normal"),n].join(" "),s=0,l=(t=""+(t||"Eg"))+"-"+a;if(f._cache.width[l])return f._cache.width[l];var h=f._context;return o&&o.createElement?h=o.createElement("canvas").getContext("2d"):h&&h.canvas,h?(f._context=h,t.split("\n").forEach((function(){h.font=a,s=Math.max(s,h.measureText(t).width)})),f._cache.width[l]=s):0},getHeight:function(t,e){var n=(e=e||{}).fontFamily||"sans-serif",i=e.fontSize||"12px",r=e.fontWeight||"normal",a=[e.fontStyle||"normal",r,i+"/"+(e.lineHeight||"normal"),n].join(" ");if(0===String(t).length)return 0;var s=(t=""+(t||"Eg"))+"-"+a;if(f._cache.height[s])return f._cache.height[s];var l=f._context;if(l){if(l.canvas,"number"==typeof(f._cache.height[s]=l.measureText(t).emHeightAscent))return f._cache.height[s]}else f._context=l=o.createElement("canvas").getContext("2d");var h,u,c,d=Math.ceil(f.getWidth(t,e)),p=parseFloat(i,10)||12;l.save(),l.font=a,l.textBaseline="alphabetic",l.textAlign="left",l.fillStyle="#fff",l.fillText(t,0,Math.ceil(p)),c=l.getImageData(0,0,d,p).data,l.restore(),h=u=-1;for(var g=0;g<=p;g++)for(var y=0;y<d;y++){var x=y+g*d<<2;if(c[x]+c[x+1]+c[x+2]>0){-1===h&&(h=g),u=g;break}}return f._cache.height[s]=u-h+1},measureText:function(t,e){var n=e&&e.rotation,i=0,r=0,a={left:0,top:0,width:i,height:r};if(!(t=String(t)).length)return a;if(a.width=i=f.getWidth(t,e),a.height=r=f.getHeight(t,e),e&&"number"==typeof n&&isFinite(n)&&!isNaN(n)){var o=h(s(n=n*Math.PI/180)*i),u=h(l(n)*i),c=h(s(n)*r),d=h(l(n)*r);a.width=u+c,a.height=o+d}return a},multipText:function(t,e,n){var i=(n=n||{}).ellipse||"..",r=f._context;if(r||(f._context=r=o.createElement("canvas").getContext("2d")),f.getWidth(t,n)<=e)return t;e-=f.getWidth(i);for(var a,s=0,l=t.length;s<l;)a=1+(s+l>>>1),f.getWidth(t.slice(0,a),n)<e?s=a:l=a-1;return t.slice(0,s)+i}};return f.HTML=function(t,e,n){var i=(n=n||{}).fontSize||"12px",r=n.fontFamily||"Arial, sans-serif",a=n.fontWeight||"100",o=n.fontStyle||"normal",s={height:0,width:0},l=0,h=0,u=0,d=0,p=0;function g(t,y,x){for(var v,m,b=t.length|(v=0),w=a,M=o;v<b;v++)"br"!==(m=t[v]).type?("b"===m.type?e.font=[M,w="bold",i,r].join(" "):"i"===m.type?e.font=[M="italic",w,i,r].join(" "):"normal"!==m.type||y||(w=a,e.font=[M,w,i,r].join(" ")),"normal"===m.type&&(x&&x.call(e,m.value,u,h),s=f.measureText(m.value,n),l=Math.max(l,s.width),h=d+s.height,u+=s.width,p=Math.max(p,s.height)),"i"!==m.type&&"u"!==m.type&&"b"!==m.type||(c(m.value)&&g(m.value,!0,x),M=o,w=a)):(u=0,d+=s.height)}var y={getBBox:function(){return u=d=l=h=0,g(t,!1),{left:0,top:0,width:l,height:n.rotation?p:h}},toCanvas:function(){u=d=l=h=0,e.save(),"number"==typeof n.x&&"number"==typeof n.y&&e.translate(n.x,n.y),g(t,!1,(function(t,n,i){e.fillText(t,n,i)})),e.restore()},toHTML:function(){var e="";return function t(n){for(var i,r,a=n.length|(i=0);i<a;i++)"br"!==(r=n[i]).type?("normal"===r.type&&(e+=r.value),"i"!==r.type&&"u"!==r.type&&"b"!==r.type||(e+="<"+r.type+">",c(r.value)&&t(r.value),e+="</"+r.type+">")):e+="<br />";return e}(t),e}};return y},f.parseHTML=(e={tag:{br:/<br\s*\/?>/,all:/<([b|i|u])>(.*?)<\/\1>/g},specialSym:/([<>&])/g},n={"<":"&lt;",">":"&gt;","&":"&amp;"},i=function(t){return t.replace(e.specialSym,(function(t,e){return n[e]||t}))},r=function(t,n){if(!(t=""+t)||!e.tag.br.test(t))return[{type:"normal",value:t}];for(var r,a=t.split(e.tag.br),o=[],s=a.length-1,l=0;l<s;l++)""!==(r=a[l])?(n&&(r=i(r)),o.splice(o.length,0,{type:"normal",value:r},{type:"br"})):o.push({type:"br"});return s>=0&&""!==(r=a[s])&&(n&&(r=i(r)),o.push({type:"normal",value:r})),o},a=function(t,e){var n=/<([b|i|u])>(.*?)<\/\1>/gi;if(!(t=""+t))return r(t,e);for(var i,o=[],s=0;i=n.exec(t);){var l=i[0],h=i[1],u=i[2],c=n.lastIndex-s-l.length;if(c>0){var f=t.substr(s,c);o=o.concat(r(f,e))}var d=a(u,e);s=n.lastIndex,o.push({type:h,value:d})}return s<t.length&&(o=o.concat(r(t.slice(s),e))),o.length?o:r(t,e)},function(t,e){return a(t,e)}),f}("undefined"!=typeof window?window:t),l.Cluster=function(){var t,e={};return e.hirschbergs=(t=Math.min,function e(n,i,r,a,o,s,l,h,u,c){var f,d,p,g=[],y=0;if(a<=r)for(p=o;p<s;p++)g.push(c("+",p));else if(s<=o)for(d=r;d<a;d++)g.push(c("-",d));else if(a-1===r){for(f=n[r],y=0,p=o;p<s;p++)u(f,i[p])&&!y?(y=1,g.push(c("=",r,p))):g.push(c("+",p));!y&&g.push(c("-",r))}else if(s-1===o){for(f=i[o],y=0,d=r;d<a;d++)u(f,n[d])&&!y?(y=1,g.push(c("=",d,o))):g.push(c("-",d));!y&&g.push(c("+",o))}else{var x=r+a>>1;!function(e,n,i,r,a,o,s,l){var h,u,c;for(l[i%2][a]=0,u=a+1;u<=o;u++)l[i%2][u]=l[i%2][u-1]+1;for(h=i+1;h<=r;h++)for(l[h%2][a]=l[(h-1)%2][a]+1,u=a+1;u<=o;u++)c=l[(h-1)%2][u-1],s(e[h-1],n[u-1])||(c+=1),l[h%2][u]=t(c,t(l[(h-1)%2][u]+1,l[h%2][u-1]+1))}(n,i,r,x,o,s,u,l),function(e,n,i,r,a,o,s,l){var h,u,c;for(l[r%2][o]=0,u=o-1;u>=a;u--)l[r%2][u]=l[r%2][u+1]+1;for(h=r-1;h>=i;h--)for(l[h%2][o]=l[(h+1)%2][o]+1,u=o-1;u>=a;u--)c=l[(h+1)%2][u+1],s(e[h],n[u])||(c+=1),l[h%2][u]=t(c,t(l[(h+1)%2][u]+1,l[h%2][u+1]+1))}(n,i,x,a,o,s,u,h);var v=o,m=Number.MAX_VALUE;for(d=o;d<=s;d++){var b=l[x%2][d]+h[x%2][d];b<m&&(m=b,v=d)}g=e(n,i,r,x,o,v,l,h,u,c).concat(e(n,i,x,a,v,s,l,h,u,c))}return g}),e.List={partition:function(t,e){var n,i,r,a,o=(t=t||[]).length,s=0,l=[],h=new Array(o);for(s=0;s<o;s++){for(i=[r=t[s]],n=s+1;n<o;n++)e&&!0===e.call(t,r,a=t[n])&&(i.push(a),h[n]=!0);h[s]||l.push(i)}return h=null,l},filter:function(t,e){for(var n,i=t.length,r=0,a=[];r<i;r++)e&&!0===e.call(t,n=t[r])&&a.push(n);return a},indexOf:function(t,e){var n=Array.prototype.indexOf;return n?n.call(t,e):function(){for(var n=-1,i=t.length;++n<i&&t[n]!==e;);return n<i?n:-1}()},fill:function(t,e){return Array.prototype.fill?new Array(t=Math.max(0,t)||0).fill(e):function(){for(var n=[];t--;)n.push(e);return n}()}},"object"==typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd&&define((function(){return e})),e}.call(void 0!==t?t:this),l.Cluster.List.diff=function(t){var e=Array.prototype.forEach;function n(t,e,n){var i={op:t,newIndex:e};return"="===t&&(i.oldIndex=n),i}function i(t){var i=function(t,e,n){return new i.fn.compareTo(t,e,n="function"==typeof(r=n)?r:function(t,e){return t===e});var r};return i.fn=i.prototype={compareTo:function(i,r,a){for(var o=i.length,s=r.length,l=Math.min(o,s),h=-1,u=-1,c=0,f=this;++u<l&&a(i[o-u-1],r[s-u-1]););for(;++h<l&&a(i[h],r[h]);)f[c++]=n("=",h,h);if(o-u>=h||s-u>=h)for(e.call(t(i,r,h,o-u,h,s-u,[[],[]],[[],[]],a,n),(function(t){f[c++]=t})),h=0;h<u;h++)f[c++]=n("=",h+o-u,h+s-u);return this.length=c,this},length:0,splice:[].splice,forEach:function(t){for(var e=0,n=this.length;e<n;e++)t.call(this,this[e],this)},add:function(t){return this.adder=function(e){return t.call(this,e)},this},remove:function(t){return this.remover=function(e){return t.call(this,e)},this},modify:function(t){return this.modifer=function(e,n){return t.call(this,e,n)},this},each:function(t){this.forEach((function(e){var n;"+"===e.op&&(n=this.adder&&this.adder.call(e,e.newIndex)),"-"===e.op&&(n=this.remover&&this.remover.call(e,e.newIndex)),"="===e.op&&(n=this.modifer&&this.modifer.call(e,e.newIndex,e.oldIndex)),t&&t.call(e,n)})),this.adder=null,this.modifer=null,this.remover=null}},i.fn.compareTo.prototype=i.fn,i}var r={deps:function(){var e=Array.prototype.slice.call(arguments,0);return i.apply(t,[].concat(e))}};return"object"==typeof module&&module.exports?module.exports=r:"function"==typeof define&&define.amd&&define((function(){return r})),r}("undefined"!=typeof window?window:this).deps(l.Cluster.hirschbergs),l.ZTree=function(t){var e={deps:function(){var e=Array.prototype.slice.call(arguments,0);return t.apply(null,[].concat(e))}};return e}.call(this,(function(t){var e=function(t,e){this.parent=t,null!==e&&(this.leaf=e)},n=function(i,r,a,o){var s,l,h,u,c=a[o],f=0;if(o>=a.length)return new e(r,i);var d=t(i,(function(t,e){return(void 0!==t[c]||void 0!==e[c])&&t[c]===e[c]}));for(s=new e(r,null),h=0,l=d.length;h<l;h++)void 0===(u=d[h][0][c])&&(u="z-"+ ++f),s[u]=n(d[h],s,a,o+1);return s},i=function(t,e){return new i.init(t.slice(0),e)};return i.init=function(t,e){return this.build(t,e),this},i.prototype={build:function(t,e){this.root=n(t,null,e,0)},update:function(t,e){var n=this.root,i=function(t,e){for(var n in e)t[n]=e[n]},r=function(n){var a,o={};if(!n)return null;if(n.leaf)return o=a=t&&t(n.leaf),i(n,a),a;for(var s in n)n.hasOwnProperty(s)&&"parent"!==s&&(a=r(n[s]))&&(o=e&&e(o,a));return i(n,o),o};return r(n),this},getRoot:function(){return this.root}},i.init.prototype=i.prototype,i})).deps(l.Cluster.List.partition),l.geo=function(){var t=Math.PI/4,e=function(t){return t*Math.PI/180};function n(t,e){return[(t<-168.5?t+360:t)+170,90-e]}function i(){return function(i,r){var a=n(i,r);return[e(a[0]),Math.log(Math.tan(t+e(a[1])/2))]}}var r={Point:function(t,e){e.point(t)},MultiPoint:function(t,e){t.forEach((function(t){r.Point(t,e)}))},LineString:function(t,e){r.MultiPoint(t,e)},MultiLineString:function(t,e){t.forEach((function(t){e.points&&(e.points=[]),r.LineString(t,e),e.groups&&e.groups()}))},Polygon:function(t,e){e.clear&&e.clear(),r.MultiLineString(t,e)},MultiPolygon:function(t,e){e.clear&&e.clear(),t.forEach((function(t){r.MultiLineString(t,e)}))}};function a(t){var a,o,s,l,h,u,c=t.extend,f=t.isNumber,d=t.isArray,p=t.isObject,g=(o=[960,500],s=[1,1],l=[0,0],h=function(t,i){var r=n(t,i);return[e(r[0]),e(r[1])]},u="Point",c(a={},{type:function(t){return arguments.length?(u=r.hasOwnProperty(t)?t:"Point",a):u},size:function(){return arguments.length?(f(o=arguments[0])&&(o=[o,o]),d(o)&&o.length<2&&(o[1]=o[0]),a):o},translate:function(){return arguments.length?(f(l=arguments[0])&&(l=[l,l]),d(l)&&l.length<2&&(l[1]=l[0]),a):a},scale:function(){return arguments.length?(f(s=arguments[0])&&(s=[s,s]),d(s)&&s.length<2&&(s[1]=s[0]),a):s},projection:function(){return arguments.length?(h=arguments[0],a):h},parse:function(t,e){var n=o[0],i=o[1],a={points:[],get:function(){return a.polygons.length?a.polygons:a.points},polygons:[],clear:function(){this.polygons=[],this.points=[]},groups:function(){a.polygons.push(a.points)}},u=g.bounds(t),c=n*s[0],f=i*s[1],d=Math.max((u[1][0]-u[0][0])/c*1,(u[1][1]-u[0][1])/f*1),y=d=d?1/d:1,x=1.3*d,v=l[0],m=l[1];if(a.point=function(t){var e=h(t[0],t[1]),n=e[0],i=e[1];n=(e[0]-u[0][0])*y+v,i=(e[1]-u[0][1])*x+m,a.points.push({x:n,y:i})},p(t)){var b={FeatureCollection:function(t,e){(t.features||[]).forEach((function(t){b.Feature(t,e)}))},Feature:function(t,n){var i=t.geometry,a=i.type,o=i.coordinates;r[a](o,n),e&&e(n.get(),t)}};b[t.type](t,a)}}}));return g.bounds=function(t){var e=g.projection(),n=[[360,180],[0,0]],i={point:function(t){var i=e(t[0],t[1]),r=i[0],a=i[1];n[0][0]>r&&(n[0][0]=r),r>n[1][0]&&(n[1][0]=r),n[0][1]>a&&(n[0][1]=a),a>n[1][1]&&(n[1][1]=a)}};if(p(t)){var a={FeatureCollection:function(t){(t.features||[]).forEach((function(t){var e=t.geometry,n=t.type;"Feature"===n?r[e.type](e.coordinates,i):"GeometryCollection"===n&&t.geometries.forEach((function(t){r[t.type](t.coordinates,i)}))}))},Feature:function(t){var e=t.geometry,n=e.type,a=e.coordinates;r[n](a,i)}};a[t.type](t)}return n},{Mercator:i,Path:g}}var o=function(t){return function(e){return a.call(t,e)}}(this);return"object"==typeof module&&module.exports?module.exports=o:"function"==typeof define&&define.amd&&define((function(){return o})),o}.call("undefined"!=typeof window?window:this)(l),l}();!function(e){var n=e.defined,i=e.extend,r=t.document;var c=function(t,n){return new e.Chart.fn.init(t,n)};c.LineSegment={none:function(t,e,n){var i,r,o,s,l,h,u,c=a("string",(n=n||{}).dashStyle,"solid"),f=g.Line.Dash,d=(e||[]).length;if(d)for(t.beginPath(),t.moveTo(l=e[i=0].x,h=e[0].y);i<d;i++){if(o=(u=e[i]).x,s=u.y,null===u.value){for(r=i+1;r<d;r++)if(null!==e[r].value){o=e[r].x,s=e[r].y;break}t.moveTo(l=o,h=s)}null!==u.value&&(f[c]&&"solid"!==c?f[c](t,l,h,l=o,h=s):t.lineTo(o,s))}}},i(c,{graphers:{},hasTouch:n(r)&&"ontouchstart"in r});var f=function(){var t=Math.cos,e=Math.sin,n=Math.PI,i=function(){var t,e={},n={},i=Array.prototype.join;function r(e,r,a,o,s,l,h,u){if(t=i.call(arguments),n[t])return n[t];var c=u*s,f=-h*l,d=h*s,p=u*l,g=Math.cos(a),y=Math.sin(a),x=Math.cos(o),v=Math.sin(o),m=.5*(o-a),b=Math.sin(.5*m),w=8/3*b*b/Math.sin(m),M=e+g-w*y,A=r+y+w*g,S=e+x,L=r+v,k=S+w*v,E=L-w*x;return n[t]=[c*M+f*A,d*M+p*A,c*k+f*E,d*k+p*E,c*S+f*L,d*S+p*L]}return function(n,a,o,s){(function(n,r,a,o,s,l,h,u,c){if(t=i.call(arguments),e[t])return e[t];var f=h*(Math.PI/180),d=Math.sin(f),p=Math.cos(f),g=p*(u-n)*.5+d*(c-r)*.5,y=p*(c-r)*.5-d*(u-n)*.5,x=g*g/((a=Math.abs(a))*a)+y*y/((o=Math.abs(o))*o);x>1&&(a*=x=Math.sqrt(x),o*=x);var v=p/a,m=d/a,b=-d/o,w=p/o,M=v*u+m*c,A=b*u+w*c,S=v*n+m*r,L=b*n+w*r,k=1/((S-M)*(S-M)+(L-A)*(L-A))-.25;k<0&&(k=0);var E=Math.sqrt(k);l==s&&(E=-E);var T=.5*(M+S)-E*(L-A),C=.5*(A+L)+E*(S-M),F=Math.atan2(A-C,M-T),W=Math.atan2(L-C,S-T)-F;W<0&&1==l?W+=2*Math.PI:W>0&&0===l&&(W-=2*Math.PI);for(var _=Math.ceil(Math.abs(W/(.5*Math.PI+.001))),P=[],z=0;z<_;z++){var H=F+z*W/_,I=F+(z+1)*W/_;P[z]=[T,C,H,I,a,o,d,p]}return e[t]=P}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],a,o)||[]).forEach((function(t){n.bezierCurveTo.apply(n,r.apply(null,t))}))}}();return{arc:i,angle2arc:function(r,a,o,s,l,h,u){var c=t(l),f=e(l),d=t(h-=1e-8),p=e(h),g=+(h-l>n);return function(t){var e,n;t.beginPath(),t.moveTo(e=r+o*c,n=a+o*f),i(t,e,n,[o,o,0,g,1,r+o*d,a+o*p]),t[u?"moveTo":"lineTo"](e=r+s*d,n=a+s*p),i(t,e,n,[s,s,0,g,0,r+s*c,a+s*f]),u||t.closePath()}}}}(),d=function(t){var e=t.document;function n(n){var i=n.pack,r=n.defined,a=n.extend,o=r(e)&&"ontouchstart"in e,s=function(r,a){var o,s,l,h;return(r=r||t.event).target||(r.target=r.srcElement),l=r.touches?r.touches.length?r.touches[0]:r.changedTouches[0]:r,h=a.getBoundingClientRect(),void 0===l.pageX?(o=Math.max(r.x,r.clientX-h.left),s=r.y):(o=l.pageX-h.left,s=l.pageY-h.top),o*=i("number",a.width/n.DEVICE_PIXEL_RATIO,a.offsetWidth)/h.width,s*=i("number",a.height/n.DEVICE_PIXEL_RATIO,a.offsetHeight)/h.height,{x:o-Math.max(e.body.scrollLeft,t.scrollX),y:s-Math.max(e.body.scrollTop,t.scrollY)}};return a({hasTouch:o,normalize:s},{draggable:function(){var t=0,e=0,n=0,i=0;return{start:function(r,a){e=s(a,r),n=t=e.x,i=e=e.y},drag:function(r,a){i=s(a,r),n=i.x-t,i=i.y-e},drop:function(){t=e=n=i=0},getX:function(){return n},getY:function(){return i},normalize:function(){var t=Math.sqrt(n*n+i*i),e=n,r=i;return t>0&&(e/=t,r/=t),{x:e,y:r}}}}})}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return n.apply(t,[].concat(e))}}}("undefined"!=typeof window?window:this).deps(e);(c.Event=d).Handler=function(){var e,n=!1,o=!0,l=function(t,e,n){t.series.forEach((function(t){t.start=e,t.end=n,t.shapes=t.addShape()})),t.draw()},h=function(){var t,e=!1;function n(t,e,n){var i=t.tooltip;i.context===t.context?t.render("hover",{x:e,y:n}):(i.context.clearRect(0,0,t.width,t.height),null!==t.legend&&i.context===t.legend.context&&t.legend.data.length&&t.legend.draw())}var i=function(i,r){var o=i.options.tooltip,s=i.tooltip,l=d.normalize(r,i.canvas);null!==s&&(!0===o.show?null!==(l=s.position())&&s.move(l.x,l.y):function(i,r){var o=i.tooltip,s=i.options.tooltip||{},l=a("number",s.hideDelay,1e3),h=function(){o.hide(),null!==r&&n(i,r.x,r.y)};l>0?(t&&clearTimeout(t),t=setTimeout((function(){!e&&h()}),l)):!e&&h()}(i,l))},r=function(t,e){var n,i=t.canvas,r=e&&d.normalize(e,i);r?t.rangeSlider.forEach((function(t){null!==t&&(n=t.getCursor(r.x,r.y,e),i.style.cursor=null!==n?n:"default")})):i.style.cursor="default"};return{show:function(t,a){var o=a.tooltip,s=a.options.tooltip;o&&(!function(t,e){var i=d.normalize(e,t.container),r=i.x,a=i.y,o=t.tooltip;t.container.style.cursor="default",o.move(r,a,!0),n(t,r,a),function(t,e,n){t.colorAxis.forEach((function(t){!1!==t.options.enabled&&t.addTooltip(e,n)})),t.yAxis.forEach((function(t){t.options.plotLine&&t.addTooltip(e,n)})),t.xAxis.forEach((function(t){t.options.plotLine&&t.addTooltip(e,n)}))}(t,r,a)}(a,t),r(a,t),e=0!==o.itemLength,!0===s.show?!e&&i(a,t):i(a,t))},hide:function(t,e){e.tooltip&&i(e,t),r(e)}}},c=function(t,e){var n,i,r=e.options,a=d.normalize(t,e.container),s=a.x,l=a.y;o&&!0===e.globalAnimation.isReady&&(e.charts.forEach((function(a){var o=a.series[0];n=(r.plotOptions||{})[o.type]||{},i=i=(i=o.events||{}).click||(n.events||{}).click;var h=a.getShape(s,l);h&&h.length>0?i&&i.call({},h[0].shape,{},t,s,l):i&&i.call({},{},{},t,s,l);var u;(u=a.getShape&&a.getShape(s,l)||[]).length&&a.setSliced&&(a.setSliced(u),e.render("click"))})),e.toolbar&&e.toolbar.onClick&&e.toolbar.onClick.call(e.container,t))},f=function(t,i){e=d.draggable();var a,s,l=i.panel;e.start(this,t),a=e.getX(),s=e.getY(),n=!0,o=!0,i.rangeSlider.forEach((function(e,n){var r=l[Math.min(l.length-1,0|e.panelIndex)],o=i.rangeSelector[n];o.maxWidth=r.plotWidth*(1-(o.to-o.from)/100+1),o.dragging=-1===e.getTarget(a,s)&&y.rect({x:a,y:s},{x:r.plotX,y:r.plotY,width:r.plotX+r.plotWidth,height:r.plotY+r.plotHeight})&&1,e&&e.onStart(0,0,t)})),i.charts.forEach((function(t){u(t.onStart)&&t.onStart()})),r.addEventListener("mousemove",i.globalEvent.drag,!1)},p=function(t,i){var r,a,s,h=this;n&&(e.drag(h,t),r=e.getX(),a=e.getY(),o=.1*.1-r*r-a*a>.001,i.globalEvent.isDragging=!0,i.series.forEach((function(t){"sankey"!==t.type&&"node"!==t.type||(i.globalEvent.isDragging=!1)})),i.rangeSlider.forEach((function(n,a){var o=i.rangeSelector[a],u=d.normalize(t,h);if(o.dragging){s=e.normalize();var c=100*Math.max(0,Math.min(1,Math.abs(r)/o.maxWidth)),f=s.x>0||-1,p=o._start-c*f,g=o._end-c*f,y=g-p;s.x>0?(p=Math.max(0,p),g=Math.max(y,g)):(g=Math.min(100,g),p=Math.min(100-y,p)),o.from=p,o.to=g,n&&n.startToEnd(p+"%",g+"%"),i.globalEvent.isDragging=i.globalEvent.isDragging||!i.globalEvent.isDragging,l(i,p,g)}n&&n.onDrag(u.x,u.y,(function(t,e,n,r){i.globalEvent.isDragging=i.globalEvent.isDragging||!i.globalEvent.isDragging,o.from=parseFloat(n,10),o.to=parseFloat(r,10),l(i,n,r)}))})),i.charts.forEach((function(e){u(e.onDrag)&&e.onDrag(r,a,t)})),i.globalEvent.isDragging||i.render("drag"))},g=function(t,e){e.rangeSlider.forEach((function(t,n){var i=e.rangeSelector[n];i._start=i.from,i._end=i.to,t&&t.onDrop(0,0,(function(){}))})),e.charts.forEach((function(t){u(t.onDrop)&&t.onDrop()})),e.globalEvent.isDragging=!1,n=!1,r.removeEventListener("mousemove",e.globalEvent.drag,!1)},x=function(t){return function(e){var n=t.getViewport().plot,i=d.normalize(e,this),r=i.y;if(i=i.x,y.rect({x:i,y:r},{x:n.left,y:n.top,width:n.left+n.width,height:n.top+n.height})){var o=function(t){var e,n,i,r,o={};if(W)r=t.originEvent.vector,o.disabled=!1,o.length=r.length,o.scale=r.scale;else{if(e=-t.wheelDeltaX,i=0===(n=a("number",-t.detail,t.wheelDelta,t.wheelDeltaY,0))?e:n,i=n=a("number",-t.deltaY,n),e=a("number",t.deltaX,e),0===n&&0===e)return o.disabled=!0,o;i=Math.max(-1,Math.min(1,i)),o.length=i,o.scale=Math.exp(.2*i)}return o}(e);if(o.disabled)return;t.rangeSlider.forEach((function(e,n){var i=t.rangeSelector[n],r=i.from,a=i.to,s=Math.max(1-r/a||0,.1),l=(o.length>0?r<a|0:-1)*o.scale*s;l||(r=a),r=Math.max(0,r+=l),a=Math.min(100,a-=l),i.from=i._start=r,i.to=i._end=a,e&&e.startToEnd(r+"%",a+"%")}));var s=t.rangeSelector;s.length&&s[0].from!==s[0].to&&(l(t,s[0].from,s[0].to),e.preventDefault&&e.preventDefault())}}},v=function(t,e){var n,i=e.getSize(e.renderer),r=i.height;i=i.width,!0===e.globalAnimation.isReady&&(n&&clearTimeout(n),n=setTimeout((function(){e.setSize(i,r,!1)}),100))},m=function(){r.hidden||r.webkitHidden};function b(t,e){function n(t,e){var n,i=t.container,a=t.globalEvent,o=e?"removeEventListener":"addEventListener",s=!1,l={click:a.click,mousemove:a.mousemove,mouseout:a.mouseout,mousedown:a.start,mouseup:{el:r,listener:a.drop},mousewheel:a.zoom,DOMMouseScroll:a.zoom,resize:{el:window,listener:a.resize},visibilitychange:{el:r,listener:a.visible},webkitvisibilitychange:{el:r,listener:a.visible}};for(var h in l)n=l[h],l.hasOwnProperty(h)&&(n.el||i)[o](h,n.listener||n,s);i[o]("mousemove",a.drag,s)}function o(o){var l=h(),u=function(t){return!0===t.globalAnimation.isReady},d=function(t){return!0!==t.globalEvent.disabled};o.rangeSelector.forEach((function(t){t._start=t.from=a("number",parseFloat(t.start,10),0),t._end=t.to=a("number",parseFloat(t.end,10),100)})),function(a){var o=a.container,h=a.globalEvent;i(h,{click:function(t){d(a)&&c.call(this,t,a)},mousemove:function(t){u(a)&d(a)&function(t){return!t.globalEvent.isDragging}(a)&&l.show.call(this,t,a)},mouseout:function(t){d(a)&&l.hide.call(this,t,a)},start:function(t){d(a)&&f.call(o,t,a)},drop:function(t){d(a)&&g.call(r,t,a)},drag:function(t){d(a)&&p.call(o,t,a)},zoom:function(t){var e=x(a);d(a)&&e.call(o,t)},resize:function(t){var e=a.options,n=e.chart.width,i=e.chart.height;n=Math.max(1,n),i=Math.max(1,i),e.chart.reflow,s(n,!0),s(i,!0),u(a),v.call(window,t,a)},visible:function(t){!0!==h.disabled&&m.call(r,t,a)}});e.hasTouch?new t.Touch(o).on({tap:function(t){h.click.call(this,t,a)},press:function(t,e){h=a.globalEvent,f.call(this,t,a),h.mousemove&&h.mousemove.call(this,t,a),"end"===e.status&&h.mouseout.call(this,t,a)},swipe:function(t,e){"start"===e.status?f.call(this,t,a):"move"===e.status?(p.call(this,t,a),h.isDragging=!1,h.mousemove&&h.mousemove.call(this,t,a)):"end"===e.status&&(g.call(r,t,a),h.mouseout&&h.mouseout.call(this,t,a))},pinch:function(t){h.zoom.call(this,t,a)}}):n(a)}(o)}return o.destroy=function(i){var r=i.container;r&&(e.hasTouch?new t.Touch(r).free():n(i,!0))},o}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return b.apply(t,[].concat(e))}}}("undefined"!=typeof window&&window).deps(e,d),c.angleInQuadrant=function(){var t=Math.PI,e=2*t,n=function(t,e){return t.angle-e.angle};return function(i,r){var a,o=[[],[],[],[]],s=r.radius||i[0].radius;i.forEach((function(n){var i=n.angle*t/180;(i%=e)<0&&(i+=e),o[function(e){return 0<=e&&e<t/2?1:e<t?2:e<1.5*t?3:0}(i)].push({angle:i,cx:n.cx,cy:n.cy,point:n})})),o.forEach((function(t){t.sort(n)})),o[1].reverse(),o[3].reverse(),a=Math.max(s+0,Math.min(s/0,Math.max.apply(Math,o.map((function(t){return t.length}))))),o.forEach((function(t,e){var n,i,r,o=t.length,l=0*o,h=a;for(n=0;n<o;n++)l-=0,i=(r=t[n]).angle,i=Math.abs(a*Math.sin(i)),i=Math.min(Math.max(i,l),h),r._angle=i,h=i-0;for(l=a-0*(o-1),h=0,n=o-1;n>=0;--n){l+=0,i=(r=t[n]).angle,i=Math.abs(a*Math.sin(i)),h=(i=Math.max(Math.min(i,l),h))+0;var u=(i+r._angle)/2,c=r.cx+[1,1,-1,-1][e]*s*Math.cos(Math.asin(Math.max(-1,Math.min(1,u/a)))),f=r.cy+u*[-1,1,1,-1][e];r.point._textX=c,r.point._textY=f,r.point._quadrent=e,delete r._angle}}))}}(),c.angle2arc=f.angle2arc,c.arc=f.arc,c.Series=function(t){var e=Math.max,r=Math.min;function s(t,s,c){var f=c.partition,d=c.indexOf,p=function(t){return s.isNumber(t)&&!isNaN(t)&&isFinite(t)},g=function(t){var e=t.length,n=0,i=!1,r=function(n){var r=1&e,a=e;for(r&&n(t[0],!1===i?0:i);r<a;)n(t[r++],t[--a])};return r((function(t,e){n+=t,n+=e})),i=n/e,n=0,r((function(t,e){n+=(t-i)*(t-i),n+=(e-i)*(e-i)})),t[e-1]},y=function(t,e){var n=parseFloat(t,10),i=t.match(/([\+\-]?\d+[\.eE]?\d*)/g),r=i&&i.length;if(p(n)&&!r)return n;if(r&&i.length<2)return parseFloat(i[0],10);if(r){var a=new A(i.map((function(t){return{x:parseFloat(t,10)}})),["x"]);if(n=a.nearest({x:e},(function(t,e){return(t.x-e.x)*(t.x-e.x)}))[0],a.destroy(),p(n.x))return n.x}return null};function x(t){i(this,t),this.type=t.type||"line",this.name=t.name,this.data=t.data||[],this.shapes=[],this.options=t}return x.prototype={constructor:x,update:function(t,e){var r=this.chart,a=this;this.options=t,n(r)&&(i(this,t),a._shapes=a.shapes,a.shapes=a.addShape(),!1!==e&&r.draw())},addShape:function(){var t,s,c,f,x,v,m=this,b=this.options.animation||{},w=a("array",m.data,[]),M=[],A=[],S=m.type,L=w.length,k=0,E=!1,T=a("number",parseFloat(m.start,10)/100,0),C=a("number",parseFloat(m.end,10)/100,1);if(T=Math.max(0,Math.min(~~(L*T),~-L)),C=Math.min(L,Math.max(~~(L*C),-~T)),m.startIndex=T,m.endIndex=C,v=C-T)for(x=-(f=Number.MAX_VALUE);T<C;T++,k++){s=t=w[T],c={series:m,source:t},!1!==m.animationEnabled&&(c.duration=a("number",b.duration,m.duration),c.easing=b.easing||m.easing,u(b.delay)?c.delay=b.delay.call(t,k):p(b.delay)?c.delay=b.delay:c.delay=u(m.delay)?m.delay.call(t,k):m.delay),o(t)?(s=n(t.value)?t.value:t.y,"arearange"===S&&n(t.high)&&(s=t.high),i(c,t),delete c.x,delete c.y,n(t.x)&&(c._x=t.x),n(t.y)&&(c._y=t.y)):l(t)&&(s=n(t[1])?t[1]:t[0],("arearange"===S||n(t[2]))&&(s=n(t[2])?t[2]:t[1]),i(c,{_x:t[0],_y:t[1]}));var F=s,W=F;if(h(s)){var _=A.length?A.length>2?g(A.slice(-10)):A[0]:0;s=y(F=s,_)}p(s)&&isFinite(s)||(s=F=null,W="--"),p(s)&&(f=r(f,s),x=e(x,s),A.push(s)),E=null===s,"candlestick"===S&&((E=!(p(+c.open)&&p(+c.close)&&p(+c.low)&&p(+c.high)))||(W=["<br>","open: "+c.open+"<br>","close: "+c.close+"<br>","low: "+c.low+"<br>","high: "+c.high+"<br>"].join("")),E&&((E=!(p(+t[0])&&p(+t[1])&&p(+t[2])&&p(+t[3])))||(W=["<br>","open: "+t[0]+"<br>","close: "+t[1]+"<br>","low: "+t[2]+"<br>","high: "+t[3]+"<br>"].join("")))),~d(["pie","funnel","venn"],S)?
//!defined(shape.color) && (shape.color = seriesColors[j % seriesColors.length]);
!n(c.name)&&(c.name=F):("node"!==S&&"sankey"!==S&&(c.name=m.name),!n(c.color)&&(c.color=m.color)),c._value=F,c.value=s,c.$value=W,c.isNULL=E,M.push(c),"pie"!==S&&"funnel"!==S||(w[T]=o(t)||l(t)?t:{value:t})}return m.minValue=v?f:0,m.maxValue=v?x:0,M},getShape:function(){return this.shapes},setOptions:function(){},setData:function(){},translate:function(){},destroy:function(){}},x.normalize=function(t){var n=Number.MAX_VALUE,i=-n,a=n,h=-a,u=a,c=h,g=a,y=h,x=!1,v=!1,m=!1,b=-n,w=f(t,(function(t,e){return t.type===e.type&&((void 0!==t.stack||void 0!==e.stack)&&t.stack===e.stack)})),M=!1,A=new s.ZTree(t,["type","stack"]);A.update((function(t){var a=n,s=i,h=n,u=i,c=n,f=i;t.forEach((function(t){b=Math.max(b,t.data.length)}));var g,y,w,A,S,L,k,E,T=t[0],C=T.startIndex,F=T.endIndex-C,W=t.length,_=null,P=null,z=!1;for(w=0;w<F;w++){var H=0,I=0,V=!1,Y=!1,N=!1,O=!1,R=!1,X=!1,j=n,D=i,B=i,q=n,U=0,G=0,$=i,K=n,Z=0,Q=0;for(y=0;y<W;y++)T=t[y],z=z||!1!==T.selected,!1!==T.selected&&(g=!!~d(["arearange","candlestick"],T.type),A=T.shapes[w]||{},S=T.data[~~(C+w)],L=A.value,p(L),l(S)?(p(S[0])&&(_=S[0],x=x||!x),p(S[1])&&(k=L=P=S[1],v=v||!v),p(S[2])&&(E=L=S[2]),g&&(v=!1)):o(S)&&(p(S.x)&&(_=S.x,x=x||!x),p(S.y)&&(L=P=S.y,v=v||!v),p(S.value)&&(L=S.value),p(S.low)&&(k=S.low),p(S.high)&&(E=S.high)),V=V||p(L)&&L<0,Y=Y||p(L)&&L>=0,N=N||_<0,O=O||_>=0,R=R||P<0,X=X||P>=0,m=m||p(L)||p(k)&&p(E),g?(H+=E,I+=k,Y=V=!0):(p(L)&&(L<0?(I+=L,D=e(D,L)):(H+=L,j=r(j,L))),p(_)&&(_<0?(G+=_,B=e(B,_)):(U+=_,q=r(q,_))),p(P)&&(P<0?(Q+=P,$=e($,P)):(Z+=P,K=r(K,P))))),s=e(s,Y?H:D),a=r(a,V?I:j),u=e(u,O?U:B),h=r(h,N?G:q),f=e(f,X?Z:$),c=r(c,R?Q:K)}return M=M||!!length,{minValue:a,maxValue:s,minAxisX:h,maxAxisX:u,minAxisY:c,maxAxisY:f}}),(function(t,a){return void 0===t.minValue&&(t.minValue=n),void 0===t.maxValue&&(t.maxValue=i),void 0===t.minAxisX&&(t.minAxisX=n),void 0===t.maxAxisX&&(t.maxAxisX=i),void 0===t.minAxisY&&(t.minAxisY=n),void 0===t.maxAxisY&&(t.maxAxisY=i),t.minValue=r(t.minValue,a.minValue),t.maxValue=e(t.maxValue,a.maxValue),t.minAxisX=r(t.minAxisX,a.minAxisX),t.maxAxisX=e(t.maxAxisX,a.maxAxisX),t.minAxisY=r(t.minAxisY,a.minAxisY),t.maxAxisY=e(t.maxAxisY,a.maxAxisY),t}));var S=A.getRoot();a=S.minValue,h=S.maxValue,u=S.minAxisX,c=S.maxAxisX,g=S.minAxisY,y=S.maxAxisY,(w.length||M)&&m?(a===h&&(0===h?h=1:a=0),u===c&&(0===c?c=1:u=0),g===y&&(0===y?y=1:g=0)):a=h=u=c=g=y=b=0;var L={min:a,max:h,length:b,groups:w};return x&&(L.isX=x,L.minX=u,L.maxX=c),v&&(L.isY=v,L.minY=g,L.maxY=y),L},x}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return s.apply(t,[t].concat(e))}}}("undefined"!=typeof window?window:t).deps(e,e.Cluster.List),c.scale=function(t,n,i,r,a,o){var s=t.canvas;a=e.pack("number",a,0),o=e.pack("number",o,0),s.width=n*r,s.height=i*r,1!==r&&(s.style.width=n+"px",s.style.height=i+"px"),t.setTransform(r,0,0,r,a*r,o*r)},c.fixLinePixel=function(t,e,n,i,r){var a=-((r=isNaN(+r)?1:r)%2?.5:0),o=r%2?.5:1,s=Math.round(t+n)+a;t=Math.round(t)+a;var l=Math.round(e+i)+o,h=Math.abs(e)<=.5&&l>.5;return i=l-(e=Math.round(e)+o),h&&(e-=1,i+=1),{x:t,width:s-t,y:e,height:i}},c.fixPixelHalf=function(){var t,e=[].slice.call(arguments,0),n=e.pop(),i=n,r=Math.round,a=[];return"boolean"==typeof n?i=e[e.length-1]:n=null,i=r(i),e.forEach((function(e){t=r(2*e),a.push(((t+i)%2==0?t:t+(n||-1))/2)})),a},c.version="0.1.9",e.Chart=c}(e);var n=t.document,i=e.defined,r=e.extend,a=e.pack,o=e.isObject,s=e.isNumber,l=e.isArray,h=e.isString,u=e.isFunction,c=e.isNumberIN,f=e.isEmptyObject,d=e.Chart.Event,p=e.Math,g=e.Geometry,y=g.Intersection,x=g.Line.Dash,v=e.Text,m=e.Color,b=e.Numeric,w=e.Formatter,M=e.Cluster.List,A=e.KDTree,S=b.toPrecision,L=b.interpolate,k=M.filter,E=M.indexOf,T=M.partition,C=p.log,F=w.TRouBLe,W=e.Chart.hasTouch,_=e.Chart.scale,P=e.DEVICE_PIXEL_RATIO,z=e.Chart.fixLinePixel,H=e.Chart.fixPixelHalf,I=function(){var e=Math.PI,n=function(){};function i(t,i){var r=t.defined,a=t.pack,o=t.isFunction,s=t.isObject;function l(){var t,r=n,h=n,u={vertical:function(t){return h=t,u},align:function(t){return r=t,u},value:function(e){return t=e,u},call:function(n,u,c){var f,d,p,g=u.dataLabels||{},y=n.dataLabels||{},x=l.options(y,g),v=x.verticalAlign,m=l.value(n,g.formatter,t),b=x.rotation,w=b%360*e/180;if(!1!==n.selected&&!1!==u.selected&&!0===x.enabled&&null!==m){var M=i.HTML(i.parseHTML(m),c,x);f=M.getBBox(),d=a("number",r.call(s(n.dataLabels)?n.dataLabels:u.dataLabels,x.align,f),n.x0,n.x,0),p=a("number",h.call(s(n.dataLabels)?n.dataLabels:u.dataLabels,v,f),n.y0,n.y,0),d=o(x.x)?x.x.call(n,d,f,n,m,u):d+=x.x,p=o(x.y)?x.y.call(n,p,f,n,m,u):p+=x.y,b&&(w>0&&w<e||(w>=e&&w<1.5*e||w>=1.5*e&&w<2*e?(d+=f.width,p+=f.height):p+=f.height)),c.save(),c.textAlign="start",c.textBaseline="alphabetic",c.fillStyle=x.color,c.font=x.fontStyle+" "+x.fontWeight+" "+x.fontSize+" "+x.fontFamily,c.translate(d,p),b&&c.rotate(w),M.toCanvas(c),c.restore()}}};return u}return l.options=function(t,e){var n=t.style||{},i=e.style||{};return{enabled:t.enabled||e.enabled,align:t.align||e.align,verticalAlign:t.verticalAlign||e.verticalAlign,rotation:a("number",t.rotation,e.rotation,0),shapeStyle:t,labelStyle:e,fontStyle:a("string",n.fontStyle,i.fontStyle,"normal"),fontWeight:a("string",n.fontWeight,i.fontWeight,"normal"),fontSize:a("string",n.fontSize,i.fontSize,"12px"),fontFamily:a("string",n.fontFamily,i.fontFamily,"Arial"),lineHeight:a("string",n.lineHeight,i.lineHeight,"normal"),color:n.color||i.color||"#000",x:o(e.x)?e.x:a("number",t.x,e.x,0),y:o(e.y)?e.y:a("number",t.y,e.y,0)}},l.value=function(t,e,n){var i=t.value,a=t._value,s=a;return t._formatterValue?t._formatterValue:(r(n)&&(i=s=n),null!==i&&o(e)&&!r(t._formatterValue)&&(s=e.call({x:t.key,key:t.key,value:i,labelValue:a,color:t.color,series:t.series,point:t,total:t.total,percentage:t.percentage},i),t._formatterValue=s),null!==i&&r(s)?s:null)},l()}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return i.apply(t,[].concat(e))}}}.call("undefined"!=typeof window?window:this).deps(e,e.Text),V=Math.PI,Y=2*V,N=function(){};!function(t,e){var h=e.Chart.Series;function c(t,e){if(t)for(var n in e)t.setAttribute(n,e[n])}var p={type:"line",chart:{width:void 0,height:void 0,spacing:W?[0,0,0,0]:[10,10,15,10],backgroundColor:"#FFFFFF",style:{fontFamily:'"Helvetica Neue",Helvetica,arial,"Hiragino Sans GB","Microsoft YaHei",sans-serif',fontSize:"12px",fontWeight:"normal",color:"#333333"},reflow:!0,animation:{duration:500,easing:"ease-in-out"}},colors:["#50E3C2","#21A6EE","#807CCC","#72e6f7","#8cd49c","#ffc977","#b794d5","#f7a35c","#434348","#f15c80","#e4d354","#2b908f","#f45b5b","#91e8e1"],title:{enabled:!0,text:"Chart title",align:"center",margin:[0,0,10,0],style:{fontSize:"16px",fontWeight:"bold"},x:0,y:0},subtitle:{enabled:!1,text:void 0,align:"center",style:{fontSize:"13px"},x:0,y:0,margin:[3,0,5,0]},legend:{enabled:!0,style:{color:"#606060",fontWeight:"bold",cursor:"default"}},tooltip:{enabled:!0,shared:!0,useHTML:!0},yAxis:{type:"linear",lineColor:"#d3d0cb",lineWidth:1,tickColor:"#d3d0cb",tickWidth:1,gridLineColor:"#f3f2f0",gridLineWidth:1},xAxis:{type:"categories",title:{enabled:!1},lineColor:"#d3d0cb",lineWidth:1,tickColor:"#d3d0cb",tickWidth:1,gridLineColor:"#f3f2f0",gridLineWidth:1},colorAxis:{title:{enabled:!1},layout:"vertical",floating:!0,verticalAlign:"top",tickLength:20,lineWidth:0,labels:{align:"center"},size:150,x:10,y:15,stops:[[0,"#EFEFFF"],[1,"#102D4C"]]},polarAxis:{startAngle:void 0,endAngle:void 0,tickColor:"rgba(0,0,0,.5)"},radiusAxis:{type:"value",enabled:!1},plotOptions:{series:{},line:{lineWidth:2,marker:{radius:4,lineWidth:0},dataLabels:{enabled:!1,style:{color:"#606060"}}},spline:{lineWidth:2,marker:{radius:4},dataLabels:{enabled:!1,style:{color:"#606060"}}},area:{lineWidth:2,marker:{radius:4},dataLabels:{enabled:!1,style:{color:"#606060"}}},areaspline:{lineWidth:2,marker:{radius:4},dataLabels:{enabled:!1,style:{color:"#606060"}}},column:{borderColor:"#FFFFFF",borderRadius:0,borderWidth:0,dataLabels:{enabled:!1,style:{color:"#606060"}}},bar:{borderColor:"#FFFFFF",borderRadius:0,borderWidth:0,dataLabels:{enabled:!1,style:{color:"#606060"}}},pie:{showInLegend:!1,borderColor:"#FFFFFF",borderWidth:1,dataLabels:{enabled:!0,distance:W?0:15,inside:!!W||void 0,connectorWidth:1,connectorPadding:10,style:{color:"#606060"}}},funnel:{showInLegend:!1,borderColor:"#FFFFFF",borderWidth:1,dataLabels:{enabled:!0,distance:W?0:30,inside:!!W||void 0,style:{color:"#606060"}}},map:{borderColor:"rgb(204, 204, 204)",borderWidth:1,dataLabels:{enabled:!1,align:"center",style:{color:"#606060"}}},venn:{borderColor:"#FFFFFF",borderWidth:1,dataLabels:{enabled:!0,style:{color:"#606060"}}},heatmap:{dataLabels:{enabled:!1},radius:30,blur:.15,fillColor:{linearGradient:{x1:0,y1:0,x2:256,y2:1},stops:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]}},node:{borderColor:"#333333",borderWidth:1,lineWidth:1,dataLabels:{enabled:!0,align:"center",style:{color:"#606060"}}},radar:{lineWidth:2,marker:{radius:4,lineWidth:0},dataLabels:{enabled:!1,style:{color:"#606060"}}},candlestick:{lineWidth:0,color:["green","red"],lineColor:["green","red"]}},credits:{enabled:!1,text:"MChart By MX",style:{cursor:"pointer",color:"#909090",fontSize:"12px"},href:void 0,position:{align:"right",x:-10,y:-5,verticalAlign:"bottom"}},rangeSelector:{},layout:{type:"flow"},toolbar:{enabled:!1}};function g(t,e,i){var r=n.createElement("canvas");this.context=r.getContext("2d"),c(this.canvas=r,{width:e,height:i,style:["position:absolute","left:0px","top:0px","-webkit-user-select:none","cursor:default"].join(";")}),_(this.context,e,i,P),t.appendChild(this.canvas)}var x,w=function(s,h){var u,f,d,y,x,v,m,b,w=function(t){return e.isNumber(t,!0)};if(!i(s))return null;this.options=r({},p),r(this.options,h),function(t){var e=t.chart||{},n=t.plotOptions,r=function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t};(function(){var t=[];return[].forEach.call(arguments,(function(e){t=t.concat(l(e)?e:o(e)?[e]:[])})),t})(t.yAxis,t.xAxis,t.colorAxis,t.polarAxis).map((function(t){return t.labels||(t.labels={})})).concat(a("array",t.title,[t.title]).map((function(t){r(t,p.title)})),a("array",t.subtitle,[t.subtitle]).map((function(t){r(t,p.subtitle)}))).concat([t.tooltip,t.legend,t.credits,n.line.dataLabels,n.spline.dataLabels,n.area.dataLabels,n.areaspline.dataLabels,n.column.dataLabels,n.bar.dataLabels,n.pie.dataLabels]).forEach((function(t){if(i(t))if(i(t.style))for(var n in e.style)!t.style.hasOwnProperty(n)&&(t.style[n]=e.style[n]);else t.style=e.style}))}(this.options),u=(d=a("object",this.options.chart,{})).width,f=d.height,w(u)&&w(f)||(1===s.nodeType?(f=(u=this.getSize(s)).height,u=u.width):(u=a(w,s.width,0),f=a(w,s.height,0))),this.width=u,this.height=f,s.getContext?this.canvas=this.container=s:(c(this.container=n.createElement("div"),r({style:["width:"+this.width+"px","height:"+this.height+"px","overflow:hidden","position:relative","background:transparent","-webkit-tap-highlight-color:transparent","-webkit-user-select:none"].join(";")},{class:d.className})),(this.renderer=s).appendChild(this.container),this.canvas=new g(this.container,this.width,this.height).canvas),this.context=this.canvas.getContext("2d"),this.layer=[],1===s.nodeType&&s.constructor===t.HTMLCanvasElement&&(this.renderer=s,this.imageData=this.context.getImageData(0,0,u,f),_(this.context,u,f,P)),i(d.backgroundImage)&&(y=this.background={completed:!1,repeat:"no-repeat",position:[0,0],size:[0,0]},x=d.backgroundImage,(b=x.match(/\S+/g))&&b.length&&~(v=b[0]).indexOf("url")&&(v=(v=v.substr(v.indexOf("url")+3)).substr(v.lastIndexOf("(")+1,v.indexOf(")")-1),y.loaded=function(){y.completed=!0,y.size=(6===b.length?[b[4],b[5]]:4===b.length?[b[3],b[3]]:[this.width,this.height]).map(parseFloat)},y.fail=function(){console.error("background image loaded fail. <options.chart.backgroundImage>")},(m=y.image=new Image).onload=y.loaded,m.onerror=y.fail,m.src=v,b[1]&&~"repeat no-repeat repeat-x repeat-y".indexOf(b[1])&&(y.repeat=b[1]),4===b.length|6===b.length&&(y.position=[b[2],6===b.length?b[3]:b[2]].map(parseFloat)))),this.layer.push(this.canvas),this.type=this.options.type||"line",this.charts=[],this.series=[],this.panel=[],this.axis=[],this.xAxis=[],this.yAxis=[],this.colorAxis=[],this.polarAxis=[],this.radiusAxis=[],this.legend=null,this.title=[],this.tooltip=null,this.rangeSlider=[],this.rangeSelector=[],this.isAxis2D=!1,this.srcOptions=h,this.eventAction="update";var M=d.animation;o(M)||(M={enabled:!!M}),this.globalAnimation=r({isReady:!1,enabled:!1!==M.enabled},M),this.globalAnimation.initialize=!0,this.globalEvent={click:N,isDragging:!1}};x={setTitle:function(){var t,e=this.options,n=this.context,r=this,o=a("array",e.subtitle,[e.subtitle]),s=function(t){var e=t.style||{};return{margin:F(t.margin),text:t.text,dx:a("number",t.x,0),dy:a("number",t.y,0),style:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,color:e.color}}};return t=e.title,a("array",t,[t]).forEach((function(t,e){var l,h,u=o[e]||{},c=0|t.panelIndex,f=s(t),d=s(u),p=!1!==t.enabled&&i(f.text)?String(f.text):"",g=!1!==u.enabled&&i(d.text)?String(d.text):"",y={width:0,height:0,top:0,bottom:0},x={},m={};!1!==t.enabled&&p.length&&(x=(l=v.HTML(v.parseHTML(f.text),n,f.style)).getBBox(),y.top=f.margin[0],y.bottom=f.margin[2]),g.length&&(m=(h=v.HTML(v.parseHTML(d.text),n,d.style)).getBBox(),y.height+=d.margin[0],y.bottom=d.margin[2]),y.width+=a("number",Math.max(x&&x.width,m&&m.width),0),y.height+=a("number",x&&x.height,0)+a("number",m&&m.height,0),r.title.push({render:function(){var e=r.panel[Math.min(c,~-r.panel.length)]||{x:0,y:0,width:r.width,height:r.height},i=0,o=0;!1!==t.enabled&&p.length&&(i=e.x+f.dx+(e.width-x.width)/2,o=e.y+f.dy+x.height,o+=f.margin[0],n.save(),n.textAlign="start",n.textBaseline="alphabetic",n.fillStyle=f.style.color||"#666",n.font=[f.style.fontStyle,f.style.fontWeight,f.style.fontSize,f.style.fontFamily].join(" "),n.translate(i,o),l.toCanvas(n),n.restore()),!1!==u.enabled&&g.length&&(i=e.x+(e.width-m.width)/2+d.dx,o=e.y+m.height+a("number",x.height,0)+d.dy,o+=d.margin[0],!1!==t.enabled&&p.length&&(o+=f.margin[0]),n.save(),n.translate(i,o),h.toCanvas(n),n.restore())},viewport:y,panelIndex:c})})),this},setCredits:function(){var t,e=this.options.credits||{},n=e.position,r=e.style||{},a=.6,o=this,s=o.context;o.credits={render:function(){!0===e.enabled&&i(e.text)&&(t=v.measureText(e.text,r),s.save(),s.scale(a,a),s.translate(n.x+o.width/a-t.width,n.y+o.height/a),s.fillStyle=r.color,s.textAlign="start",s.textBaseline="alphabetic",s.font=r.fontSize+" "+r.fontFamily,s.fillText(e.text,0,0),s.restore())}}},setSeries:function(t,e){var n,o,l,c,f=this.options,d=(f.chart||{}).animation||{},p=t.animation||{},g=f.plotOptions||{},y=f.rangeSelector,x=this.series,v=f.colors,m=t.type||this.type,b=t.name||"Series "+x.length,w={duration:a("number",p.duration,d.duration,500),easing:p.easing||d.easing||"linear",delay:p.delay,enabled:!1!==d.enabled&&!1!==p.enabled};return s(w.delay)||u(w.delay)||(w.delay=a("number",d.delay,0)),(c=new h(t)).type=m,c.name=b,c.data=t.data,c.index=e,i(y)&&(o=y.start||"0%",l=y.end||"100%",o=Math.min(100,Math.max(0,a("number",parseFloat(o,10),0))),l=Math.min(100,Math.max(0,a("number",parseFloat(l,10),100))),c.start=o+"%",c.end=l+"%"),i(t.layer)&&(c.canvas=this.addLayer(t.layer),c.context=c.canvas.getContext("2d")),n=r({},{color:c.color||v[e%v.length],duration:w.duration,delay:w.delay,easing:w.easing,animationEnabled:w.enabled,states:{hover:{}}},g.series||{},g[c.type]||{},c),(c=new h(n)).shapes=c.addShape(),c},addSeries:function(t){var e=this.setSeries(t,this.series.length);return this.series.push(e),this},removeSeries:function(t){var e=this.series,n=0;if(o(t))for(;n<e.length;n++)if(e[n]===t){e[n].destroy(),this.removeSeriesAt(n);break}return this},removeSeriesAt:function(t){var e=this.series;e.splice(Math.max(0,Math.min(t,e.length-1)),1)},reset:function(){this.xAxis.forEach((function(t){delete t.options.stack,delete t.options.series})),this.yAxis.forEach((function(t){delete t.options.stack,delete t.options.series})),this.colorAxis.forEach((function(t){delete t.options.stack,delete t.options.series}))},linkSeries:function(){var t,e=this,n=this.options.plotOptions||{},o={yAxis:{},xAxis:{},polarAxis:{},radiusAxis:{},colorAxis:{}},s={name:"chart",node:this,parent:null,children:[]};this.mapAxis=o;var l=function(t){return Math.max(0,a("number",t,0))},h=function(t,e,n){t.hasOwnProperty(e)?t[e].push(n):t[e]=[n]};function u(t){T(t,(function(t,e){return t.options.panelIndex===e.options.panelIndex})).forEach((function(t,e){var n,i=l(t[0].options.panelIndex),r=o[t[0].name][e]||[],a=!r.length,h=s.children[i],u=h.children;t.forEach((function(e){r=o[t[0].name][l(e.index)]||[],n=r.map((function(t){return t["_"+e.name]=e.options,t})),(a=!r.length)&&function(t){var e=t._options.enabled;t.options.enabled=!0===e}(e),a||u.push({name:e.name,node:e,parent:h,length:t.length,children:n})}))}))}T(this.series,(function(t,e){return t.panelIndex===e.panelIndex})).forEach((function(a){a.forEach((function(a){var s=a.type;if(a.chart=e,t=t||function(t){return E(["line","spline","column","bar","area","areaspline","arearange","scatter","heatmap","candlestick"],t)>-1}(s),a.minAxisZero=a.minAxisZero||!!~E(["column","bar"],s),!1!==a.selected&&(a.sumLength=Math.max(0,0|(a.data||[]).length),a.maxLength=Math.max(0,a.shapes.length)),t&&(h(o.yAxis,l(a.yAxis),a),h(o.xAxis,l(a.xAxis),a)),~E(["map","heatmap"],s)&&h(o.colorAxis,l(a.colorAxis),a),~E(["radar"],s)&&(h(o.polarAxis,l(a.polarAxis),a),h(o.radiusAxis,l(a.polarAxis),a)),i(n[s])){var u=r({},n[s]);for(var c in u)a.hasOwnProperty(c)||(a[c]=u[c])}}))})),this.panel.forEach((function(t){s.children.push({name:"panel",node:t,parent:e,children:[]})})),u(this.yAxis),u(this.xAxis),u(this.polarAxis),u(this.radiusAxis),u(this.colorAxis),this.chartTree=s,this.isAxis2D=t},linkAxis:function(){var t=this.options.rangeSelector,e=function(t){return"xAxis"===t},n=function(t){return"yAxis"===t},o=function(t){return"linear"===t},u=function(t){return"categories"===t};!function c(f){var d,p=f.children,g=-1,y=!0;if(-1===f.name.indexOf("Axis")&&f.children||(!function(c){var f,d,p,g,y,x,v,m,b,w,M,A=c.node,S=c.children,L=c.length,k=A.name,E=S[0]||{},T=A._options||{},F=T.enabled,W=T.categories,_=T.tickAmount,P=T.type,z=a("number",(T.logarithmic||{}).base,10),H=T.softMax,I=T.softMin,V=T.max,Y=T.min,N=-2,O=[function(t,e){return"logarithmic"===e},function(){b=v=C(Math.max(v,1),z),w=m=C(m,z)},function(t,n){return e(t)&&!o(n)},function(){b=0,w=f.length},function(t,n){return e(t)&&!u(n)&&!0===f.isX},function(){b=v=f.minX,w=m=f.maxX},function(t,e){return n(t)&&!u(e)&&!0===f.isY},function(){b=v=f.minY,w=m=f.maxY},function(t,e){return E.minAxisZero&&o(e)},function(){b=v=Math.min(0,f.min)},function(){return s(I,!0)&&I<v},function(){b=v=I},function(){return s(H,!0)&&H<m},function(){w=m=H},function(){return i(Y)&&s(Y,!0)},function(){b=v=Y},function(){return i(V)&&s(V,!0)},function(){w=m=V},function(){return s(T.tickAmount,!0)},function(){_=T.tickAmount},function(t,e){return u(e)||l(W)},function(){var t=a("number",_,f.length,W&&W.length,0);b=Math.max(0,Math.min(~~(t*p/100),t-1)),w=Math.max(Math.ceil(t*g/100),b+1),s(_,!0)&&(_=w-b)},function(){return 0===f.length},function(){b=w=0}];for(L>1&&(_=5),(f=r({series:S},h.normalize(S))).length=E.sumLength,p=a("number",parseFloat(E.start,10),0),g=a("number",parseFloat(E.end,10),100),v=f.min,m=f.max,b=v,w=m,y=O.length;(N+=2)<y;)(x=O[N].apply(null,[k,P]))&&O[-~N](x);for(d={length:f.length,domain:[b,w],minValue:v,maxValue:m,tickAmount:_},i(t)&&(s(t.yAxis,!0)&n(k)||s(t.xAxis,!0)&e(k)||s(t.polarAxis,!0))&&(d.startValue=b,d.endValue=s(t.endValue,!0)?t.endValue:null),A.setOptions&&A.setOptions(d),s(A.minValue,!0)&&(v=A.minValue),s(A.maxValue,!0)&&(m=A.maxValue),A.options.maxValue=m,A.options.minValue=v,A.options.plot={x:[f.minX,f.maxX],y:[f.minY,f.maxY],value:[f.min,f.max]},A.options.labelWidth=A.labelWidth,A.options.labelHeight=A.labelHeight,x=!1,N=0,y=S.length;/*!flag && */N<y;N++)M=S[N],x=x||!1!==M.selected;A.options.enabled=!0===F||!1!==F&&x}(f),y=!1),y&&p&&(d=p.length))for(;++g<d;)c(p[g])}(this.chartTree),this.translateAxis()},linkRangeSelector:function(){var t=this.options.chart||{},e=F(t.spacing||[]),n=this.legend?this.legend.viewport.height:0,o=this;this.rangeSlider.forEach((function(t){if(null!==t){var l=t.options,h=function(t){var e,n,a,l,h,u=o.mapAxis,c=t,f=Number.MAX_VALUE,d=-f,p=[];for(h in t.hasOwnProperty("xAxis")||(c=r({xAxis:0},t)),c)u.hasOwnProperty(h)&&s(e=c[h])&&(p=[],(u[h][e]||[]).forEach((function(t){!1!==t.selected&&(p=t.data,"candlestick"===t.type&&(p=p.map((function(t){return t.close}))))})),i(n=o[h][e])&&(f=Math.min(f,n.minValue),d=Math.max(d,n.maxValue),a=""+n.startValue,l=""+n.endValue));return{data:p,minValue:f,maxValue:d,startValue:a,endValue:l}}(t.options);t.setOptions({data:h.data,y:a("number",l.y,b.percentage(t.height,l.y),o.height-t.height-n-e[2])})}}))},linkLegend:function(){var t=this.options;if(null!==this.legend){var e=0,n=[],s=t.colors||[];!1!==t.legend.enabled&&(this.series.forEach((function(t,e){var a=t.data;"pie"!==t.type&&"funnel"!==t.type||!0!==t.showInLegend?!1!==t.showInLegend&&n.push(t):a.forEach((function(a,l){if(null!==a&&o(a)&&null!==a.value){var h=r({type:t.type,seriesIndex:e,dataIndex:l},a);!i(h.color)&&(h.color=s[l%s.length]),!i(h.name)&&(h.name=h.value),!i(h.showInLegend)&&(h.showInLegend=t.showInLegend),n.push(h)}}))})),n.length&&(this.legend.setData(n),e=this.legend.maxHeight)),this.legend.viewport={width:this.legend.width,height:Math.min(e+a("number",this.legend.options.margin,0),this.height/2),left:0,top:0}}},setLayout:function(){var t,e,n=this.options.layout,r=n.grid||{},o=F(r.margin),h=this.getViewport().getView(),u=h.width,c=h.height,f=h.left,d=h.top,p=a("number",r.row,1),g=a("number",r.col,1),y=p*g,x=[];if(i(n.panel)&&l(n.panel))y=n.panel.length,n.panel.forEach((function(t){var e=a("number",b.percentage(u,t.x),t.x)+f,n=a("number",b.percentage(c,t.y),t.y)+d,i=a("number",b.percentage(u,t.width),t.width,u-f),r=a("number",b.percentage(c,t.height),t.height,c-d);x.push({x:e,y:n,width:i,height:r,borderWidth:t.borderWidth,borderColor:t.borderColor,backgroundColor:t.backgroundColor,plotX:e,plotY:n,plotWidth:i,plotHeight:r,viewport:{left:0,right:0,top:0,bottom:0},yAxis:[],xAxis:[],polarAxis:[],radiusAxis:[],colorAxis:[],series:[]})}));else{t=o[3],e=o[0];for(var v=0;v<y;v++){var m=c,w=v%g*(u/g)+f+t,M=~~(v/g)*(m/p)+d+e,A=u/g-o[1]-t,S=m/p-o[2]-e;x.push({x:w,y:M,width:A,height:S,yAxis:[],xAxis:[],polarAxis:[],radiusAxis:[],colorAxis:[],series:[],plotX:w,plotY:M,plotWidth:A,plotHeight:S,viewport:{left:0,right:0,top:0,bottom:0}})}}var L=function(t,e){return s(t)&&Math.min(t,e)},k=function(t,e){return Math.min(Math.max(0,0|a("number",t,0)),e)};T(this.series,(function(t,e){return L(t.panelIndex,~-y)===L(e.panelIndex,~-y)})).forEach((function(t){x[k(t[0].panelIndex,~-y)].series=t})),T(this.title,(function(t,e){return L(t.panelIndex,~-y)===L(e.panelIndex,~-y)})).forEach((function(t){var e,n=x[k(t[0].panelIndex,~-y)];t[0]&&(e=t[0].viewport,n.viewport.top+=e.height+e.bottom+e.top,n.plotY+=n.viewport.top,n.plotHeight-=n.viewport.top)}));var E=function(t){T(t,(function(t,e){return L(t.options.panelIndex,~-y)===L(e.options.panelIndex,~-y)})).forEach((function(t){var e=k(t[0].options.panelIndex,~-y);t.forEach((function(t){x[e][t.name].push(t)}))}))};return E(this.yAxis),E(this.xAxis),E(this.polarAxis),E(this.radiusAxis),E(this.colorAxis),this.panel=x},renderAll:function(){var e=this.options,n=this.context,r=this;var o={image:function(){var t,e,o;i(r.background)&&(t=r.background,e=t.position,o=t.size,t.completed&&function(i,o){var s,l,h=a("number",o[0],i.width),u=a("number",o[1],i.height),c=a("number",e[0]),f=a("number",e[1]),d=r.width,p=r.height,g=h?Math.ceil(d/h):0,y=u?Math.ceil(p/u):0;if(g*y>0){for("repeat"!==t.repeat&&(g=y=1),n.save(),s=0;s<g;s++)for(l=0;l<y;l++)n.drawImage(i,c+s*h,f+l*u,h,u);n.restore()}}(t.image,o))},background:function(){var t,a=(e.chart||{}).backgroundColor,o=r.canvas.width,s=r.canvas.height,l=Math.min(o,s);l=Math.sqrt(o*o+s*s)/2,i(a)&&((a.linearGradient||a.radialGradient)&&(t=m.parse(a),a=a.radialGradient?t.radial((o-l)/2,(s-l)/2,l):t.linear(0,0,o,s)),n.save(),n.fillStyle=a,n.fillRect(0,0,o,s),n.restore())},title:function(){r.title.forEach((function(t){t.render()}))},credits:function(){r.credits&&r.credits.render()},toolbar:function(){r.toolbar&&r.toolbar.render()},legend:function(){null!==r.legend&&r.legend.data.length&&r.legend.draw()},rangeSlider:function(){r.rangeSlider.forEach((function(t){t&&t.draw()}))},tooltip:function(){r.tooltip&&r.tooltip.draw()},axis:function(){r.colorAxis.forEach((function(t){!1!==t.options.enabled&&t.draw()})),r.radiusAxis.forEach((function(t){!1!==t.options.enabled&&t.draw()})),r.polarAxis.forEach((function(t){!1!==t.options.enabled&&t.draw()}))}};[{z:1,render:o.background},{z:2,render:o.image},{z:3,render:function(){var t=e.layout.grid||{};r.panel.forEach((function(e){var r,o,l,h,u,c=a("number",e.borderWidth,t.borderWidth,0),f=e.borderColor||t.borderColor,d=e.backgroundColor||t.backgroundColor,p=e.shadowColor||t.shadowColor,g=e.shadowBlur||t.shadowBlur,y=e.shadowOffsetX||t.shadowOffsetX,x=e.shadowOffsetY||t.shadowOffsetY;r=(u=H(e.x,e.y,e.width,e.height,c))[0],o=u[1],l=Math.round(u[2]),h=Math.round(u[3]),n.save(),n.shadowColor=p,s(g)&&(n.shadowBlur=g),s(y)&&(n.shadowOffsetX=y),s(x)&&(n.shadowOffsetY=x),i(d)&&(n.fillStyle=d,n.fillRect(r,o,l,h)),c>0&&(n.beginPath(),n.moveTo(r,o),n.lineTo(r+l,o),n.lineTo(r+l,o+h),n.lineTo(r,o+h),n.lineTo(r,o),n.strokeStyle=f,n.stroke()),n.restore()}))}},{z:9,render:o.credits},{z:8,render:o.toolbar},{z:4,render:o.axis},{z:5,render:o.title},{z:6,render:o.rangeSlider},{z:0,render:function(){1===r.container.nodeType&&r.container.constructor===t.HTMLCanvasElement&&n.putImageData(r.imageData,0,0)}}].sort((function(t,e){return t.z-e.z})).forEach((function(t){t.render()}))},renderChart:function(t,e){var n=this.panel,i=this;t.forEach((function(t){"resize"===e?(i.series.forEach((function(t){var e=n[Math.min(0|t.panelIndex,~-n.length)];t.plotX=a("number",e.plotX,e.x),t.plotY=a("number",e.plotY,e.y),t.plotWidth=a("number",e.plotWidth,e.width),t.plotHeight=a("number",e.plotHeight,e.height),t.plotCenterX=a("number",e.plotCenterX,e.width/2,0),t.plotCenterY=a("number",e.plotCenterY,e.height/2,0),t.plotRadius=a("number",e.plotRadius,Math.min(e.width,e.height),0),t.plotRadius=e.plotRadius})),t.redraw()):t.draw()}))},clear:function(){var t=this.width,e=this.height;this.series.concat([{context:this.context}]).forEach((function(n){var r=n.context;i(r)&&r.clearRect(0,0,t,e)}))},draw:function(){var t,n,o,s,l,h,u=this.options,c=r({},u),d=e.Chart.graphers;if(f(this.srcOptions)&&this.globalAnimation.initialize&&!(this.globalAnimation.initialize=!1))return this.renderAll(),this;this.reset(),null!==this.tooltip&&!0!==(this.options.tooltip||{}).show&&this.tooltip.hide(),null===this.legend||this.legend.noScroll||this.legend.destroy().scrollTop(0),this.linkLegend(),this.setLayout(),this.linkSeries(),this.linkAxis(),this.linkRangeSelector(),c.series=this.series,c.panel=this.panel,function(t,e,n){var r,a,o,s=t.charts,l={};for(var h in e){for(r=!1,o=0,a=s.length;!r&&o<a;o++)r=s[o].type===h;r?s[~-o].init(n):i(d[h])&&!(h in l)&&(l[h]=!0,s.push(new d[h](t.canvas,n)))}s.forEach((function(t,n){t.type in e||s.splice(n,1)})),e=l=null}(this,(n=(t=this).series,o=t.panel,s=t.width,l=t.height,h={},n.forEach((function(e){var n=e.type||t.type,i=o[Math.min(0|e.panelIndex,~-o.length)];e.plotX=a("number",i.plotX,i.x,0),e.plotY=a("number",i.plotY,i.y,0),e.plotWidth=a("number",i.plotWidth,i.width,s),e.plotHeight=a("number",i.plotHeight,i.height,l),e.plotCenterX=a("number",i.plotCenterX,i.width/2,0),e.plotCenterY=a("number",i.plotCenterY,i.height/2,0),e.plotRadius=a("number",i.plotRadius,Math.min(i.width,i.height),0),h[n]=n})),h),c),null!==this.tooltip&&this.tooltip.setChart(this.charts),this.render("update")},render:function(t,n){var r=(this.options.chart||{}).events||{},o=this.charts,s=this,l=s.context,h=s.globalAnimation,u=s.background,c=function(){i(r.ready)&&r.ready.call(s)},f=function(){i(r.redraw)&&r.redraw.call(s,t,n)},d=function(t,n){return k(t,(function(t){var r;return(r=function(t,n){var r=t.globalAnimation;return!i(e.Animation)||!0!==r.enabled||!!~E(["map","heatmap","venn","node"],n)}(s,t.type))&&n.push(t),!r}))},p=function(){var t=[].slice.call(arguments,0,-1),e=!!arguments[t.length],n=[];return t.forEach((function(t){t.forEach((function(t){t.animateTo(l,e,s.eventAction).forEach((function(t){n.push(t)}))}))})),n},g=function(){s.yAxis.concat(s.xAxis).forEach((function(t){!1!==t.options.enabled&&(t.draw(),t._ticks=t.ticks)}))};function y(e,n){s.clear(),s.renderAll(),g(),n&&n(),s.renderChart(e,t),s.legend&&s.legend.draw(),s.tooltip&&s.tooltip.draw()}var x;if(!0!==h.initialize||(h.initialize=!1)){if("update"===t){var v,m=d(o,v=[]);if(v.length&&y(v),i(e.Animation)&&m.length)(x=new e.Animation).stop(),p(m,s.yAxis,s.xAxis,!1).forEach((function(t){var e=t[0],n=t[1];x.addAnimate(e,{duration:"update"===s.eventAction?a("number",e.duration,h.duration,500):(s.eventAction,300),delay:0,easing:"linear",step:function(t,e){n(e)},complete:function(){}})})),x.fire((function(){h.isReady=!1,s.clear(),s.renderAll(),s.yAxis.concat(s.xAxis).forEach((function(t){!1!==t.options.enabled&&t.onFrame()})),s.renderChart(v),m.forEach((function(t){t.onFrame&&t.onFrame(l,!1)})),s.legend&&s.legend.draw(),s.tooltip&&s.tooltip.draw(),f()}),(function(){h.isReady=!0,s.clear(),s.renderAll(),s.yAxis.concat(s.xAxis).forEach((function(t){!1!==t.options.enabled&&t.draw()})),s.renderChart(o),s.legend&&s.legend.draw(),s.tooltip&&s.tooltip.draw(),f(),c()}))}(function(t){return!0===t.globalAnimation.isReady})(s)&&function(t){return!t.globalEvent.isDragging}(s)&&function(t){return"hover"===t||"resize"===t||"drag"===t||"click"===t}(t)&&(y(o),f())}else!function(t,n,r){var o,l=d(t,o=[]);h.isReady=!1,o.length&&(i(u)&&i(u.image)&&!0!==u.completed?new function(){u.image.onload=function(){u.loaded(),y(o)},u.image.onerror=function(){u.loaded(),y(o),u.fail()}}:y(o)),i(e.Animation)&&l.length&&(x=new e.Animation,p(l,!0).forEach((function(t){var e=t[0],n=t[1],r=e.animationEnabled;!i(r)&&e.series&&(r=e.series.animationEnabled),x.addAnimate(e,{step:function(t,e){r||(e=1),n(e)},complete:function(){},duration:a("number",e.duration,h.duration,500),easing:a("string",e.easing,h.easing,"ease-in-out"),delay:a("number",e.delay,h.delay,0)})})),x.fire((function(){h.isReady=!1,n&&n(o,l)}),(function(){h.isReady=!0,y(t),r()}))),l.length|o.length||(s.renderAll(),g(),r(),c()),!l.length&!!o.length&&(r(),c()),h.isReady=!0}(o,(function(t,e){y(t,(function(){e.forEach((function(t){t.onFrame&&t.onFrame(l,!0)}))}))}),(function(){i(r.load)&&r.load.call(s),c()}))},getViewport:function(){var t,e,n,r=this.options,o=F(r.chart.spacing||[]),s=o[3],l=o[1],h=o[0],u=o[2],c=this.width,f=this.height,d={left:s,right:l,top:h,bottom:u,width:c,height:f},p={left:s,right:l,top:h,bottom:u},g=0,y=0,x=0,v=0,m=0;return this.title,null!==this.legend&&i(this.legend.viewport)&&(t=this.legend.options,e=this.legend.viewport,!0!==t.floating&&("vertical"===t.layout?("left"===t.align&&(p.left+=e.width),"right"===t.align&&(p.right+=e.width)):("top"===t.verticalAlign&&(p.top+=e.height),"bottom"===t.verticalAlign&&(p.bottom+=e.height)))),this.rangeSlider.forEach((function(e){null!==e&&!0!==(t=e.options).floating&&"vertical"!==t.layout&&(p.bottom+=e.height+a("number",t.margin,0))})),this.yAxis.forEach((function(t){!1!==t.options.enabled&&(!0===t.options.opposite?y+=t.labelWidth||0:g+=t.labelWidth||0,m=Math.max(m,a("number",t.titleHeight,0)))})),this.xAxis.forEach((function(t){!1!==t.options.enabled&&(!0===t.options.opposite?x+=t.labelHeight||0:v+=t.labelHeight||0)})),d.top+=m,h=d.top+x,u=d.bottom+v,s=d.left+g,l=d.right+y,n={width:d.width-l-s,height:d.height-h-u,left:s,right:l,bottom:u,top:h},d.plot=n,d.getPlot=function(){return n},d.getView=function(){return{left:p.left,right:p.right,top:p.top,bottom:p.bottom,width:c-p.right-p.left,height:f-p.top-p.bottom}},d},setOptions:function(t,e){var n,o,s=[],l=this;r(this.options,t);var h=function(t,e){e.slice(0,l[t].length).forEach((function(e,n){var i=l[t][n];i.setOptions(e),i._options=e}))},u=function(t,e){(e=a("array",e,[e])).length^l[t].length?e.length<l[t].length?(function(t,e){var n=l[t],i=e;l[t].splice(Math.abs(n.length-i.length))}(t,e),h(t,e)):(h(t,e),function(t,e){e.forEach((function(e){var n=r({},p[t]);r(n,e),l.addAxis(t,n)._options=e}))}(t,e.slice(l[t].length))):h(t,e),l[t].forEach((function(t,e){t.index=e}))};return i(o=t.xAxis)&&u("xAxis",o),i(o=t.yAxis)&&u("yAxis",o),i(o=t.polarAxis)&&u("polarAxis",o),i(o=t.colorAxis)&&u("colorAxis",o),i(n=t.series)&&(n=a("array",n,[]),M.diff(this.series,n,(function(t,e){return t.name===e.name&&t.type===e.type})).modify((function(t,e){var i,r;r=l.series[e],(i=n[t]).used=!0,r.update(i,!1),s.push(r)})).each(),n.forEach((function(t,e){var n;t.used||((n=l.setSeries(t,e))._diffValues=[],s.push(n),delete t.used)})),this._series=this.series,this.series=s),i(t.tooltip)&&null!==this.tooltip&&this.tooltip.setOptions(t.tooltip),this.eventAction="update",!1!==e&&this.draw(),this},setSize:function(t,e){var n=this.options,i=F(n.chart.spacing||[]),r=b.percentage,o=this;this.width=t,this.height=e,this.layer.forEach((function(n){_(n.getContext("2d"),t,e,P)})),this.container.style.width=t+"px",this.container.style.height=e+"px",null!==this.legend&&this.legend.data.length&&(this.legend.destroy(),this.legend.setOptions({width:a("number",(n.legend||{}).width,r(t,(n.legend||{}).width),.7*(t-i[1]-i[3]))}),this.legend.viewport.height=Math.min(this.legend.maxHeight+a("number",this.legend.options.margin,0),this.height/2)),this.tooltip,this.rangeSlider.forEach((function(t){var e;null!==t&&(e=t._options,t.setOptions({width:a("number",e.width,b.percentage(o.width,e.width),o.width-i[1]-i[3])}))})),this.setLayout(),this.translateAxis(),this.render("resize")},getSize:function(t){var e=this.options.chart||{},n=e.width,i=e.height,r=t.getBoundingClientRect(),o=a("number",r.width,t.offsetWidth),s=a("number",r.height,t.offsetHeight);return n=Math.max(0,a("number",n,b.percentage(o,n))),(i=Math.max(0,a("number",i,b.percentage(s,i))))<=0&&(i=a("number",r.height,t.offsetHeight)),n<=0&&(n=a("number",r.width,t.offsetWidth)),{width:n,height:i}},destroy:function(){var t=this.container;d.Handler.destroy(this),this.layer.forEach((function(e){t.removeChild(e),e=null})),null!==this.tooltip&&!0===this.tooltip.useHTML&&t.removeChild(this.tooltip.canvas),t.parentNode.removeChild(t),[t,this.context,this.tooltip,this.legend].concat(this.xAxis,this.yAxis,this.colorAxis,this.series).forEach((function(t){0}))},addLayer:function(t){var e=this.layer;return s(t)&t>0?e[e.length]=new g(this.container,this.width,this.height).canvas:this.canvas},addAxis:function(t,n){var r=e.Chart.Axis,a=null;return i(r)&&{}.hasOwnProperty.call({xAxis:0,yAxis:0,polarAxis:0,radiusAxis:0,colorAxis:0},t)&&i(this[t])&&(i(n.range)||(n.range=[0,this.width]),(a=new r(this.canvas,n)).name=t,a.index=this[t].length,this[t].push(a)),a},addLegend:function(t){var n=e.Chart.Legend,r=null;return i(n)&&!1!==t.enabled&&(r=new n(this.canvas,t.series,t)),r},addToolbar:function(t){var i,r=t||{},a=this.context,o=0,s=this.width-15,l=this,h=!1;return!0===r.enabled?(i={render:function(){var t=0;s=l.width-15,a.save(),a.fillStyle="rgba(0, 0, 0, 0.25)",a.fillRect(s,0,15,1),a.fillRect(s,0+(t+=3),12,1),a.fillRect(s,0+(t+=3),15,1),a.fillRect(s,0+(t+=3),12,1),a.fillRect(s,0+(t+=3),15,1),a.restore(),i.viewport.height=o=12,i.viewport.x=s},viewport:{x:s,y:0,width:15},onClick:function(t){var i=d.normalize(t,this),r=i.x,a=i.y;if(y.rect({x:r,y:a},{x:s,y:0,width:s+15,height:0+o})&&!h&&(h=!h)){var u=n.createElement("script");u.src="/src/chart/dashboard.js",u.onload=function(){new e.Chart.Dashboard(l)},l.container.appendChild(u)}}},this.toolbar=i):null},translateAxis:function(){var t=this.panel;this.yAxis.forEach((function(e){var n=t[Math.min(0|e.options.panelIndex,t.length-1)];!0===e.options.enabled&&(e.scale(0,n.height),!0===e.options.opposite?n.viewport.right+=e.labelWidth:n.viewport.left+=e.labelWidth,n.yAxisTitleFirst||(n.yAxisTitleFirst=!0,n.viewport.top+=a("number",e.titleHeight,0)))})),this.xAxis.forEach((function(e){var n=t[Math.min(0|e.options.panelIndex,t.length-1)];!0===e.options.enabled&&(e.scale(0,n.width),!0===e.options.opposite?n.viewport.top+=e.labelHeight:n.viewport.bottom+=e.labelHeight)})),t.forEach((function(e){var n,i=0,r=0,o=0,s=0;e.yAxis.forEach((function(e){var o=t[Math.min(0|e.options.panelIndex,t.length-1)],s=o.height-o.viewport.top-o.viewport.bottom,l=o.width-o.viewport.left-o.viewport.right,h=o.y+o.viewport.top,u=o.x,c=h;!1!==e.options.enabled&&(!0===e.options.opposite?(u+=o.width-e.labelWidth-r,r+=e.labelWidth):(n=u+=e.labelWidth+i,i+=e.labelWidth),e.setOptions({x:u,y:c,width:l,range:[0,s]})),o.plotX=a("number",n,o.x),o.plotY=c,o.plotHeight=s,o.plotWidth=l})),e.xAxis.forEach((function(n){var i=t[Math.min(0|n.options.panelIndex,t.length-1)],r=i.height-i.viewport.top-i.viewport.bottom,a=i.width-i.viewport.left-i.viewport.right,l=0;!1!==n.options.enabled&&(!0===n.options.opposite?(l=i.y+i.viewport.top+s,s+=n.labelHeight):(l=i.y+i.height-n.labelHeight-o,o+=n.labelHeight),n.setOptions({x:i.x+i.viewport.left,y:l,height:r,range:[0,a]})),e.yAxis.length||(i.plotHeight=r)})),e.polarAxis.concat(e.radiusAxis).forEach((function(e,n){var i,r=t[Math.min(0|e.options.panelIndex,t.length-1)],o=r.height-r.viewport.top-r.viewport.bottom,s=r.width-r.viewport.left-r.viewport.right,l=r.y+r.viewport.top,h=e._options,u=Math.min(o,s)/2;u=a("number",h.size,b.percentage(u,h.size),.85*u,0),(i=a("array",h.center,[r.x+s/2,l+o/2])).length<2&&(i[1]=i[0]),i=[a("number",i[0],b.percentage(s,i[0]),u),a("number",i[1],b.percentage(o,i[1]),u)],!1!==e.options.enabled&&(e.scale(0,s),e.setOptions({center:i,size:u,width:r.width,height:r.height,range:[0,u],length:r.polarAxis[n>>1]&&r.polarAxis[n>>1].ticks.length})),r.plotCenterX=i[0],r.plotCenterY=i[1],r.plotRadius=u})),e.colorAxis.forEach((function(t){var e=a("number",t.options.size,150);t.scale(0,e),t.setOptions({range:[0,e]})}))}))},export:function(t,e,i,r){var a,o=n.createElement("canvas"),s=o.getContext("2d"),l=t.width,h=t.height;_(s,e,i,P),s.drawImage(t,0,0,l,h,0,0,e,i),a=o.toDataURL(r),n.location.href=a.replace(r,"image/octet-stream")}},w.prototype=x,e.Chart.setOptions=function(t){p=r(p,t)},e.Chart.getOptions=function(){return p},e.Chart.fn=e.Chart.prototype={constructor:w,init:function(t,n){if(null===w.call(this,t,n))return this;n=this.options;var s=this,h=this.width,u=F(n.chart.spacing),c=b.percentage;m.GRADIENT_CONTEXT=this.context,v.context(this.context),this.setTitle(),this.setCredits(),a("array",n.series,[]).forEach((function(t){s.addSeries(t)}));var f=function(t,e){a("array",e,o(e)?[e]:[{enabled:!1}]).forEach((function(e){var i=o(e)?e:{};(s.addAxis(t,r({name:t,index:s[t].length,lang:n.lang},p[t],i))||{})._options=i}))};f("yAxis",n.yAxis),f("xAxis",n.xAxis),f("radiusAxis",n.radiusAxis),f("polarAxis",n.polarAxis),f("colorAxis",n.colorAxis);var g=r({},n.legend||{});r(g,{width:a("number",g.width,c(h,g.width),.7*(h-u[1]-u[3])),x:{left:u[3],center:0,right:u[1]}[a("string",g.align,"center")]+a("number",g.x,0),y:{top:u[0],middle:0,bottom:u[2]}[a("string",g.verticalAlign,"bottom")]+a("number",g.y,0)});var y=this.addLegend(g);null!==y&&(y.onClick(s.container,(function(t,e){var n,i=s.series,r=this.selected;"pie"===t.type||"funnel"===t.type?a("object",a("object",i[a("number",t.seriesIndex,-1)],{}).data[a("number",t.dataIndex,-1)],{}).selected=r:((n=i[e]).selected=r,n.action="click"),i.forEach((function(t){t.shapes=t.addShape()})),s.eventAction="selected",y.noScroll=!0,s.draw(),n&&(n.action="")})).onState(s.container,(function(t){var e=s.series,n=t;if("pie"===t.type||"funnel"===t.type){var i=a("object",e[a("number",t.seriesIndex,-1)],{}).shapes||[];i.forEach((function(t){delete t.state})),(n=i[a("number",t.dataIndex,-1)]||{}).state=!0}else e.forEach((function(t){delete t.state})),n.state=!0;s.render("hover"),delete n.state})).onScroll(s.container,(function(){s.render("click")})),this.legend=y);var x=e.Chart.RangeSelector;i(n.rangeSelector)&&(l(n.rangeSelector)?n.rangeSelector:[n.rangeSelector]).forEach((function(t){var e=r({},t||{}),n=null,o=e.xAxis,l=e.yAxis,h=e.polarAxis;if(s.xAxis[o]||s.yAxis[l]||s.polarAxis[h]){var c=a("number",e.width,b.percentage(s.width,e.width),s.width-u[1]-u[3]),f=a("number",e.height,b.percentage(s.height,e.height),30);r(e,{width:c,height:f,x:a("number",e.x,b.percentage(c,e.x),u[3])}),i(x)&&!0===e.enabled&&((n=new x(s.canvas,e))._options=t||{}),s.rangeSlider.push(n),s.rangeSelector.push({start:e.start,end:e.end})}}));var M=this.options.tooltip,A=e.Chart.Tooltip,S=null;return i(A)&&!1!==M.enabled&&(S=new A(this.addLayer(M.layer),M)),this.tooltip=S,this.toolbar=s.addToolbar(n.toolbar),s.draw(),1===s.container.nodeType&&d.Handler(this),this}},r(e.Chart.prototype,w.prototype),e.Chart.fn.init.prototype=e.Chart.fn}("undefined"!=typeof window?window:this,e),function(t,e){var l=e.Chart||{},h={enabled:!0,show:!1,animation:!0,style:{fontSize:"12px",fontWeight:"normal",color:"#666666",cursor:"default",lineHeight:"16px"},padding:5,crosshairs:void 0,shared:!0,formatter:void 0,borderWidth:0,borderRadius:4,borderColor:"#7B7B7B",backgroundColor:"rgba(251, 251, 251, .85)",shadow:!0,headerFormat:"",positioner:void 0};function c(){this.init.apply(this,arguments)}c.prototype={Item:function(t,e,n){this.x=t,this.y=e,this.node=null,this.selected=n.selected},init:function(t,e){var i;if(this.options=r({},h),i=r(this.options,e),this.useHTML=!!i.useHTML,this.canvas=t,this.context=t.getContext("2d"),1===t.nodeType&&!0===this.useHTML){var o=i.style||{},s={position:"absolute",border:(0|i.borderWidth)+"px solid "+i.borderColor,"border-radius":i.borderRadius/2+"px","background-color":i.backgroundColor,padding:a("number",i.padding)+"px","line-height":o.lineHeight,"font-weight":o.fontWeight||"normal","font-size":o.fontSize||"12px","font-family":o.fontFamily||"sans-serif","white-space":"nowrap",color:o.color||"#666",display:"none","z-index":3,"box-shadow":"0px 0px 3px #7B7B7B"};for(var l in i.animation&&(s.transition="left .1s linear, top .1s linear"),this.canvas=n.createElement("div"),s)s.hasOwnProperty(l)&&(this.canvas.style[l.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}))]=s[l]);t.parentNode.appendChild(this.canvas)}this.x=+i.x,this.y=+i.y,isNaN(this.x)&&(this.x=-9999),isNaN(this.y)&&(this.y=-9999),this.width=0,this.height=0,this.itemLength=0,this.visible=!1,this.data=[]},addCrosshair:function(){var t=this.options,e=t.crosshairs,n=this.bounds;if(!i(n))return this;var r=this.dx,o=this.dy,s="#ACD8FF",l=this.context,h=n.left||0,u=n.top||0,c=n.width+h||100,f=n.height+u||25,d=function(t,e,n,i,r){var o,s=a("string",r.dashStyle,"solid");l.lineWidth=r.lineWidth,l.strokeStyle=r.color,l.beginPath(),o=z(t,e,n,i,r.lineWidth),"solid"===s?(l.moveTo(t,e),l.lineTo(n,i),l.stroke()):x[s]?x[s](l,o.x,o.y,o.width,o.height):(l.moveTo(t,e),l.lineTo(n,i),l.stroke())};return this.visible&&i(e)&&(e.length||!0===e)&&(l.save(),e=!0===e||e[0],i(e)&&d(Math.max(h,Math.min(c,r)),u,Math.max(h,Math.min(c,r)),f,{lineWidth:e.lineWidth||1,color:e.color||s,dashStyle:e.dashStyle,snap:!!e.snap}),e=t.crosshairs[1],i(e)&&d(h,Math.max(u,Math.min(f,o)),c,Math.max(u,Math.min(f,o)),{lineWidth:e.lineWidth||1,color:e.color||s,dashStyle:e.dashStyle,snap:!!e.snap}),l.restore()),this},parseHTML:function(t,e){var n="";return i(t.color)&&(n+=function(t,e){return"<"+t+" style='"+[].concat(Array.prototype.slice.call(arguments,2)).join(";")+"'>"+e+"</"+t+">"}("span","","display:inline-block","margin:3px","border-radius:"+t.symbolWidth/2+"px","width:"+t.symbolWidth+"px","height:"+t.symbolWidth+"px","background-color:"+(t.color||"inherit"))),n+=t.value,n+=e?"":"<br />"},formatter:function(){var t=this.options.style||{},e={fontStyle:t.fontStyle||"normal",fontSize:t.fontSize||"12px",fontWeight:t.fontWeight||"normal",fontFamily:t.fontFamily||"Arial",lineHeight:t.lineHeight||"normal",color:t.color},n=this.canvas,i=this.context,r=this.data,a=this.useHTML,o=this,s="";r.forEach((function(t,n,r){var l=e.fontWeight;if("title"===t.type&&(l="bold"),1===t.value.nodeType)s=t.value;else if(!0===a)s+=o.parseHTML(t,!(r.length-n-1));else{i.save(),i.textAlign="start",i.textBaseline="alphabetic",i.fillStyle=e.color||"#ccc",i.font=[e.fontStyle,l,e.fontSize+"/"+e.lineHeight,e.fontFamily].join(" ");var h=v.HTML(v.parseHTML(t.value,e),i,e);i.translate(t.x,t.y),h.toCanvas(),"title"!==t.type&&(i.fillStyle=t.color,i.beginPath(),i.arc(-t.symbolWidth/1.5,-t.height/2,t.symbolWidth/2,0,2*Math.PI),i.fill()),i.restore()}})),1===s.nodeType?n.appendChild(s):!0===a&&(n.innerHTML=s)},setLabels:function(){var t,e=this.options,n=e.style,r=0|parseInt(e.padding,10),a=this.x,o=this.y,l=0,h=0,u=this.canvas,c=this.useHTML,f=this,d="";this.data.forEach((function(t,e,i){var s=v.measureText(t.value,n),u=-~e*s.height;t.height=s.height,t.x=a+r,t.symbolWidth=6,e&&(u+=4*e),t.y=o+u+r,l=u+r,h=Math.max(s.width,h),1===t.value.nodeType?d=t.value:!0===c&&(d+=f.parseHTML(t,!(~-i.length-e)))})),i(e.height)&&s(e.height)?this.height=e.height:this.height=l+r,i(e.width)&&s(e.height)?this.width=e.width:this.width=h+6+2*r,1===d.nodeType?(t=d.getBoundingClientRect(),u.innerHTML="",this.width=t.width,this.height=t.height):!0===c&&(u.style.display="block",u.innerHTML=d,t=u.getBoundingClientRect(),this.width=t.width,this.height=t.height)},setBounds:function(t){this.bounds=t},pointFormatter:function(t,e,n){var r,a,o,s,l,h=this.options,c=h.formatter,f=h.shared,d=this;if(l=t.length){for(;--l>=0&&!i(r=t[l].key););if(a=t.map((function(t){return t.shape})),u(c))if(o=a[0],s=c.call(f?{mx:e,my:n,x:r,key:r,value:o.$value,points:a}:{mx:e,my:n,x:r,value:o.$value,key:r,percentage:o.percentage,total:o.total,point:o,points:a},d),i(s))if(1===s.nodeType)d.text({value:s,hasDOM:!0});else{var p=v.HTML(v.parseHTML(s)).toHTML();p=p.split(/<br\s*\/*>/),i(p)&&p.forEach((function(t){d.text({value:t})}))}else d.hide();else i(r)&&d.text({value:"<b>"+r+"</b>",type:"title"}),a.forEach((function(t){d.text(t.name+": "+t.$value,{color:t.color})}))}},draw:function(){this.data.length&&(this.setLabels(),this.show(),!0!==this.useHTML&&this.style(),this.formatter(),this.data.splice(0)),this.addCrosshair()},style:function(){var t=this.options,e=a("number",t.padding,0),n=this.context,r=this.x-e,o=this.y,s=this.width+e,l=this.height;n.save(),n.lineWidth=t.borderWidth||0,n.fillStyle=t.backgroundColor,!0===t.shadow&&(n.shadowColor="#7B7B7B",n.shadowBlur=6,n.shadowOffsetX=0,n.shadowOffsetY=0),i(t.borderColor)&&(n.strokeStyle=t.borderColor),function(t,e,n,i,r){var a,o=Math.min(r&&r.r||0,n,i),s=o+6,l=r&&r.anchorX,h=r&&r.anchorY;return a=["M",t+o,e,"L",t+n-o,e,"C",t+n,e,t+n,e,t+n,e+o,"L",t+n,e+i-o,"C",t+n,e+i,t+n,e+i,t+n-o,e+i,"L",t+o,e+i,"C",t,e+i,t,e+i,t,e+i-o,"L",t,e+o,"C",t,e,t,e,t+o,e],l&&l>n&&h>e+s&&h<e+i-s?a.splice(13,3,"L",t+n,h-6,t+n+6,h,t+n,h+6,t+n,e+i-o):l&&l<0&&h>e+s&&h<e+i-s?a.splice(33,3,"L",t,h+6,t-6,h,t,h-6,t,e+o):h&&h>i&&l>t+s&&l<t+n-s?a.splice(23,3,"L",l+6,e+i,l,e+i+6,l-6,e+i,t+o,e+i):h&&h<0&&l>t+s&&l<t+n-s&&a.splice(3,3,"L",l-6,e,l,e-6,l+6,e,n-o,e),function(r){r.beginPath(),r.moveTo(t+o,e),r.lineTo(t+n-o,e),r.bezierCurveTo(t+n,e,t+n,e,t+n,e+o),r.lineTo(t+n,e+i-o),r.bezierCurveTo(t+n,e+i,t+n,e+i,t+n-o,e+i),r.lineTo(t+o,e+i),r.bezierCurveTo(t,e+i,t,e+i,t,e+i-o),r.lineTo(t,e+o),r.bezierCurveTo(t,e,t,e,t+o,e)}}(r,o,s,l,{r:t.borderRadius||4})(n),i(t.borderWidth)&&t.borderWidth>0&&n.stroke(),i(t.backgroundColor)&&n.fill(),n.restore()},setOptions:function(t){return r(this.options,t),this},setChart:function(t){this.charts=t},position:function(t,e){var n,r=this.options,a=r.positioner;return!0===r.show&&i(a)?(n=a,u(a)&&(n=a.call(this,t,e,{plotX:t,plotY:e})),o(n)&&s(n.x)&&s(n.y)?n:null):null},getShape:function(t,e){var n=this.options.shared,i=[];return this.charts.forEach((function(r){a("array",a("function",r.getShape,N).call(r,t,e,n)).forEach((function(t){i.push({shape:t.shape,series:t.series,key:t.shape.key})}))})),i},move:function(t,e,n){var i,r,a=this.options,o=this.getShape(t,e),s=this.position(t,e),l=!0===a.show&&null!==s,h=!0===n;switch(this.dx=t,this.dy=e,((this.itemLength=i=o.length)||!i&&l&&(t=s.x,e=s.y,(o=this.getShape(t,e)).length))&&(r=o[0].series,this.pointFormatter(o,t,e),this.setBounds({left:r.plotX,right:0,top:r.plotY,bottom:0,width:r.plotWidth,height:r.plotHeight})),h*(!i<<-~l)+!h*l){case 0:case 2:break;case 1:this.draw();break;case 4:this.dx=s.x,this.dy=s.y,this.show()}},show:function(){var t=this.canvas,e=this.useHTML,n=this.bounds||{},i=n.height-n.top-n.bottom,r=n.width-n.left-n.right,a=this.height,o=this.width,l=this.dx,h=this.dy;(h+=8)+a>=i&&(h-=a,h-=16),(l+=8)+o>=r&&(l-=o,l-=16),l<=n.left&&(l=n.left+8),a>n.height&&(h=this.dy-a/2),a>=n.height&&(h=this.dy-a/2)+a>=n.height&&(h=n.height-a-8),h<=n.top&&(h=n.top),this.x=l,this.y=h,!0===e&&s(l,!0)&&s(h,!0)&&(this.visible=!0,t.style.display="block",t.style.left=this.x+"px",t.style.top=this.y+"px")},hide:function(){this.visible=!1,this.addCrosshair(),this.destroy()},text:function(t,e){return e=e||{},o(t)||(t={name:t,value:t}),i(e.color)&&(t.color=e.color),this.data.push(t),this},destroy:function(){this.data.splice(0),!0===this.useHTML&&(this.canvas.style.display="none")}},"object"==typeof module?module.exports=c:"function"==typeof define&&define.amd&&define((function(){return c})),l.Tooltip=c}("undefined"!=typeof window&&window,e),function(t,l){var h=function(t,e,n,i){var r=2*Math.PI;return function(a){return a.beginPath(),a.arc(t+n/2,e+n/2,n/2-.5,0,r,!0),{x:t,y:e,width:n,height:i}}},c=function(t,e,n,i,r){r=r||0;var a=z(t,e,n-1,i-1);return t=a.x,e=a.y,n=a.width,i=a.height,function(a){return a.beginPath(),a.moveTo(t+r,e),a.lineTo(t+n-r,e),a.bezierCurveTo(t+n,e,t+n,e,t+n,e+r),a.lineTo(t+n,e+i-r),a.bezierCurveTo(t+n,e+i,t+n,e+i,t+n-r,e+i),a.lineTo(t+r,e+i),a.bezierCurveTo(t,e+i,t,e+i,t,e+i-r),a.lineTo(t,e+r),a.bezierCurveTo(t,e,t,e,t+r,e),{x:t-1,y:e-1,width:n,height:i}}},f=function(t,e,n,i){var r=2*Math.PI;return function(a){return a.save(),a.beginPath(),a.lineWidth=4,a.moveTo(t+3,e+n/2-1),a.lineTo(t,e+n/2-1),a.moveTo(t+n-3,e+n/2-1),a.lineTo(t+n,e+n/2-1),a.stroke(),a.restore(),a.beginPath(),a.lineWidth=3,a.arc(t+n/2,e+n/2-1,n/4,0,r,!0),{x:t,y:e,width:n,height:i}}},p={style:{fontSize:"12px",fontWeight:"bold",lineHeight:"normal",cursor:"pointer",color:"#606060"},x:0,y:0,width:void 0,maxHeight:void 0,padding:8,margin:0,layout:"horizontal",verticalAlign:"bottom",align:"center",floating:!1,borderWidth:0,borderColor:"#909090",backgroundColor:void 0,symbolWidth:14,symbolHeight:void 0,symbolRadius:6,symbolPadding:4,symbol:{enabled:!0,width:14,height:void 0,radius:6,padding:4},itemWidth:void 0,itemMarginBottom:8,itemDistance:20,navigation:{animation:!0},useHTML:!1},g=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t.style[n.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}))]=e[n]);return t};function x(){this.init.apply(this,arguments)}x.prototype={Item:function(t,e,n){this.x=t,this.y=e,this.node=null,this.selected=n.selected},init:function(t,e,i){this.options=r({},p),i=r(this.options,i),this.data=a("array",e,[]),this.container=t,this.canvas=t,this.context=this.canvas.getContext("2d"),!0===i.useHTML&&(this.canvas=g(t.parentNode.appendChild(n.createElement("div")),{position:"absolute",border:(0|i.borderWidth)+"px solid "+i.borderColor,"background-color":i.backgroundColor,"z-index":2})),this.width=0,this.height=a("number",i.height,0),this.maxHeight=a("number",i.maxHeight,0),this.items=[],this.setLabels(),this.translateY=0,this.scroller={next:null,prev:null},this.globalAnimation={isFinish:!1,startY:0,current:0}},translate:function(){var t=this.options,e=t.x,n=t.y,i=a("string",t.align,"center"),r=a("string",t.verticalAlign,"bottom"),o=a("number",t.padding,0),s=a("number",t.borderWidth,0),l=this.width,h=this.maxHeight,u=a("number",this.container.width/P,l),c=a("number",this.container.height/P,this.height);"left"===i?e+=s:"right"===i?e=u-l-s-o-e:e+=(u-l)/2,"top"===r?n+=s:"middle"===r?n+=(c-h)/2:n=c-h-s-n,this.x=e,this.y=n},setData:function(t){return this.data=t.slice(0),this.setLabels(),this},setOptions:function(t){return r(this.options,t),this.setLabels(),this},setWidth:function(t){this.width=t,this.setLabels()},setLabels:function(){var t,e=this.options,n=e.style,r=e.padding,o=e.layout,l=a("number",e.itemMarginBottom,8),h=a("number",e.itemDistance,0),c=a("number",e.symbolPadding,0),f=a("number",e.borderWidth,0),d={width:0,height:0},p=e.symbolWidth,y=e.useHTML,x=e.formatter,m={fontStyle:n.fontStyle||"normal",fontWeight:n.fontWeight||"normal",fontSize:n.fontSize||"12px",fontFamily:n.fontFamily||"Arial",lineHeight:n.lineHeight||"normal",color:n.color},b=this.canvas,w=this.context,M=this.items=[],A=this.data.length,S=0,L=0,k=e.itemWidth||e.width||80,E=1,T=0,C=r,F=0,W=0,_="",P=this,H=u(x);this.data.forEach((function(t,a){var s,u,f=t.name,g=!1!==t.selected,b=!1!==t.showInLegend,A=0,z=0,I=!1;if(b&&(w.font=[m.fontStyle,m.fontWeight,m.fontSize+"/"+m.lineHeight,m.fontFamily].join(" "),d=v.measureText(f,m),z=p,d.width>=k&&(f=v.multipText(f,k,m)),d.width=v.measureText(f,m).width,A=d.width+({column:p,pie:p,line:p+4}[t.type]||p)+c,W&&("vertical"===o||C+A>=e.width-2*r)&&(I=!0,C=r,F+=z+l,E%3==0&&(F+=r-l),3===E&&(T=F),E++),W++),M.push(s={x:C,y:F,width:A,height:z,text:t.name,value:t.name,selected:g,disabled:b,ellipse:f,type:t.type,color:t.color||n.color,series:t,index:a,nowrap:I}),u=H&&x.call(s,s.value,s.index,P),!0===y){var V=["<p style='",["position: absolute","left:"+C+"px","top:"+(F+c)+"px","color:"+(g?m.color:"#ccc"),"font:"+m.fontStyle+" "+m.fontWeight+" "+m.fontSize+" "+m.fontFamily,"white-space: nowrap"].join(";"),"' data-legend-index='"+a+"'>","<span style='",["display:inline-block","position:relative","top:3px","border-radius:3px","width:"+p+"px","height:"+p+"px","background-color:"+(g?t.color||n.color:"#ccc")].join(";"),"'></span>"," "+f,"</p>"];H?i(u)&&(V[6]=u,_+=V.join("")):_+=V.join("")}H&&!u||(C+=A+h*("horizontal"===o)),S=Math.max(S,C),L=F})),L+=p,i(e.height)||(this.height=(L+r)*(0!==A)),this.width=(S+2*r-h)*(0!==A),E<4&&(T=this.height),"vertical"===o&&(T=this.height),s(e.maxHeight)&&(T=e.maxHeight),this.maxHeight=(T+r)*(0!==A),this.lineNumber=E*(0!==A),this.translate(),t=z(0,0,this.width+15*(this.height>this.maxHeight),this.maxHeight-f,f),!0===y&&_.length&&(g(b,{left:this.x+t.x+"px",top:this.y+t.y+"px",height:t.height+"px",width:t.width+"px",overflow:"auto"}),b.innerHTML=_)},scrollTop:function(t){this.translateY=t},formatter:function(){var t,e=this.context,n=this.options,r=a("object",n.style,{}),s=n.formatter,l={fontStyle:a("string",r.fontStyle,"normal"),fontWeight:a("string",r.fontWeight,"normal"),fontSize:a("string",r.fontSize,"12px"),fontFamily:a("string",r.fontFamily,"Arial"),lineHeight:a("string",r.lineHeight,"normal"),color:r.color},d=a("number",n.padding,0),p=a("number",n.symbolWidth,16),g=a("number",n.symbolRadius,0),y=a("number",n.symbolPadding,0),x={},b=this;e.save(),e.translate(d,d+this.translateY),this.items.forEach((function(n){var r,a,d=n.x,w=n.y,M=n.selected?n.color:"#ccc",A=u(s)&&s.call(n,n.value,n.index,b);n.disabled&&(e.save(),e.font=[l.fontStyle,l.fontWeight,l.fontSize+"/"+l.lineHeight,l.fontFamily].join(" "),u(s)?i(A)&&(r=v.HTML(v.parseHTML(A),e,l)):r=v.HTML(v.parseHTML(n.ellipse),e,l),u(s)&&!i(A)||(x={column:c(d,w,p,p,g),pie:h(d,w,p,p),line:f(d,w,p+4,p)},e.lineWidth=1,e.strokeStyle=M,M=m.isColor(M)?m.parse(M).alpha(.55).rgba():o(M)?i(M.radialGradient)?m.parse(M).radial(d+g,w+g,g):i(M.linearGradient)?m.parse(M).linear(d,w,p,p):"#000":"#000",e.fillStyle=M,t=(x[n.type]||x.column)(e),e.stroke(),e.fill(),e.textAlign="start",e.textBaseline="alphabetic",e.fillStyle=n.selected?l.color:"#ccc",a=r.getBBox(),d=d+t.width+y,w+=a.height,w+=(t.height-1-a.height)/2,e.translate(d,w),r.toCanvas(e)),e.restore())})),e.restore()},draw:function(){var t,e=this.maxHeight,n=this.options,r=a("number",n.borderWidth,0),o=a("string",n.borderColor,"#000000"),s=this.context,l=this.height>e;this.data.length&&!0!==n.useHTML&&(s.save(),s.translate(this.x,this.y),t=z(0,0,this.width+15*l,e-r,r),s.fillStyle=i(n.backgroundColor)?n.backgroundColor:"none",c(t.x,t.y,t.width,t.height)(s),i(n.backgroundColor)&&s.fill(),(s.lineWidth=r)>0&&(s.strokeStyle=o,s.stroke()),l&&(s.clip(),this.next()),this.formatter(),s.restore())},next:function(){var t,e=this.options,n=a("number",e.itemMarginBottom,8),r=this.width,o=this.maxHeight,s=-5,l=this.context,h={p0:{x:0,y:0},p1:{x:0,y:0},type:"prev"},u={p0:{x:0,y:0},p1:{x:0,y:0},type:"next"};i(e.borderWidth)&&e.borderWidth>0&&(l.beginPath(),l.moveTo(r,0),l.lineTo(r,o),l.stroke()),l.lineWidth=3,l.strokeStyle="#CCC",l.fillStyle="red",l.lineJoin="round",l.lineCap="round",l.beginPath(),l.moveTo(t=u.p1.x=r+10+2,u.p0.y=s+=o-2.5),l.lineTo(t-=5,u.p1.y=s+5),l.lineTo(u.p0.x=t-=5,s),l.stroke(),l.beginPath(),l.moveTo(h.p1.x=t+=10,s=n),l.lineTo(t-=5,h.p0.y=s-5),l.lineTo(h.p0.x=t-=5,h.p1.y=s),l.stroke(),this.scroller.prev=h,this.scroller.next=u},onScroll:function(t){var n,r=this.options,o=r.navigation||{},s=a("number",r.padding,0),l=this.globalAnimation,h=this.canvas,u=this;arguments[1]&&(h=t,t=arguments[1]);var c=0,f=function(r){var a=[u.scroller.prev,u.scroller.next],h=null,f=d.normalize(r,this),p=f.x,g=f.y,x=u.x,v=u.y;if(!(u.height<u.maxHeight)){for(var m=0;m<a.length;m++){var b=a[m];if(b&&y.rect({x:p,y:g},{x:b.p0.x-10+x,y:b.p0.y-10+v,width:b.p1.x+10+x,height:b.p1.y+10+v})){h=b;break}}h&&(!1!==o.animation?function(r){var a,o="next"===r.type||-1,h=(l.isFinish,!1),c=l.startY,f=u.maxHeight-s;if((a=c+o*f)<0&&(c=-1,a=0),a>=u.height&&(a=c+1,h=!0),i(e.Animation)){var d=0;n=new e.Animation,[[{},function(t){d=c+(a-c)*t}]].forEach((function(e){var i=e[1];n.addAnimate(e[0],{step:function(e,n){i(n),u.translateY=-d,t&&t(u,d)},duration:300,delay:0,easing:"linear"})})),n.fire((function(){}),(function(){h||(l.startY=c=a),l.isFinish=!1}))}else u.translateY=-a,t&&t(u,a),h||(l.startY=c=a)}(h):function(e){var n=Math.floor(u.height/u.maxHeight),i="next"===e.type||-1;c+=i;var r=(c=Math.max(0,Math.min(c,n)))*u.maxHeight-s*c;r=Math.max(0,r),u.translateY=-r,t&&t(u,r)}(h))}};return W?new e.Touch(h).on({tap:f}):1===h.nodeType&&(h.removeEventListener("click",f,!1),h.addEventListener("click",f,!1)),f=null,this},destroy:function(){var t=this.globalAnimation;return t.isFinish=!1,t.startY=0,t.current=0,this}},function(t){var n=!1,i=function(t,e,n){for(var i,r=!1,o=this.items,s=this,l=!0===t?function(t){for(;e&&e.getAttribute&&null===e.getAttribute("data-legend-index");)e=e.parentNode;return(e&&e.getAttribute&&parseInt(e.getAttribute("data-legend-index"),10))===t.index}:function(n){return function(t,e,n,i){var r=t.options,o=a("number",r.padding,0),s=a("number",r.borderWidth,0),l=t.context;return c(t.x+e.x,t.y+e.y+t.translateY+o,e.width+o,e.height)(l),function(t,e){return!(t<e.y||t>e.height+e.y)}(i/P,{y:t.y-s,height:t.maxHeight-s})&&l.isPointInPath(n,i)}(s,n,t,e)},h=0;h<o.length;h++)if(l(i=o[h])){r=!0;break}n.call(i,r,o)},o=function(t,e){var n=d.normalize(t,e),i=n.x,r=n.y;return[i*=P,r*=P]};r(t.prototype,{onClick:function(t){var r=this.canvas,a=this,s=this.options.useHTML;arguments[1]&&(r=t,t=arguments[1]);var l=function(e){var n=o(e,this),r=n[1];n=n[0],i.apply(a,(!0===s?[s,e.target]:[n,r]).concat((function(e,n){var i=this;e&&(i.selected=!i.selected,t&&t.call(i,i.series,i.index,n))})))};return W&&!0!==s?new e.Touch(r).on({tap:l}):1===r.nodeType&&((r=!0===s?this.canvas:r).removeEventListener("click",l,n),r.addEventListener("click",l,n)),this},onState:function(t){var e,r=this.canvas,a=this;arguments[1]&&(r=t,t=arguments[1]);var s=function(n){var r=o(n,this),s=r[1];r=r[0],i.call(a,r,s,(function(n,i){var r=this;n||(e=0),n&&!e&&(e=1,t&&t.call(r,r.series,r.index,i))}))};return 1===r.nodeType&&(r.removeEventListener("mousemove",s,n),r.addEventListener("mousemove",s,n)),s=null,this}})}(x),l.Legend=x,"object"==typeof module&&module.exports?module.exports=x:"function"==typeof define&&define.amd?define((function(){return x})):(void 0!==l?l:this).Legend=x}("undefined"!=typeof window&&window,e.Chart),function(t,e){var n=e.Chart,h=n.angle2arc,c=w.String.padding,f=w.String.numberFormat,d=p.round,g=p.pow,A=864e5,k={millisecond:{interval:1,format:function(t){var e=new Date(t);return[c(e.getMinutes(),"0"),":",c(e.getSeconds(),"0"),".",(""+e.getMilliseconds()).substr(0,3)].join("")}},second:{interval:1e3,format:function(t){var e=new Date(t);return[c(e.getHours(),"0"),":",c(e.getMinutes(),"0"),":",c(e.getSeconds(),"0")].join("")}},minute:{interval:6e4,format:function(t){var e=new Date(t);return[c(e.getHours(),"0"),":",c(e.getMinutes(),"0")].join("")}},hour:{interval:36e5,format:function(t){var e=new Date(t);return[c(e.getHours(),"0"),":",c(e.getMinutes(),"0")].join("")}},day:{interval:A,format:function(t){var e=new Date(t),n=e.getFullYear(),i=e.getMonth(),r=e.getDate();return[n,"/",c(i+1,"0"),"/",c(r,"0")].join("")}},week:{interval:6048e5,format:function(t){var e=new Date(t),n=e.getFullYear(),i=e.getDate(),r=0===e.getDay()?7:e.getDay();return e.setDate(e.getDate()+4-r),r=Math.floor((e.getTime()-new Date(e.getFullYear(),0,1,-6))/A),[n,"W",c(r=1+~~(r/7),"0"),"D",c(i,"0")].join("")}},month:{interval:2592e6,format:function(t){var e=new Date(t),n=e.getFullYear(),i=e.getMonth();return[n,"/",c(i+1,"0")].join("")}},year:{interval:31536e6,format:function(t){return new Date(t).getFullYear()}}},E=function(t){return Math.pow(10,Math.floor(Math.log(t)/Math.LN10))},T=function(t,e){var n,r,a=e.length,o=Math.abs(t);if(a&&o>=1e3){for(;a--&&!i(n);)o>=(r=Math.pow(1e3,a+1))&&null!==e[a]&&(n=10*o%r==0?f(o/r,null)+e[a]:f(Math.round(o/r*100)/100,null)+e[a]);i(n)&&(n=(t<0?"-":"")+n)}else i(n)||(n=f(t,null,void 0));return n},F={enabled:!0,type:"linear",title:{align:"middle",enabled:!0,margin:5,offset:void 0,rotation:0,style:{fontWeight:"normal",fontSize:"12px",color:"#707070"},text:"Axis Values",x:0,y:0},labels:{align:"center",verticalAlign:void 0,style:{fontSize:"12px",fontWeight:"normal",color:"#606060"},padding:5,autoRotation:-45,formatter:void 0,size:30,x:0,y:0},logarithmic:{base:10},lineColor:"rgba(0,0,0,.5)",lineWidth:1,gridLineColor:"rgba(0,0,0,.2)",gridLineWidth:1,gridLineDashStyle:"solid",min:void 0,max:void 0,tickInterval:1,tickLength:6,tickWidth:1,opposite:!1,reversed:!1,lang:{numericSymbols:["k","M","G","T","P","E"],decimalPoint:"."},x:0,y:0,layout:"vertical",verticalAlign:"top",floating:void 0,angleOptions:{}};function W(){this.init.apply(this,arguments)}W.prototype={Item:function(){var t=this.options,e=t.labels||{},n=a("number",e.autoRotation,-45),r=a("number",t.tickLength,0),o=a("number",t.tickWidth,0),l=a("number",t.lineWidth,0),h=a("number",t.gridLineWidth,0),u=t.gridLineInterpolation,c=!!t.opposite,f=a("object",e.style,{}),p={fontStyle:f.fontStyle||"normal",fontWeight:f.fontWeight||"normal",fontSize:f.fontSize||"12px",fontFamily:f.fontFamily||"Arial",lineHeight:f.lineHeight||"normal",color:f.color},g=i(t.categories)&&!!t.categories.length,y=this.context,b=this.name,w=this.minRange,M=this.maxRange,A=this;function S(){}return S.line=function(){var e,n,r,s=a("number",t.x,0),h=a("number",t.y,0),f=t.lineColor,d=t.lineDashStyle,p=A.zeroAxis,g=t.center,v=t.size,w=a("number",t.startAngle,-90);e=z(s,h-o/2,s,h+M+o,l),"xAxis"===b&&(e=z(s,h,s+M,h+l,l)),y.save(),l>0&&("yAxis"===b||"xAxis"===b?(y.beginPath(),y.lineWidth=l,y.strokeStyle=f,y.moveTo(e.x,e.y),y.lineTo.apply(y,"yAxis"===b?[e.x,e.height]:[e.width,e.y]),y.stroke(),p.hidden||(e=z.apply(null,"xAxis"===b?[s+p.x,h,s+p.x,h-t.height*!c,1]:[s,h+p.y,s+t.width*!c,h+p.y,1]),y.beginPath(),y.lineWidth=l,y.strokeStyle=m.parse(f).alpha(.45).rgba(),y.moveTo(e.x,e.y),y.lineTo.apply(y,"xAxis"===b?[e.x,e.height]:[e.width,e.y]),y.stroke())):"polarAxis"===b&&g?(n=g[0],r=g[1],y.beginPath(),"polygon"===u?(A.ticks.forEach((function(t,e){y[e?"lineTo":"moveTo"](Math.cos(t.angle*V/180)*v+n,Math.sin(t.angle*V/180)*v+r)})),y.closePath()):i(d)?x.arc(y,n,r,v,0,Y,d):y.arc(n,r,v,0,Y),y.lineWidth=l,y.strokeStyle=f,y.stroke()):"radiusAxis"===b&&g&&(n=g[0],r=g[1],w=w*V/180,y.moveTo(n,r),y.lineTo(Math.cos(w)*v+n,Math.sin(w)*v+r),y.lineWidth=l,y.strokeStyle=f,y.stroke())),y.restore()},S.xAxis=function(e){var n,s=a("number",t.x),l=a("number",t.y),u=l+e.y,c=s+e.x,f=!!t.opposite;if(c=Math.max(0,c),y.save(),t.tickWidth>0&&(y.beginPath(),y.strokeStyle=t.tickColor,y.lineWidth=o,n=z(c,u,c,u-r*(f||-1),o),e.isFirst&&!0!==t.startOnTick||(y.moveTo(n.x,n.y),y.lineTo(n.x,n.height)),e.isLast&&!0===t.endOnTick&&(n=z(c+M,u,c+M,u+r*(f||-1),o),y.moveTo(n.x,n.y),y.lineTo(n.x,n.height)),y.stroke()),!e.isFirst&&(!e.isLast||g)&&i(t.height)&&h>0){var d=a("string",t.gridLineDashStyle,"solid");y.beginPath(),y.lineWidth=h,y.strokeStyle=t.gridLineColor,n=z(c,l,c,l-t.height*(!f||-1),h),x[d]&&x[d](y,n.x,n.y,n.x,n.height),y.stroke()}y.restore()},S.yAxis=function(e){var n,s=a("number",t.x,0),l=a("number",t.y,0),u=l+e.y,f=s+e.x;if(u=Math.max(0,u),y.save(),o>0&&(y.beginPath(),n=z(f,u,f+r*(c||-1),u,o),y.lineWidth=o,y.strokeStyle=t.tickColor,e.isFirst&&!0!==t.startOnTick||(y.moveTo(n.x,n.y),y.lineTo(n.width,n.y)),e.isLast&&!0===t.endOnTick&&(n=z(f,l,f-r*(c||-1),l,o),y.moveTo(n.x,n.y),y.lineTo(n.width,n.y)),y.stroke()),h>0&&/*!item.isFirst && */i(t.width)){var d=a("string",t.gridLineDashStyle,"solid");y.beginPath(),y.lineWidth=h,y.strokeStyle=t.gridLineColor,n=z(s,u,s+t.width*(!c||-1),u,h),x[d]&&x[d](y,n.x,n.y,n.width,n.y)}y.restore()},S.colorAxis=function(e){var n,o=a("number",t.x,0),l=a("number",t.y,0),h=t.stops,u="horizontal"===t.layout;if(e.isFirst){i(h)||(h=[[0,"#EFEFFF"],[1,"#102D4C"]]);var c=o,f=l,d=r,p=Math.abs(M-w);u&&(d=Math.abs(M-w),p=r),n=y.createLinearGradient.apply(y,[c,f].concat(u?[d,f]:[c,p]));for(var g=0;g<h.length;g++){var x=h[g];s(x[0])&&"string"==typeof x[1]&&n.addColorStop(x[0],h[u?g:h.length-g-1][1])}y.save(),y.fillStyle=n,y.strokeStyle=t.lineColor,y.lineWidth=t.lineWidth,y.beginPath(),y.fillRect(c,f,d,p),y.fill(),i(t.lineWidth)&&t.lineWidth>0&&y.stroke(),y.restore()}},S.polarAxis=function(e){var n=t.gridLineDashStyle,a=t.gridLineColor,s=e.cx,l=e.cy,u=e.innerRadius,c=e.radius,f=e.angle*V/180;if(o>0&&(y.save(),y.beginPath(),y.lineWidth=o,y.fillStyle=t.tickColor,y.translate(s,l),y.rotate(f),y.fillRect(e.radius,0,r,o),y.restore()),u>0&&h>0){y.save(),y.beginPath(),y.lineWidth=h,y.strokeStyle=a;var d=s+Math.cos(f)*c,p=l+Math.sin(f)*c;i(n)&&x[n]&&"solid"!==n?x[n](y,s,l,d,p):(y.moveTo(s,l),y.lineTo(d,p)),y.stroke(),y.restore()}},S.radiusAxis=function(e){var n=a("number",t.tickWidth,1),o=t.tickColor,s=t.gridLineInterpolation,l=t.gridLineDashStyle,u=t.gridLineColor,c=t.length,f=e.cx,d=e.cy,p=e.innerRadius,g=e.startAngle*V/180;if(n>0&&(y.save(),y.transform(Math.cos(g),Math.sin(g),-Math.sin(g),Math.cos(g),f,d),y.moveTo(p,0),y.lineTo(p,r),y.strokeStyle=o,y.stroke(),y.restore()),p>0&&h>0&&!e.isFirst){if(y.save(),y.beginPath(),y.lineWidth=h,y.strokeStyle=u,"polygon"===s){for(var v=0;v<c;v++){var m=v/c*Y+g;y[v?"lineTo":"moveTo"](Math.cos(m)*p+f,Math.sin(m)*p+d)}y.closePath()}else i(l)&&"solid"!==l?x.arc(y,f,d,p,0,Y,l):y.arc(f,d,p,0,Y);y.stroke(),y.restore()}},S.adjustLabel=function(r,o,l){var h=!!t.opposite,u=r.size,c=t.tickLength,g=t.logarithmic,x=t.layout,S=a("number",t.x,0),L=a("number",t.y,0),k=A.type,E=l.isRotation,T=l.isCenter,C=i(t.categories)&&!!t.categories.length,F=e.rotation,W=A.labelWidth;!0===h&&(c=-c),i(F)||(F=E&&"xAxis"===b?n:0),T=T&&C;var _=r.x,P=r.y,z=r.cx,H=r.cy,I=r.radius,Y=r.text;if(i(Y.ellipse)){var N=Y.height,O=Y.width;if("yAxis"===b)!0===h&&(O=0),P=Math.max(0,P),C&&(P-=r.size/2),_=function(t,e,n){return{left:t-(e-n),center:t,right:t+(e-n)}}(_=_-O-c,W,Y.width)[a("string",e.align,"center")];else if("xAxis"===b)_=Math.max(0,_),T?_+=(u-O)/2:_-=O/2,P=P+c+a("number",Y.firstHeight,Y.height),!0===h&&(P=P-N/2+c);else if("polarAxis"===b){var R=r.angle*V/180;_=Math.cos(R)*(I+c+3)+z,P=Math.sin(R)*(I+c+3)+H}(s(e.rotation)||E&&"xAxis"===b)&&(F<0&&(F=360+F),(F%=360)>0&&F<=90?(_=r.x+(r.size-Y.width)/2,P=r.y+c):F>=180&&F<270?(_=r.x+r.size,P=r.y+Y.height*!h+c):F>=270&&F<360?(_="categories"===k?r.x+r.size/2-Y.width/2*!h:r.x-Y.width/2,P=r.y+Y.height*!h+c):(_=r.x+(r.size-Y.width)/2,P=r.y+Y.height+c));var X=m.parse(p.color);if(X.a=Math.max(0,Math.min(a("number",r.opacity,1),1)),y.save(),y.beginPath(),y.fillStyle=m.rgba(X),y.textAlign="start",y.textBaseline="alphabetic",y.font=[p.fontStyle,p.fontWeight,p.fontSize+"/"+p.lineHeight,p.fontFamily].join(" "),"colorAxis"===b)(Y.isLast&&("horizontal"!==x?(_=r.x+(c-Y.width)/2,P=w-2):(_=r.x,P=r.y+Y.height+(c-Y.height)/2),1)||Y.isFirst&&("horizontal"!==x?(_=r.x+(c-Y.width)/2,P=M+Y.height+2):(_=r.x-Y.width-2,P=r.y+Y.height+(c-Y.height)/2),1))&&(y.translate(S+_+a("number",e.x,0),L+P+a("number",e.y,0)),y.fillText(Y.ellipse,0,0));else{var j=v.HTML(v.parseHTML(Y.ellipse),y,{fontFamily:f.fontFamily,fontSize:f.fontSize,fontWeight:f.fontWeight}),D=v.measureText(Y.ellipse,f);"yAxis"===b?P+=D.height/2:"polarAxis"===b?(Math.abs(_-z)/I<.3?_-=D.width/2:_<=z&&(_-=D.width),Math.abs(P-H)/I<.3?P+=D.height/2:P>H&&(P+=D.height)):"radiusAxis"===b&&(y.translate(r.cx,r.cy),y.rotate(r.startAngle*V/180),_=r.radius-r.innerRadius-Y.width/2,P=c+Y.height,F=0),y.translate(S+_+a("number",e.x,0),L+P+a("number",e.y,0)),y.rotate(F*V/180),j.toCanvas(y)}if("logarithmic"===k&&s(g.base)&&i(g.pow)){var B,q=1;s(t.tickAmount)&&t.tickAmount>1&&(q=A.maxDomain/~-t.tickAmount),B=d(A.startValue+q*o,1),y.scale(.8,.8),y.fillText(B,h?.8*Y.width:O-y.measureText(B).width/2,0)}y.restore()}},S.render=function(t){return"xAxis"===b?this.xAxis(t):"yAxis"===b?this.yAxis(t):"colorAxis"===b?this.colorAxis(t):"polarAxis"===b?this.polarAxis(t):"radiusAxis"===b&&this.radiusAxis(t),this},S},init:function(t,e){this.options=r({},F);var n=r(this.options,e);this.type=l(n.categories)?"categories":n.type,this.name=n.name||"xAxis",this.startValue=0,this.endValue=0,this.minValue=0,this.maxValue=0,this.minRange=(n.range=n.range||[])[0],this.maxRange=n.range[1],this.labelWidth=0,this.labelHeight=0,this.isRotation=!1,this.ticks=[],this._ticks=[],this.tickPositions=[],this.values=[],this.tickInterval=5,this.tickGap=1,this.zeroAxis={hidden:!0,x:0,y:0},this.canvas=t,this.context=t.getContext("2d"),!~"logarithmic categories datetime".indexOf(this.type)&&(this.type="linear"),this.setTitle()},translate:function(t,e){var n=this.options;return n.x=t,n.y=e,this},domain:function(t,e){var n=this.options;return arguments.length?(n.domain[0]=t,n.domain[1]=e,this):n.domain},range:function(){return arguments.length?(this.minRange=arguments[0],this.maxRange=i(this.minRange)?arguments[1]||0:this.minRange=0,this):[this.minRange,this.maxRange]},nice:function(t,e,n){i(n)||(n=10);var r,a=t,o=e;a>o&&(r=a,a=o,o=r);var s=E((r=o-a)/n),l=n/r*s;return l<=.15?s*=10:l<=.35?s*=5:l<=.75&&(s*=2),a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,t>e&&(r=a,a=o,o=r),{min:a,max:o,step:s}},getLinearTicks:function(t,e){var n,r,a=this.options,o=a.interval,l=a.tickAmount,h=this.tickInterval,u=[],c=t,f=e,d=0,p=Math.floor,g=Math.ceil,y=Math.abs,x=Math.pow(10,16);c>f&&(n=c,c=f,f=n);var v,m,b,w,M=E((n=f-c)/h),A=h/n*M;if(A<=.15?M*=10:A<=.35?M*=5:A<=.75&&(M*=2),M===1/0)return u;if(s(l))for(h=Math.max(1,l-1),n=y((c*=l)-(f*=l))/h,c=p(c/(v=E(n)))*v,f=g(f/v)*v;d<l;)n=y(f-c)/l,r=c/l+(n/=h)*d++,u.push(parseFloat(S(r),10));else if(s(o))for(m=c,b=f,M=Math.min(Math.abs(f-c)/2,o),r=m;M<0?r>=b:r<=b;)r=m+M*d++,u.push(r);else{for(c=p(p(c/M)*M*x)/x,f=p(g(f/M)*M*x)/x,m=parseFloat(S(c,10),16),b=g(f/M)*M+.5*M,w=1;y(M)*w%1;)w*=10;for(m*=w,b*=w,M*=w;r=m+M*d++,M<0?r>b:r<b;)u.push(r/w)}return i(a.startValue)&&t!==u[0]&&(u[0]=parseFloat(S(t,10),10)),i(a.endValue)&&e!==u[u.length-1]&&(u[u.length-1]=parseFloat(S(e,10),10)),u},getCategoriesTicks:function(t,e){var n,i=this.options.tickAmount,r=[];if(s(i))for(i=Math.max(1,~~i),n=0;n<i;n++)r.push(t+n);else for(n=t;n<e;n+=1)r.push(n);return r},getLogTicks:function(t,e,n){var i,r=this.options.tickAmount,a=[],o=t,l=e;o>l&&(i=o,o=l,l=i),i=l-o;var h,u=o>=0&&l>=0,c=Math.floor(parseFloat(S(o),10)),f=1+Math.ceil(parseFloat(S(l),10));if(s(r))for(r=Math.max(r,1),h=0;h<r;h++){var d=g(h,n,u);a.push(parseFloat(S(d,15),10))}else if(isFinite(c)&&isFinite(f))for(i=1+Math.ceil(l),h=0;h<i;h++)a.push(g(h,n,u));return a},getTimeTicks:function(t,e){var n,i,r,o,l=this.options,h=l.tickAmount,u=t,c=e,f=(k[l.dateType]||{}).interval||A,d=function(t,e,n,i,r,o){return new Date(t,e,a("number",n,1),a("number",i,0),a("number",r,0),a("number",o,0)).getTime()},p=function(t,e,n,i,r){return f===k.year.interval?t=d(n+e,0):f===k.month.interval?t=d(n,i+e):f===k.day.interval?t=d(n,i,r+e):f===k.week.interval?t=d(n,i,r+7*e):t+=f,t},g=[],y=1;if("Invalid Date"===(n=new Date(u)).toString()||"Invalid Date"===(i=new Date(c)).toString())return g;n.getTime()>i.getTime()&&(r=n,n=i,i=r),n.setMilliseconds(f>=k.second.interval?0:n.getMilliseconds()),f>=k.second.interval&&n.setSeconds(f>=k.minute.interval?0:n.getSeconds()),f>=k.minute.interval&&n.setMinutes(f>=k.hour.interval?0:n.getMinutes()),f>=k.hour.interval&&n.setHours(f>=k.day.interval?0:n.getHours()),f>=k.day.interval&&n.setDate(f>=k.month.interval?1:n.getDate()),f>=k.month.interval&&(n.setDate(f>k.year.interval?0:n.getMonth()),o=n.getFullYear()),f>k.year.interval&&n.setFullYear(o),o=n.getFullYear();var x=n.getTime(),v=n.getMonth(),m=n.getDate();if(i=i.getTime(),s(h))for(h=Math.max(1,~~h),r=Math.floor((i-x)/h);y<=h;){var b=p(x,y,o,v,m);b+=r*y,g.push(b),y++}else for(g.push(x);x<i;)g.push(x=p(x,y,o,v,m)),y++;return g},getPolarTicks:function(){var t,e=this.options.tickAmount,n=[];s(e)||(e=12),t=360/e;for(var i=0;i<e;i++)n.push(0+parseFloat(S(i*t,10),10));return n},setTickInterval:function(){var t,e=this.options,n=e.categories,i=e.tickAmount,r=a("number",a("object",e.logarithmic,{}).base,10),o=this.type,h=e.domain,u=h[0],c=h[1],f=e.minValue,d=e.maxValue,p=e.startValue,g=e.endValue;(p=Math.min(100,Math.max(0,a("number",parseFloat(p,10),0)))/100)>(g=Math.min(100,Math.max(0,a("number",parseFloat(g,10),100)))/100)&&(t=p,p=g,g=t),u>c&&(t=u,u=c,c=t),p=u+(c-u)*p,g=u+(c-u)*g;var y=[],x="logarithmic"===o?this.getLogTicks(f,d,r):"datetime"===o?this.getTimeTicks(u,c):this.getLinearTicks(f,d);return"logarithmic"===o?y=this.getLogTicks(u,c,r):"categories"===o||l(n)?y=this.getCategoriesTicks(u,c):"datetime"===o?y=this.getTimeTicks(p,g):"polarAxis"===this.name?y=this.getPolarTicks():(s(i)||"polarAxis"!==this.name||"polygon"!==e.gridLineInterpolation||(i=e.length),y=this.getLinearTicks(u,c)),!0===e.reversed&&y.reverse(),y.length>=1&&(this.startValue=y[0],this.endValue=y[y.length-1]),x.length>1?(this.minValue=x[0],this.maxValue=x[x.length-1]):(this.minValue=f,this.maxValue=d),"logarithmic"===o&&(this.minValue=C(this.minValue,r),this.maxValue=C(this.maxValue,r)),this.values=y},setLabels:function(){var t,e=this.options,n=e.layout||{},i=e.categories&&l(e.categories)&&!!e.categories.length,r=this.maxRange,o=this.minRange,s=this.startValue,h=this.endValue,u=this.ticks,c=this.type,f=this.name,d=0,p=this,g=a("number",e.startAngle,-90),y=((y=a("array",e.center,["50%","50%"])).length<2&&(y[1]=y[0]),y),x=r;y[0]=a("number",y[0],b.percentage(e.width,y[0])),y[1]=a("number",y[1],b.percentage(e.height,y[1])),p.zeroAxis.hidden="categories"===c||!(s<=0&&h>0)||"xAxis"!==f&&"yAxis"!==f,(t=u.length)&&(d=Math.max(o,r,1)/t,u.forEach((function(e,a){if("xAxis"===f)d=r/Math.max(1,t-1),e.y=0,"categories"===c?(d=r/(t-!i),e.x=i?a*d:L(e.value,s,h,o,r)):e.x=L(e.value,s,h,o,r),0===e.value&&(p.zeroAxis.x=e.x);else if("yAxis"===f)e.x=0,"logarithmic"===c?(d=Math.max(o,r,1)/Math.max(1,t-1),e.y=(t-a-1)*d):"categories"===c?(d=r/(t-!i),e.y=(t-a-!i)*d):e.y=L(e.value,s,h,r,o),0===e.value&&(p.zeroAxis.y=e.y);else if("colorAxis"===f)"vertical"===n?(e.x=0,e.y=L(e.value,s,h,r,o)):(e.x=L(e.value,h,s,r,o),e.y=0);else if("polarAxis"===f||"radiusAxis"===f){var l=a/Math.max(1,t-("radiusAxis"===f)),u=x-x*l,v=360*l+g,m=v*V/180,b=y[0],w=y[1];e.cx=b,e.cy=w,e.x=Math.cos(m)*x+b,e.y=Math.sin(m)*x+w,e.angle=v,e.radius=x,e.innerRadius=u,e.startAngle=g}e.size=d})))},scale:function(t,e){var n=this.options,r=n.labels||{},o=a("number",r.autoRotation,-45),l=a("array",n.categories,[]),h=a("number",n.tickLength,0),u=n.logarithmic||{},c=r.step,f=r.maxWidth,p=r.rotation,g=n.tickInterval,y=n.tickAmount,x=a("object",r.style,{}),m={fontStyle:a("string",x.fontStyle,"normal"),fontWeight:a("string",x.fontWeight,"normal"),fontSize:a("string",x.fontSize,"12px"),fontFamily:a("string",x.fontFamily,"Arial"),lineHeight:a("string",x.lineHeight,"normal")},b=60,w=0,M=0,A=0,S=[],L=this.values,k=this.tickPositions,E="categories"===this.type,T=s(p)&&!isNaN(p)&&isFinite(p),C=this,F=this.context,W=this.type,_=this.name;"yAxis"===_&&(b=this.labelHeight);var P=L.length;s(g)||(g=1),s(c)?g=c:s(y)||"logarithmic"===W||"colorAxis"===_?g=1:~~(e/P)<=b&&(g=Math.round(P/e*b)),g=Math.max(g,1);for(var z=0,H=0;z<P;z++){var I=L[z],V={isFirst:0===z,isLast:z===P-1,value:I,gap:Math.abs(I-(L[z+1]||I))};k[z]=E&&l[z]||I,z%g==0&&(H++,V.enabled=!0,S.push(V))}(P=S.length)&&(A=(e-t)/H,S.forEach((function(t,e){var r,a=C.labelFormatter(t.value,{isFirst:!e,isLast:!(P-e-1),index:e}),o=a;F.font=[m.fontStyle,m.fontWeight,m.fontSize+"/"+m.lineHeight,m.fontFamily].join(" "),r=v.HTML(v.parseHTML(a),F,{fontStyle:m.fontStyle,fontWeight:m.fontWeight,fontSize:m.fontSize,lineHeight:m.lineHeight,fontFamily:m.fontFamily}).getBBox(),s(f);var l,h=A-4*("xAxis"===_);"xAxis"!==_&&"yAxis"!==_||(s(f)?f<r.width&&(o=v.multipText(""+a,f)):r.width>h&&(o=v.multipText(""+a,h))),r=v.HTML(v.parseHTML(o),F,{fontStyle:m.fontStyle,fontWeight:m.fontWeight,fontSize:m.fontSize,lineHeight:m.lineHeight,fontFamily:m.fontFamily}).getBBox(),s(u.base)&&i(u.pow)&&(l=1,s(n.tickAmount)&&n.tickAmount>1&&(l=C.maxDomain/~-n.tickAmount),r.width+=.7*F.measureText(d(e*l,1)).width),T=T||"xAxis"===_&&r.width>=h,t.text={name:a,ellipse:o,width:r.width,height:r.height,isFirst:!e,isLast:!(P-e-1)}})),S.forEach((function(t){var e,n=t.text;"xAxis"===_&&(e=v.measureText(n.ellipse,{fontStyle:m.fontStyle,fontWeight:m.fontWeight,fontSize:m.fontSize,lineHeight:m.lineHeight,fontFamily:m.fontFamily,rotation:a("number",p,T?o:0)}),n.firstHeight=e.height,e=v.HTML(v.parseHTML(n.ellipse),F,{fontStyle:m.fontStyle,fontWeight:m.fontWeight,fontSize:m.fontSize,lineHeight:m.lineHeight,fontFamily:m.fontFamily,rotation:a("number",p,T?o:0)}).getBBox(),n.width=e.width,n.height=e.height),w=Math.max(w,n.width),M=Math.max(M,n.height)})),i(p)||(p=0,"xAxis"===_&&T&&(p=o)),p=p*Math.PI/180,M+=/*!isRotation **/h),"yAxis"===_?w+=h:"xAxis"===_&&(M+=h),this.labelWidth=w*!r.floating,this.labelHeight=M*!r.floating,this.isRotation=T,this.ticks=S},setTitle:function(){var t,e=this.options,n=this.context,r=e.title||{},s=e.labels||{},l=a("number",r.margin,0),h=r.style||{},u={fontWeight:h.fontWeight||"normal",fontStyle:h.fontStyle||"normal",fontFamily:h.fontFamily||(s.style||{}).fontFamily||"Arial",fontSize:h.fontSize||"12px",lineHeight:h.lineHeight||"normal",color:h.color},c=a("number",e.x,0)+a("number",r.x,0),f=a("number",e.y,0)+a("number",r.y,0);o(r)&&!1!==r.enabled&&i(r.text)&&(n.save(),n.textAlign="start",n.textBaseline="alphabetic",n.fillStyle=u.color,n.font=[u.fontStyle,u.fontWeight,u.fontSize+"/"+u.lineHeight,u.fontFamily].join(" "),t=v.measureText(r.text,u),f-=l,!0===e.opposite&&(c-=t.width),n.fillText(r.text,c,f),n.restore(),this.titleWidth=t.width,this.titleHeight=t.height+l)},setPlotLine:function(t,e,n){var i,r,o,s,l=this.options,h={fontSize:"14px",fontWeight:"bold",fontFamily:"Arial",color:"#666"},u=a("number",n.arrowLength,5),c=this.context,f=this;o=b.toPrecision(n.value),i=(s=v.measureText(o,h)).width+16,r=s.height+8,"bottom"===n.anchor?(t=Math.min(t,f.maxRange-i+l.x),e-=r+u):"left"===n.anchor?(t+=u,e=Math.min(e,f.maxRange-r+l.y)):"top"===n.anchor&&(t=Math.min(t,f.maxRange-i+l.x),e+=u),c.save(),c.textAlign="start",c.textBaseline="alphabetic",c.fillStyle="rgba(251, 251, 251, .85)",function(t,e,n,i,r){var a=r.arrowLength||10,o=r.anchor||"left",s=[{x:t,y:e},{x:t+n,y:e},{x:t+n,y:e+i},{x:t,y:e+i},{x:t,y:e+i/2+a},{x:t-a,y:e+i/2},{x:t,y:e+i/2-a},{x:t,y:e}];return"top"===o?s.splice(1,s.length,{x:t+n/2-a,y:e},{x:t+n/2,y:e-a},{x:t+n/2+a,y:e},{x:t+n,y:e},{x:t+n,y:e+i},{x:t,y:e+i},{x:t,y:e}):"bottom"===o&&s.splice(3,s.length,{x:t+n/2+a,y:e+i},{x:t+n/2,y:e+i+a},{x:t+n/2-a,y:e+i},{x:t,y:e+i},{x:t,y:e}),function(t){t.beginPath(),t.moveTo(s[0].x,s[0].y),s.forEach((function(e){t.lineTo(e.x,e.y)}))}}(t,e,i,r,{arrowLength:u,anchor:n.anchor})(c),(c.lineWidth=1)&&(c.strokeStyle=n.color,c.stroke()),c.fill(),c.fillStyle=h.color,c.font=h.fontWeight+" "+h.fontSize+" "+h.fontFamily,c.fillText(o,t+8,e+s.height+u),c.restore()},setGrid:function(t,e,n){var r=this.options,a=r.gridLineInterpolation,o=this.context,s=this.name,l=Math.sin,u=Math.cos,c=function(t,e,n,i,r){o.fillStyle=r,o.fillRect(t,e,n,i)};i(r.alternateGridColor)&&n.length>1&&(o.save(),o.translate(r.x,r.y),"xAxis"===s?e%2&!t.isLast&&c(t.x+.5,t.y-r.height,Math.abs(n[0].x-n[1].x),r.height-.5,r.alternateGridColor):"yAxis"===s?!(e%2)&&!t.isLast&&c(t.x+.5,t.y-Math.abs(n[0].y-n[1].y),r.width,Math.abs(n[0].y-n[1].y),r.alternateGridColor):"radiusAxis"===s&&!(e%2)&&!t.isLast&&function(t,e){var i,s,c=t.cx,f=t.cy,d=t.innerRadius,p=t.startAngle,g=Math.abs(n[0].innerRadius-n[1].innerRadius),y=r.length;if(o.fillStyle=e,o.beginPath(),"polygon"===a){for(i=0;i<=y;i++)s=i/y*Y+p,o[i?"lineTo":"moveTo"](u(s)*d+c,l(s)*d+f);for(o.lineTo(u(s)*(d-g)+c,l(s)*(d-g)+f),i=y;i>=0;i--)s=i/y*Y+p,o.lineTo(u(s)*(d-g)+c,l(s)*(d-g)+f)}else h(c,f,d,d-g,0,Y,!1)(o);o.fill()}(t,r.alternateGridColor),o.restore())},setOptions:function(t){var e;return r(this.options,t),i(t.domain)&&this.setTickInterval(),i(e=t.range)&&(this.minRange=e[0],this.maxRange=e[1]||e[0],this.setLabels()),this},labelFormatter:function(t,e){var n,r=this.options,o=a("array",r.lang.numericSymbols,[]),l=(r.labels||{}).formatter,h=a("object",r.logarithmic,{});e=e||{};var c=this.type;return"categories"===c?(n=a("array",r.categories,[])[t],!i(n)&&(n=t),this.tickPositions[t]=n):"datetime"===c?n=function(t,e){var n=k[e];return n.format?n.format(t):t}(t,r.dateType||"year"):"logarithmic"===c?(i(h)&&s(h.base)&&i(h.pow)&&(n=""+(h.base===Math.E?"e":h.base)),i(n)||(n=T(t,o))):n=T(t,o),u(l)&&(n=l.call({axis:this,value:t,name:i(n)?n:t,isFirst:!!e.isFirst,isLast:!!e.isLast},i(n)?n:t,e.index,this)),n},formatter:function(t){var e,n=this.options.labels||{},i=this.ticks,r=this;e=this.Item(),i.forEach((function(a,o){r.setGrid(a,o,i),e.adjustLabel(a,o,{isCenter:"center"===n.align&&!!i.length,isRotation:r.isRotation}),e.render(a,o),t&&t.call(r,a)})),e.line()},animateTo:function(){var t=this._ticks,e=this.ticks,n=[],i=[];return M.diff(e,t,(function(t,e){return t&&e&&t.text.ellipse===e.text.ellipse})).add((function(e){var i,r=t[e];r&&(i={isFirst:r.isFirst,isLast:r.isLast,size:r.size,text:r.text,angle:r.angle,x:r.x,y:r.y,opacity:0},n.push([r,function(){i.x=r.x,i.y=r.y,i.opacity=0}]))})).modify((function(r,o){var s,l=e[r],h=t[o];l&&h&&(s={isFirst:l.isFirst,isLast:l.isLast,size:l.size,text:l.text,angle:l.angle,x:h.x,y:h.y},n.push([l,function(t){var e=h.x||0,n=a("number",h.y,l.y,0);s.x=e+(l.x-e)*t,s.y=n+(l.y-n)*t}]),i.push(s))})).remove((function(t){var r,a=e[t];a&&(r={isFirst:a.isFirst,isLast:a.isLast,size:a.size,text:a.text,angle:a.angle,x:a.x,y:a.y},n.push([a,function(){r.x=a.x,r.y=a.y}]),i.push(r))})).each(),this._ticks=this.ticks,this.animator=i,n},onFrame:function(){var t=this.options.labels||{},e=this.Item(),n=this,i=this._ticks,r=this.ticks,a=function(a,o){n.setGrid(a,o,r),e.render(a),e.adjustLabel(a,o,{isCenter:"center"===t.align&&!!i.length,isRotation:n.isRotation})};this.animator.forEach((function(t,e){a(t,e)})),e.line(),n.setTitle()},draw:function(){this.formatter(),this.setTitle()},redraw:function(t){this.draw(t)},addTooltip:function(t,e,n){var o=this.options,s=a("array",o.stops,[]),l="horizontal"===o.layout,h=this.name,c=this.startValue,f=this.endValue,d=this.maxRange,p=this;return function(){var a={x:o.x,y:o.y};if(r(a,{xAxis:{width:o.x+d,height:o.y+o.tickLength+p.labelHeight,dx:t,dy:o.y,k:(t-o.x)/d,anchor:"bottom"},yAxis:{width:o.x-o.tickLength-p.labelWidth,height:o.y+d,dx:o.x,dy:e,k:(d-e+o.y)/d,anchor:"left"},colorAxis:{width:o.x+(l?d:o.tickLength),height:o.y+(l?o.tickLength:d),dx:l?t:o.x+o.tickLength,dy:l?o.y+o.tickLength:e,k:(l?t-o.x:d-e+o.y)/d,anchor:l?"top":"left"}}[h]),i(c)&&i(f)&&y.rect({x:t,y:e},a)){var g=Math.min(1,Math.max(0,a.k)),x=c+(f-c)*g,v=s.length>1?m.interpolate(s[0][1],s[s.length-1][1])(g):"#000";p.setPlotLine(a.dx,a.dy,{value:x,color:v,anchor:a.anchor}),u(n)&&n.call(p,x,v,g)}}(),this},destroy:function(){}},n.Axis=W}("undefined"!=typeof window&&window,e),function(t,e){var n=e.Chart||{},h=b.interpolate,u=p.round,c=n.fixLinePixel,f=n.Event,d={style:{fontSize:"12px",fontWeight:"normal",fontFamily:'"Helvetica Neue", Helvetica, arial, "Hiragino Sans GB", "Microsoft YaHei",sans-serif',lineHeight:"normal",cursor:"pointer",color:"#606060"},x:void 0,y:void 0,width:void 0,height:30,margin:0,layout:"horizontal",verticalAlign:"bottom",align:"center",floating:!1,borderWidth:1,borderColor:"#ccc",backgroundColor:"#fff",handles:[{backgroundColor:"#f2f2f2",borderColor:"#999",shadowBlur:2,shadowColor:"rgba(0, 0, 0, 0.6)",shadowOffsetX:1,shadowOffsetY:0},{backgroundColor:"#f2f2f2",borderColor:"#999",shadowBlur:2,shadowColor:"rgba(0, 0, 0, 0.6)",shadowOffsetX:-1,shadowOffsetY:0}]},g=function(t,e){i(e.shadowColor)&&(t.shadowColor=e.shadowColor),s(e.shadowBlur)&&(t.shadowBlur=e.shadowBlur),s(e.shadowOffsetX)&&(t.shadowOffsetX=e.shadowOffsetX),s(e.shadowOffsetY)&&(t.shadowOffsetY=e.shadowOffsetY)},x=function(t,e,n,i,r){var a=r.borderColor,o=n,s=15,l=c(t,e,o,s);return function(n){return n.save(),n.fillStyle=a,g(n,r),n.fillRect(t,e,1,i),t=l.x,e=l.y,o=l.width,s=l.height,n.translate(-o/2+1,(i-s)/2-1),n.lineWidth=1,n.strokeStyle=a,n.fillStyle=r.backgroundColor,n.beginPath(),n.moveTo(t,e),n.lineTo(t+o,e),n.lineTo(t+o,e+s),n.lineTo(t,e+s),n.lineTo(t,e),g(n,r),n.fill(),n.stroke(),n.beginPath(),n.moveTo(t+3,e+3),n.lineTo(t+3,e+s-3),n.moveTo(t+o-3,e+3),n.lineTo(t+o-3,e+s-3),n.stroke(),n.restore(),{left:t-o/2+1,top:e,width:o,height:s}}};function v(){this.init.apply(this,arguments)}v.prototype={init:function(t,e){if(this.options=r({},d),r(this.options,e),this.canvas=t,this.context=t.getContext("2d"),this.x=a("number",this.options.x,0),this.y=a("number",this.options.y,this.options.borderWidth,0),this.height=a("number",this.options.height,d.height),this.width=a("number",this.options.width,2*this.height),this.start=a("number",Math.max(0,Math.min(100,parseFloat(e.start,10)),0),0),this.end=a("number",Math.max(0,Math.min(100,parseFloat(e.end,10))),100),this.start>this.end){var n=this.start;this.start=this.end,this.end=n}this.start+="%",this.end+="%",this.from=b.percentage(this.width,this.start)+this.x,this.to=b.percentage(this.width,this.end)+this.x,this.minValue=a("number",e.min,0),this.maxValue=a("number",e.max,0),this.range=[],this.target=-1,this.dragging=!1},setWidth:function(t){this.width=a("number",t,0),this.from=b.percentage(this.width,this.start)+this.x,this.to=b.percentage(this.width,this.end)+this.x},setValue:function(){var t=this.width,e=this.x,n=this.minValue,i=this.maxValue,r=n+(i-n)*((this.from-e)/t),a=n+(i-n)*((this.to-e)/t);(r=n+(i-n)*parseFloat(this.start,10)/100)>(a=n+(i-n)*parseFloat(this.end,10)/100)&&(e=r,r=a,a=e),this.startValue=r,this.endValue=a},startToEnd:function(t,e){this.start=t,this.end=e,this.setWidth(this.width),this.draw()},setOptions:function(t){var e=Object.prototype.hasOwnProperty;switch(r(this.options,t),!0){case e.call(t,"min"):case e.call(t,"max"):case e.call(t,"width"):case e.call(t,"x"):case e.call(t,"y"):s(t.min)&&(this.minValue=t.min),s(t.max)&&(this.maxValue=t.max),s(t.x)&&(this.x=a("number",t.x,0),this.setWidth(this.width-t.x)),s(t.y)&&(this.y=a("number",t.y,0)),i(t.width)&&this.setWidth(t.width)}return e.call(t,"start")&&e.call(t,"end")&&this.startToEnd(t.start,t.end),this},drawPlot:function(){var t=this.options,e=a("number",t.borderWidth,1),n=t.borderColor,r=this.width,o=this.height,s=this.x,l=this.y-e,h=this.context,u=c(s,l,r,o,e);h.save(),h.fillStyle=t.backgroundColor,h.beginPath(),h.moveTo(u.x,u.y),h.lineTo(u.x+u.width,u.y),h.lineTo(u.x+u.width,u.y+u.height),h.lineTo(u.x,u.y+u.height),h.closePath(),e>0&&(h.strokeStyle=n,h.lineWidth=e,h.stroke()),i(t.backgroundColor)&&h.fill(),h.fillRect(u.x,u.y,0,o),h.clip(),h.restore()},drawNavigator:function(){var t,e=this.options,n=(a("number",e.borderWidth,1),l(n=e.handles)?n:[n]),i=this.height,r=this.y,o=this.context,s=this.from,h=this.to,u={x:s,y:r},c={x:h,y:r};s>h&&(u={x:h,y:r},c={x:s,y:r}),o.save(),o.fillStyle="rgba(51,92,173,0.2)",o.fillRect(u.x,r,c.x-u.x,i),t=n[0]||{},u.viewport=!1!==t.enabled?x(u.x,u.y,8,i,t)(o):{},t=n[1]||t,c.viewport=!1!==t.enabled?x(c.x,c.y,8,i,t)(o):{},o.restore(),this.range=[u,c]},drawSeries:function(){for(var t,e,n,i,r,u,c,f,d=this.options,p=a("array",d.data,[]),g=p.length,y=0,x=this.width,v=this.height,m=this.x,b=this.y,w=!1,M=x/~-g,A=this.context,S=function(t){var e=t;return o(t)&&(s(t.value)||s(t.y))?(e=t.value,s(t.y)&&(e=t.y)):l(t)&&(e=t[1]),s(e)?e:null};f=S(p[y]),!s(f)&&++y<g;);for(;f=S(p[g-1]),!s(f)&&--g>=0;);for(i=r=f=S(p[t=y]),t=y+1;t<g;t++)f=S(p[t]),s(f)&&(i>f&&(i=f),r<f&&(r=f));if(r-i!=0){for(A.save(),A.beginPath(),A.moveTo(u=m+y*M,c=b+h(S(p[y]),i,r,v,0));y<g;y++){if(f=S(p[y]),e=y*M+m,!s(f)){w=w||!w,t=y+1;do{f=S(p[t])}while(!s(f)&&t++<g);A.moveTo(t*M+m,b+h(f,i,r,v,0))}n=b+h(f,i,r,v,0),A.lineTo(e,n)}A.lineWidth=1,A.strokeStyle="#afb8bc",A.stroke(),w||(A.lineTo(e,b+v),A.lineTo(u,b+v),A.lineTo(u,c),A.fillStyle="#e2e4e5",A.fill()),A.restore()}},getTarget:function(t,e){var n,i,r,a=this.range,o=this.height,s=-1;return this.range.length?(n=a[0].viewport,i=a[1].viewport,r=a[1].x-a[0].x,y.rect({x:t,y:e},{x:a[0].x,y:this.y,width:a[0].x+r,height:this.y+o})&&(s=0),y.rect({x:t,y:e},{x:n.left,y:n.top,width:n.left+n.width,height:n.top+this.height})?s=1:y.rect({x:t,y:e},{x:i.left,y:i.top,width:i.left+i.width,height:i.top+o})&&(s=2),s):s},getCursor:function(t,e){var n=null,i=this.getTarget(t,e);return 0===i&&(n="move"),1!==i&&2!==i||(n="ew-resize"),this.hasRange=i>-1&&i<3,n},getRangeValue:function(){var t=this.options,e=t.style||{},n={fontStyle:e.fontStyle||"normal",fontSize:e.fontSize||"12px",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"Arial",lineHeight:e.lineHeight||"normal",color:e.color},i=this.height,r=this.y,o=a("number",.8*parseFloat(n.fontSize,10)),s=this.range,l=s[0].viewport,h=s[1].viewport,c=parseFloat(this.start,10),f=parseFloat(this.end,10);if(c>f){var d=c;c=f,f=d}c=a("string",t.startValue,parseFloat(b.toPrecision(this.startValue,8),10),u(c,3)+"%","0"),f=a("string",t.endValue,parseFloat(b.toPrecision(this.endValue,8),10),u(f,3)+"%","0");var p=this.context;this.setValue(),(this.hasRange||this.dragging)&&(p.save(),p.fillStyle=n.color,p.font=[n.fontStyle,n.fontWeight,n.fontSize+"/"+n.lineHeight,n.fontFamily].join(" "),p.textAlign="right",p.fillText(c,s[0].x-l.width/2,r+o+(i-o)/2),p.textAlign="left",p.fillText(f,s[1].x+h.width/2,r+o+(i-o)/2),p.restore())},draw:function(){this.drawPlot(),this.drawSeries(),this.drawNavigator(),this.getRangeValue()},onStart:function(t,e,n){var i,r,a=parseFloat(this.start,10),o=parseFloat(this.end,10);e=(t=f.normalize(n,this.canvas)).y,t=t.x,this.dragging=(i=this.target=this.getTarget(t,e))>-1&&i<3,this.dx=t-this.range[0].x,this.from>this.to&&(r=this.from,this.from=this.to,this.to=r),a>o&&(r=this.start,this.start=this.end,this.end=r)},onDrag:function(t,e,n){var i,r,a,o,s,l=this.width,h=this.range,u=h[0],c=h[1],f=u.viewport,d=c.viewport,p=this.target,g=c.x-u.x;this.dragging&&(1===p?(a=f.left+(t-f.left),this.from=Math.min(l+this.x,Math.max(this.x,a)),this.start=100*Math.max(0,Math.min(1,(a-this.x)/l))+"%"):2===p?(a=d.left+(t-d.left),this.to=Math.min(l+this.x,Math.max(this.x,a)),this.end=100*Math.max(0,Math.min(1,(a-this.x)/l))+"%"):0===p&&(s=(a=t-this.dx)+g,(o=a)<=this.x?s=(o=this.x)+g:s>=this.width+this.x&&(o=(s=this.width+this.x)-g),this.from=o,this.to=s,this.start=100*Math.max(0,Math.min(1,(o-this.x)/l))+"%",this.end=100*Math.max(0,Math.min(1,(s-this.x)/l))+"%"),(i=parseFloat(this.start,10))>(r=parseFloat(this.end,10))&&(a=i,i=r,r=a),p>-1&&p<3&&n&&n.call(this,this.startValue,this.endValue,i+"%",r+"%"))},onDrop:function(t,e,n){this.target>-1&&this.target<3&&n&&n.call(this),this.dragging=!1,this.target=-1,delete this.hasRange}},i(n)&&(n.RangeSelector=v),"object"==typeof module&&module.exports?module.exports=v:"function"==typeof define&&define.amd?define((function(){return v})):(void 0!==n?n:t).RangeSelector=v}("undefined"!=typeof window?window:void 0!==t?t:this,e),function(t,h){var u=function(t){function e(t,e){var n=e.interpolate,r=Math.min,h=Math.max,u=Math.floor,c=Math.log;return function(t,e){function f(t,e,n,r){var a=e.categories,o=+t.startIndex;!isNaN(o)||(o=0);var s=n;return a&&a.length?(s=u(n+r+o),i(a[s])&&(s=a[s])):s=u(s+r+o),s}e.panel.forEach((function(e){var i=k(e.series,(function(e){return e.type===t}));T(i,(function(t,e){return!(t.yAxis!==e.yAxis||t.xAxis!==e.xAxis)&&((void 0!==t.stack||void 0!==e.stack)&&(t.stack===e.stack&&t.type===e.type))})).forEach((function(t){var e,i,u,d,p,g,y,x,v,m,b,w,M,A,S,L,k,E,T,C,F,W,_,P,z,H,I,V,Y,N,O,R=t.length,X=t[0].data.length,j=0,D=0;for(X=a("number",t[0].maxLength,t[0].maxLength),e=0;e<X;e++)for(g=0,D=0,j=0;j<R;j++){d=(u=(i=t[j]).shapes[e]||{}).value,H=!!i.inverted,V=i.coordinate,I=i.pointPosition,y=i.plotX,x=i.plotY,v=i.plotWidth,m=i.plotHeight,W=((C=i._yAxis).logarithmic||{}).base||10,z=C.reversed,P=C.maxValue,_=C.minValue,F=i._xAxis,w=(b=v/(N=h(1,X-(Y="start"===I))))/2*!Y,M=m/N/2*!Y,A=m-(O=P,_<=0&&O>=0?!0===z?n(0,_,P,m,0):n(0,_,P,0,m):0),S=r(m+x,S=x+A),L=y,!1===i.selected||0===d||u.isNULL?d=0:d<0?D+=d:g+=d,"logarithmic"===C.type&&(g=c(D+=d,W)),"xy"===V?(k=n.apply(null,[l(u.source)?u.source[0]:o(u.source)?u._x:null,F.minValue,F.maxValue,0,v]),k+=y+w,E=n.apply(null,[l(u.source)?u.source[1]:o(u.source)?u._y:null,_,P].concat(!0===z?[0,m]:[m,0])),E+=x):l(u.source)&&u.source.length>1?(k=e*b,k+=y,k+=w,E=s(u.source[1])?n.apply(null,[u.source[1],_,P].concat(!0===z?[0,m]:[m,0])):NaN,E+=x,T=s(u.source[2])?n.apply(null,[u.source[2],_,P].concat(!0===z?[0,m]:[m,0])):NaN,T+=x):s(u._x)&&s(u._y)?(k=y+e*b,k+=w,E=n.apply(null,[u._y,_,P].concat(!0===z?[0,m]:[m,0])),E+=x):H?(E=e*(b=m/X),E+=x,E+=M,k=n(d<0?D:g,_,P,0,v),k+=y):(k=e*b,k+=y,k+=w,E=[d<0?D:g,_,P,m,0],!0===z&&(E[3]=E[4],E[4]=m),E=n.apply(null,E),E+=x);var B=H?{x:L,y:E,x1:L,y1:E,x2:L,y2:E}:{x:k,y:S,x1:k,y1:S,x2:k,y2:S};j>0&&(S=(B=t[j-1].shapes[e]).y,L=B.x,S=r(m+x,S)),p=R>1?d>=0?g:D:void 0,i.selected,E=r(x+m,E),u.x=u.x1=u.x2=k,u.y=u.y1=u.y2=E,u.highY=T,u.total=p,u.percentage=R>1?d/p*100:void 0,u.size=b,u.margin=w,u.yBottom=S,u.xLeft=L,u.key=f(i,F,e,w/v/X),u.index=e,u.prevShape=B}})),i.forEach((function(t){"spline"!==t.type&&"areaspline"!==t.type||y.pointSpline(t.shapes,t)}))}))}}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}.call("undefined"!=typeof window?window:this).deps(e.Math,b),c=function(){var t=function(t,e,n){for(;t[e].isNULL&&e<~-n;)++e;return e},e=function(t,e,n){for(;t[n-1].isNULL&&--n>e;);return n},n=function(t,e,n){var i,r=e;do{i=t[r]}while(i.isNULL&&r++<n);return r},i={line:function(i,r,a){var o,s,l,h,u,c=a.dashStyle,f=a.onStep,d=r.length,p=t(r,0,d);for(d=e(r,p,d),o=r[p],i.beginPath(),i.moveTo(h=o.x,u=o.y);p<d;p++)(o=r[p]).isNULL&&(o=r[n(r,p+1,d)],i.moveTo(h=o.x,u=o.y)),s=o.x,l=o.y,x[c]&&"solid"!==c?x[c](i,h,u,h=s,u=l):i.lineTo(s,l),f&&f(o)},spline:function(i,r,a){var o,s,l,h,u,c,f,d=a.onStep,p=r.length,g=t(r,0,p);for(p=e(r,g,p),f=r[g],i.beginPath(),i.moveTo(f.x,f.y);g<p;g++)o=(f=r[g]).x,s=f.y,l=f.x1,h=f.y1,u=f.x2,c=f.y2,f.isNULL?(o=l=u=(f=r[n(r,g+1,p)]).x,s=h=c=f.y,i.moveTo(o,s)):i.bezierCurveTo(l,h,u,c,o,s),d&&d(f)},step:function(i,r,a){var o=a.step,s=a.onStep;!function(i,r,a){var o,s,l,h=r.length,u=t(r,0,h);for(h=e(r,u,h),o=r[u],i.beginPath(),i.moveTo(s=o.x,l=o.y);u<h;u++)(o=r[u]).isNULL&&(o=r[n(r,u+1,h)],i.moveTo(s=o.x,l=o.y)),a(o,u,s,l)}(i,r,(function(t,e){var n=r[e],a=r[e-1];if(a&&!a.isNULL&&!n.isNULL){switch(o){case"right":i.lineTo(a.x,n.y);break;case"center":i.lineTo((a.x+n.x)/2,a.y),i.lineTo((a.x+n.x)/2,n.y);break;default:i.lineTo(n.x,a.y)}i.lineTo(n.x,n.y),s&&s(n)}}))},arearange:function(i,r,a){var o,s,l,h,u,c=a.onStep,f=r.length,d=t(r,0,f),p=a.key,g=a.dashStyle;for(f=e(r,d,f),o=r[d],i.beginPath(),i.moveTo(h=o.x,u=o[p]);d<f;d++)(o=r[d]).isNULL&&(o=r[n(r,d+1,f)],i.moveTo(h=o.x,u=o[p])),s=o.x,l=o[p],x[g]&&"solid"!==g?x[g](i,h,u,h=s,u=l):i.lineTo(s,l),c&&c(o)}};return i}(),f=function(){var t=function(t,e){for(var n,i=t.length,r=n=0,a=i;r<a;)t[--a].isNULL&&((n=a)^--i&&e(n+1,i),i=n);!t[0].isNULL&&e(0,i-1)},e=function(t,e,n,i,r,a){var o=e[n],s=i,l=n;for(t.moveTo(o.x,o.y);l<=s;l++)r(e[l]);a(n,l)},n=function(t,e,n,i,r,a){var o=e[i-=1];t.lineTo(r?o.xLeft:o.x,o.yBottom),a(n,i)},i=function(t,e,n,i,r){for(var a=i;a>=n;--a)r(e[a],n,a)},r={line:function(r,a,o){var s=o.inverted,l=o.type;t(a,(function(t,o){e(r,a,t,o,(function(t){r.lineTo(t.x,t.y)}),(function(t,e){n(r,a,t,e,s,(function(t,e){i(0,a,t,e,(function(t){"arearange"===l?r.lineTo(t.x,t.highY):r.lineTo.apply(r,s?[t.xLeft,t.y]:[t.x,t.yBottom])}))}))}))}))},spline:function(r,a,o){var s=o.inverted;t(a,(function(t,o){e(r,a,t,o,(function(t){r.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)}),(function(t,e){var o=a[t];n(r,a,t,e,s,(function(t,e){i(0,a,t,e,(function(t,e,n){if(t.prevShape){var i=a[n-1];i?(i.isNULL&&(i=a[function(t,e,n){for(var i=n;i>=e&&t[i].isNULL;i++);return i}(a,e,n)]),i=i.prevShape):i=o,r.bezierCurveTo(t.prevShape.x2,t.prevShape.y2,t.prevShape.x1,t.prevShape.y1,i.x,i.y)}}))}))}))}))},range:function(t,e,n){r.line(t,e,n)}};return r}(),d=g.Line.smooth,p=function(t,e,n,i){for(var r,a,o=t.slice(e,n),s=0;s<n-e;s++)(a=d(o[s-1],r=t[e+s],o[s+1],i))&&(r.x1=a.x1,r.y1=a.y1,r.x2=a.x2,r.y2=a.y2,r.x=a.x,r.y=a.y)},y={pointSpline:function(t,e){for(var n=0,i=t.length,r=0,a=i;r<a;){if(null===t[r].value){n!==(i=r)&&i-n>2&&p(t,n,i,!!e.inverted);for(var o=i;o<a;o++)if(null!==t[o].value){i=o;break}n=i}r++}null!==t[r-1].value&&r-n>2&&p(t,n,r,!!e.inverted)},line:function(t,e,n,r){var o=a("string",n.dashStyle,"solid"),l=a("number",n.lineWidth,2),h=n.step,u=n.type,f=r.y||"y";e.length&&(t.save(),"spline"===u||"areaspline"===u?c.spline(t,e,{}):"arearange"===u?c.arearange(t,e,{key:f,dashStyle:o}):c[i(h)?"step":"line"](t,e,{step:h,dashStyle:o}),!1!==n.selected&&l>0&&(t.shadowColor=n.shadowColor,s(n.shadowBlur)&&(t.shadowBlur=n.shadowBlur),s(n.shadowOffsetX)&&(t.shadowOffsetX=n.shadowOffsetX),s(n.shadowOffsetY)&&(t.shadowOffsetY=n.shadowOffsetY),t.strokeStyle=n.lineColor||n.color,t.lineCap="round",t.lineJoin="round",t.lineWidth=l,t.stroke()),t.restore())},area:function(t,e,n){var r,o=n.type,l=n.color,h=n.opacity;if(e.length&&!1!==n.selected){var u=Number.MAX_VALUE,c=-u,d=null,p=null;e.forEach((function(t,n){var i=e[e.length-n-1];s(t.yBottom)&&t.yBottom==t.yBottom&&(u=Math.min(u,t.yBottom)),c=Math.max(c,t.y),null===d&&s(t.x,!0)&&(d=t.x),null===p&&s(i.x,!0)&&(p=i.x)})),i(r=n.fillColor)&&e.length>1?m.isColor(r)?l=r:i(r.linearGradient)&&(l=m.parse(r).linear(d,u,p,c)):l=m.parse(l).alpha(a("number",h,.75)).rgba(),t.save(),t.beginPath(),f[{areaspline:"spline",arearange:"range"}[o]||"line"](t,e,{inverted:!!n.inverted,type:o}),t.globalCompositeOperation=a("string",n.blendMode,"source-over"),t.fillStyle=l,t.fill(),t.restore()}},hover:function(t,e,n){var i=n.marker||{},r=e.color||n.color,a=m.parse(r);a.a=.5;s(e.current)&&-1!==e.current&&[].slice.call(arguments,-2).forEach((function(n){var o,s;t.save(),o=e.x,s=e[n],t.fillStyle=m.rgba(a),t.beginPath(),t.arc(o,s,8,0,Y),t.fill(),t.fillStyle=r,t.strokeStyle=i.fillColor||"#fff",t.beginPath(),t.arc(o,s,3,0,Y),t.fill(),t.stroke(),t.restore()})),delete e.current},xClip:function(t,e,n,i,r){0!==t&&(e.save(),t>0&&e.drawImage(n,i,r,n.width*t,n.height,i,r,n.width*t/P,n.height/P),e.restore())},yClip:function(t,e,n,i,r){0!==t&&(e.save(),t>0&&e.drawImage(n,i,r,n.width,n.height*t,i,r,n.width/P,n.height*t/P),e.restore())}};function v(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="line",this.series=[],this.shapes=[],this.init(e)}v.prototype={constructor:v,init:function(t){var e=this.canvas,i=this.type;this.options=r({},t),this.series=k(a("array",t.series,[]),(function(t){var e=t.type===i;return e&&(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.value===e.value}))),e})),u(i,t),(!0===this.options.chart.animation||this.options.chart.animation&&!1!==this.options.chart.animation.enabled)&&1===this.canvas.nodeType&&this.series.forEach((function(t){var r=n.createElement("canvas"),o=r.getContext("2d");h.scale(o,a("number",t.plotWidth+t.plotX,e.width),a("number",t.plotHeight+t.plotY,e.height),P),t._image=r,"area"!==i&&"areaspline"!==i&&"arearange"!==i||(y.area(o,t.shapes,t),"arearange"===i&&y.line(o,t.shapes,t,{y:"highY"})),y.line(o,t.shapes,t,{y:"y"})}))},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){var i=n.shapes;y.line(t,i,n,{y:"y"}),i.forEach((function(i){e.drawMarker(t,i,n,"y"),e.drawLabels(t,i,n),y.hover(t,i,n,"y")}))}))},redraw:function(){u(this.type,this.options),this.draw()},animateTo:function(t,e){var n=[];return this.series.forEach((function(t){var r=t.shapes,a=t._shapes||[],o=[];if(!0===e){var s=t;n.push([t,function(t){s._timer=t}]),o.push(s)}else t._diffValues.add((function(t){var e=a[t],n={value:e.value,_value:e._value,isNULL:e.isNULL,color:e.color,x:e.x,y:e.y,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,highY:e.highY,yBottom:e.yBottom,marker:e.marker,dataLabels:e.dataLabels};i(e.prevShape)&&(n.prevShape={x:e.prevShape.x,y:e.prevShape.y,x1:e.prevShape.x1,y1:e.prevShape.y1,x2:e.prevShape.x2,y2:e.prevShape.y2,highY:e.prevShape.highY}),e.value,a[0].value,n.x=NaN,o.push(n)})).remove((function(e){var s,l;s=r[e],a[e],l={value:s.value,_value:s._value,isNULL:s.isNULL,color:s.color,x:s.x,y:s.y,x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,highY:s.highY,yBottom:s.yBottom,marker:s.marker,dataLabels:s.dataLabels},i(s.prevShape)&&(l.prevShape={x:s.prevShape.x,y:s.prevShape.y,x1:s.prevShape.x1,y1:s.prevShape.y1,x2:s.prevShape.x2,y2:s.prevShape.y2,highY:s.prevShape.highY}),n.push([s,function(e){var n,i,o=t.plotWidth/r.length*(r.length-a.length);n=(i=r[r.length-1].x)-o,o-=t.plotX,i-=n+=(i-n)*e,l.x1=s.x1,l.y1=s.y1,l.x2=s.x2,l.y2=s.y2,l.x=s.x,l.y=s.y}]),o.push(l)})).modify((function(t,e){var s,l=r[t],h=a[e];h&&l&&(s={value:l.value,_value:l._value,isNULL:l.isNULL,color:l.color,x:h.x,y:h.y,x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,highY:h.highY,yBottom:l.yBottom,marker:l.marker,dataLabels:l.dataLabels},i(l.prevShape)&&(s.prevShape={x:l.prevShape.x,y:l.prevShape.y,x1:l.prevShape.x1,y1:l.prevShape.y1,x2:l.prevShape.x2,y2:l.prevShape.y2,highY:l.prevShape.highY}),n.push([l,function(t){var e=(h.x||l.x)+(l.x-(h.x||l.x))*t,n=(h.y||l.y)+(l.y-(h.y||l.y))*t,i=(h.y1||l.y1)+(l.y1-(h.y1||l.y1))*t,r=(h.y2||l.y2)+(l.y2-(h.y2||l.y2))*t,a=(h.x1||l.x1)+(l.x1-(h.x1||l.x1))*t,o=(h.x2||l.x2)+(l.x2-(h.x2||l.x2))*t,u=(h.highY||l.highY)+(l.highY-(h.highY||l.highY))*t;s.x=e,s.y=n,s.x1=a,s.x2=o,s.y1=i,s.y2=r,s.highY=u}]),o.push(s))})).each();t._animators=o,t._shapes=t.shapes})),n},onFrame:function(t,e){var n=this;this.series.forEach((function(i){var r=i._animators;!0===e?r.forEach((function(e){e._image&&y[e.inverted?"yClip":"xClip"](e._timer,t,e._image,0,0)})):("area"!==i.type&&"areaspline"!==i.type&&"arearange"!==i.type||(y.area(t,r,i),"arearange"===i.type&&y.line(t,r,i,{y:"highY"})),y.line(t,r,i,{y:"y"}),r.forEach((function(e){n.drawMarker.apply(null,[t,e,i].concat("arearange"===i.type?["y","highY"]:["y"])),n.drawLabels(t,e,i)})))}))},drawShape:function(t,e,n){e&&null!==e.value&&y.hover(t,e.x,e.y,n)},drawLabels:function(t,e,n){var i=a("number",(e.marker||{}).radius,(n.marker||{}).radius,0);I.align((function(t,n){var r=a("string",t,"center"),o=e.x,s=n.width;return isNaN(o)?-9999:{left:o-s-i/2,center:o-s/2,right:o+i/2}[r]})).vertical((function(t,n){var r=a("string",t,"top"),o=e.y,s=n.height;return isNaN(o)?-9999:{top:o-s-i,middle:o-s+i,bottom:o+i}[r]})).call(e,n,t)},drawMarker:function(t,e,n){var r=n.marker||{},o=e.marker||{},s=a("number",o.lineWidth,r.lineWidth,0),l=a("string",o.lineColor,r.lineColor,e.color,"#000"),h=a("string",o.fillColor,r.fillColor,e.color,"#000"),u=a("number",o.radius,r.radius,4),c=u*u<=n.plotWidth/n.shapes.length;(i(o.enabled)||i(r.enabled))&&(c=!0===o.enabled||!0===r.enabled),[].slice.call(arguments,-2).forEach((function(i){!1!==n.selected&null!==e.value&c&&(t.save(),t.fillStyle=h,t.beginPath(),t.arc(e.x,e[i],u,0,Y,!0),t.fill(),s>0&&(t.lineWidth=s,t.strokeStyle=l,t.stroke()),t.restore())}))},getShape:function(t,e,n){var r,o,s,l,h,u,c,f=this.series.length,d=[],p=function(n){return!(t<a("number",n.plotX,0)||t>n.plotWidth+a("number",n.plotX,0)||e<a("number",n.plotY,0)||e>n.plotHeight+a("number",n.plotY,0))};function g(t){t.forEach((function(t){delete t.current}))}for(s=0;s<f;s++)!1!==(r=this.series[s]).selected&&(h=r.shapes,c=!!r.inverted,p(r)&&(g(h),o=(u=A(h)).nearest({x:t,y:e},(function(t,e){var n=t.x-e.x,i=t.y-e.y;return c?i*i:n*n}))[0],u.destroy(),i(o)&&!o.isNULL&&(o.current=o.index,(l={shape:o,series:r}).shape.$value=o._value,"arearange"===r.type&&(l.shape.$value=o.source[1]+","+o._value),d.push(l))));return!1===n&&(g(h=d.map((function(t){return t.shape}))),o=(u=A(h)).nearest({x:t,y:e},(function(t,e){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}))[0],u.destroy(),i(o)&&!o.isNULL)?(o.current=o.index,(l={shape:o,series:o.series}).shape.$value=""+o._value,"arearange"===o.series.type&&(l.shape.$value=o._value+","+o.source[2]),[l]):d}};var w,S,L=function(){function e(t,e){var n=t.extend,i=t.pack,r=t.Cluster.List.filter,a=function(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="spline",this.init(e)};return n(a.prototype,e.prototype,{constructor:a,init:function(t){this.series=r(i("array",t.series,[]),(function(t){return"spline"===t.type})),e.prototype.init.call(this,t)}}),a}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}().deps(e,v),E=function(){function e(t,e){var n=t.extend,i=t.pack,r=t.Cluster.List.filter;function a(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="area",this.init(e)}return n(a.prototype,e.prototype,{constructor:a,init:function(t){this.series=r(i("array",t.series,[]),(function(t){return"area"===t.type})),e.prototype.init.call(this,t)},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){var i=n.shapes;y.area(t,i,n),y.line(t,i,n,{y:"y"}),i.forEach((function(i){e.drawMarker(t,i,n,"y"),e.drawLabels(t,i,n),y.hover(t,i,n,"y")}))}))},redraw:function(){e.prototype.redraw.apply(this,arguments)}}),a}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}().deps(e,v,y.area),C=function(){function e(t,e){var n=t.pack,i=t.extend,r=t.Cluster.List.filter;function a(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="areaspline",this.init(e)}return i(a.prototype,e.prototype,{init:function(t){this.series=r(n("array",t.series,[]),(function(t){return"areaspline"===t.type})),e.prototype.init.call(this,t)}}),a}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}().deps(e,E),F=function(){function e(t,e){var n=t.extend,i=t.Cluster.List.filter;function r(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="arearange",this.init(e)}return n(r.prototype,e.prototype,{init:function(t){this.series=i(a("array",t.series,[]),(function(t){return"arearange"===t.type})),E.prototype.init.call(this,t)},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){var i=n.shapes;y.area(t,n.shapes,n),y.line(t,i,n,{y:"highY"}),y.line(t,i,n,{y:"y"}),i.forEach((function(i){var r=[t,i,n,"y"];"arearange"===n.type&&r.push("highY"),e.drawMarker.apply(null,r),e.drawLabels(t,i,n),y.hover.apply(null,r)}))}))}}),r}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}().deps(e,C),W=h.graphers=h.graphers||{};for(S in w||(w={Line:v,Spline:L,Area:E,AreaSpline:C,AreaRange:F}))W[S.toLowerCase()]=h[S]=w[S]}("undefined"!=typeof window?window:this,e.Chart||{}),function(t,e){var n=p.log,h=function(t,e){return t<=0&&e>=0},u=function(t){var e,n,i=t.length,r=0,a=0,o=i-1;for(e=t[r],n=t[i-1];++r<i;)!1===e.selected&&(e=t[++a]),!1===n.selected&&(n=t[--o]);return[e,n]};function c(t,e){this.type="column",this.shapes=[],this.canvas=t,this.context=t.getContext("2d"),this.init(e)}function f(t,e){this.type="bar",this.shapes=[],this.canvas=t,this.context=t.getContext("2d"),this.init(e)}c.prototype={constructor:c,init:function(t){var e=this.type;this.options=r({},t),this.series=k(a("array",t.series,[]),(function(t){var n=t.type===e;return n&&(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.value===e.value}))),n}));var n=new c.Layout(e,this.series,this.options);this.shapes=n.shapes,this.layout=n},draw:function(){var t=this.context,e=this;this.shapes.forEach((function(n){n.shapes.forEach((function(i){e.drawShape(n.context||t,i,n),delete i.current}))})),this.shapes.forEach((function(n){n.state&&e.drawState(t,n),n.shapes.forEach((function(i){e.dataLabels(n.context||t,i,n)}))}))},redraw:function(){this.shapes=this.layout.subgroup(),this.draw()},animateTo:function(){var t=[];return this.shapes.forEach((function(e){var n=e.shapes,i=e._shapes||[],r=[];e._diffValues.remove((function(i){var r=n[i],a={color:r.color,_value:r._value,value:r.value,percentage:r.percentage,shape:r};return t.push([r,function(t){a.x0=r.x0,a.y0=r.y0,a.x1=r.x1,a.y1=r.y1,"bar"===e.type?a.x1=r.x0+(r.x1-r.x0)*t:a.y1=r.y0+(r.y1-r.y0)*t}]),a})).add((function(e){var n=i[e],r={x0:n.x0,y0:n.y0,x1:n.x1,y1:n.y1,color:n.color,_value:n._value,value:n.value,percentage:n.percentage,shape:n};return t.push([n,function(t){r.y1=n.y1-(n.y1-n.y0)*t,r.x1=n.x1-(n.x1-n.x0)*t}]),r})).modify((function(r,a){var o,s,l,h,u,c=n[r],f=i[a];return f&&c&&(o={x0:f.x0,y0:f.y0,x1:f.x1,y1:f.y1,color:c.color,_value:c._value,value:c.value,percentage:c.percentage,shape:c},t.push([c,function(t){s=f.x0+(c.x0-f.x0)*t,l=f.x1+(c.x1-f.x1)*t,!1===e.selected?(s=f.x0+(c.x0-f.x0)*t,l=f.x1+(c.x1-f.x1)*t,h=f.y0,u=f.y1):(s=f.x0+(c.x0-f.x0)*t,l=f.x1+(c.x1-f.x1)*t,h=f.y0+(c.y0-f.y0)*t,u=f.y1+(c.y1-f.y1)*t),o.x0=s,o.x1=l,o.y0=h,o.y1=u}])),o})).each((function(t){t&&r.push(t)})),e._animators=r,e._shapes=e.shapes})),t},onFrame:function(t){var e=this;this.shapes.forEach((function(n){n._animators.forEach((function(i){e.drawShape(t,i,n),e.dataLabels(t,i.shape,n)}))}))},drawState:function(){},drawShape:function(t,e,n){var r=e.x0,h=e.y0,u=e.x1,c=e.y1,f=(Math.abs(u-r),Math.abs(h-c),a("number",n.borderWidth,0)),d=a("string",n.borderColor,"#FFFFFF"),p=n.borderRadius,g=(a("number",e.rotation,0),e.color);if(!1===n.selected&&(f=p=0),o(g)&&i(g.stops)&&l(g.stops)){var y=t.createLinearGradient(Math.abs(u-r),c,Math.abs(u-r),h);g.stops.forEach((function(t){s(t[0])&&"string"==typeof t[1]&&y.addColorStop(t[0],t[1])})),g=y}else g=m.parse(g),i(e.current)&&(g.a=.55),g=m.rgba(g);t.save(),!l(p)&&(p=s(p)&&p>0?[p,p,p,p]:[0,0,0,0]),t.beginPath(),t.moveTo(r+a("number",p[0],0),c),t.lineTo(u-a("number",p[1],0),c),t.bezierCurveTo(u,c,u,c,u,c+a("number",p[1],0)),t.lineTo(u,h),t.lineTo(r,h),t.lineTo(r,c+a("number",p[0],0)),t.bezierCurveTo(r,c,r,c,r+a("number",p[0],0),c),i(n.shadowColor)&&(t.shadowColor=n.shadowColor,s(n.shadowBlur)&&(t.shadowBlur=n.shadowBlur),s(n.shadowOffsetX)&&(t.shadowOffsetX=n.shadowOffsetX),s(n.shadowOffsetY)&&(t.shadowOffsetY=n.shadowOffsetY)),t.fillStyle=g,t.fill(),f>0&&(t.beginPath(),t.lineWidth=f,t.strokeStyle=d,t.moveTo(r+f/2,c-f/2),t.lineTo(u-f/2,c-f/2),t.lineTo(u-f/2,h+f/2),t.lineTo(r+f/2,h+f/2),t.lineTo(r+f/2,c),t.stroke()),t.restore()},dataLabels:function(t,e,n){var r="column"===n.type;I.align((function(t,n){var o=n.width,l=Math.abs(e.x1-e.x0),h=0,u=a("string",t,r?"center":"right");return i(t)||!r&&s(e.value)&&e.value<0&&(h=o),{left:e.x0,center:e.x0+(l-o)/2,right:e.x1-o*r-h}[u]})).vertical((function(t,n){var o=n.height,l=Math.abs(e.y1-e.y0),h=0,u=a("string",t,r?"top":"middle");return i(t)||r&&s(e.value)&&e.value<0&&(h=o),{top:e[r?"y1":"y0"]+h,middle:e[r?"y1":"y0"]+o*!r+(l-o)/2,bottom:e[r?"y0":"y1"]}[u]})).call(e,n,t)},getShape:function(t,e,n){var i,r,o,s,l,h,c,f,d,p=this.shapes,g=p.length,x=[];function v(t){t.forEach((function(t){delete t.current}))}var m=function(n){return!(t<a("number",n.plotX,0)||t>n.plotWidth+a("number",n.plotX,0)||e<a("number",n.plotY,0)||e>n.plotHeight+a("number",n.plotY,0))};c=(l=u(p))[0],f=l[1];for(var b=0;b<g;b++)if(!1!==(l=p[b]).selected){if(i=l.plotY,r=l.plotHeight,!m(l))return x;v(o=l.shapes);for(var w=0;w<o.length;w++)if(null!==(s=o[w]||{}).value&&(h={x:s.x0-s.margin,y:s.y0,width:s.x1+s.margin,height:s.y1},n&&c.shapes[w]&&f.shapes[w]&&(h.x=c.shapes[w]?c.shapes[w].x0-s.margin:0,h.y=r+i,h.height=i,h.width=f.shapes[w]?f.shapes[w].x1+s.margin:0),y.rect({x:t,y:e},h))){if((d={shape:s,series:l}).shape.$value=""+s._value,x.push(d),s.current=w,!n)return x;break}}return x}},f.prototype={constructor:f,init:function(){c.prototype.init.apply(this,arguments)},draw:function(){c.prototype.draw.apply(this,arguments)},redraw:function(){c.prototype.redraw.apply(this,arguments)},getShape:function(t,e,n){var r,a,o,s,l,h,c,f,d=this.shapes,p=d.length,g=[];function x(t){t.forEach((function(t){delete t.current}))}c=(l=u(d))[0],f=l[1];for(var v=0;v<p;v++)if(!1!==(l=d[v]).selected){r=l.plotX,a=l.plotWidth,x(o=l.shapes);for(var m=0;m<o.length;m++)if(s=o[m],i(s.value)&&(h={x:s.x0,y:s.y0-s.margin,width:s.x1,height:s.y1+s.margin},n&&(h.y=c.shapes[m]?c.shapes[m].y0-s.margin:0,h.x=r,h.width=a+r,h.height=f.shapes[m]?f.shapes[m].y1+s.margin:0),y.rect({x:t,y:e},h))){if(g.push({shape:s,series:l}),s.current=m,!n)return g;break}}return g},drawShape:function(){c.prototype.drawShape.apply(this,arguments)},drawState:function(){c.prototype.drawState.apply(this,arguments)},dataLabels:function(){c.prototype.dataLabels.apply(this,arguments)},animateTo:function(){return c.prototype.animateTo.apply(this,arguments)},onFrame:function(){c.prototype.onFrame.apply(this,arguments)}},c.Layout=function(t,e,n){this.series=e,this.shapes=[],this.type=t,this.options=n,this.init()},c.Layout.prototype={init:function(){this.shapes=this.subgroup()},getKey:function(t,e,n,i,r){var o=a("number",t.startIndex,0);return n&&n.length?n[e=Math.floor(i+r+o)]&&(e=n[e]):e=Math.floor(i+r+o),e},getPointSize:function(t,e,n){var r=a("object",t.point,{}),o=e/n;return o=(e-o*a("number",t.groupPadding,.5))/n,i(r.width)&&(o=Math.max(0,a("number",r.width,b.percentage(e,r.width),0))),(s(r.maxWidth)||s(t.maxPointWidth))&&(o=Math.min(o,a("number",r.maxWidth,t.maxPointWidth))),o},subgroup:function(){var t=this.series,e=this.options,n=this.type,i=this;return e.panel.forEach((function(t){var e=k(t.series,(function(t){return t.type===n})),r=0,a=-1,o=T(e,(function(t,e){return(void 0!==t.stack||void 0!==e.stack)&&(t.yAxis===e.yAxis&&t.stack===e.stack&&t.type===e.type)}));o.forEach((function(t){for(var e=0,n=0,i=t.length;!e&&n<i;n++)e=!1!==t[n].selected&&!1!==t[n].grouping;e&&r++})),i.groupLength=r=Math.max(1,r),o.forEach((function(t){for(var e=0,n=0,o=t.length;!e&&n<o;n++)e=!1!==t[n].selected&&!1!==t[n].grouping;e&&a++,"bar"===t[0].type?i.computeBar.call(i,t,t[0].plotWidth,t[0].plotHeight,a,r):i.computeColumn.call(i,t,t[0].plotWidth,t[0].plotHeight,a,r)}))})),t},computeColumn:function(t,e,i,o,l){var u=t[0],c=a("number",u.plotX,0),f=a("number",u.plotY,0),d=a("number",u.plotWidth,e),p=a("number",u.plotHeight,i),g=u._yAxis||{},y=a("number",a("object",g.logarithmic,{}).base,10),x=g.maxValue,v=g.minValue,m=g.reversed,b=u._xAxis||{},w=b.length,M=b.categories,A=t.length,S=u.maxLength,k=S;!1===u.grouping&&(l=1,o=0);for(var E,T,C=d/k,F=this.getPointSize(t[0],C,l),W=(C-l*F)/2,_=p-(h(v,x)?L(0,v,x,0,p):0),P=0;P<S;P++){var z=T=(E=(u=t[0]).shapes[P]||{}).value,H=T;"logarithmic"===g.type&&(T=n(T,y));for(var I=1;I<A;I++)H+=(t[I].shapes[P]||{}).value;var V,Y,N,O,R,X,j,D=this.getKey(u,0+P*w/S,M,P,W/e/S);for(E._x&&(D=E._x),V=c+P*C,V+=W,N=(V+=o*F)+F,O=Y=f+(!0===m?0:_),!1===u.selected||0===T?(O=0,z=1):O=T<0?L(T,0,v,0,Math.abs(p-_)):L(T,0,x,0,_),R=X=Y,T>=0?(j=R,R-=O,O=-O):(j=X,X+=O),O=(Y=j)+(!(!0===m)||-1)*O,!1===u.selected&&(V=N,O=Y),r(E,{x0:V,y0:Y,x1:N,y1:O,total:A>1?H:void 0,percentage:A>1?T/H*100:void 0,size:F,margin:W,yBottom:_+f,key:D,index:P}),I=1;I<A;I++)T=(E=(u=t[I]).shapes[P]||{}).value,s(T)||(T=0),"logarithmic"===g.type?(T=n(T+=z,y),O=L(T,v,x,0,p),O-=L(n(z,y),v,x,0,p)):O=!1===u.selected||0===T?0:T<0?L(T,0,v,0,Math.abs(p-_)):L(T,0,x,0,_),T>=0?(j=R,R-=O,O=-O):(j=X,X+=O),V=c+P*C,V+=W,N=(V+=o*F)+F,O=(Y=j)+(!(!0===m)||-1)*O,!1===u.selected&&(V=N,O=Y),r(E,{x0:V,y0:Y,x1:N,y1:O,size:F,margin:W,yBottom:_+f,total:H,percentage:T/H*100,key:D,index:P})}},computeBar:function(t,e,i,o,l){var u=t[0],c=a("number",u.plotX,0),f=a("number",u.plotY,0),d=a("number",u.plotWidth,e),p=a("number",u.plotHeight,i),g=u._xAxis||{},y=a("number",(g.logarithmic||{}).base,10),x=g.maxValue,v=g.minValue,m=u._yAxis||{},b=m.length,w=m.categories,M=g.reversed;!1===u.grouping&&(l=1,o=0);for(var A,S,k=t.length,E=u.maxLength,T=p/E,C=this.getPointSize(t[0],T,l),F=(T-l*C)/2,W=h(v,x)?L(0,v,x,0,d):0,_=0;_<E;_++){var P=S=(A=(u=t[0]).shapes[_]||{}).value,z=S;"logarithmic"===g.type&&(S=n(S,y));for(var H=1;H<k;H++)z+=t[H].shapes[_].value;var I,V,Y,N,O,R,X,j=this.getKey(u,0+_*b/E,w,_,F/e/E);for(V=p+f,V-=_*T,V-=F,V-=o*C,N=(V-=C)+C,Y=I=c+(!0===M?d:W),s(A._x)&&s(A._y)?(Y=!1===u.selected||0===A._y?0:A._y<0?L(A._y,v,x,0,W):L(A._y,v,x,0,Math.abs(d-W)),j=A._x):Y=!1===u.selected||0===S?0:S<0?L(S,0,v,0,W):L(S,0,x,0,Math.abs(d-W)),O=R=I,S>=0?(X=O,O+=Y):(X=R,R-=Y,Y=-Y),Y=(I=X)+(!(!0===M)||-1)*Y,!1===u.selected&&(V=N,Y=I),r(A,{x0:I,y0:V,x1:Y,y1:N,total:k>1?z:void 0,percentage:k>1?S/z*100:void 0,size:C,margin:F,yBottom:W+c,key:j}),H=1;H<k;H++)S=(A=(u=t[H]).shapes[_]).value,"logarithmic"===m.type?(Y=P,S=n(P+=S,y),Y=L(S,v,x,0,d)-L(n(N,y),v,x,0,d)):Y=s(A._x)&&s(A._y)?!1===u.selected||0===A._y?0:A._y<0?L(A._y,m.min,m.max,0,W):L(A._y,m.min,m.max,0,Math.abs(d-W)):!1===u.selected||0===S?0:S<0?L(S,0,v,0,W):L(S,0,x,0,Math.abs(d-W)),V=p+f,V-=_*T,V-=F,V-=o*C,N=(V-=C)+C,I=W+c,S>=0?(X=O,O+=Y):(X=R,R-=Y,Y=-Y),Y=(I=X)+Y,!1===u.selected&&(V=N,Y=I),r(A,{x0:I,y0:V,x1:Y,y1:N,size:C,margin:F,yBottom:W+c,total:z,percentage:S/z*100,key:j})}}};var d,g,x=e.graphers=e.graphers||{};for(g in d||(d={Column:c,Bar:f}))x[g.toLowerCase()]=e[g]=d[g]}("undefined"!=typeof window&&window,e.Chart),function(t,e){var n=b.percentage,l=e.angle2arc;function h(t,e){this.type="pie",this.series=[],this.canvas=t,this.context=t.getContext("2d"),this.init(e)}h.prototype={constructor:h,init:function(t){var e,n=this.type;this.options=r({},t),e=this.options.colors||[],this.series=k(this.options.series||[],(function(t){var r,a,o,l,h=t.shapes||[],u=h.length,c=0,f=t.type===n;if(f){for(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.value===e.value})),a=o=l=0;c<u;c++){var d=h[c];r=Math.max(0,d.value),!i(d.color)&&(d.color=e[c%e.length]),s(r)&&!1!==d.selected&&(o=Math.max(o,r),a=Math.min(a,r),l+=r)}t.maxValue=o,t.minValue=a,t.sumValue=l}return f}));var a=new h.Layout(n,this.series,this.options);this.shapes=a.shapes,this.layout=a},draw:function(){var t=this.context,e=this;this.shapes.forEach((function(n){var i=n.shapes;i.forEach((function(i){e.drawShape(t,i,n)})),i.forEach((function(i){e.drawLabels(t,i,n)}))}))},redraw:function(){this.shapes=this.layout.subgroup(),this.draw()},animateTo:function(){var t=[];return this.shapes.forEach((function(e){var n,i,o=e.shapes,s=e._shapes||[],l=a("number",e.startAngle*V/180,0)+-Math.PI/2,h=[];e._diffValues.add((function(e){var a,l=s[e],h=o[e]||{};return a={shapeArgs:r({},h.shapeArgs),textArgs:r({},h.textArgs),connectorPoints:h.connectorPoints,angle:h.angle,color:h.color,value:h.value,_value:h._value,percentage:h.percentage},t.push([l,function(t){n=l.shapeArgs.startAngle,i=l.shapeArgs.endAngle,a.shapeArgs.startAngle=n*(1-t)+i*t,a.textArgs.x=-9999,a.textArgs.y=-9999}]),a})).modify((function(e,n){var i,a=o[e],l=s[n];return a&&l&&a.shapeArgs&&l.shapeArgs&&((i={shapeArgs:r({},a.shapeArgs),textArgs:r({},a.textArgs),connectorPoints:a.connectorPoints,color:a.color,value:a.value,_value:a._value,percentage:a.percentage}).shapeArgs.startAngle=l.shapeArgs.startAngle,i.shapeArgs.endAngle=l.shapeArgs.endAngle,t.push([a,function(t){var e=l.shapeArgs.startAngle,n=l.shapeArgs.endAngle,r=a.shapeArgs.startAngle,o=a.shapeArgs.endAngle;i.shapeArgs.startAngle=e+(r-e)*t,i.shapeArgs.endAngle=n+(o-n)*t,i.textArgs.x=l.textArgs.x+(a.textArgs.x-l.textArgs.x)*t,i.textArgs.y=l.textArgs.y+(a.textArgs.y-l.textArgs.y)*t}])),i})).remove((function(e){var a,h=o[e];return a={shapeArgs:r({},h.shapeArgs),textArgs:r({},h.textArgs),connectorPoints:h.connectorPoints,angle:h.angle,color:h.color,value:h.value,_value:h._value,percentage:h.percentage},t.push([h,function(t){n=h.shapeArgs.startAngle,i=h.shapeArgs.endAngle,s[e-1]?(a.shapeArgs.startAngle=i+(n-i)*t,a.textArgs.x=h.textArgs.x,a.textArgs.y=h.textArgs.y):(a.shapeArgs.startAngle=l+(n-l)*t,a.shapeArgs.endAngle=l+(i-l)*t)}]),a})).each((function(t){t&&h.push(t)})),e._animators=h,e._shapes=e.shapes})),t},onFrame:function(t){var e=this;this.shapes.forEach((function(n){n._animators.forEach((function(i){e.drawShape(t,i,n),e.drawLabels(t,i,n)}))}))},drawState:function(t,e,n){var i=e.shapeArgs,r=i.x,o=i.y,s=i.radius,h=i.startAngle,u=i.endAngle,c=a("string",e.color,n.color,"#000");t.save(),t.beginPath(),l(r,o,s+.05*s,s,h,u,!1)(t),t.fillStyle=m.parse(c).alpha(.2).rgba(),t.fill(),t.restore()},drawShape:function(t,e,n){var r,o=a("string",e.color,n.color,"#000"),s=a("number",n.borderWidth,0),h=a("string",n.borderColor,"#FFFFFF"),u=e.shapeArgs,c=u.x,f=u.y,d=u.startAngle,p=u.endAngle;i(e.current)&&((o=m.parse(o).alpha(.7)).r=Math.min(255,o.r+20),o.g=Math.min(255,o.g+20),o.b=Math.min(255,o.b+20),o=m.rgba(o)),!0===e.sliced&&(r=(d+p)/2,c+=10*Math.cos(r),f+=10*Math.sin(r)),t.save(),t.fillStyle=o,l(c,f,u.radius,u.innerRadius,d,p,!1)(t),!0!==n.nofill&&t.fill(),(t.lineWidth=a("number",s))>0&&(t.strokeStyle=h,t.stroke()),i(e.state)&&this.drawState(t,e,n),t.restore()},drawLabels:function(t,e,n){var r,o=e.dataLabels||{},s=a("object",e.dataLabels,n.dataLabels,{}),l=o.enabled||s.enabled,h=o.style||n.dataLabels.style||{},c={fontStyle:a("string",h.fontStyle,"normal"),fontSize:a("string",h.fontSize,"12px"),fontWeight:a("string",h.fontWeight,"normal"),fontFamily:a("string",h.fontFamily,"Arial"),lineHeight:a("string",h.lineHeight,"normal")},f=!!o.inside||!!s.inside||1===n.shapes.length,d=e.textArgs,p=e.connectorPoints,g=function(e,n,r,o){var l=e._value,d=s.formatter;if(u(d)&&(l=d.call({name:e.name,value:l,total:e.total,percentage:e.percentage,point:e,series:e.series,color:e.color},e)),i(l)){var p=v.HTML(v.parseHTML(l),t,c),g=p.getBBox(),y=g.width,x=g.height;f?(n-=y*o,r+=x/2):(n=a("number",function(t,e){return{left:t-e*!o,right:t-e*o,center:t-e/2*!o}}(n,y)[a("string",s.align,"right")],n),r=a("number",function(t,e){return{top:t-e,bottom:t+e,middle:t+e/2}}(r,x)[a("string",s.verticalAlign,"middle")],r-x/2)),t.save(),t.fillStyle=h.color,t.font=[c.fontStyle,c.fontWeight,c.fontSize,c.fontFamily].join(" "),t.translate(n,r),p.toCanvas(t),t.restore()}return l};null!==e.value&&!1!==e.selected&&!0===l&&(1===n.shapes.length&&!e.shapeArgs.innerRadius&&f||f?(t.save(),t.textAlign="center",g(e,d.x,d.y,!1),t.restore()):!0!==e.visibility&&(r=g(e,d.x,d.y,"end"===d["text-anchor"]),i(r)&&s.distance>0&&s.connectorWidth>0&&(t.save(),t.strokeStyle=e.color,t.lineWidth=s.connectorWidth,t.beginPath(),(p||[]).forEach((function(e,n){t[n?"lineTo":"moveTo"](e.x,e.y)})),t.stroke(),t.restore())))},setSliced:function(t){t.forEach((function(t){var e=t.shape;t.series.shapes.forEach((function(t){t!==e&&delete t.sliced})),e.sliced=!e.sliced}))},getShape:function(t,e){var n,i,r,a=this.shapes,o=a.length,s=-1,l=this.context,h=[];function u(t){t.forEach((function(t){!function(t){delete t.current}(t)}))}t*=P,e*=P;for(var c=0;c<o;c++){u(n=(r=a[c]).shapes),s=-1;for(var f=0;f<n.length;f++)if(i=n[f],this.drawShape(l,i,{nofill:!0}),l.isPointInPath(t,e)){i.$value=""+i._value,h.push({shape:i,series:r}),s=f;break}-1!==s?n[s].current=s:u(n)}return h}},h.Layout=function(t,e,n){this.type=t,this.options=n,this.series=e.slice(0),this.init()},h.Layout.prototype={init:function(){this.shapes=this.subgroup()},subgroup:function(){var t=this.options,e=this.type,o=this,s=[];return t.panel.forEach((function(t){k(t.series,(function(t){return t.type===e})).forEach((function(t){var e,l=a("number",t.plotX,0),h=a("number",t.plotY,0),u=a("number",t.plotWidth,0),c=a("number",t.plotHeight,0),f=t.sumValue,d=t.maxValue,p=t.dataLabels||{},g=a("number",p.distance,0),y=a("object",p.style,{}),x=a("number",parseInt(y.fontSize,10),12),v=t.roseType,m=-90,b=270;i(t.startAngle)&&(b=(m=t.startAngle)+b+90),i(t.endAngle)&&(b=t.endAngle),f||(f=1);var w=0,M=0,A=i(t.center)?t.center:[u/2,c/2],S=a("number",n(u,A[0]),A[0],u/2),k=a("number",n(c,A[1]),A[1],c/2);S+=l,k+=h,!1===p.enabled||p.inside,g>0&&!0!==p.inside&&(c-=2*g,c-=x),w=Math.min(u/2,c/2),i(t.size)&&(w=Math.max(a("number",t.size,n(w,t.size),10),10)),i(t.innerSize)&&(M=a("number",t.innerSize,n(w,t.innerSize)),M=Math.min(M,w-1)),m=Math.PI/180*m,e=(b=Math.PI/180*(b||m+360-90))-m;for(var E=0,T=0,C=t.shapes.length;T<C;T++){var F,W,_=t.shapes[T],P=_.value,z=P/f,H=w,I="area"===v;(null===P||!1===_.selected||P<0)&&(P=z=0),(!0===v||"radius"===v||I)&&(H=L(P,0,d,M,w),I&&(z=1/C)),N=(W+F)/2;var N=((F=m+E*e)+(W=m+(E+=z)*e))/2;N>1.5*V?N-=Y:N<-V/2&&(N+=Y),r(_,{shapeArgs:{x:S,y:k,radius:H,innerRadius:M,startAngle:F,endAngle:W},textArgs:{x:NaN,y:NaN},transX:0,transY:0,center:A,percentage:100*z,total:f,angle:N,half:N<-V/2||N>V/2?1:0,radius:w})}t.shapes.length&&o.labels(t.shapes,t),s.push(t)}))})),s},labels:function(t,e){var n=function(t,e){return t.point.value-e.point.value},i=function(t,e){return t.angle-e.angle},r=e.dataLabels||{},s=r.style||{},l=a("number",r.distance,0),h=a("number",Math.ceil(parseFloat(s.lineHeight),10),12),u=!!r.inside||1===t.length,c=!!r.skipOverlapLabels,f=!!r.manageLabelOverflow,d=(r.isSmartLineSlanted,[t[0].shapeArgs.x,t[0].shapeArgs.y,t[0].radius,t[0].shapeArgs.innerRadius||0]),p=d[0],g=d[1],y=d[2],x=d[3],v=e.labelsRadius||y+l/2,m=e.labelsMaxInQuadrant||Math.floor(v/parseInt(s.fontSize,10)),b=parseInt(s.fontSize,10),w=a("number",r.connectorPadding,15),M=[w,w,-w,-w],A=[[],[],[],[]];if(1===t.length&&!x&&u)t[0].textArgs={x:p,y:g,"text-anchor":"center"};else if(u)t.forEach((function(t){if(null!==t.value&&!0===r.enabled||o(t.dataLabels)&&!0===t.dataLabels.enabled){var e=(t.shapeArgs.startAngle+t.shapeArgs.endAngle)/2,n=t.shapeArgs.radius,i=Math.cos(e),a=Math.sin(e),s=(n+x)/2*i+p+4*i,l=(n+x)/2*a+g+4*a;t.sliced,t.textArgs={x:s,y:l,"text-anchor":"center"}}}));else{var S,L,k,E,T;t.forEach((function(t){if(!0===r.enabled||o(t.dataLabels)&&!0===t.dataLabels.enabled){var e=t.angle%(2*Math.PI);0>e&&(e=2*Math.PI+e);var n=0<=e&&e<Math.PI/2?1:e<Math.PI?2:e<1.5*Math.PI?3:0;A[n].push({point:t,angle:e})}}));for(var C=4;C--;){var F;if(c&&0<(F=A[C].length-m))for(A[C].sort(n),T=A[C].splice(0,F),F=0;F<T.length;F++)(S=T[F].point).visibility=!0;A[C].sort(i)}var W=Math.max(Math.min(Math.max(A[0].length,A[1].length,A[2].length,A[3].length),m)*b,v+b),_=A[0].concat(A[1]),P=A[2].concat(A[3]);for(L=Number.POSITIVE_INFINITY,C=_.length-1;0<=C;C--)delete(S=_[C].point).clearance,delete S.clearanceShift,E=Math.abs(W*Math.sin(S.angle)),Math.abs(L-E)<2*h&&(S.clearance=0,_[C+1].point.clearanceShift=h/2),L=E;for(L=Number.POSITIVE_INFINITY,C=0;C<P.length;C++)delete(S=P[C].point).clearance,delete S.clearanceShift,E=Math.abs(W*Math.sin(S.angle)),Math.abs(L-E)<2*h&&(S.clearance=0,P[C-1].point.clearanceShift=h/2),L=E;A[1].reverse(),A[3].reverse();for(var z=4;z--;){var H,I=(T=A[z]).length;for(c||(b=I>m?W/I:parseInt(s.fontSize,10)),E=I*b,L=W,C=0;C<I;C+=1,E-=b)L<(H=Math.abs(W*Math.sin(T[C].angle)))?H=L:H<E&&(H=E),L=(T[C].oriY=H)-b;var V=["start","start","end","end"][z];for(I=W-(I-1)*b,L=0,C=T.length-1;0<=C;--C,I+=b){var Y=T[C];S=T[C].point,o(Y.dataLabels)&&(r=Y.dataLabels),(H=Math.abs(W*Math.sin(Y.angle)))<L?H=L:H>I&&(H=I),L=H+b;var N=void 0===S.clearance?2*Math.ceil(a("number",parseFloat(e.borderWidth,10),12)):2*Math.ceil(a("number",parseFloat(e.borderWidth,10),S.clearance,0)),O=(H+T[C].oriY)/2;p=S.shapeArgs.x,g=S.shapeArgs.y,y=S.shapeArgs.radius,H=p+[1,1,-1,-1][z]*v*Math.cos(Math.asin(Math.max(-1,Math.min(O/W,1)))),O*=[-1,1,1,-1][z],O+=g;var R=p+y*Math.cos(Y.angle),X=g+y*Math.sin(Y.angle),j=Math.cos(k=(S.shapeArgs.startAngle+S.shapeArgs.endAngle)/2);Math.sin(k);(2>z&&H<R||1<z&&H>R)&&(H=R);var D=H+M[z];if(f){var B=h+N;void 0===S.clearance&&B>b&&(O+=b)}if(S.sliced){var q=S.transX;D+=q,H+=q,R+=q,X+=S.transY}var U=R+j*(w+S.radius-y),G=D+(j>=0||-1)*l;S.connectorPoints=[{x:R,y:X},{x:U,y:O},{x:G,y:O}],S.textArgs={x:D+(j>=0||-1)*(3+l),y:O,"text-anchor":V}}}}}},(e.graphers=e.graphers||{}).pie=e.Pie=h}("undefined"!=typeof window&&window,e.Chart),function(t,e){var n=function(t){function e(t){var e=t.interpolate;return function(t,n){n.panel.forEach((function(n){k(n.series,(function(e){return e.type===t})).forEach((function(t){var n,i,o,h,c,f,d=a("number",t.plotX,0),p=a("number",t.plotY,0),g=a("number",t.plotWidth,0),y=a("number",t.plotHeight,0),x=t.shapes.length,v=0;for(v=0;v<x;v++){var m,b,w=t.shapes[v],M=w.value,A=a("number",w.radius,t.radius,u(t.radius)&&t.radius.call(w,w.source,M),5);n=t._xAxis||{},i=t._yAxis||{},a("number",a("object",i.logarithmic,{}).base,10),h=a("number",t.max,i.maxValue),o=a("number",t.min,i.minValue),c=i.reversed,f=g/Math.max(1,x-1),l(w.source)&&w.source.length>1?(m=s(w.source[0])?e.apply(null,[w.source[0],n.minValue,n.maxValue,0,g]):NaN,m+=d,b=s(w.source[1])?e.apply(null,[w.source[1],o,h].concat(!0===c?[0,y]:[y,0])):NaN,b+=p):s(w._x)&&s(w._y)?(m=e.apply(null,[w._x,n.minValue,n.maxValue,0,g]),m+=d,b=e.apply(null,[w._y,o,h].concat(!0===c?[0,y]:[y,0])),b+=p):(m=v*f,m+=d,b=e.apply(null,[M,o,h].concat(!0===c?[0,y]:[y,0])),b+=p),!1===t.selected&&(A=0),w.radius=A,r(w,{cx:m,cy:b,radius:A})}}))}))}}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}.call("undefined"!=typeof window?window:this).deps(b);function o(t,e){this.type="scatter",this.canvas=t,this.context=t.getContext("2d"),this.init(e)}o.prototype={constructor:o,init:function(t){var e=this.type;this.options=r({},t),this.series=k(t.series,(function(t){var n=t.type===e;return n&&(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.value===e.value}))),n})),n(e,this.options)},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){n.shapes.forEach((function(i){e.drawShape(t,i,n)})),n.shapes.forEach((function(i){s(i.current)&&i.current>-1&&e.drawShape(t,i,n),e.drawLabels(t,i,n)}))}))},redraw:function(){n(this.type,this.options),this.draw()},getShape:function(t,e){var n,i,r,o,s,l,h=this.series.length,u=[],c=function(n){return!(t<a("number",n.plotX,0)||t>n.plotWidth+a("number",n.plotX,0)||e<a("number",n.plotY,0)||e>n.plotHeight+a("number",n.plotY,0))},f=function(t){for(var e=0,n=t.length;e<n;e++)delete t[e].current};for(o=0;o<h;o++){if(f(l=(n=this.series[o]).shapes),!c(n))return u;for(s=0,r=l.length;s<r;s++)if(i=l[s],!1!==n.selected&&y.line({x:t,y:e},{x:i.cx,y:i.cy,width:i.radius})){i.current=s,u.push({shape:i,series:n});break}}return u},drawShape:function(t,e,n){var r=a("number",n.borderWidth,0),o=n.borderColor,l=e.color||n.color,h=e.radius,u=b.clamp(a("number",e.opacity,n.opacity,1),0,1),c=a("number",e.shadowBlur,n.shadowBlur,0),f=a("number",e.shadowOffsetX,n.shadowOffsetX,0),d=a("number",e.shadowOffsetY,n.shadowOffsetY,0),p=e.shadowColor||n.shadowColor,g=e.cx,y=e.cy,x=l;if(i(l.radialGradient)&&(l=(x=m.parse(l)).radial(g,y,h),x=x.color),u<1&&(x=l=m.parse(l).alpha(u).rgba()),s(e.current)&&e.current>-1){var v=h+3;t.save(),t.fillStyle=m.parse(x).alpha(.25).rgba(),t.beginPath(),t.arc(g,y,v,0,2*V,!0),t.fill(),t.restore()}t.save(),t.fillStyle=l,t.beginPath(),h>0&&t.arc(g,y,h,0,Y,!0),r>0&&(t.lineWidth=r,t.strokeStyle=o,t.stroke()),c>0&&(t.shadowColor=p,t.shadowBlur=c,t.shadowOffsetX=f,t.shadowOffsetY=d),t.fill(),t.restore()},drawLabels:function(t,e,n){var r=n.dataLabels||{},o=e.dataLabels||{},s=o.style||r.style||{},l=o.align||r.align,h=o.verticalAlign||r.verticalAlign,c=o.formatter||r.formatter;var f,d,p,g=o.enabled||r.enabled,y=a("string",""+e._value,e.name,""),x=e.radius;if(!1!==n.selected&&!0===g&&null!==e.value&&(u(c)&&(y=c.call({x:e.key,key:e.key,name:y,color:e.color,series:e.series,point:e},y)),i(y))){var m=v.HTML(v.parseHTML(y),t,{fontFamily:s.fontFamily,fontSize:s.fontSize,fontWeight:s.fontWeight});f=m.getBBox(),d=a("number",function(t,e){return{left:t-e.width,center:t-e.width/2,right:t}}(e.cx,f)[a("string",l,"center")],e.cx)+a("number",o.x,r.x,0),p=a("number",function(t,e){return{top:t,middle:t+x,bottom:t+2*e.height+x}}(e.cy,f)[a("string",h,"top")],e.cy-x)+a("number",o.y,r.y,0),t.save(),t.fillStyle=s.color,t.translate(d,p-f.height),m.toCanvas(t),t.restore()}},animateTo:function(t,e){var n=[];return this.series.forEach((function(t){var i=t.shapes,r=t._shapes||[],a=[];!0===e?i.forEach((function(t){var e={cx:t.cx,cy:t.cy,color:t.color,shape:t};n.push([t,function(n){e.radius=t.radius*n}]),a.push(e)})):t._diffValues.remove((function(t){var e,r=i[t];e={cx:r.cx,cy:r.cy,value:r.radius,shape:r},n.push([r,function(t){e.radius=r.radius*t}]),a.push(e)})).add((function(t){var e,i=r[t];e={cx:i.cx,cy:i.cy,color:i.color,value:i.value,shape:i},n.push([i,function(t){e.radius=i.radius-i.radius*t}]),a.push(e)})).modify((function(t,e){var o,s=i[t],l=r[e];l&&s&&(o={color:s.color,value:s.value,shape:s},n.push([s,function(t){o.cx=l.cx+(s.cx-l.cx)*t,o.cy=l.cy+(s.cy-l.cy)*t,o.radius=l.radius+(s.radius-l.radius)*t}]),a.push(o))})).each(),t._shapes=t.shapes,t._animators=a})),n},onFrame:function(t){var e=this;this.series.forEach((function(n){n._animators.forEach((function(i){e.drawShape(t,i,n),e.drawLabels(t,i.shape,n)}))}))}},(e.graphers=e.graphers||{}).scatter=e.Scatter=o}("undefined"!=typeof window&&window,e.Chart),function(t,e){var n=Math.sqrt(3),o=function(t,e){var n=e.x-t.x?(e.y-t.y)/(e.x-t.x):0;return{slope:n,b:t.y-n*t.x}};function l(t,e){this.type="funnel",this.canvas=t,this.context=t.getContext("2d"),this.series=[],this.shapes=[],this.init(e)}l.prototype={constructor:l,init:function(t){var e,n=this.type;this.options=r({},t),e=this.options.colors||[],this.series=k(this.options.series||[],(function(t){var r,a,o,l=t.shapes||[],h=l.length,u=0,c=t.type===n;if(c){for(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.value===e.value})),r=a=o=0;u<h;u++){var f,d=l[u];!s(f=d.value)&&(d.value=null),!i(d.name)&&(d.name=d.value),!i(d.color)&&(d.color=e[u%e.length]),null!==d.value&&!1!==d.selected&&(a=Math.max(a,f=Math.max(0,f)),r=Math.min(r,f),o+=f)}t.maxValue=a,t.minValue=r,t.sumValue=o}return c}));var a=new l.Layout(n,this.series,this.options);this.shapes=a.shapes,this.layout=a},draw:function(){var t=this.context,e=this;this.shapes.forEach((function(n){n.shapes.forEach((function(i){e.drawShape(t,i,n)})),n.shapes.forEach((function(i){e.drawLabels(t,i,n)}))}))},redraw:function(){this.layout.subgroup(),this.draw()},animateTo:function(){var t=[];return this.shapes.forEach((function(e){var n=e.shapes,i=e._shapes||[],a=[];e._diffValues.remove((function(e){var i,a,o,s,l,h=n[e],u=h.series;return delete h.series,i=r({},h),h.series=u,t.push([h,function(t){var e=h.points[0].y;a=h.points.map((function(t){return r({},t)})),o=a[0].y,s=a[a.length-2].y,l=a[a.length-3].y,7===a.length?(a[0].y=a[1].y=a[6].y=e+(o-e)*t,a[2].y=a[5].y=e+(s-e)*t,a[3].y=a[4].y=e+(l-e)*t):a[2].y=a[3].y=e+(s-e)*t,i.points=a}]),i})).add((function(t){var e,n=i[t],a=n.series;return delete n.series,e=r({},n),n.series=a,e})).modify((function(e,a){var o,s,l,h,u,c,f=n[e],d=i[a];return d&&f&&!1!==f.selected&&null!==f.value&&(c=f.series,delete f.series,o=r({},f),f.series=c,t.push([f,function(t){s=f.points.map((function(t){return r({},t)}));var e=d.points.map((function(t){return r({},t)}));l=s[0].y,h=s[s.length-2].y,u=s[s.length-3].y;var n=e[0].y,i=e[e.length-2].y,a=e[e.length-3].y;7===s.length?(s[0].y=s[1].y=s[6].y=n+(l-n)*t,s[2].y=s[5].y=i+(h-i)*t,s[3].y=s[4].y=a+(u-a)*t):s[2].y=s[3].y=i+(h-i)*t,o.points=s}])),o})).each((function(t){t&&a.push(t)})),e._animators=a,e._shapes=e.shapes})),t},onFrame:function(t){var e=this;this.shapes.forEach((function(n){n._animators.forEach((function(i){e.drawShape(t,i,n),e.drawLabels(t,i,n)}))}))},drawShape:function(t,e,n){var r=a("number",e.borderWidth,n.borderWidth,0),o=e.color||n.color;!1!==e.selected&&null!==e.value&&((o=m.parse(o)).a=i(e.current)?.75:1,t.save(),t.fillStyle=m.rgba(o),t.beginPath(),e.points.forEach((function(e,n){t[n?"lineTo":"moveTo"](e.x,e.y)})),t.fill(),(t.lineWidth=r)>0&&(t.strokeStyle=n.borderColor,t.stroke()),t.restore())},getShape:function(t,e){var n,i,r,a=[],o=this.shapes,s=o.length;function l(t){t.forEach((function(t){delete t.current}))}for(var h=0;h<s;h++){l(n=(r=o[h]).shapes);for(var u=0;u<n.length;u++)if(null!==(i=n[u]).value&&!1!==i.selected&&y.polygon({x:t,y:e},i.points)){i.current=u,i.$value=""+i._value,a.push({shape:i,series:r});break}}return a},drawLabels:function(t,e,n){I.align((function(n,i){var r,s=a("string",n,"center"),l=e.points,h=e.textArgs,u=Math.abs(l[1].x-l[0].x),c=i.width,f=h.x,d=h.y;return!0!==this.inside?(this.distance>0&&(t.save(),t.beginPath(),t.moveTo(f,d),t.lineTo(f+=this.distance,d),t.strokeStyle=e.color,t.stroke(),t.restore()),f):(f=l[0].x,{left:(d-(r=o(l[4],l[3])).b)/r.slope,center:f+(u-c)/2,right:h.x-c}[s])})).vertical((function(t,n){var i=e.points,r=e.shapeArgs,o=n.height,s=r.height,l=i[0].y,h=a("string",t,"top");return!0!==this.inside?e.textArgs.y+o/2:{top:l+o,middle:l+o+(s-o)/2,bottom:l+s}[h]})).call(e,n,t)}},l.Layout=function(t,e,n){this.series=e,this.shapes=[],this.type=t,this.options=n,this.init()},l.Layout.prototype={init:function(){this.shapes=this.subgroup()},neckWidth:function(t,e,o,s,l){t.dataLabels;var h=a("number",b.percentage(100,t.neckHeight)/100,.75),u=!!t.reversed,c=t.sorted,f=a("number",t.width,b.percentage(s,t.width),s),d=a("number",t.height,b.percentage(l,t.height),l),p=Math.min(f,d),g=a("number",t.left,b.percentage(s,t.left),e+(s-p)/2),y=a("number",t.top,b.percentage(l,t.top),o),x=u*d,v=p,m=n*p*h/2,w=0,M=!1,A=g,S=t.shapes,L=S.length,k=u?L:-1;!0===t.neck&&i(c)&&!1!==c&&S.sort((function(t,e){return t.value-e.value}));for(;u?k--:++k<L;){var E=S[k],T=E.value,C=T/t.sumValue;(null===T||!1===E.selected||T<0)&&(T=C=0);var F=C*d,W=M?0:F/n,_=A+v,P=_-W,z=A+W,H=y+x,I=H+F,V=[{x:A,y:H},{x:_,y:H}];if(u)_=0+W,(V=[{x:P=0+v,y:I=x},{x:0,y:I}]).push({x:A=0-W,y:H=I-F}),V.push({x:_,y:H}),x-=F;else{if(!M&&w+F>m){var Y=p*(1-h);M=!0,W=(v-Y)/2,V=V.concat([{x:_-W,y:H+m-w},{x:_-W,y:I},{x:A+W,y:I},{x:A+W,y:H+m-w}]),v=Y,z=A+W}else w+=F,V.push({x:P,y:I},{x:z,y:I}),v-=2*W;x+=F,V.push({x:A,y:H}),A=z}r(E,{x:A,y:H,points:V,total:t.sumValue,percentage:100*C,shapeArgs:{x:A,y:H,height:F},textArgs:{x:-9999,y:-9999}})}},neckHeight:function(t,e,n,i,o){var s,l,h=!!t.reversed,u=t.sorted,c=a("number",t.width,b.percentage(i,t.width),i),f=a("number",t.height,b.percentage(o,t.height),o),d=Math.min(c,f),p=a("number",t.left,b.percentage(i,t.left),e+(i-d)/2),g=a("number",t.top,b.percentage(o,t.top),n+(o-d)/2-1),y=t.shapes,x=y.length,v=h?-1:x,m=h?g:g+d,w=0,M=0;!1!==u&&y.sort((function(t,e){return h?t.value-e.value:e.value-t.value}));for(var A,S=0;h?++v<x:v--;){var L=!1!==(s=y[v]).selected&&null!==s.value&&s.value>=0;delete s.isLast,L&&(A||(A=s),++S)}for(l=d/S,A&&(A.isLast=!0),v=h?-1:x;h?++v<x:v--;){var k,E,T,C,F,W,_=(s=y[v]).value,P=_/t.maxValue,z=[],H=!1;W=l,(null===_||_<0||!1===s.selected)&&(_=W=0,H=!0),k=p,T=(k+=(d-(F=P*d<10?10/v:P*d))/2)+F,h?(z=[{x:w,y:E=m},{x:M,y:E},{x:T,y:C=E+W},{x:k,y:C},{x:w,y:E}],s.isLast&&(z=[{x:k+F/2,y:E},{x:k+F/2,y:E},{x:T,y:C},{x:k,y:C},{x:k+F/2,y:E}]),m=C):(C=(E=m-W)+W,z=[{x:k,y:E},{x:T,y:E}],s.isLast?z.push({x:T-F/2,y:C},{x:T-F/2,y:C}):z.push({x:M,y:C},{x:w,y:C}),z.push({x:k,y:E}),m=E),H||(M=T,w=k),r(s,{points:z,shapeArgs:{x:k,y:E,height:l,width:F},textArgs:{x:-9999,y:-9999}})}},dataLabels:function(t){t.shapes.forEach((function(t){var e,n,i,r=t.points||[],a=t.shapeArgs;r.length&&(e=o(r[2],r[1]),r.length>=7&&(e=o(r[4],r[3])),n=((i=a.y+a.height/2)-e.b)/e.slope,0===e.slope&&(r.length>=7?(n=r[3].x,i=r[2].y):n=r[2].x),t.textArgs.x=n,t.textArgs.y=i)}))},subgroup:function(){var t=this.options,e=this.type,n=t.chart.width,i=t.chart.height,r=this;return t.panel.forEach((function(t){k(t.series,(function(t){return t.type===e})).forEach((function(t){var e=a("number",t.plotX,0),o=a("number",t.plotY,0),s=a("number",t.plotWidth,n,0),l=a("number",t.plotHeight,i,0);r[!0===t.neck?"neckHeight":"neckWidth"].apply(r,[t,e,o,s,l]),r.dataLabels(t)}))})),this.series}},(e.graphers=e.graphers||{}).funnel=e.Funnel=l}("undefined"!=typeof window&&window,e.Chart),function(t,e){var o=function(t){function e(t){var e=t.interpolate;return function(t,n){n.panel.forEach((function(n){k(n.series,(function(e){return e.type===t})).forEach((function(t){var n,i,o,s,h=t._polarAxis||{},u=h.center[0],c=h.center[1],f=t.plotRadius;n=a("number",h.startAngle,-90)*V/180,i=a("number",h.endAngle,360)*V/180,a("number",a("object",h.logarithmic,{}).base,10),s=a("number",h.maxValue),o=a("number",h.minValue);var d,p,g,y=t.shapes.length,x=0;for(x=0;x<y;x++){var v,m,b,w,M=t.shapes[x],A=M.value;l(M.source)?(b=M.source[0]*Y/360+n,w=e(M.source[1],o,s,0,f)):(b=x*Y/Math.max(1,y)+n,w=e(A,o,s,0,f)),!1!==t.selected&&null!==A||(w=0),v=u+Math.cos(b)*w,m=c+Math.sin(b)*w,r(M,{x:v,y:m,angle:b,index:x,key:(d=x,p=h,g=void 0,l(g=p.categories)&&g.length?g[d]:d)}),M.series._startAngle=n,M.series._endAngle=i}}))}))}}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}.call("undefined"!=typeof window?window:this).deps(b),h=e.LineSegment,u=e.angle2arc;function c(t,e){this.type="radar",this.canvas=t,this.context=t.getContext("2d"),this.series=[],this.init(e)}c.prototype={constructor:c,init:function(t){var i=this.type,a=this.canvas,s=this;this.options=r({},t),this.series=k(t.series,(function(t){var e=t.type===i;return e&&(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.value===e.value}))),e})),o(i,this.options),1===a.nodeType&&this.series.forEach((function(t){if(t.animationEnabled){var i=n.createElement("canvas"),r=i.getContext("2d");e.scale(r,a.width,a.height,P),t._image=i,s.drawLine(r,t.shapes,t)}}))},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){e.drawLine(t,n.shapes,n),!1!==n.selected&&(n.shapes.forEach((function(i){e.drawShape(t,i,n)})),n.shapes.forEach((function(i){e.drawLabels(t,i,n),e.onHover(t,i,n)})))}))},redraw:function(){o(this.type,this.options),this.draw()},getShape:function(t,e){var n,i,r,o,s,l,h=this.series.length,u=[],c=function(n){var i=t-n.plotCenterX,r=e-n.plotCenterY;return n.plotRadius*n.plotRadius-i*i-r*r>=.001},f=function(t){for(var e=0,n=t.length;e<n;e++)delete t[e].current};for(o=0;o<h;o++)if(l=(n=this.series[o]).shapes,c(n))for(f(l),s=0,r=l.length;s<r;s++)if(i=l[s],!1!==n.selected&&!i.isNULL&&y.line({x:t,y:e},{x:i.x,y:i.y,width:2*a("number",(n.marker||{}).radius,5)})){i.current=s,u.push({shape:i,series:n});break}return u},drawShape:function(t,e,n){var r=a("object",e.marker,n.marker,{}),o=a("number",r.lineWidth,0),s=a("string",r.lineColor,e.color,n.color,"#000"),l=a("string",r.fillColor,e.color,n.color,"#000"),h=a("number",r.radius,4),u=n.shapes.length*h<n.radius;(i(r.enabled)||i(r.enabled))&&(u=!0===r.enabled),!1!==n.selected&null!==e.value&u&&(t.save(),t.fillStyle=l,t.beginPath(),t.arc(e.x,e.y,h,0,Y,!0),t.fill(),(t.lineWidth=o)>0&&(t.strokeStyle=s,t.stroke()),t.restore())},drawLine:function(t,e,n){var r=a("number",n.lineWidth,2),o=n.lineColor||n.color,l=n.fillColor||n.color,u=n.radarType;t.save(),t.beginPath(),"area"===u?(m.isColor(l)?l=m.parse(l).alpha(.75).rgba():i(l.radialGradient)&&(l=m.parse(l).radial(n.cx,n.cy,n.radius)),h.none(t,e,n),t.fillStyle=l,t.closePath(),t.fill()):(h.none(t,e,n),t.closePath()),(t.lineWidth=r)>0&&(t.shadowColor=n.shadowColor,s(n.shadowBlur)&&(t.shadowBlur=n.shadowBlur),s(n.shadowOffsetX)&&(t.shadowOffsetX=n.shadowOffsetX),s(n.shadowOffsetY)&&(t.shadowOffsetY=n.shadowOffsetY),t.strokeStyle=o,t.stroke()),t.restore()},onHover:function(t,e,n){var i,r=n.marker||{},a=e.color||n.color;!e.isNULL&&s(e.current)&&e.current>-1&&((i=m.parse(a)).a=.5,t.save(),t.fillStyle=m.rgba(i),t.beginPath(),t.arc(e.x,e.y,8,0,Y),t.fill(),t.fillStyle=a,t.strokeStyle=r.fillColor||"#fff",t.beginPath(),t.arc(e.x,e.y,3,0,Y),t.fill(),t.stroke(),t.restore()),delete e.current},drawLabels:function(t,e,n){var i=a("number",(e.marker||{}).radius,(n.marker||{}).radius,0);I.align((function(t,n){var r=a("string",t,"center"),o=e.x,s=n.width;return{left:o-s-i/2,center:o-s/2,right:o+i/2}[r]})).vertical((function(t,n){var r=a("string",t,"top"),o=e.y,s=n.height;return{top:o-i,middle:o-s+i,bottom:o+i}[r]})).call(e,n,t)},animateTo:function(t,e){var n=[];return this.series.forEach((function(t){var i=t.shapes,r=t._shapes||[],a=[];if(!0===e){var o=t;o._timer=0,n.push([t,function(t){o._timer=t}]),a.push(o)}else t._diffValues.remove((function(t){var e=i[t],r={x:e.x,y:e.y,color:e.color,value:e.value,_value:e._value,isNULL:e.isNULL};n.push([e,function(t){r.radius=e.radius*t}]),a.push(r)})).add((function(t){var e=r[t],i={x:e.x,y:e.y,color:e.color,_value:e._value,value:e.value,isNULL:e.isNULL};n.push([e,function(t){i.radius=e.radius-e.radius*t}]),a.push(i)})).modify((function(t,e){var o,s=i[t],l=r[e];l&&s&&(o={x:l.x,y:l.y,color:s.color,_value:s._value,value:s.value,isNULL:s.isNULL},n.push([s,function(t){o.x=l.x+(s.x-l.x)*t,o.y=l.y+(s.y-l.y)*t,o.radius=l.radius+(s.radius-l.radius)*t}]),a.push(o))})).each();t._animators=a,t._shapes=t.shapes})),n},onFrame:function(t,e){var n=this;this.series.forEach((function(i){var r=i._animators;!0===e?r.forEach((function(e){var n,i,r,a,o;e._image&&(n=e._image,{ploar:function(t,e,n){return i=t,r=e,a=n,this},angle:function(t){return o=t,this},clip:function(t){t.save(),u(i,r,a/2,0,o[0],o[1],!1)(t),t.clip(),t.drawImage(n,0,0,n.width,n.height,0,0,n.width/P,n.height/P),t.restore()}}).ploar(e.plotCenterX,e.plotCenterY,2*e.plotRadius+10).angle([e._startAngle,e._endAngle*e._timer+e._startAngle]).clip(t)})):(n.drawLine(t,r,i),r.forEach((function(e){n.drawShape(t,e,i),n.drawLabels(t,e,i)})))}))}},(e.graphers=e.graphers||{}).radar=e.Radar=c}("undefined"!=typeof window&&window,e.Chart),function(t,n){var h=function(t){function e(t,e){var n=function(t){return s(t)&&isFinite(t)?Math.min(10,Math.max(t,0)):1};return function(h,u){var c={},f=t.Path;u.panel.forEach((function(t){k(t.series,(function(t){return t.type===h})).forEach((function(t){var h,u=t.mapData,d=c,p=[],g=a("number",t.plotX,0),y=a("number",t.plotY,0),x=a("number",t.plotWidth,0),v=a("number",t.plotHeight,0),m=a("number",t.chartWidth,x,0),b=a("number",t.chartHeight,v,0),w=t._colorAxis,M=[],A=[],S=w.minValue,k=w.maxValue,E=0,T=0,C=[1,1],F=[0,0];i(w)&&l(w.stops)&&(w.stops.forEach((function(t){M.push(t[0]),A.push(t[1])})),h=e.lerp(M,A,e.interpolate)),i(u)&&(C=[x/m*.9,v/b*.9],F=[g,y],i(t.scale)&&(s(t.scale)&&(C=[C=n(t.scale),C]),l(t.scale)&&(C=[n(t.scale[0]),n(t.scale[1])])),i(t.translate)&&(s(t.translate)&&(F=[g+a("number",t.translate),y+a("number",t.translate)]),l(t.translate)&&(F=[g+a("number",t.translate[0]),y+a("number",t.translate[1])])),f.size([m,b]).scale(C).translate(F).parse(u,(function(e,n){var i=[],a=0,l=0,u=0,c={name:(n.properties||{}).name,points:i};e.forEach((function(t,e){var n,r,o,s,h=t.length;for(e&&i.push({x:t[o=0].x,y:t[o].y,isNext:!0}),o=1;o<h;o++)n=(s=t[o]).x,r=s.y,E=Math.max(n,E),T=Math.max(r,T),l+=(n-l)/++a,u+=(r-u)/a,i.push({x:n,y:r})})),c.shapeArgs={x:l,y:u};var f,d,g=t.mapKey[c.name];o(g)||(g={value:null}),s(f=g.value)&&(d=h&&h(L(f,S,k,0,1)),c.color=d||t.color),r(c,g),p.push(c)})),p.forEach((function(t){var e=(m-E)/2,n=(b-T)/2+y;t.points.forEach((function(t){t.x+=e,t.y+=n})),t.shapeArgs.x+=e,t.shapeArgs.y+=n})),t._geo={path:f,size:d.size,x:d.x,y:d.y,center:d.center}),t.shapes=p}))}))}}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}.call("undefined"!=typeof window?window:this).deps(e.geo,m);function c(t,e){this.type="map",this.series=[],this.canvas=t,this.context=t.getContext("2d"),this.init(e)}c.prototype={constructor:c,init:function(t){var e=this.type;this.options=r({},t),this.series=k(a("array",this.options.series,[]),(function(t){var n=!1!==t.selected&&t.type===e;if(n){var r={};t.data.forEach((function(t){i(t.name)&&(r[t.name]=t)})),t.mapKey=r}return n})),h(e,this.options)},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){var r=n.shapes;i(n.mapData)&&(r.forEach((function(i){e.drawShape(t,i,n)})),r.forEach((function(i){e.drawLabels(t,i,n)})))}))},redraw:function(){h(this.type,this.options),this.draw()},drawShape:function(t,e,n){var r=a("number",n.borderWidth,0),o=a("string",n.borderColor,"#FFFFFF"),l=a("string",e.color,n.fillColor,"#f7f7f7"),h=e.points;s(e.current)&&-1!==e.current&&(l=i(e.value)?m.parse(l).alpha(.75).rgba():"rgb(79, 134, 189)"),t.save(),t.beginPath(),h.forEach((function(e,n){t[n&&!e.isNext?"lineTo":"moveTo"](e.x,e.y)})),t.closePath(),t.fillStyle=l,t.fill(),(t.lineWidth=r)>0&&(t.strokeStyle=o,t.stroke()),t.restore()},getShape:function(t,e){var n,i,r,a=[];function o(t){t.forEach((function(t){delete t.current}))}for(var s=0,l=this.series.length;s<l;s++){o(i=(n=this.series[s]).shapes);for(var h=0;h<i.length;h++)if(r=i[h],y.polygon({x:t,y:e},r.points)){r.$value=null===r.value?"--":""+r.value,a.push({shape:r,series:n}),r.current=h;break}}var u=[],c={};return a.forEach((function(t){var e=t.shape.name;c.hasOwnProperty(e)||(c[e]=!0,u.push(t))})),u},drawLabels:function(t,e,n){var r,o,s=a("object",e.dataLabels,n.dataLabels,{}),l=s.style||{},h={fontStyle:l.fontStyle||"normal",fontWeight:l.fontWeight||"normal",fontSize:l.fontSize||"12px",fontFamily:l.fontFamily||"Arial",lineHeight:l.lineHeight||"normal",color:l.color},c=s.formatter,f=e.shapeArgs,d=e.name;!0===s.enabled&&(u(c)&&(d=c.call({x:e.name,value:e.value,color:e.color,key:e.name,series:n,point:e,total:e.total,percentage:e.percentage},e.value)),i(d)&&(r=(o=v.HTML(v.parseHTML(d),t,h)).getBBox(),t.save(),t.fillStyle=h.color,t.font=[h.fontStyle,h.fontWeight,h.fontSize+"/"+h.lineHeight,h.fontFamily].join(" "),t.translate(f.x-r.width/2,f.y-r.height/2),o.toCanvas(t),t.restore()))}},(n.graphers=n.graphers||{}).map=n.Map=c}("undefined"!=typeof window&&window,e.Chart),function(t,e){var n=M.filter;function i(t,n){var i,r,a=e.arc;n.forEach((function(e,n){n?(a(t,i,r,e),r=(i=e.slice(-2))[1],i=i[0]):t.moveTo(i=e[0],r=e[1])}))}function o(t,e,n,i){var r=e.x-t.x,a=e.y-t.y,o=Math.sqrt(r*r+a*a);if(o>=n+i||o<=Math.abs(n-i))return[];var s=(n*n-i*i+o*o)/(2*o),l=Math.sqrt(n*n-s*s),h=t.x+s*r/o,u=t.y+s*a/o,c=l/o*-a,f=l/o*-r;return[{x:h+c,y:u-f},{x:h-c,y:u+f}]}var l=function(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.min(t,e)*Math.min(t,e)*V;var i=(t*t+n*n-e*e)/(2*t*n),r=(e*e+n*n-t*t)/(2*e*n);return(i=Math.acos(i))*t*t+(r=Math.acos(r))*e*e-t*n*Math.sin(i)},h=function(t,e){var n;return(n=function(t,e){var n=Math.sqrt(t*t-e*e);return e*n+t*t*Math.atan2(e,n)})(t,e-t)-n(t,-t)},u={arcs:[],areas:NaN,points:{inner:[],intersector:[]},area:function(t){var e,n,i,r,a=[],s=t.length;for(i=0;i<s;i++)for(r=i+1;r<s;r++){var l=t[i],u=t[r];o(l,u,l.radius,u.radius).forEach((function(t){t.parentIndex=[i,r],t.source=l,t.target=u,a.push(t)}))}e=k(a,(function(e){for(i=0;i<s;i++){var n=e,r=t[i];if(Math.sqrt((n.x-r.x)*(n.x-r.x)+(n.y-r.y)*(n.y-r.y))>r.radius+1e-10)return!1}return!0}));var c=0,f=0,d=this.arcs=[];if(e.length>1){var p={x:0,y:0};for(s=e.length,i=0;i<s;i++)n=e[i],p.x+=n.x,p.y+=n.y;for(p.x/=s,p.y/=s,i=0;i<s;i++)(n=e[i]).angle=Math.atan2(n.x-p.x,n.y-p.y);e.sort((function(t,e){return e.angle-t.angle}));var g,y,x=e[e.length-1];for(i=0;i<s;i++){for(g=e[i],c+=(x.x+g.x)*(g.y-x.y),y=null,r=0;r<g.parentIndex.length;++r)if(x.parentIndex.indexOf(g.parentIndex[r])>-1){var v,m,b=t[g.parentIndex[r]],w=Math.atan2(g.x-b.x,g.y-b.y),M=Math.atan2(x.x-b.x,x.y-b.y),A=M-w;A<0&&(A+=2*Math.PI),v=M-A/2;var S={x:(g.x+x.x)/2,y:(g.y+x.y)/2},L={x:b.x+Math.sin(v)*b.radius,y:b.y+Math.cos(v)*b.radius};m=Math.sqrt((S.x-L.x)*(S.x-L.x)+(S.y-L.y)*(S.y-L.y)),(null===y||y.width>m)&&(y={width:m,p1:g,p2:x,node:b})}d.push(y),f+=h(y.node.radius,y.width),x=g}}else{var E=t[0],T=!1;for(s=t.length,i=1;i<s;i++)t[i].radius<E.radius&&(E=t[i]);for(i=0;i<s;i++)if(Math.sqrt((t[i].x-E.x)*(t[i].x-E.x)+(t[i].y-E.y)*(t[i].y-E.y))){T=!0;break}T?f=c=0:(f=E.radius*E.radius*Math.PI,d.push({node:E,p1:{x:E.x,y:E.y+E.radius},p2:{x:E.x-1e-10,y:E.y+E.radius},width:2*E.radius}))}return this.areas=f+c,this.points.inner=e,this.points.intersector=a,f+(c/=2)}};function c(t){var e={};(this.nodes=n(t,(function(t){return void 0!==t.id}))).forEach((function(t,n){t.x=t.y=0,t.radius=Math.sqrt(t.value/Math.PI),e[n]=[]})),(this.overlaps=n(t,(function(t){return void 0!==t.sets&&t.sets.length>1}))).forEach((function(t){var n=t.sets[0],i=t.sets[1];e[n].push({node:i,value:t.value}),e[i].push({node:n,value:t.value})})),this.links=e,this.width=0,this.height=0,this.init()}function f(t){t.sort((function(t,e){return t.deep-e.deep}))}function d(t,e){this.type="venn",this.canvas=t,this.context=t.getContext("2d"),this.series=[],this.shapes=[],this.init(e)}c.prototype={init:function(){var t=this.nodes,e=this.links;if(t.length){var i,r,a=[];for(i in e)e.hasOwnProperty(i)&&(r=0,(e[i]||[]).forEach((function(t){r+=t.value})),a.push({node:i,weight:r}));a.sort((function(t,e){return e.weight-t.weight}));var o,s,l={},h=a[0].node,u=this.matrix();t[h].x=0,t[h].y=0,l[h]=!0;for(var c=1;c<a.length;c++){i=a[c].node,0===(s=n(e[i],(function(t){return t.node in l})).sort((function(t,e){return e.value-t.value}))).length&&console.log("error");for(var f,d=(o=this.union(u[i],s))[0],p=1e50,g=0;g<o.length;g++)t[i].x=o[g].x,t[i].y=o[g].y,(f=this.loss())<p&&(p=f,d=o[g]);l[i]=!0,t[i].x=d.x,t[i].y=d.y}}},union:function(t,e){for(var n=this.nodes,i=[],r=0;r<e.length;r++){var a=e[r].node,s=n[a],l=t[a];i.push({x:s.x+l,y:s.y},{x:s.x-l,y:s.y},{x:s.x,y:s.y+l},{x:s.x,y:s.y-l});for(var h=r+1;h<e.length;h++){var u=e[h].node,c=n[u],f=t[u];o({x:s.x,y:s.y},{x:c.x,y:c.y},l,f).forEach((function(t){i.push(t)}))}}return i},matrix:function(){for(var t=this.nodes,e=this.overlaps,n=t.length,i=[],r=0;r<n;r++){i.push([]);for(var a=0;a<n;a++)i[r].push(0)}for(n=e.length,r=0;r<n;r++){var o=e[r];if(2===o.sets.length){var s=o.sets[0],h=o.sets[1],u=Math.sqrt(t[s].value/Math.PI),c=Math.sqrt(t[h].value/Math.PI),f=Math.min(u,c)*Math.min(u,c)*Math.PI,d=o.value;f=f<=d?Math.abs(c-u):this.bisect(0,u+c,(function(t){return l(u,c,t)-d})),i[s][h]=i[h][s]=f}}return i},loss:function(t){var e=this.overlaps,n=0;t=t||this.nodes;for(var i=0;i<e.length;i++){var r,a=e[i];if(2===a.sets.length){var o=t[a.sets[0]],s=t[a.sets[1]],h=Math.sqrt((o.x-s.x)*(o.x-s.x)+(o.y-s.y)*(o.y-s.y));r=l(o.radius,s.radius,h)}else r=u.area(a.sets.map((function(e){return t[e]})));n+=(r-a.value)*(r-a.value)}return n},bisect:function(t,e,n){var i,r,a=n(t),o=n(e),s=e-t;if(a*o>0)throw"points";if(0===a)return t;if(0===o)return e;for(var l=0;l<100;l++)if((r=n(i=t+(s/=2)))*a>=0&&(t=i),Math.abs(s)<1e-10||0===r)return i;return t+s},scale:function(t,e,n){var i=this.nodes,r=this;n=n||1;var a=function(t){var e=Math.max.apply(Math,i.map((function(e){return e[t]+e.radius})));return{min:Math.min.apply(Math,i.map((function(e){return e[t]-e.radius}))),max:e}},o=a("x"),s=a("y"),l=Math.min(t/(o.max-o.min),e/(s.max-s.min));return i.forEach((function(t){t.radius=l*t.radius,t.x=n+(t.x-o.min)*l,t.y=n+(t.y-s.min)*l,r.width=Math.max(r.width,t.x+t.radius),r.height=Math.max(r.height,t.y+t.radius)})),this},translate:function(t,e){this.nodes.forEach((function(n){n.x+=+t||0,n.y+=+e||0}))},shapes:function(t,e){var n=this.nodes,i=this.overlaps,r=[],a=n.length;return n.forEach((function(t,n){t.color=e.colors[n%e.colors.length]})),i.forEach((function(t){var e=t.sets.map((function(t){return n[t]}));u.area(e);var i=u.arcs;if(i.length){var o,s,l=i[0].p2.x,h=i[0].p2.y,c=[[l,h]],f={x:l,y:h,type:"arc"};i.forEach((function(t){var e=t.node.radius,n=t.width>e;c.push([e,e,0,n?1:0,1,t.p1.x,t.p1.y]),l=t.p1.x,h=t.p1.y;var i=m.parse(t.p1.source.color),r=m.parse(t.p1.target.color),a=i.r,u=i.g,f=i.b,d=r.r,p=r.g,g=r.b,y=i.add(a,d),x=i.add(u,p),v=i.add(f,g);o=m.toString(127.5<<24|y<<16|x<<8|v),s=t.p1.source.name+" & "+t.p1.target.name})),f.name=s,f.value=t.value,f.path=c,f.deep=a++,f.color=o,r.push(f)}})),n.forEach((function(t,e){t.type="circle",t.deep=e,r.push(t)})),r}},d.prototype={constructor:d,init:function(t){var e=this.type;this.options=r({},t),this.series=k(t.series,(function(t){return t.type===e}));var n=new d.Layout(e,this.series,this.options);this.shapes=n.shapes,this.layout=n},draw:function(){var t=this.context,e=this;this.shapes.forEach((function(n){var i=n.dataLabels||{},r=i.style||{},o={fontStyle:a("string",r.fontStyle,"normal"),fontWeight:a("string",r.fontWeight,"normal"),fontSize:a("string",r.fontSize,"12px"),fontFamily:a("string",r.fontFamily,"Arial"),lineHeight:a("string",r.lineHeight,"normal"),color:r.color||"#000"},s=n.shapes;s.forEach((function(i){e.drawShape(t,i,n)})),!1!==i.enabled&&s.forEach((function(e){"circle"===e.type&&(t.font=[o.fontStyle,o.fontWeight,o.fontSize+"/"+o.lineHeight,o.fontFamily||"Arial"].join(" "),t.fillStyle=o.color,t.fillText(e.name,e.x,e.y))}))}))},redraw:function(){this.shapes=this.layout.subgroup(),this.draw()},animateTo:function(t,e){this.draw(e)},drawShape:function(t,e,n){var r=(n.dataLabels||{}).style||{};t.save(),t.beginPath(),t.fillStyle=e.color,"circle"===e.type?t.arc(e.x,e.y,e.radius,0,2*Math.PI,!0):"arc"===e.type&&i(t,e.path),t.fill(),t!==this.context&&this.shapes.forEach((function(e){e.shapes.forEach((function(e){"circle"===e.type&&(t.font=["normal",r.fontWeight||"normal",r.fontSize,r.fontFamily||"Arial"].join(" "),t.fillStyle=r.color,t.fillText(e.name,e.x,e.y))}))})),t.restore()},getShape:function(t,e){var n,r,a,o=this.shapes,s=-1,l=this.context,h=[];t*=P,e*=P;for(var u=0;u<o.length;u++){s=-1,(n=(a=o[u]).shapes).sort((function(t,e){return e.deep-t.deep}));for(var c=0;c<n.length;c++)if(r=n[c],l.beginPath(),"circle"===r.type?l.arc(r.x,r.y,r.radius,0,Y,!0):"arc"===r.type&&i(l,r.path),l.isPointInPath(t,e)){r.$value=r.value,h.push({shape:r,series:a}),s=c;break}if(-1!==s){var d=n[n.length-1];n[n.length-1]=r=n[s],n[s]=d}else f(n)}return h}},d.Layout=function(t,e,n){this.series=e,this.shapes=[],this.type=t,this.options=n,this.init()},d.Layout.prototype={init:function(){this.shapes=this.subgroup()},subgroup:function(){var t=this.options,e=this.type,n=this.series;return t.panel.forEach((function(n){k(n.series,(function(t){return t.type===e&&!1!==t.selected})).forEach((function(e){var n=a("number",e.plotY,0),i=a("number",e.plotHeight,0),r=a("number",e.plotWidth,0),o=new c(e.data),l=e.size,h=e.x,u=e.y;s(l)&&(r=l,i=l),o.scale(r,i),!s(h)&&(h=(r-o.width)/2),!s(u)&&(u=n+(i-o.height)/2),o.translate(h,u),e.shapes=o.shapes(e,t),f(e.shapes)}))})),n}},(e.graphers=e.graphers||{}).venn=e.Venn=d}("undefined"!=typeof window&&window,e.Chart),function(t,e){var h=M.filter,u=M.fill,c=function(t){var e=function(t,e,n,i){return function(r){return L(r,t,e,n,i)}};function n(t){var n=t.interpolate;return function(t,h){var u=function(t,e,n){var i,r,a,l;return a=function(t){var e=t;return o(t)?e=[t.x,t.y,t.value,t.color]:s(t)&&(e=[t]),e}(t.source),i=a[0],r=a[1],l=a[2],{x:i=e(i),y:r=n(r),value:l}},c=function(t,e,n,i,a){var o=e.tickWidth,s=e.tickHeight,l=u(t,n,i),h=l.y,c=l.value;l=l.x,r(t,{x0:l,y0:h,x1:l+o,y1:h+s,width:o,height:s,color:a(c,e.minValue,e.maxValue)})};h.panel.forEach((function(h){var f=k(h.series,(function(e){return e.type===t}));T(f,(function(t,e){return null!==t.radius&&null!==e.radius})).forEach((function(t){t.forEach((function(t){var h,f=a("number",t.plotX,0),d=a("number",t.plotY,0),p=a("number",t.plotWidth,0),g=a("number",t.plotHeight,0),y=t.coordinate,x=t.shapes,v=t._xAxis||{},b=t._yAxis||{},w=b.maxValue,M=b.minValue,A=a("number",v.plot.x[0],M,0),S=a("number",v.plot.x[1],w,0),L=a("number",b.plot.y[0],M,0),k=a("number",b.plot.y[1],w,0),E=(t._colorAxis||{}).stops||[[0,"#313695"],[1,"#a50026"]],T=[],C=[];l(E)&&(E.forEach((function(t){T.push(t[0]),C.push(t[1])})),h=m.lerp(T,C,m.interpolate));var F=p/(S-A+1),W=g/(k-L+1);x.forEach((function(x,m){i(y)||o(x.source)?function(t,e,n,i,a){var o=e.radius,s=u(t,n,i),l=s.y,h=s.value;s=s.x,r(t,{x0:s-o/2,y0:l-o/2,x1:s+o,y1:l+o,width:o,height:o,blur:e.blur,alpha:a(h,e.minValue,e.maxValue)})}(x,{minValue:t.minValue,maxValue:t.maxValue,radius:a("number",x.radius,t.radius,.1),blur:a("number",t.blur,.05)},(function(t){return e(v.minValue,v.maxValue,0,p)(t)+f}),(function(t){return e(b.minValue,b.maxValue,0,g)(t)+d}),(function(t,e,n){return Math.max((t-e)/(n-e),.01)||0})):l(x.source)?c(x,{minValue:b.plot.value[0],maxValue:b.plot.value[1],tickWidth:F,tickHeight:W},(function(t){return e(A,S+1,0,p)(t)+f}),(function(t){return e(L-1,k,g,0)(t)+d}),(function(t,e,i){return h&&s(t)?h(n(t,e,i,0,1)):"#000"})):(S=a("number",v.categories&&v.categories.length,6),k=a("number",b.categories&&b.categories.length,5),F=p/S,W=g/k,c(x,{minValue:b.plot.value[0],maxValue:b.plot.value[1],tickWidth:F,tickHeight:W},(function(){return e(0,S,0,p)(m%S)+f}),(function(){return e(-1,k-1,g,0)(m%k)+d}),(function(t,e,i){return h&&s(x.value)?h(n(x.value,e,i,0,1)):"#000"})))}))}))}))}))}}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return n.apply(t,[].concat(e))}}}.call("undefined"!=typeof window?window:this).deps(b),f={gradient:function(t){var e,r,a=n.createElement("canvas"),o=a.getContext("2d");if(a.width=256,a.height=1,i(t))if(m.isColor(t))e=t;else if(i(r=t.linearGradient)){var s=0|r.x1,l=0|r.y1,h=0|r.x2,u=0|r.y2;e=o.createLinearGradient(s,l,h,u),t.stops.forEach((function(t){e.addColorStop(t[0],t[1])}))}return o.fillStyle=e,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data},node:function(t,i){var r=n.createElement("canvas"),a=r.getContext("2d");if(e.scale(a,t,t,P),1==i)a.fillStyle="rgba(0,0,0,1)",a.beginPath(),a.arc(t/2,t/2,t/2,0,2*Math.PI,!0),a.closePath(),a.fill();else{var o=a.createRadialGradient(t/2,t/2,t/2*i,t/2,t/2,t/2);o.addColorStop(0,"rgba(0,0,0,1)"),o.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=o,a.fillRect(0,0,t,t)}return r},shadow:function(t,i,r,a){var o=n.createElement("canvas"),s=o.getContext("2d"),l={};return e.scale(s,r,a,P),t.forEach((function(t){var e,n=t.x0,r=t.y0,a=t.radius||i.radius||.1,o=i.blur||.05;e=l[a]?l[a]:l[a]=f.node(a,o),s.globalAlpha=t.alpha,s.drawImage(e,n,r,e.width/P,e.height/P)})),o},buffer:function(t,e){for(var n=t.getContext("2d"),i=f.gradient(e.fillColor),r=n.getImageData(0,0,t.width,t.height),a=r.data,o=a.length,s=3;s<o;s+=4){var l=a[s],h=l<<2;if(h){var u,c=i[h],d=i[h+1],p=i[h+2];u=Math.min(255,Math.max(l,0)),a[s]=u,a[s-1]=p,a[s-2]=d,a[s-3]=c}}return n.putImageData(r,0,0),t}};function d(t,e){this.type="heatmap",this.canvas=t,this.context=t.getContext("2d"),this.series=[],this.init(e)}d.prototype={constructor:d,init:function(t){var e=this.type;this.options=r({},t),this.series=h(a("array",t.series,[]),(function(t){return!1!==t.selected&&t.type===e})),this.tables=new Array(u(Math.ceil(t.chart.width),[])),c(e,this.options)},draw:function(){var t=this.context,e=this,n=this.options,r=n.chart.width,a=n.chart.height,s=n.chart.spacing[3],l=n.chart.spacing[0];this.series.forEach((function(n){var h=n.shapes;if(i(n.coordinate)||o(h[0].source)){var u=f.buffer(f.shadow(h,n,r+s,a+l),n);t.save(),t.drawImage(u,0,0,u.width/P,u.height/P),t.restore()}else h.forEach((function(i){e.drawShape(t,i,n)})),h.forEach((function(i){e.dataLabels(t,i,n)}))}))},redraw:function(){c(this.type,this.options),this.draw()},drawShape:function(t,e,n){var r=e.x0,a=e.y0,h=e.x1,u=e.y1,c=function(e,n){t.beginPath(),t.lineWidth=e,t.strokeStyle=n,t.moveTo(r+e/2,a),t.lineTo(r+e/2,u-e/2),t.lineTo(h-e/2,u-e/2),t.lineTo(h-e/2,a+e/2),t.lineTo(r+e/2,a+e/2),t.stroke()};if(null!==e.value){var f=e.color;if(o(f)&&i(f.stops)&&l(f.stops)){var d=t.createLinearGradient(Math.abs(h-r),u,Math.abs(h-r),a);f.stops.forEach((function(t){s(t[0])&&"string"==typeof t[1]&&d.addColorStop(t[0],t[1])})),f=d}t.save(),t.fillStyle=f,t.beginPath(),t.moveTo(r,a),t.lineTo(r,u),t.lineTo(h,u),t.lineTo(h,a),t.lineTo(r,a),t.fill(),i(e.current)&&c(n.borderWidth||1,n.borderColor),i(n.borderWidth)&&n.borderWidth>0&&c(n.borderWidth,n.borderColor),t.restore()}},dataLabels:function(t,e,n){I.align((function(t,n){var i=a("string",t,"center"),r=n.width,o=Math.abs(e.x1-e.x0);return{left:e.x0,center:e.x0+o/2-r/2,right:e.x1-r}[i]})).vertical((function(t,n){var i=a("string",t,"middle"),r=n.height,o=Math.abs(e.y1-e.y0);return{top:e.y0+r,middle:e.y0+r+(o-r)/2,bottom:e.y1}[i]})).call(e,n,t)},getShape:function(t,e){var n,r,a,o,l=this.series,h=l.length,u=[];function c(t){t.forEach((function(t){delete t.current}))}if(i(this.tables[t])&&i(this.tables[t][e]))return this.tables[t][e];for(var f=0;f<h;f++){c(r=(o=l[f]).shapes),n=r.length;for(var d=0;d<n;d++)if(null!==(a=r[d]).value&&y.rect({x:t,y:e},{x:a.x0,y:a.y0,width:a.x1,height:a.y1}))return a.current=d,s(a._x)&&s(a._y)?a.$value=a._x+", "+a._y+", "+a.value:a.$value=a.value,u.push({shape:a,series:o}),i(this.tables[t])&&(this.tables[t][e]=u),u}return u}},(e.graphers=e.graphers||{}).heatmap=e.Heatmap=d}("undefined"!=typeof window&&window,e.Chart),function(t,e){var n,o,l=(n=function(t,e,n){for(var i=-1,r=t.length;++i<r&&!n(t[i],e););return i<r?t[i]:null},o=function(t,e){return t.name===e},function(t,e,i){var r=[];return i=i||o,e.forEach((function(e){var a=n(t,e.source,i),o=n(t,e.target,i);null!==a&&null!==o&&r.push({source:a,target:o,link:e})})),r}),h={dount:function(t,e,n,i){var r=Math.min(n,i);return function(n){n.beginPath(),n.arc(t,e+r/2,r,0,Y,!0),n.arc(t,e+r/2,.4*r,0,Y,!1)}},square:function(t,e,n,i,r){return function(r){r.beginPath(),r.moveTo(t+6,e),r.lineTo(t+n-6,e),r.bezierCurveTo(t+n,e,t+n,e,t+n,e+6),r.lineTo(t+n,e+i-6),r.bezierCurveTo(t+n,e+i,t+n,e+i,t+n-6,e+i),r.lineTo(t+6,e+i),r.bezierCurveTo(t,e+i,t,e+i,t,e+i-6),r.lineTo(t,e+6),r.bezierCurveTo(t,e,t,e,t+6,e)}},triangle:function(t,e,n,i){return function(r){r.beginPath(),r.moveTo(t,e+i/2),r.lineTo(t+n/2,e-i/2),r.lineTo(t+n,e+i/2),r.lineTo(t,e+i/2)}},circle:function(t,e,n,i){return function(i){i.beginPath(),i.arc(t+n/2,e+n/2,n/2,0,Y),i.closePath()}},hexagon:function(t,e,n,i){var r=Math.max(n,i);return function(n){var i,a=-1,o=Math.sin,s=Math.cos;for(r/=2,n.beginPath(),n.moveTo(t+s(0)*r+r,e+o(0)*r+r);++a<6;)n.lineTo(t+s(i=a/6*Y)*r+r,e+o(i)*r+r);n.closePath()}},path:function(t,n,i,r,a){var o=this,s=e.arc;return function(e){var i,r,l,h,u=(o=o.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2")).split(/[\s+]/g),c=u.length,f=0;for(e.save(),e.translate(t,n+a/2),e.beginPath();f<c;f++)switch(u[f]){case"M":e.moveTo(i=l=+u[++f],r=h=+u[++f]);break;case"L":e.lineTo(i=+u[++f],r=+u[++f]);break;case"A":s(e,i,r,[+u[++f],+u[++f],+u[++f],+u[++f],+u[++f],i=+u[++f],r=+u[++f]]);break;case"Z":i=l,r=h,f++,e.closePath()}e.restore()}}},u=function(t,e,n){if(!t||!e)return null;n=(n||1)-1;for(var i,r,a,o,s,l,h=.5,u=t.x,c=t.y,f=t.width,d=t.height,p=e.x,g=e.y,y=e.width,x=e.height,v=[{x:u+f*h,y:c-n},{x:u+f*h,y:c+d+n},{x:u-n,y:c+d*h},{x:u+f+n,y:c+d*h},{x:p+y*h,y:g-n},{x:p+y*h,y:g-n},{x:p-n,y:g+x*h},{x:p+y+n,y:g+x*h}],m=[],b=[],w={},M=0;M<4;M++)for(var A=4;A<8;A++){M===A-4|(3!==M&&6!==A||v[M].x<v[A].x)&(2!==M&&7!==A||v[M].x>v[A].x)&(1!==M&&4!==A||v[M].y<v[A].y)&(0!==M&&5!==A||v[M].y>v[A].y)&&(w[m[m.push((i=Math.abs(v[M].x-v[A].x))+(r=Math.abs(v[M].y-v[A].y)))-1]]=[M,A])}return a=v[(b=0===m.length?[0,4]:w[Math.min.apply(Math,m)])[0]].x,o=v[b[0]].y,s=v[b[1]].x,l=v[b[1]].y,i=Math.max(Math.abs(s-a)/2,n),r=Math.max(Math.abs(l-o)/2,n),{x1:a,y1:o,x2:[a,a,a-i,a+i][b[0]],y2:[o-r,o+r,o,o][b[0]],x3:[0,0,0,0,s,s,s-i,s+i][b[1]],y3:[0,0,0,0,o+r,o-r,l,l][b[1]],x4:s,y4:l}};function c(t){this.canvas=t,this.context=t.getContext("2d"),this.series=[]}function f(t,e){c.call(this,t),this.type="node",this.init(e)}function d(t,e){e.panel.forEach((function(e){k(e.series,(function(e){return e.type===t})).forEach((function(t){a("number",t.plotX,0),a("number",t.plotY,0);var e=a("number",t.plotWidth),n=a("number",t.plotHeight);t.shapes.forEach((function(i){var o=i._x,l=i._y,h=a("string",i.symbol,t.symbol,"square"),u=a("number",i.radius,t.radius,50),c=a("number",i.width,t.width,u),f=a("number",i.height,t.height,20);!s(o)&&(o=Math.random()*e),!s(l)&&(l=Math.random()*n),"hexagon"!==h&&"circle"!==h||(c=f=2*u),!1===t.selected&&(c=f=u=0),r(i,{radius:u,width:c,height:f,symbol:h,name:i.name||t.name,x:o,y:l})}))}))}))}c.prototype={},f.prototype={constructor:f,init:function(t){var e=this.type;this.options=r({},t),this.series=k(a("array",t.series,[]),(function(t){return t.type===e})),d(e,this.options)},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){var i=n.shapes;!1!==n.selected&&(i.forEach((function(t){t.sourceLinks=[],t.targetLinks=[]})),(a("array",n.links,[]).length>0&&l(i,n.links,(function(t,e){return t.name===e}))||[]).forEach((function(i){i.source.sourceLinks.push(i),i.target.targetLinks.push(i),u(i.source,i.target)&&e.drawLink(t,i,n)})));i.forEach((function(i){e.drawShape(t,i,n)})),!1!==n.selected&&i.forEach((function(i){e.drawLabels(t,i,n)}))}))},redraw:function(){d(this.type,this.options),this.draw()},drawShape:function(t,e,n){var r=a("number",e.borderWidth,n.borderWidth,0),o=e.borderColor||n.borderColor,l=e.color||n.fillColor,u=a("string",e.symbol,"square"),c=e.radius,f=e.width,d=e.height,p=e.x,g=e.y,y=z(p,g,f,d,r);s(e.current)&&e.current>-1&&((l=m.parse(l)).a=.8*l.a,l=m.rgba(l)),i(e.hover)&&e.hover,t.save(),t.fillStyle=l,(i(e.path)?h.path:h[u]?h[u]:h.square).apply(e.path,[y.x,y.y,y.width,y.height,c])(t),t.fill(),r>0&&(t.lineWidth=r,t.strokeStyle=o,t.stroke()),t.restore()},drawLabels:function(t,e,n){I.value(e.name).align((function(t,n){var i=e.x,r=n.width,o=e.width;return{left:i-r,center:i+(o-r)/2,right:i+o}[a("string",t,"center")]})).vertical((function(t,n){var i=a("string",t,"middle"),r=e.y,o=n.height,s=e.height;return{top:r,middle:r+o+(s-o)/2,bottom:r+o+s}[i]})).call(e,n,t)},drawLink:function(t,e,n){var r,o=e.source,s=e.target,l=e.link,h=this.options,c=a("object",a("object",h.plotOptions,{}).node,{}),f=a("object",c.dataLabels.style,{}),d=a("number",l.lineWidth,n.lineWidth),p=l.lineColor||n.lineColor||"#000",g={fontStyle:a("string",f.fontStyle,"normal"),fontSize:a("string",f.fontSize,"12px"),fontWeight:a("string",f.fontWeight,"normal"),fontFamily:a("string",f.fontFamily,"Arial"),color:l.color||"#000"},y=l.value,x=m.parse(p),b=u(o,s);if(x.a=.5,t.save(),b&&((r=t.createLinearGradient(b.x1,b.y1,b.x4,b.y4)).addColorStop(0,p),r.addColorStop(1,m.rgba(x)),p=r,!0===o._selected&&(x.a=.1,p=m.rgba(x)),t.beginPath(),t.moveTo(b.x1,b.y1),t.bezierCurveTo(b.x2,b.y2,b.x3,b.y3,b.x4,b.y4),(t.lineWidth=d)>0&&(t.strokeStyle=p,t.stroke())),i(y)&&b){var w=v.measureText(y,g),M=b.x4+5,A=b.y4-d;b.x1<b.x4&&(M=b.x4-w.width-5),t.font=[g.fontStyle,g.fontWeight,g.fontSize,g.fontFamily].join(" "),t.fillStyle=g.color,t.fillText(y,M,A)}t.restore()},getShape:function(t,e){var n,i,r,a,o,s,l=this.series.length,h=!1,u=[];for(a=0;a<l;a++)for(o=0,r=(n=this.series[a]).shapes.length;o<r;o++)if("square"===(s=(i=n.shapes[o]).symbol)?h=y.rect({x:t,y:e},{x:i.x,y:i.y,width:i.x+i.width,height:i.y+i.height}):"circle"===s||"dount"===s?h=y.distance({x:t,y:e},{x:i.x+i.radius,y:i.y+i.radius})<=i.radius:"triangle"!==s&&"hexagon"!==s||(h=y.polygon({x:t,y:e},[])),delete i.current,h){i.current=o,u.push({series:n,shape:i});break}return this.onSelected(u),u},onSelected:function(t){function e(t,e){var i=[];return"source"!=(e=e||"both")&&"both"!=e||(i=i.concat(n(t.source,"source"))),"target"!=e&&"both"!=e||(i=i.concat(n(t.target,"target"))),i}function n(t,n){var i=[];return("source"==(n=n||"both")&&t.sourceLinks.length<2||"both"==n)&&t.targetLinks.forEach((function(t){i=i.concat(e(t,n))})),("target"==n&&t.targetLinks.length<2||"both"==n)&&t.sourceLinks.forEach((function(t){i=i.concat(e(t,n))})),i}this.series.forEach((function(e){e.shapes.forEach((function(e){e._selected=!!t.length}))})),t.length&&t.forEach((function(t){var e=[t.shape];e.forEach((function(t){(function(t,e){return n(t,e)})(t).forEach((function(t){e.push(t)}))})),e.forEach((function(t){t._selected=!1}))}))},onStart:function(){this.series.forEach((function(t){t.shapes.forEach((function(t){t._x=t.x,t._y=t.y}))}))},onDrag:function(t,e){this.series.forEach((function(n){n.shapes.forEach((function(n){n.x=n._x+t,n.y=n._y+e}))}))}};var p,g,x=e.graphers=e.graphers||{};for(g in p||(p={Node:f}))x[g.toLowerCase()]=e[g]=p[g]}("undefined"!=typeof window&&window,e.Chart),function(t,i){var h=function(t){function e(){return{shapes:function(t,e){e.panel.forEach((function(e){k(e.series,(function(e){return e.type===t})).forEach((function(t){var e,n,i,s,h,u,c,f,d,p,g,y,x,v,b=a("number",t.plotX,0),w=a("number",t.plotY,0),M=a("number",t.plotWidth),A=a("number",t.plotHeight),S=t.shapes,k=S.length,E=M/k,T=E/2,C=(E-T)/2,F=t._yAxis||{},W=F.minValue,_=F.maxValue;for(n=0;n<k;n++)i=(e=S[n]).color,f=(u=(s=b+n*E+C)+T)-T/2,l(e.source)?(g=e.source[0],y=e.source[1],x=e.source[2],v=e.source[3]):o(e.source)?(g=e.source.open,y=e.source.close,x=e.source.high,v=e.source.low):g=y=x=v=0,h=L(g,W,_,A,0)+w,c=L(y,W,_,A,0)+w,d=L(x,W,_,A,0)+w,p=L(v,W,_,A,0)+w,!1===t.selected&&(h=c=d=p=-9999),r(e,{x:s,y:h,x1:u,y1:c,x2:f,y2:d,x3:f,y3:p,index:n,color:m.isColor(i)?i:g>y?i[0]:i[1]})}))}))}}}return{deps:function(){var n=Array.prototype.slice.call(arguments,0);return e.apply(t,[].concat(n))}}}.call("undefined"!=typeof window?window:this).deps(e),u=function(t,e,n){return!(t<a("number",n.plotX,0)||t>n.plotWidth+a("number",n.plotX,0)||e<a("number",n.plotY,0)||e>n.plotHeight+a("number",n.plotY,0))};function c(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="candlestick",this.series=[],this.init(e)}c.prototype={constructor:c,init:function(t){var e=this.canvas,o=this.type,s=this;this.options=r({},t),this.series=k(a("array",t.series,[]),(function(t){var e=t.type===o;return e&&(t._diffValues=M.diff(t.shapes,t._shapes||[],(function(t,e){return t&&e&&t.open===e.open&&t.close===e.close&&t.low===e.low&&t.high===e.high})),e)})),h.shapes(o,t),1===e.nodeType&&this.series.forEach((function(t){if(t.animationEnabled){var r=n.createElement("canvas"),o=r.getContext("2d");i.scale(o,a("number",t.plotWidth+t.plotX,e.width),a("number",t.plotHeight+t.plotY,e.height),P),t._image=r,t.shapes.forEach((function(e){s.drawShape(o,e,t)}))}}))},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){n.shapes.forEach((function(i){e.drawShape(t,i,n)}))}))},redraw:function(){h.shapes(this.type,this.options),this.draw()},drawShape:function(t,e,n){var i,r,o=e.x,l=e.y,h=e.x1,u=e.y1,c=e.y2,f=e.y3,d=Math.round(e.x1-e.x),p=a("number",e.lineWidth,n.lineWidth,1),g=e.fillColor||n.fillColor||e.color||n.color,y=e.color||n.color,x=e.lineColor||n.lineColor,v=u>l;i=o+d/2,s(e.current)&&e.current>-1&&(p=Math.max(1,2*Math.min(p,1))),delete e.current,o=(r=H(o,l,h,u,p))[0],l=r[1],h=r[2],u=r[3],i=H(i,p||1)[0];var b=function(e,n){(t.lineWidth=e)>0&&(t.strokeStyle=m.isColor(n)?n:v?n[0]:n[1],t.stroke())};!1===n.selected||p||l!==u||(u+=1),t.save(),t.beginPath(),t.moveTo(o,l),t.lineTo(o,u),t.lineTo(o+d,u),t.lineTo(o+d,l),t.lineTo(o,l),t.fillStyle=g,t.fill(),b(p,y),t.beginPath(),t.moveTo(i,v?l:u),t.lineTo(i,c),b(p||1,x),t.beginPath(),t.moveTo(i,v?u:l),t.lineTo(i,f),b(p||1,x),t.restore()},animateTo:function(t,e){var n=[];return this.series.forEach((function(t){var i=t.shapes,r=t._shapes||[],a=[];if(!0===e){var o=t;n.push([t,function(t){o._timer=t}]),a.push(o)}else t._diffValues.add((function(){return null})).remove((function(t){var e,r=i[t];return e={color:r.color,isNULL:r.isNULL},n.push([r,function(t){e.x=r.x,e.y=r.y,e.x1=r.x1,e.x2=r.x2,e.y2=r.y2,e.y3=r.y3,e.y1=r.y+(r.y1-r.y)*t}]),e})).modify((function(e,a){var o,s=i[e],l=r[a],h=t.action;return s&&l&&(o={x:l.x,y:l.y,x1:l.x1,y1:l.y1,y2:l.y2,y3:l.y3,color:s.color,isNULL:s.isNULL},n.push([s,function(e){var n;"click"===h?!1!==t.selected?(n=s.y+(s.y1-s.y)*e,o.x=s.x,o.y=s.y,o.x1=s.x1,o.x2=s.x2,o.y2=s.y2,o.y3=s.y3,o.y1=n):(n=l.y1+(l.y-l.y1)*e,o.x=l.x,o.y=l.y,o.x1=l.x1,o.x2=l.x2,o.y2=l.y2,o.y3=l.y3,o.y1=n):(o.x=l.x+(s.x-l.x)*e,o.y=l.y+(s.y-l.y)*e,o.x1=l.x1+(s.x1-l.x1)*e,o.y1=l.y1+(s.y1-l.y1)*e,o.y2=l.y2+(s.y2-l.y2)*e,o.y3=l.y3+(s.y3-l.y3)*e)}])),o})).each((function(t){t&&a.push(t)}));t._shapes=t.shapes,t._animators=a})),n},onFrame:function(t,e){var n=this;this.series.forEach((function(i){var r=i._animators;!0===e?r.forEach((function(e){e._image&&function(t,e,n,i,r){0!==t&&(e.save(),t>0&&e.drawImage(n,i,r,n.width*t,n.height,i,r,n.width*t/P,n.height/P),e.restore())}(e._timer,t,e._image,0,0)})):r.forEach((function(e){n.drawShape(t,e,i)}))}))},getShape:function(t,e){for(var n,i,r,a,o=this.series.length,s=0,l=function(t){t.forEach((function(t){delete t.current}))},h=[];s<o&&!1!==(n=this.series[s]).selected;s++){if(!u(t,e,n))return h;l(i=n.shapes),r=(a=A(i)).nearest({x:t,y:e},(function(t,e){var n=t.x-e.x;return n*n}))[0],a.destroy(),r&&!r.isNULL&&(r.current=r.index,h.push({shape:r,series:n}))}return h}},(i.graphers=i.graphers||{}).candlestick=c}("undefined"!=typeof window&&window,e.Chart),function(t,o){var l=function(t){var e=function(t,e,n){return t*(1-n)+e*n},n=function(t,n,i,r){var a=t,o=n;return[a,i,e(a,o,.5),i,e(a,o,.5),r,o,r]},o=function(t,e){for(var n=-1,i=t.length;++n<i&&t[n]!==e;);return n<i?n:-1},l=function(){var t={},e=NaN,n=.001,r=1e3,s=8,l=[1,1],h=[1,1],u=[],f=[],d=0,p=0;return t.data=function(e){(e||[]).forEach((function(t,e){var n=t.source;void 0!==n&&u.push({name:n,data:t}),f.push({source:t.source,target:t.target,value:+t.value,weight:t.weight,index:e})})),e.forEach((function(t){var e=t.target;void 0!==e&&u.push({name:e,data:t})}));var n=[];return u=function(t){for(var e,n=t.length,i=-1,r=[],a={};++i<n;)(e=t[i]).data.source in a||(a[e.data.source]=1,r.push(e));return r}(u).map((function(t){return n.push(t.name),t.data})),e.forEach((function(t,e){t.empty?(f[e].target=f[e].source=o(n,t.source),f[e].empty=!0):(f[e].source=o(n,t.source),f[e].target=o(n,t.target))})),u.forEach((function(t){t.sourceLinks=[],t.targetLinks=[]})),f.forEach((function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=u[t.source]),"number"==typeof n&&(n=t.target=u[t.target]),e&&n&&(e.sourceLinks.push(t),n.targetLinks.push(t))})),t},t.nodeWidth=function(n){return arguments.length?(c(n)&&(e=n),t):e},t.minWidth=function(e){return arguments.length?(c(e)&&(n=e),t):n},t.maxWidth=function(e){return arguments.length?(c(e)&&(r=e),t):r},t.nodePadding=function(e){return arguments.length?(s=+e,t):s},t.nodeSpacing=function(e){return e?(l=e,t):l},t.nodes=function(e){return arguments.length?(u=e,t):u},t.links=function(e){return arguments.length?(f=e,t):f},t.size=function(e){return arguments.length?(h=e,t):h},t.translate=function(e,n){return arguments.length?(d=e,p=n,t):[d,p]},t.layout=function(o){var s,c,f,g,y,x,v;return"none"===o&&(s=h[0],c=h[1],f=function(t){var e=0;return t.forEach((function(t){e=Math.max(e,function(t,e){for(var n=t.length,i=1&n,r=i?t[0][e]:0;i<n;)r+=t[i++][e]+t[--n][e];return r}(t,"value"))})),e},g=function(t,e,n){t.forEach((function(t){t.y+=(e-n)/2+p,t.x+=d}))},y=T(u,(function(t,e){return t.group===e.group})),x=y.length,v=f(y),y.forEach((function(t,o){var h=0;t.forEach((function(u){var f=o*(s/x),d=0;i(u.value)&&(d=L(u.value,0,v,0,c-l[1]*~-t.length)),u.x=f,u.y=h,u.width=Math.max(n,Math.min(r,a("number",e))),u.dy=d,h+=d+l[1]})),g(t,c,h-l[1])})),u.forEach((function(t){var e,n=t.sourceLinks,i=t.targetLinks,r=0,a=0,o=0,s=0;t.sourceLinks.forEach((function(t){o+=t.weight})),t.targetLinks.forEach((function(t){s+=t.weight})),t.linkArgs=[],t.sourceLinks.forEach((function(i){e=i.weight?t.dy*(i.weight/o):t.dy/n.length,i.sy=r,i.sy0=e+i.sy,i.x=t.x,i.y=t.y+r,i.dx=t.width,i.dy=i.sy0,r+=e})),t.targetLinks.forEach((function(n){e=n.weight?t.dy*(n.weight/s):t.dy/i.length,n.ty=a,n.ty0=e+n.ty,n.x=t.x,n.y=t.y+a,n.dx=t.width,n.dy=n.ty0,a+=e}))}))),t},t};function h(t){var o=b.percentage,h=function(t,n,i,r){var a=Math.abs(r-i)/4,o=t,s=n;return[o,i,e(o+a,s+a,.5),i,e(o+a,s+a,.5),r,s,r]};return function(t,e){e.panel.forEach((function(e){k(e.series,(function(e){return e.type===t})).forEach((function(t){var e,u,c,f,d,p,g,y=t.point&&(d=t.point.minWidth,p=t.point.maxWidth,t.point.width),x=function(t,e){var n=t.size,r=t.plotX,o=t.plotY,s=a("number",n,n&&n[0],t.plotWidth),l=a("number",n&&n[1],t.plotHeight),h=(e||{}).scale,u=(e||{}).translate;return i(u)&&(r+=u[0],o+=u[1]),i(h)&&1!==h&&(s*=h=Math.max(a("number",h,1),1e-5),l*=h,r+=(t.plotWidth-s)/2,o+=(t.plotHeight-l)/2),{x:r,y:o,width:s,height:l}}(t,t.transform);e=a("number",x.x,0),u=a("number",x.y,0),c=a("number",x.width),f=a("number",x.height),s(g=o(c,d))&&(d=g),s(g=o(c,p))&&(p=g),s(g=o(c,y))&&(y=g);var v=t.shapes,m=t.nodes=[],b=l().nodeWidth(y).minWidth(d>p?p:d).maxWidth(d>p?d:p).nodeSpacing([15,20]).translate(e,u).size([c,f]);b.data(v).layout("none"),b.links().forEach((function(t){t.target&&t.source&&(t.empty?t.source.linkArgs.push({from:n(t.source.x+t.target.width,t.target.x+t.target.width+15,t.source.y+t.sy,t.source.y+t.sy0),to:n(t.target.x+t.target.width+15,t.source.x+t.source.width,t.target.y+t.ty0+2,t.source.y+t.sy0),empty:!0,source:t.source,target:t.target,weight:t.weight,index:t.index,size:t.dy}):t.source.group===t.target.group?t.source.linkArgs.push({from:h(t.source.x+t.target.width,t.target.x+t.target.width,t.source.y+t.sy,t.target.y+t.ty),to:h(t.target.x+t.target.width,t.source.x+t.source.width,t.target.y+t.ty0,t.source.y+t.dy),source:t.source,target:t.target,weight:t.weight,index:t.index,size:t.dy}):t.source.group<t.target.group?t.source.linkArgs.push({from:n(t.source.x+t.source.width,t.target.x,t.source.y+t.sy,t.y),to:n(t.target.x,t.source.x+t.source.width,t.target.y+t.dy,t.source.y+t.sy0),source:t.source,target:t.target,weight:t.weight,index:t.index,size:t.dy}):t.source.linkArgs.push({from:n(t.source.x,t.target.x+t.target.width,t.source.y+t.sy,t.target.y+t.ty),to:n(t.target.x+t.target.width,t.source.x,t.target.y+t.ty0,t.source.y+t.sy0),source:t.source,target:t.target,weight:t.weight,index:t.index,size:t.dy}))})),b.nodes().forEach((function(t,e){m.push(r(t,{name:t.source,key:null,index:e,x:t.x,y:t.y,width:t.width,height:t.dy}))}))}))}))}}return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return h.apply(t,[].concat(e))}}}.call("undefined"!=typeof window?window:this).deps(e.Numeric),h=function(t,e,n){var i=[];return t.forEach((function(t,r){var a=e[r];i.push(t*(1-n)+a*n)})),i},f=function(t,e,n,i,r,a){var o=a.linearGradient,l=o.x1,h=o.y1,u=o.x2,c=o.y2,f=a.stops||[],d=l^u,p=!(h^c),g=t.createLinearGradient(e+i*d,n+r*p,e+i*d,n+r*!p);return f.forEach((function(t){s(t[0])&&"string"==typeof t[1]&&g.addColorStop(t[0],t[1])})),g};function d(t,e){this.canvas=t,this.context=t.getContext("2d"),this.type="sankey",this.series=[],this.init(e)}d.prototype={constructor:d,init:function(t){var e=this.canvas,i=this.type,s=this;this.actived={},this.options=r({},t),this.series=k(a("array",t.series,[]),(function(t){return t.type===i})),l(i,t),1===e.nodeType&&this.series.forEach((function(t){if(t.animationEnabled){var i=n.createElement("canvas"),r=i.getContext("2d"),l=t.shapes,h=[];o.scale(r,a("number",t.plotWidth+t.plotX,e.width),a("number",t.plotHeight+t.plotY,e.height),P),t._image=i,l.forEach((function(e){!0!==e.selected?s.drawLink(r,e,t):h.push(e)})),h.forEach((function(e){s.drawLink(r,e,t)})),l.forEach((function(e){s.drawShape(r,e,t)}))}}))},draw:function(){var t=this.context,e=this;this.series.forEach((function(n){var i=n.shapes,r=[];i.forEach((function(i){!0!==i.selected?e.drawLink(t,i,n):r.push(i)})),r.forEach((function(i){e.drawLink(t,i,n)})),e.actived.link&&e.drawPath(t,e.actived.link,n)})),this.series.forEach((function(n){n.nodes.forEach((function(i){e.drawShape(t,i,n)})),n.nodes.forEach((function(i){e.dataLabels(t,i,n)}))}))},redraw:function(){l(this.type,this.options),this.draw()},drawShape:function(t,e,n){var r,o=e.x,l=e.y,h=e.width,c=e.height,d=a("number",e.borderWidth,n.borderWidth,0),p=e.borderColor||n.borderColor,g=e.fillColor||n.fillColor||e.color||n.color,y=(n.states||{}).hover;u(y)&&(y=y.call(e,e,n)),i(y)||(y={}),r=y.color,i(g.linearGradient)&&s(h)&&s(c)&&(g=f(t,o,l,h,c,g)),e===this.actived.shape&&(i(r)?g=i(r.linearGradient)?f(t,o,l,h,c,r):r:((g=m.parse(g)).a=.75,g=m.rgba(g))),t.save(),t.beginPath(),t.moveTo(o,l),t.lineTo(o+h,l),t.lineTo(o+h,l+c),t.lineTo(o,l+c),t.closePath(),d>0&&(t.lineWidth=d,t.strokeStyle=p,t.stroke()),t.fillStyle=g,t.fill(),t.restore()},drawPath:function(t,e,n){var r,o=n.shapes[e.index]||{},s=o.lineColor||n.lineColor||"#eee",l=a("number",o.lineWidth,n.lineWidth),h=(n.states||{}).hover;u(h)&&(h=h.call(o,o,n)),i(h)||(h={}),r=h.lineColor;var c=e.from,f=e.to;e===this.actived.link&&(i(r)?s=r:((s=m.parse(s)).a=.55,s=m.rgba(s))),t.beginPath(),t.moveTo(c[0],c[1]),t.bezierCurveTo.apply(t,c.slice(2)),f&&(t.lineTo(f[0],f[1]),t.bezierCurveTo.apply(t,f.slice(2))),t.fillStyle=s,t.fill(),l>0||e.size<1&&(t.strokeStyle=s,t.stroke())},drawLink:function(t,e,n){var i=this;t.save(),(e.linkArgs||[]).forEach((function(e){i.drawPath(t,e,n)})),t.restore()},dataLabels:function(t,e,n){I.value(e.value).align((function(t,n){var i=e.x,r=n.width,o=e.width;return{left:i,center:i+(o-r)/2,right:i+o-r}[a("string",t,"center")]})).vertical((function(t,n){var i=e.y,r=n.height,o=e.height;return{top:i+r,middle:i+(o-r)/2,bottom:i+o}[a("string",t,"top")]})).call(e,n,t)},animateTo:function(t,e){var n=[];return this.series.forEach((function(t){var r=[];if(!0===e){var a=t;n.push([t,function(t){a._timer=t}]),r.push(a)}else i(t.transform)&&t.nodes.forEach((function(e,i){var a,o,s,l,u,c,f=t._nodes[i];f&&e&&(a={width:f.width,height:f.height,x:f.x,y:f.y,color:e.color,lineColor:e.lineColor,fillColor:e.fillColor,_value:e._value,selected:f.selected,text:e.text,source:e.source,value:e.value,linkArgs:f.linkArgs,shape:e},n.push([e,function(t){c=[],l=f.width+(e.width-f.width)*t,u=f.height+(e.height-f.height)*t,o=f.x+(e.x-f.x)*t,s=f.y+(e.y-f.y)*t,(f.linkArgs||[]).forEach((function(n,i){var r=e.linkArgs[i];r&&c.push({from:h(n.from,r.from,t),to:h(n.to,r.to,t),lineColor:n.lineColor,empty:n.empty,index:r.index})})),a.width=l,a.height=u,a.x=o,a.y=s,a.linkArgs=c}])),a&&r.push(a)}));t._shapes=t.shapes,t._nodes=t.nodes,t._animators=r})),n},onFrame:function(t,e){var n=this;this.series.forEach((function(i){var r=i._animators;!0===e?r.forEach((function(e){e._image&&function(t,e,n,i,r){0!==t&&(e.save(),t>0&&e.drawImage(n,i,r,n.width*t,n.height,i,r,n.width*t/P,n.height/P),e.restore())}(e._timer,t,e._image,0,0)})):(r.forEach((function(e){n.drawLink(t,e,i)})),r.forEach((function(e){n.drawShape(t,e,i),n.dataLabels(t,e,i)})))}))},onStart:function(){this.series.forEach((function(t){var e=t.transform;i(e)&&i(e.translate)&&(e._translate=e.translate)}))},onDrag:function(t,e){this.actived={},this.series.forEach((function(n){var r=n.transform||{},a=r._translate;i(a)&&(r.translate=[a[0]+t,a[1]+e])})),l(this.type,this.options)},getShape:function(t,e){for(var n,i,r,a,o,s,l=this.series.length,h=0,u=this.context,c=[];h<l&&!1!==(i=this.series[h]).selected;h++)for(o=i.nodes,delete this.actived.shape,n=0;n<o.length;n++)if(!(a=o[n]).isNULL&&y.rect({x:t,y:e},{x:a.x,y:a.y,width:a.x+a.width,height:a.y+a.height})){(s={shape:a,series:i}).shape.$value=""+a._value,s.shape.shape="node",c.push(s),this.actived.shape=a;break}for(h=0;h<l;h++){r=i.shapes,delete this.actived.link;t:for(n=0;n<r.length;n++)for(var f=(a=r[n]).linkArgs||[],d=0;d<f.length;d++){var p=f[d],g=p.from,x=p.to;if(u.beginPath(),u.moveTo(g[0],g[1]),u.bezierCurveTo.apply(u,g.slice(2)),x&&(u.lineTo(x[0],x[1]),u.bezierCurveTo.apply(u,x.slice(2))),u.closePath(),u.isPointInPath(t*P,e*P)){this.actived.link=p,s={shape:{shape:"line",$value:a._value,target:p.target,source:p.source,weight:p.weight,empty:p.empty,sourceLinks:a.sourceLinks,targetLinks:a.targetLinks,linkArgs:a.linkArgs,index:d},series:i},c.push(s);break t}}}return c}},(o.graphers=o.graphers||{}).sankey=d}("undefined"!=typeof window&&window,e.Chart),function(t){var e={"ease-in":function(t){return e.cubicBezier(.42,0,1,1,t)},"ease-out":function(t){return e.cubicBezier(0,0,.58,1,t)},"ease-in-out":function(t){return e.cubicBezier(.42,0,.58,1,t)},linear:function(t){return t},"ease-in-quad":function(t,e,n,i){return n*(t/=i)*t+e},"ease-out-quad":function(t,e,n,i){return-n*(t/=i)*(t-2)+e},"ease-in-out-quad":function(t,e,n,i){return(t/=i/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},"ease-in-cubic":function(t,e,n,i){return n*(t/=i)*t*t+e},"ease-out-cubic":function(t,e,n,i){return n*((t=t/i-1)*t*t+1)+e},"ease-in-out-cubic":function(t,e,n,i){return(t/=i/2)<1?n/2*t*t*t+e:n/2*((t-=2)*t*t+2)+e},"ease-in-quart":function(t,e,n,i){return n*(t/=i)*t*t*t+e},"ease-out-quart":function(t,e,n,i){return-n*((t=t/i-1)*t*t*t-1)+e},"ease-in-out-quart":function(t,e,n,i){return(t/=i/2)<1?n/2*t*t*t*t+e:-n/2*((t-=2)*t*t*t-2)+e},"ease-in-quint":function(t,e,n,i){return n*(t/=i)*t*t*t*t+e},"ease-out-quint":function(t,e,n,i){return n*((t=t/i-1)*t*t*t*t+1)+e},"ease-in-out-quint":function(t,e,n,i){return(t/=i/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},"ease-in-sine":function(t,e,n,i){return-n*Math.cos(t/i*(Math.PI/2))+n+e},"ease-out-sine":function(t,e,n,i){return n*Math.sin(t/i*(Math.PI/2))+e},"ease-in-out-sine":function(t,e,n,i){return-n/2*(Math.cos(Math.PI*t/i)-1)+e},"ease-in-expo":function(t,e,n,i){return 0===t?e:n*Math.pow(2,10*(t/i-1))+e},"ease-out-expo":function(t,e,n,i){return t===i?e+n:n*(1-Math.pow(2,-10*t/i))+e},"ease-in-out-expo":function(t,e,n,i){return 0===t?e:t==i?e+n:(t/=i/2)<1?n/2*Math.pow(2,10*(t-1))+e:n/2*(2-Math.pow(2,-10*--t))+e},"ease-in-circ":function(t,e,n,i){return-n*(Math.sqrt(1-(t/=i)*t)-1)+e},"ease-out-circ":function(t,e,n,i){return n*Math.sqrt(1-(t=t/i-1)*t)+e},"ease-in-out-circ":function(t,e,n,i){return(t/=i/2)<1?-n/2*(Math.sqrt(1-t*t)-1)+e:n/2*(Math.sqrt(1-(t-=2)*t)+1)+e},"ease-in-elastic":function(t,e,n,i,r,a){if(0===t)return e;if(1==(t/=i))return e+n;if(a||(a=.3*i),(r=r||0)<Math.abs(n)){r=n;var o=a/4}else o=a/(2*Math.PI)*Math.asin(n/r);return-r*Math.pow(2,10*(t-=1))*Math.sin((t*i-o)*(2*Math.PI)/a)+e},"ease-out-elastic":function(t,e,n,i,r,a){if(0===t)return e;if(1==(t/=i))return e+n;if(a||(a=.3*i),(r=r||0)<Math.abs(n)){r=n;var o=a/4}else o=a/(2*Math.PI)*Math.asin(n/r);return r*Math.pow(2,-10*t)*Math.sin((t*i-o)*(2*Math.PI)/a)+n+e},"ease-in-out-elastic":function(t,e,n,i,r,a){if(0===t)return e;if(2==(t/=i/2))return e+n;if(a||(a=i*(.3*1.5)),(r=r||0)<Math.abs(n)){r=n;var o=a/4}else o=a/(2*Math.PI)*Math.asin(n/r);return t<1?r*Math.pow(2,10*(t-=1))*Math.sin((t*i-o)*(2*Math.PI)/a)*-.5+e:r*Math.pow(2,-10*(t-=1))*Math.sin((t*i-o)*(2*Math.PI)/a)*.5+n+e},"ease-in-back":function(t,e,n,i,r){return void 0===r&&(r=1.70158),n*(t/=i)*t*((r+1)*t-r)+e},"ease-out-back":function(t,e,n,i,r){return void 0===r&&(r=1.70158),n*((t=t/i-1)*t*((r+1)*t+r)+1)+e},"ease-in-out-back":function(t,e,n,i,r){return void 0===r&&(r=1.70158),(t/=i/2)<1?n/2*(t*t*((1+(r*=1.525))*t-r))+e:n/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},"ease-in-bounce":function(t,n,i,r){return i-e["ease-out-bounce"](r-t,0,i,r)+n},"ease-out-bounce":function(t,e,n,i){return(t/=i)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},"ease-in-out-bounce":function(t,n,i,r){return t<r/2?.5*e["ease-in-bounce"](2*t,0,i,r)+n:.5*e["ease-out-bounce"](2*t-r,0,i,r)+.5*i+n},cubicBezier:function(t,e,n,i,r){var a,o=1-3*n+3*t-0,s=3*n-6*t+0,l=3*t-0,h=1-3*i+3*e-0,u=3*i-6*e+0,c=3*e-0,f=r;if(r<=0)return 0;for(a=0;a<5;a++)f=(f-=(o*f*f*f+s*f*f+l*f+0-r)*(1/(3*o*f*f+2*s*f+l)))>1?1:f<0?0:f;return Math.abs(h*f*f*f+u*f*f+c*f*0)}};return t&&t.call(this,e)}.call("undefined"!=typeof window?window:this,(function(t){Object.prototype.toString;var n=this.requestAnimationFrame||this.mozRequestAnimationFrame||this.webkitRequestAnimationFrame||this.msRequestAnimationFrame||this.oRequestAnimationFrame||function(t){return setTimeout(t,1e3/60)},i=(this.cancelAnimationFrame||this.webkitCancelAnimationFrame||this.mozCancelAnimationFrame||this.oCancelAnimationFrame,function(e){return"function"==typeof e?e:"string"==typeof e?~e.indexOf("cubic-bezier")?function(e){var n,i,r,a,o=e.match(/cubic-bezier\(\s*(.*?),\s*(.*?),\s*(.*?),\s*(.*?)\)/);if(o)return isNaN(n=parseFloat(o[1],10))&&(n=0),isNaN(i=parseFloat(o[2],10))&&(i=0),isNaN(r=parseFloat(o[3],10))&&(r=1),isNaN(a=parseFloat(o[4],10))&&(a=1),function(e){return t.cubicBezier(n,i,r,a,e)}}(e)||t.linear:t[e]||t.linear:t.linear});function r(t){for(var e,n=(new Date).getTime(),i=!0,r=0,a=t.length;r<a;r++)if(!(e=t[r]).paused&&!e.done){e.next;var o,s=e.target,l=n-e.start,h=e.duration,u=e.easefy,c=e.step,f=e.complete;if(i=!1,l<0)continue;l<h?c(s,o=u(l,h,n)):(c(s,o=1),f(s,o),e.done=!0,e.repeat)}return i}var a=[];function o(){this.animators=[],this.running=!1,a.length,a.push(this)}return o.prototype={stop:function(t){return this.animators.forEach((function(e){t&&e.step(e.target,1)})),this},addAnimate:function(){var t,e,n,r,a,o=Array.prototype.slice.call(arguments,0),s={},l={},h={duration:500,easing:"linear",step:function(){},complete:function(){}};if(!o.length)return this;o.length>1?(s=o[0]||{},l=o[1]||h):(s={},l=o[0]||h),r=l.step,a=l.complete,t=l.easing,e=Math.max(1,l.duration)||h.duration,n=l.delay||0,r="function"==typeof r?r:h.step,a="function"==typeof a?a:h.complete;var u=i(t),c=(new Date).getTime();this.animators.push({target:s,timestamp:c,start:c+n,stop:!1,duration:e,easefy:function(t,e){return 1===u.length?u(t/e):u(t,0,1,e)},step:function(t,e){r(t,e)},complete:function(t,e){a(t,e)}})},fire:function(t,e){var i=this.prev||this;a.length||e();i.running=!0,n((function o(){if(i.running){t&&t();for(var s=0;s<a.length;s++)r(a[s].animators)&&a.splice(s--,1);a.length?n(o):(t&&t(1),e&&e.call(i))}}))}},void 0!==e&&(e.Animation=o),"object"==typeof module&&module.exports?module.exports=o:"function"==typeof define&&define.amd&&define((function(){return o})),o})),function(t){var n=Object.prototype.toString,i=Array.prototype.slice,r=function(t){return void 0!==t||null!==t},a=function(t){return"[object Function]"===n.call(t)},o=function(){},s="touchstart",l="touchmove",h="touchend",u="touchcancel",c=function(t){return a(t)?t:o},f=function(t,e){return new f.init(t,e)};f.init=function(t,e){if(t&&1!==t.nodeType)throw Error("not a HTMLElement.");var i;return this.node=t,this.options=(i=e,"[object Object]"===n.call(i)?e:{}),this.globalTimer=null,this.v1=[],this.v2=[],this};var d=f.prototype;d={constructor:f,events:{touchStart:null,touchMove:null,touchEnd:null,touchCancel:null},on:function(t){var e=this.node,n=t.useCapture,f=!0===t.isScrolling,d=this.events,p={isFirst:!1,isMultiPoint:!1,isPressed:!1},g={x:0,y:0},y=this;n=!(r(n)?!n:n),arguments[1]&&a(arguments[1]||o);var x=c(t.press),v=c(t.swipe),m=function(e,n){var r=n.v1[0],a=i.call(e.changedTouches)[0],o=r.clientX-a.clientX,s=r.clientY-a.clientY;.1*.1-o*o-s*s>.001&&c(t.tap).call(this,e,n)},b=function(e,n){var i=n.v1,r=n.v2;if(r.length>1&&i.length>1){var a=e.target.getBoundingClientRect(),o=r[1].clientX-r[0].clientX,s=r[1].clientY-r[0].clientY,l=+(o*o>g.x*g.x||-1),h=Math.sqrt(o*o+s*s)/a.width;g.x=o,e.originEvent={vector:{length:l,scale:h}},c(t.pinch).call(this,e,n)}};return d.touchStart=function(t){var e=this;y.v1=i.call(t.touches),(new Date).getTime(),p.isPressed=!0,y.status="start",setTimeout(function(){p.isMultiPoint||x.call(e,t,y)}.call(y),250)},d.touchMove=function(t){var e=this;if(y.v2=i.call(t.touches),p.isFirst||(p.isFirst=!p.isFirst,y.status="start",p.isMultiPoint=y.v2.length>1,p.isMultiPoint?(g.x=y.v2[1].clientX-y.v2[0].clientX,g.y=y.v2[1].clientY-y.v2[0].clientY):v.call(e,t,y)),y.status="move",p.isMultiPoint?b.call(e,t,y):v.call(e,t,y),y.isHorizontal()||p.isMultiPoint||f)return t.preventDefault&&t.preventDefault(),!1},d.touchEnd=function(t){y.status="end",p.isPressed&&m.call(this,t,y),(p.isMultiPoint=p.isFirst=p.isPressed=!1)||v.call(this,t,y),y.destroy()},d.touchCancel=function(){y.destroy()},this.free(),function(t){t.addEventListener(s,d.touchStart,n),t.addEventListener(l,d.touchMove,n),t.addEventListener(h,d.touchEnd,n),t.addEventListener(u,d.touchCancel,n)}(e),this},free:function(){var t=this.options.useCapture,e=this.node,n=this.events;t=!(r(t)?!t:t),this.destroy(),[[n.touchStart,s],[n.touchMove,l],[n.touchEnd,h],[n.touchCancel,u]].forEach((function(n){n[0]&&(e.removeEventListener(n[1],n[0],t),n[0]=null)}))},isHorizontal:function(){var t,e,n,i,r=this.v1[0],a=this.v2[0];return t=r.clientX,e=r.clientY,n=a.clientX,i=a.clientY,Math.abs(n-t)>Math.abs(i-e)},destroy:function(){}},f.init.prototype=d,"object"==typeof module&&module.exports?module.exports=f:"function"==typeof define&&define.amd?define((function(){return f})):(void 0!==e?e:t).Touch=f}("undefined"!=typeof window?window:this),e.Chart.hasTouch&&e.Chart.setOptions({legend:{itemMarginBottom:12},tooltip:{backgroundColor:"#00bfa9",shadow:!1,style:{fontSize:"14px",color:"#FFFFFF"},positioner:function(t,e,n){return{x:n.plotX,y:0}},hideDelay:0},plotOptions:{line:{lineWidth:3,marker:{fillColor:"#FFFFFF",lineWidth:2}},spline:{lineWidth:3,marker:{fillColor:"#FFFFFF",lineWidth:2}},area:{lineWidth:1,marker:{fillColor:"#FFFFFF",lineWidth:2}},areaspline:{lineWidth:1,marker:{fillColor:"#FFFFFF",lineWidth:2}},pie:{borderWidth:0,dataLabels:{connectorWidth:1.5,inside:!0,style:{fontSize:"14px"}}},funnel:{borderWidth:0}}}),function(t){var e=Number.MAX_VALUE;function n(t,e,i){var r,a,o,s=function(t){return t.children}.call(null,t),l=0,h=0;if(t.depth=e,i.push(t),s&&(r=s.length)){for(a=t.children=[],h=0;l<r;l++)(o=n(s[l],e+1,i)).parent=t,a.push(o),h+=o.value;void 0===t.value&&(t.value=h)}return t}function i(){this.init.apply(this,arguments)}function r(t){var r=t.pick,a=t.extend,o=t.defined,s=t.isArray,l=t.isNumber,h=t.Geometry.Intersection,u={Pack:c,Treemap:i};function c(){this.init.apply(this,arguments)}return c.create=function(){function t(n){var o=n.children;o&&o.length?(o.forEach(t),n.radius=function(t){var n,o,u,c=e,f=-c,d=c,p=f;function g(t){c=Math.min(t.x-t.radius,c),f=Math.max(t.x+t.radius,f),d=Math.min(t.y-t.radius,d),p=Math.max(t.y+t.radius,p)}if(t.forEach(s),(n=t[0]).x=-n.radius,n.y=0,g(n),t.length>1&&((o=t[1]).x=o.radius,o.y=0,g(o),t.length>2)){a(n,o,u=t[2]),g(u),i(n,u),n.prev=u,i(u,o),o=n.next;for(var y=3;y<t.length;y++){var x=0,v=1,m=1;a(n,o,u=t[y]);for(var b=o.next;b!==o;b=b.next,v++)if(!h.circle(b,u)){x=1;break}if(1===x)for(var w=n.prev;w!==b.prev;w=w.prev,m++)if(!h.circle(w,u)){m<v&&(x=-1,b=w);break}0===x?(i(n,u),o=u,g(u)):x>0?(r(n,b),o=b,y--):x<0&&(r(b,o),n=b,y--)}}var M=(c+f)/2,A=(d+p)/2,S=0;return t.forEach((function(t){t.x-=M,t.y-=A,S=Math.max(S,t.radius+Math.sqrt(t.x*t.x+t.y*t.y))})),t.forEach(l),S}(o)):n.radius=Math.sqrt(n.value)}function i(t,e){var n=t.next;t.next=e,e.prev=t,e.next=n,n.prev=e}function r(t,e){t.next=e,e.prev=t}function a(t,e,n){var i=e.x-t.x,r=e.y-t.y,a=Math.sqrt(i*i+r*r),o=e.radius+n.radius,s=t.radius+n.radius,l=Math.min(1,Math.max(-1,(s*s+a*a-o*o)/(2*s*a))),h=l*s,u=Math.sin(Math.acos(l))*s;a?(i/=a,r/=a,n.x=t.x+h*i+u*r,n.y=t.y+h*r-u*i):(n.x=t.x+a,n.y=t.y)}function s(t){t.next=t.prev=t}function l(t){delete t.next,delete t.prev}function u(t,e,n,i){var r=t.children;if(e+=t.x*i,n+=t.y*i,t.x=e,t.y=n,t.radius*=i,r)for(var a=0;a<r.length;a++)u(r[a],e,n,i)}return function(e,i){var r;return n(e,0,i),r=i[0],{sort:function(t){return function(t,e){for(var n,i,r,a=[t],o=[];null!=(t=a.pop());)if(o.push(t),(r=t.children)&&(n=-1,i=r.length))for(;++n<i;)a.push(r[n]);for(;null!=(t=o.pop());)e(t)}(r,(function(e){e.children&&o(t)&&e.children.sort(t)})),this},tree:function(){return r.x=0,r.y=0,t(r),this},transform:function(t,e){var n=1/Math.max(2*r.radius/t,2*r.radius/e);u(r,t/2,e/2,n)}}}}(),c.prototype={init:function(t,e){if(this.data=[],this.options=a({nodes:t},e||{}),!o(this.options.nodes)||arguments.length<2)return this;var n=e.size[0],i=e.size[1];return c.create.call(this,this.options.nodes,this.data).sort(e.sort).tree().transform(n,i),this},pack:function(){return this.init(this.options.nodes,this.options)},padding:function(t){var e=this.options;return l(t)?(e.padding=t,this):r("number",e.padding,0)},sort:function(t){var e=this.options;return o(t)?(e.sort=t,this):e.sort},size:function(t){var e=this.options;return s(t)?(!l(t[0])&&(t[0]=0),t=l(t[1])?t:[t,t],e.size=t,this):e.size},nodes:function(t){var e=this.options;return t?(e.nodes=t,this):this.data}},t.Layout=u,u}i.prototype={init:function(t,e){var i=e.size||[1,1];this.nodes=[],n(t,0,this.nodes),this.squarify(this.nodes[0],i)},squarify:function(t,n){var i,r=t.children,a=this;t.parent||(t.x=t.y=0,t.dx=n[0],t.dy=n[1],a.scale([t],t.dx*t.dy/t.value));var o,s,l,h=[],u={x:t.x,y:t.y,dx:t.dx,dy:t.dy},c=Math.min(t.dx,t.dy),f=e;if(r&&(i=r.length)){for(o=r.slice(),a.scale(o,u.dx*u.dy/t.value),h.area=0;(i=o.length)>0;)h.push(s=o[i-1]),h.area+=s.area,(l=a.worst(h,h.area,c))<=f?(f=l,o.pop()):(h.area-=h.pop().area,a.position(h,c,u,!1),c=Math.min(u.dx,u.dy),h.length=h.area=0,f=e);h.length&&(a.position(h,c,u,!0),h.length=0,h.area=0),r.forEach((function(t){a.squarify(t,n)}))}},scale:function(t,e){for(var n,i,r=0,a=t.length;r<a;r++)i=(n=t[r]).value*(e<0?0:e),n.area=isNaN(i)||i<0?0:i},worst:function(t,n,i){for(var r,a=(1+Math.sqrt(5))/2,o=e,s=0,l=0;l<t.length;l++)(r=t[l].area)&&(o=Math.min(o,r),s=Math.max(s,r));return i*=i,(n*=n)?Math.max(i*s*a/n,n/(i*o*a)):e},position:function(t,e,n,i){var r,a=t.length,o=0,s=n.x,l=n.y,h=e?Math.round(t.area/e):0;if(e===n.dx){for((i||h>n.dy)&&(h=n.dy);o<a;o++)(r=t[o]).x=s,r.y=l,r.dy=h,r.dx=Math.min(n.x+n.dx-s,h?Math.round(r.area/h):0),s+=r.dx;r.dx+=n.x+n.dx-s,n.y+=h,n.dy-=h}else{for((i||h>n.dx)&&(h=n.dx);o<a;o++)(r=t[o]).x=s,r.y=l,r.dx=h,r.dy=Math.min(n.y+n.dy-l,h?Math.round(r.area/h):0),l+=r.dy;r.dy+=n.y+n.dy-l,n.x+=h,n.dx-=h}}};var a=function(t){return{deps:function(){var e=Array.prototype.slice.call(arguments,0);return r.apply(t,[].concat(e))}}}(this);return"object"==typeof module&&module.exports?module.exports=a:"function"==typeof define&&define.amd&&define([],(function(){return a})),a}.call("undefined"!=typeof window?window:this).deps(e),e.Dalaba=function(t){var e=function(){var t=Object.prototype.toString,e=function(e){return"[object Object]"===t.call(e)},n=function(t,e){return"number"==typeof t&&!isNaN(t)&&(!0!==e||isFinite(t))},i=function(e){return"[object String]"===t.call(e)},r=function(t){return null!=t};return{defined:r,isNumber:n,isArray:function(e){return"[object Array]"===t.call(e)},isString:i,isFunction:function(e){return"[object Function]"===t.call(e)},isObject:e,isValue:function(t,a){var o=t;return e(t)&&r(t.value)&&(o=t.value),i(o)&&(o=parseFloat(o,10)),n(o,a)?o:NaN}}}();return function(e){Math.min;var n=e.isArray,i=e.isValue;function r(){var t,r={};return r.min=(t=e.nonull,function(e,r){var a,o,l,h=0;if(!n(e))return NaN;for(a=e.length,o=t(e),h=i(r?r.call(e,e[o],o,e):e[o],!0);o<a;o++)(l=i(r?r.call(e,e[o],o,e):e[o],!0))<h&&(h=l);return s(h,!0)?h:NaN}),e.stats=r}e.nonull=function(t,e){var r,a,o=-1;if(!n(t))return 0;for(r=t.length;++o<r&&!i(a=t[o],e?e.call(t,a,o,t):a););return o};var a={deps:function(){var e=Array.prototype.slice.call(arguments,0);return r.apply(t,[].concat(e))}};return"object"==typeof module&&module.exports?module.exports=a:"function"==typeof define&&define.amd&&define((function(){return a})),a}(e).deps(e),"object"==typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define((function(){return e})):t.Dalaba=e,e}("undefined"!=typeof window?window:this),"object"==typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define((function(){return e})):t.Graph=e}("undefined"!=typeof window?window:this);
//# sourceMappingURL=/sm/063a7165be31d2afc40f78364fcbd4a48712717a368d189e046b059c7a941ff8.map