/*
 Highcharts JS v6.0.4 (2017-12-15)
 Highstock as a plugin for Highcharts

 (c) 2017 Torstein Honsi

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