/*
 Highcharts JS v5.0.14 (2017-07-28)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(L){"object"===typeof module&&module.exports?module.exports=L:L(Highcharts)})(function(L){(function(a){var F=a.addEvent,m=a.Axis,y=a.Chart,D=a.css,G=a.dateFormat,v=a.defined,I=a.each,C=a.extend,r=a.noop,w=a.timeUnits,J=a.wrap;J(a.Series.prototype,"init",function(a){var d;a.apply(this,Array.prototype.slice.call(arguments,1));(d=this.xAxis)&&d.options.ordinal&&F(this,"updatedData",function(){delete d.ordinalIndex})});J(m.prototype,"getTimeTicks",function(a,d,b,h,k,u,f,g){var e=0,p,q,c={},n,
x,H,z=[],l=-Number.MAX_VALUE,t=this.options.tickPixelInterval;if(!this.options.ordinal&&!this.options.breaks||!u||3>u.length||void 0===b)return a.call(this,d,b,h,k);x=u.length;for(p=0;p<x;p++){H=p&&u[p-1]>h;u[p]<b&&(e=p);if(p===x-1||u[p+1]-u[p]>5*f||H){if(u[p]>l){for(q=a.call(this,d,u[e],u[p],k);q.length&&q[0]<=l;)q.shift();q.length&&(l=q[q.length-1]);z=z.concat(q)}e=p+1}if(H)break}a=q.info;if(g&&a.unitRange<=w.hour){p=z.length-1;for(e=1;e<p;e++)G("%d",z[e])!==G("%d",z[e-1])&&(c[z[e]]="day",n=!0);
n&&(c[z[0]]="day");a.higherRanks=c}z.info=a;if(g&&v(t)){g=a=z.length;p=[];var A;for(n=[];g--;)e=this.translate(z[g]),A&&(n[g]=A-e),p[g]=A=e;n.sort();n=n[Math.floor(n.length/2)];n<.6*t&&(n=null);g=z[a-1]>h?a-1:a;for(A=void 0;g--;)e=p[g],h=Math.abs(A-e),A&&h<.8*t&&(null===n||h<.8*n)?(c[z[g]]&&!c[z[g+1]]?(h=g+1,A=e):h=g,z.splice(h,1)):A=e}return z});C(m.prototype,{beforeSetTickPositions:function(){var a,d=[],b=!1,h,k=this.getExtremes(),u=k.min,f=k.max,g,E=this.isXAxis&&!!this.options.breaks,k=this.options.ordinal,
p=this.chart.options.chart.ignoreHiddenSeries;if(k||E){I(this.series,function(f,c){if(!(p&&!1===f.visible||!1===f.takeOrdinalPosition&&!E)&&(d=d.concat(f.processedXData),a=d.length,d.sort(function(c,f){return c-f}),a))for(c=a-1;c--;)d[c]===d[c+1]&&d.splice(c,1)});a=d.length;if(2<a){h=d[1]-d[0];for(g=a-1;g--&&!b;)d[g+1]-d[g]!==h&&(b=!0);!this.options.keepOrdinalPadding&&(d[0]-u>h||f-d[d.length-1]>h)&&(b=!0)}b?(this.ordinalPositions=d,h=this.ordinal2lin(Math.max(u,d[0]),!0),g=Math.max(this.ordinal2lin(Math.min(f,
d[d.length-1]),!0),1),this.ordinalSlope=f=(f-u)/(g-h),this.ordinalOffset=u-h*f):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=void 0}this.isOrdinal=k&&b;this.groupIntervalFactor=null},val2lin:function(a,d){var b=this.ordinalPositions;if(b){var h=b.length,k,e;for(k=h;k--;)if(b[k]===a){e=k;break}for(k=h-1;k--;)if(a>b[k]||0===k){a=(a-b[k])/(b[k+1]-b[k]);e=k+a;break}d=d?e:this.ordinalSlope*(e||0)+this.ordinalOffset}else d=a;return d},lin2val:function(a,d){var b=this.ordinalPositions;if(b){var h=
this.ordinalSlope,k=this.ordinalOffset,e=b.length-1,f;if(d)0>a?a=b[0]:a>e?a=b[e]:(e=Math.floor(a),f=a-e);else for(;e--;)if(d=h*e+k,a>=d){h=h*(e+1)+k;f=(a-d)/(h-d);break}return void 0!==f&&void 0!==b[e]?b[e]+(f?f*(b[e+1]-b[e]):0):a}return a},getExtendedPositions:function(){var a=this.chart,d=this.series[0].currentDataGrouping,b=this.ordinalIndex,h=d?d.count+d.unitName:"raw",k=this.getExtremes(),u,f;b||(b=this.ordinalIndex={});b[h]||(u={series:[],chart:a,getExtremes:function(){return{min:k.dataMin,
max:k.dataMax}},options:{ordinal:!0},val2lin:m.prototype.val2lin,ordinal2lin:m.prototype.ordinal2lin},I(this.series,function(g){f={xAxis:u,xData:g.xData,chart:a,destroyGroupedData:r};f.options={dataGrouping:d?{enabled:!0,forced:!0,approximation:"open",units:[[d.unitName,[d.count]]]}:{enabled:!1}};g.processData.apply(f);u.series.push(f)}),this.beforeSetTickPositions.apply(u),b[h]=u.ordinalPositions);return b[h]},getGroupIntervalFactor:function(a,d,b){var h;b=b.processedXData;var k=b.length,e=[];h=
this.groupIntervalFactor;if(!h){for(h=0;h<k-1;h++)e[h]=b[h+1]-b[h];e.sort(function(f,a){return f-a});e=e[Math.floor(k/2)];a=Math.max(a,b[0]);d=Math.min(d,b[k-1]);this.groupIntervalFactor=h=k*e/(d-a)}return h},postProcessTickInterval:function(a){var d=this.ordinalSlope;return d?this.options.breaks?this.closestPointRange:a/(d/this.closestPointRange):a}});m.prototype.ordinal2lin=m.prototype.val2lin;J(y.prototype,"pan",function(a,d){var b=this.xAxis[0],h=d.chartX,k=!1;if(b.options.ordinal&&b.series.length){var e=
this.mouseDownX,f=b.getExtremes(),g=f.dataMax,E=f.min,p=f.max,q=this.hoverPoints,c=b.closestPointRange,e=(e-h)/(b.translationSlope*(b.ordinalSlope||c)),n={ordinalPositions:b.getExtendedPositions()},c=b.lin2val,x=b.val2lin,H;n.ordinalPositions?1<Math.abs(e)&&(q&&I(q,function(c){c.setState()}),0>e?(q=n,H=b.ordinalPositions?b:n):(q=b.ordinalPositions?b:n,H=n),n=H.ordinalPositions,g>n[n.length-1]&&n.push(g),this.fixedRange=p-E,e=b.toFixedRange(null,null,c.apply(q,[x.apply(q,[E,!0])+e,!0]),c.apply(H,[x.apply(H,
[p,!0])+e,!0])),e.min>=Math.min(f.dataMin,E)&&e.max<=Math.max(g,p)&&b.setExtremes(e.min,e.max,!0,!1,{trigger:"pan"}),this.mouseDownX=h,D(this.container,{cursor:"move"})):k=!0}else k=!0;k&&a.apply(this,Array.prototype.slice.call(arguments,1))})})(L);(function(a){function F(){return Array.prototype.slice.call(arguments,1)}function m(a){a.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,y(this.pointArrayMap,["y"]))}var y=a.pick,D=a.wrap,G=a.each,v=a.extend,I=a.isArray,C=a.fireEvent,
r=a.Axis,w=a.Series;v(r.prototype,{isInBreak:function(a,e){var d=a.repeat||Infinity,b=a.from,h=a.to-a.from;e=e>=b?(e-b)%d:d-(b-e)%d;return a.inclusive?e<=h:e<h&&0!==e},isInAnyBreak:function(a,e){var d=this.options.breaks,b=d&&d.length,h,k,u;if(b){for(;b--;)this.isInBreak(d[b],a)&&(h=!0,k||(k=y(d[b].showPoints,this.isXAxis?!1:!0)));u=h&&e?h&&!k:h}return u}});D(r.prototype,"setTickPositions",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var e=this.tickPositions,
d=this.tickPositions.info,b=[],h;for(h=0;h<e.length;h++)this.isInAnyBreak(e[h])||b.push(e[h]);this.tickPositions=b;this.tickPositions.info=d}});D(r.prototype,"init",function(a,e,d){var b=this;d.breaks&&d.breaks.length&&(d.ordinal=!1);a.call(this,e,d);a=this.options.breaks;b.isBroken=I(a)&&!!a.length;b.isBroken&&(b.val2lin=function(a){var h=a,e,f;for(f=0;f<b.breakArray.length;f++)if(e=b.breakArray[f],e.to<=a)h-=e.len;else if(e.from>=a)break;else if(b.isInBreak(e,a)){h-=a-e.from;break}return h},b.lin2val=
function(a){var e,h;for(h=0;h<b.breakArray.length&&!(e=b.breakArray[h],e.from>=a);h++)e.to<a?a+=e.len:b.isInBreak(e,a)&&(a+=e.len);return a},b.setExtremes=function(a,b,e,f,g){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(b);)b-=this.closestPointRange;r.prototype.setExtremes.call(this,a,b,e,f,g)},b.setAxisTranslation=function(a){r.prototype.setAxisTranslation.call(this,a);a=b.options.breaks;var e=[],h=[],f=0,g,d,p=b.userMin||b.min,q=b.userMax||b.max,c=y(b.pointRangePadding,
0),n,x;G(a,function(c){d=c.repeat||Infinity;b.isInBreak(c,p)&&(p+=c.to%d-p%d);b.isInBreak(c,q)&&(q-=q%d-c.from%d)});G(a,function(c){n=c.from;for(d=c.repeat||Infinity;n-d>p;)n-=d;for(;n<p;)n+=d;for(x=n;x<q;x+=d)e.push({value:x,move:"in"}),e.push({value:x+(c.to-c.from),move:"out",size:c.breakSize})});e.sort(function(c,a){return c.value===a.value?("in"===c.move?0:1)-("in"===a.move?0:1):c.value-a.value});g=0;n=p;G(e,function(c){g+="in"===c.move?1:-1;1===g&&"in"===c.move&&(n=c.value);0===g&&(h.push({from:n,
to:c.value,len:c.value-n-(c.size||0)}),f+=c.value-n-(c.size||0))});b.breakArray=h;b.unitLength=q-p-f+c;C(b,"afterBreaks");b.options.staticScale?b.transA=b.options.staticScale:b.unitLength&&(b.transA*=(q-b.min+c)/b.unitLength);c&&(b.minPixelPadding=b.transA*b.minPointOffset);b.min=p;b.max=q})});D(w.prototype,"generatePoints",function(a){a.apply(this,F(arguments));var e=this.xAxis,d=this.yAxis,b=this.points,h,k=b.length,u=this.options.connectNulls,f;if(e&&d&&(e.options.breaks||d.options.breaks))for(;k--;)h=
b[k],f=null===h.y&&!1===u,f||!e.isInAnyBreak(h.x,!0)&&!d.isInAnyBreak(h.y,!0)||(b.splice(k,1),this.data[k]&&this.data[k].destroyElements())});a.Series.prototype.drawBreaks=function(a,e){var d=this,b=d.points,h,k,u,f;a&&G(e,function(g){h=a.breakArray||[];k=a.isXAxis?a.min:y(d.options.threshold,a.min);G(b,function(b){f=y(b["stack"+g.toUpperCase()],b[g]);G(h,function(g){u=!1;if(k<g.from&&f>g.to||k>g.from&&f<g.from)u="pointBreak";else if(k<g.from&&f>g.from&&f<g.to||k>g.from&&f>g.to&&f<g.from)u="pointInBreak";
u&&C(a,u,{point:b,brk:g})})})})};a.Series.prototype.gappedPath=function(){var r=this.options.gapSize,e=this.points.slice(),d=e.length-1,b=this.yAxis,h;if(r&&0<d)for("value"!==this.options.gapUnit&&(r*=this.closestPointRange);d--;)e[d+1].x-e[d].x>r&&(h=(e[d].x+e[d+1].x)/2,e.splice(d+1,0,{isNull:!0,x:h}),this.options.stacking&&(h=b.stacks[this.stackKey][h]=new a.StackItem(b,b.options.stackLabels,!1,h,this.stack),h.total=0));return this.getGraphPath(e)};D(a.seriesTypes.column.prototype,"drawPoints",
m);D(a.Series.prototype,"drawPoints",m)})(L);(function(a){var F=a.arrayMax,m=a.arrayMin,y=a.Axis,D=a.defaultPlotOptions,G=a.defined,v=a.each,I=a.extend,C=a.format,r=a.isNumber,w=a.merge,J=a.pick,e=a.Point,d=a.Tooltip,b=a.wrap,h=a.Series.prototype,k=h.processData,u=h.generatePoints,f=h.destroy,g={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],
minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},E={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",
groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},p=a.defaultDataGroupingUnits=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],q={sum:function(c){var a=c.length,f;if(!a&&c.hasNulls)f=null;else if(a)for(f=0;a--;)f+=c[a];return f},average:function(c){var a=c.length;c=q.sum(c);r(c)&&a&&(c/=a);return c},averages:function(){var c=[];v(arguments,function(a){c.push(q.average(a))});
return c},open:function(c){return c.length?c[0]:c.hasNulls?null:void 0},high:function(c){return c.length?F(c):c.hasNulls?null:void 0},low:function(c){return c.length?m(c):c.hasNulls?null:void 0},close:function(c){return c.length?c[c.length-1]:c.hasNulls?null:void 0},ohlc:function(c,a,f,g){c=q.open(c);a=q.high(a);f=q.low(f);g=q.close(g);if(r(c)||r(a)||r(f)||r(g))return[c,a,f,g]},range:function(c,a){c=q.low(c);a=q.high(a);if(r(c)||r(a))return[c,a];if(null===c&&null===a)return null}};h.groupData=function(a,
f,b,e){var c=this.data,l=this.options.data,t=[],A=[],n=[],d=a.length,B,x,h=!!f,k=[];e="function"===typeof e?e:q[e]||E[this.type]&&q[E[this.type].approximation]||q[g.approximation];var p=this.pointArrayMap,H=p&&p.length,u=0;x=0;var C,m;H?v(p,function(){k.push([])}):k.push([]);C=H||1;for(m=0;m<=d&&!(a[m]>=b[0]);m++);for(m;m<=d;m++){for(;void 0!==b[u+1]&&a[m]>=b[u+1]||m===d;){B=b[u];this.dataGroupInfo={start:x,length:k[0].length};x=e.apply(this,k);void 0!==x&&(t.push(B),A.push(x),n.push(this.dataGroupInfo));
x=m;for(B=0;B<C;B++)k[B].length=0,k[B].hasNulls=!1;u+=1;if(m===d)break}if(m===d)break;if(p){B=this.cropStart+m;var G=c&&c[B]||this.pointClass.prototype.applyOptions.apply({series:this},[l[B]]),w;for(B=0;B<H;B++)w=G[p[B]],r(w)?k[B].push(w):null===w&&(k[B].hasNulls=!0)}else B=h?f[m]:null,r(B)?k[0].push(B):null===B&&(k[0].hasNulls=!0)}return[t,A,n]};h.processData=function(){var a=this.chart,f=this.options.dataGrouping,g=!1!==this.allowDG&&f&&J(f.enabled,a.options.isStock),b=this.visible||!a.options.chart.ignoreHiddenSeries,
e;this.forceCrop=g;this.groupPixelWidth=null;this.hasProcessed=!0;if(!1!==k.apply(this,arguments)&&g){this.destroyGroupedData();var l=this.processedXData,t=this.processedYData,A=a.plotSizeX,a=this.xAxis,d=a.options.ordinal,M=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth();if(M){this.isDirty=e=!0;this.points=null;var B=a.getExtremes(),g=B.min,B=B.max,d=d&&a.getGroupIntervalFactor(g,B,this)||1,A=M*(B-g)/A*d,M=a.getTimeTicks(a.normalizeTimeTickInterval(A,f.units||p),Math.min(g,l[0]),
Math.max(B,l[l.length-1]),a.options.startOfWeek,l,this.closestPointRange),l=h.groupData.apply(this,[l,t,M,f.approximation]),t=l[0],d=l[1];if(f.smoothed){f=t.length-1;for(t[f]=Math.min(t[f],B);f--&&0<f;)t[f]+=A/2;t[0]=Math.max(t[0],g)}this.currentDataGrouping=M.info;this.closestPointRange=M.info.totalRange;this.groupMap=l[2];G(t[0])&&t[0]<a.dataMin&&b&&(a.min===a.dataMin&&(a.min=t[0]),a.dataMin=t[0]);this.processedXData=t;this.processedYData=d}else this.currentDataGrouping=this.groupMap=null;this.hasGroupedData=
e}};h.destroyGroupedData=function(){var a=this.groupedData;v(a||[],function(c,f){c&&(a[f]=c.destroy?c.destroy():null)});this.groupedData=null};h.generatePoints=function(){u.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};b(e.prototype,"update",function(c){this.dataGroup?a.error(24):c.apply(this,[].slice.call(arguments,1))});b(d.prototype,"tooltipFooterHeaderFormatter",function(c,f,g){var b=f.series,e=b.tooltipOptions,l=b.options.dataGrouping,t=e.xDateFormat,
A,d=b.xAxis,h=a.dateFormat;return d&&"datetime"===d.options.type&&l&&r(f.key)?(c=b.currentDataGrouping,l=l.dateTimeLabelFormats,c?(d=l[c.unitName],1===c.count?t=d[0]:(t=d[1],A=d[2])):!t&&l&&(t=this.getXDateFormat(f,e,d)),t=h(t,f.key),A&&(t+=h(A,f.key+c.totalRange-1)),C(e[(g?"footer":"header")+"Format"],{point:I(f.point,{key:t}),series:b})):c.call(this,f,g)});h.destroy=function(){for(var a=this.groupedData||[],g=a.length;g--;)a[g]&&a[g].destroy();f.apply(this)};b(h,"setOptions",function(a,f){a=a.call(this,
f);var c=this.type,b=this.chart.options.plotOptions,e=D[c].dataGrouping;E[c]&&(e||(e=w(g,E[c])),a.dataGrouping=w(e,b.series&&b.series.dataGrouping,b[c].dataGrouping,f.dataGrouping));this.chart.options.isStock&&(this.requireSorting=!0);return a});b(y.prototype,"setScale",function(a){a.call(this);v(this.series,function(a){a.hasProcessed=!1})});y.prototype.getGroupPixelWidth=function(){var a=this.series,f=a.length,g,b=0,e=!1,l;for(g=f;g--;)(l=a[g].options.dataGrouping)&&(b=Math.max(b,l.groupPixelWidth));
for(g=f;g--;)(l=a[g].options.dataGrouping)&&a[g].hasProcessed&&(f=(a[g].processedXData||a[g].data).length,a[g].groupPixelWidth||f>this.chart.plotSizeX/b||f&&l.forced)&&(e=!0);return e?b:0};y.prototype.setDataGrouping=function(a,f){var c;f=J(f,!0);a||(a={forced:!1,units:null});if(this instanceof y)for(c=this.series.length;c--;)this.series[c].update({dataGrouping:a},!1);else v(this.chart.options.series,function(f){f.dataGrouping=a},!1);f&&this.chart.redraw()}})(L);(function(a){var F=a.each,m=a.Point,
y=a.seriesType,D=a.seriesTypes;y("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cb\x3e {series.name}\x3c/b\x3e\x3cbr/\x3eOpen: {point.open}\x3cbr/\x3eHigh: {point.high}\x3cbr/\x3eLow: {point.low}\x3cbr/\x3eClose: {point.close}\x3cbr/\x3e'},threshold:null,states:{hover:{lineWidth:3}},stickyTracking:!0},{directTouch:!1,pointArrayMap:["open","high","low","close"],toYData:function(a){return[a.open,a.high,a.low,a.close]},pointValKey:"close",
pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},pointAttribs:function(a,m){m=D.column.prototype.pointAttribs.call(this,a,m);var v=this.options;delete m.fill;!a.options.color&&v.upColor&&a.open<a.close&&(m.stroke=v.upColor);return m},translate:function(){var a=this,m=a.yAxis,I=!!a.modifyValue,C=["plotOpen","plotHigh","plotLow","plotClose","yBottom"];D.column.prototype.translate.apply(a);F(a.points,function(r){F([r.open,r.high,r.low,r.close,r.low],function(w,v){null!==w&&(I&&(w=a.modifyValue(w)),
r[C[v]]=m.toPixels(w,!0))});r.tooltipPos[1]=r.plotHigh+m.pos-a.chart.plotTop})},drawPoints:function(){var a=this,m=a.chart;F(a.points,function(v){var C,r,w,y,e=v.graphic,d,b=!e;void 0!==v.plotY&&(e||(v.graphic=e=m.renderer.path().add(a.group)),e.attr(a.pointAttribs(v,v.selected&&"select")),r=e.strokeWidth()%2/2,d=Math.round(v.plotX)-r,w=Math.round(v.shapeArgs.width/2),y=["M",d,Math.round(v.yBottom),"L",d,Math.round(v.plotHigh)],null!==v.open&&(C=Math.round(v.plotOpen)+r,y.push("M",d,C,"L",d-w,C)),
null!==v.close&&(C=Math.round(v.plotClose)+r,y.push("M",d,C,"L",d+w,C)),e[b?"attr":"animate"]({d:y}).addClass(v.getClassName(),!0))})},animate:null},{getClassName:function(){return m.prototype.getClassName.call(this)+(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}})})(L);(function(a){var F=a.defaultPlotOptions,m=a.each,y=a.merge,D=a.seriesType,G=a.seriesTypes;D("candlestick","ohlc",y(F.column,{states:{hover:{lineWidth:2}},tooltip:F.ohlc.tooltip,threshold:null,lineColor:"#000000",
lineWidth:1,upColor:"#ffffff",stickyTracking:!0}),{pointAttribs:function(a,m){var C=G.column.prototype.pointAttribs.call(this,a,m),r=this.options,w=a.open<a.close,v=r.lineColor||this.color;C["stroke-width"]=r.lineWidth;C.fill=a.options.color||(w?r.upColor||this.color:this.color);C.stroke=a.lineColor||(w?r.upLineColor||v:v);m&&(a=r.states[m],C.fill=a.color||C.fill,C.stroke=a.lineColor||C.stroke,C["stroke-width"]=a.lineWidth||C["stroke-width"]);return C},drawPoints:function(){var a=this,y=a.chart;m(a.points,
function(m){var r=m.graphic,w,v,e,d,b,h,k,u=!r;void 0!==m.plotY&&(r||(m.graphic=r=y.renderer.path().add(a.group)),r.attr(a.pointAttribs(m,m.selected&&"select")).shadow(a.options.shadow),b=r.strokeWidth()%2/2,h=Math.round(m.plotX)-b,w=m.plotOpen,v=m.plotClose,e=Math.min(w,v),w=Math.max(w,v),k=Math.round(m.shapeArgs.width/2),v=Math.round(e)!==Math.round(m.plotHigh),d=w!==m.yBottom,e=Math.round(e)+b,w=Math.round(w)+b,b=[],b.push("M",h-k,w,"L",h-k,e,"L",h+k,e,"L",h+k,w,"Z","M",h,e,"L",h,v?Math.round(m.plotHigh):
e,"M",h,w,"L",h,d?Math.round(m.yBottom):w),r[u?"attr":"animate"]({d:b}).addClass(m.getClassName(),!0))})}})})(L);(function(a){var F=a.addEvent,m=a.each,y=a.merge,D=a.noop,G=a.Renderer,v=a.seriesType,I=a.seriesTypes,C=a.TrackerMixin,r=a.VMLRenderer,w=a.SVGRenderer.prototype.symbols,J=a.stableSort;v("flags","column",{pointRange:0,shape:"flag",stackDistance:12,textAlign:"center",tooltip:{pointFormat:"{point.text}\x3cbr/\x3e"},threshold:null,y:-30,fillColor:"#ffffff",lineWidth:1,states:{hover:{lineColor:"#000000",
fillColor:"#ccd6eb"}},style:{fontSize:"11px",fontWeight:"bold"}},{sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:a.Series.prototype.init,pointAttribs:function(a,d){var b=this.options,e=a&&a.color||this.color,k=b.lineColor,m=a&&a.lineWidth;a=a&&a.fillColor||b.fillColor;d&&(a=b.states[d].fillColor,k=b.states[d].lineColor,m=b.states[d].lineWidth);return{fill:a||e,stroke:k||e,"stroke-width":m||b.lineWidth||0}},translate:function(){I.column.prototype.translate.apply(this);
var a=this.options,d=this.chart,b=this.points,h=b.length-1,k,u,f=a.onSeries;k=f&&d.get(f);var a=a.onKey||"y",f=k&&k.options.step,g=k&&k.points,E=g&&g.length,p=this.xAxis,q=this.yAxis,c=p.getExtremes(),n=0,x,H,z;if(k&&k.visible&&E)for(n=(k.pointXOffset||0)+(k.barW||0)/2,k=k.currentDataGrouping,H=g[E-1].x+(k?k.totalRange:0),J(b,function(a,t){return a.x-t.x}),a="plot"+a[0].toUpperCase()+a.substr(1);E--&&b[h]&&!(k=b[h],x=g[E],x.x<=k.x&&void 0!==x[a]&&(k.x<=H&&(k.plotY=x[a],x.x<k.x&&!f&&(z=g[E+1])&&void 0!==
z[a]&&(k.plotY+=(k.x-x.x)/(z.x-x.x)*(z[a]-x[a]))),h--,E++,0>h)););m(b,function(a,t){var l;void 0===a.plotY&&(a.x>=c.min&&a.x<=c.max?a.plotY=d.chartHeight-p.bottom-(p.opposite?p.height:0)+p.offset-q.top:a.shapeArgs={});a.plotX+=n;(u=b[t-1])&&u.plotX===a.plotX&&(void 0===u.stackIndex&&(u.stackIndex=0),l=u.stackIndex+1);a.stackIndex=l})},drawPoints:function(){var e=this.points,d=this.chart,b=d.renderer,h,k,m=this.options,f=m.y,g,E,p,q,c,n,x,H=this.yAxis;for(E=e.length;E--;)p=e[E],x=p.plotX>this.xAxis.len,
h=p.plotX,q=p.stackIndex,g=p.options.shape||m.shape,k=p.plotY,void 0!==k&&(k=p.plotY+f-(void 0!==q&&q*m.stackDistance)),c=q?void 0:p.plotX,n=q?void 0:p.plotY,q=p.graphic,void 0!==k&&0<=h&&!x?(q||(q=p.graphic=b.label("",null,null,g,null,null,m.useHTML).attr(this.pointAttribs(p)).css(y(m.style,p.style)).attr({align:"flag"===g?"left":"center",width:m.width,height:m.height,"text-align":m.textAlign}).addClass("highcharts-point").add(this.markerGroup),p.graphic.div&&(p.graphic.div.point=p),q.shadow(m.shadow)),
0<h&&(h-=q.strokeWidth()%2),q.attr({text:p.options.title||m.title||"A",x:h,y:k,anchorX:c,anchorY:n}),p.tooltipPos=d.inverted?[H.len+H.pos-d.plotLeft-k,this.xAxis.len-h]:[h,k+H.pos-d.plotTop]):q&&(p.graphic=q.destroy());m.useHTML&&a.wrap(this.markerGroup,"on",function(f){return a.SVGElement.prototype.on.apply(f.apply(this,[].slice.call(arguments,1)),[].slice.call(arguments,1))})},drawTracker:function(){var a=this.points;C.drawTrackerPoint.apply(this);m(a,function(d){var b=d.graphic;b&&F(b.element,
"mouseover",function(){0<d.stackIndex&&!d.raised&&(d._y=b.y,b.attr({y:d._y-8}),d.raised=!0);m(a,function(a){a!==d&&a.raised&&a.graphic&&(a.graphic.attr({y:a._y}),a.raised=!1)})})})},animate:D,buildKDTree:D,setClip:D});w.flag=function(a,d,b,h,k){return["M",k&&k.anchorX||a,k&&k.anchorY||d,"L",a,d+h,a,d,a+b,d,a+b,d+h,a,d+h,"Z"]};m(["circle","square"],function(a){w[a+"pin"]=function(d,b,e,k,m){var f=m&&m.anchorX;m=m&&m.anchorY;"circle"===a&&k>e&&(d-=Math.round((k-e)/2),e=k);d=w[a](d,b,e,k);f&&m&&d.push("M",
f,b>m?b:b+k,"L",f,m);return d}});G===r&&m(["flag","circlepin","squarepin"],function(a){r.prototype.symbols[a]=w[a]})})(L);(function(a){function F(a,g,b){this.init(a,g,b)}var m=a.addEvent,y=a.Axis,D=a.correctFloat,G=a.defaultOptions,v=a.defined,I=a.destroyObjectProperties,C=a.each,r=a.fireEvent,w=a.hasTouch,J=a.isTouchDevice,e=a.merge,d=a.pick,b=a.removeEvent,h=a.wrap,k,u={height:J?20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:a.svg&&!J,margin:10,minWidth:6,step:.2,zIndex:3,barBackgroundColor:"#cccccc",
barBorderWidth:1,barBorderColor:"#cccccc",buttonArrowColor:"#333333",buttonBackgroundColor:"#e6e6e6",buttonBorderColor:"#cccccc",buttonBorderWidth:1,rifleColor:"#333333",trackBackgroundColor:"#f2f2f2",trackBorderColor:"#f2f2f2",trackBorderWidth:1};G.scrollbar=e(!0,u,G.scrollbar);a.swapXY=k=function(a,g){var f=a.length,b;if(g)for(g=0;g<f;g+=3)b=a[g+1],a[g+1]=a[g+2],a[g+2]=b;return a};F.prototype={init:function(a,g,b){this.scrollbarButtons=[];this.renderer=a;this.userOptions=g;this.options=e(u,g);this.chart=
b;this.size=d(this.options.size,this.options.height);g.enabled&&(this.render(),this.initEvents(),this.addEvents())},render:function(){var a=this.renderer,g=this.options,b=this.size,d;this.group=d=a.g("scrollbar").attr({zIndex:g.zIndex,translateY:-99999}).add();this.track=a.rect().addClass("highcharts-scrollbar-track").attr({x:0,r:g.trackBorderRadius||0,height:b,width:b}).add(d);this.track.attr({fill:g.trackBackgroundColor,stroke:g.trackBorderColor,"stroke-width":g.trackBorderWidth});this.trackBorderWidth=
this.track.strokeWidth();this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=a.g().add(d);this.scrollbar=a.rect().addClass("highcharts-scrollbar-thumb").attr({height:b,width:b,r:g.barBorderRadius||0}).add(this.scrollbarGroup);this.scrollbarRifles=a.path(k(["M",-3,b/4,"L",-3,2*b/3,"M",0,b/4,"L",0,2*b/3,"M",3,b/4,"L",3,2*b/3],g.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);this.scrollbar.attr({fill:g.barBackgroundColor,stroke:g.barBorderColor,"stroke-width":g.barBorderWidth});
this.scrollbarRifles.attr({stroke:g.rifleColor,"stroke-width":1});this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%2/2,-this.scrollbarStrokeWidth%2/2);this.drawScrollbarButton(0);this.drawScrollbarButton(1)},position:function(a,g,b,d){var f=this.options.vertical,c=0,e=this.rendered?"animate":"attr";this.x=a;this.y=g+this.trackBorderWidth;this.width=b;this.xOffset=this.height=d;this.yOffset=c;f?(this.width=this.yOffset=b=c=this.size,this.xOffset=
g=0,this.barWidth=d-2*b,this.x=a+=this.options.margin):(this.height=this.xOffset=d=g=this.size,this.barWidth=b-2*d,this.y+=this.options.margin);this.group[e]({translateX:a,translateY:this.y});this.track[e]({width:b,height:d});this.scrollbarButtons[1][e]({translateX:f?0:b-g,translateY:f?d-c:0})},drawScrollbarButton:function(a){var f=this.renderer,b=this.scrollbarButtons,d=this.options,e=this.size,c;c=f.g().add(this.group);b.push(c);c=f.rect().addClass("highcharts-scrollbar-button").add(c);c.attr({stroke:d.buttonBorderColor,
"stroke-width":d.buttonBorderWidth,fill:d.buttonBackgroundColor});c.attr(c.crisp({x:-.5,y:-.5,width:e+1,height:e+1,r:d.buttonBorderRadius},c.strokeWidth()));c=f.path(k(["M",e/2+(a?-1:1),e/2-3,"L",e/2+(a?-1:1),e/2+3,"L",e/2+(a?2:-2),e/2],d.vertical)).addClass("highcharts-scrollbar-arrow").add(b[a]);c.attr({fill:d.buttonArrowColor})},setRange:function(a,g){var f=this.options,b=f.vertical,d=f.minWidth,c=this.barWidth,e,h,k=this.rendered&&!this.hasDragged?"animate":"attr";v(c)&&(a=Math.max(a,0),e=Math.ceil(c*
a),this.calculatedWidth=h=D(c*Math.min(g,1)-e),h<d&&(e=(c-d+h)*a,h=d),d=Math.floor(e+this.xOffset+this.yOffset),c=h/2-.5,this.from=a,this.to=g,b?(this.scrollbarGroup[k]({translateY:d}),this.scrollbar[k]({height:h}),this.scrollbarRifles[k]({translateY:c}),this.scrollbarTop=d,this.scrollbarLeft=0):(this.scrollbarGroup[k]({translateX:d}),this.scrollbar[k]({width:h}),this.scrollbarRifles[k]({translateX:c}),this.scrollbarLeft=d,this.scrollbarTop=0),12>=h?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0),
!1===f.showFull&&(0>=a&&1<=g?this.group.hide():this.group.show()),this.rendered=!0)},initEvents:function(){var a=this;a.mouseMoveHandler=function(g){var b=a.chart.pointer.normalize(g),d=a.options.vertical?"chartY":"chartX",f=a.initPositions;!a.grabbedCenter||g.touches&&0===g.touches[0][d]||(b=a.cursorToScrollbarPosition(b)[d],d=a[d],d=b-d,a.hasDragged=!0,a.updatePosition(f[0]+d,f[1]+d),a.hasDragged&&r(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:g.type,DOMEvent:g}))};a.mouseUpHandler=
function(b){a.hasDragged&&r(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:b.type,DOMEvent:b});a.grabbedCenter=a.hasDragged=a.chartX=a.chartY=null};a.mouseDownHandler=function(b){b=a.chart.pointer.normalize(b);b=a.cursorToScrollbarPosition(b);a.chartX=b.chartX;a.chartY=b.chartY;a.initPositions=[a.from,a.to];a.grabbedCenter=!0};a.buttonToMinClick=function(b){var g=D(a.to-a.from)*a.options.step;a.updatePosition(D(a.from-g),D(a.to-g));r(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",
DOMEvent:b})};a.buttonToMaxClick=function(b){var g=(a.to-a.from)*a.options.step;a.updatePosition(a.from+g,a.to+g);r(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:b})};a.trackClick=function(b){var g=a.chart.pointer.normalize(b),d=a.to-a.from,f=a.y+a.scrollbarTop,c=a.x+a.scrollbarLeft;a.options.vertical&&g.chartY>f||!a.options.vertical&&g.chartX>c?a.updatePosition(a.from+d,a.to+d):a.updatePosition(a.from-d,a.to-d);r(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:b})}},
cursorToScrollbarPosition:function(a){var b=this.options,b=b.minWidth>this.calculatedWidth?b.minWidth:0;return{chartX:(a.chartX-this.x-this.xOffset)/(this.barWidth-b),chartY:(a.chartY-this.y-this.yOffset)/(this.barWidth-b)}},updatePosition:function(a,b){1<b&&(a=D(1-D(b-a)),b=1);0>a&&(b=D(b-a),a=0);this.from=a;this.to=b},update:function(a){this.destroy();this.init(this.chart.renderer,e(!0,this.options,a),this.chart)},addEvents:function(){var a=this.options.inverted?[1,0]:[0,1],b=this.scrollbarButtons,
d=this.scrollbarGroup.element,e=this.mouseDownHandler,h=this.mouseMoveHandler,c=this.mouseUpHandler,a=[[b[a[0]].element,"click",this.buttonToMinClick],[b[a[1]].element,"click",this.buttonToMaxClick],[this.track.element,"click",this.trackClick],[d,"mousedown",e],[d.ownerDocument,"mousemove",h],[d.ownerDocument,"mouseup",c]];w&&a.push([d,"touchstart",e],[d.ownerDocument,"touchmove",h],[d.ownerDocument,"touchend",c]);C(a,function(a){m.apply(null,a)});this._events=a},removeEvents:function(){C(this._events,
function(a){b.apply(null,a)});this._events.length=0},destroy:function(){var a=this.chart.scroller;this.removeEvents();C(["track","scrollbarRifles","scrollbar","scrollbarGroup","group"],function(a){this[a]&&this[a].destroy&&(this[a]=this[a].destroy())},this);a&&this===a.scrollbar&&(a.scrollbar=null,I(a.scrollbarButtons))}};h(y.prototype,"init",function(a){var b=this;a.apply(b,Array.prototype.slice.call(arguments,1));b.options.scrollbar&&b.options.scrollbar.enabled&&(b.options.scrollbar.vertical=!b.horiz,
b.options.startOnTick=b.options.endOnTick=!1,b.scrollbar=new F(b.chart.renderer,b.options.scrollbar,b.chart),m(b.scrollbar,"changed",function(a){var e=Math.min(d(b.options.min,b.min),b.min,b.dataMin),g=Math.max(d(b.options.max,b.max),b.max,b.dataMax)-e,c;b.horiz&&!b.reversed||!b.horiz&&b.reversed?(c=e+g*this.to,e+=g*this.from):(c=e+g*(1-this.from),e+=g*(1-this.to));b.setExtremes(e,c,!0,!1,a)}))});h(y.prototype,"render",function(a){var b=Math.min(d(this.options.min,this.min),this.min,d(this.dataMin,
this.min)),e=Math.max(d(this.options.max,this.max),this.max,d(this.dataMax,this.max)),h=this.scrollbar,f=this.titleOffset||0;a.apply(this,Array.prototype.slice.call(arguments,1));if(h){this.horiz?(h.position(this.left,this.top+this.height+2+this.chart.scrollbarsOffsets[1]+(this.opposite?0:f+this.axisTitleMargin+this.offset),this.width,this.height),f=1):(h.position(this.left+this.width+2+this.chart.scrollbarsOffsets[0]+(this.opposite?f+this.axisTitleMargin+this.offset:0),this.top,this.width,this.height),
f=0);if(!this.opposite&&!this.horiz||this.opposite&&this.horiz)this.chart.scrollbarsOffsets[f]+=this.scrollbar.size+this.scrollbar.options.margin;isNaN(b)||isNaN(e)||!v(this.min)||!v(this.max)?h.setRange(0,0):(f=(this.min-b)/(e-b),b=(this.max-b)/(e-b),this.horiz&&!this.reversed||!this.horiz&&this.reversed?h.setRange(f,b):h.setRange(1-b,1-f))}});h(y.prototype,"getOffset",function(a){var b=this.horiz?2:1,d=this.scrollbar;a.apply(this,Array.prototype.slice.call(arguments,1));d&&(this.chart.scrollbarsOffsets=
[0,0],this.chart.axisOffset[b]+=d.size+d.options.margin)});h(y.prototype,"destroy",function(a){this.scrollbar&&(this.scrollbar=this.scrollbar.destroy());a.apply(this,Array.prototype.slice.call(arguments,1))});a.Scrollbar=F})(L);(function(a){function F(a){this.init(a)}var m=a.addEvent,y=a.Axis,D=a.Chart,G=a.color,v=a.defaultOptions,I=a.defined,C=a.destroyObjectProperties,r=a.each,w=a.erase,J=a.error,e=a.extend,d=a.grep,b=a.hasTouch,h=a.isArray,k=a.isNumber,u=a.isObject,f=a.merge,g=a.pick,E=a.removeEvent,
p=a.Scrollbar,q=a.Series,c=a.seriesTypes,n=a.wrap,x=a.swapXY,H=[].concat(a.defaultDataGroupingUnits),z=function(a){var l=d(arguments,k);if(l.length)return Math[a].apply(0,l)};H[4]=["day",[1,2,3,4]];H[5]=["week",[1,2,3]];c=void 0===c.areaspline?"line":"areaspline";e(v,{navigator:{height:40,margin:25,maskInside:!0,handles:{backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:G("#6685c2").setOpacity(.3).get(),outlineColor:"#cccccc",outlineWidth:1,series:{type:c,color:"#335cad",fillOpacity:.05,lineWidth:1,
compare:null,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:H},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},pointRange:0,shadow:!1,threshold:null},xAxis:{className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#999999"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",
gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}}});F.prototype={drawHandle:function(a,b,c,d){this.handles[b][d](c?{translateX:Math.round(this.left+this.height/2-8),translateY:Math.round(this.top+parseInt(a,10)+.5)}:{translateX:Math.round(this.left+parseInt(a,10)),translateY:Math.round(this.top+this.height/2-8)})},getHandlePath:function(a){return x(["M",-4.5,.5,"L",3.5,.5,"L",3.5,15.5,"L",-4.5,15.5,
"L",-4.5,.5,"M",-1.5,4,"L",-1.5,12,"M",.5,4,"L",.5,12],a)},drawOutline:function(a,b,c,d){var l=this.navigatorOptions.maskInside,t=this.outline.strokeWidth(),A=t/2,t=t%2/2,e=this.outlineHeight,g=this.scrollbarHeight,h=this.size,f=this.left-g,K=this.top;c?(f-=A,c=K+b+t,b=K+a+t,a=["M",f+e,K-g-t,"L",f+e,c,"L",f,c,"L",f,b,"L",f+e,b,"L",f+e,K+h+g].concat(l?["M",f+e,c-A,"L",f+e,b+A]:[])):(a+=f+g-t,b+=f+g-t,K+=A,a=["M",f,K,"L",a,K,"L",a,K+e,"L",b,K+e,"L",b,K,"L",f+h+2*g,K].concat(l?["M",a-A,K,"L",b+A,K]:
[]));this.outline[d]({d:a})},drawMasks:function(a,b,c,d){var l=this.left,t=this.top,A=this.height,e,g,f,h;c?(f=[l,l,l],h=[t,t+a,t+b],g=[A,A,A],e=[a,b-a,this.size-b]):(f=[l,l+a,l+b],h=[t,t,t],g=[a,b-a,this.size-b],e=[A,A,A]);r(this.shades,function(a,l){a[d]({x:f[l],y:h[l],width:g[l],height:e[l]})})},renderElements:function(){var a=this,b=a.navigatorOptions,c=b.maskInside,d=a.chart,e=d.inverted,g=d.renderer,f;a.navigatorGroup=f=g.g("navigator").attr({zIndex:8,visibility:"hidden"}).add();var h={cursor:e?
"ns-resize":"ew-resize"};r([!c,c,!c],function(l,c){a.shades[c]=g.rect().addClass("highcharts-navigator-mask"+(1===c?"-inside":"-outside")).attr({fill:l?b.maskFill:"rgba(0,0,0,0)"}).css(1===c&&h).add(f)});a.outline=g.path().addClass("highcharts-navigator-outline").attr({"stroke-width":b.outlineWidth,stroke:b.outlineColor}).add(f);r([0,1],function(l){a.handles[l]=g.path(a.getHandlePath(e)).attr({zIndex:7-l}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][l]).add(f);
var c=b.handles;a.handles[l].attr({fill:c.backgroundColor,stroke:c.borderColor,"stroke-width":1}).css(h)})},update:function(a){r(this.series||[],function(a){a.baseSeries&&delete a.baseSeries.navigatorSeries});this.destroy();f(!0,this.chart.options.navigator,this.options,a);this.init(this.chart)},render:function(a,b,c,d){var l=this.chart,t,e,A=this.scrollbarHeight,f,h=this.xAxis;t=h.fake?l.xAxis[0]:h;var K=this.navigatorEnabled,z,x=this.rendered;e=l.inverted;var n=l.xAxis[0].minRange;if(!this.hasDragged||
I(c)){if(!k(a)||!k(b))if(x)c=0,d=h.width;else return;this.left=g(h.left,l.plotLeft+A+(e?l.plotWidth:0));this.size=z=f=g(h.len,(e?l.plotHeight:l.plotWidth)-2*A);l=e?A:f+2*A;c=g(c,h.toPixels(a,!0));d=g(d,h.toPixels(b,!0));k(c)&&Infinity!==Math.abs(c)||(c=0,d=l);a=h.toValue(c,!0);b=h.toValue(d,!0);if(Math.abs(b-a)<n)if(this.grabbedLeft)c=h.toPixels(b-n,!0);else if(this.grabbedRight)d=h.toPixels(a+n,!0);else return;this.zoomedMax=Math.min(Math.max(c,d,0),z);this.zoomedMin=Math.min(Math.max(this.fixedWidth?
this.zoomedMax-this.fixedWidth:Math.min(c,d),0),z);this.range=this.zoomedMax-this.zoomedMin;z=Math.round(this.zoomedMax);c=Math.round(this.zoomedMin);K&&(this.navigatorGroup.attr({visibility:"visible"}),x=x&&!this.hasDragged?"animate":"attr",this.drawMasks(c,z,e,x),this.drawOutline(c,z,e,x),this.drawHandle(c,0,e,x),this.drawHandle(z,1,e,x));this.scrollbar&&(e?(e=this.top-A,t=this.left-A+(K||!t.opposite?0:(t.titleOffset||0)+t.axisTitleMargin),A=f+2*A):(e=this.top+(K?this.height:-A),t=this.left-A),
this.scrollbar.position(t,e,l,A),this.scrollbar.setRange(this.zoomedMin/f,this.zoomedMax/f));this.rendered=!0}},addMouseEvents:function(){var a=this,c=a.chart,d=c.container,e=[],f,g;a.mouseMoveHandler=f=function(b){a.onMouseMove(b)};a.mouseUpHandler=g=function(b){a.onMouseUp(b)};e=a.getPartsEvents("mousedown");e.push(m(d,"mousemove",f),m(d.ownerDocument,"mouseup",g));b&&(e.push(m(d,"touchmove",f),m(d.ownerDocument,"touchend",g)),e.concat(a.getPartsEvents("touchstart")));a.eventsToUnbind=e;a.series&&
a.series[0]&&e.push(m(a.series[0].xAxis,"foundExtremes",function(){c.navigator.modifyNavigatorAxisExtremes()}))},getPartsEvents:function(a){var b=this,l=[];r(["shades","handles"],function(c){r(b[c],function(t,d){l.push(m(t.element,a,function(a){b[c+"Mousedown"](a,d)}))})});return l},shadesMousedown:function(a,b){a=this.chart.pointer.normalize(a);var l=this.chart,c=this.xAxis,d=this.zoomedMin,t=this.left,e=this.size,f=this.range,g=a.chartX,h;l.inverted&&(g=a.chartY,t=this.top);1===b?(this.grabbedCenter=
g,this.fixedWidth=f,this.dragOffset=g-d):(a=g-t-f/2,0===b?a=Math.max(0,a):2===b&&a+f>=e&&(a=e-f,h=this.getUnionExtremes().dataMax),a!==d&&(this.fixedWidth=f,b=c.toFixedRange(a,a+f,null,h),l.xAxis[0].setExtremes(Math.min(b.min,b.max),Math.max(b.min,b.max),!0,null,{trigger:"navigator"})))},handlesMousedown:function(a,b){this.chart.pointer.normalize(a);a=this.chart;var l=a.xAxis[0],c=a.inverted&&!l.reversed||!a.inverted&&l.reversed;0===b?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=
c?l.min:l.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=c?l.max:l.min);a.fixedRange=null},onMouseMove:function(a){var b=this,c=b.chart,l=b.left,d=b.navigatorSize,e=b.range,f=b.dragOffset,g=c.inverted;a.touches&&0===a.touches[0].pageX||(a=c.pointer.normalize(a),c=a.chartX,g&&(l=b.top,c=a.chartY),b.grabbedLeft?(b.hasDragged=!0,b.render(0,0,c-l,b.otherHandlePos)):b.grabbedRight?(b.hasDragged=!0,b.render(0,0,b.otherHandlePos,c-l)):b.grabbedCenter&&(b.hasDragged=!0,c<
f?c=f:c>d+f-e&&(c=d+f-e),b.render(0,0,c-f,c-f+e)),b.hasDragged&&b.scrollbar&&b.scrollbar.options.liveRedraw&&(a.DOMType=a.type,setTimeout(function(){b.onMouseUp(a)},0)))},onMouseUp:function(a){var b=this.chart,c=this.xAxis,l=this.scrollbar,d,e,f=a.DOMEvent||a;(!this.hasDragged||l&&l.hasDragged)&&"scrollbar"!==a.trigger||(this.zoomedMin===this.otherHandlePos?d=this.fixedExtreme:this.zoomedMax===this.otherHandlePos&&(e=this.fixedExtreme),this.zoomedMax===this.size&&(e=this.getUnionExtremes().dataMax),
c=c.toFixedRange(this.zoomedMin,this.zoomedMax,d,e),I(c.min)&&b.xAxis[0].setExtremes(Math.min(c.min,c.max),Math.max(c.min,c.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:f}));"mousemove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null)},removeEvents:function(){this.eventsToUnbind&&(r(this.eventsToUnbind,function(a){a()}),this.eventsToUnbind=void 0);
this.removeBaseSeriesEvents()},removeBaseSeriesEvents:function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&r(a,function(a){E(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&E(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))},init:function(a){var b=a.options,c=b.navigator,l=c.enabled,d=b.scrollbar,e=d.enabled,b=l?c.height:0,h=e?d.height:0;this.handles=[];this.shades=[];this.chart=a;this.setBaseSeries();this.height=b;this.scrollbarHeight=
h;this.scrollbarEnabled=e;this.navigatorEnabled=l;this.navigatorOptions=c;this.scrollbarOptions=d;this.outlineHeight=b+h;this.opposite=g(c.opposite,!l&&a.inverted);var k=this,d=k.baseSeries,e=a.xAxis.length,x=a.yAxis.length,H=d&&d[0]&&d[0].xAxis||a.xAxis[0];a.extraMargin={type:k.opposite?"plotTop":"marginBottom",value:(l||!a.inverted?k.outlineHeight:0)+c.margin};a.inverted&&(a.extraMargin.type=k.opposite?"marginRight":"plotLeft");a.isDirtyBox=!0;k.navigatorEnabled?(k.xAxis=new y(a,f({breaks:H.options.breaks,
ordinal:H.options.ordinal},c.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0,type:"datetime",index:e,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},a.inverted?{offsets:[h,0,-h,0],width:b}:{offsets:[0,-h,0,h],height:b})),k.yAxis=new y(a,f(c.yAxis,{id:"navigator-y-axis",alignTicks:!1,offset:0,index:x,zoomEnabled:!1},a.inverted?{width:b}:{height:b})),d||c.series.data?k.updateNavigatorSeries():0===a.series.length&&n(a,"redraw",function(b,
c){0<a.series.length&&!k.series&&(k.setBaseSeries(),a.redraw=b);b.call(a,c)}),k.renderElements(),k.addMouseEvents()):k.xAxis={translate:function(b,c){var l=a.xAxis[0],d=l.getExtremes(),e=l.len-2*h,t=z("min",l.options.min,d.dataMin),l=z("max",l.options.max,d.dataMax)-t;return c?b*l/e+t:e*(b-t)/l},toPixels:function(a){return this.translate(a)},toValue:function(a){return this.translate(a,!0)},toFixedRange:y.prototype.toFixedRange,fake:!0};a.options.scrollbar.enabled&&(a.scrollbar=k.scrollbar=new p(a.renderer,
f(a.options.scrollbar,{margin:k.navigatorEnabled?0:10,vertical:a.inverted}),a),m(k.scrollbar,"changed",function(b){var c=k.size,l=c*this.to,c=c*this.from;k.hasDragged=k.scrollbar.hasDragged;k.render(0,0,c,l);(a.options.scrollbar.liveRedraw||"mousemove"!==b.DOMType)&&setTimeout(function(){k.onMouseUp(b)})}));k.addBaseSeriesEvents();k.addChartEvents()},getUnionExtremes:function(a){var b=this.chart.xAxis[0],c=this.xAxis,l=c.options,d=b.options,e;a&&null===b.dataMin||(e={dataMin:g(l&&l.min,z("min",d.min,
b.dataMin,c.dataMin,c.min)),dataMax:g(l&&l.max,z("max",d.max,b.dataMax,c.dataMax,c.max))});return e},setBaseSeries:function(a){var b=this.chart,c=this.baseSeries=[];a=a||b.options&&b.options.navigator.baseSeries||0;r(b.series||[],function(b,l){b.options.isInternal||!b.options.showInNavigator&&(l!==a&&b.options.id!==a||!1===b.options.showInNavigator)||c.push(b)});this.xAxis&&!this.xAxis.fake&&this.updateNavigatorSeries()},updateNavigatorSeries:function(){var b=this,c=b.chart,d=b.baseSeries,e,g,k=b.navigatorOptions.series,
z,x={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:!1,isInternal:!0,visible:!0},n=b.series=a.grep(b.series||[],function(c){var l=c.baseSeries;return 0>a.inArray(l,d)?(l&&(E(l,"updatedData",b.updatedDataHandler),delete l.navigatorSeries),c.destroy(),!1):!0});d&&d.length&&r(d,function(a,d){var l=a.navigatorSeries,t=h(k)?{}:k;l&&!1===b.navigatorOptions.adaptToUpdatedData||(x.name="Navigator "+(d+1),e=
a.options||{},z=e.navigatorOptions||{},g=f(e,x,t,z),d=z.data||t.data,b.hasNavigatorData=b.hasNavigatorData||!!d,g.data=d||e.data&&e.data.slice(0),l?l.update(g):(a.navigatorSeries=c.initSeries(g),a.navigatorSeries.baseSeries=a,n.push(a.navigatorSeries)))});if(k.data&&(!d||!d.length)||h(k))b.hasNavigatorData=!1,k=a.splat(k),r(k,function(a,d){g=f({color:c.series[d]&&!c.series[d].options.isInternal&&c.series[d].color||c.options.colors[d]||c.options.colors[0]},a,x);g.data=a.data;g.data&&(b.hasNavigatorData=
!0,n.push(c.initSeries(g)))});this.addBaseSeriesEvents()},addBaseSeriesEvents:function(){var a=this,b=a.baseSeries||[];b[0]&&b[0].xAxis&&m(b[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);r(b,function(b){m(b,"show",function(){this.navigatorSeries&&this.navigatorSeries.show()});m(b,"hide",function(){this.navigatorSeries&&this.navigatorSeries.hide()});!1!==this.navigatorOptions.adaptToUpdatedData&&b.xAxis&&m(b,"updatedData",this.updatedDataHandler);m(b,"remove",function(){this.navigatorSeries&&
(w(a.series,this.navigatorSeries),this.navigatorSeries.remove(!1),delete this.navigatorSeries)})},this)},modifyNavigatorAxisExtremes:function(){var a=this.xAxis,b;a.getExtremes&&(!(b=this.getUnionExtremes(!0))||b.dataMin===a.min&&b.dataMax===a.max||(a.min=b.dataMin,a.max=b.dataMax))},modifyBaseAxisExtremes:function(){var a=this.chart.navigator,b=this.getExtremes(),c=b.dataMin,d=b.dataMax,b=b.max-b.min,e=a.stickToMin,f=a.stickToMax,g,h,z=a.series&&a.series[0],x=!!this.setExtremes;this.eventArgs&&"rangeSelectorButton"===
this.eventArgs.trigger||(e&&(h=c,g=h+b),f&&(g=d,e||(h=Math.max(g-b,z&&z.xData?z.xData[0]:-Number.MAX_VALUE))),x&&(e||f)&&k(h)&&(this.min=this.userMin=h,this.max=this.userMax=g));a.stickToMin=a.stickToMax=null},updatedDataHandler:function(){var a=this.chart.navigator,b=this.navigatorSeries;a.stickToMax=Math.round(a.zoomedMax)>=Math.round(a.size);a.stickToMin=k(this.xAxis.min)&&this.xAxis.min<=this.xData[0]&&(!this.chart.fixedRange||!a.stickToMax);b&&!a.hasNavigatorData&&(b.options.pointStart=this.xData[0],
b.setData(this.options.data,!1,null,!1))},addChartEvents:function(){m(this.chart,"redraw",function(){var a=this.navigator,b=a&&(a.baseSeries&&a.baseSeries[0]&&a.baseSeries[0].xAxis||a.scrollbar&&this.xAxis[0]);b&&a.render(b.min,b.max)})},destroy:function(){this.removeEvents();this.xAxis&&(w(this.chart.xAxis,this.xAxis),w(this.chart.axes,this.xAxis));this.yAxis&&(w(this.chart.yAxis,this.yAxis),w(this.chart.axes,this.yAxis));r(this.series||[],function(a){a.destroy&&a.destroy()});r("series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" "),
function(a){this[a]&&this[a].destroy&&this[a].destroy();this[a]=null},this);r([this.handles],function(a){C(a)},this)}};a.Navigator=F;n(y.prototype,"zoom",function(a,b,c){var d=this.chart,e=d.options,l=e.chart.zoomType,g=e.navigator,e=e.rangeSelector,f;this.isXAxis&&(g&&g.enabled||e&&e.enabled)&&("x"===l?d.resetZoomButton="blocked":"y"===l?f=!1:"xy"===l&&(d=this.previousZoom,I(b)?this.previousZoom=[this.min,this.max]:d&&(b=d[0],c=d[1],delete this.previousZoom)));return void 0!==f?f:a.call(this,b,c)});
n(D.prototype,"init",function(a,b,c){m(this,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=this.navigator=new F(this)});a.call(this,b,c)});n(D.prototype,"setChartSize",function(a){var b=this.legend,c=this.navigator,d,e,l,f;a.apply(this,[].slice.call(arguments,1));c&&(e=b.options,l=c.xAxis,f=c.yAxis,d=c.scrollbarHeight,this.inverted?(c.left=c.opposite?this.chartWidth-d-c.height:this.spacing[3]+d,c.top=this.plotTop+d):(c.left=this.plotLeft+d,c.top=
c.navigatorOptions.top||this.chartHeight-c.height-d-this.spacing[2]-("bottom"===e.verticalAlign&&e.enabled&&!e.floating?b.legendHeight+g(e.margin,10):0)),l&&f&&(this.inverted?l.options.left=f.options.left=c.left:l.options.top=f.options.top=c.top,l.setAxisSize(),f.setAxisSize()))});n(q.prototype,"addPoint",function(a,b,c,d,e){var l=this.options.turboThreshold;l&&this.xData.length>l&&u(b,!0)&&this.chart.navigator&&J(20,!0);a.call(this,b,c,d,e)});n(D.prototype,"addSeries",function(a,b,c,d){a=a.call(this,
b,!1,d);this.navigator&&this.navigator.setBaseSeries();g(c,!0)&&this.redraw();return a});n(q.prototype,"update",function(a,b,c){a.call(this,b,!1);this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries();g(c,!0)&&this.chart.redraw()});D.prototype.callbacks.push(function(a){var b=a.navigator;b&&(a=a.xAxis[0].getExtremes(),b.render(a.min,a.max))})})(L);(function(a){function F(a){this.init(a)}var m=a.addEvent,y=a.Axis,D=a.Chart,G=a.css,v=a.createElement,I=a.dateFormat,C=a.defaultOptions,
r=C.global.useUTC,w=a.defined,J=a.destroyObjectProperties,e=a.discardElement,d=a.each,b=a.extend,h=a.fireEvent,k=a.Date,u=a.isNumber,f=a.merge,g=a.pick,E=a.pInt,p=a.splat,q=a.wrap;b(C,{rangeSelector:{buttonTheme:{"stroke-width":0,width:28,height:18,padding:2,zIndex:7},height:35,inputPosition:{align:"right"},labelStyle:{color:"#666666"}}});C.lang=f(C.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});F.prototype={clickButton:function(a,b){var c=this,e=c.chart,f=c.buttonOptions[a],
l=e.xAxis[0],h=e.scroller&&e.scroller.getUnionExtremes()||l||{},k=h.dataMin,n=h.dataMax,q,B=l&&Math.round(Math.min(l.max,g(n,l.max))),v=f.type,w,h=f._range,N,C,D,E=f.dataGrouping;if(null!==k&&null!==n){e.fixedRange=h;E&&(this.forcedDataGrouping=!0,y.prototype.setDataGrouping.call(l||{chart:this.chart},E,!1));if("month"===v||"year"===v)l?(v={range:f,max:B,dataMin:k,dataMax:n},q=l.minFromRange.call(v),u(v.newMax)&&(B=v.newMax)):h=f;else if(h)q=Math.max(B-h,k),B=Math.min(q+h,n);else if("ytd"===v)if(l)void 0===
n&&(k=Number.MAX_VALUE,n=Number.MIN_VALUE,d(e.series,function(a){a=a.xData;k=Math.min(a[0],k);n=Math.max(a[a.length-1],n)}),b=!1),B=c.getYTDExtremes(n,k,r),q=N=B.min,B=B.max;else{m(e,"beforeRender",function(){c.clickButton(a)});return}else"all"===v&&l&&(q=k,B=n);c.setSelected(a);l?l.setExtremes(q,B,g(b,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:f}):(w=p(e.options.xAxis)[0],D=w.range,w.range=h,C=w.min,w.min=N,m(e,"load",function(){w.range=D;w.min=C}))}},setSelected:function(a){this.selected=
this.options.selected=a},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var b=this,c=a.options.rangeSelector,e=c.buttons||[].concat(b.defaultButtons),f=c.selected,l=function(){var a=b.minInput,c=b.maxInput;a&&a.blur&&h(a,"blur");c&&c.blur&&h(c,"blur")};b.chart=a;b.options=c;b.buttons=[];a.extraTopMargin=c.height;b.buttonOptions=e;this.unMouseDown=
m(a.container,"mousedown",l);this.unResize=m(a,"resize",l);d(e,b.computeButtonRange);void 0!==f&&e[f]&&this.clickButton(f,!1);m(a,"load",function(){m(a.xAxis[0],"setExtremes",function(c){this.max-this.min!==a.fixedRange&&"rangeSelectorButton"!==c.trigger&&"updatedData"!==c.trigger&&b.forcedDataGrouping&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var a=this.chart,b=a.xAxis[0],e=Math.round(b.max-b.min),f=!b.hasVisibleSeries,a=a.scroller&&a.scroller.getUnionExtremes()||b,g=a.dataMin,
l=a.dataMax,a=this.getYTDExtremes(l,g,r),h=a.min,k=a.max,m=this.selected,p=u(m),B=this.options.allButtonsEnabled,q=this.buttons;d(this.buttonOptions,function(a,c){var d=a._range,z=a.type,t=a.count||1;a=q[c];var x=0;c=c===m;var n=d>l-g,A=d<b.minRange,H=!1,r=!1,d=d===e;("month"===z||"year"===z)&&e>=864E5*{month:28,year:365}[z]*t&&e<=864E5*{month:31,year:366}[z]*t?d=!0:"ytd"===z?(d=k-h===e,H=!c):"all"===z&&(d=b.max-b.min>=l-g,r=!c&&p&&d);z=!B&&(n||A||r||f);d=c&&d||d&&!p&&!H;z?x=3:d&&(p=!0,x=2);a.state!==
x&&a.setState(x)})},computeButtonRange:function(a){var b=a.type,c=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*c;else if("month"===b||"year"===b)a._range=864E5*{month:30,year:365}[b]*c},setInputValue:function(a,b){var c=this.chart.options.rangeSelector,d=this[a+"Input"];w(b)&&(d.previousValue=d.HCTime,d.HCTime=b);d.value=I(c.inputEditDateFormat||"%Y-%m-%d",d.HCTime);this[a+"DateBox"].attr({text:I(c.inputDateFormat||"%b %e, %Y",d.HCTime)})},
showInput:function(a){var b=this.inputGroup,c=this[a+"DateBox"];G(this[a+"Input"],{left:b.translateX+c.x+"px",top:b.translateY+"px",width:c.width-2+"px",height:c.height-2+"px",border:"2px solid silver"})},hideInput:function(a){G(this[a+"Input"],{border:0,width:"1px",height:"1px"});this.setInputValue(a)},drawInput:function(a){function c(){var a=p.value,b=(h.inputDateParser||Date.parse)(a),c=e.xAxis[0],l=e.scroller&&e.scroller.xAxis?e.scroller.xAxis:c,f=l.dataMin,l=l.dataMax;b!==p.previousValue&&(p.previousValue=
b,u(b)||(b=a.split("-"),b=Date.UTC(E(b[0]),E(b[1])-1,E(b[2]))),u(b)&&(r||(b+=6E4*(new Date).getTimezoneOffset()),m?b>d.maxInput.HCTime?b=void 0:b<f&&(b=f):b<d.minInput.HCTime?b=void 0:b>l&&(b=l),void 0!==b&&c.setExtremes(m?b:c.min,m?c.max:b,void 0,void 0,{trigger:"rangeSelectorInput"})))}var d=this,e=d.chart,g=e.renderer.style||{},l=e.renderer,h=e.options.rangeSelector,k=d.div,m="min"===a,p,B,q=this.inputGroup;this[a+"Label"]=B=l.label(C.lang[m?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(q);
q.offset+=B.width+5;this[a+"DateBox"]=l=l.label("",q.offset).addClass("highcharts-range-input").attr({padding:2,width:h.inputBoxWidth||90,height:h.inputBoxHeight||17,stroke:h.inputBoxBorderColor||"#cccccc","stroke-width":1,"text-align":"center"}).on("click",function(){d.showInput(a);d[a+"Input"].focus()}).add(q);q.offset+=l.width+(m?10:0);this[a+"Input"]=p=v("input",{name:a,className:"highcharts-range-selector",type:"text"},{top:e.plotTop+"px"},k);B.css(f(g,h.labelStyle));l.css(f({color:"#333333"},
g,h.inputStyle));G(p,b({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:g.fontSize,fontFamily:g.fontFamily,left:"-9em"},h.inputStyle));p.onfocus=function(){d.showInput(a)};p.onblur=function(){d.hideInput(a)};p.onchange=c;p.onkeypress=function(a){13===a.keyCode&&c()}},getPosition:function(){var a=this.chart,b=a.options.rangeSelector,a=g((b.buttonPosition||{}).y,a.plotTop-a.axisOffset[0]-b.height);return{buttonTop:a,inputTop:a-10}},getYTDExtremes:function(a,
b,d){var c=new k(a),e=c[k.hcGetFullYear]();d=d?k.UTC(e,0,1):+new k(e,0,1);b=Math.max(b||0,d);c=c.getTime();return{max:Math.min(a||c,c),min:b}},render:function(a,e){var c=this,f=c.chart,h=f.renderer,l=f.container,k=f.options,m=k.exporting&&!1!==k.exporting.enabled&&k.navigation&&k.navigation.buttonOptions,n=k.rangeSelector,p=c.buttons,k=C.lang,B=c.div,B=c.inputGroup,q=n.buttonTheme,r=n.buttonPosition||{},u=n.inputEnabled,y=q&&q.states,D=f.plotLeft,E,G=this.getPosition(),F=c.group,I=c.rendered;!1!==
n.enabled&&(I||(c.group=F=h.g("range-selector-buttons").add(),c.zoomText=h.text(k.rangeSelectorZoom,g(r.x,D),15).css(n.labelStyle).add(F),E=g(r.x,D)+c.zoomText.getBBox().width+5,d(c.buttonOptions,function(a,b){p[b]=h.button(a.text,E,0,function(){c.clickButton(b);c.isActive=!0},q,y&&y.hover,y&&y.select,y&&y.disabled).attr({"text-align":"center"}).add(F);E+=p[b].width+g(n.buttonSpacing,5)}),!1!==u&&(c.div=B=v("div",null,{position:"relative",height:0,zIndex:1}),l.parentNode.insertBefore(B,l),c.inputGroup=
B=h.g("input-group").add(),B.offset=0,c.drawInput("min"),c.drawInput("max"))),c.updateButtonStates(),F[I?"animate":"attr"]({translateY:G.buttonTop}),!1!==u&&(B.align(b({y:G.inputTop,width:B.offset,x:m&&G.inputTop<(m.y||0)+m.height-f.spacing[0]?-40:0},n.inputPosition),!0,f.spacingBox),w(u)||(f=F.getBBox(),B[B.alignAttr.translateX<f.x+f.width+10?"hide":"show"]()),c.setInputValue("min",a),c.setInputValue("max",e)),c.rendered=!0)},update:function(a){var b=this.chart;f(!0,b.options.rangeSelector,a);this.destroy();
this.init(b)},destroy:function(){var b=this,d=b.minInput,f=b.maxInput;b.unMouseDown();b.unResize();J(b.buttons);d&&(d.onfocus=d.onblur=d.onchange=null);f&&(f.onfocus=f.onblur=f.onchange=null);a.objectEach(b,function(a,c){a&&"chart"!==c&&(a.destroy?a.destroy():a.nodeType&&e(this[c]));a!==F.prototype[c]&&(b[c]=null)},this)}};y.prototype.toFixedRange=function(a,b,d,e){var c=this.chart&&this.chart.fixedRange;a=g(d,this.translate(a,!0,!this.horiz));b=g(e,this.translate(b,!0,!this.horiz));d=c&&(b-a)/c;
.7<d&&1.3>d&&(e?a=b-c:b=a+c);u(a)||(a=b=void 0);return{min:a,max:b}};y.prototype.minFromRange=function(){var a=this.range,b={month:"Month",year:"FullYear"}[a.type],d,e=this.max,f,l,h=function(a,c){var d=new Date(a),e=d["get"+b]();d["set"+b](e+c);e===d["get"+b]()&&d.setDate(0);return d.getTime()-a};u(a)?(d=e-a,l=a):(d=e+h(e,-a.count),this.chart&&(this.chart.fixedRange=e-d));f=g(this.dataMin,Number.MIN_VALUE);u(d)||(d=f);d<=f&&(d=f,void 0===l&&(l=h(d,a.count)),this.newMax=Math.min(d+l,this.dataMax));
u(e)||(d=void 0);return d};q(D.prototype,"init",function(a,b,d){m(this,"init",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=new F(this))});a.call(this,b,d)});D.prototype.callbacks.push(function(a){function b(){d=a.xAxis[0].getExtremes();u(d.min)&&c.render(d.min,d.max)}var d,c=a.rangeSelector,e,f;c&&(f=m(a.xAxis[0],"afterSetExtremes",function(a){c.render(a.min,a.max)}),e=m(a,"redraw",b),b());m(a,"destroy",function(){c&&(e(),f())})});a.RangeSelector=F})(L);(function(a){var F=a.arrayMax,
m=a.arrayMin,y=a.Axis,D=a.Chart,G=a.defined,v=a.each,I=a.extend,C=a.format,r=a.grep,w=a.inArray,J=a.isNumber,e=a.isString,d=a.map,b=a.merge,h=a.pick,k=a.Point,u=a.Renderer,f=a.Series,g=a.splat,E=a.SVGRenderer,p=a.VMLRenderer,q=a.wrap,c=f.prototype,n=c.init,x=c.processData,H=k.prototype.tooltipFormatter;a.StockChart=a.stockChart=function(c,f,k){var l=e(c)||c.nodeName,m=arguments[l?1:0],t=m.series,z=a.getOptions(),p,q=h(m.navigator&&m.navigator.enabled,z.navigator.enabled,!0),r=q?{startOnTick:!1,endOnTick:!1}:
null,n={marker:{enabled:!1,radius:2}},u={shadow:!1,borderWidth:0};m.xAxis=d(g(m.xAxis||{}),function(a){return b({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},z.xAxis,a,{type:"datetime",categories:null},r)});m.yAxis=d(g(m.yAxis||{}),function(a){p=h(a.opposite,!0);return b({labels:{y:-2},opposite:p,showLastLabel:!1,title:{text:null}},z.yAxis,a)});m.series=null;m=b({chart:{panning:!0,pinchType:"x"},navigator:{enabled:q},scrollbar:{enabled:h(z.scrollbar.enabled,
!0)},rangeSelector:{enabled:h(z.rangeSelector.enabled,!0)},title:{text:null},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:n,spline:n,area:n,areaspline:n,arearange:n,areasplinerange:n,column:u,columnrange:u,candlestick:u,ohlc:u}},m,{isStock:!0});m.series=t;return l?new D(c,m,k):new D(m,f)};q(y.prototype,"autoLabelAlign",function(a){var b=this.chart,d=this.options,b=b._labelPanes=b._labelPanes||{},c=this.options.labels;return this.chart.options.isStock&&"yAxis"===this.coll&&
(d=d.top+","+d.height,!b[d]&&c.enabled)?(15===c.x&&(c.x=0),void 0===c.align&&(c.align="right"),b[d]=this,"right"):a.apply(this,[].slice.call(arguments,1))});q(y.prototype,"destroy",function(a){var b=this.chart,d=this.options&&this.options.top+","+this.options.height;d&&b._labelPanes&&b._labelPanes[d]===this&&delete b._labelPanes[d];return a.apply(this,Array.prototype.slice.call(arguments,1))});q(y.prototype,"getPlotLinePath",function(b,c,f,g,k,m){var l=this,z=this.isLinked&&!this.series?this.linkedParent.series:
this.series,t=l.chart,p=t.renderer,q=l.left,r=l.top,n,A,u,x,y=[],C=[],D,E;if("xAxis"!==l.coll&&"yAxis"!==l.coll)return b.apply(this,[].slice.call(arguments,1));C=function(a){var b="xAxis"===a?"yAxis":"xAxis";a=l.options[b];return J(a)?[t[b][a]]:e(a)?[t.get(a)]:d(z,function(a){return a[b]})}(l.coll);v(l.isXAxis?t.yAxis:t.xAxis,function(a){if(G(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?"yAxis":"xAxis",b=G(a.options[b])?t[b][a.options[b]]:t[b][0];l===b&&C.push(a)}});D=C.length?
[]:[l.isXAxis?t.yAxis[0]:t.xAxis[0]];v(C,function(b){-1!==w(b,D)||a.find(D,function(a){return a.pos===b.pos&&a.len&&b.len})||D.push(b)});E=h(m,l.translate(c,null,null,g));J(E)&&(l.horiz?v(D,function(a){var b;A=a.pos;x=A+a.len;n=u=Math.round(E+l.transB);if(n<q||n>q+l.width)k?n=u=Math.min(Math.max(q,n),q+l.width):b=!0;b||y.push("M",n,A,"L",u,x)}):v(D,function(a){var b;n=a.pos;u=n+a.len;A=x=Math.round(r+l.height-E);if(A<r||A>r+l.height)k?A=x=Math.min(Math.max(r,A),l.top+l.height):b=!0;b||y.push("M",
n,A,"L",u,x)}));return 0<y.length?p.crispPolyLine(y,f||1):null});y.prototype.getPlotBandPath=function(a,b){b=this.getPlotLinePath(b,null,null,!0);a=this.getPlotLinePath(a,null,null,!0);var d=[],c;if(a&&b)if(a.toString()===b.toString())d=a,d.flat=!0;else for(c=0;c<a.length;c+=6)d.push("M",a[c+1],a[c+2],"L",a[c+4],a[c+5],b[c+4],b[c+5],b[c+1],b[c+2],"z");else d=null;return d};E.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+1]=a[c+4]=Math.round(a[c+1])-b%2/
2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=Math.round(a[c+2])+b%2/2);return a};u===p&&(p.prototype.crispPolyLine=E.prototype.crispPolyLine);q(y.prototype,"hideCrosshair",function(a,b){a.call(this,b);this.crossLabel&&(this.crossLabel=this.crossLabel.hide())});q(y.prototype,"drawCrosshair",function(a,b,c){var d,e;a.call(this,b,c);if(G(this.crosshair.label)&&this.crosshair.label.enabled&&this.cross){a=this.chart;var f=this.options.crosshair.label,g=this.horiz;d=this.opposite;e=this.left;var l=this.top,k=this.crossLabel,
m,n=f.format,p="",q="inside"===this.options.tickPosition,t=!1!==this.crosshair.snap,r=0;b||(b=this.cross&&this.cross.e);m=g?"center":d?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";k||(k=this.crossLabel=a.renderer.label(null,null,null,f.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&&" highcharts-color-"+this.series[0].colorIndex)).attr({align:f.align||m,padding:h(f.padding,8),r:h(f.borderRadius,3),zIndex:2}).add(this.labelGroup),k.attr({fill:f.backgroundColor||
this.series[0]&&this.series[0].color||"#666666",stroke:f.borderColor||"","stroke-width":f.borderWidth||0}).css(I({color:"#ffffff",fontWeight:"normal",fontSize:"11px",textAlign:"center"},f.style)));g?(m=t?c.plotX+e:b.chartX,l+=d?0:this.height):(m=d?this.width+e:0,l=t?c.plotY+l:b.chartY);n||f.formatter||(this.isDatetimeAxis&&(p="%b %d, %Y"),n="{value"+(p?":"+p:"")+"}");b=t?c[this.isXAxis?"x":"y"]:this.toValue(g?b.chartX:b.chartY);k.attr({text:n?C(n,{value:b}):f.formatter.call(this,b),x:m,y:l,visibility:"visible"});
b=k.getBBox();if(g){if(q&&!d||!q&&d)l=k.y-b.height}else l=k.y-b.height/2;g?(d=e-b.x,e=e+this.width-b.x):(d="left"===this.labelAlign?e:0,e="right"===this.labelAlign?e+this.width:a.chartWidth);k.translateX<d&&(r=d-k.translateX);k.translateX+b.width>=e&&(r=-(k.translateX+b.width-e));k.attr({x:m+r,y:l,anchorX:g?m:this.opposite?0:a.chartWidth,anchorY:g?this.opposite?a.chartHeight:0:l+b.height/2})}});c.init=function(){n.apply(this,arguments);this.setCompare(this.options.compare)};c.setCompare=function(a){this.modifyValue=
"value"===a||"percent"===a?function(b,c){var d=this.compareValue;if(void 0!==b&&void 0!==d)return b="value"===a?b-d:b/d*100-(100===this.options.compareBase?0:100),c&&(c.change=b),b}:null;this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty=!0)};c.processData=function(){var a,b=-1,c,d,e,f;x.apply(this,arguments);if(this.xAxis&&this.processedYData)for(c=this.processedXData,d=this.processedYData,e=d.length,this.pointArrayMap&&(b=w("close",this.pointArrayMap),-1===b&&(b=w(this.pointValKey||
"y",this.pointArrayMap))),a=0;a<e-1;a++)if(f=d[a]&&-1<b?d[a][b]:d[a],J(f)&&c[a+1]>=this.xAxis.min&&0!==f){this.compareValue=f;break}};q(c,"getExtremes",function(a){var b;a.apply(this,[].slice.call(arguments,1));this.modifyValue&&(b=[this.modifyValue(this.dataMin),this.modifyValue(this.dataMax)],this.dataMin=m(b),this.dataMax=F(b))});y.prototype.setCompare=function(a,b){this.isXAxis||(v(this.series,function(b){b.setCompare(a)}),h(b,!0)&&this.chart.redraw())};k.prototype.tooltipFormatter=function(b){b=
b.replace("{point.change}",(0<this.change?"+":"")+a.numberFormat(this.change,h(this.series.tooltipOptions.changeDecimals,2)));return H.apply(this,[b])};q(f.prototype,"render",function(a){this.chart.is3d&&this.chart.is3d()||this.chart.polar||!this.xAxis||this.xAxis.isRadial||(!this.clipBox&&this.animate?(this.clipBox=b(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]?this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len}):
this.clipBox&&(this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len));a.call(this)});q(D.prototype,"getSelectedPoints",function(a){var b=a.call(this);v(this.series,function(a){a.hasGroupedData&&(b=b.concat(r(a.points||[],function(a){return a.selected})))});return b});q(D.prototype,"update",function(a,c){"scrollbar"in c&&this.navigator&&(b(!0,this.options.scrollbar,c.scrollbar),this.navigator.update({},!1),delete c.scrollbar);return a.apply(this,Array.prototype.slice.call(arguments,
1))})})(L)});
