/*! * Copyright (c) 2017 ~ present NAVER Corp. * billboard.js project is licensed under the MIT license * * billboard.js, JavaScript chart library * http://naver.github.io/billboard.js/ * * @version 1.7.1-snapshot * * All-in-one packaged file for ease use of 'billboard.js' with below dependency. * - d3 ^5.9.1 */ !function webpackUniversalModuleDefinition(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,function(){return function(n){var i={};function __webpack_require__(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,__webpack_require__),e.l=!0,e.exports}return __webpack_require__.m=n,__webpack_require__.c=i,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(n,i,function(t){return e[t]}.bind(null,i));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){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=11)}([function(t,e){t.exports=function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){var i=n(2),a=n(3),r=n(4);t.exports=function _slicedToArray(t,e){return i(t)||a(t,e)||r()}},function(t,e){t.exports=function _arrayWithHoles(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function _iterableToArrayLimit(t,e){var n=[],i=!0,a=!1,r=undefined;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(c){a=!0,r=c}finally{try{i||null==s["return"]||s["return"]()}finally{if(a)throw r}}return n}},function(t,e){t.exports=function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){function _defineProperties(t,e){for(var n=0;n=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(t){return new FormatSpecifier(t)}function FormatSpecifier(t){if(!(e=vt.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var bt,Tt,wt,At,kt=function(t,e){var n=xt(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")},Ct={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return kt(100*t,e)},r:kt,s:function(t,e){var n=xt(t,e);if(!n)return t+"";var i=n[0],a=n[1],r=a-(bt=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,o=i.length;return r===o?i:oe));)r=s[a=(a+1)%s.length];return i.reverse().join(c)}):St,n=t.currency,w=t.decimal,A=t.numerals?(e=t.numerals,function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}):St,i=t.percent||"%";function newFormat(t){var u=(t=formatSpecifier(t)).fill,l=t.align,h=t.sign,e=t.symbol,d=t.zero,f=t.width,g=t.comma,p=t.precision,_=t.trim,m=t.type;"n"===m?(g=!0,m="g"):Ct[m]||(null==p&&(p=12),_=!0,m="g"),(d||"0"===u&&"="===l)&&(d=!0,u="0",l="=");var x="$"===e?n[0]:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",y="$"===e?n[1]:/[%p]/.test(m)?i:"",v=Ct[m],b=/[defgprs%]/.test(m);function format(t){var e,n,i,a=x,r=y;if("c"===m)r=v(t)+r,t="";else{var o=(t=+t)<0;if(t=v(Math.abs(t),p),_&&(t=function(t){t:for(var e,n=t.length,i=1,a=-1;i>1)+a+t+r+c.slice(s);break;default:t=c+a+t+r}return A(t)}return p=null==p?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(yt(e)/3))),a=Math.pow(10,-i),r=Mt[8+i/3];return function(t){return n(a*t)+r}}}};!function defaultLocale_defaultLocale(t){return Tt=Lt(t),wt=Tt.format,At=Tt.formatPrefix,Tt}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Dt=n(0),Ft=n.n(Dt),Rt=n(1),zt=n.n(Rt),Xt=n(5),It=n.n(Xt),Et={value:function(){}};function dispatch_dispatch(){for(var t,e=0,n=arguments.length,i={};en._time&&(i=n._time),(t=n)._next):(e=n._next,n._next=null,t?t._next=e:Ot=e);Pt=t,sleep(i)}(),Wt=0}}function poke(){var t=jt.now(),e=t-Ut;VtJt)throw new Error("too late; already scheduled");return n}function schedule_set(t,e){var n=schedule_get(t,e);if(n.state>Qt)throw new Error("too late; already running");return n}function schedule_get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var ee=function(t,e){var n,i,a,r=t.__transition,o=!0;if(r){for(a in e=null==e?null:e+"",r)(n=r[a]).name===e?(i=2>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=ce.exec(t))?rgbn(parseInt(e[1],16)):(e=ue.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=le.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=he.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=de.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=fe.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=ge.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?rgbn(pe[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color_color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function color_rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hex(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hsl(t,e,n,i){return 1===arguments.length?function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color_color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),r=Math.max(e,n,i),o=NaN,s=r-a,c=(r+a)/2;return s?(o=e===r?(n-i)/s+6*(nr&&(a=i.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(e=e[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:Xe(e,n)})),r=Ee.lastIndex;return rMath.abs(t[1]-S[1])?f=!0:d=!0),S=t,h=!0,wn(),move()}function move(){var t;switch(u=S[0]-C[0],l=S[1]-C[1],_){case kn:case An:m&&(u=Math.max(b-e,Math.min(w-r,u)),n=e+u,o=r+u),x&&(l=Math.max(T-i,Math.min(A-s,l)),a=i+l,c=s+l);break;case Cn:m<0?(u=Math.max(b-e,Math.min(w-e,u)),n=e+u,o=r):0/g,">"):t},Qn=function(t){var e=t.getBBox(),n=e.x,i=e.y,a=e.width,r=e.height;return[{x:n,y:i+r},{x:n,y:i},{x:n+a,y:i},{x:n+a,y:i+r}]},ti=function(t){var e=null,n=E,i=t.context||t.main;return n&&"BrushEvent"===n.constructor.name?e=n.selection:i&&(e=i.select(".".concat(dn.brush)).node())&&(e=function brushSelection(t){var e=t.__brush;return e?e.dim.output(e.selection):null}(e)),e},ei=function(){var t=!(0>>1;r(t[a],e)<0?n=a+1:i=a}return n},right:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;0i&&(i=(e=t).values.length)}):e=n?t[0]:null,e},mapToIds:function mapToIds(t){return t.map(function(t){return t.id})},mapToTargetIds:function mapToTargetIds(t){return t?qn(t)?t.concat():[t]:this.mapToIds(this.data.targets)},hasTarget:function hasTarget(t,e){for(var n,i=this.mapToIds(t),a=0;n=i[a];a++)if(n===e)return!0;return!1},isTargetToShow:function isTargetToShow(t){return this.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function isLegendToShow(t){return this.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function filterTargetsToShow(t){var e=this;return t.filter(function(t){return e.isTargetToShow(t.id)})},mapTargetsToUniqueXs:function mapTargetsToUniqueXs(t){var e=[],n=this.x.domain();return t&&t.length&&(e=oi(t.map(function(t){return t.values.map(function(t){return+t.x})})).filter(function(t,e,n){return n.indexOf(t)===e}),e=this.isTimeSeries()?e.map(function(t){return new Date(+t)}):e.map(function(t){return+t})),e=e.filter(function(t){return t>=n[0]&&t<=n[1]}),si(e)},addHiddenTargetIds:function addHiddenTargetIds(t){this.hiddenTargetIds=this.hiddenTargetIds.concat(t)},removeHiddenTargetIds:function removeHiddenTargetIds(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},addHiddenLegendIds:function addHiddenLegendIds(t){this.hiddenLegendIds=this.hiddenLegendIds.concat(t)},removeHiddenLegendIds:function removeHiddenLegendIds(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},getValuesAsIdKeyed:function getValuesAsIdKeyed(t){var i=this,e={},a=i.isMultipleX(),r=a?i.mapTargetsToUniqueXs(t).map(function(t){return On(t)?t:+t}):null;return t.forEach(function(t){var n=[];t.values.forEach(function(t){var e=t.value;qn(e)?n.push.apply(n,gn()(e)):Zn(e)&&"high"in e?n.push.apply(n,gn()(Object.values(e))):a?n[i.getIndexByX(t.x,r)]=e:n.push(e)}),e[t.id]=n}),e},checkValueInTargets:function checkValueInTargets(t,e){for(var n,i=Object.keys(t),a=0;a=a?s=!0:10===(e=i.charCodeAt(r++))?c=!0:13===e&&(c=!0,10===i.charCodeAt(r)&&++r),i.slice(n+1,t-1).replace(/""/g,'"')}for(;r=h)&&(a=!0,t.preventDefault()),u(this)}else o.unselectRect(),o.callOverOutForTouch()}).on("touchend.eventRect",function(){var t=c();!t.empty()&&t.classed(dn.eventRect)&&(o.hasArcType()||!o.toggleShape||o.cancelClick)&&o.cancelClick&&(o.cancelClick=!1)})},updateEventRect:function updateEventRect(t){var e,n,i,a,r=this,o=r.config,s=r.zoomScale||r.x,c=t||r.eventRect.data(),u=o.axis_rotated;if(r.isMultipleX())n=e=0,i=r.width,a=r.height;else{var l,h;if(r.isCategorized())l=r.getEventRectWidth(),h=function(t){return s(t.x)-l/2};else{r.updateXs();var d=function(t){var e=t.index;return{prev:r.getPrevX(e),next:r.getNextX(e)}};l=function(t){var e=d(t);return null===e.prev&&null===e.next?u?r.height:r.width:(null===e.prev&&(e.prev=s.domain()[0]),null===e.next&&(e.next=s.domain()[1]),Math.max(0,(s(e.next)-s(e.prev))/2))},h=function(t){var e=d(t),n=r.data.xs[t.id][t.index];return null===e.prev&&null===e.next?0:(null===e.prev&&(e.prev=s.domain()[0]),(s(n)+s(e.prev))/2)}}e=u?0:h,n=u?h:0,i=u?r.width:l,a=u?l:r.height}c.attr("class",r.classEvent.bind(r)).attr("x",e).attr("y",n).attr("width",i).attr("height",a)},selectRectForSingle:function selectRectForSingle(n,i,a){var r=this,o=r.config,s=o.data_selection_enabled,c=o.data_selection_grouped,u=o.tooltip_grouped,t=r.getAllValuesOnIndex(a);u&&(r.showTooltip(t,n),r.showXGridFocus(t),!s||c)||r.main.selectAll(".".concat(dn.shape,"-").concat(a)).each(function(){O(this).classed(dn.EXPANDED,!0),s&&i.style("cursor",c?"pointer":null),u||(r.hideXGridFocus(),r.hideTooltip(),!c&&r.expandCirclesBars(a))}).filter(function(t){return r.isWithinShape(this,t)}).call(function(t){var e=t.data();s&&(c||o.data_selection_isselectable(e))&&i.style("cursor","pointer"),u||(r.showTooltip(e,n),r.showXGridFocus(e),r.unexpandCircles(),t.each(function(t){return r.expandCirclesBars(a,t.id)}))})},expandCirclesBars:function expandCirclesBars(t,e,n){this.config.point_focus_expand_enabled&&this.expandCircles(t,e,n),this.expandBars(t,e,n)},selectRectForMultipleXs:function selectRectForMultipleXs(t){var e=this,n=e.config,i=e.filterTargetsToShow(e.data.targets);if(!e.dragging&&!e.hasArcType(i)){var a=P(t),r=e.findClosestFromTargets(i,a);if(e.mouseover&&(!r||r.id!==e.mouseover.id)&&(n.data_onout.call(e.api,e.mouseover),e.mouseover=undefined),!r)return void e.unselectRect();var o=(e.isBubbleType(r)||e.isScatterType(r)||!n.tooltip_grouped?[r]:e.filterByX(i,r.x)).map(function(t){return e.addName(t)});e.showTooltip(o,t),e.expandCirclesBars(r.index,r.id,!0),e.showXGridFocus(o),(e.isBarType(r.id)||e.dist(r,a)ra&&a){var d=n-r,f=i-o,g=s*s+c*c,p=d*d+f*f,_=Math.sqrt(g),m=Math.sqrt(h),x=a*Math.tan((ia-Math.acos((g+h-p)/(2*_*m)))/2),y=x/m,v=x/_;Math.abs(y-1)>ra&&(this._+="L"+(t+y*u)+","+(e+y*l)),this._+="A"+a+","+a+",0,0,"+ +(u*fra||Math.abs(this._y1-u)>ra)&&(this._+="L"+c+","+u),n&&(h<0&&(h=h%aa+aa),oa_a?(d+=b*=s?1:-1,f-=b):(g=0,d=f=(a+r)/2),(p-=2*T)>_a?(l+=T*=s?1:-1,h-=T):(p=0,l=h=(a+r)/2)}var w=i*ha(l),A=i*ga(l),k=n*ha(f),C=n*ga(f);if(_a_a){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>_a){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,a,r,o,t._x2,t._y2)}function CatmullRom(t,e){this._context=t,this._alpha=e}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ia=function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomClosed(t,e){this._context=t,this._alpha=e}CatmullRomClosed.prototype={areaStart:Sa,areaEnd:Sa,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ea=function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomOpen(t,e){this._context=t,this._alpha=e}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Oa=function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function LinearClosed(t){this._context=t}LinearClosed.prototype={areaStart:Sa,areaEnd:Sa,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var Pa=function(t){return new LinearClosed(t)};function monotone_sign(t){return t<0?-1:1}function slope3(t,e,n){var i=t._x1-t._x0,a=e-t._x1,r=(t._y1-t._y0)/(i||a<0&&-0),o=(n-t._y1)/(a||i<0&&-0),s=(r*a+o*i)/(i+a);return(monotone_sign(r)+monotone_sign(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(s))||0}function slope2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function monotone_point(t,e,n){var i=t._x0,a=t._y0,r=t._x1,o=t._y1,s=(r-i)/3;t._context.bezierCurveTo(i+s,a+s*e,r-s,o-s*n,r,o)}function MonotoneX(t){this._context=t}function MonotoneY(t){this._context=new ReflectContext(t)}function ReflectContext(t){this._context=t}function monotoneX(t){return new MonotoneX(t)}function monotoneY(t){return new MonotoneY(t)}function Natural(t){this._context=t}function controlPoints(t){var e,n,i=t.length-1,a=new Array(i),r=new Array(i),o=new Array(i);for(r[a[0]=0]=2,o[0]=t[0]+2*t[1],e=1;ethis.width?i=this.width-n.getBoundingClientRect().width:i<0&&(i=4)),i+(r.data_labels_position.x||0)},getYForText:function getYForText(t,e,n){var i,a=this,r=a.config,o=r.point_r,s=3;if(r.axis_rotated)i=(t[0][0]+t[2][0]+.6*n.getBoundingClientRect().height)/2;else if(i=t[2][1],Pn(o)&&5this.height&&(i=this.height-4)}return i+(r.data_labels_position.y||0)}});var Ha={Area:["area","area-spline","area-spline-range","area-line-range","area-step"],AreaRange:["area-spline-range","area-line-range"],Arc:["pie","donut","gauge","radar"],Line:["line","spline","area","area-spline","area-spline-range","area-line-range","step","area-step"],Step:["step","area-step"],Spline:["spline","area-spline","area-spline-range"]};ii(Wi.prototype,{setTargetType:function setTargetType(t,e){var n=this,i=n.config;n.mapToTargetIds(t).forEach(function(t){n.withoutFadeIn[t]=e===i.data_types[t],i.data_types[t]=e}),t||(i.data_type=e)},hasType:function hasType(n,t){var i=this.config.data_types,e=t||this.data.targets,a=!1;return e&&e.length?e.forEach(function(t){var e=i[t.id];(e&&0<=e.indexOf(n)||!e&&"line"===n)&&(a=!0)}):Object.keys(i).length?Object.keys(i).forEach(function(t){i[t]===n&&(a=!0)}):a=this.config.data_type===n,a},hasTypeOf:function hasTypeOf(t,e){var n=this,i=2n&&(i=i.filter(function(t){return(t+"").indexOf(".")<0}));return i},getGridFilterToRemove:function getGridFilterToRemove(t){return t?function(e){var n=!1;return(qn(t)?t.concat():[t]).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e["class"]===t["class"])&&(n=!0)}),n}:function(){return!0}},removeGridLines:function removeGridLines(t,e){var n=this.config,i=this.getGridFilterToRemove(t),a=e?dn.xgridLines:dn.ygridLines,r=e?dn.xgridLine:dn.ygridLine;this.main.select(".".concat(a)).selectAll(".".concat(r)).filter(i).transition().duration(n.transition_duration).style("opacity","0").remove();var o="grid_".concat(e?"x":"y","_lines");n[o]=n[o].filter(function toShow(t){return!i(t)})}}),ii(Wi.prototype,{initTooltip:function initTooltip(){var e=this,n=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",dn.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),n.tooltip_init_show){if(e.isTimeSeries()&&On(n.tooltip_init_x)){var t,i,a=e.data.targets[0];for(n.tooltip_init_x=e.parseDate(n.tooltip_init_x),t=0;(i=a.values[t])&&i.x-n.tooltip_init_x!=0;t++);n.tooltip_init_x=t}e.tooltip.html(n.tooltip_contents.call(e,e.data.targets.map(function(t){return e.addName(t.values[n.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType(null,["radar"])),e.color)),e.tooltip.style("top",n.tooltip_init_position.top).style("left",n.tooltip_init_position.left).style("display","block")}},getTooltipContent:function getTooltipContent(t,e,n,i){var a,r,o,s,c=this,u=c.config,l=u.tooltip_format_title||e,h=u.tooltip_format_name||function(t){return t},d=u.tooltip_format_value||(c.isStackNormalized()?function(t,e){return"".concat((100*e).toFixed(2),"%")}:n),f=u.tooltip_order,g=function(t){return c.getBaseValue(t)},p=c.levelColor?function(t){return c.levelColor(t.value)}:function(t){return i(t.id)};if(null===f&&u.data_groups.length){var _=c.orderTargets(c.data.targets).map(function(t){return t.id}).reverse();t.sort(function(t,e){var n=t?t.value:null,i=e?e.value:null;return 0').concat(In(y)?''.concat(y,""):"")}if(o=[r.ratio,r.id,r.index,t],s=Jn(d.apply(void 0,[g(r)].concat(gn()(o)))),c.isAreaRangeType(r)){var v=["high","low"].map(function(t){return Jn(d.apply(void 0,[c.getAreaRangeData(r,t)].concat(gn()(o))))}),b=zt()(v,2),T=b[0],w=b[1];s="Mid: ".concat(s," High: ").concat(T," Low: ").concat(w)}if(s!==undefined){if(null===r.name)continue;var A=Jn(h.apply(void 0,[r.name].concat(gn()(o)))),k=p(r);a+=''),a+=c.patterns?''):''),a+="".concat(A,'').concat(s,"")}}return"".concat(a,"")},tooltipPosition:function tooltipPosition(t,e,n,i){var a=this,r=a.config,o=P(i),s=zt()(o,2),c=s[0],u=s[1],l=a.getSvgLeft(!0),h=l+a.currentWidth-a.getCurrentPaddingRight();if(u+=20,a.hasArcType()){"touch"===a.inputType||a.hasType("radar")||(u+=a.height/2,c+=(a.width-(a.isLegendRight?a.getLegendWidth():0))/2)}else{var d=a.x(t[0].x);r.axis_rotated?(u=d+20,c+=l+100,h-=l):(u-=5,c=l+a.getCurrentPaddingLeft(!0)+20+(a.zoomScale?c:d))}return ha.currentHeight&&(u-=n+30),u<0&&(u=0),c<0&&(c=0),{top:u,left:c}},showTooltip:function showTooltip(t,e){var n=this,i=n.config,a=n.hasArcType(null,["radar"]),r=t.filter(function(t){return t&&In(n.getBaseValue(t))}),o=i.tooltip_position||n.tooltipPosition;if(0!==r.length&&i.tooltip_show){var s=n.tooltip.datum(),c=JSON.stringify(t),u=s&&s.width||0,l=s&&s.height||0;if(!s||s.current!==c){var h=t.concat().sort()[0].index,d=i.tooltip_contents.call(n,t,n.axis.getXAxisTickFormat(),n.getYFormat(a),n.color);Kn(i.tooltip_onshow,n),n.tooltip.html(d).style("display","block").datum({index:h,current:c,width:u=n.tooltip.property("offsetWidth"),height:l=n.tooltip.property("offsetHeight")}),Kn(i.tooltip_onshown,n),n._handleLinkedCharts(!0,h)}var f=o.call(this,r,u,l,e);n.tooltip.style("top","".concat(f.top,"px")).style("left","".concat(f.left,"px"))}},hideTooltip:function hideTooltip(){var t=this.config;Kn(t.tooltip_onhide,this),this.tooltip.style("display","none").datum(null),Kn(t.tooltip_onhidden,this)},_handleLinkedCharts:function _handleLinkedCharts(c,u){var l=this;if(l.config.tooltip_linked){var h=l.config.tooltip_linked_name;(l.api.internal.charts||[]).forEach(function(t){if(t!==l.api){var e=t.internal.config,n=e.tooltip_linked,i=e.tooltip_linked_name,a=document.body.contains(t.element);if(n&&h===i&&a){var r=t.internal.tooltip.data()[0],o=u!==(r&&r.index);try{c&&o?t.tooltip.show({index:u}):!c&&t.tooltip.hide()}catch(s){}}}})}}}),ii(Wi.prototype,{initLegend:function initLegend(){var t=this,e=t.config;t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g"),e.legend_show?(t.legend.attr("transform",t.getTranslate("legend")),t.updateLegend()):(t.legend.style("visibility","hidden"),t.hiddenLegendIds=t.mapToIds(t.data.targets))},updateLegend:function updateLegend(t,e,n){var i=this,a=i.config,r=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};r.withTransition=$n(r,"withTransition",!0),r.withTransitionForTransform=$n(r,"withTransitionForTransform",!0),a.legend_contents_bindto&&a.legend_contents_template?i.updateLegendTemplate():i.updateLegendElement(t||i.mapToIds(i.data.targets),r,n),i.updateSizes(),i.updateScales(!r.withTransition),i.updateSvgSize(),i.transformAll(r.withTransitionForTransform,n),i.legendHasRendered=!0},updateLegendTemplate:function updateLegendTemplate(){var n=this,t=n.config,e=O(t.legend_contents_bindto),i=t.legend_contents_template;if(!e.empty()){var a=n.data.targets,r=[],o="";n.mapToIds(a).forEach(function(t){var e=En(i)?i.call(n,t,n.color(t),n.api.data(t)[0].values):i.replace(/{=COLOR}/g,n.color(t)).replace(/{=TITLE}/g,t);e&&(r.push(t),o+=e)});var s=e.html(o).selectAll(function(){return this.childNodes}).data(r);n.setLegendItem(s)}},updateSizeForLegend:function updateSizeForLegend(t){var e=this,n=e.config,i=t.width,a=t.height,r={top:e.isLegendTop?e.getCurrentPaddingTop()+n.legend_inset_y+5.5:e.currentHeight-a-e.getCurrentPaddingBottom()-n.legend_inset_y,left:e.isLegendLeft?e.getCurrentPaddingLeft()+n.legend_inset_x+.5:e.currentWidth-i-e.getCurrentPaddingRight()-n.legend_inset_x+.5};e.margin3={top:e.isLegendRight?0:e.isLegendInset?r.top:e.currentHeight-a,right:NaN,bottom:0,left:e.isLegendRight?e.currentWidth-i:e.isLegendInset?r.left:0}},transformLegend:function transformLegend(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},updateLegendStep:function updateLegendStep(t){this.legendStep=t},updateLegendItemWidth:function updateLegendItemWidth(t){this.legendItemWidth=t},updateLegendItemHeight:function updateLegendItemHeight(t){this.legendItemHeight=t},getLegendWidth:function getLegendWidth(){return this.config.legend_show?this.isLegendRight||this.isLegendInset?this.legendItemWidth*(this.legendStep+1):this.currentWidth:0},getLegendHeight:function getLegendHeight(){return this.config.legend_show?this.isLegendRight?this.currentHeight:Math.max(20,this.legendItemHeight)*(this.legendStep+1):0},opacityForLegend:function opacityForLegend(t){return t.classed(dn.legendItemHidden)?null:"1"},opacityForUnfocusedLegend:function opacityForUnfocusedLegend(t){return t.classed(dn.legendItemHidden)?null:"0.3"},toggleFocusLegend:function toggleFocusLegend(t,e){var n=this,i=n.mapToTargetIds(t);n.legend.selectAll(".".concat(dn.legendItem)).filter(function(t){return 0<=i.indexOf(t)}).classed(dn.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?n.opacityForLegend:n.opacityForUnfocusedLegend).call(n,O(this))})},revertLegend:function revertLegend(){var t=this;t.legend.selectAll(".".concat(dn.legendItem)).classed(dn.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(O(this))})},showLegend:function showLegend(t){var e=this,n=e.config;n.legend_show||(n.legend_show=!0,e.legend.style("visibility","visible"),!e.legendHasRendered&&e.updateLegend()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(O(this))})},hideLegend:function hideLegend(t){var e=this.config;e.legend_show&&Gn(t)&&(e.legend_show=!1,this.legend.style("visibility","hidden")),this.addHiddenLegendIds(t),this.legend.selectAll(this.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},clearLegendItemTextBoxCache:function clearLegendItemTextBoxCache(){this.legendItemTextBox={}},setLegendItem:function setLegendItem(t){var n=this,e=n.config,i="touch"===n.inputType;t.attr("class",function(t){var e=O(this);return(!e.empty()&&e.attr("class")||"")+n.generateClass(dn.legendItem,t)}).style("visibility",function(t){return n.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){Kn(e.legend_item_onclick,n,t)||(E.altKey?(n.api.hide(),n.api.show(t)):(n.api.toggle(t),!i&&n.isTargetToShow(t)?n.api.focus(t):n.api.revert())),i&&n.hideTooltip()}),i||t.on("mouseout",function(t){Kn(e.legend_item_onout,n,t)||(O(this).classed(dn.legendItemFocused,!1),n.api.revert())}).on("mouseover",function(t){Kn(e.legend_item_onover,n,t)||(O(this).classed(dn.legendItemFocused,!0),!n.transiting&&n.isTargetToShow(t)&&n.api.focus(t))})},updateLegendElement:function updateLegendElement(t,e){var n,i,a,g=this,p=g.config,_=p.legend_item_tile_width+5,m=0,x=0,y=0,v={},b={},T={},w=[0],A={},k=0,C=g.isLegendRight||g.isLegendInset,S=t.filter(function(t){return!Nn(p.data_names[t])||null!==p.data_names[t]}),r=e.withTransition,o=function(t,e,n){var i,a,r,o=n===S.length-1,s=(a=t,r=e,g.legendItemTextBox[r]||(g.legendItemTextBox[r]=g.getTextRect(a,dn.legendItem)),g.legendItemTextBox[r]),c=s.width+_+(o&&!C?0:10)+p.legend_padding,u=s.height+4,l=C?u:c,h=C?g.getLegendHeight():g.getLegendWidth(),d=function(t,e){e||(i=(h-y-l)/2)<10&&(i=(h-l)/2,y=0,k++),A[t]=k,w[k]=g.isLegendInset?10:i,v[t]=y,y+=l};if(0===n&&(x=m=k=y=0),p.legend_show&&!g.isLegendToShow(e))return b[e]=0,T[e]=0,A[e]=0,void(v[e]=0);b[e]=c,T[e]=u,(!m||m<=c)&&(m=c),(!x||x<=u)&&(x=u);var f=C?x:m;p.legend_equally?(Object.keys(b).forEach(function(t){return b[t]=m}),Object.keys(T).forEach(function(t){return T[t]=x}),(i=(h-f*S.length)/2)<10?(k=y=0,S.forEach(function(t){return d(t)})):d(e,!0)):d(e)};g.isLegendInset&&(k=p.legend_inset_step?p.legend_inset_step:S.length,g.updateLegendStep(k)),i=g.isLegendRight?(n=function(t){return m*A[t]},function(t){return w[A[t]]+v[t]}):g.isLegendInset?(n=function(t){return m*A[t]+10},function(t){return w[A[t]]+v[t]}):(n=function(t){return w[A[t]]+v[t]},function(t){return x*A[t]});var s=function(t,e){return n(t,e)+4+p.legend_item_tile_width},c=function(t,e){return n(t,e)},h=function(t,e){return n(t,e)-2},u=function(t,e){return n(t,e)-2+p.legend_item_tile_width},l=function(t,e){return i(t,e)+9},d=function(t,e){return i(t,e)-5},f=function(t,e){return i(t,e)+4},M=g.legend.selectAll(".".concat(dn.legendItem)).data(S).enter().append("g");g.setLegendItem(M),M.append("text").text(function(t){return Nn(p.data_names[t])?p.data_names[t]:t}).each(function(t,e){o(this,t,e)}).style("pointer-events","none").attr("x",C?s:-200).attr("y",C?-200:l),M.append("rect").attr("class",dn.legendItemEvent).style("fill-opacity","0").attr("x",C?c:-200).attr("y",C?-200:d);var L=g.config.legend_usePoint;if(L){var D=[];M.append(function(t){var e=jn(p.point_pattern)?p.point_pattern:[p.point_type];-1===D.indexOf(t)&&D.push(t);var n=e[D.indexOf(t)%e.length];return"rectangle"===n&&(n="rect"),document.createElementNS(I.svg,g.hasValidPointType(n)?n:"use")}).attr("class",dn.legendItemPoint).style("fill",function(t){return g.color(t)}).style("pointer-events","none").attr("href",function(t,e,n){return"use"===n[e].nodeName.toLowerCase()?"#".concat(g.datetimeId,"-point-").concat(t):undefined})}else M.append("line").attr("class",dn.legendItemTile).style("stroke",g.color).style("pointer-events","none").attr("x1",C?h:-200).attr("y1",C?-200:f).attr("x2",C?u:-200).attr("y2",C?-200:f).attr("stroke-width",p.legend_item_tile_height);a=g.legend.select(".".concat(dn.legendBackground," rect")),g.isLegendInset&&0'":;\[\]\/|~`{}\\]/g,"-"):""},selectorTarget:function selectorTarget(t,e){return"".concat(e||"",".").concat(dn.target+this.getTargetSelectorSuffix(t))},selectorTargets:function selectorTargets(t,e){var n=this,i=t||[];return i.length?i.map(function(t){return n.selectorTarget(t,e)}):null},selectorLegend:function selectorLegend(t){return".".concat(dn.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function selectorLegends(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null}}),ii(Gi.prototype,{focus:function focus(t){var e=this.internal,n=e.mapToTargetIds(t),i=e.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),i.classed(dn.focused,!0).classed(dn.defocused,!1),e.hasArcType()&&e.expandArc(n),e.toggleFocusLegend(n,!0),e.focusedTargetIds=n,e.defocusedTargetIds=e.defocusedTargetIds.filter(function(t){return n.indexOf(t)<0})},defocus:function defocus(t){var e=this.internal,n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e))).classed(dn.focused,!1).classed(dn.defocused,!0),e.hasArcType()&&e.unexpandArc(n),e.toggleFocusLegend(n,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(t){return n.indexOf(t)<0}),e.defocusedTargetIds=n},revert:function revert(t){var e=this.internal,n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n)).classed(dn.focused,!1).classed(dn.defocused,!1),e.hasArcType()&&e.unexpandArc(n),e.config.legend_show&&(e.showLegend(n.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(n)).filter(function(){return O(this).classed(dn.legendItemFocused)}).classed(dn.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]}}),ii(Gi.prototype,{_showHide:function _showHide(t,e,n){var i=this.internal,a=i.mapToTargetIds(e);i["".concat(t?"remove":"add","HiddenTargetIds")](a);var r=i.svg.selectAll(i.selectorTargets(a)),o=t?"1":"0";r.transition().style("opacity",o,"important").call(i.endall,function(){r.style("opacity",null).style("opacity",o)}),n.withLegend&&i["".concat(t?"show":"hide","Legend")](a),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},show:function show(t){var e=1