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