/*
 Highcharts JS v6.0.2 (2017-10-20)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

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