/*
 Highcharts JS v5.0.4 (2016-11-25)
 Exporting module

 (c) 2010-2016 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(l){"object"===typeof module&&module.exports?module.exports=l:l(Highcharts)})(function(l){(function(f){var l=f.defaultOptions,u=f.doc,A=f.Chart,x=f.addEvent,H=f.removeEvent,F=f.fireEvent,w=f.createElement,B=f.discardElement,G=f.css,v=f.merge,C=f.pick,t=f.each,y=f.extend,z=f.win,D=f.SVGRenderer,I=f.Renderer.prototype.symbols;y(l.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",
contextButtonTitle:"Chart context menu"});l.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};l.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},
{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(a,b,c){var e;a=w("form",v({method:"post",action:a,enctype:"multipart/form-data"},c),{display:"none"},u.body);for(e in b)w("input",{type:"hidden",name:e,value:b[e]},
null,a);a.submit();B(a)};y(A.prototype,{sanitizeSVG:function(a,b){if(b&&b.exporting&&b.exporting.allowHTML){var c=a.match(/<\/svg>(.*?$)/);c&&(c='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+b.chart.width+'" height\x3d"'+b.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+c[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",a=a.replace("\x3c/svg\x3e",c+"\x3c/svg\x3e"))}return a=a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,
"").replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'\x3csvg xmlns:xlink\x3d"http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?href=/g," xlink:href\x3d").replace(/\n/," ").replace(/<\/svg>.*?$/,"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/&nbsp;/g,"\u00a0").replace(/&shy;/g,"\u00ad")},getChartHTML:function(){this.inlineStyles();return this.container.innerHTML},
getSVG:function(a){var b=this,c,e,m,E,h,d=v(b.options,a);u.createElementNS||(u.createElementNS=function(a,b){return u.createElement(b)});e=w("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},u.body);m=b.renderTo.style.width;h=b.renderTo.style.height;m=d.exporting.sourceWidth||d.chart.width||/px$/.test(m)&&parseInt(m,10)||600;h=d.exporting.sourceHeight||d.chart.height||/px$/.test(h)&&parseInt(h,10)||400;y(d.chart,{animation:!1,renderTo:e,forExport:!0,
renderer:"SVGRenderer",width:m,height:h});d.exporting.enabled=!1;delete d.data;d.series=[];t(b.series,function(a){E=v(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});E.isInternal||d.series.push(E)});c=new f.Chart(d,b.callback);a&&t(["xAxis","yAxis","series"],function(b){var e={};a[b]&&(e[b]=a[b],c.update(e))});t(["xAxis","yAxis"],function(a){t(b[a],function(b,e){e=c[a][e];var d=b.getExtremes();b=d.userMin;d=d.userMax;!e||void 0===b&&void 0===d||e.setExtremes(b,
d,!0,!1)})});m=c.getChartHTML();m=b.sanitizeSVG(m,d);d=null;c.destroy();B(e);return m},getSVGForExport:function(a,b){var c=this.options.exporting;return this.getSVG(v({chart:{borderRadius:0}},c.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||c.sourceWidth,sourceHeight:a&&a.sourceHeight||c.sourceHeight}}))},exportChart:function(a,b){b=this.getSVGForExport(a,b);a=v(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:b},a.formAttributes)},
print:function(){var a=this,b=a.container,c=[],e=b.parentNode,m=u.body,f=m.childNodes,h=a.options.exporting.printMaxWidth,d,p;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);F(a,"beforePrint");if(p=h&&a.chartWidth>h)d=[a.options.chart.width,void 0,!1],a.setSize(h,void 0,!1);t(f,function(a,b){1===a.nodeType&&(c[b]=a.style.display,a.style.display="none")});m.appendChild(b);z.focus();z.print();setTimeout(function(){e.appendChild(b);t(f,function(a,b){1===a.nodeType&&(a.style.display=c[b])});
a.isPrinting=!1;p&&a.setSize.apply(a,d);F(a,"afterPrint")},1E3)}},contextMenu:function(a,b,c,e,m,f,h){var d=this,p=d.chartWidth,g=d.chartHeight,k="cache-"+a,n=d[k],q=Math.max(m,f),r,l;n||(d[k]=n=w("div",{className:a},{position:"absolute",zIndex:1E3,padding:q+"px"},d.container),r=w("div",{className:"highcharts-menu"},null,n),l=function(){G(n,{display:"none"});h&&h.setState(0);d.openMenu=!1},x(n,"mouseleave",function(){n.hideTimer=setTimeout(l,500)}),x(n,"mouseenter",function(){clearTimeout(n.hideTimer)}),
k=x(u,"mouseup",function(b){d.pointer.inClass(b.target,a)||l()}),x(d,"destroy",k),t(b,function(a){if(a){var b;b=a.separator?w("hr",null,null,r):w("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();l();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},null,r);d.exportDivElements.push(b)}}),d.exportDivElements.push(r,n),d.exportMenuWidth=n.offsetWidth,d.exportMenuHeight=n.offsetHeight);b={display:"block"};c+d.exportMenuWidth>p?b.right=
p-c-m-q+"px":b.left=c-q+"px";e+f+d.exportMenuHeight>g&&"top"!==h.alignOptions.verticalAlign?b.bottom=g-e-q+"px":b.top=e+f-q+"px";G(n,b);d.openMenu=!0},addButton:function(a){var b=this,c=b.renderer,e=v(b.options.navigation.buttonOptions,a),f=e.onclick,l=e.menuItems,h,d,p=e.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==e.enabled){var g=e.theme,k=g.states,n=k&&k.hover,k=k&&k.select,q;delete g.states;f?q=function(a){a.stopPropagation();
f.call(b,a)}:l&&(q=function(){b.contextMenu(d.menuClassName,l,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});e.text&&e.symbol?g.paddingLeft=C(g.paddingLeft,25):e.text||y(g,{width:e.width,height:e.height,padding:0});d=c.button(e.text,0,0,q,g,n,k).addClass(a.className).attr({title:b.options.lang[e._titleKey],zIndex:3});d.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;e.symbol&&(h=c.symbol(e.symbol,e.symbolX-p/2,e.symbolY-p/2,p,p).addClass("highcharts-button-symbol").attr({zIndex:1}).add(d));
d.add().align(y(e,{width:d.width,x:C(e.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(d.width+e.buttonSpacing)*("right"===e.align?-1:1);b.exportSVGElements.push(d,h)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var c=b.exportDivElements;a&&(t(a,function(a,c){a&&(a.onclick=a.ontouchstart=null,b.exportSVGElements[c]=a.destroy())}),a.length=0);c&&(t(c,function(a,c){clearTimeout(a.hideTimer);H(a,"mouseleave");b.exportDivElements[c]=a.onmouseout=a.onmouseover=a.ontouchstart=
a.onclick=null;B(a)}),c.length=0)}});D.prototype.inlineToAttributes="fill stroke strokeLinecap strokeLinejoin strokeWidth textAnchor x y".split(" ");D.prototype.inlineBlacklist=[/-/,/^(clipPath|cssText|d|height|width)$/,/^font$/,/[lL]ogical(Width|Height)$/,/perspective/,/TapHighlightColor/,/^transition/];D.prototype.unstyledElements=["clipPath","defs","desc"];A.prototype.inlineStyles=function(){function a(a){return a.replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()})}function b(c){var g,
k,n,q="",r,p;if(1===c.nodeType&&-1===l.indexOf(c.nodeName)){k=z.getComputedStyle(c,null);n="svg"===c.nodeName?{}:z.getComputedStyle(c.parentNode,null);h[c.nodeName]||(d||(d=u.createElementNS(f.SVG_NS,"svg"),d.setAttribute("version","1.1"),u.body.appendChild(d)),r=u.createElementNS(c.namespaceURI,c.nodeName),d.appendChild(r),h[c.nodeName]=v(z.getComputedStyle(r,null)),d.removeChild(r));for(g in k){r=!1;for(p=m.length;p--&&!r;)r=m[p].test(g)||"function"===typeof k[g];r||n[g]!==k[g]&&h[c.nodeName][g]!==
k[g]&&(-1!==e.indexOf(g)?c.setAttribute(a(g),k[g]):q+=a(g)+":"+k[g]+";")}q&&(g=c.getAttribute("style"),c.setAttribute("style",(g?g+";":"")+q));"text"!==c.nodeName&&t(c.children||c.childNodes,b)}}var c=this.renderer,e=c.inlineToAttributes,m=c.inlineBlacklist,l=c.unstyledElements,h={},d;b(this.container.querySelector("svg"));d.parentNode.removeChild(d)};I.menu=function(a,b,c,e){return["M",a,b+2.5,"L",a+c,b+2.5,"M",a,b+e/2+.5,"L",a+c,b+e/2+.5,"M",a,b+e-1.5,"L",a+c,b+e-1.5]};A.prototype.renderExporting=
function(){var a,b=this.options.exporting,c=b.buttons,e=this.isDirtyExporting||!this.exportSVGElements;this.buttonOffset=0;this.isDirtyExporting&&this.destroyExport();if(e&&!1!==b.enabled){for(a in c)this.addButton(c[a]);this.isDirtyExporting=!1}x(this,"destroy",this.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();x(a,"redraw",a.renderExporting);t(["exporting","navigation"],function(b){a[b]={update:function(c,e){a.isDirtyExporting=!0;v(!0,a.options[b],c);C(e,!0)&&a.redraw()}}})})})(l)});
