/*
 Highcharts JS v7.0.3 (2019-02-06)
 Advanced Highstock tools

 (c) 2010-2019 Highsoft AS
 Author: Torstein Honsi

 License: www.highcharts.com/license
*/
(function(l){"object"===typeof module&&module.exports?(l["default"]=l,module.exports=l):"function"===typeof define&&define.amd?define(function(){return l}):l("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(l){(function(f){var h=f.fireEvent,n=f.defined,l=f.pick,r=f.extend,v=f.isNumber,m=f.correctFloat,d=f.NavigationBindings.prototype.utils;d.addFlagFromForm=function(a){return function(b){var c=this,g=c.chart,e=g.toolbar,k=d.getFieldType;b=d.attractToPoint(b,g);var p={type:"flags",onSeries:b.series.id,
shape:a,data:[{x:b.x,y:b.y}],point:{events:{click:function(){var a=this,b=a.options;h(c,"showPopup",{point:a,formType:"annotation-toolbar",options:{langKey:"flags",type:"flags",title:[b.title,k(b.title)],name:[b.name,k(b.name)]},onSubmit:function(b){a.update(c.fieldsToOptions(b.fields,{}))}})}}}};e&&e.guiEnabled||g.addSeries(p);h(c,"showPopup",{formType:"flag",options:{langKey:"flags",type:"flags",title:["A",k("A")],name:["Flag A",k("Flag A")]},onSubmit:function(a){c.fieldsToOptions(a.fields,p.data[0]);
g.addSeries(p)}})}};d.manageIndicators=function(a){var b=this.chart,c={linkedTo:a.linkedTo,type:a.type},g=["ad","cmf","mfi","vbp","vwap"],e="ad atr cci cmf macd mfi roc rsi vwap ao aroon aroonoscillator trix apo dpo ppo natr williamsr linearRegression linearRegressionSlope linearRegressionIntercept linearRegressionAngle".split(" "),k;if("edit"===a.actionType)this.fieldsToOptions(a.fields,c),(a=b.get(a.seriesId))&&a.update(c,!1);else if("remove"===a.actionType){if(a=b.get(a.seriesId))k=a.yAxis,a.linkedSeries&&
a.linkedSeries.forEach(function(a){a.remove(!1)}),a.remove(!1),0<=e.indexOf(a.type)&&(k.remove(!1),this.resizeYAxes())}else c.id=f.uniqueKey(),this.fieldsToOptions(a.fields,c),0<=e.indexOf(a.type)&&(k=b.addAxis({id:f.uniqueKey(),offset:0,opposite:!0,title:{text:""},tickPixelInterval:40,showLastLabel:!1,labels:{align:"left",y:-2}},!1,!1),c.yAxis=k.options.id,this.resizeYAxes()),0<=g.indexOf(a.type)&&(c.params.volumeSeriesID=b.series.filter(function(a){return"column"===a.options.type})[0].options.id),
b.addSeries(c,!1);h(this,"deselectButton",{button:this.selectedButtonElement});b.redraw()};d.updateHeight=function(a,b){b.update({typeOptions:{height:this.chart.yAxis[0].toValue(a.chartY)-b.options.typeOptions.points[1].y}})};d.attractToPoint=function(a,b){var c=b.xAxis[0].toValue(a.chartX);a=b.yAxis[0].toValue(a.chartY);var g=Number.MAX_VALUE,e;b.series.forEach(function(a){a.points.forEach(function(a){a&&g>Math.abs(a.x-c)&&(g=Math.abs(a.x-c),e=a)})});return{x:e.x,y:e.y,below:a<e.y,series:e.series,
xAxis:e.series.xAxis.index||0,yAxis:e.series.yAxis.index||0}};d.isNotNavigatorYAxis=function(a){return"highcharts-navigator-yaxis"!==a.userOptions.className};d.updateNthPoint=function(a){return function(b,c){var g=c.options.typeOptions,e=this.chart.xAxis[0].toValue(b.chartX),k=this.chart.yAxis[0].toValue(b.chartY);g.points.forEach(function(b,c){c>=a&&(b.x=e,b.y=k)});c.update({typeOptions:{points:g.points}})}};r(f.NavigationBindings.prototype,{getYAxisPositions:function(a,b,c){function g(a){return n(a)&&
!v(a)&&a.match("%")}var e=0;a=a.map(function(a){var k=g(a.options.height)?parseFloat(a.options.height)/100:a.height/b;a=g(a.options.top)?parseFloat(a.options.top)/100:m(a.top-a.chart.plotTop)/b;v(k)||(k=c/100);e=m(e+k);return{height:100*k,top:100*a}});a.allAxesHeight=e;return a},getYAxisResizers:function(a){var b=[];a.forEach(function(c,g){c=a[g+1];b[g]=c?{enabled:!0,controlledAxis:{next:[l(c.options.id,c.options.index)]}}:{enabled:!1}});return b},resizeYAxes:function(a){a=a||20;var b=this.chart,
c=b.yAxis.filter(this.utils.isNotNavigatorYAxis),g=c.length,b=this.getYAxisPositions(c,b.plotHeight,a),e=this.getYAxisResizers(c),k=b.allAxesHeight,d=a;1<k?(6>g?(b[0].height=m(b[0].height-d),b=this.recalculateYAxisPositions(b,d)):(a=100/g,b=this.recalculateYAxisPositions(b,a/(g-1),!0,-1)),b[g-1]={top:m(100-a),height:a}):(d=100*m(1-k),5>g?(b[0].height=m(b[0].height+d),b=this.recalculateYAxisPositions(b,d)):b=this.recalculateYAxisPositions(b,d/g,!0,1));b.forEach(function(a,b){c[b].update({height:a.height+
"%",top:a.top+"%",resize:e[b]},!1)})},recalculateYAxisPositions:function(a,b,c,g){a.forEach(function(e,k){k=a[k-1];e.top=k?m(k.height+k.top):0;c&&(e.height=m(e.height+g*b))});return a}});r={segment:{className:"highcharts-segment",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"segment",type:"crookedLine",typeOptions:{points:[{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1)]},arrowSegment:{className:"highcharts-arrow-segment",
start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"arrowSegment",type:"crookedLine",typeOptions:{line:{markerEnd:"arrow"},points:[{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1)]},ray:{className:"highcharts-ray",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"ray",type:"infinityLine",typeOptions:{type:"ray",
points:[{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1)]},arrowRay:{className:"highcharts-arrow-ray",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"arrowRay",type:"infinityLine",typeOptions:{type:"ray",line:{markerEnd:"arrow"},points:[{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1)]},infinityLine:{className:"highcharts-infinity-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);
a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"infinityLine",type:"infinityLine",typeOptions:{type:"line",points:[{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1)]},arrowInfinityLine:{className:"highcharts-arrow-infinity-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"arrowInfinityLine",type:"infinityLine",typeOptions:{type:"line",line:{markerEnd:"arrow"},points:[{x:b,
y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1)]},horizontalLine:{className:"highcharts-horizontal-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);this.chart.addAnnotation({langKey:"horizontalLine",type:"infinityLine",typeOptions:{type:"horizontalLine",points:[{x:b,y:a}]}})}},verticalLine:{className:"highcharts-vertical-line",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);this.chart.addAnnotation({langKey:"verticalLine",
type:"infinityLine",typeOptions:{type:"verticalLine",points:[{x:b,y:a}]}})}},crooked3:{className:"highcharts-crooked3",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"crooked3",type:"crookedLine",typeOptions:{points:[{x:b,y:a},{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1),d.updateNthPoint(2)]},crooked5:{className:"highcharts-crooked5",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);
a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"crookedLine",type:"crookedLine",typeOptions:{points:[{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1),d.updateNthPoint(2),d.updateNthPoint(3),d.updateNthPoint(4)]},elliott3:{className:"highcharts-elliott3",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"elliott3",type:"elliottWave",typeOptions:{points:[{x:b,
y:a},{x:b,y:a},{x:b,y:a}]},labelOptions:{style:{color:"#666666"}}})},steps:[d.updateNthPoint(1),d.updateNthPoint(2)]},elliott5:{className:"highcharts-elliott5",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"elliott5",type:"elliottWave",typeOptions:{points:[{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a},{x:b,y:a}]},labelOptions:{style:{color:"#666666"}}})},steps:[d.updateNthPoint(1),d.updateNthPoint(2),d.updateNthPoint(3),
d.updateNthPoint(4)]},measureX:{className:"highcharts-measure-x",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"measure",type:"measure",typeOptions:{selectType:"x",point:{x:b,y:a,xAxis:0,yAxis:0},crosshairX:{strokeWidth:1,stroke:"#000000"},crosshairY:{enabled:!1,strokeWidth:0,stroke:"#000000"},background:{width:0,height:0,strokeWidth:0,stroke:"#ffffff"}},labelOptions:{style:{color:"#666666"}}})},steps:[d.updateRectSize]},
measureY:{className:"highcharts-measure-y",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"measure",type:"measure",typeOptions:{selectType:"y",point:{x:b,y:a,xAxis:0,yAxis:0},crosshairX:{enabled:!1,strokeWidth:0,stroke:"#000000"},crosshairY:{strokeWidth:1,stroke:"#000000"},background:{width:0,height:0,strokeWidth:0,stroke:"#ffffff"}},labelOptions:{style:{color:"#666666"}}})},steps:[d.updateRectSize]},measureXY:{className:"highcharts-measure-xy",
start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"measure",type:"measure",typeOptions:{selectType:"xy",point:{x:b,y:a,xAxis:0,yAxis:0},background:{width:0,height:0,strokeWidth:0,stroke:"#000000"},crosshairX:{strokeWidth:1,stroke:"#000000"},crosshairY:{strokeWidth:1,stroke:"#000000"}},labelOptions:{style:{color:"#666666"}}})},steps:[d.updateRectSize]},fibonacci:{className:"highcharts-fibonacci",start:function(a){var b=
this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"fibonacci",type:"fibonacci",typeOptions:{points:[{x:b,y:a},{x:b,y:a}]},labelOptions:{style:{color:"#666666"}}})},steps:[d.updateNthPoint(1),d.updateHeight]},parallelChannel:{className:"highcharts-parallel-channel",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"parallelChannel",type:"tunnel",
typeOptions:{points:[{x:b,y:a},{x:b,y:a}]}})},steps:[d.updateNthPoint(1),d.updateHeight]},pitchfork:{className:"highcharts-pitchfork",start:function(a){var b=this.chart.xAxis[0].toValue(a.chartX);a=this.chart.yAxis[0].toValue(a.chartY);return this.chart.addAnnotation({langKey:"pitchfork",type:"pitchfork",typeOptions:{points:[{x:b,y:a,controlPoint:{style:{fill:"red"}}},{x:b,y:a},{x:b,y:a}],innerBackground:{fill:"rgba(100, 170, 255, 0.8)"}},shapeOptions:{strokeWidth:2}})},steps:[d.updateNthPoint(1),
d.updateNthPoint(2)]},verticalCounter:{className:"highcharts-vertical-counter",start:function(a){a=d.attractToPoint(a,this.chart);n(this.verticalCounter)||(this.verticalCounter=0);a=this.chart.addAnnotation({langKey:"verticalCounter",type:"verticalLine",typeOptions:{point:{x:a.x,y:a.y,xAxis:a.xAxis,yAxis:a.yAxis},label:{offset:a.below?40:-40,text:this.verticalCounter.toString()}},labelOptions:{style:{color:"#666666",fontSize:"11px"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}});this.verticalCounter++;
a.options.events.click.call(a,{})}},verticalLabel:{className:"highcharts-vertical-label",start:function(a){a=d.attractToPoint(a,this.chart);a=this.chart.addAnnotation({langKey:"verticalLabel",type:"verticalLine",typeOptions:{point:{x:a.x,y:a.y,xAxis:a.xAxis,yAxis:a.yAxis},label:{offset:a.below?40:-40}},labelOptions:{style:{color:"#666666",fontSize:"11px"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}});a.options.events.click.call(a,{})}},verticalArrow:{className:"highcharts-vertical-arrow",
start:function(a){a=d.attractToPoint(a,this.chart);a=this.chart.addAnnotation({langKey:"verticalArrow",type:"verticalLine",typeOptions:{point:{x:a.x,y:a.y,xAxis:a.xAxis,yAxis:a.yAxis},label:{offset:a.below?40:-40,format:" "},connector:{fill:"none",stroke:a.below?"red":"green"}},shapeOptions:{stroke:"rgba(0, 0, 0, 0.75)",strokeWidth:1}});a.options.events.click.call(a,{})}},flagCirclepin:{className:"highcharts-flag-circlepin",start:d.addFlagFromForm("circlepin")},flagDiamondpin:{className:"highcharts-flag-diamondpin",
start:d.addFlagFromForm("flag")},flagSquarepin:{className:"highcharts-flag-squarepin",start:d.addFlagFromForm("squarepin")},flagSimplepin:{className:"highcharts-flag-simplepin",start:d.addFlagFromForm("nopin")},zoomX:{className:"highcharts-zoom-x",init:function(a){this.chart.update({chart:{zoomType:"x"}});h(this,"deselectButton",{button:a})}},zoomY:{className:"highcharts-zoom-y",init:function(a){this.chart.update({chart:{zoomType:"y"}});h(this,"deselectButton",{button:a})}},zoomXY:{className:"highcharts-zoom-xy",
init:function(a){this.chart.update({chart:{zoomType:"xy"}});h(this,"deselectButton",{button:a})}},seriesTypeLine:{className:"highcharts-series-type-line",init:function(a){this.chart.series[0].update({type:"line",useOhlcData:!0});h(this,"deselectButton",{button:a})}},seriesTypeOhlc:{className:"highcharts-series-type-ohlc",init:function(a){this.chart.series[0].update({type:"ohlc"});h(this,"deselectButton",{button:a})}},seriesTypeCandlestick:{className:"highcharts-series-type-candlestick",init:function(a){this.chart.series[0].update({type:"candlestick"});
h(this,"deselectButton",{button:a})}},fullScreen:{className:"highcharts-full-screen",init:function(a){var b=this.chart;b.fullScreen=new f.FullScreen(b.container);h(this,"deselectButton",{button:a})}},currentPriceIndicator:{className:"highcharts-current-price-indicator",init:function(a){var b=this.chart.series[0],c=b.options,g=c.lastVisiblePrice&&c.lastVisiblePrice.enabled,c=c.lastPrice&&c.lastPrice.enabled,e=this.chart.stockToolbar;e&&e.guiEnabled&&(a.firstChild.style["background-image"]=c?'url("'+
e.options.iconsURL+'current-price-show.svg")':'url("'+e.options.iconsURL+'current-price-hide.svg")');b.update({lastPrice:{enabled:!c,color:"red"},lastVisiblePrice:{enabled:!g,label:{enabled:!0}}});h(this,"deselectButton",{button:a})}},indicators:{className:"highcharts-indicators",init:function(){var a=this;h(a,"showPopup",{formType:"indicators",options:{},onSubmit:function(b){a.utils.manageIndicators.call(a,b)}})}},toggleAnnotations:{className:"highcharts-toggle-annotations",init:function(a){var b=
this.chart.stockToolbar;this.toggledAnnotations=!this.toggledAnnotations;(this.chart.annotations||[]).forEach(function(a){a.setVisibility(!this.toggledAnnotations)},this);b&&b.guiEnabled&&(a.firstChild.style["background-image"]=this.toggledAnnotations?'url("'+b.options.iconsURL+'annotations-hidden.svg")':'url("'+b.options.iconsURL+'annotations-visible.svg")');h(this,"deselectButton",{button:a})}},saveChart:{className:"highcharts-save-chart",init:function(a){var b=this,c=b.chart,g=[],e=[],k=[],d=[];
c.annotations.forEach(function(a,b){g[b]=a.userOptions});c.series.forEach(function(a){a instanceof f.seriesTypes.sma?e.push(a.userOptions):"flags"===a.type&&k.push(a.userOptions)});c.yAxis.forEach(function(a){b.utils.isNotNavigatorYAxis(a)&&d.push(a.options)});f.win.localStorage.setItem("highcharts-chart",JSON.stringify({annotations:g,indicators:e,flags:k,yAxes:d}));h(this,"deselectButton",{button:a})}}};f.setOptions({navigation:{bindings:r}})})(l);(function(f){var h=f.addEvent,n=f.createElement,
l=f.pick,r=f.isArray,v=f.fireEvent,m=f.getStyle,d=f.merge,a=f.css,b=f.win;f.setOptions({lang:{stockTools:{gui:{simpleShapes:"Simple shapes",lines:"Lines",crookedLines:"Crooked lines",measure:"Measure",advanced:"Advanced",toggleAnnotations:"Toggle annotations",verticalLabels:"Vertical labels",flags:"Flags",zoomChange:"Zoom change",typeChange:"Type change",saveChart:"Save chart",indicators:"Indicators",currentPriceIndicator:"Current Price Indicators",zoomX:"Zoom X",zoomY:"Zoom Y",zoomXY:"Zooom XY",
fullScreen:"Fullscreen",typeOHLC:"OHLC",typeLine:"Line",typeCandlestick:"Candlestick",circle:"Circle",label:"Label",rectangle:"Rectangle",flagCirclepin:"Flag circle",flagDiamondpin:"Flag diamond",flagSquarepin:"Flag square",flagSimplepin:"Flag simple",measureXY:"Measure XY",measureX:"Measure X",measureY:"Measure Y",segment:"Segment",arrowSegment:"Arrow segment",ray:"Ray",arrowRay:"Arrow ray",line:"Line",arrowLine:"Arrow line",horizontalLine:"Horizontal line",verticalLine:"Vertical line",infinityLine:"Infinity line",
crooked3:"Crooked 3 line",crooked5:"Crooked 5 line",elliott3:"Elliott 3 line",elliott5:"Elliott 5 line",verticalCounter:"Vertical counter",verticalLabel:"Vertical label",verticalArrow:"Vertical arrow",fibonacci:"Fibonacci",pitchfork:"Pitchfork",parallelChannel:"Parallel channel"}},navigation:{popup:{circle:"Circle",rectangle:"Rectangle",label:"Label",segment:"Segment",arrowSegment:"Arrow segment",ray:"Ray",arrowRay:"Arrow ray",line:"Line",arrowLine:"Arrow line",horizontalLine:"Horizontal line",verticalLine:"Vertical line",
crooked3:"Crooked 3 line",crooked5:"Crooked 5 line",elliott3:"Elliott 3 line",elliott5:"Elliott 5 line",verticalCounter:"Vertical counter",verticalLabel:"Vertical label",verticalArrow:"Vertical arrow",fibonacci:"Fibonacci",pitchfork:"Pitchfork",parallelChannel:"Parallel channel",infinityLine:"Infinity line",measure:"Measure",measureXY:"Measure XY",measureX:"Measure X",measureY:"Measure Y",flags:"Flags",addButton:"add",saveButton:"save",editButton:"edit",removeButton:"remove",series:"Series",volume:"Volume",
connector:"Connector",innerBackground:"Inner background",outerBackground:"Outer background",crosshairX:"Crosshair X",crosshairY:"Crosshair Y",tunnel:"Tunnel",background:"Background"}}},stockTools:{gui:{enabled:!0,className:"highcharts-bindings-wrapper",toolbarClassName:"stocktools-toolbar",iconsURL:"https://code.highcharts.com/7.0.3/gfx/stock-icons/",buttons:"indicators separator simpleShapes lines crookedLines measure advanced toggleAnnotations separator verticalLabels flags separator zoomChange fullScreen typeChange separator currentPriceIndicator saveChart".split(" "),
definitions:{separator:{symbol:"separator.svg"},simpleShapes:{items:["label","circle","rectangle"],circle:{symbol:"circle.svg"},rectangle:{symbol:"rectangle.svg"},label:{symbol:"label.svg"}},flags:{items:["flagCirclepin","flagDiamondpin","flagSquarepin","flagSimplepin"],flagSimplepin:{symbol:"flag-basic.svg"},flagDiamondpin:{symbol:"flag-diamond.svg"},flagSquarepin:{symbol:"flag-trapeze.svg"},flagCirclepin:{symbol:"flag-elipse.svg"}},lines:{items:"segment arrowSegment ray arrowRay line arrowLine horizontalLine verticalLine".split(" "),
segment:{symbol:"segment.svg"},arrowSegment:{symbol:"arrow-segment.svg"},ray:{symbol:"ray.svg"},arrowRay:{symbol:"arrow-ray.svg"},line:{symbol:"line.svg"},arrowLine:{symbol:"arrow-line.svg"},verticalLine:{symbol:"vertical-line.svg"},horizontalLine:{symbol:"horizontal-line.svg"}},crookedLines:{items:["elliott3","elliott5","crooked3","crooked5"],crooked3:{symbol:"crooked-3.svg"},crooked5:{symbol:"crooked-5.svg"},elliott3:{symbol:"elliott-3.svg"},elliott5:{symbol:"elliott-5.svg"}},verticalLabels:{items:["verticalCounter",
"verticalLabel","verticalArrow"],verticalCounter:{symbol:"vertical-counter.svg"},verticalLabel:{symbol:"vertical-label.svg"},verticalArrow:{symbol:"vertical-arrow.svg"}},advanced:{items:["fibonacci","pitchfork","parallelChannel"],pitchfork:{symbol:"pitchfork.svg"},fibonacci:{symbol:"fibonacci.svg"},parallelChannel:{symbol:"parallel-channel.svg"}},measure:{items:["measureXY","measureX","measureY"],measureX:{symbol:"measure-x.svg"},measureY:{symbol:"measure-y.svg"},measureXY:{symbol:"measure-xy.svg"}},
toggleAnnotations:{symbol:"annotations-visible.svg"},currentPriceIndicator:{symbol:"current-price-show.svg"},indicators:{symbol:"indicators.svg"},zoomChange:{items:["zoomX","zoomY","zoomXY"],zoomX:{symbol:"zoom-x.svg"},zoomY:{symbol:"zoom-y.svg"},zoomXY:{symbol:"zoom-xy.svg"}},typeChange:{items:["typeOHLC","typeLine","typeCandlestick"],typeOHLC:{symbol:"series-ohlc.svg"},typeLine:{symbol:"series-line.svg"},typeCandlestick:{symbol:"series-candlestick.svg"}},fullScreen:{symbol:"fullscreen.svg"},saveChart:{symbol:"save-chart.svg"}}}}});
h(f.Chart,"afterGetContainer",function(){this.setStockTools()});h(f.Chart,"getMargins",function(){var a=this.stockTools&&this.stockTools.listWrapper&&this.stockTools.listWrapper.offsetWidth;a&&a<this.plotWidth&&(this.plotLeft+=a)});h(f.Chart,"destroy",function(){this.stockTools&&this.stockTools.destroy()});h(f.Chart,"redraw",function(){this.stockTools&&this.stockTools.guiEnabled&&this.stockTools.redraw()});f.Toolbar=function(a,b,e){this.chart=e;this.options=a;this.lang=b;this.guiEnabled=a.enabled;
this.visible=l(a.visible,!0);this.placed=l(a.placed,!1);this.eventsToUnbind=[];this.guiEnabled&&(this.createHTML(),this.init(),this.showHideNavigatorion());v(this,"afterInit")};f.extend(f.Chart.prototype,{setStockTools:function(a){var b=this.options,c=b.lang;a=d(b.stockTools&&b.stockTools.gui,a&&a.gui);this.stockTools=new f.Toolbar(a,c.stockTools&&c.stockTools.gui,this);this.stockTools.guiEnabled&&(this.isDirtyBox=!0)}});f.Toolbar.prototype={init:function(){var a=this,b=this.lang,e=this.options,d=
this.toolbar,f=a.addSubmenu,w=e.buttons,l=e.definitions,n=d.childNodes,m=this.inIframe(),q;w.forEach(function(c){q=a.addButton(d,l,c,b);m&&"fullScreen"===c&&(q.buttonWrapper.className+=" highcharts-disabled-btn");["click","touchstart"].forEach(function(b){h(q.buttonWrapper,b,function(){a.eraseActiveButtons(n,q.buttonWrapper)})});r(l[c].items)&&f.call(a,q,l[c])})},addSubmenu:function(b,g){var c=this,d=b.submenuArrow,p=b.buttonWrapper,w=m(p,"width"),l=this.wrapper,u=this.listWrapper,r=this.toolbar.childNodes,
q=0,t;this.submenu=t=n("ul",{className:"highcharts-submenu-wrapper"},null,p);this.addSubmenuItems(p,g);["click","touchstart"].forEach(function(b){h(d,b,function(b){b.stopPropagation();c.eraseActiveButtons(r,p);0<=p.className.indexOf("highcharts-current")?(u.style.width=u.startWidth+"px",p.classList.remove("highcharts-current"),t.style.display="none"):(t.style.display="block",q=t.offsetHeight-p.offsetHeight-3,t.offsetHeight+p.offsetTop>l.offsetHeight&&p.offsetTop>q||(q=0),a(t,{top:-q+"px",left:w+3+
"px"}),p.className+=" highcharts-current",u.startWidth=l.offsetWidth,u.style.width=u.startWidth+f.getStyle(u,"padding-left")+t.offsetWidth+3+"px")})})},addSubmenuItems:function(a,b){var c=this,g=this.submenu,d=this.lang,f=this.listWrapper,l,n;b.items.forEach(function(e){n=c.addButton(g,b,e,d);["click","touchstart"].forEach(function(b){h(n.mainButton,b,function(){c.switchSymbol(this,a,!0);f.style.width=f.startWidth+"px";g.style.display="none"})})});l=g.querySelectorAll("li \x3e .highcharts-menu-item-btn")[0];
c.switchSymbol(l,!1)},eraseActiveButtons:function(a,b,e){[].forEach.call(a,function(a){a!==b&&(a.classList.remove("highcharts-current"),a.classList.remove("highcharts-active"),e=a.querySelectorAll(".highcharts-submenu-wrapper"),0<e.length&&(e[0].style.display="none"))})},addButton:function(a,b,e,d){var c=this.options;b=b[e];var g=b.items,k=b.className||"",h;e=n("li",{className:l(f.Toolbar.prototype.classMapping[e],"")+" "+k,title:d[e]||e},null,a);a=n("span",{className:"highcharts-menu-item-btn"},
null,e);g&&1<g.length?h=n("span",{className:"highcharts-submenu-item-arrow highcharts-arrow-right"},null,e):a.style["background-image"]="url("+c.iconsURL+b.symbol+")";return{buttonWrapper:e,mainButton:a,submenuArrow:h}},addNavigation:function(){var a=this.wrapper;this.arrowWrapper=n("div",{className:"highcharts-arrow-wrapper"});this.arrowUp=n("div",{className:"highcharts-arrow-up"},null,this.arrowWrapper);this.arrowDown=n("div",{className:"highcharts-arrow-down"},null,this.arrowWrapper);a.insertBefore(this.arrowWrapper,
a.childNodes[0]);this.scrollButtons()},scrollButtons:function(){var a=0,b=this,e=b.wrapper,d=b.toolbar,f=.1*e.offsetHeight;["click","touchstart"].forEach(function(c){h(b.arrowUp,c,function(){0<a&&(a-=f,d.style["margin-top"]=-a+"px")});h(b.arrowDown,c,function(){e.offsetHeight+a<=d.offsetHeight+f&&(a+=f,d.style["margin-top"]=-a+"px")})})},createHTML:function(){var a=this.options,b=this.chart.container,e;this.wrapper=e=n("div",{className:"highcharts-stocktools-wrapper "+a.className});b.parentNode.insertBefore(e,
b);this.toolbar=b=n("ul",{className:"highcharts-stocktools-toolbar "+a.toolbarClassName});this.listWrapper=a=n("div",{className:"highcharts-menu-wrapper"});e.insertBefore(a,e.childNodes[0]);a.insertBefore(b,a.childNodes[0]);this.showHideToolbar();this.addNavigation()},showHideNavigatorion:function(){this.visible&&this.toolbar.offsetHeight>this.wrapper.offsetHeight-50?this.arrowWrapper.style.display="block":(this.toolbar.style.marginTop="0px",this.arrowWrapper.style.display="none")},showHideToolbar:function(){var a=
this.chart,b=this.wrapper,e=this.listWrapper,d=this.submenu,l=this.visible,m;this.showhideBtn=m=n("div",{className:"highcharts-toggle-toolbar highcharts-arrow-left"},null,b);l?(b.style.height="100%",m.style.top=f.getStyle(e,"padding-top")+"px",m.style.left=b.offsetWidth+f.getStyle(e,"padding-left")+"px"):(d&&(d.style.display="none"),m.style.left="0px",this.visible=l=!1,e.classList.add("highcharts-hide"),m.classList.toggle("highcharts-arrow-right"),b.style.height=m.offsetHeight+"px");["click","touchstart"].forEach(function(b){h(m,
b,function(){a.update({stockTools:{gui:{visible:!l,placed:!0}}})})})},switchSymbol:function(a,b){var c=a.parentNode,d=c.classList.value,c=c.parentNode.parentNode;c.className="";d&&c.classList.add(d.trim());c.querySelectorAll(".highcharts-menu-item-btn")[0].style["background-image"]=a.style["background-image"];b&&this.selectButton(c)},selectButton:function(a){0<=a.className.indexOf("highcharts-active")?a.classList.remove("highcharts-active"):a.classList.add("highcharts-active")},unselectAllButtons:function(a){var b=
a.parentNode.querySelectorAll(".highcharts-active");[].forEach.call(b,function(b){b!==a&&b.classList.remove("highcharts-active")})},inIframe:function(){try{return b.self!==b.top}catch(c){return!0}},update:function(a){d(!0,this.chart.options.stockTools,a);this.destroy();this.chart.setStockTools(a);this.chart.navigationBindings&&this.chart.navigationBindings.update()},destroy:function(){var a=this.wrapper,b=a&&a.parentNode;this.eventsToUnbind.forEach(function(a){a()});b&&b.removeChild(a);this.chart.isDirtyBox=
!0;this.chart.redraw()},redraw:function(){this.showHideNavigatorion()},classMapping:{circle:"highcharts-circle-annotation",rectangle:"highcharts-rectangle-annotation",label:"highcharts-label-annotation",segment:"highcharts-segment",arrowSegment:"highcharts-arrow-segment",ray:"highcharts-ray",arrowRay:"highcharts-arrow-ray",line:"highcharts-infinity-line",arrowLine:"highcharts-arrow-infinity-line",verticalLine:"highcharts-vertical-line",horizontalLine:"highcharts-horizontal-line",crooked3:"highcharts-crooked3",
crooked5:"highcharts-crooked5",elliott3:"highcharts-elliott3",elliott5:"highcharts-elliott5",pitchfork:"highcharts-pitchfork",fibonacci:"highcharts-fibonacci",parallelChannel:"highcharts-parallel-channel",measureX:"highcharts-measure-x",measureY:"highcharts-measure-y",measureXY:"highcharts-measure-xy",verticalCounter:"highcharts-vertical-counter",verticalLabel:"highcharts-vertical-label",verticalArrow:"highcharts-vertical-arrow",currentPriceIndicator:"highcharts-current-price-indicator",indicators:"highcharts-indicators",
flagCirclepin:"highcharts-flag-circlepin",flagDiamondpin:"highcharts-flag-diamondpin",flagSquarepin:"highcharts-flag-squarepin",flagSimplepin:"highcharts-flag-simplepin",zoomX:"highcharts-zoom-x",zoomY:"highcharts-zoom-y",zoomXY:"highcharts-zoom-xy",typeLine:"highcharts-series-type-line",typeOHLC:"highcharts-series-type-ohlc",typeCandlestick:"highcharts-series-type-candlestick",fullScreen:"highcharts-full-screen",toggleAnnotations:"highcharts-toggle-annotations",saveChart:"highcharts-save-chart",
separator:"highcharts-separator"}};h(f.NavigationBindings,"selectButton",function(a){var b=a.button,c=this.chart.stockTools;c&&c.guiEnabled&&(c.unselectAllButtons(a.button),0<=b.parentNode.className.indexOf("highcharts-submenu-wrapper")&&(b=b.parentNode.parentNode),c.selectButton(b))});h(f.NavigationBindings,"deselectButton",function(a){a=a.button;var b=this.chart.stockTools;b&&b.guiEnabled&&(0<=a.parentNode.className.indexOf("highcharts-submenu-wrapper")&&(a=a.parentNode.parentNode),b.selectButton(a))})})(l)});
//# sourceMappingURL=stock-tools.js.map
