/*!
 * Copyright (c) 2017 NAVER Corp.
 * billboard.js project is licensed under the MIT license
 * 
 * billboard.js, JavaScript chart library
 * http://naver.github.io/billboard.js/
 * 
 * @version 1.0.1
 */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("d3"));else if("function"==typeof define&&define.amd)define(["d3"],e);else{var i=e("object"==typeof exports?require("d3"):t.d3);for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(this,function(t){return function(t){function __webpack_require__(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}var e={};return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,i){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=9)}([function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function extend(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],i=void 0;for(i in e)t[i]=e[i];return t}function addEvent(t,e,i,n){if(L){var r=n||!1;"object"===(void 0===n?"undefined":(0,a.default)(n))&&(r=!!D&&n),t.addEventListener(e,i,r)}else t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function removeEvent(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}e.__esModule=!0,e.isObject=e.isArray=e.merge=e.getRectSegList=e.removeEvent=e.addEvent=e.extend=e.brushEmpty=e.getBrushSelection=e.isEmpty=e.diffDomain=e.getPathBox=e.sanitise=e.hasValue=e.isString=e.getOption=e.asHalfPixel=e.isFunction=e.ceil10=e.notEmpty=e.isUndefined=e.isDefined=e.isValue=void 0;var n=i(5),a=_interopRequireDefault(n),r=i(2),o=i(3),s=_interopRequireDefault(o),l=function(t){return t||0===t},d=function(t){return"function"==typeof t},u=function(t){return"string"==typeof t},c=function(t){return void 0===t},f=function(t){return void 0!==t},g=function(t){return 10*Math.ceil(t/10)},h=function(t){return Math.ceil(t)+.5},p=function(t){return t[1]-t[0]},x=function(t){return void 0===t||null===t||u(t)&&0===t.length||"object"===(void 0===t?"undefined":(0,a.default)(t))&&0===Object.keys(t).length},_=function(t){return!x(t)},v=function(t,e,i){return f(t[e])?t[e]:i},m=function(t,e){var i=!1;return Object.keys(t).forEach(function(n){return t[n]===e&&(i=!0)}),i},y=function(t){return"string"==typeof t?t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):t},b=function(t){var e=t.getBBox(),i=[];return i.push({x:e.x,y:e.y+e.height}),i.push({x:e.x,y:e.y}),i.push({x:e.x+e.width,y:e.y}),i.push({x:e.x+e.width,y:e.y+e.height}),i},T=function(t){var e=t.getBoundingClientRect(),i=b(t);return{x:i[0].x,y:Math.min(i[0].y,i[1].y),width:e.width,height:e.height}},A=function(){var t=null,e=r.event;return e&&"BrushEvent"===e.constructor.name?t=e.selection:this.context&&(t=this.context.select("."+s.default.brush).node())&&(t=(0,r.brushSelection)(t)),t},w=function(){var t=this.getBrushSelection();return!t||t[0]===t[1]},L=!!("addEventListener"in document),D=function(){var t=!1;try{L&&Object.defineProperty&&document.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){t=!0}}))}catch(t){}return t}(),S=function(t){return t&&t.constructor===Array},C=function(t){return t&&!t.nodeType&&"object"===(void 0===t?"undefined":(0,a.default)(t))&&!S(t)},R=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];if(!i.length||1===i.length&&!i[0])return t;var a=i.shift();return C(t)&&C(a)&&Object.keys(a).forEach(function(e){var i=a[e];C(i)?(!t[e]&&(t[e]={}),t[e]=R(t[e],i)):t[e]=S(i)?i.concat():i}),extend.apply(void 0,[t].concat(i))};e.isValue=l,e.isDefined=f,e.isUndefined=c,e.notEmpty=_,e.ceil10=g,e.isFunction=d,e.asHalfPixel=h,e.getOption=v,e.isString=u,e.hasValue=m,e.sanitise=y,e.getPathBox=T,e.diffDomain=p,e.isEmpty=x,e.getBrushSelection=A,e.brushEmpty=w,e.extend=extend,e.addEvent=addEvent,e.removeEvent=removeEvent,e.getRectSegList=b,e.merge=R,e.isArray=S,e.isObject=C},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=i(6),a=_interopRequireDefault(n),r=i(2),o=i(7),s=_interopRequireDefault(o),l=i(3),d=_interopRequireDefault(l),u=i(0),c=function(){function ChartInternal(t){(0,a.default)(this,ChartInternal);var e=this;e.api=t,e.config=e.getOptions(),e.data={},e.cache={},e.axes={}}return ChartInternal.prototype.beforeInit=function(){},ChartInternal.prototype.afterInit=function(){},ChartInternal.prototype.init=function(){var t=this,e=t.config;if(t.initParams(),e.data_url)t.convertUrlToData(e.data_url,e.data_mimeType,e.data_headers,e.data_keys,t.initWithData);else if(e.data_json)t.initWithData(t.convertJsonToData(e.data_json,e.data_keys));else if(e.data_rows)t.initWithData(t.convertRowsToData(e.data_rows));else{if(!e.data_columns)throw Error("url or json or rows or columns is required.");t.initWithData(t.convertColumnsToData(e.data_columns))}},ChartInternal.prototype.initParams=function(){var t=this,e=t.config;t.clipId="bb-"+ +new Date+"-clip",t.clipIdForXAxis=t.clipId+"-xaxis",t.clipIdForYAxis=t.clipId+"-yaxis",t.clipIdForGrid=t.clipId+"-grid",t.clipIdForSubchart=t.clipId+"-subchart",t.clipPath=t.getClipPath(t.clipId),t.clipPathForXAxis=t.getClipPath(t.clipIdForXAxis),t.clipPathForYAxis=t.getClipPath(t.clipIdForYAxis),t.clipPathForGrid=t.getClipPath(t.clipIdForGrid),t.clipPathForSubchart=t.getClipPath(t.clipIdForSubchart),t.dragStart=null,t.dragging=!1,t.flowing=!1,t.cancelClick=!1,t.mouseover=!1,t.transiting=!1,t.color=t.generateColor(),t.levelColor=t.generateLevelColor(),t.dataTimeFormat=e.data_xLocaltime?r.timeParse:r.utcParse,t.axisTimeFormat=e.axis_x_localtime?r.timeFormat:r.utcFormat,t.defaultAxisTimeFormat=function(e){var i=e.getMilliseconds()&&".%L"||e.getSeconds()&&".:%S"||e.getMinutes()&&"%I:%M"||e.getHours()&&"%I %p"||e.getDay()&&1!==e.getDate()&&"%-m/%-d"||1!==e.getDate()&&"%b %d"||e.getMonth()&&"%-m/%-d"||"%Y/%-m/%-d";return t.axisTimeFormat(i)(e)},t.hiddenTargetIds=[],t.hiddenLegendIds=[],t.focusedTargetIds=[],t.defocusedTargetIds=[],t.xOrient=e.axis_rotated?"left":"bottom",t.yOrient=e.axis_rotated?e.axis_y_inner?"top":"bottom":e.axis_y_inner?"right":"left",t.y2Orient=e.axis_rotated?e.axis_y2_inner?"bottom":"top":e.axis_y2_inner?"left":"right",t.subXOrient=e.axis_rotated?"left":"bottom",t.isLegendRight="right"===e.legend_position,t.isLegendInset="inset"===e.legend_position,t.isLegendTop="top-left"===e.legend_inset_anchor||"top-right"===e.legend_inset_anchor,t.isLegendLeft="top-left"===e.legend_inset_anchor||"bottom-left"===e.legend_inset_anchor,t.legendStep=0,t.legendItemWidth=0,t.legendItemHeight=0,t.currentMaxTickWidths={x:0,y:0,y2:0},t.rotated_padding_left=30,t.rotated_padding_right=e.axis_rotated&&!e.axis_x_show?0:30,t.rotated_padding_top=5,t.withoutFadeIn={},t.intervalForObserveInserted=void 0,t.inputType=t.convertInputType(),t.axes.subx=(0,r.selectAll)([])},ChartInternal.prototype.initWithData=function(t){var e=this,i=e.config,n=!0;e.axis=new s.default(e),e.initPie&&e.initPie(),e.initBrush&&e.initBrush(),e.initZoom&&e.initZoom(),e.selectChart=i.bindto?"function"==typeof i.bindto.node?i.bindto:(0,r.select)(i.bindto):(0,r.selectAll)([]),e.selectChart.empty()&&(e.selectChart=(0,r.select)(document.createElement("div")).style("opacity","0"),e.observeInserted(e.selectChart),n=!1),e.selectChart.html("").classed("bb",!0),e.data.xs={},e.data.targets=e.convertDataToTargets(t),i.data_filter&&(e.data.targets=e.data.targets.filter(i.data_filter)),i.data_hide&&e.addHiddenTargetIds(!0===i.data_hide?e.mapToIds(e.data.targets):i.data_hide),i.legend_hide&&e.addHiddenLegendIds(!0===i.legend_hide?e.mapToIds(e.data.targets):i.legend_hide),e.hasType("gauge")&&(i.legend_show=!1),e.updateSizes(),e.updateScales(),e.x.domain((0,r.extent)(e.getXDomain(e.data.targets))),e.y.domain(e.getYDomain(e.data.targets,"y")),e.y2.domain(e.getYDomain(e.data.targets,"y2")),e.subX.domain(e.x.domain()),e.subY.domain(e.y.domain()),e.subY2.domain(e.y2.domain()),e.orgXDomain=e.x.domain();var a="touch"===e.inputType;e.svg=e.selectChart.append("svg").style("overflow","hidden").on(a?"touchstart":"mouseenter",function(){return i.onover.call(e)}).on(a?"touchend":"mouseleave",function(){return i.onout.call(e)}),e.config.svg_classname&&e.svg.attr("class",e.config.svg_classname);var o=e.svg.append("defs");e.clipChart=e.appendClip(o,e.clipId),e.clipXAxis=e.appendClip(o,e.clipIdForXAxis),e.clipYAxis=e.appendClip(o,e.clipIdForYAxis),e.clipGrid=e.appendClip(o,e.clipIdForGrid),e.clipSubchart=e.appendClip(o,e.clipIdForSubchart),e.updateSvgSize();var l=e.svg.append("g").attr("transform",e.getTranslate("main"));e.main=l,i.subchart_show&&e.initSubchart&&e.initSubchart(),e.initTooltip&&e.initTooltip(),e.initLegend&&e.initLegend(),e.initTitle&&e.initTitle(),l.append("text").attr("class",d.default.text+" "+d.default.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),e.initRegion(),e.initGrid(),l.append("g").attr("clip-path",e.clipPath).attr("class",d.default.chart),i.grid_lines_front&&e.initGridLines(),e.initEventRect(),e.initChartElements(),l.insert("rect",i.zoom_privileged?null:"g."+d.default.regions).attr("class",d.default.zoomRect).attr("width",e.width).attr("height",e.height).style("opacity","0").on("dblclick.zoom",null),i.axis_x_extent&&e.brush.scale(e.getDefaultExtent()),e.axis.init(),e.updateTargets(e.data.targets),n&&(e.updateDimension(),e.config.oninit.call(e),e.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),e.bindResize(),e.api.element=e.selectChart.node()},ChartInternal.prototype.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},ChartInternal.prototype.smoothLines=function(t,e){"grid"===e&&t.each(function(){var t=(0,r.select)(this),e=t.attr("x1"),i=t.attr("x2"),n=t.attr("y1"),a=t.attr("y2");t.attr({x1:Math.ceil(e),x2:Math.ceil(i),y1:Math.ceil(n),y2:Math.ceil(a)})})},ChartInternal.prototype.updateSizes=function(){var t=this,e=t.config,i=t.legend?t.getLegendHeight():0,n=t.legend?t.getLegendWidth():0,a=t.isLegendRight||t.isLegendInset?0:i,r=t.hasArcType(),o=e.axis_rotated||r?0:t.getHorizontalAxisHeight("x"),s=e.subchart_show&&!r?e.subchart_size_height+o:0;t.currentWidth=t.getCurrentWidth(),t.currentHeight=t.getCurrentHeight(),t.margin=e.axis_rotated?{top:t.getHorizontalAxisHeight("y2")+t.getCurrentPaddingTop(),right:r?0:t.getCurrentPaddingRight(),bottom:t.getHorizontalAxisHeight("y")+a+t.getCurrentPaddingBottom(),left:s+(r?0:t.getCurrentPaddingLeft())}:{top:4+t.getCurrentPaddingTop(),right:r?0:t.getCurrentPaddingRight(),bottom:o+s+a+t.getCurrentPaddingBottom(),left:r?0:t.getCurrentPaddingLeft()},t.margin2=e.axis_rotated?{top:t.margin.top,right:NaN,bottom:20+a,left:t.rotated_padding_left}:{top:t.currentHeight-s-a,right:NaN,bottom:o+a,left:t.margin.left},t.margin3={top:0,right:NaN,bottom:0,left:0},t.updateSizeForLegend&&t.updateSizeForLegend(i,n),t.width=t.currentWidth-t.margin.left-t.margin.right,t.height=t.currentHeight-t.margin.top-t.margin.bottom,t.width<0&&(t.width=0),t.height<0&&(t.height=0),t.width2=e.axis_rotated?t.margin.left-t.rotated_padding_left-t.rotated_padding_right:t.width,t.height2=e.axis_rotated?t.height:t.currentHeight-t.margin2.top-t.margin2.bottom,t.width2<0&&(t.width2=0),t.height2<0&&(t.height2=0),t.arcWidth=t.width-(t.isLegendRight?n+10:0),t.arcHeight=t.height-(t.isLegendRight?0:10),t.hasType("gauge")&&!e.gauge_fullCircle&&(t.arcHeight+=t.height-t.getGaugeLabelHeight()),t.updateRadius&&t.updateRadius(),t.isLegendRight&&r&&(t.margin3.left=t.arcWidth/2+1.1*t.radiusExpanded)},ChartInternal.prototype.updateTargets=function(t){var e=this;e.updateTargetsForText(t),e.updateTargetsForBar(t),e.updateTargetsForLine(t),e.hasArcType()&&e.updateTargetsForArc&&e.updateTargetsForArc(t),e.updateTargetsForSubchart&&e.updateTargetsForSubchart(t),e.showTargets()},ChartInternal.prototype.showTargets=function(){var t=this;t.svg.selectAll("."+d.default.target).filter(function(e){return t.isTargetToShow(e.id)}).transition().duration(t.config.transition_duration).style("opacity","1")},ChartInternal.prototype.redraw=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],i=this,n=i.main,a=i.config,o=i.getShapeIndices(i.isAreaType),s=i.getShapeIndices(i.isBarType),l=i.getShapeIndices(i.isLineType),c=void 0,f=void 0,g=i.hasArcType(),h=i.filterTargetsToShow(i.data.targets),p=i.xv.bind(i),x=void 0,_=void 0,v=void 0,m=(0,u.getOption)(t,"withY",!0),y=(0,u.getOption)(t,"withSubchart",!0),b=(0,u.getOption)(t,"withTransition",!0),T=(0,u.getOption)(t,"withTransform",!1),A=(0,u.getOption)(t,"withUpdateXDomain",!1),w=(0,u.getOption)(t,"withUpdateOrgXDomain",!1),L=(0,u.getOption)(t,"withTrimXDomain",!0),D=(0,u.getOption)(t,"withUpdateXAxis",A),S=(0,u.getOption)(t,"withLegend",!1),C=(0,u.getOption)(t,"withEventRect",!0),R=(0,u.getOption)(t,"withDimension",!0),I=(0,u.getOption)(t,"withTransitionForExit",b),F=(0,u.getOption)(t,"withTransitionForAxis",b),X=b?a.transition_duration:0,k=I?X:0,M=F?X:0,E=e||i.axis.generateTransitions(M);if("touch"===i.inputType&&i.hideTooltip(),S&&a.legend_show?i.updateLegend(i.mapToIds(i.data.targets),t,E):R&&i.updateDimension(!0),i.isCategorized()&&0===h.length&&i.x.domain([0,i.axes.x.selectAll(".tick").size()]),h.length?(i.updateXDomain(h,A,w,L),!a.axis_x_tick_values&&(x=i.axis.updateXAxisTickValues(h))):(i.xAxis.tickValues([]),i.subXAxis.tickValues([])),a.zoom_rescale&&!t.flow&&(v=i.x.orgDomain()),i.y.domain(i.getYDomain(h,"y",v)),i.y2.domain(i.getYDomain(h,"y2",v)),!a.axis_y_tick_values&&a.axis_y_tick_count&&i.yAxis.tickValues(i.axis.generateTickValues(i.y.domain(),a.axis_y_tick_count,i.isTimeSeriesY())),!a.axis_y2_tick_values&&a.axis_y2_tick_count&&i.y2Axis.tickValues(i.axis.generateTickValues(i.y2.domain(),a.axis_y2_tick_count)),i.axis.redraw(E,g),i.axis.updateLabels(b),(A||D)&&h.length)if(a.axis_x_tick_culling&&x){for(var O=1;O<x.length;O++)if(x.length/O<a.axis_x_tick_culling_max){_=O;break}i.svg.selectAll("."+d.default.axisX+" .tick text").each(function(t){var e=x.indexOf(t);e>=0&&(0,r.select)(this).style("display",e%_?"none":"block")})}else i.svg.selectAll("."+d.default.axisX+" .tick text").style("display","block");var Y=i.generateDrawArea?i.generateDrawArea(o,!1):void 0,z=i.generateDrawBar?i.generateDrawBar(s):void 0,P=i.generateDrawLine?i.generateDrawLine(l,!1):void 0,B=i.generateXYForText(o,s,l,!0),q=i.generateXYForText(o,s,l,!1);m&&(i.subY.domain(i.getYDomain(h,"y")),i.subY2.domain(i.getYDomain(h,"y2"))),i.updateXgridFocus(),n.select("text."+d.default.text+"."+d.default.empty).attr("x",i.width/2).attr("y",i.height/2).text(a.data_empty_label_text).transition().style("opacity",h.length?0:1),i.updateGrid(X),i.updateRegion(X),i.updateBar(k),i.updateLine(k),i.updateArea(k),i.updateCircle(),i.hasDataLabel()&&i.updateText(k),i.redrawTitle&&i.redrawTitle(),i.redrawArc&&i.redrawArc(X,k,T),a.subchart_show&&i.redrawSubchart&&i.redrawSubchart(y,E,X,k,o,s,l),n.selectAll("."+d.default.selectedCircles).filter(i.isBarType.bind(i)).selectAll("circle").remove(),a.interaction_enabled&&!t.flow&&C&&(i.redrawEventRect(),i.updateZoom&&i.updateZoom()),i.updateCircleY();var V=(i.config.axis_rotated?i.circleY:i.circleX).bind(i),W=(i.config.axis_rotated?i.circleX:i.circleY).bind(i);t.flow&&(f=i.generateFlow({targets:h,flow:t.flow,duration:t.flow.duration,drawBar:z,drawLine:P,drawArea:Y,cx:V,cy:W,xv:p,xForText:B,yForText:q})),(X||f)&&i.isTabVisible()?(0,r.transition)().duration(X).each(function(){c=i.generateWait(),[i.redrawBar(z,!0),i.redrawLine(P,!0),i.redrawArea(Y,!0),i.redrawCircle(V,W,!0,f),i.redrawText(B,q,t.flow,!0),i.redrawRegion(!0),i.redrawGrid(!0)].reduce(function(t,e){return e.forEach(function(e){t.push(e)}),t},[]).forEach(function(t){c.add(t)})}).call(c,function(){f&&f(),a.onrendered&&a.onrendered.call(i)}):(i.redrawBar(z),i.redrawLine(P),i.redrawArea(Y),i.redrawCircle(V,W),i.redrawText(B,q,t.flow),i.redrawRegion(),i.redrawGrid(),a.onrendered&&a.onrendered.call(i)),i.mapToIds(i.data.targets).forEach(function(t){i.withoutFadeIn[t]=!0})},ChartInternal.prototype.updateAndRedraw=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,i=e.config,n=void 0;t.withTransition=(0,u.getOption)(t,"withTransition",!0),t.withTransform=(0,u.getOption)(t,"withTransform",!1),t.withLegend=(0,u.getOption)(t,"withLegend",!1),t.withUpdateXDomain=!0,t.withUpdateOrgXDomain=!0,t.withTransitionForExit=!1,t.withTransitionForTransform=(0,u.getOption)(t,"withTransitionForTransform",t.withTransition),e.updateSizes(),t.withLegend&&i.legend_show||(n=e.axis.generateTransitions(t.withTransitionForAxis?i.transition_duration:0),e.updateScales(),e.updateSvgSize(),e.transformAll(t.withTransitionForTransform,n)),e.redraw(t,n)},ChartInternal.prototype.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},ChartInternal.prototype.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},ChartInternal.prototype.isCategorized=function(){return this.config.axis_x_type.indexOf("category")>=0},ChartInternal.prototype.isCustomX=function(){var t=this,e=t.config;return!t.isTimeSeries()&&(e.data_x||(0,u.notEmpty)(e.data_xs))},ChartInternal.prototype.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},ChartInternal.prototype.getTranslate=function(t){var e=this,i=e.config,n=void 0,a=void 0;return"main"===t?(n=(0,u.asHalfPixel)(e.margin.left),a=(0,u.asHalfPixel)(e.margin.top)):"context"===t?(n=(0,u.asHalfPixel)(e.margin2.left),a=(0,u.asHalfPixel)(e.margin2.top)):"legend"===t?(n=e.margin3.left,a=e.margin3.top):"x"===t?(n=0,a=i.axis_rotated?0:e.height):"y"===t?(n=0,a=i.axis_rotated?e.height:0):"y2"===t?(n=i.axis_rotated?0:e.width,a=i.axis_rotated?1:0):"subx"===t?(n=0,a=i.axis_rotated?0:e.height2):"arc"===t&&(n=e.arcWidth/2,a=e.arcHeight/2),"translate("+n+", "+a+")"},ChartInternal.prototype.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?"1":"0"},ChartInternal.prototype.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):"0"},ChartInternal.prototype.opacityForCircle=function(t){var e=this.config.point_show?"1":"0";return(0,u.isValue)(t.value)?this.isScatterType(t)?"0.5":e:"0"},ChartInternal.prototype.opacityForText=function(){return this.hasDataLabel()?"1":"0"},ChartInternal.prototype.xx=function(t){return this.config.zoom_enabled&&this.zoomScale?t?this.zoomScale(t.x):null:t?this.x(t.x):null},ChartInternal.prototype.xv=function(t){var e=this,i=t.value;return e.isTimeSeries()?i=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(i=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(i))},ChartInternal.prototype.yv=function(t){var e=this,i=t.axis&&"y2"===t.axis?e.y2:e.y;return Math.ceil(i(t.value))},ChartInternal.prototype.subxx=function(t){return t?this.subX(t.x):null},ChartInternal.prototype.transformMain=function(t,e){var i=this,n=void 0,a=void 0,r=void 0;e&&e.axisX?n=e.axisX:(n=i.main.select("."+d.default.axisX),t&&(n=n.transition())),e&&e.axisY?a=e.axisY:(a=i.main.select("."+d.default.axisY),t&&(a=a.transition())),e&&e.axisY2?r=e.axisY2:(r=i.main.select("."+d.default.axisY2),t&&(r=r.transition())),(t?i.main.transition():i.main).attr("transform",i.getTranslate("main")),n.attr("transform",i.getTranslate("x")),a.attr("transform",i.getTranslate("y")),r.attr("transform",i.getTranslate("y2")),i.main.select("."+d.default.chartArcs).attr("transform",i.getTranslate("arc"))},ChartInternal.prototype.transformAll=function(t,e){var i=this;i.transformMain(t,e),i.config.subchart_show&&i.transformContext(t,e),i.legend&&i.transformLegend(t)},ChartInternal.prototype.updateSvgSize=function(){var t=this,e=t.svg.select("."+d.default.brush+" .overlay"),i=e.size()?e.attr("height"):0;t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+t.clipIdForXAxis).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForYAxis).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",i),t.svg.select("."+d.default.zoomRect).attr("width",t.width).attr("height",t.height),t.selectChart.style("max-height",t.currentHeight+"px"),t.brush&&t.brush.scale(t.subX,i)},ChartInternal.prototype.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(t),e.updateSvgSize(),e.transformAll(!1)},ChartInternal.prototype.observeInserted=function(t){var e=this;if("undefined"==typeof MutationObserver)return void(console&&console.error&&console.error("MutationObserver not defined."));var i=new MutationObserver(function(n){n.forEach(function(n){"childList"===n.type&&n.previousSibling&&(i.disconnect(),e.intervalForObserveInserted=window.setInterval(function(){t.node().parentNode&&(window.clearInterval(e.intervalForObserveInserted),e.updateDimension(),e.brush&&e.brush.update(),e.config.oninit.call(e),e.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity","1"))},10))})});i.observe(t.node(),{attributes:!0,childList:!0,characterData:!0})},ChartInternal.prototype.bindResize=function(){var t=this,e=t.config;t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){e.onresize.call(t)}),e.resize_auto&&t.resizeFunction.add(function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout(function(){delete t.resizeTimeout,t.api.flush()},100)}),t.resizeFunction.add(function(){e.onresized.call(t)}),(0,u.addEvent)(window,"resize",t.resizeFunction)},ChartInternal.prototype.generateResize=function(){function callResizeFunctions(){t.forEach(function(t){return t()})}var t=[];return callResizeFunctions.add=function(e){t.push(e)},callResizeFunctions.remove=function(e){for(var i=0;i<t.length;i++)if(t[i]===e){t.splice(i,1);break}},callResizeFunctions},ChartInternal.prototype.endall=function(t,e){var i=0;t.each(function(){return++i}).on("end",function(){for(var t=arguments.length,n=Array(t),a=0;a<t;a++)n[a]=arguments[a];--i||e.apply.apply(e,[this].concat(n))})},ChartInternal.prototype.generateWait=function(){var t=[],e=function(e,i){function loop(){var e=0;t.forEach(function(t){if(t.empty())return void(e+=1);try{t.transition()}catch(t){e+=1}}),e===t.length?(clearTimeout(n),i&&i()):n=setTimeout(loop,20)}var n=void 0;loop()};return e.add=function(e){Array.isArray(e)?t=[].concat(t,e):t.push(e)},e},ChartInternal.prototype.parseDate=function(t){var e=this,i=void 0;return t instanceof Date?i=t:"string"==typeof t?i=e.dataTimeFormat(e.config.data_xFormat)(t):"number"==typeof t&&!isNaN(t)&&(i=new Date(+t)),(!i||isNaN(+i))&&console&&console.error&&console.error("Failed to parse x '"+t+"' to Date object"),i},ChartInternal.prototype.isTabVisible=function(){var t=void 0;return void 0===document.hidden?void 0===document.mozHidden?void 0===document.msHidden?void 0!==document.webkitHidden&&(t="webkitHidden"):t="msHidden":t="mozHidden":t="hidden",!document[t]},ChartInternal.prototype.convertInputType=function(){var t=this,e=t.config,i=!!e.interaction_inputType_mouse&&!!("onmouseover"in window),n=void 0;return e.interaction_inputType_touch?(n="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,/PhantomJS/.test(window.navigator.userAgent)&&(n=!1)):n=!1,n&&"touch"||i&&"mouse"||null},ChartInternal}();e.default=c,t.exports=e.default},function(e,i){e.exports=t},function(t,e,i){"use strict";e.__esModule=!0;var n={target:"bb-target",chart:"bb-chart",chartLine:"bb-chart-line",chartLines:"bb-chart-lines",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",chartText:"bb-chart-text",chartTexts:"bb-chart-texts",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsTitle:"bb-chart-arcs-title",chartArcsBackground:"bb-chart-arcs-background",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsSingle:"bb-event-rects-single",eventRectsMultiple:"bb-event-rects-multiple",zoomRect:"bb-zoom-rect",brush:"bb-brush",focused:"bb-focused",defocused:"bb-defocused",region:"bb-region",regions:"bb-regions",title:"bb-title",tooltipContainer:"bb-tooltip-container",tooltip:"bb-tooltip",tooltipName:"bb-tooltip-name",shape:"bb-shape",shapes:"bb-shapes",line:"bb-line",lines:"bb-lines",bar:"bb-bar",bars:"bb-bars",circle:"bb-circle",circles:"bb-circles",arc:"bb-arc",arcs:"bb-arcs",area:"bb-area",areas:"bb-areas",empty:"bb-empty",text:"bb-text",texts:"bb-texts",gaugeValue:"bb-gauge-value",grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgrids:"bb-xgrids",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgridFocus:"bb-xgrid-focus",ygrid:"bb-ygrid",ygrids:"bb-ygrids",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisYLabel:"bb-axis-y-label",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemTile:"bb-legend-item-tile",legendItemHidden:"bb-legend-item-hidden",legendItemFocused:"bb-legend-item-focused",dragarea:"bb-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};e.default=n,t.exports=e.default},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=i(6),a=_interopRequireDefault(n),r=i(1),o=_interopRequireDefault(r),s=function Chart(t){(0,a.default)(this,Chart);var e=new o.default(this);this.internal=e,e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function bindThis(t,e,i){Object.keys(t).forEach(function(n){e[n]=t[n].bind(i),Object.keys(t[n]).length&&bindThis(t[n],e[n],i)})}(Chart.prototype,this,this)};e.default=s,t.exports=e.default},function(t,e,i){"use strict";function _typeof(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}e.__esModule=!0,e.default=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":_typeof(t)}},function(t,e,i){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var n=i(5),a=_interopRequireDefault(n),r=i(6),o=_interopRequireDefault(r),s=i(2),l=i(0),d=i(8),u=_interopRequireDefault(d),c=i(3),f=_interopRequireDefault(c),g=function(){function Axis(t){(0,o.default)(this,Axis),this.owner=t}return Axis.prototype.init=function(){var t=this.owner,e=t.config,i=t.main;t.axes.x=i.append("g").attr("class",f.default.axis+" "+f.default.axisX).attr("clip-path",t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",f.default.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=i.append("g").attr("class",f.default.axis+" "+f.default.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",f.default.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=i.append("g").attr("class",f.default.axis+" "+f.default.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",f.default.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},Axis.prototype.getXAxis=function(t,e,i,n,a,r,o){var s=this.owner,d=s.config,c={isCategory:s.isCategorized(),withOuterTick:a,tickMultiline:d.axis_x_tick_multiline,tickWidth:d.axis_x_tick_width,tickTextRotate:o?0:d.axis_x_tick_rotate,withoutTransition:r},f=(0,u.default)(c).scale(t).orient(e),g=n;return s.isTimeSeries()&&n&&"function"!=typeof n&&(g=n.map(function(t){return s.parseDate(t)})),f.tickFormat(i).tickValues(g),s.isCategorized()&&(f.tickCentered(d.axis_x_tick_centered),(0,l.isEmpty)(d.axis_x_tick_culling)&&(d.axis_x_tick_culling=!1)),f},Axis.prototype.updateXAxisTickValues=function(t,e){var i=this.owner,n=i.config,a=void 0;return(n.axis_x_tick_fit||n.axis_x_tick_count)&&(a=this.generateTickValues(i.mapTargetsToUniqueXs(t),n.axis_x_tick_count,i.isTimeSeries())),e?e.tickValues(a):(i.xAxis.tickValues(a),i.subXAxis.tickValues(a)),a},Axis.prototype.getYAxis=function(t,e,i,n,a,r,o){var s=this.owner,l=s.config,d={withOuterTick:a,withoutTransition:r,tickTextRotate:o?0:l.axis_y_tick_rotate},c=(0,u.default)(d).scale(t).orient(e).tickFormat(i);return s.isTimeSeriesY()?c.ticks(l.axis_y_tick_time_value):c.tickValues(n),c},Axis.prototype.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},Axis.prototype.getXAxisTickFormat=function(){var t=this.owner,e=t.config,i=void 0;return i=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t<0?t.toFixed(0):t},e.axis_x_tick_format&&((0,l.isFunction)(e.axis_x_tick_format)?i=e.axis_x_tick_format:t.isTimeSeries()&&(i=function(i){return i?t.axisTimeFormat(e.axis_x_tick_format)(i):""})),(0,l.isFunction)(i)?function(e){return i.call(t,e)}:i},Axis.prototype.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},Axis.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},Axis.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},Axis.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},Axis.prototype.getLabelOptionByAxisId=function(t){var e=this.owner,i=e.config,n=void 0;return"y"===t?n=i.axis_y_label:"y2"===t?n=i.axis_y2_label:"x"===t&&(n=i.axis_x_label),n},Axis.prototype.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return(0,l.isString)(e)?e:e?e.text:null},Axis.prototype.setLabelText=function(t,e){var i=this.owner,n=i.config,a=this.getLabelOptionByAxisId(t);(0,l.isString)(a)?"y"===t?n.axis_y_label=e:"y2"===t?n.axis_y2_label=e:"x"===t&&(n.axis_x_label=e):a&&(a.text=e)},Axis.prototype.getLabelPosition=function(t,e){var i=this.getLabelOptionByAxisId(t),n="object"===(void 0===i?"undefined":(0,a.default)(i))&&i.position?i.position:e;return{isInner:!!~n.indexOf("inner"),isOuter:!!~n.indexOf("outer"),isLeft:!!~n.indexOf("left"),isCenter:!!~n.indexOf("center"),isRight:!!~n.indexOf("right"),isTop:!!~n.indexOf("top"),isMiddle:!!~n.indexOf("middle"),isBottom:!!~n.indexOf("bottom")}},Axis.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},Axis.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},Axis.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},Axis.prototype.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},Axis.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},Axis.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},Axis.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},Axis.prototype.xForAxisLabel=function(t,e){var i=this.owner;return t?e.isLeft?0:e.isCenter?i.width/2:i.width:e.isBottom?-i.height:e.isMiddle?-i.height/2:0},Axis.prototype.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},Axis.prototype.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},Axis.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},Axis.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},Axis.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},Axis.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},Axis.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},Axis.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},Axis.prototype.dyForXAxisLabel=function(){var t=this.owner,e=t.config,i=this.getXAxisLabelPosition();return e.axis_rotated?i.isInner?"1.2em":-25-this.getMaxTickWidth("x"):i.isInner?"-0.5em":e.axis_x_height?e.axis_x_height-10:"3em"},Axis.prototype.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},Axis.prototype.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},Axis.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},Axis.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},Axis.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},Axis.prototype.getMaxTickWidth=function(t,e){var i=this.owner,n=i.config,a=0,r=void 0,o=void 0;if(e&&i.currentMaxTickWidths[t])return i.currentMaxTickWidths[t];if(i.svg){var l=i.filterTargetsToShow(i.data.targets),d=void 0,u=void 0;"y"===t?(d=i.y.copy().domain(i.getYDomain(l,"y")),u=this.getYAxis(d,i.yOrient,n.axis_y_tick_format,i.yAxisTickValues,!1,!0,!0)):"y2"===t?(d=i.y2.copy().domain(i.getYDomain(l,"y2")),u=this.getYAxis(d,i.y2Orient,n.axis_y2_tick_format,i.y2AxisTickValues,!1,!0,!0)):(d=i.x.copy().domain(i.getXDomain(l)),u=this.getXAxis(d,i.xOrient,i.xAxisTickFormat,i.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(l,u)),r=(0,s.select)("body").append("div").classed("bb",!0),o=r.append("svg").style("visibility","hidden").style("position","fixed").style("top","0px").style("left","0px"),o.append("g").call(u).each(function(){(0,s.select)(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();a<t.width&&(a=t.width)}),r.remove()})}return i.currentMaxTickWidths[t]=a<=0?i.currentMaxTickWidths[t]:a,i.currentMaxTickWidths[t]},Axis.prototype.updateLabels=function(t){var e=this.owner,i=e.main.select("."+f.default.axisX+" ."+f.default.axisXLabel),n=e.main.select("."+f.default.axisY+" ."+f.default.axisYLabel),a=e.main.select("."+f.default.axisY2+"  ."+f.default.axisY2Label);(t?i.transition():i).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?n.transition():n).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?a.transition():a).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},Axis.prototype.getPadding=function(t,e,i,n){var a="number"==typeof t?t:t[e];return(0,l.isValue)(a)?"ratio"===t.unit?t[e]*n:this.convertPixelsToAxisPadding(a,n):i},Axis.prototype.convertPixelsToAxisPadding=function(t,e){var i=this.owner;return e*(t/(i.config.axis_rotated?i.width:i.height))},Axis.prototype.generateTickValues=function(t,e,i){var n=t,a=void 0,r=void 0,o=void 0,s=void 0,d=void 0,u=void 0;if(e){var c=(0,l.isFunction)(e)?e():e;if(1===c)n=[t[0]];else if(2===c)n=[t[0],t[t.length-1]];else if(c>2){for(o=c-2,a=t[0],r=t[t.length-1],s=(r-a)/(o+1),n=[a],d=0;d<o;d++)u=+a+s*(d+1),n.push(i?new Date(u):u);n.push(r)}}return i||(n=n.sort(function(t,e){return t-e})),n},Axis.prototype.generateTransitions=function(t){var e=this.owner,i=e.axes;return{axisX:t?i.x.transition().duration(t):i.x,axisY:t?i.y.transition().duration(t):i.y,axisY2:t?i.y2.transition().duration(t):i.y2,axisSubX:t?i.subx.transition().duration(t):i.subx}},Axis.prototype.redraw=function(t,e){var i=this.owner;i.axes.x.style("opacity",e?"0":"1"),i.axes.y.style("opacity",e?"0":"1"),i.axes.y2.style("opacity",e?"0":"1"),i.axes.subx.style("opacity",e?"0":"1"),t.axisX.call(i.xAxis),t.axisY.call(i.yAxis),t.axisY2.call(i.y2Axis),t.axisSubX.call(i.subXAxis)},Axis}();e.default=g,t.exports=e.default},function(t,e,i){"use strict";e.__esModule=!0;var n=i(5),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);e.default=function(){function axisX(t,e){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+g)+", 0)"})}function axisY(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})}function scaleExtent(t){var e=t[0],i=t[t.length-1];return e<i?[e,i]:[i,e]}function generateTicks(t){var e=[];if(t.ticks)return t.ticks.apply(t,f?Array.prototype.slice.call(f):[]).map(function(t){return/(string|number)/.test(void 0===t?"undefined":(0,a.default)(t))&&!isNaN(t)?Math.round(10*t)/10:t});for(var i=t.domain(),n=Math.ceil(i[0]);n<i[1];n++)e.push(n);return e.length>0&&e[0]>0&&e.unshift(e[0]-(e[1]-e[0])),e}function copyScale(){var i=e.copy();if(t.isCategory||!i.domain().length){var n=e.domain();i.domain([n[0],n[1]-1])}return i}function textFormatted(t){var e=c?c(t):t;return void 0===e?"":e}function getSizeFor1Char(t){if(s)return s;var e={h:11.5,w:5.5};return t.select("text").text(textFormatted).each(function(t){var i=this.getBoundingClientRect(),n=textFormatted(t),a=i.height,r=n?i.width/n.length:void 0;a&&r&&(e.h=a,e.w=r)}).text(""),s=e,e}function transitionise(e){return t.withoutTransition?e:e.transition(x)}function axis(a){a.each(function(){function splitTickText(e,i){function split(t,e){o=void 0;for(var i=1;i<e.length;i++)if(" "===e.charAt(i)&&(o=i),r=e.substr(0,i+1),s=I.w*r.length,a<s)return split(t.concat(e.substr(0,o||i)),e.slice(o?o+1:i));return t.concat(e)}var n=textFormatted(e),a=i,r=void 0,o=void 0,s=void 0;return"[object Array]"===Object.prototype.toString.call(n)?n:((!a||a<=0)&&(a=k?95:t.isCategory?Math.ceil(c(f[1])-c(f[0]))-12:110),split([],n+""))}function tspanDy(t,e){var n=I.h;return 0===e&&(n="left"===i||"right"===i?-((F[t.index]-1)*(I.h/2)-3):".71em"),n}var a=(0,r.select)(this);axis.g=a;var s=this.__chart__||e,c=copyScale();this.__chart__=c;var f=u||generateTicks(c),h=a.selectAll(".tick").data(f,c),x=h.enter().insert("g",".domain").attr("class","tick").style("opacity","1"),_=h.exit().remove();h=x.merge(h);var v=transitionise(h).style("opacity","1"),m=void 0,y=void 0,b=void 0,T=e.rangeExtent?e.rangeExtent():scaleExtent(e.range()),A=a.selectAll(".domain").data([0]),w=A.enter().append("path").attr("class","domain").merge(transitionise(A));x.append("line"),x.append("text");var L=x.select("line"),D=v.select("line"),S=x.select("text"),C=v.select("text");t.isCategory?(g=Math.ceil((c(1)-c(0))/2),y=p?0:g,b=p?g:0):(y=0,g=y);var R=void 0,I=getSizeFor1Char(a.select(".tick")),F=[],X=Math.max(n,0)+d,k="left"===i||"right"===i,M=h.select("text");R=M.selectAll("tspan").data(function(e,i){var n=void 0;return n=t.tickMultiline?splitTickText(e,t.tickWidth):(0,o.isArray)(textFormatted(e))?textFormatted(e).concat():[textFormatted(e)],F[i]=n.length,n.map(function(t){return{index:i,splitted:t}})}),R.exit().remove(),R=R.enter().append("tspan").merge(R).text(function(t){return t.splitted});var E=t.tickTextRotate;if("bottom"===i?(m=axisX,L.attr("y2",n),S.attr("y",X),D.attr("x1",y).attr("x2",y).attr("y2",function(t){var i=e(t)+(p?0:g);return T[0]<i&&i<T[1]?n:0}),C.attr("x",0).attr("y",function(t){return t?11.5-t/15*2.5*(t>0?1:-1):X}(E)).style("text-anchor",function(t){return t?t>0?"start":"end":"middle"}(E)).attr("transform",function(t){return t?"rotate("+t+")":""}(E)),R.attr("x",0).attr("dy",tspanDy).attr("dx",function(t){return t?8*Math.sin(Math.PI*(t/180)):0}(E)),w.attr("d","M"+T[0]+","+l+"V0H"+T[1]+"V"+l)):"top"===i?(m=axisX,L.attr("y2",-n),S.attr("y",-X),D.attr("x2",0).attr("y2",-n),C.attr("x",0).attr("y",-X),M.style("text-anchor","middle"),R.attr("x",0).attr("dy","0em"),w.attr("d","M"+T[0]+","+-l+"V0H"+T[1]+"V"+-l)):"left"===i?(m=axisY,L.attr("x2",-n),S.attr("x",-X),D.attr("x2",-n).attr("y1",b).attr("y2",b),C.attr("x",-X).attr("y",g),M.style("text-anchor","end"),R.attr("x",-X).attr("dy",tspanDy),w.attr("d","M"+-l+","+T[0]+"H0V"+T[1]+"H"+-l)):"right"===i&&(m=axisY,L.attr("x2",n),S.attr("x",X),D.attr("x2",n).attr("y2",0),C.attr("x",X).attr("y",0),M.style("text-anchor","start"),R.attr("x",X).attr("dy",tspanDy),w.attr("d","M"+l+","+T[0]+"H0V"+T[1]+"H"+l)),c.bandwidth){var O=c,Y=O.bandwidth()/2;s=function(t){return O(t)+Y},c=s}else s.bandwidth?s=c:_.call(m,c);x.call(m,s),v.call(m,c)})}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,r.scaleLinear)(),i="bottom",n=6,l=t.withOuterTick?6:0,d=3,u=null,c=void 0,f=void 0,g=0,h=!0,p=void 0,x=void 0;return axis.scale=function(t){return arguments.length?(e=t,axis):e},axis.orient=function(t){return arguments.length?(i=t in{top:1,right:1,bottom:1,left:1}?t+"":"bottom",axis):i},axis.tickFormat=function(t){return arguments.length?(c=t,axis):c},axis.tickCentered=function(t){return arguments.length?(p=t,axis):p},axis.tickOffset=function(){return g},axis.tickInterval=function(){var e=void 0;if(t.isCategory)e=2*g;else{e=(axis.g.select("path.domain").node().getTotalLength()-2*l)/axis.g.selectAll("line").size()}return e===1/0?0:e},axis.ticks=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return e.length?(f=Array.prototype.slice.call(e),axis):f},axis.tickCulling=function(t){return arguments.length?(h=t,axis):h},axis.tickValues=function(t){if("function"==typeof t)u=function(){return t(e.domain())};else{if(!arguments.length)return u;u=t}return this},axis.setTransition=function(t){return x=t,this},axis};var r=i(2),o=i(0),s=void 0;t.exports=e.default},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function _interopRequireWildcard(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}e.__esModule=!0,e.d3=e.bb=void 0;var n=i(2),a=_interopRequireWildcard(n),r=i(4),o=_interopRequireDefault(r),s=i(1),l=_interopRequireDefault(s),d=i(7),u=_interopRequireDefault(d),c=i(0),f=_interopRequireWildcard(c);i(10);var g={version:"1.0.1",generate:function(t){return new o.default(t)},chart:{fn:o.default.prototype,internal:{fn:l.default.prototype,axis:{fn:u.default.prototype}}}};for(var h in f)/^__/.test(h)||(l.default.prototype[h]=f[h]);i(11),i(13),i(14),i(15),i(16),i(17),i(18),i(19),i(20),i(21),i(22),i(23),i(24),i(25),i(26),i(27),i(28),i(29),i(30),i(31),i(32),i(33),i(34),i(35),i(36),i(37),i(38),i(39),i(40),i(41),i(42),i(43),i(44),i(45),i(46),i(47),i(48),i(49),i(50),i(51),i(52),i(53),i(54),i(55),i(56),i(57),i(59),i(8),i(60),e.bb=g,e.d3=a},function(t,e){},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(5),a=_interopRequireDefault(n),r=i(12),o=_interopRequireDefault(r),s=i(1),l=_interopRequireDefault(s),d=i(0);(0,d.extend)(l.default.prototype,{getOptions:function(){var t=new o.default;return(0,d.merge)(t.value,this.additionalConfig)},additionalConfig:{},loadConfig:function(t){function find(){var t=n.shift();return t&&i&&"object"===(void 0===i?"undefined":(0,a.default)(i))&&t in i?(i=i[t],find()):t?void 0:i}var e=this.config,i=void 0,n=void 0,r=void 0;Object.keys(e).forEach(function(a){i=t,n=a.split("_"),r=find(),(0,d.isDefined)(r)&&(e[a]=r)})}})},function(t,e,i){"use strict";e.__esModule=!0;var n=i(6),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=function Options(){(0,a.default)(this,Options),this.value={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,interaction_inputType_mouse:!0,interaction_inputType_touch:!0,onover:function(){},onout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(t){return t},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onover:function(){},data_onout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,pie_padAngle:0,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_label_extents:void 0,gauge_units:void 0,gauge_width:void 0,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,donut_padAngle:0,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(t,e,i,n){return this.getTooltipContent?this.getTooltipContent(t,e,i,n):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"}};e.default=r,t.exports=e.default},function(t,e,i){"use strict";var n=i(2),a=i(1),r=function(t){return t&&t.__esModule?t:{"default":t}}(a);(0,i(0).extend)(r.default.prototype,{getScale:function(t,e,i){return(i?(0,n.scaleTime)():(0,n.scaleLinear)()).range([t,e])},getX:function(t,e,i,n){var a=this,r=a.getScale(t,e,a.isTimeSeries()),o=i?r.domain(i):r,s=void 0,l=void 0;for(s in a.isCategorized()?(l=n||function(){return 0},r=function(t,e){var i=o(t)+l(t);return e?i:Math.ceil(i)}):r=function(t,e){var i=o(t);return e?i:Math.ceil(i)},o)r[s]=o[s];return r.orgDomain=function(){return o.domain()},a.isCategorized()&&(r.domain=function(t){var e=t;return arguments.length?(o.domain(e),r):(e=this.orgDomain(),[e[0],e[1]+1])}),r},getY:function(t,e,i){var n=this.getScale(t,e,this.isTimeSeriesY());return i&&n.domain(i),n},getYScale:function(t){return"y2"===this.axis.getId(t)?this.y2:this.y},getSubYScale:function(t){return"y2"===this.axis.getId(t)?this.subY2:this.subY},updateScales:function(t){var e=this,i=e.config,n=!e.x;e.xMin=i.axis_rotated?1:0,e.xMax=i.axis_rotated?e.height:e.width,e.yMin=i.axis_rotated?0:e.height,e.yMax=i.axis_rotated?e.width:1,e.subXMin=e.xMin,e.subXMax=e.xMax,e.subYMin=i.axis_rotated?0:e.height2,e.subYMax=i.axis_rotated?e.width2:1,e.x=e.getX(e.xMin,e.xMax,n?void 0:e.x.orgDomain(),function(){return e.xAxis.tickOffset()}),e.y=e.getY(e.yMin,e.yMax,n?i.axis_y_default:e.y.domain()),e.y2=e.getY(e.yMin,e.yMax,n?i.axis_y2_default:e.y2.domain()),e.subX=e.getX(e.xMin,e.xMax,e.orgXDomain,function(t){return t%1?0:e.subXAxis.tickOffset()}),e.subY=e.getY(e.subYMin,e.subYMax,n?i.axis_y_default:e.subY.domain()),e.subY2=e.getY(e.subYMin,e.subYMax,n?i.axis_y2_default:e.subY2.domain()),e.xAxisTickFormat=e.axis.getXAxisTickFormat(),e.xAxisTickValues=e.axis.getXAxisTickValues(),e.yAxisTickValues=e.axis.getYAxisTickValues(),e.y2AxisTickValues=e.axis.getY2AxisTickValues(),e.xAxis=e.axis.getXAxis(e.x,e.xOrient,e.xAxisTickFormat,e.xAxisTickValues,i.axis_x_tick_outer,t),e.subXAxis=e.axis.getXAxis(e.subX,e.subXOrient,e.xAxisTickFormat,e.xAxisTickValues,i.axis_x_tick_outer),e.yAxis=e.axis.getYAxis(e.y,e.yOrient,i.axis_y_tick_format,e.yAxisTickValues,i.axis_y_tick_outer),e.y2Axis=e.axis.getYAxis(e.y2,e.y2Orient,i.axis_y2_tick_format,e.y2AxisTickValues,i.axis_y2_tick_outer),e.updateArc&&e.updateArc()}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(5),a=_interopRequireDefault(n),r=i(2),o=i(1),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(s.default.prototype,{getYDomainMin:function(t){var e=this,i=e.config,n=e.mapToIds(t),a=e.getValuesAsIdKeyed(t),o=void 0,s=void 0,l=void 0,d=void 0,u=void 0,c=void 0;if(i.data_groups.length>0)for(c=e.hasNegativeValueInTargets(t),o=0;o<i.data_groups.length;o++)if(d=i.data_groups[o].filter(function(t){return n.indexOf(t)>=0}),0!==d.length)for(l=d[0],c&&a[l]&&a[l].forEach(function(t,e){a[l][e]=t<0?t:0}),s=1;s<d.length;s++)u=d[s],!!a[u]&&a[u].forEach(function(t,i){e.axis.getId(u)===e.axis.getId(l)&&a[l]&&!(c&&+t>0)&&(a[l][i]+=+t)});return(0,r.min)(Object.keys(a).map(function(t){return(0,r.min)(a[t])}))},getYDomainMax:function(t){var e=this,i=e.config,n=e.mapToIds(t),a=e.getValuesAsIdKeyed(t),o=void 0,s=void 0,l=void 0,d=void 0,u=void 0,c=void 0;if(i.data_groups.length>0)for(c=e.hasPositiveValueInTargets(t),o=0;o<i.data_groups.length;o++)if(d=i.data_groups[o].filter(function(t){return n.indexOf(t)>=0}),0!==d.length)for(l=d[0],c&&a[l]&&a[l].forEach(function(t,e){a[l][e]=t>0?t:0}),s=1;s<d.length;s++)u=d[s],!!a[u]&&a[u].forEach(function(t,i){e.axis.getId(u)===e.axis.getId(l)&&a[l]&&!(c&&+t<0)&&(a[l][i]+=+t)});return(0,r.max)(Object.keys(a).map(function(t){return(0,r.max)(a[t])}))},getYDomain:function(t,e,i){var n=this,a=n.config,r=t.filter(function(t){return n.axis.getId(t.id)===e}),o=i?n.filterByXDomain(r,i):r,s="y2"===e?a.axis_y2_min:a.axis_y_min,d="y2"===e?a.axis_y2_max:a.axis_y_max,u=n.getYDomainMin(o),c=n.getYDomainMax(o),f="y2"===e?a.axis_y2_center:a.axis_y_center,g=n.hasType("bar",o)&&a.bar_zerobased||n.hasType("area",o)&&a.area_zerobased,h="y2"===e?a.axis_y2_inverted:a.axis_y_inverted,p=n.hasDataLabel()&&a.axis_rotated,x=n.hasDataLabel()&&!a.axis_rotated,_=void 0;if(u=(0,l.isValue)(s)?s:(0,l.isValue)(d)?u<d?u:d-10:u,c=(0,l.isValue)(d)?d:(0,l.isValue)(s)?s<c?c:s+10:c,0===o.length)return"y2"===e?n.y2.domain():n.y.domain();isNaN(u)&&(u=0),isNaN(c)&&(c=u),u===c&&(u<0?c=0:u=0);var v=u>=0&&c>=0,m=u<=0&&c<=0;((0,l.isValue)(s)&&v||(0,l.isValue)(d)&&m)&&(g=!1),g&&(v&&(u=0),m&&(c=0));var y=Math.abs(c-u),b=.1*y,T=.1*y;if(void 0!==f){var A=Math.max(Math.abs(u),Math.abs(c));c=f+A,u=f-A}if(p){_=n.getDataLabelLength(u,c,"width");var w=(0,l.diffDomain)(n.y.range()),L=[_[0]/w,_[1]/w];b+=y*(L[1]/(1-L[0]-L[1])),T+=y*(L[0]/(1-L[0]-L[1]))}else x&&(_=n.getDataLabelLength(u,c,"height"),b+=n.axis.convertPixelsToAxisPadding(_[1],y),T+=n.axis.convertPixelsToAxisPadding(_[0],y));"y"===e&&(0,l.notEmpty)(a.axis_y_padding)&&(b=n.axis.getPadding(a.axis_y_padding,"top",b,y),T=n.axis.getPadding(a.axis_y_padding,"bottom",T,y)),"y2"===e&&(0,l.notEmpty)(a.axis_y2_padding)&&(b=n.axis.getPadding(a.axis_y2_padding,"top",b,y),T=n.axis.getPadding(a.axis_y2_padding,"bottom",T,y)),g&&(v&&(T=u),m&&(b=-c));var D=[u-T,c+b];return h?D.reverse():D},getXDomainMin:function(t){var e=this,i=e.config;return(0,l.isDefined)(i.axis_x_min)?e.isTimeSeries()?this.parseDate(i.axis_x_min):i.axis_x_min:(0,r.min)(t,function(t){return(0,r.min)(t.values,function(t){return t.x})})},getXDomainMax:function(t){var e=this,i=e.config;return(0,l.isDefined)(i.axis_x_max)?e.isTimeSeries()?this.parseDate(i.axis_x_max):i.axis_x_max:(0,r.max)(t,function(t){return(0,r.max)(t.values,function(t){return t.x})})},getXDomainPadding:function(t){var e=this,i=e.config,n=t[1]-t[0],r=void 0,o=void 0,s=void 0,d=void 0;return e.isCategorized()?o=0:e.hasType("bar")?(r=e.getMaxDataCount(),o=r>1?n/(r-1)/2:.5):o=.01*n,"object"===(0,a.default)(i.axis_x_padding)&&(0,l.notEmpty)(i.axis_x_padding)?(s=(0,l.isValue)(i.axis_x_padding.left)?i.axis_x_padding.left:o,d=(0,l.isValue)(i.axis_x_padding.right)?i.axis_x_padding.right:o):"number"==typeof i.axis_x_padding?(s=i.axis_x_padding,d=i.axis_x_padding):(s=o,d=o),{left:s,right:d}},getXDomain:function(t){var e=this,i=[e.getXDomainMin(t),e.getXDomainMax(t)],n=i[0],a=i[1],r=e.getXDomainPadding(i),o=0,s=0;return n-a!=0||e.isCategorized()||(e.isTimeSeries()?(n=new Date(.5*n.getTime()),a=new Date(1.5*a.getTime())):(n=0===n?1:.5*n,a=0===a?-1:1.5*a)),(n||0===n)&&(o=e.isTimeSeries()?new Date(n.getTime()-r.left):n-r.left),(a||0===a)&&(s=e.isTimeSeries()?new Date(a.getTime()+r.right):a+r.right),[o,s]},updateXDomain:function(t,e,i,n,a){var o=this,s=o.config;if(i&&(o.x.domain(a||(0,r.extent)(o.getXDomain(t))),o.orgXDomain=o.x.domain(),s.zoom_enabled&&o.zoom.updateScaleExtent(),o.subX.domain(o.x.domain()),o.brush&&o.brush.scale(o.subX)),e){var l=a||!o.brush||o.brushEmpty()?o.orgXDomain:o.getBrushSelection().map(function(t){return o.subX.invert(t)});o.x.domain(l),s.zoom_enabled&&o.zoom.updateScaleExtent()}return n&&o.x.domain(o.trimXDomain(o.x.orgDomain())),o.x.domain()},trimXDomain:function(t){var e=this.getZoomDomain(),i=e[0],n=e[1];return t[0]<=i&&(t[1]=+t[1]+(i-t[0]),t[0]=i),n<=t[1]&&(t[0]=+t[0]-(t[1]-n),t[1]=n),t}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(5),a=_interopRequireDefault(n),r=i(2),o=i(3),s=_interopRequireDefault(o),l=i(1),d=_interopRequireDefault(l),u=i(0);(0,u.extend)(d.default.prototype,{isX:function(t){var e=this,i=e.config,n=i.data_x&&t===i.data_x,a=(0,u.notEmpty)(i.data_xs)&&(0,u.hasValue)(i.data_xs,t);return n||a},isNotX:function(t){return!this.isX(t)},getXKey:function(t){var e=this,i=e.config;return i.data_x?i.data_x:(0,u.notEmpty)(i.data_xs)?i.data_xs[t]:null},getXValuesOfXKey:function(t,e){var i=this,n=e&&(0,u.notEmpty)(e)?i.mapToIds(e):[],a=void 0;return n.forEach(function(e){i.getXKey(e)===t&&(a=i.data.xs[e])}),a},getIndexByX:function(t){var e=this,i=e.filterByX(e.data.targets,t);return i.length?i[0].index:null},getXValue:function(t,e){var i=this;return t in i.data.xs&&i.data.xs[t]&&(0,u.isValue)(i.data.xs[t][e])?i.data.xs[t][e]:e},getOtherTargetXs:function(){var t=this,e=Object.keys(t.data.xs);return e.length?t.data.xs[e[0]]:null},getOtherTargetX:function(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},addXs:function(t){var e=this;Object.keys(t).forEach(function(i){e.config.data_xs[i]=t[i]})},hasMultipleX:function(t){return(0,r.set)(Object.keys(t).map(function(e){return t[e]})).size()>1},isMultipleX:function(){return(0,u.notEmpty)(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},addName:function(t){var e=this,i=void 0;return t&&(i=e.config.data_names[t.id],t.name=void 0===i?t.id:i),t},getValueOnIndex:function(t,e){var i=t.filter(function(t){return t.index===e});return i.length?i[0]:null},updateTargetX:function(t,e){var i=this;t.forEach(function(t){t.values.forEach(function(n,a){n.x=i.generateTargetX(e[a],t.id,a)}),i.data.xs[t.id]=e})},updateTargetXs:function(t,e){var i=this;t.forEach(function(t){e[t.id]&&i.updateTargetX([t],e[t.id])})},generateTargetX:function(t,e,i){var n=this;return n.isTimeSeries()?t?n.parseDate(t):n.parseDate(n.getXValue(e,i)):n.isCustomX()&&!n.isCategorized()?(0,u.isValue)(t)?+t:n.getXValue(e,i):i},cloneTarget:function(t){return{id:t.id,id_org:t.id_org,values:t.values.map(function(t){return{x:t.x,value:t.value,id:t.id}})}},updateXs:function(){var t=this;t.data.targets.length&&(t.xs=[],t.data.targets[0].values.forEach(function(e){t.xs[e.index]=e.x}))},getPrevX:function(t){var e=this.xs[t-1];return void 0===e?null:e},getNextX:function(t){var e=this.xs[t+1];return void 0===e?null:e},getMaxDataCount:function(){var t=this;return(0,r.max)(t.data.targets,function(t){return t.values.length})},getMaxDataCountTarget:function(t){var e=t.length,i=0,n=void 0;return e>1?t.forEach(function(t){t.values.length>i&&(n=t,i=t.values.length)}):n=e?t[0]:null,n},mapToIds:function(t){return t.map(function(t){return t.id})},mapToTargetIds:function(t){var e=this;return t?(0,u.isArray)(t)?t.concat():[t]:e.mapToIds(e.data.targets)},hasTarget:function(t,e){var i=this.mapToIds(t),n=void 0;for(n=0;n<i.length;n++)if(i[n]===e)return!0;return!1},isTargetToShow:function(t){return this.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function(t){return this.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function(t){var e=this;return t.filter(function(t){return e.isTargetToShow(t.id)})},mapTargetsToUniqueXs:function(t){var e=this,i=(0,r.set)((0,r.merge)(t.map(function(t){return t.values.map(function(t){return+t.x})}))).values();return i=e.isTimeSeries()?i.map(function(t){return new Date(+t)}):i.map(function(t){return+t}),i.sort(function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN})},addHiddenTargetIds:function(t){this.hiddenTargetIds=this.hiddenTargetIds.concat(t)},removeHiddenTargetIds:function(t){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(e){return t.indexOf(e)<0})},addHiddenLegendIds:function(t){this.hiddenLegendIds=this.hiddenLegendIds.concat(t)},removeHiddenLegendIds:function(t){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(e){return t.indexOf(e)<0})},getValuesAsIdKeyed:function(t){var e={};return t.forEach(function(t){e[t.id]=[],t.values.forEach(function(i){e[t.id].push(i.value)})}),e},checkValueInTargets:function(t,e){var i=Object.keys(t),n=void 0,a=void 0,r=void 0;for(n=0;n<i.length;n++)for(r=t[i[n]].values,a=0;a<r.length;a++)if(e(r[a].value))return!0;return!1},hasNegativeValueInTargets:function(t){return this.checkValueInTargets(t,function(t){return t<0})},hasPositiveValueInTargets:function(t){return this.checkValueInTargets(t,function(t){return t>0})},_checkOrder:function(t){var e=this.config;return"string"==typeof e.data_order&&e.data_order.toLowerCase()===t},isOrderDesc:function(){return this._checkOrder("desc")},isOrderAsc:function(){return this._checkOrder("asc")},orderTargets:function(t){var e=this,i=e.config,n=e.isOrderAsc(),a=e.isOrderDesc();return n||a?t.sort(function(t,e){var i=function(t,e){return t+Math.abs(e.value)},a=t.values.reduce(i,0),r=e.values.reduce(i,0);return n?r-a:a-r}):(0,u.isFunction)(i.data_order)&&t.sort(i.data_order),t},filterByX:function(t,e){return(0,r.merge)(t.map(function(t){return t.values})).filter(function(t){return t.x-e==0})},filterRemoveNull:function(t){return t.filter(function(t){return(0,u.isValue)(t.value)})},filterByXDomain:function(t,e){return t.map(function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return e[0]<=t.x&&t.x<=e[1]})}})},hasDataLabel:function(){var t=this.config.data_labels,e=void 0===t?"undefined":(0,a.default)(t);return"boolean"===e&&t||"object"===e&&(0,u.notEmpty)(t)},getDataLabelLength:function(t,e,i){var n=this,a=[0,0];return n.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return n.dataLabelFormat(t.id)(t)}).each(function(t,e){a[e]=1.3*this.getBoundingClientRect()[i]}).remove(),a},isNoneArc:function(t){return this.hasTarget(this.data.targets,t.id)},isArc:function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},findSameXOfValues:function(t,e){var i=t[e].x,n=[],a=void 0;for(a=e-1;a>=0&&i===t[a].x;a--)n.push(t[a]);for(a=e;a<t.length&&i===t[a].x;a++)n.push(t[a]);return n},findClosestFromTargets:function(t,e){var i=this,n=t.map(function(t){return i.findClosest(t.values,e)});return i.findClosest(n,e)},findClosest:function(t,e){var i=this,n=i.config.point_sensitivity,a=void 0;return t.filter(function(t){return t&&i.isBarType(t.id)}).forEach(function(t){var e=i.main.select().node("."+s.default.bars+i.getTargetSelectorSuffix(t.id)+"."+s.default.bar+"-"+t.index);!a&&i.isWithinBar(e)&&(a=t)}),t.filter(function(t){return t&&!i.isBarType(t.id)}).forEach(function(t){var r=i.dist(t,e);r<n&&(n=r,a=t)}),a},dist:function(t,e){var i=this,n=i.config,a=n.axis_rotated?1:0,r=n.axis_rotated?0:1,o=i.circleY(t,t.index),s=i.x(t.x);return Math.sqrt(Math.pow(s-e[a],2)+Math.pow(o-e[r],2))},convertValuesToStep:function(t){var e=(0,u.isArray)(t)?t.concat():[t],i=void 0;if(!this.isCategorized())return t;for(i=t.length+1;i>0;i--)e[i]=e[i-1];return e[0]={x:e[0].x-1,value:e[0].value,id:e[0].id},e[t.length+1]={x:e[t.length].x+1,value:e[t.length].value,id:e[t.length].id},e},updateDataAttributes:function(t,e){var i=this,n=i.config,a=n["data_"+t];return void 0===e?a:(Object.keys(e).forEach(function(t){a[t]=e[t]}),i.redraw({withLegend:!0}),a)}})},function(t,e,i){"use strict";var n=i(2),a=i(1),r=function(t){return t&&t.__esModule?t:{"default":t}}(a),o=i(0);(0,o.extend)(r.default.prototype,{convertUrlToData:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"csv",a=arguments[2],r=arguments[3],o=arguments[4],s=i,l=(0,n.request)(t);if(a)for(var d=Object.keys(a),u=Array.isArray(d),c=0,d=u?d:d[Symbol.iterator]();;){var f;if(u){if(c>=d.length)break;f=d[c++]}else{if(c=d.next(),c.done)break;f=c.value}var g=f;l.header(g,a[g])}l.get(function(t,i){var n=void 0;if(!i)throw new Error(t.responseURL+" "+t.status+" ("+t.statusText+")");var a=i.response||i.responseText;n="json"===s?e.convertJsonToData(JSON.parse(a),r):"tsv"===s?e.convertTsvToData(a):e.convertCsvToData(a),o.call(e,n)})},convertCsvToData:function(t){var e=(0,n.csvParseRows)(t),i=void 0;return 1===e.length?(i=[{}],e[0].forEach(function(t){i[0][t]=null})):i=(0,n.csvParse)(t),i},convertTsvToData:function(t){var e=(0,n.tsvParseRows)(t),i=void 0;return 1===e.length?(i=[{}],e[0].forEach(function(t){i[0][t]=null})):i=(0,n.tsvParse)(t),i},convertJsonToData:function(t,e){var i=this,n=[],a=void 0,r=void 0;return e?(e.x?(a=e.value.concat(e.x),this.config.data_x=e.x):a=e.value,n.push(a),t.forEach(function(t){for(var e=[],r=void 0,s=a,l=Array.isArray(s),d=0,s=l?s:s[Symbol.iterator]();;){var u;if(l){if(d>=s.length)break;u=s[d++]}else{if(d=s.next(),d.done)break;u=d.value}var c=u;r=i.findValueInJson(t,c),(0,o.isUndefined)(r)&&(r=null),e.push(r)}n.push(e)}),r=this.convertRowsToData(n)):(Object.keys(t).forEach(function(e){var i=t[e].concat();i.unshift(e),n.push(i)}),r=this.convertColumnsToData(n)),r},findValueInJson:function(t,e){if(void 0!==t[e])return t[e];for(var i=e.replace(/\[(\w+)\]/g,".$1"),n=i.replace(/^\./,"").split("."),a=t,r=n,o=Array.isArray(r),s=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(s>=r.length)break;l=r[s++]}else{if(s=r.next(),s.done)break;l=s.value}var d=l;if(!(d in a)){a=void 0;break}a=a[d]}return a},convertRowsToData:function(t){var e=t[0],i=[],n={},a=void 0,r=void 0;for(a=1;a<t.length;a++){for(n={},r=0;r<t[a].length;r++){if((0,o.isUndefined)(t[a][r]))throw new Error("Source data is missing a component at ("+a+", "+r+")!");n[e[r]]=t[a][r]}i.push(n)}return i},convertColumnsToData:function(t){var e=[],i=void 0,n=void 0,a=void 0;for(i=0;i<t.length;i++)for(a=t[i][0],n=1;n<t[i].length;n++){if((0,o.isUndefined)(e[n-1])&&(e[n-1]={}),(0,o.isUndefined)(t[i][n]))throw new Error("Source data is missing a component at ("+i+", "+n+")!");e[n-1][a]=t[i][n]}return e},convertDataToTargets:function(t,e){var i=this,a=this,r=a.config,s=(0,n.keys)(t[0]).filter(a.isNotX,a),l=(0,n.keys)(t[0]).filter(a.isX,a);s.forEach(function(n){var s=i.getXKey(n);i.isCustomX()||i.isTimeSeries()?l.indexOf(s)>=0?i.data.xs[n]=(e&&a.data.xs[n]?a.data.xs[n]:[]).concat(t.map(function(t){return t[s]}).filter(o.isValue).map(function(t,e){return a.generateTargetX(t,n,e)})):r.data_x?i.data.xs[n]=i.getOtherTargetXs():(0,o.notEmpty)(r.data_xs)&&(a.data.xs[n]=a.getXValuesOfXKey(s,a.data.targets)):a.data.xs[n]=t.map(function(t,e){return e})}),s.forEach(function(t){if(!a.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')});var d=s.map(function(e,i){var n=r.data_idConverter(e);return{id:n,id_org:e,values:t.map(function(t,s){var l=a.getXKey(e),d=t[l],u=null===t[e]||isNaN(t[e])?null:+t[e],c=void 0;return a.isCustomX()&&a.isCategorized()&&0===i&&!(0,o.isUndefined)(d)?(0===i&&0===s&&(r.axis_x_categories=[]),-1===(c=r.axis_x_categories.indexOf(d))&&(c=r.axis_x_categories.length,r.axis_x_categories.push(d))):c=a.generateTargetX(d,e,s),((0,o.isUndefined)(t[e])||a.data.xs[e].length<=s)&&(c=void 0),{x:c,value:u,id:n}}).filter(function(t){return(0,o.isDefined)(t.x)})}});return d.forEach(function(t){var e=void 0;r.data_xSort&&(t.values=t.values.sort(function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)})),e=0,t.values.forEach(function(t){t.index=e++}),a.data.xs[t.id].sort(function(t,e){return t-e})}),a.hasNegativeValue=a.hasNegativeValueInTargets(d),a.hasPositiveValue=a.hasPositiveValueInTargets(d),r.data_type&&a.setTargetType(a.mapToIds(d).filter(function(t){return!(t in r.data_types)}),r.data_type),d.forEach(function(t){a.addCache(t.id_org,t)}),d}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(3),a=_interopRequireDefault(n),r=i(1),o=_interopRequireDefault(r);(0,i(0).extend)(o.default.prototype,{load:function(t,e){var i=this,n=t;n&&(e.filter&&(n=n.filter(e.filter)),(e.type||e.types)&&n.forEach(function(t){var n=e.types&&e.types[t.id]?e.types[t.id]:e.type;i.setTargetType(t.id,n)}),i.data.targets.forEach(function(t){for(var e=0;e<n.length;e++)if(t.id===n[e].id){t.values=n[e].values,n.splice(e,1);break}}),i.data.targets=i.data.targets.concat(n)),i.updateTargets(i.data.targets),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()},loadFromArgs:function(t){var e=this;t.data?e.load(e.convertDataToTargets(t.data),t):t.url?e.convertUrlToData(t.url,t.mimeType,t.headers,t.keys,function(i){e.load(e.convertDataToTargets(i),t)}):t.json?e.load(e.convertDataToTargets(e.convertJsonToData(t.json,t.keys)),t):t.rows?e.load(e.convertDataToTargets(e.convertRowsToData(t.rows)),t):t.columns?e.load(e.convertDataToTargets(e.convertColumnsToData(t.columns)),t):e.load(null,t)},unload:function(t,e){var i=this,n=e,r=t;return n||(n=function(){}),r=r.filter(function(t){return i.hasTarget(i.data.targets,t)}),r&&0!==r.length?(i.svg.selectAll(r.map(function(t){return i.selectorTarget(t)})).transition().style("opacity","0").remove().call(i.endall,n),void r.forEach(function(t){i.withoutFadeIn[t]=!1,i.legend&&i.legend.selectAll("."+a.default.legendItem+i.getTargetSelectorSuffix(t)).remove(),i.data.targets=i.data.targets.filter(function(e){return e.id!==t})})):void n()}})},function(t,e,i){"use strict";var n=i(1),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{categoryName:function(t){var e=this.config;return t<e.axis_x_categories.length?e.axis_x_categories[t]:t}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o);(0,i(0).extend)(r.default.prototype,{initEventRect:function(){this.main.select("."+s.default.chart).append("g").attr("class",s.default.eventRects).style("fill-opacity","0")},redrawEventRect:function(){var t=this,e=t.config,i=t.isMultipleX(),a=t.main.select("."+s.default.eventRects).style("cursor",e.zoom_enabled?e.axis_rotated?"ns-resize":"ew-resize":null).classed(s.default.eventRectsMultiple,i).classed(s.default.eventRectsSingle,!i),r=void 0,o=void 0;if(a.selectAll("."+s.default.eventRect).remove(),t.eventRect=a.selectAll("."+s.default.eventRect),i?(r=t.eventRect.data([0]),r=t.generateEventRectsForMultipleXs(r.enter()).merge(r),t.updateEventRect(r)):(o=t.getMaxDataCountTarget(t.data.targets),a.datum(o?o.values:[]),t.eventRect=a.selectAll("."+s.default.eventRect),r=t.eventRect.data(function(t){return t}),r.exit().remove(),r=t.generateEventRectsForSingleX(r.enter()).merge(r),t.updateEventRect(r)),"touch"===t.inputType&&!t.hasArcType()){var l=function(){var t=n.event.changedTouches[0];return(0,n.select)(document.elementFromPoint(t.clientX,t.clientY))},d=function(t){var e=t&&t.attr("class")&&1*t.attr("class").replace(new RegExp("("+s.default.eventRect+"-?|s)","g"),"");return(isNaN(e)||null===e)&&(e=-1),e},u=void 0,c=function(e){var a=n.event.type,r=n.event.changedTouches[0],o=t.config.axis_rotated,s=r.clientY;if("touchstart"===a)u=s,o&&n.event.preventDefault();else if("touchmove"===a&&u){var c=Math.abs(u-s);!o&&c<5&&n.event.preventDefault()}if(i)t.selectRectForMultipleXs(e);else{var f=l(),g=d(f);-1===g?t.unselectRect():t.selectRectForSingle(e,f,g)}},f=function(){if(l().classed(s.default.eventRect)){if(t.dragging||t.flowing||t.hasArcType())return;c(this)}else t.unselectRect()};t.svg.on("touchstart",f).on("touchmove",f).on("touchend",function(){var n=l();if(n.classed(s.default.eventRect)){if(t.hasArcType()||!t.toggleShape||t.cancelClick)return void(t.cancelClick&&(t.cancelClick=!1));var a=d(n);i||-1===a||t.main.selectAll("."+s.default.shape+"-"+a).each(function(i){return e.data_onout.call(t.api,i)})}})}},updateEventRect:function(t){var e=this,i=e.config,n=e.zoomScale||e.x,a=t||e.eventRect.data(),r=void 0,o=void 0,s=void 0,l=void 0;if(e.isMultipleX())r=0,o=0,s=e.width,l=e.height;else{var d=void 0,u=void 0;!e.isCustomX()&&!e.isTimeSeries()||e.isCategorized()?(d=e.getEventRectWidth(),u=function(t){return n(t.x)-d/2}):(e.updateXs(),d=function(t){var a=e.getPrevX(t.index),r=e.getNextX(t.index);return null===a&&null===r?i.axis_rotated?e.height:e.width:(null===a&&(a=n.domain()[0]),null===r&&(r=n.domain()[1]),Math.max(0,(n(r)-n(a))/2))},u=function(t){var i=e.getNextX(t.index),a=e.data.xs[t.id][t.index],r=e.getPrevX(t.index);return null===r&&null===i?0:(null===r&&(r=n.domain()[0]),(n(a)+n(r))/2)}),r=i.axis_rotated?0:u,o=i.axis_rotated?u:0,s=i.axis_rotated?e.width:d,l=i.axis_rotated?d:e.height}a.attr("class",e.classEvent.bind(e)).attr("x",r).attr("y",o).attr("width",s).attr("height",l)},selectRectForSingle:function(t,e,i){var a=this,r=a.config,o=a.filterTargetsToShow(a.data.targets).map(function(t){return a.addName(a.getValueOnIndex(t.values,i))});r.tooltip_grouped&&(a.showTooltip(o,t),a.showXGridFocus(o),!r.data_selection_enabled||r.data_selection_grouped)||a.main.selectAll("."+s.default.shape+"-"+i).each(function(){(0,n.select)(this).classed(s.default.EXPANDED,!0),r.data_selection_enabled&&e.style("cursor",r.data_selection_grouped?"pointer":null),r.tooltip_grouped||(a.hideXGridFocus(),a.hideTooltip(),!r.data_selection_grouped&&(a.unexpandCircles(i),a.unexpandBars(i)))}).filter(function(t){return a.isWithinShape(this,t)}).each(function(t){r.data_selection_enabled&&(r.data_selection_grouped||r.data_selection_isselectable(t))&&e.style("cursor","pointer"),r.tooltip_grouped||(a.showTooltip([t],this),a.showXGridFocus([t]),r.point_focus_expand_enabled&&a.expandCircles(i,t.id,!0),a.expandBars(i,t.id,!0))})},selectRectForMultipleXs:function(t){var e=this,i=e.config,a=e.filterTargetsToShow(e.data.targets);if(!e.dragging&&!e.hasArcType(a)){var r=(0,n.mouse)(e.main.select("."+s.default.eventRects+" ."+s.default.eventRect).node()),o=e.findClosestFromTargets(a,r),l=void 0;if(e.mouseover&&(!o||o.id!==e.mouseover.id)&&(i.data_onout.call(e.api,e.mouseover),e.mouseover=void 0),!o)return void e.unselectRect();l=e.isScatterType(o)||!i.tooltip_grouped?[o]:e.filterByX(a,o.x);var d=l.map(function(t){return e.addName(t)});e.showTooltip(d,t),i.point_focus_expand_enabled&&e.expandCircles(o.index,o.id,!0),e.expandBars(o.index,o.id,!0),e.showXGridFocus(d),(e.isBarType(o.id)||e.dist(o,r)<i.point_sensitivity)&&(e.svg.select(""+s.default.eventRect).style("cursor","pointer"),!e.mouseover&&(i.data_onover.call(e.api,o),e.mouseover=o))}},unselectRect:function(){var t=this;t.svg.select("."+s.default.eventRect).style("cursor",null),t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars()},generateEventRectsForSingleX:function(t){var e=this,i=e.config,a=t.append("rect").attr("class",e.classEvent.bind(e)).style("cursor",i.data_selection_enabled&&i.data_selection_grouped?"pointer":null).on("click",function(t){if(e.hasArcType()||!e.toggleShape||e.cancelClick)return void(e.cancelClick&&(e.cancelClick=!1));var n=t.index;e.main.selectAll("."+s.default.shape+"-"+n).each(function(t){(i.data_selection_grouped||e.isWithinShape(this,t))&&(e.toggleShape(this,t,n),e.config.data_onclick.call(e.api,t,this))})}).call(i.data_selection_draggable&&e.drag?(0,n.drag)().origin(Object).on("drag",function(){e.drag((0,n.mouse)(this))}).on("dragstart",function(){e.dragstart((0,n.mouse)(this))}).on("dragend",function(){e.dragend()}):function(){});return"mouse"===e.inputType&&a.on("mouseover",function(t){if(!(e.dragging||e.flowing||e.hasArcType())){var n=t.index;i.point_focus_expand_enabled&&e.expandCircles(n,null,!0),e.expandBars(n,null,!0),-1!==n&&e.main.selectAll("."+s.default.shape+"-"+n).each(function(t){return i.data_onover.call(e.api,t)})}}).on("mousemove",function(t){if(!(e.dragging||e.flowing||e.hasArcType())){var i=t.index,a=e.svg.select("."+s.default.eventRect+"-"+i);e.isStepType(t)&&"step-after"===e.config.line_step_type&&(0,n.mouse)(this)[0]<e.x(e.getXValue(t.id,i))&&(i-=1),-1===i?e.unselectRect():e.selectRectForSingle(this,a,i)}}).on("mouseout",function(t){if(e.config&&!e.hasArcType()){var n=t.index;e.unselectRect(),e.main.selectAll("."+s.default.shape+"-"+n).each(function(t){return i.data_onout.call(e.api,t)})}}),a},generateEventRectsForMultipleXs:function(t){var e=this,i=e.config,a=t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("class",s.default.eventRect).on("click",function(){var t=this,a=e.filterTargetsToShow(e.data.targets);if(!e.hasArcType(a)){var r=(0,n.mouse)(this),o=e.findClosestFromTargets(a,r);!o||(e.isBarType(o.id)||e.dist(o,r)<i.point_sensitivity)&&e.main.selectAll("."+s.default.shapes+e.getTargetSelectorSuffix(o.id)).selectAll("."+s.default.shape+"-"+o.index).each(function(){(i.data_selection_grouped||e.isWithinShape(t,o))&&(e.toggleShape(t,o,o.index),e.config.data_onclick.call(e.api,o,t))})}}).call(i.data_selection_draggable&&e.drag?(0,n.drag)().origin(Object).on("drag",function(){e.drag((0,n.mouse)(this))}).on("dragstart",function(){e.dragstart((0,n.mouse)(this))}).on("dragend",function(){e.dragend()}):function(){});return"mouse"===e.inputType&&a.on("mouseover",function(){e.selectRectForMultipleXs(this)}).on("mouseout",function(){!e.config||e.hasArcType()||e.unselectRect()}).on("mousemove",function(){e.selectRectForMultipleXs(this)}),a},dispatchEvent:function(t,e,i){var n=this,a=n.isMultipleX()?"."+s.default.eventRect:s.default.eventRect+"-"+e,r=n.main.select(a).node(),o=r.getBoundingClientRect(),l=o.left+(i?i[0]:0),d=o.top+(i?i[1]:0),u=document.createEvent("MouseEvents").initMouseEvent(t,!0,!0,window,0,l,d,l,d,!1,!1,!1,!1,0,null);r.dispatchEvent(u)}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(1),a=_interopRequireDefault(n),r=i(3),o=_interopRequireDefault(r),s=i(0);(0,s.extend)(a.default.prototype,{getCurrentWidth:function(){var t=this,e=t.config;return e.size_width?e.size_width:t.getParentWidth()},getCurrentHeight:function(){var t=this,e=t.config,i=e.size_height?e.size_height:t.getParentHeight();return i>0?i:320/(t.hasType("gauge")&&!e.gauge_fullCircle?2:1)},getCurrentPaddingTop:function(){var t=this,e=t.config,i=(0,s.isValue)(e.padding_top)?e.padding_top:0;return t.title&&t.title.node()&&(i+=t.getTitlePadding()),i},getCurrentPaddingBottom:function(){var t=this.config;return(0,s.isValue)(t.padding_bottom)?t.padding_bottom:0},getCurrentPaddingLeft:function(t){var e=this,i=e.config;return(0,s.isValue)(i.padding_left)?i.padding_left:i.axis_rotated?i.axis_x_show?Math.max((0,s.ceil10)(e.getAxisWidthByAxisId("x",t)),40):1:!i.axis_y_show||i.axis_y_inner?e.axis.getYAxisLabelPosition().isOuter?30:1:(0,s.ceil10)(e.getAxisWidthByAxisId("y",t))},getCurrentPaddingRight:function(){var t=this,e=t.config,i=t.isLegendRight?t.getLegendWidth()+20:0;return(0,s.isValue)(e.padding_right)?e.padding_right+1:e.axis_rotated?10+i:!e.axis_y2_show||e.axis_y2_inner?2+i+(t.axis.getY2AxisLabelPosition().isOuter?20:0):(0,s.ceil10)(t.getAxisWidthByAxisId("y2"))+i},getParentRectValue:function(t){for(var e=this.selectChart.node(),i=void 0;e&&"BODY"!==e.tagName;){try{i=e.getBoundingClientRect()[t]}catch(n){"width"===t&&(i=e.offsetWidth)}if(i)break;e=e.parentNode}return i},getParentWidth:function(){return this.getParentRectValue("width")},getParentHeight:function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},getSvgLeft:function(t){var e=this,i=e.config,n=i.axis_rotated||!i.axis_rotated&&!i.axis_y_inner,a=i.axis_rotated?o.default.axisX:o.default.axisY,r=e.main.select("."+a).node(),s=r&&n?r.getBoundingClientRect():{right:0},l=e.selectChart.node().getBoundingClientRect(),d=e.hasArcType(),u=s.right-l.left-(d?0:e.getCurrentPaddingLeft(t));return u>0?u:0},getAxisWidthByAxisId:function(t,e){var i=this,n=i.axis.getLabelPositionById(t);return i.axis.getMaxTickWidth(t,e)+(n.isInner?20:40)},getHorizontalAxisHeight:function(t){var e=this,i=e.config,n=30;return"x"!==t||i.axis_x_show?"x"===t&&i.axis_x_height?i.axis_x_height:"y"!==t||i.axis_y_show?"y2"!==t||i.axis_y2_show?("x"===t&&!i.axis_rotated&&i.axis_x_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-i.axis_x_tick_rotate)/180)),"y"===t&&i.axis_rotated&&i.axis_y_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-i.axis_y_tick_rotate)/180)),n+(e.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):e.rotated_padding_top:!i.legend_show||e.isLegendRight||e.isLegendInset?1:10:8},getEventRectWidth:function(){return Math.max(0,this.xAxis.tickInterval())}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(3),r=_interopRequireDefault(a),o=i(1),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(s.default.prototype,{getShapeIndices:function(t){var e=this,i=e.config,n={},a=0,r=void 0,o=void 0;return e.filterTargetsToShow(e.data.targets.filter(t,e)).forEach(function(t){for(r=0;r<i.data_groups.length;r++)if(!(i.data_groups[r].indexOf(t.id)<0))for(o=0;o<i.data_groups[r].length;o++)if(i.data_groups[r][o]in n){n[t.id]=n[i.data_groups[r][o]];break}(0,l.isUndefined)(n[t.id])&&(n[t.id]=a++)}),n.__max__=a-1,n},getShapeX:function(t,e,i,n){var a=this,r=n?a.subX:a.zoomScale?a.zoomScale:a.x;return function(n){var a=n.id in i?i[n.id]:0;return n.x||0===n.x?r(n.x)-t*(e/2-a):0}},getShapeY:function(t){var e=this;return function(i){return(t?e.getSubYScale(i.id):e.getYScale(i.id))(i.value)}},getShapeOffset:function(t,e,i){var n=this,a=n.orderTargets(n.filterTargetsToShow(n.data.targets.filter(t,n))),r=a.map(function(t){return t.id});return function(t,o){var s=i?n.getSubYScale(t.id):n.getYScale(t.id),l=s(0),d=l,u=o;return a.forEach(function(i){var a=n.isStepType(t)?n.convertValuesToStep(i.values):i.values;i.id===t.id||e[i.id]!==e[t.id]||r.indexOf(i.id)<r.indexOf(t.id)&&((void 0===a[u]||+a[u].x!=+t.x)&&(u=-1,a.forEach(function(e,i){(e.x.constructor===Date?+e.x:e.x)===(t.x.constructor===Date?+t.x:t.x)&&(u=i)})),u in a&&a[u].value*t.value>=0&&(d+=s(a[u].value)-l))}),d}},isWithinShape:function(t,e){var i=this,a=(0,n.select)(t),o=void 0;return i.isTargetToShow(e.id)?"circle"===t.nodeName?o=i.isStepType(e)?i.isWithinStep(t,i.getYScale(e.id)(e.value)):i.isWithinCircle(t,1.5*i.pointSelectR(e)):"path"===t.nodeName&&(o=!a.classed(r.default.bar)||i.isWithinBar(t)):o=!1,o},getInterpolate:function(t){var e=this,i=e.getInterpolateType(t);return{basis:n.curveBasis,"basis-closed":n.curveBasisClosed,"basis-open":n.curveBasisOpen,bundle:n.curveBundle,cardinal:n.curveCardinal,"cardinal-closed":n.curveCardinalClosed,"cardinal-open":n.curveCardinalOpen,"catmull-rom":n.curveCatmullRom,"catmull-rom-closed":n.curveCatmullRomClosed,"catmull-rom-open":n.curveCatmullRomOpen,"monotone-x":n.curveMonotoneX,"monotone-y":n.curveMonotoneY,natural:n.curveNatural,"linear-closed":n.curveLinearClosed,linear:n.curveLinear,step:n.curveStep}[i]},getInterpolateType:function(t){var e=this,i=e.isInterpolationType(e.config.spline_interpolation_type)?e.config.spline_interpolation_type:"cardinal";return e.isSplineType(t)?i:e.isStepType(t)?e.config.line_step_type:"linear"}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(3),r=_interopRequireDefault(a),o=i(1),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(s.default.prototype,{initLine:function(){this.main.select("."+r.default.chart).append("g").attr("class",r.default.chartLines)},updateTargetsForLine:function(t){var e=this,i=e.config,n=e.classChartLine.bind(e),a=e.classLines.bind(e),o=e.classAreas.bind(e),s=e.classCircles.bind(e),l=e.classFocus.bind(e),d=e.main.select("."+r.default.chartLines).selectAll("."+r.default.chartLine).data(t).attr("class",function(t){return n(t)+l(t)}),u=d.enter().append("g").attr("class",n).style("opacity","0").style("pointer-events","none");u.append("g").attr("class",a),u.append("g").attr("class",o),u.append("g").attr("class",function(t){return e.generateClass(r.default.selectedCircles,t.id)}),u.append("g").attr("class",s).style("cursor",function(t){return i.data_selection_isselectable(t)?"pointer":null}),t.forEach(function(t){e.main.selectAll("."+r.default.selectedCircles+e.getTargetSelectorSuffix(t.id)).selectAll(""+r.default.selectedCircle).each(function(e){e.value=t.values[e.index].value})})},updateLine:function(t){var e=this;e.mainLine=e.main.selectAll("."+r.default.lines).selectAll("."+r.default.line).data(e.lineData.bind(e)),e.mainLine.exit().transition().duration(t).style("opacity","0").remove(),e.mainLine=e.mainLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color).merge(e.mainLine).style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",function(t){return e.isStepType(t)?"crispEdges":""}).attr("transform",null)},redrawLine:function(t,e){return[(e?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity","1")]},generateDrawLine:function(t,e){var i=this,a=i.config,r=a.line_connectNull,o=a.axis_rotated,s=i.generateGetLinePoints(t,e),l=e?i.getSubYScale:i.getYScale,d=function(t){return(e?i.subxx:i.xx).call(i,t)},u=function(t,e){return a.data_groups.length>0?s(t,e)[0][1]:l.call(i,t.id)(t.value)},c=(0,n.line)();return c=o?c.x(u).y(d):c.x(d).y(u),r||(c=c.defined(function(t){return null!==t.value})),function(t){var n=e?i.x:i.subX,s=l.call(i,t.id),d=r?i.filterRemoveNull(t.values):t.values,u=0,f=0,g=void 0;return i.isLineType(t)?a.data_regions[t.id]?g=i.lineWithRegions(d,n,s,a.data_regions[t.id]):(i.isStepType(t)&&(d=i.convertValuesToStep(d)),g=c.curve(i.getInterpolate(t))(d)):(d[0]&&(u=n(d[0].x),f=s(d[0].value)),g=o?"M "+f+" "+u:"M "+u+" "+f),g||"M 0 0"}},generateGetLinePoints:function(t,e){var i=this,n=i.config,a=t.__max__+1,r=!!e,o=i.getShapeX(0,a,t,r),s=i.getShapeY(r),l=i.getShapeOffset(i.isLineType,t,r),d=r?i.getSubYScale:i.getYScale;return function(t,e){var a=d.call(i,t.id)(0),r=l(t,e)||a,u=o(t),c=s(t);n.axis_rotated&&(t.value>0&&c<a||t.value<0&&a<c)&&(c=a);var f=[u,c-(a-r)];return[f,f,f,f]}},lineWithRegions:function(t,e,i,n){function generateM(t){return"M"+t[0][0]+" "+t[0][1]+" "+t[1][0]+" "+t[1][1]}var a=this,r=a.config,o=a.isCategorized()?.5:0,s=[],d=void 0,u=void 0,c="M",f=void 0,g=void 0,h=void 0,p=void 0,x=void 0,_=void 0,v=void 0,m=void 0;if((0,l.isDefined)(n))for(d=0;d<n.length;d++)s[d]={},s[d].start=(0,l.isUndefined)(n[d].start)?t[0].x:a.isTimeSeries()?a.parseDate(n[d].start):n[d].start,s[d].end=(0,l.isUndefined)(n[d].end)?t[t.length-1].x:a.isTimeSeries()?a.parseDate(n[d].end):n[d].end;var y=r.axis_rotated?function(t){return i(t.value)}:function(t){return e(t.x)},b=r.axis_rotated?function(t){return e(t.x)}:function(t){return i(t.value)};for(f=a.isTimeSeries()?function(t,n,a,o){var s=t.x.getTime(),l=n.x-t.x,d=new Date(s+l*a),u=new Date(s+l*(a+o)),c=void 0;return c=r.axis_rotated?[[i(h(a)),e(d)],[i(h(a+v)),e(u)]]:[[e(d),i(h(a))],[e(u),i(h(a+v))]],generateM(c)}:function(t,n,a,o){var s=void 0;return s=r.axis_rotated?[[i(h(a),!0),e(g(a))],[i(h(a+o),!0),e(g(a+o))]]:[[e(g(a),!0),i(h(a))],[e(g(a+o),!0),i(h(a+o))]],generateM(s)},d=0;d<t.length;d++)if((0,l.isUndefined)(s)||!function(t,e){var i=void 0;for(i=0;i<e.length;i++)if(e[i].start<t&&t<=e[i].end)return!0;return!1}(t[d].x,s))c+=" "+y(t[d])+" "+b(t[d]);else for(g=a.getScale(t[d-1].x+o,t[d].x+o,a.isTimeSeries()),h=a.getScale(t[d-1].value,t[d].value),p=e(t[d].x)-e(t[d-1].x),x=i(t[d].value)-i(t[d-1].value),_=Math.sqrt(Math.pow(p,2)+Math.pow(x,2)),v=2/_,m=2*v,u=v;u<=1;u+=m)c+=f(t[d-1],t[d],u,v);return c},updateArea:function(t){var e=this;e.mainArea=e.main.selectAll("."+r.default.areas).selectAll("."+r.default.area).data(e.lineData.bind(e)),e.mainArea.exit().transition().duration(t).style("opacity","0").remove(),e.mainArea=e.mainArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=(0,n.select)(this).style("opacity"),"0"}).merge(e.mainArea),e.mainArea.style("opacity",e.orgAreaOpacity)},redrawArea:function(t,e){return[(e?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},generateDrawArea:function(t,e){var i=this,a=i.config,r=a.line_connectNull,o=a.axis_rotated,s=i.generateGetAreaPoints(t,e),l=e?i.getSubYScale:i.getYScale,d=function(t){return(e?i.subxx:i.xx).call(i,t)},u=function(t,e){return a.data_groups.length>0?s(t,e)[0][1]:l.call(i,t.id)(i.getAreaBaseValue(t.id))},c=function(t,e){return a.data_groups.length>0?s(t,e)[1][1]:l.call(i,t.id)(t.value)},f=(0,n.area)();return f=o?f.x0(u).x1(c).y(d):f.x(d).y0(a.area_above?0:u).y1(c),r||(f=f.defined(function(t){return null!==t.value})),function(t){var e=r?i.filterRemoveNull(t.values):t.values,n=0,a=0,s=void 0;return i.isAreaType(t)?(i.isStepType(t)&&(e=i.convertValuesToStep(e)),s=f.curve(i.getInterpolate(t))(e)):(e[0]&&(n=i.x(e[0].x),a=i.getYScale(t.id)(e[0].value)),s=o?"M "+a+" "+n:"M "+n+" "+a),s||"M 0 0"}},getAreaBaseValue:function(){return 0},generateGetAreaPoints:function(t,e){var i=this,n=i.config,a=t.__max__+1,r=i.getShapeX(0,a,t,!!e),o=i.getShapeY(!!e),s=i.getShapeOffset(i.isAreaType,t,!!e),l=e?i.getSubYScale:i.getYScale;return function(t,e){var a=l.call(i,t.id)(0),d=s(t,e)||a,u=r(t),c=o(t);return n.axis_rotated&&(t.value>0&&c<a||t.value<0&&a<c)&&(c=a),[[u,d],[u,c-(a-d)],[u,c-(a-d)],[u,d]]}},updateCircle:function(){var t=this;t.mainCircle=t.main.selectAll("."+r.default.circles).selectAll("."+r.default.circle).data(t.lineOrScatterData.bind(t)),t.mainCircle.exit().remove(),t.mainCircle=t.mainCircle.enter().append("circle").attr("class",t.classCircle.bind(t)).attr("r",t.pointR.bind(t)).style("fill",t.color).merge(t.mainCircle).style("opacity",t.initialOpacityForCircle.bind(t))},redrawCircle:function(t,e,i,n){var a=this.main.selectAll("."+r.default.selectedCircle),o=void 0;if(i){var s=Math.random().toString();o=n?this.mainCircle.attr("cx",t).transition(s).attr("cx",t).attr("cy",e).transition(s).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color):this.mainCircle.transition(s).attr("cx",t).attr("cy",e).transition(s).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color),a=a.transition(Math.random().toString())}else o=this.mainCircle.attr("cx",t).attr("cy",e).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color);return[o,a.attr("cx",t).attr("cy",e)]},circleX:function(t){return this.config.zoom_enabled&&this.zoomScale?t.x||0===t.x?this.zoomScale(t.x):null:t.x||0===t.x?this.x(t.x):null},updateCircleY:function(){var t=this,e=void 0,i=void 0;t.config.data_groups.length>0?(e=t.getShapeIndices(t.isLineType),i=t.generateGetLinePoints(e),t.circleY=function(t,e){return i(t,e)[0][1]}):t.circleY=function(e){return t.getYScale(e.id)(e.value)}},getCircles:function(t,e){var i=this,n=(0,l.isValue)(t)?"-"+t:"";return(e?i.main.selectAll("."+r.default.circles+i.getTargetSelectorSuffix(e)):i.main).selectAll("."+r.default.circle+n)},expandCircles:function(t,e,i){var n=this,a=n.pointExpandedR.bind(n);i&&n.unexpandCircles(),n.getCircles(t,e).classed(r.default.EXPANDED,!0).attr("r",a)},unexpandCircles:function(t){var e=this,i=e.pointR.bind(e);e.getCircles(t).filter(function(){return(0,n.select)(this).classed(r.default.EXPANDED)}).classed(r.default.EXPANDED,!1).attr("r",i)},pointR:function(t){var e=this,i=e.config;return e.isStepType(t)?0:(0,l.isFunction)(i.point_r)?i.point_r(t):i.point_r},pointExpandedR:function(t){var e=this,i=e.config;return i.point_focus_expand_enabled?i.point_focus_expand_r?i.point_focus_expand_r:1.75*e.pointR(t):e.pointR(t)},pointSelectR:function(t){var e=this,i=e.config;return(0,l.isFunction)(i.point_select_r)?i.point_select_r(t):i.point_select_r?i.point_select_r:4*e.pointR(t)},isWithinCircle:function(t,e){var i=(0,n.mouse)(t),a=(0,n.select)(t),r=+a.attr("cx"),o=+a.attr("cy");return Math.sqrt(Math.pow(r-i[0],2)+Math.pow(o-i[1],2))<e},isWithinStep:function(t,e){return Math.abs(e-(0,n.mouse)(t)[1])<30}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(3),r=_interopRequireDefault(a),o=i(1),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(s.default.prototype,{initBar:function(){this.main.select("."+r.default.chart).append("g").attr("class",r.default.chartBars)},updateTargetsForBar:function(t){var e=this,i=e.config,n=e.classChartBar.bind(e),a=e.classBars.bind(e),o=e.classFocus.bind(e);e.main.select("."+r.default.chartBars).selectAll("."+r.default.chartBar).data(t).attr("class",function(t){return n(t)+o(t)}).enter().append("g").attr("class",n).style("opacity","0").style("pointer-events","none").append("g").attr("class",a).style("cursor",function(t){return i.data_selection_isselectable(t)?"pointer":null})},updateBar:function(t){var e=this,i=e.barData.bind(e),n=e.classBar.bind(e),a=e.initialOpacity.bind(e),o=function(t){return e.color(t.id)};e.mainBar=e.main.selectAll("."+r.default.bars).selectAll("."+r.default.bar).data(i),e.mainBar.exit().transition().duration(t).style("opacity","0").remove(),e.mainBar=e.mainBar.enter().append("path").attr("class",n).style("stroke",o).style("fill",o).merge(e.mainBar).style("opacity",a)},redrawBar:function(t,e){return[(e?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",t).style("fill",this.color).style("opacity","1")]},getBarW:function(t,e){var i=this,n=i.config,a="number"==typeof n.bar_width?n.bar_width:e?t.tickInterval()*n.bar_width_ratio/e:0;return n.bar_width_max&&a>n.bar_width_max?n.bar_width_max:a},getBars:function(t,e){var i=this,n=(0,l.isValue)(t)?"-"+t:"";return(e?i.main.selectAll("."+r.default.bars+i.getTargetSelectorSuffix(e)):i.main).selectAll("."+r.default.bar+n)},expandBars:function(t,e,i){var n=this;i&&n.unexpandBars(),n.getBars(t,e).classed(r.default.EXPANDED,!0)},unexpandBars:function(t){this.getBars(t).classed(r.default.EXPANDED,!1)},generateDrawBar:function(t,e){var i=this,n=i.config,a=i.generateGetBarPoints(t,e);return function(t,e){var i=a(t,e),r=n.axis_rotated?1:0,o=n.axis_rotated?0:1;return"M "+i[0][r]+","+i[0][o]+"\n\t\t\tL "+i[1][r]+","+i[1][o]+"\n\t\t\tL "+i[2][r]+","+i[2][o]+"\n\t\t\tL "+i[3][r]+","+i[3][o]+" z"}},generateGetBarPoints:function(t,e){var i=this,n=e?i.subXAxis:i.xAxis,a=t.__max__+1,r=i.getBarW(n,a),o=i.getShapeX(r,a,t,!!e),s=i.getShapeY(!!e),l=i.getShapeOffset(i.isBarType,t,!!e),d=e?i.getSubYScale:i.getYScale;return function(t,e){var n=d.call(i,t.id)(0),a=l(t,e)||n,u=o(t),c=s(t);return i.config.axis_rotated&&(t.value>0&&c<n||t.value<0&&n<c)&&(c=n),[[u,a],[u,c-(n-a)],[u+r,c-(n-a)],[u+r,a]]}},isWithinBar:function(t){var e=(0,n.mouse)(t),i=(0,l.getRectSegList)(t),a=t.getBBox(),r=i[0],o=i[1],s=Math.min(r.x,o.x),d=Math.min(r.y,o.y),u=a.width,c=a.height;return s-2<e[0]&&e[0]<s+u+2&&d-2<e[1]&&e[1]<d+c+2}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o);(0,i(0).extend)(r.default.prototype,{initText:function(){var t=this;t.main.select("."+s.default.chart).append("g").attr("class",s.default.chartTexts),t.mainText=(0,n.selectAll)([])},updateTargetsForText:function(t){var e=this,i=e.classChartText.bind(e),n=e.classTexts.bind(e),a=e.classFocus.bind(e);e.main.select("."+s.default.chartTexts).selectAll("."+s.default.chartText).data(t).attr("class",function(t){return i(t)+a(t)}).enter().append("g").attr("class",i).style("opacity","0").style("pointer-events","none").append("g").attr("class",n)},updateText:function(t){var e=this,i=e.config,n=e.barOrLineData.bind(e),a=e.classText.bind(e);e.mainText=e.main.selectAll("."+s.default.texts).selectAll("."+s.default.text).data(n),e.mainText.exit().transition().duration(t).style("fill-opacity","0").remove(),e.mainText=e.mainText.enter().append("text").attr("class",a).attr("text-anchor",function(t){return i.axis_rotated?t.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(t){return e.color(t)}).style("fill-opacity","0").merge(e.mainText).text(function(t,i,n){return e.dataLabelFormat(t.id)(t.value,t.id,i,n)})},redrawText:function(t,e,i,n){return[(n?this.mainText.transition():this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",i?0:this.opacityForText.bind(this))]},getTextRect:function(t,e,i){var a=(0,n.select)("body").append("div").classed("bb",!0),r=a.append("svg").style("visibility","hidden").style("position","fixed").style("top","0px").style("left","0px"),o=(0,n.select)(i).style("font"),s=void 0;return r.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",o).text(t).each(function(){s=this.getBoundingClientRect()}),a.remove(),s},generateXYForText:function(t,e,i,n){var a=this,r=a.generateGetAreaPoints(t,!1),o=a.generateGetBarPoints(e,!1),s=a.generateGetLinePoints(i,!1),l=n?a.getXForText:a.getYForText;return function(t,e){var i=a.isBarType(t)?o:s;return i=a.isAreaType(t)?r:i,l.call(a,i(t,e),t,this)}},getXForText:function(t,e,i){var n=this,a=void 0,r=void 0;return n.config.axis_rotated?(r=n.isBarType(e)?4:6,a=t[2][1]+r*(e.value<0?-1:1)):a=n.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(a>n.width?a=n.width-i.getBoundingClientRect().width:a<0&&(a=4)),a},getYForText:function(t,e,i){var n=this,a=void 0;if(n.config.axis_rotated?a=(t[0][0]+t[2][0]+.6*i.getBoundingClientRect().height)/2:(a=t[2][1],e.value<0||0===e.value&&!n.hasPositiveValue?(a+=i.getBoundingClientRect().height,n.isBarType(e)&&n.isSafari()?a-=3:!n.isBarType(e)&&n.isChrome()&&(a+=3)):a+=n.isBarType(e)?-3:-6),null===e.value&&!n.config.axis_rotated){var r=i.getBoundingClientRect().height;a<r?a=r:a>this.height&&(a=this.height-4)}return a}})},function(t,e,i){"use strict";var n=i(1),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(0);(0,r.extend)(a.default.prototype,{setTargetType:function(t,e){var i=this,n=i.config;i.mapToTargetIds(t).forEach(function(t){i.withoutFadeIn[t]=e===n.data_types[t],n.data_types[t]=e}),t||(n.data_type=e)},hasType:function(t,e){var i=this,n=i.config.data_types,a=e||i.data.targets,r=!1;return a&&a.length?a.forEach(function(e){var i=n[e.id];(i&&i.indexOf(t)>=0||!i&&"line"===t)&&(r=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(e){n[e]===t&&(r=!0)}):r=i.config.data_type===t,r},hasArcType:function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},isLineType:function(t){var e=this.config,i=(0,r.isString)(t)?t:t.id;return!e.data_types[i]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])>=0},isStepType:function(t){var e=(0,r.isString)(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},isSplineType:function(t){var e=(0,r.isString)(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},isAreaType:function(t){var e=(0,r.isString)(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},isBarType:function(t){var e=(0,r.isString)(t)?t:t.id;return"bar"===this.config.data_types[e]},isScatterType:function(t){var e=(0,r.isString)(t)?t:t.id;return"scatter"===this.config.data_types[e]},isPieType:function(t){var e=(0,r.isString)(t)?t:t.id;return"pie"===this.config.data_types[e]},isGaugeType:function(t){var e=(0,r.isString)(t)?t:t.id;return"gauge"===this.config.data_types[e]},isDonutType:function(t){var e=(0,r.isString)(t)?t:t.id;return"donut"===this.config.data_types[e]},isArcType:function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},lineData:function(t){return this.isLineType(t)?[t]:[]},arcData:function(t){return this.isArcType(t.data)?[t]:[]},barData:function(t){return this.isBarType(t)?t.values:[]},lineOrScatterData:function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},barOrLineData:function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},isInterpolationType:function(t){return["basis","basis-closed","basis-open","bundle","cardinal","cardinal-closed","cardinal-open","catmull-rom","catmull-rom-closed","catmull-rom-open","linear","linear-closed","monotone-x","monotone-y","natural"].indexOf(t)>=0}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initGrid:function(){var t=this,e=t.config;t.grid=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",s.default.grid),e.grid_x_show&&t.grid.append("g").attr("class",s.default.xgrids),e.grid_y_show&&t.grid.append("g").attr("class",s.default.ygrids),e.grid_focus_show&&t.grid.append("g").attr("class",s.default.xgridFocus).append("line").attr("class",s.default.xgridFocus),t.xgrid=(0,n.selectAll)([]),e.grid_lines_front||t.initGridLines()},initGridLines:function(){var t=this;t.gridLines=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",s.default.grid+" "+s.default.gridLines),t.gridLines.append("g").attr("class",s.default.xgridLines),t.gridLines.append("g").attr("class",s.default.ygridLines),t.xgridLines=(0,n.selectAll)([])},updateXGrid:function(t){var e=this,i=e.config,a=e.generateGridData(i.grid_x_type,e.x),r=e.isCategorized()?e.xAxis.tickOffset():0;e.xgridAttr=i.axis_rotated?{x1:0,x2:e.width,y1:function(t){return e.x(t)-r},y2:function(t){return e.x(t)-r}}:{x1:function(t){return e.x(t)+r},x2:function(t){return e.x(t)+r},y1:0,y2:e.height},e.xgrid=e.main.select("."+s.default.xgrids).selectAll("."+s.default.xgrid).data(a),e.xgrid.exit().remove(),e.xgrid=e.xgrid.enter().append("line").attr("class",s.default.xgrid).merge(e.xgrid),t||e.xgrid.each(function(){var t=(0,n.select)(this);Object.keys(e.xgridAttr).forEach(function(n){t.attr(n,e.xgridAttr[n]).style("opacity",function(){return t.attr(i.axis_rotated?"y1":"x1")===(i.axis_rotated?e.height:0)?"0":"1"})})})},updateYGrid:function(){var t=this,e=t.config,i=t.yAxis.tickValues()||t.y.ticks(e.grid_y_ticks);t.ygrid=t.main.select("."+s.default.ygrids).selectAll("."+s.default.ygrid).data(i),t.ygrid.exit().remove(),t.ygrid=t.ygrid.enter().append("line").attr("class",s.default.ygrid).merge(t.ygrid),t.ygrid.attr("x1",e.axis_rotated?t.y:0).attr("x2",e.axis_rotated?t.y:t.width).attr("y1",e.axis_rotated?0:t.y).attr("y2",e.axis_rotated?t.height:t.y),t.smoothLines(t.ygrid,"grid")},gridTextAnchor:function(t){return t.position?t.position:"end"},gridTextDx:function(t){return"start"===t.position?4:"middle"===t.position?0:-4},xGridTextX:function(t){return"start"===t.position?-this.height:"middle"===t.position?-this.height/2:0},yGridTextX:function(t){return"start"===t.position?0:"middle"===t.position?this.width/2:this.width},updateGrid:function(t){var e=this,i=e.main,n=e.config;e.grid.style("visibility",e.hasArcType()?"hidden":"visible"),i.select("line."+s.default.xgridFocus).style("visibility","hidden"),n.grid_x_show&&e.updateXGrid(),e.xgridLines=i.select("."+s.default.xgridLines).selectAll("."+s.default.xgridLine).data(n.grid_x_lines),e.xgridLines.exit().transition().duration(t).style("opacity","0").remove();var a=e.xgridLines.enter().append("g").attr("class",function(t){return s.default.xgridLine+(t.class?" "+t.class:"")});a.append("line").style("opacity","0"),a.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",n.axis_rotated?"":"rotate(-90)").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity","0"),e.xgridLines=a.merge(e.xgridLines),n.grid_y_show&&e.updateYGrid(),e.ygridLines=i.select("."+s.default.ygridLines).selectAll("."+s.default.ygridLine).data(n.grid_y_lines),e.ygridLines.exit().transition().duration(t).style("opacity","0").remove();var r=e.ygridLines.enter().append("g").attr("class",function(t){return s.default.ygridLine+(t.class?" "+t.class:"")});r.append("line").style("opacity","0"),r.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",n.axis_rotated?"rotate(-90)":"").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity","0"),e.ygridLines=r.merge(e.ygridLines);var o=e.yv.bind(e);e.ygridLines.select("line").transition().duration(t).attr("x1",n.axis_rotated?o:0).attr("x2",n.axis_rotated?o:e.width).attr("y1",n.axis_rotated?0:o).attr("y2",n.axis_rotated?e.height:o).transition().style("opacity","1"),e.ygridLines.select("text").transition().duration(t).attr("x",n.axis_rotated?e.xGridTextX.bind(e):e.yGridTextX.bind(e)).attr("y",o).text(function(t){return t.text}).transition().style("opacity","1")},redrawGrid:function(t){var e=this,i=e.config.axis_rotated,n=e.xv.bind(e),a=e.xgridLines.select("line"),r=e.xgridLines.select("text");return a=(t?a.transition():a).attr("x1",i?0:n).attr("x2",i?e.width:n).attr("y1",i?n:0).attr("y2",i?n:e.height),r=(t?r.transition():r).attr("x",i?e.yGridTextX.bind(e):e.xGridTextX.bind(e)).attr("y",n).text(function(t){return t.text}),[(t?a.transition():a).style("opacity","1"),(t?r.transition():r).style("opacity","1")]},showXGridFocus:function(t){var e=this,i=e.config,n=t.filter(function(t){return t&&(0,l.isValue)(t.value)}),a=e.main.selectAll("line."+s.default.xgridFocus),r=e.xx.bind(e);!i.tooltip_show||e.hasType("scatter")||e.hasArcType()||(a.style("visibility","visible").data([n[0]]).attr(i.axis_rotated?"y1":"x1",r).attr(i.axis_rotated?"y2":"x2",r),e.smoothLines(a,"grid"))},hideXGridFocus:function(){this.main.select("line."+s.default.xgridFocus).style("visibility","hidden")},updateXgridFocus:function(){var t=this,e=t.config;t.main.select("line."+s.default.xgridFocus).attr("x1",e.axis_rotated?0:-10).attr("x2",e.axis_rotated?t.width:-10).attr("y1",e.axis_rotated?-10:0).attr("y2",e.axis_rotated?-10:t.height)},generateGridData:function(t,e){var i=this,n=i.main.select("."+s.default.axisX).selectAll(".tick").size(),a=[];if("year"===t)for(var r=i.getXDomain(),o=r[0].getFullYear(),l=r[1].getFullYear(),d=o;d<=l;d++)a.push(new Date(d+"-01-01 00:00:00"));else a=e.ticks(10),a.length>n&&(a=a.filter(function(t){return(t+"").indexOf(".")<0}));return a},getGridFilterToRemove:function(t){return t?function(e){var i=!1;return((0,l.isArray)(t)?t.concat():[t]).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(i=!0)}),i}:function(){return!0}},removeGridLines:function(t,e){var i=this,n=i.config,a=i.getGridFilterToRemove(t),r=function(t){return!a(t)},o=e?s.default.xgridLines:s.default.ygridLines,l=e?s.default.xgridLine:s.default.ygridLine;i.main.select("."+o).selectAll("."+l).filter(a).transition().duration(n.transition_duration).style("opacity","0").remove(),e?n.grid_x_lines=n.grid_x_lines.filter(r):n.grid_y_lines=n.grid_y_lines.filter(r)}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initTooltip:function(){var t=this,e=t.config,i=void 0;if(t.tooltip=t.selectChart.style("position","relative").append("div").attr("class",s.default.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),e.tooltip_init_show){if(t.isTimeSeries()&&(0,l.isString)(e.tooltip_init_x)){for(e.tooltip_init_x=t.parseDate(e.tooltip_init_x),i=0;i<t.data.targets[0].values.length&&t.data.targets[0].values[i].x-e.tooltip_init_x!=0;i++);e.tooltip_init_x=i}t.tooltip.html(e.tooltip_contents.call(t,t.data.targets.map(function(i){return t.addName(i.values[e.tooltip_init_x])}),t.axis.getXAxisTickFormat(),t.getYFormat(t.hasArcType()),t.color)),t.tooltip.style("top",e.tooltip_init_position.top).style("left",e.tooltip_init_position.left).style("display","block")}},getTooltipContent:function(t,e,i,n){var a=this,r=a.config,o=r.tooltip_format_title||e,s=r.tooltip_format_name||function(t){return t},d=r.tooltip_format_value||i,u=a.isOrderAsc(),c=void 0,f=void 0,g=void 0,h=void 0,p=void 0,x=void 0;if(0===r.data_groups.length)t.sort(function(t,e){var i=t?t.value:null,n=e?e.value:null;return u?i-n:n-i});else{var _=a.orderTargets(a.data.targets).map(function(t){return t.id});t.sort(function(t,e){var i=t?t.value:null,n=e?e.value:null;return i>0&&n>0&&(i=t?_.indexOf(t.id):null,n=e?_.indexOf(e.id):null),u?i-n:n-i})}for(f=0;f<t.length;f++)if(t[f]&&(t[f].value||0===t[f].value)&&(c||(g=(0,l.sanitise)(o?o(t[f].x):t[f].x),c=g||0===g?'<tr><th colspan="2">'+g+"</th></tr>":"",c='<table class="'+a.CLASS.tooltip+'">'+c),void 0!==(h=(0,l.sanitise)(d(t[f].value,t[f].ratio,t[f].id,t[f].index,t))))){if(null===t[f].name)continue;p=(0,l.sanitise)(s(t[f].name,t[f].ratio,t[f].id,t[f].index)),x=a.levelColor?a.levelColor(t[f].value):n(t[f].id),c+='<tr class="'+a.CLASS.tooltipName+a.getTargetSelectorSuffix(t[f].id)+'"><td class="name"><span style="background-color:'+x+'"></span>'+p+'</td><td class="value">'+h+"</td></tr>"}return c+"</table>"},tooltipPosition:function(t,e,i,a){var r=this,o=r.config,s=r.hasArcType(),l="touch"===r.inputType,d=(0,n.mouse)(a),u=void 0,c=void 0,f=void 0,g=void 0,h=void 0;return s?(c=l?d[0]:(r.width-(r.isLegendRight?r.getLegendWidth():0))/2+d[0],g=l?d[1]+20:r.height/2+d[1]+20):(u=r.getSvgLeft(!0),o.axis_rotated?(c=u+d[0]+100,f=c+e,h=r.currentWidth-r.getCurrentPaddingRight(),g=r.x(t[0].x)+20):(c=u+r.getCurrentPaddingLeft(!0)+r.x(t[0].x)+20,f=c+e,h=u+r.currentWidth-r.getCurrentPaddingRight(),g=d[1]+15),f>h&&(c-=f-h+20),g+i>r.currentHeight&&(g-=i+30)),g<0&&(g=0),{top:g,left:c}},showTooltip:function(t,e){var i=this,n=i.config,a=i.hasArcType(),r=t.filter(function(t){return t&&(0,l.isValue)(t.value)}),o=n.tooltip_position||i.tooltipPosition;if(0!==r.length&&n.tooltip_show){i.tooltip.html(n.tooltip_contents.call(i,t,i.axis.getXAxisTickFormat(),i.getYFormat(a),i.color)).style("display","block");var s=i.tooltip.property("offsetWidth"),d=i.tooltip.property("offsetHeight"),u=o.call(this,r,s,d,e);i.tooltip.style("top",u.top+"px").style("left",u.left+"px")}},hideTooltip:function(){this.tooltip.style("display","none")}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initLegend:function(){var t=this;return t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g").attr("transform",t.getTranslate("legend")),t.config.legend_show?void t.updateLegendWithDefaults():(t.legend.style("visibility","hidden"),void(t.hiddenLegendIds=t.mapToIds(t.data.targets)))},updateLegendWithDefaults:function(){var t=this;t.updateLegend(t.mapToIds(t.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},updateSizeForLegend:function(t,e){var i=this,n=i.config,a={top:i.isLegendTop?i.getCurrentPaddingTop()+n.legend_inset_y+5.5:i.currentHeight-t-i.getCurrentPaddingBottom()-n.legend_inset_y,left:i.isLegendLeft?i.getCurrentPaddingLeft()+n.legend_inset_x+.5:i.currentWidth-e-i.getCurrentPaddingRight()-n.legend_inset_x+.5};i.margin3={top:i.isLegendRight?0:i.isLegendInset?a.top:i.currentHeight-t,right:NaN,bottom:0,left:i.isLegendRight?i.currentWidth-e:i.isLegendInset?a.left:0}},transformLegend:function(t){var e=this;(t?e.legend.transition():e.legend).attr("transform",e.getTranslate("legend"))},updateLegendStep:function(t){this.legendStep=t},updateLegendItemWidth:function(t){this.legendItemWidth=t},updateLegendItemHeight:function(t){this.legendItemHeight=t},getLegendWidth:function(){var t=this;return t.config.legend_show?t.isLegendRight||t.isLegendInset?t.legendItemWidth*(t.legendStep+1):t.currentWidth:0},getLegendHeight:function(){var t=this,e=0;return t.config.legend_show&&(e=t.isLegendRight?t.currentHeight:Math.max(20,t.legendItemHeight)*(t.legendStep+1)),e},opacityForLegend:function(t){return t.classed(s.default.legendItemHidden)?null:"1"},opacityForUnfocusedLegend:function(t){return t.classed(s.default.legendItemHidden)?null:"0.3"},toggleFocusLegend:function(t,e){var i=this,a=i.mapToTargetIds(t);i.legend.selectAll("."+s.default.legendItem).filter(function(t){return a.indexOf(t)>=0}).classed(s.default.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?i.opacityForLegend:i.opacityForUnfocusedLegend).call(i,(0,n.select)(this))})},revertLegend:function(){var t=this;t.legend.selectAll("."+s.default.legendItem).classed(s.default.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend((0,n.select)(this))})},showLegend:function(t){var e=this,i=e.config;i.legend_show||(i.legend_show=!0,e.legend.style("visibility","visible"),!e.legendHasRendered&&e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend((0,n.select)(this))})},hideLegend:function(t){var e=this,i=e.config;i.legend_show&&(0,l.isEmpty)(t)&&(i.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},clearLegendItemTextBoxCache:function(){this.legendItemTextBox={}},updateLegend:function(t,e,i){var a=this,r=a.config,o=r.legend_item_tile_width+5,d="touch"===a.inputType,u=0,c=0,f=void 0,g=void 0,h=0,p={},x={},_={},v=[0],m={},y=0,b=void 0,T=t.filter(function(t){return!(0,l.isDefined)(r.data_names[t])||null!==r.data_names[t]}),A=e||{},w=(0,l.getOption)(A,"withTransition",!0),L=(0,l.getOption)(A,"withTransitionForTransform",!0),D=function(t,e){return a.legendItemTextBox[e]||(a.legendItemTextBox[e]=a.getTextRect(t.textContent,s.default.legendItem,t)),a.legendItemTextBox[e]},S=function(t,e,i){var n=i===T.length-1,s=D(t,e),l=s.width+o+(!n||a.isLegendRight||a.isLegendInset?10:0)+r.legend_padding,d=s.height+4,f=a.isLegendRight||a.isLegendInset?d:l,g=a.isLegendRight||a.isLegendInset?a.getLegendHeight():a.getLegendWidth(),b=void 0,A=function(t,e){e||(b=(g-h-f)/2)<10&&(b=(g-f)/2,h=0,y++),m[t]=y,v[y]=a.isLegendInset?10:b,p[t]=h,h+=f};if(0===i&&(h=0,y=0,u=0,c=0),r.legend_show&&!a.isLegendToShow(e))return x[e]=0,_[e]=0,m[e]=0,void(p[e]=0);x[e]=l,_[e]=d,(!u||l>=u)&&(u=l),(!c||d>=c)&&(c=d);var w=a.isLegendRight||a.isLegendInset?c:u;r.legend_equally?(Object.keys(x).forEach(function(t){return x[t]=u}),Object.keys(_).forEach(function(t){return _[t]=c}),b=(g-w*T.length)/2,b<10?(h=0,y=0,T.forEach(function(t){return A(t)})):A(e,!0)):A(e)};a.isLegendInset&&(y=r.legend_inset_step?r.legend_inset_step:T.length,a.updateLegendStep(y)),a.isLegendRight?(f=function(t){return u*m[t]},g=function(t){return v[m[t]]+p[t]}):a.isLegendInset?(f=function(t){return u*m[t]+10},g=function(t){return v[m[t]]+p[t]}):(f=function(t){return v[m[t]]+p[t]},g=function(t){return c*m[t]});var C=function(t,e){return f(t,e)+4+r.legend_item_tile_width},R=function(t,e){return g(t,e)+9},I=function(t,e){return f(t,e)},F=function(t,e){return g(t,e)-5},X=function(t,e){return f(t,e)-2},k=function(t,e){return f(t,e)-2+r.legend_item_tile_width},M=function(t,e){return g(t,e)+4},E=a.legend.selectAll("."+s.default.legendItem).data(T).enter().append("g").attr("class",function(t){return a.generateClass(s.default.legendItem,t)}).style("visibility",function(t){return a.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on(d?"touchstart":"click",function(t){r.legend_item_onclick?r.legend_item_onclick.call(a,t):n.event.altKey?(a.api.hide(),a.api.show(t)):(a.api.toggle(t),a.isTargetToShow(t)?a.api.focus(t):a.api.revert()),d&&a.hideTooltip()}).on(d?void 0:"mouseover",function(t){r.legend_item_onover?r.legend_item_onover.call(a,t):((0,n.select)(this).classed(s.default.legendItemFocused,!0),!a.transiting&&a.isTargetToShow(t)&&a.api.focus(t))}).on(d?"touchend":"mouseout",function(t){r.legend_item_onout?r.legend_item_onout.call(a,t):((0,n.select)(this).classed(s.default.legendItemFocused,!1),a.api.revert())});E.append("text").text(function(t){return(0,l.isDefined)(r.data_names[t])?r.data_names[t]:t}).each(function(t,e){S(this,t,e)}).style("pointer-events","none").attr("x",a.isLegendRight||a.isLegendInset?C:-200).attr("y",a.isLegendRight||a.isLegendInset?-200:R),E.append("rect").attr("class",s.default.legendItemEvent).style("fill-opacity","0").attr("x",a.isLegendRight||a.isLegendInset?I:-200).attr("y",a.isLegendRight||a.isLegendInset?-200:F),E.append("line").attr("class",s.default.legendItemTile).style("stroke",a.color).style("pointer-events","none").attr("x1",a.isLegendRight||a.isLegendInset?X:-200).attr("y1",a.isLegendRight||a.isLegendInset?-200:M).attr("x2",a.isLegendRight||a.isLegendInset?k:-200).attr("y2",a.isLegendRight||a.isLegendInset?-200:M).attr("stroke-width",r.legend_item_tile_height),b=a.legend.select("."+s.default.legendBackground+" rect"),a.isLegendInset&&u>0&&0===b.size()&&(b=a.legend.insert("g","."+s.default.legendItem).attr("class",s.default.legendBackground).append("rect"));var O=a.legend.selectAll("text").data(T).text(function(t){return(0,l.isDefined)(r.data_names[t])?r.data_names[t]:t}).each(function(t,e){S(this,t,e)});(w?O.transition():O).attr("x",C).attr("y",R);var Y=a.legend.selectAll("rect."+s.default.legendItemEvent).data(T);(w?Y.transition():Y).attr("width",function(t){return x[t]}).attr("height",function(t){return _[t]}).attr("x",I).attr("y",F);var z=a.legend.selectAll("line."+s.default.legendItemTile).data(T);(w?z.transition():z).style("stroke",a.color).attr("x1",X).attr("y1",M).attr("x2",k).attr("y2",M),b&&(w?b.transition():b).attr("height",a.getLegendHeight()-12).attr("width",u*(y+1)+10),a.legend.selectAll("."+s.default.legendItem).classed(s.default.legendItemHidden,function(t){return!a.isTargetToShow(t)}),a.updateLegendItemWidth(u),a.updateLegendItemHeight(c),a.updateLegendStep(y),a.updateSizes(),a.updateScales(!w),a.updateSvgSize(),a.transformAll(L,i),a.legendHasRendered=!0}})},function(t,e,i){"use strict";var n=i(1),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{initTitle:function(){var t=this;t.title=t.svg.append("text").text(t.config.title_text).attr("class",t.CLASS.title)},redrawTitle:function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},xForTitle:function(){var t=this,e=t.config,i=e.title_position||"left";return i.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:i.indexOf("center")>=0?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},yForTitle:function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},getTitlePadding:function(){var t=this;return t.yForTitle()+t.config.title_padding.bottom}})},function(t,e,i){"use strict";var n=i(1),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{getClipPath:function(t){return"url("+(window.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0?"":document.URL.split("#")[0])+"#"+t+")"},appendClip:function(t,e){return t.append("clipPath").attr("id",e).append("rect")},getAxisClipX:function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},getAxisClipY:function(t){return t?-20:-this.margin.top},getXAxisClipX:function(){var t=this;return t.getAxisClipX(!t.config.axis_rotated)},getXAxisClipY:function(){var t=this;return t.getAxisClipY(!t.config.axis_rotated)},getYAxisClipX:function(){var t=this;return t.config.axis_y_inner?-1:t.getAxisClipX(t.config.axis_rotated)},getYAxisClipY:function(){var t=this;return t.getAxisClipY(t.config.axis_rotated)},getAxisClipWidth:function(t){var e=this,i=Math.max(30,e.margin.left),n=Math.max(30,e.margin.right);return t?e.width+2+i+n:e.margin.left+20},getAxisClipHeight:function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},getXAxisClipWidth:function(){var t=this;return t.getAxisClipWidth(!t.config.axis_rotated)},getXAxisClipHeight:function(){var t=this;return t.getAxisClipHeight(!t.config.axis_rotated)},getYAxisClipWidth:function(){var t=this;return t.getAxisClipWidth(t.config.axis_rotated)+(t.config.axis_y_inner?20:0)},getYAxisClipHeight:function(){var t=this;return t.getAxisClipHeight(t.config.axis_rotated)}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initPie:function(){var t=this,e=t.config;t.pie=(0,n.pie)().padAngle(e[e.data_type+"_padAngle"]||0).value(function(t){return t.values.reduce(function(t,e){return t+e.value},0)}),e.data_order||t.pie.sort(null)},updateRadius:function(){var t=this,e=t.config,i=e.gauge_width||e.donut_width;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2,t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=i?(t.radius-i)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0},updateArc:function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},updateAngle:function(t){var e=this,i=e.config,n=t,a=!1,r=0,o=void 0,s=void 0,l=void 0,d=void 0;return i?(e.pie(e.filterTargetsToShow(e.data.targets)).forEach(function(t){a||t.data.id!==n.data.id||(a=!0,n=t,n.index=r),r++}),isNaN(n.startAngle)&&(n.startAngle=0),isNaN(n.endAngle)&&(n.endAngle=n.startAngle),e.isGaugeType(n.data)&&(o=i.gauge_min,s=i.gauge_max,l=Math.PI*(i.gauge_fullCircle?2:1)/(s-o),d=n.value<o?0:n.value<s?n.value-o:s-o,n.startAngle=i.gauge_startingAngle,n.endAngle=n.startAngle+l*d),a?n:null):null},getSvgArc:function(){var t=this,e=(0,n.arc)().outerRadius(t.radius).innerRadius(t.innerRadius),i=function(i,n){if(n)return e(i);var a=t.updateAngle(i);return a?e(a):"M 0 0"};return i.centroid=e.centroid,i},getSvgArcExpanded:function(t){var e=this,i=(0,n.arc)().outerRadius(e.radiusExpanded*(t||1)).innerRadius(e.innerRadius);return function(t){var n=e.updateAngle(t);return n?i(n):"M 0 0"}},getArc:function(t,e,i){return i||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},transformForArcLabel:function(t){var e=this,i=e.config,n=e.updateAngle(t),a=void 0,r=void 0,o=void 0,s=void 0,d=void 0,u="";return n&&!e.hasType("gauge")&&(a=this.svgArc.centroid(n),r=isNaN(a[0])?0:a[0],o=isNaN(a[1])?0:a[1],s=Math.sqrt(r*r+o*o),d=e.hasType("donut")&&i.donut_label_ratio?(0,l.isFunction)(i.donut_label_ratio)?i.donut_label_ratio(t,e.radius,s):i.donut_label_ratio:e.hasType("pie")&&i.pie_label_ratio?(0,l.isFunction)(i.pie_label_ratio)?i.pie_label_ratio(t,e.radius,s):i.pie_label_ratio:e.radius&&(s?(36/e.radius>.375?1.175-36/e.radius:.8)*e.radius/s:0),u="translate("+r*d+","+o*d+")"),u},getArcRatio:function(t){var e=this,i=e.config,n=Math.PI*(e.hasType("gauge")&&!i.gauge_fullCircle?1:2);return t?(t.endAngle-t.startAngle)/n:null},convertToArcData:function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getArcRatio(t),index:t.index})},textForArcLabel:function(t){var e=this;if(!e.shouldShowArcLabel())return"";var i=e.updateAngle(t),n=i?i.value:null,a=e.getArcRatio(i),r=t.data.id;if(!e.hasType("gauge")&&!e.meetsArcLabelThreshold(a))return"";var o=e.getArcLabelFormat();return o?o(n,a,r):e.defaultArcValueFormat(n,a)},textForGaugeMinMax:function(t,e){var i=this.getGaugeLabelExtents();return i?i(t,e):t},expandArc:function(t){var e=this,i=void 0;if(e.transiting)return void(i=window.setInterval(function(){e.transiting||(window.clearInterval(i),e.legend.selectAll(".bb-legend-item-focused").size()>0&&e.expandArc(t))},10));var a=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(a,"."+s.default.chartArc)).each(function(t){e.shouldExpand(t.data.id)&&(0,n.select)(this).selectAll("path").transition().duration(e.expandDuration(t.data.id)).attr("d",e.svgArcExpanded).transition().duration(2*e.expandDuration(t.data.id)).attr("d",e.svgArcExpandedSub)})},unexpandArc:function(t){var e=this;if(!e.transiting){var i=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(i,"."+s.default.chartArc)).selectAll("path").transition().duration(function(t){return e.expandDuration(t.data.id)}).attr("d",e.svgArc),e.svg.selectAll(""+s.default.arc).style("opacity","1")}},expandDuration:function(t){var e=this,i=e.config;return e.isDonutType(t)?i.donut_expand_duration:e.isGaugeType(t)?i.gauge_expand_duration:e.isPieType(t)?i.pie_expand_duration:50},shouldExpand:function(t){var e=this,i=e.config;return e.isDonutType(t)&&i.donut_expand||e.isGaugeType(t)&&i.gauge_expand||e.isPieType(t)&&i.pie_expand},shouldShowArcLabel:function(){var t=this,e=t.config,i=!0;return t.hasType("donut")?i=e.donut_label_show:t.hasType("pie")&&(i=e.pie_label_show),i},meetsArcLabelThreshold:function(t){var e=this,i=e.config;return t>=(e.hasType("donut")?i.donut_label_threshold:i.pie_label_threshold)},getArcLabelFormat:function(){var t=this,e=t.config,i=e.pie_label_format;return t.hasType("gauge")?i=e.gauge_label_format:t.hasType("donut")&&(i=e.donut_label_format),i},getGaugeLabelExtents:function(){return this.config.gauge_label_extents},getArcTitle:function(){var t=this;return t.hasType("donut")?t.config.donut_title:""},updateTargetsForArc:function(t){var e=this,i=e.main,n=e.classChartArc.bind(e),a=e.classArcs.bind(e),r=e.classFocus.bind(e),o=i.select("."+s.default.chartArcs).selectAll("."+s.default.chartArc).data(e.pie(t)).attr("class",function(t){return n(t)+r(t.data)}),l=o.enter().append("g").attr("class",n);l.append("g").attr("class",a).merge(o),l.append("text").attr("dy",e.hasType("gauge")?"-.1em":".35em").style("opacity","0").style("text-anchor","middle").style("pointer-events","none")},initArc:function(){var t=this;t.arcs=t.main.select("."+s.default.chart).append("g").attr("class",s.default.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",s.default.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},redrawArc:function(t,e,i){function selectArc(t,e,i){a.expandArc(i),a.api.focus(i),a.toggleFocusLegend(i,!0),a.showTooltip([e],t)}function unselectArc(t){var e=t&&t.id||void 0;a.unexpandArc(e),a.api.revert(),a.revertLegend(),a.hideTooltip()}var a=this,r=a.config,o=a.main,l="touch"===a.inputType,d="mouse"===a.inputType,u=o.selectAll("."+s.default.arcs).selectAll("."+s.default.arc).data(a.arcData.bind(a));if(u.exit().transition().duration(e).style("opacity","0").remove(),u=u.enter().append("path").attr("class",a.classArc.bind(a)).style("fill",function(t){return a.color(t.data)}).style("cursor",function(t){return r.interaction_enabled&&(r.data_selection_isselectable(t)?"pointer":null)}).style("opacity","0").each(function(t){a.isGaugeType(t.data)&&(t.startAngle=r.gauge_startingAngle,t.endAngle=r.gauge_startingAngle),this._current=t}).merge(u),u.attr("transform",function(t){return!a.isGaugeType(t.data)&&i?"scale(0)":""}).style("opacity",function(t){return t===this._current?"0":"1"}).each(function(){a.transiting=!0}).transition().duration(t).attrTween("d",function(t){var e=a.updateAngle(t);if(!e)return function(){return"M 0 0"};isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);var i=(0,n.interpolate)(this._current,e);return this._current=i(0),function(e){var n=i(e);return n.data=t.data,a.getArc(n,!0)}}).attr("transform",i?"scale(1)":"").style("fill",function(t){return a.levelColor?a.levelColor(t.data.values[0].value):a.color(t.data.id)}).style("opacity","1").call(a.endall,function(){a.transiting=!1}),r.interaction_enabled&&(u.on("click",function(t,e){var i=a.updateAngle(t),n=void 0;i&&(n=a.convertToArcData(i),a.toggleShape&&a.toggleShape(this,n,e),a.config.data_onclick.call(a.api,n,this))}),d&&u.on("mouseover",function(t){if(!a.transiting){var e=a.updateAngle(t),i=e?a.convertToArcData(e):null;selectArc(this,i,i&&i.id||void 0),a.config.data_onover(i,this)}}).on("mouseout",function(t){if(!a.transiting){var e=a.updateAngle(t),i=e?a.convertToArcData(e):null;unselectArc(),a.config.data_onout(i,this)}}).on("mousemove",function(t){var e=a.updateAngle(t),i=e?a.convertToArcData(e):null;a.showTooltip([i],this)}),l&&a.hasArcType())){var c=function(){var t=n.event.changedTouches[0];return(0,n.select)(document.elementFromPoint(t.clientX,t.clientY))};a.svg.on("touchstart",function(){if(!a.transiting){var t=c(),e=t.datum(),i=e&&e.data&&e.data.id?a.updateAngle(e):null,n=i?a.convertToArcData(i):null,r=n&&n.id||void 0;void 0===r?unselectArc():selectArc(this,n,r),a.config.data_onover(n,this)}}).on("touchend",function(){if(!a.transiting){var t=c(),e=t.datum(),i=e&&e.data&&e.data.id?a.updateAngle(e):null,n=i?a.convertToArcData(i):null,r=n&&n.id||void 0;void 0===r?unselectArc():selectArc(this,n,r),a.config.data_onout(n,this)}}).on("touchmove",function(){var t=c(),e=t.datum(),i=e&&e.data&&e.data.id?a.updateAngle(e):null,n=i?a.convertToArcData(i):null,r=n&&n.id||void 0;void 0===r?unselectArc():selectArc(this,n,r)})}o.selectAll("."+s.default.chartArc).select("text").style("opacity","0").attr("class",function(t){return a.isGaugeType(t.data)?s.default.gaugeValue:""}).text(a.textForArcLabel.bind(a)).attr("transform",a.transformForArcLabel.bind(a)).style("font-size",function(t){return a.isGaugeType(t.data)?Math.round(a.radius/5)+"px":""}).transition().duration(t).style("opacity",function(t){return a.isTargetToShow(t.data.id)&&a.isArcType(t.data)?"1":"0"}),o.select("."+s.default.chartArcsTitle).style("opacity",a.hasType("donut")||a.hasType("gauge")?"1":"0"),a.hasType("gauge")&&(a.arcs.select("."+s.default.chartArcsBackground).attr("d",function(){var t={data:[{value:r.gauge_max}],startAngle:r.gauge_startingAngle,endAngle:-1*r.gauge_startingAngle};return a.getArc(t,!0,!0)}),a.arcs.select("."+s.default.chartArcsGaugeUnit).attr("dy",".75em").text(r.gauge_label_show?r.gauge_units:""),a.arcs.select("."+s.default.chartArcsGaugeMin).attr("dx",-1*(a.innerRadius+(a.radius-a.innerRadius)/(r.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(r.gauge_label_show?a.textForGaugeMinMax(r.gauge_min,!1):""),a.arcs.select("."+s.default.chartArcsGaugeMax).attr("dx",a.innerRadius+(a.radius-a.innerRadius)/(r.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(r.gauge_label_show?a.textForGaugeMinMax(r.gauge_max,!0):""))},initGauge:function(){var t=this.arcs;this.hasType("gauge")&&(t.append("path").attr("class",s.default.chartArcsBackground),t.append("text").attr("class",s.default.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",s.default.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",s.default.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},getGaugeLabelHeight:function(){return this.config.gauge_label_show?20:0}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initRegion:function(){var t=this;t.region=t.main.append("g").attr("clip-path",t.clipPath).attr("class",s.default.regions)},updateRegion:function(t){var e=this,i=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible"),e.mainRegion=e.main.select("."+s.default.regions).selectAll("."+s.default.region).data(i.regions),e.mainRegion.exit().transition().duration(t).style("opacity","0").remove(),e.mainRegion=e.mainRegion.enter().append("g").merge(e.mainRegion).attr("class",e.classRegion.bind(e)),e.mainRegion.append("rect").style("fill-opacity","0")},redrawRegion:function(t){var e=this,i=e.regionX.bind(e),a=e.regionY.bind(e),r=e.regionWidth.bind(e),o=e.regionHeight.bind(e),s=e.mainRegion.select("rect");return s=(t?s.transition():s).attr("x",i).attr("y",a).attr("width",r).attr("height",o),[(t?s.transition():s).style("fill-opacity",function(t){return(0,l.isValue)(t.opacity)?t.opacity:"0.1"}).on("end",function(){(0,n.select)(this.parentNode).selectAll("rect:not([x])").remove()})]},regionX:function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated&&"start"in t?n(t.start):0:i.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},regionY:function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated?0:"end"in t?n(t.end):0:i.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},regionWidth:function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2,a=e.regionX(t),r=void 0;return r="y"===t.axis||"y2"===t.axis?i.axis_rotated&&"end"in t?n(t.end):e.width:i.axis_rotated?e.width:"end"in t?e.x(e.isTimeSeries()?e.parseDate(t.end):t.end):e.width,r<a?0:r-a},regionHeight:function(t){var e=this,i=e.config,n=this.regionY(t),a=void 0,r="y"===t.axis?e.y:e.y2;return a="y"===t.axis||"y2"===t.axis?i.axis_rotated?e.height:"start"in t?r(t.start):e.height:i.axis_rotated&&"end"in t?e.x(e.isTimeSeries()?e.parseDate(t.end):t.end):e.height,a<n?0:a-n},isRegionOnX:function(t){return!t.axis||"x"===t.axis}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{drag:function(t){var e=this,i=e.config,a=e.main;if(!e.hasArcType()&&i.data_selection_enabled&&(!i.zoom_enabled||e.zoom.altDomain)&&i.data_selection_multiple){var r=e.dragStart[0],o=e.dragStart[1],d=t[0],u=t[1],c=Math.min(r,d),f=Math.max(r,d),g=i.data_selection_grouped?e.margin.top:Math.min(o,u),h=i.data_selection_grouped?e.height:Math.max(o,u);a.select("."+s.default.dragarea).attr("x",c).attr("y",g).attr("width",f-c).attr("height",h-g),a.selectAll("."+s.default.shapes).selectAll("."+s.default.shape).filter(function(t){return i.data_selection_isselectable(t)}).each(function(t,i){var a=(0,n.select)(this),r=a.classed(s.default.SELECTED),o=a.classed(s.default.INCLUDED),d=void 0,u=void 0,p=void 0,x=void 0,_=void 0,v=!1,m=void 0;if(a.classed(s.default.circle))d=1*a.attr("cx"),u=1*a.attr("cy"),_=e.togglePoint,v=c<d&&d<f&&g<u&&u<h;else{if(!a.classed(s.default.bar))return;m=(0,l.getPathBox)(this),d=m.x,u=m.y,p=m.width,x=m.height,_=e.togglePath,v=!(f<d||d+p<c||h<u||u+x<g)}v^o&&(a.classed(s.default.INCLUDED,!o),a.classed(s.default.SELECTED,!r),_.call(e,!r,a,t,i))})}},dragstart:function(t){var e=this,i=e.config;e.hasArcType()||!i.data_selection_enabled||(e.dragStart=t,e.main.select("."+s.default.chart).append("rect").attr("class",s.default.dragarea).style("opacity","0.1"),e.dragging=!0)},dragend:function(){var t=this,e=t.config;t.hasArcType()||!e.data_selection_enabled||(t.main.select("."+s.default.dragarea).transition().duration(100).style("opacity","0").remove(),t.main.selectAll("."+s.default.shape).classed(s.default.INCLUDED,!1),t.dragging=!1)}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o);(0,i(0).extend)(r.default.prototype,{selectPoint:function(t,e,i){var n=this,a=n.config,r=(a.axis_rotated?n.circleY:n.circleX).bind(n),o=(a.axis_rotated?n.circleX:n.circleY).bind(n),l=n.pointSelectR.bind(n);a.data_onselected.call(n.api,e,t.node()),n.main.select("."+s.default.selectedCircles+n.getTargetSelectorSuffix(e.id)).selectAll("."+s.default.selectedCircle+"-"+i).data([e]).enter().append("circle").attr("class",function(){return n.generateClass(s.default.selectedCircle,i)}).attr("cx",r).attr("cy",o).attr("stroke",function(){return n.color(e)}).attr("r",function(t){return 1.4*n.pointSelectR(t)}).transition().duration(100).attr("r",l)},unselectPoint:function(t,e,i){var n=this;n.config.data_onunselected.call(n.api,e,t.node()),n.main.select("."+s.default.selectedCircles+n.getTargetSelectorSuffix(e.id)).selectAll("."+s.default.selectedCircle+"-"+i).transition().duration(100).attr("r",0).remove()},togglePoint:function(t,e,i,n){t?this.selectPoint(e,i,n):this.unselectPoint(e,i,n)},selectPath:function(t,e){var i=this;i.config.data_onselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return(0,n.rgb)(i.color(e)).brighter(.75)})},unselectPath:function(t,e){var i=this;i.config.data_onunselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return i.color(e)})},togglePath:function(t,e,i,n){t?this.selectPath(e,i,n):this.unselectPath(e,i,n)},getToggle:function(t,e){var i=this,n=void 0;return"circle"===t.nodeName?n=i.isStepType(e)?function(){}:i.togglePoint:"path"===t.nodeName&&(n=i.togglePath),n},toggleShape:function(t,e,i){var a=this,r=this,o=r.config,l=(0,n.select)(t),d=l.classed(s.default.SELECTED),u=r.getToggle(t,e).bind(r);if(o.data_selection_enabled&&o.data_selection_isselectable(e)){if(!o.data_selection_multiple){var c="."+s.default.shapes;o.data_selection_grouped&&(c="."+c+r.getTargetSelectorSuffix(e.id)),r.main.selectAll(c).selectAll("."+s.default.shape).each(function(t,e){var i=(0,n.select)(a);i.classed(s.default.SELECTED)&&u(!1,i.classed(s.default.SELECTED,!1),t,e)})}l.classed(s.default.SELECTED,!d),u(!d,l,e,i)}}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initBrush:function(){var t=this;t.brush=t.config.axis_rotated?(0,n.brushY)():(0,n.brushX)();var e=function(){t.redrawForBrush()};t.brush.on("start",function(){"touch"===t.inputType&&t.hideTooltip(),e()}).on("brush",e),t.brush.update=function(){return 0===this.extent()()[1].filter(function(t){return isNaN(t)}).length&&t.context&&t.context.select("."+s.default.brush).call(this),this},t.brush.scale=function(e,i){var n=t.svg.select(".bb-brush .overlay"),a=[[0,0]];e.range?a.push([e.range()[1],(i||!n.empty())&&~~n.attr("height")||60]):e.constructor===Array&&a.push(e),t.config.axis_rotated&&a.reverse(),this.extent(t.config.axis_x_extent||a),this.update()},t.brush.getSelection=function(){return t.context?t.context.select("."+s.default.brush):(0,n.select)([])}},initSubchart:function(){var t=this,e=t.config,i=e.subchart_show?"visible":"hidden";t.context=t.svg.append("g").attr("transform",t.getTranslate("context"));var n=t.context;n.style("visibility",i),n.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",s.default.chart),n.select("."+s.default.chart).append("g").attr("class",s.default.chartBars),n.select("."+s.default.chart).append("g").attr("class",s.default.chartLines),n.append("g").attr("clip-path",t.clipPath).attr("class",s.default.brush).call(t.brush),t.axes.subx=n.append("g").attr("class",s.default.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis).style("visibility",e.subchart_axis_x_show?i:"hidden")},updateTargetsForSubchart:function(t){var e=this,i=e.context,n=e.config,a=e.classChartBar.bind(e),r=e.classBars.bind(e),o=e.classChartLine.bind(e),l=e.classLines.bind(e),d=e.classAreas.bind(e);if(n.subchart_show){var u=i.select("."+s.default.chartBars).selectAll("."+s.default.chartBar).data(t).attr("class",a);u.enter().append("g").style("opacity","0").attr("class",a).merge(u).append("g").attr("class",r);var c=i.select("."+s.default.chartLines).selectAll("."+s.default.chartLine).data(t).attr("class",o),f=c.enter().append("g").style("opacity","0").attr("class",o).merge(c);f.append("g").attr("class",l),f.append("g").attr("class",d),i.selectAll("."+s.default.brush+" rect").attr(n.axis_rotated?"width":"height",n.axis_rotated?e.width2:e.height2)}},updateBarForSubchart:function(t){var e=this;e.contextBar=e.context.selectAll("."+s.default.bars).selectAll("."+s.default.bar).data(e.barData.bind(e)),e.contextBar.exit().transition().duration(t).style("opacity","0").remove(),e.contextBar=e.contextBar.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color).merge(e.contextBar).style("opacity",e.initialOpacity.bind(e))},redrawBarForSubchart:function(t,e,i){var n=void 0;n=e?this.contextBar.transition(Math.random().toString()).duration(i):this.contextBar,n.attr("d",t).style("opacity","1")},updateLineForSubchart:function(t){var e=this;e.contextLine=e.context.selectAll("."+s.default.lines).selectAll("."+s.default.line).data(e.lineData.bind(e)),e.contextLine.exit().transition().duration(t).style("opacity","0").remove(),e.contextLine=e.contextLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color).merge(e.contextLine).style("opacity",e.initialOpacity.bind(e))},redrawLineForSubchart:function(t,e,i){var n=void 0;n=e?this.contextLine.transition(Math.random().toString()).duration(i):this.contextLine,n.attr("d",t).style("opacity","1")},updateAreaForSubchart:function(t){var e=this;e.contextArea=e.context.selectAll("."+s.default.areas).selectAll("."+s.default.area).data(e.lineData.bind(e)),e.contextArea.exit().transition().duration(t).style("opacity","0").remove(),e.contextArea=e.contextArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=(0,n.select)(this).style("opacity"),"0"}).merge(e.contextArea).style("opacity","0")},redrawAreaForSubchart:function(t,e,i){var n=void 0;n=e?this.contextArea.transition(Math.random().toString()).duration(i):this.contextArea,n.attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},redrawSubchart:function(t,e,i,a,r,o,s){var l=this,d=l.config;if(l.context.style("visibility",d.subchart_show?"visible":"hidden"),d.subchart_show&&(n.event&&"zoom"===n.event.type&&l.brush.update(),t)){l.brushEmpty()||l.brush.update();var u=l.generateDrawArea(r,!0),c=l.generateDrawBar(o,!0),f=l.generateDrawLine(s,!0);l.updateBarForSubchart(i),l.updateLineForSubchart(i),l.updateAreaForSubchart(i),l.redrawBarForSubchart(c,i,i),l.redrawLineForSubchart(f,i,i),l.redrawAreaForSubchart(u,i,i)}},redrawForBrush:function(){var t=this,e=t.x;t.redraw({withTransition:!1,withY:t.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),t.config.subchart_onbrush.call(t.api,e.orgDomain())},transformContext:function(t,e){var i=this,n=void 0;e&&e.axisSubX?n=e.axisSubX:(n=i.context.select("."+s.default.axisX),t&&(n=n.transition())),i.context.attr("transform",i.getTranslate("context")),n.attr("transform",i.getTranslate("subx"))},getDefaultExtent:function(){var t=this,e=t.config,i=(0,l.isFunction)(e.axis_x_extent)?e.axis_x_extent(t.getXDomain(t.data.targets)):e.axis_x_extent;return t.isTimeSeries()&&(i=[t.parseDate(i[0]),t.parseDate(i[1])]),i}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(1),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o),l=i(0);(0,l.extend)(r.default.prototype,{initZoom:function(){var t=this,e=t.config,i=void 0;t.zoomScale=null,t.zoom=(0,n.zoom)().duration(0).on("start",function(){i=n.event.sourceEvent,t.zoom.altDomain=n.event.sourceEvent.altKey?t.x.orgDomain():null,e.zoom_onzoomstart.call(t.api,n.event.sourceEvent)}).on("zoom",function(){t.redrawForZoom.call(t)}).on("end",function(){var a=n.event.sourceEvent;a&&i.clientX===a.clientX&&i.clientY===a.clientY||(t.redrawEventRect(),t.updateZoom(),e.zoom_onzoomend.call(t.api,t.x.orgDomain()))}),t.zoom.orgScaleExtent=function(){var i=e.zoom_extent?e.zoom_extent:[1,10];return[i[0],Math.max(t.getMaxDataCount()/i[1],i[1])]},t.zoom.updateScaleExtent=function(){var e=(0,l.diffDomain)(t.x.orgDomain())/(0,l.diffDomain)(t.getZoomDomain()),i=this.orgScaleExtent();return this.scaleExtent([i[0]*e,i[1]*e]),this},t.zoom.updateTransformScale=function(e){var i=e.rescaleX(t.x);i.domain(t.trimXDomain(i.domain())),t.zoomScale=i,t.xAxis.scale(t.zoomScale),t.main.select("."+s.default.eventRects).node().__zoom=e}},getZoomDomain:function(){var t=this,e=t.config;return[(0,n.min)([t.orgXDomain[0],e.zoom_x_min]),(0,n.max)([t.orgXDomain[1],e.zoom_x_max])]},updateZoom:function(){var t=this,e=t.config.zoom_enabled?t.zoom:function(){};t.main.select("."+s.default.eventRects).call(e).on("dblclick.zoom",null)},redrawForZoom:function(){var t=this,e=t.config;if(e.zoom_enabled){var i=t.zoom,a=t.x,r=n.event,o=r.transform;return t.zoom.updateTransformScale(o),0===t.filterTargetsToShow(t.data.targets).length?void 0:"mousemove"===r.sourceEvent.type&&i.altDomain?(a.domain(i.altDomain),void o.scale(t.zoomScale).updateScaleExtent()):(t.isCategorized()&&a.orgDomain()[0]===t.orgXDomain[0]&&a.domain([t.orgXDomain[0]-1e-10,a.orgDomain()[1]]),t.redraw({withTransition:!1,withY:e.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===r.sourceEvent.type&&(t.cancelClick=!0),void e.zoom_onzoom.call(t.api,a.orgDomain()))}}})},function(t,e,i){"use strict";var n=i(2),a=i(1),r=function(t){return t&&t.__esModule?t:{"default":t}}(a),o=i(0);(0,o.extend)(r.default.prototype,{generateColor:function(){var t=this,e=t.config,i=e.data_colors,a=e.data_color,r=[],s=(0,o.notEmpty)(e.color_pattern)?e.color_pattern:(0,n.scaleOrdinal)(n.schemeCategory10).range();return function(t){var e=t.id||t.data&&t.data.id||t,n=void 0;return i[e]instanceof Function?n=i[e](t):i[e]?n=i[e]:(r.indexOf(e)<0&&r.push(e),n=s[r.indexOf(e)%s.length],i[e]=n),a instanceof Function?a(n,t):n}},generateLevelColor:function(){var t=this,e=t.config,i=e.color_pattern,n=e.color_threshold,a="value"===n.unit,r=n.max||100,s=n.values&&n.values.length?n.values:[];return(0,o.notEmpty)(n)?function(t){for(var e=i[i.length-1],n=0;n<s.length;n++)if((a?t:100*t/r)<s[n]){e=i[n];break}return e}:null}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(5),a=_interopRequireDefault(n),r=i(1),o=_interopRequireDefault(r),s=i(0),l=function(t,e,i){var n=t.config,a="axis_"+e+"_tick_format";return(n[a]?n[a]:t.defaultValueFormat)(i)};(0,s.extend)(o.default.prototype,{getYFormat:function(t){var e=this,i=e.yFormat,n=e.y2Format;return t&&!e.hasType("gauge")&&(i=e.defaultArcValueFormat,n=e.defaultArcValueFormat),function(t,a,r){return("y2"===e.axis.getId(r)?n:i).call(e,t,a)}},yFormat:function(t){return l(this,"y",t)},y2Format:function(t){return l(this,"y2",t)},defaultValueFormat:function(t){return(0,s.isValue)(t)?+t:""},defaultArcValueFormat:function(t,e){return(100*e).toFixed(1)+"%"},dataLabelFormat:function(t){var e=this,i=e.config.data_labels,n=function(t){return(0,s.isValue)(t)?+t:""};return"function"==typeof i.format?i.format:"object"===(0,a.default)(i.format)?i.format[t]?!0===i.format[t]?n:i.format[t]:function(){return""}:n}})},function(t,e,i){"use strict";var n=i(1),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{hasCaches:function(t){for(var e=0;e<t.length;e++)if(!(t[e]in this.cache))return!1;return!0},addCache:function(t,e){this.cache[t]=this.cloneTarget(e)},getCaches:function(t){for(var e=[],i=0;i<t.length;i++)t[i]in this.cache&&e.push(this.cloneTarget(this.cache[t[i]]));return e}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(1),a=_interopRequireDefault(n),r=i(3),o=_interopRequireDefault(r);(0,i(0).extend)(a.default.prototype,{CLASS:o.default,generateClass:function(t,e){return" "+t+" "+(t+this.getTargetSelectorSuffix(e))},classText:function(t){return this.generateClass(o.default.text,t.index)},classTexts:function(t){return this.generateClass(o.default.texts,t.id)},classShape:function(t){return this.generateClass(o.default.shape,t.index)},classShapes:function(t){return this.generateClass(o.default.shapes,t.id)},classLine:function(t){return this.classShape(t)+this.generateClass(o.default.line,t.id)},classLines:function(t){return this.classShapes(t)+this.generateClass(o.default.lines,t.id)},classCircle:function(t){return this.classShape(t)+this.generateClass(o.default.circle,t.index)},classCircles:function(t){return this.classShapes(t)+this.generateClass(o.default.circles,t.id)},classBar:function(t){return this.classShape(t)+this.generateClass(o.default.bar,t.index)},classBars:function(t){return this.classShapes(t)+this.generateClass(o.default.bars,t.id)},classArc:function(t){return this.classShape(t.data)+this.generateClass(o.default.arc,t.data.id)},classArcs:function(t){return this.classShapes(t.data)+this.generateClass(o.default.arcs,t.data.id)},classArea:function(t){return this.classShape(t)+this.generateClass(o.default.area,t.id)},classAreas:function(t){return this.classShapes(t)+this.generateClass(o.default.areas,t.id)},classRegion:function(t,e){return this.generateClass(o.default.region,e)+" "+("class"in t?t.class:"")},classEvent:function(t){return this.generateClass(o.default.eventRect,t.index)},classTarget:function(t){var e=this.config.data_classes[t],i="";return e&&(i=" "+o.default.target+"-"+e),this.generateClass(o.default.target,t)+i},classFocus:function(t){return this.classFocused(t)+this.classDefocused(t)},classFocused:function(t){return" "+(this.focusedTargetIds.indexOf(t.id)>=0?o.default.focused:"")},classDefocused:function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?o.default.defocused:"")},classChartText:function(t){return o.default.chartText+this.classTarget(t.id)},classChartLine:function(t){return o.default.chartLine+this.classTarget(t.id)},classChartBar:function(t){return o.default.chartBar+this.classTarget(t.id)},classChartArc:function(t){return o.default.chartArc+this.classTarget(t.data.id)},getTargetSelectorSuffix:function(t){return t||0===t?("-"+t).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},selectorTarget:function(t,e){return(e||"")+"."+(o.default.target+this.getTargetSelectorSuffix(t))},selectorTargets:function(t,e){var i=this,n=t||[];return n.length?n.map(function(t){return i.selectorTarget(t,e)}):null},selectorLegend:function(t){return"."+(o.default.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(4),r=_interopRequireDefault(a),o=i(3),s=_interopRequireDefault(o);(0,i(0).extend)(r.default.prototype,{focus:function(t){var e=this.internal,i=e.mapToTargetIds(t),n=e.svg.selectAll(e.selectorTargets(i.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),n.classed(s.default.focused,!0).classed(s.default.defocused,!1),e.hasArcType()&&e.expandArc(i),e.toggleFocusLegend(i,!0),e.focusedTargetIds=i,e.defocusedTargetIds=e.defocusedTargetIds.filter(function(t){return i.indexOf(t)<0})},defocus:function(t){var e=this.internal,i=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(i.filter(e.isTargetToShow,e))).classed(s.default.focused,!1).classed(s.default.defocused,!0),e.hasArcType()&&e.unexpandArc(i),e.toggleFocusLegend(i,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(t){return i.indexOf(t)<0}),e.defocusedTargetIds=i},revert:function(t){var e=this.internal,i=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(i)).classed(s.default.focused,!1).classed(s.default.defocused,!1),e.hasArcType()&&e.unexpandArc(i),e.config.legend_show&&(e.showLegend(i.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(i)).filter(function(){return(0,n.select)(this).classed(s.default.legendItemFocused)}).classed(s.default.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]}})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{show:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.internal,n=i.mapToTargetIds(t);i.removeHiddenTargetIds(n);var a=i.svg.selectAll(i.selectorTargets(n));a.transition().style("opacity","1","important").call(i.endall,function(){a.style("opacity",null).style("opacity","1")}),e.withLegend&&i.showLegend(n),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},hide:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.internal,n=i.mapToTargetIds(t);i.addHiddenTargetIds(n);var a=i.svg.selectAll(i.selectorTargets(n));a.transition().style("opacity","0","important").call(i.endall,function(){a.style("opacity",null).style("opacity","0")}),e.withLegend&&i.hideLegend(n),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},toggle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this,n=this.internal;n.mapToTargetIds(t).forEach(function(t){n.isTargetToShow(t)?i.hide(t,e):i.show(t,e)})}})},function(t,e,i){"use strict";var n=i(2),a=i(4),r=function(t){return t&&t.__esModule?t:{"default":t}}(a),o=i(0),s=function(t){var e=this.internal,i=t,a=void 0;if(i){if(e.isTimeSeries()&&(i=i.map(function(t){return e.parseDate(t)})),e.config.subchart_show){var r=e.zoomScale||e.x;e.brush.getSelection().call(e.brush.move,[r(i[0]),r(i[1])]),a=i}else{var o=e.x.orgDomain(),s=(o[1]-o[0])/(i[1]-i[0]),l=e.isTimeSeries()?0-s*e.x(i[0].getTime()):i[0]-s*e.x(i[0]);e.zoom.updateTransformScale(n.zoomIdentity.translate(l,0).scale(s)),a=e.zoomScale.domain()}e.redraw({withTransition:!0,withY:e.config.zoom_rescale,withDimension:!1}),e.config.zoom_onzoom.call(this,e.x.orgDomain())}else a=(e.zoomScale||e.x).domain();return a};s.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},s.max=function(t){var e=this.internal,i=e.config;if(0!==t&&!t)return i.zoom_x_max;i.zoom_x_max=(0,n.max)([e.orgXDomain[1],t])},s.min=function(t){var e=this.internal,i=e.config;if(0!==t&&!t)return i.zoom_x_min;i.zoom_x_min=(0,n.min)([e.orgXDomain[0],t])},s.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};(0,o.isDefined)(t.max)&&this.domain.max(t.max),(0,o.isDefined)(t.min)&&this.domain.min(t.min)},(0,o.extend)(r.default.prototype,{zoom:s,unzoom:function(){var t=this.internal;t.config.subchart_show?t.brush.getSelection().call(t.brush.move,null):t.zoom.updateTransformScale(n.zoomIdentity),t.redraw({withTransition:!0,withY:t.config.zoom_rescale})}})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{load:function(t){var e=this.internal,i=e.config;return t.xs&&e.addXs(t.xs),"names"in t&&this.data.names(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(e){i.data_classes[e]=t.classes[e]}),"categories"in t&&e.isCategorized()&&(i.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(e){i.data_axes[e]=t.axes[e]}),"colors"in t&&Object.keys(t.colors).forEach(function(e){i.data_colors[e]=t.colors[e]}),"cacheIds"in t&&e.hasCaches(t.cacheIds)?void e.load(e.getCaches(t.cacheIds),t.done):void("unload"in t?e.unload(e.mapToTargetIds("boolean"==typeof t.unload&&t.unload?null:t.unload),function(){return e.loadFromArgs(t)}):e.loadFromArgs(t))},unload:function(t){var e=this.internal,i=t||{};i instanceof Array?i={ids:i}:"string"==typeof i&&(i={ids:[i]}),e.unload(e.mapToTargetIds(i.ids),function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),i.done&&i.done()})}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(4),r=_interopRequireDefault(a),o=i(1),s=_interopRequireDefault(o),l=i(0),d=i(3),u=_interopRequireDefault(d);(0,l.extend)(r.default.prototype,{flow:function(t){var e=this.internal,i=[],n=e.getMaxDataCount(),a=void 0,r=void 0,o=0,s=0,d=void 0,u=void 0;if(t.json)a=e.convertJsonToData(t.json,t.keys);else if(t.rows)a=e.convertRowsToData(t.rows);else{if(!t.columns)return;a=e.convertColumnsToData(t.columns)}var c=e.convertDataToTargets(a,!0);e.data.targets.forEach(function(t){var n=!1,a=void 0,r=void 0;for(a=0;a<c.length;a++)if(t.id===c[a].id){for(n=!0,t.values[t.values.length-1]&&(s=t.values[t.values.length-1].index+1),o=c[a].values.length,r=0;r<o;r++)c[a].values[r].index=s+r,e.isTimeSeries()||(c[a].values[r].x=s+r);t.values=t.values.concat(c[a].values),c.splice(a,1);break}n||i.push(t.id)}),e.data.targets.forEach(function(t){var n=void 0,a=void 0;for(n=0;n<i.length;n++)if(t.id===i[n])for(s=t.values[t.values.length-1].index+1,a=0;a<o;a++)t.values.push({id:t.id,index:s+a,x:e.isTimeSeries()?e.getOtherTargetX(s+a):s+a,value:null})}),e.data.targets.length&&c.forEach(function(t){var i=void 0,n=[];for(i=e.data.targets[0].values[0].index;i<s;i++)n.push({id:t.id,index:i,x:e.isTimeSeries()?e.getOtherTargetX(i):i,value:null});t.values.forEach(function(t){t.index+=s,e.isTimeSeries()||(t.x+=s)}),t.values=n.concat(t.values)}),e.data.targets=e.data.targets.concat(c);var f=e.data.targets[0],g=f.values[0];(0,l.isDefined)(t.to)?(o=0,u=e.isTimeSeries()?e.parseDate(t.to):t.to,f.values.forEach(function(t){t.x<u&&o++})):(0,l.isDefined)(t.length)&&(o=t.length),n?1===n&&e.isTimeSeries()&&(d=(f.values[f.values.length-1].x-g.x)/2,r=[new Date(+g.x-d),new Date(+g.x+d)],e.updateXDomain(null,!0,!0,!1,r)):(d=e.isTimeSeries()?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-e.getXDomain(e.data.targets)[0]:1,r=[g.x-d,g.x],e.updateXDomain(null,!0,!0,!1,r)),e.updateTargets(e.data.targets),e.redraw({flow:{index:g.index,length:o,duration:(0,l.isValue)(t.duration)?t.duration:e.config.transition_duration,done:t.done,orgDataCount:n},withLegend:!0,withTransition:n>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}),(0,l.extend)(s.default.prototype,{generateFlow:function(t){var e=this,i=e.config;return function(){var a=t.targets,r=t.flow,o=t.drawBar,s=t.drawLine,d=t.drawArea,c=t.cx,f=t.cy,g=t.xv,h=t.xForText,p=t.yForText,x=t.duration,_=void 0,v=1,m=r.index,y=r.length,b=e.getValueOnIndex(e.data.targets[0].values,m),T=e.getValueOnIndex(e.data.targets[0].values,m+y),A=e.x.domain(),w=r.duration||x,L=r.done||function(){},D=e.generateWait(),S=e.xgrid||(0,n.selectAll)([]),C=e.xgridLines||(0,n.selectAll)([]),R=e.mainRegion||(0,n.selectAll)([]),I=e.mainText||(0,n.selectAll)([]),F=e.mainBar||(0,n.selectAll)([]),X=e.mainLine||(0,n.selectAll)([]),k=e.mainArea||(0,n.selectAll)([]),M=e.mainCircle||(0,n.selectAll)([]);e.flowing=!0,e.data.targets.forEach(function(t){t.values.splice(0,y)});var E=e.updateXDomain(a,!0,!0);e.updateXGrid&&e.updateXGrid(!0),r.orgDataCount?_=1===r.orgDataCount||(b&&b.x)===(T&&T.x)?e.x(A[0])-e.x(E[0]):e.isTimeSeries()?e.x(A[0])-e.x(E[0]):e.x(b.x)-e.x(T.x):1===e.data.targets[0].values.length?e.isTimeSeries()?(b=e.getValueOnIndex(e.data.targets[0].values,0),T=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),_=e.x(b.x)-e.x(T.x)):_=(0,l.diffDomain)(E)/2:_=e.x(A[0])-e.x(E[0]),v=(0,l.diffDomain)(A)/(0,l.diffDomain)(E);var O="translate("+_+",0) scale("+v+",1)";e.hideXGridFocus();var Y=(0,n.transition)().ease(n.easeLinear).duration(w);D.add([e.axes.x.transition(Y).call(e.xAxis.setTransition(Y)),F.transition(Y).attr("transform",O),X.transition(Y).attr("transform",O),k.transition(Y).attr("transform",O),M.transition(Y).attr("transform",O),I.transition(Y).attr("transform",O),R.filter(e.isRegionOnX).transition(Y).attr("transform",O),S.transition(Y).attr("transform",O),C.transition(Y).attr("transform",O)]),Y.call(D,function(){var t=void 0,n=[],a=[],r=[];if(y){for(t=0;t<y;t++)n.push("."+u.default.shape+"-"+(m+t)),a.push("."+u.default.text+"-"+(m+t)),r.push("."+u.default.eventRect+"-"+(m+t));e.svg.selectAll("."+u.default.shapes).selectAll(n).remove(),e.svg.selectAll("."+u.default.texts).selectAll(a).remove(),e.svg.selectAll("."+u.default.eventRects).selectAll(r).remove(),e.svg.select("."+u.default.xgrid).remove()}S.size()&&S.attr("transform",null).attr(e.xgridAttr),C.attr("transform",null),C.select("line").attr("x1",i.axis_rotated?0:g).attr("x2",i.axis_rotated?e.width:g),C.select("text").attr("x",i.axis_rotated?e.width:0).attr("y",g),F.attr("transform",null).attr("d",o),X.attr("transform",null).attr("d",s),k.attr("transform",null).attr("d",d),M.attr("transform",null).attr("cx",c).attr("cy",f),I.attr("transform",null).attr("x",h).attr("y",p).style("fill-opacity",e.opacityForText.bind(e)),R.attr("transform",null),R.select("rect").filter(e.isRegionOnX).attr("x",e.regionX.bind(e)).attr("width",e.regionWidth.bind(e)),i.interaction_enabled&&e.redrawEventRect(),L(),e.flowing=!1})}}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(2),a=i(4),r=_interopRequireDefault(a),o=i(0),s=i(3),l=_interopRequireDefault(s);(0,o.extend)(r.default.prototype,{selected:function(t){var e=this.internal,i=[];return e.main.selectAll("."+(l.default.shapes+e.getTargetSelectorSuffix(t))).selectAll("."+l.default.shape).filter(function(){return(0,n.select)(this).classed(l.default.SELECTED)}).each(function(t){return i.push(t)}),i},select:function(t,e,i){var a=this.internal,r=a.config;r.data_selection_enabled&&a.main.selectAll("."+l.default.shapes).selectAll("."+l.default.shape).each(function(s,d){var u=(0,n.select)(this),c=s.data?s.data.id:s.id,f=a.getToggle(this,s).bind(a),g=r.data_selection_grouped||!t||t.indexOf(c)>=0,h=!e||e.indexOf(d)>=0,p=u.classed(l.default.SELECTED);u.classed(l.default.line)||u.classed(l.default.area)||(g&&h?r.data_selection_isselectable(s)&&!p&&f(!0,u.classed(l.default.SELECTED,!0),s,d):(0,o.isDefined)(i)&&i&&p&&f(!1,u.classed(l.default.SELECTED,!1),s,d))})},unselect:function(t,e){var i=this.internal,a=i.config;a.data_selection_enabled&&i.main.selectAll("."+l.default.shapes).selectAll("."+l.default.shape).each(function(r,o){var s=(0,n.select)(this),d=r.data?r.data.id:r.id,u=i.getToggle(this,r).bind(i),c=a.data_selection_grouped||!t||t.indexOf(d)>=0,f=!e||e.indexOf(o)>=0,g=s.classed(l.default.SELECTED);s.classed(l.default.line)||s.classed(l.default.area)||c&&f&&a.data_selection_isselectable(r)&&g&&u(!1,s.classed(l.default.SELECTED,!1),r,o)})}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(4),a=_interopRequireDefault(n),r=i(1),o=_interopRequireDefault(r),s=i(0);(0,s.extend)(a.default.prototype,{transform:function(t,e){var i=this.internal,n=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;i.transformTo(e,t,n)}}),(0,s.extend)(o.default.prototype,{transformTo:function(t,e,i){var n=this,a=!n.hasArcType(),r=i||{withTransitionForAxis:a};r.withTransitionForTransform=!1,n.transiting=!1,n.setTargetType(t,e),n.updateTargets(n.data.targets),n.updateAndRedraw(r)}})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(0);(0,r.extend)(a.default.prototype,{groups:function(t){var e=this.internal,i=e.config;return(0,r.isUndefined)(t)?i.data_groups:(i.data_groups=t,e.redraw(),i.data_groups)}})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(0),o=function(t){var e=this.internal,i=e.config;return t?(i.grid_x_lines=t,e.redrawWithoutRescale(),i.grid_x_lines):i.grid_x_lines};o.add=function(t){return this.xgrids(this.internal.config.grid_x_lines.concat(t||[]))},o.remove=function(t){this.internal.removeGridLines(t,!0)};var s=function(t){var e=this.internal,i=e.config;return t?(i.grid_y_lines=t,e.redrawWithoutRescale(),i.grid_y_lines):i.grid_y_lines};s.add=function(t){return this.ygrids(this.internal.config.grid_y_lines.concat(t||[]))},s.remove=function(t){this.internal.removeGridLines(t,!1)},(0,r.extend)(a.default.prototype,{xgrids:o,ygrids:s})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(4),a=_interopRequireDefault(n),r=i(3),o=_interopRequireDefault(r),s=i(0),l=function(t){var e=this.internal,i=e.config;return t?(i.regions=t,e.redrawWithoutRescale(),i.regions):i.regions};l.add=function(t){var e=this.internal,i=e.config;return t?(i.regions=i.regions.concat(t),e.redrawWithoutRescale(),i.regions):i.regions},l.remove=function(t){var e=this.internal,i=e.config,n=t||{},a=e.getOption(n,"duration",i.transition_duration),r=e.getOption(n,"classes",[o.default.region]),s=e.main.select("."+o.default.regions).selectAll(r.map(function(t){return"."+t}));return(a?s.transition().duration(a):s).style("opacity","0").remove(),i.regions=i.regions.filter(function(t){var e=!1;return!t.class||(t.class.split(" ").forEach(function(t){r.indexOf(t)>=0&&(e=!0)}),!e)}),i.regions},(0,s.extend)(a.default.prototype,{regions:l})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(0),o=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter(function(e){return t.indexOf(e.id)>=0})};o.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},o.values=function(t){var e=null;if(t){var i=this.data(t);i&&i[0]&&(e=i[0].values.map(function(t){return t.value}))}return e},o.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},o.colors=function(t){return this.internal.updateDataAttributes("colors",t)},o.axes=function(t){return this.internal.updateDataAttributes("axes",t)},(0,r.extend)(a.default.prototype,{data:o})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{category:function(t,e){var i=this.internal,n=i.config;return arguments.length>1&&(n.axis_x_categories[t]=e,i.redraw()),n.axis_x_categories[t]},categories:function(t){var e=this.internal,i=e.config;return arguments.length?(i.axis_x_categories=t,e.redraw(),i.axis_x_categories):i.axis_x_categories}})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{color:function(t){return this.internal.color(t)}})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{x:function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},xs:function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}})},function(t,e,i){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}var n=i(5),a=_interopRequireDefault(n),r=i(4),o=_interopRequireDefault(r),s=i(0),l=function(t,e,i){var n=t.config,r="axis_y_"+e,o="axis_y2_"+e;return void(void 0!==i&&("object"===(void 0===i?"undefined":(0,a.default)(i))?((0,s.isValue)(i.x)&&(n["axis_x_"+e]=i.x),(0,s.isValue)(i.y)&&(n[r]=i.y),(0,s.isValue)(i.y2)&&(n[o]=i.y2)):(n[r]=i,n[o]=i),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})))},d=function(t,e){var i=t.config;return{x:i["axis_x_"+e],y:i["axis_y_"+e],y2:i["axis_y2_"+e]}},u=function(){};u.labels=function(t){var e=this.internal;arguments.length&&(Object.keys(t).forEach(function(i){e.axis.setLabelText(i,t[i])}),e.axis.updateLabels())},u.min=function(t){return arguments.length?l(this.internal,"min",t):d(this.internal,"min")},u.max=function(t){return arguments.length?l(this.internal,"max",t):d(this.internal,"max")},u.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};(0,s.isDefined)(t.max)&&this.axis.max(t.max),(0,s.isDefined)(t.min)&&this.axis.min(t.min)},(0,s.extend)(o.default.prototype,{axis:u})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(0),o=function(){};o.show=function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},o.hide=function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},(0,r.extend)(a.default.prototype,{legend:o})},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(58),o=i(0);(0,o.extend)(a.default.prototype,{resize:function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},flush:function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},destroy:function(){var t=this.internal;return r.window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&r.window.clearTimeout(t.resizeTimeout),(0,o.removeEvent)(r.window,"resize",t.resizeFunction),t.selectChart.classed("bb",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null}})},function(t,e,i){"use strict";e.__esModule=!0;var n="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")();e.window=n;e.document=n.document},function(t,e,i){"use strict";var n=i(4),a=function(t){return t&&t.__esModule?t:{"default":t}}(n),r=i(0),o=function(){};o.show=function(t){var e=this.internal,i=void 0,n=void 0;t.mouse&&(n=t.mouse),t.data?e.isMultipleX()?(n=[e.x(t.data.x),e.getYScale(t.data.id)(t.data.value)],i=null):i=(0,r.isValue)(t.data.index)?t.data.index:e.getIndexByX(t.data.x):void 0===t.x?void 0!==t.index&&(i=t.index):i=e.getIndexByX(t.x),e.dispatchEvent("mouseover",i,n),e.dispatchEvent("mousemove",i,n),e.config.tooltip_onshow.call(e,t.data)},o.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},(0,r.extend)(a.default.prototype,{tooltip:o})},function(t,e,i){"use strict";var n=i(1),a=function(t){return t&&t.__esModule?t:{"default":t}}(n);(0,i(0).extend)(a.default.prototype,{isSafari:function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},isChrome:function(){return window.navigator.userAgent.indexOf("Chrome")>=0}})}])});
//# sourceMappingURL=billboard.min.js.map