billboard.js 3.17.0 → 3.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +10 -7
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +3 -3
  5. package/dist/billboard.pkgd.js +15 -11
  6. package/dist/billboard.pkgd.min.js +13 -13
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +7 -6
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +4 -4
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +7 -6
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +3 -3
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +7 -6
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +10 -10
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +7 -6
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +8 -8
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +7 -6
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -7
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +8 -8
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +1 -1
  44. package/src/ChartInternal/data/convert.ts +4 -4
  45. package/src/ChartInternal/data/load.ts +1 -1
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.0
8
+ * @version 3.17.1
9
9
  */(function(gt,qt){if(typeof exports=="object"&&typeof module=="object")module.exports=qt(require("d3-axis"),require("d3-brush"),require("d3-drag"),require("d3-dsv"),require("d3-ease"),require("d3-hierarchy"),require("d3-interpolate"),require("d3-scale"),require("d3-selection"),require("d3-shape"),require("d3-time-format"),require("d3-transition"),require("d3-zoom"));else if(typeof define=="function"&&define.amd)define(["d3-axis","d3-brush","d3-drag","d3-dsv","d3-ease","d3-hierarchy","d3-interpolate","d3-scale","d3-selection","d3-shape","d3-time-format","d3-transition","d3-zoom"],qt);else{var xe=typeof exports=="object"?qt(require("d3-axis"),require("d3-brush"),require("d3-drag"),require("d3-dsv"),require("d3-ease"),require("d3-hierarchy"),require("d3-interpolate"),require("d3-scale"),require("d3-selection"),require("d3-shape"),require("d3-time-format"),require("d3-transition"),require("d3-zoom")):qt(gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3,gt.d3);for(var _e in xe)(typeof exports=="object"?exports:gt)[_e]=xe[_e]}})(this,function(ti,gt,qt,xe,_e,Vs,Ys,js,Hs,Ws,Us,Zs,qs){return(function(){"use strict";var Ks=[,,(function(D){D.exports=Hs}),(function(D){D.exports=Us}),(function(D){D.exports=gt}),(function(D){D.exports=xe}),(function(D){D.exports=qt}),(function(D){D.exports=js}),(function(D){D.exports=Zs}),(function(D){D.exports=Ws}),(function(D){D.exports=qs}),(function(D){D.exports=ti}),(function(D){D.exports=_e}),(function(D){D.exports=Ys}),(function(D){D.exports=Vs})],ei={};function U(D){var mt=ei[D];if(mt!==void 0)return mt.exports;var w=ei[D]={exports:{}};return Ks[D](w,w.exports,U),w.exports}(function(){U.d=function(D,mt){for(var w in mt)U.o(mt,w)&&!U.o(D,w)&&Object.defineProperty(D,w,{enumerable:!0,get:mt[w]})}})(),(function(){U.o=function(D,mt){return Object.prototype.hasOwnProperty.call(D,mt)}})(),(function(){U.r=function(D){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})}})();var Pe={};return(function(){U.r(Pe),U.d(Pe,{bb:function(){return Ns},default:function(){return Ns}});var D={};U.r(D),U.d(D,{selection:function(){return Vi},subchart:function(){return Yi},zoom:function(){return ji}});var mt={};U.r(mt),U.d(mt,{area:function(){return bs},areaLineRange:function(){return vs},areaSpline:function(){return As},areaSplineRange:function(){return ws},areaStep:function(){return Ss},areaStepRange:function(){return Ts},bar:function(){return Ds},bubble:function(){return zs},candlestick:function(){return Fs},donut:function(){return Es},funnel:function(){return Xs},gauge:function(){return Ls},line:function(){return Rs},pie:function(){return Ps},polar:function(){return Os},radar:function(){return Is},scatter:function(){return Ms},spline:function(){return Cs},step:function(){return ks},treemap:function(){return Bs}});var w=U(2),me=U(3),Js=Object.defineProperty,ii=Object.getOwnPropertySymbols,Qs=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable,si=(e,t,i)=>t in e?Js(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Z=(e,t)=>{for(var i in t||(t={}))Qs.call(t,i)&&si(e,i,t[i]);if(ii)for(var i of ii(t))tn.call(t,i)&&si(e,i,t[i]);return e};const I={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},V={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},$e={area:"bb-area",areas:"bb-areas"},ot={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},$t={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},Et={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ft={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},Oe={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},Nt={dragarea:"bb-dragarea",INCLUDED:"_included_"},ce={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},yt={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Y={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},Lt={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},At={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},q={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},et={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Dt={level:"bb-level",levels:"bb-levels"},ni={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},de={region:"bb-region",regions:"bb-regions"},Q={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},it={shape:"bb-shape",shapes:"bb-shapes"},ai={brush:"bb-brush",subchart:"bb-subchart"},rt={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},ye={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},oi={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Ie={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var N=Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z(Z({},I),V),$e),ot),$t),Et),ft),Oe),Nt),yt),Y),Lt),At),q),ce),et),ni),de),Q),it),ai),rt),ye),oi),Ie),en={boost_useCssRule:!1,boost_useWorker:!1},sn={color_pattern:[],color_tiles:void 0,color_threshold:{},color_onover:void 0},nn={legend_contents_bindto:void 0,legend_contents_template:"<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",legend_equally:!1,legend_hide:!1,legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_interaction:!0,legend_item_dblclick:!1,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_item_tile_width:10,legend_item_tile_height:10,legend_item_tile_r:5,legend_item_tile_type:"rectangle",legend_format:void 0,legend_padding:0,legend_position:"bottom",legend_show:!0,legend_tooltip:!1,legend_usePoint:!1},an={bindto:"#chart",background:{},clipPath:!0,svg_classname:void 0,size_width:void 0,size_height:void 0,padding:!0,padding_mode:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,resize_timer:!0,onclick:void 0,onover:void 0,onout:void 0,onresize:void 0,onresized:void 0,onbeforeinit:void 0,oninit:void 0,onafterinit:void 0,onrendered:void 0,transition_duration:250,plugins:[],render:{},regions:[]},on={title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"center"},rn={tooltip_show:!0,tooltip_doNotHide:!1,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:{},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:void 0,tooltip_linked:!1,tooltip_linked_name:"",tooltip_onshow:()=>{},tooltip_onhide:()=>{},tooltip_onshown:()=>{},tooltip_onhidden:()=>{},tooltip_order:null},ln={data_x:void 0,data_idConverter:e=>e,data_names:{},data_classes:{},data_type:void 0,data_types:{},data_order:"desc",data_groups:[],data_groupsZeroAs:"positive",data_color:void 0,data_colors:{},data_labels:{},data_labels_backgroundColors:void 0,data_labels_colors:void 0,data_labels_position:{},data_labels_imgUrl:void 0,data_hide:!1,data_filter:void 0,data_onclick:()=>{},data_onover:()=>{},data_onout:()=>{},data_onshown:void 0,data_onhidden:void 0,data_onmin:void 0,data_onmax:void 0,data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:"csv",data_keys:void 0,data_empty_label_text:""},cn={interaction_enabled:!0,interaction_brighten:!0,interaction_inputType_mouse:!0,interaction_inputType_touch:{},interaction_onout:!0},be=U(4);function dn(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function un(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",i=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",s=a=>setTimeout(a,1),n=a=>clearTimeout(a);return[t?e.requestAnimationFrame:s,t?e.cancelAnimationFrame:n,i?e.requestIdleCallback:s,i?e.cancelIdleCallback:n]}const j=dn(),lt=j==null?void 0:j.document,[hn,Gr,ri,Vr]=un(j);var gn=Object.defineProperty,li=Object.getOwnPropertySymbols,fn=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,ci=(e,t,i)=>t in e?gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,di=(e,t)=>{for(var i in t||(t={}))fn.call(t,i)&&ci(e,i,t[i]);if(li)for(var i of li(t))pn.call(t,i)&&ci(e,i,t[i]);return e};const M=e=>e||e===0,L=e=>typeof e=="function",X=e=>typeof e=="string",O=e=>typeof e=="number",st=e=>typeof e=="undefined",H=e=>typeof e!="undefined",De=e=>typeof e=="boolean",xn=e=>Math.ceil(e/10)*10,ve=e=>Math.ceil(e)+.5,Gt=e=>e[1]-e[0],Rt=e=>typeof e=="object",wt=e=>st(e)||e===null||X(e)&&e.length===0||Rt(e)&&!(e instanceof Date)&&Object.keys(e).length===0||O(e)&&isNaN(e),nt=e=>!wt(e),G=e=>Array.isArray(e),B=e=>e&&!(e!=null&&e.nodeType)&&Rt(e)&&!G(e);function zt(e,t,i){return H(e[t])?e[t]:i}function _n(e,t){let i=!1;return Object.keys(e).forEach(s=>e[s]===t&&(i=!0)),i}function K(e,t,...i){const s=L(e);return s&&e.call(t,...i),s}function Te(e,t){let i=0;const s=function(...n){!--i&&t.apply(this,...n)};"duration"in e?e.each(()=>++i).on("end",s):(++i,e.call(s))}function ze(e){return X(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function ue(e,t,i=[-1,1],s=!1){if(!(!e||!X(t)))if(t.indexOf(`
10
10
  `)===-1)e.text(t);else{const n=[e.text(),t].map(a=>a.replace(/[\s\n]/g,""));if(n[0]!==n[1]){const a=t.split(`
11
11
  `),o=s?a.length-1:1;e.html(""),a.forEach((r,l)=>{e.append("tspan").attr("x",0).attr("dy",`${l===0?i[0]*o:i[1]}em`).text(r)})}}}function ui(e){const{x:t,y:i,width:s,height:n}=e.getBBox();return[{x:t,y:i+n},{x:t,y:i},{x:t+s,y:i},{x:t+s,y:i+n}]}function hi(e){const{width:t,height:i}=ct(e),s=ui(e),n=s[0].x,a=Math.min(s[0].y,s[1].y);return{x:n,y:a,width:t,height:i}}function bt(e,t){var i;const s=e&&((i=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:i[0]);let n=[0,0];try{n=(0,w.pointer)(s||e,t)}catch(a){}return n.map(a=>isNaN(a)?0:a)}function gi(e){const{event:t,$el:i}=e,s=i.subchart.main||i.main;let n;return t&&t.type==="brush"?n=t.selection:s&&(n=s.select(".bb-brush").node())&&(n=(0,be.brushSelection)(n)),n}function fi(e,t,i=!1){const s=n=>n[e?"getBoundingClientRect":"getBBox"]();return i?s(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=s(t):t.rect}function ct(e,t=!1){return fi(!0,e,t)}function Kt(e,t=!1){return fi(!1,e,t)}function Ct(e=!0,t=0,i=1e4){const s=j.crypto||j.msCrypto,n=s?t+s.getRandomValues(new Uint32Array(1))[0]%(i-t+1):Math.floor(Math.random()*(i-t)+t);return e?String(n):n}function Fe(e,t,i,s,n){if(i>s)return-1;const a=Math.floor((i+s)/2);let{x:o,w:r=0}=e[a];return n&&(o=e[a].y,r=e[a].h),t>=o&&t<=o+r?a:t<o?Fe(e,t,i,a-1,n):Fe(e,t,a+1,s,n)}function pi(e){const t=gi(e);return t?t[0]===t[1]:!0}function mn(...e){const t=i=>{if(B(i)&&i.constructor){const s=new i.constructor;for(const n in i)s[n]=t(i[n]);return s}return i};return e.map(i=>t(i)).reduce((i,s)=>di(di({},i),s))}function dt(e={},t){G(t)&&t.forEach(i=>dt(e,i));for(const i in t)/^\d+$/.test(i)||i in e||(e[i]=t[i]);return e}const pt=e=>e.charAt(0).toUpperCase()+e.slice(1);function $n(e,t="-"){return e.split(t).map((i,s)=>s?i.charAt(0).toUpperCase()+i.slice(1).toLowerCase():i.toLowerCase()).join("")}const Vt=e=>[].slice.call(e);function yn(e,t,i){const{rootSelector:s="",sheet:n}=e,o=`${s} ${(r=>r.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${i.join(";")}}`;return n[n.insertRule?"insertRule":"addRule"](o,n.cssRules.length)}function bn(e){let t=[];return e.forEach(i=>{var s;try{i.cssRules&&i.cssRules.length&&(t=t.concat(Vt(i.cssRules)))}catch(n){(s=j.console)==null||s.warn(`Error while reading rules from ${i.href}: ${n.toString()}`)}}),t}function xi(e){var t,i,s,n,a,o;return{x:((i=(t=j.pageXOffset)!=null?t:j.scrollX)!=null?i:0)+((s=e.scrollLeft)!=null?s:0),y:((a=(n=j.pageYOffset)!=null?n:j.scrollY)!=null?a:0)+((o=e.scrollTop)!=null?o:0)}}function Ae(e,t=0,i=0,s=!0){const n=new DOMPoint(t,i),a=e.getScreenCTM(),o=n.matrixTransform(s?a==null?void 0:a.inverse():a);if(s===!1){const r=ct(e);o.x-=r.x,o.y-=r.y}return o}function _i(e){const t=e?e.transform:null,i=t&&t.baseVal;return i&&i.numberOfItems?i.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Me(e){const t=e[0]instanceof Date,i=(t?e.map(Number):e).filter((s,n,a)=>a.indexOf(s)===n);return t?i.map(s=>new Date(s)):i}function mi(e){return e&&e.length?e.reduce((t,i)=>t.concat(i)):[]}function Jt(e,...t){if(!t.length||t.length===1&&!t[0])return e;const i=t.shift();return B(e)&&B(i)&&Object.keys(i).forEach(s=>{if(!/^(__proto__|constructor|prototype)$/i.test(s)){const n=i[s];B(n)?(!e[s]&&(e[s]={}),e[s]=Jt(e[s],n)):e[s]=G(n)?n.concat():n}}),Jt(e,...t)}function Qt(e,t=!0){let i;return e[0]instanceof Date?i=t?(s,n)=>s-n:(s,n)=>n-s:t&&!e.every(isNaN)?i=(s,n)=>s-n:t||(i=(s,n)=>s>n&&-1||s<n&&1||s===n&&0),e.concat().sort(i)}function St(e,t){let i=t.filter(s=>nt(s));return i.length?O(i[0])?i=Math[e](...i):i[0]instanceof Date&&(i=Qt(i,e==="min")[0]):i=void 0,i}const we=(e,t,i=1)=>{const s=[],n=Math.max(0,Math.ceil((t-e)/i))|0;for(let a=e;a<n;a++)s.push(e+a*i);return s},vn={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,i,s=e())=>{t.dispatchEvent(new MouseEvent(i,s))}}catch(t){return(i,s,n=e())=>{const a=lt.createEvent("MouseEvent");a.initMouseEvent(s,n.bubbles,n.cancelable,j,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(a)}}})(),touch:(e,t,i)=>{const s=new Touch(Jt({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[s],targetTouches:[],changedTouches:[s]}))}};function he(e,t){let i=e;for(const s in t)i=i.replace(new RegExp(`{=${s}}`,"g"),t[s]);return i}function vt(e){var t;let i;if(e instanceof Date)i=e;else if(X(e)){const{config:s,format:n}=this;i=(t=n.dataTime(s.data_xFormat)(e))!=null?t:new Date(e)}else O(e)&&!isNaN(e)&&(i=new Date(+e));return(!i||isNaN(+i))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),i}function Xe(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Tn(e,t,i=!1){const s=!!e.node;let n=!1;for(const[a,o]of Object.entries(t))if(n=s?e.style(a)===o:e.style[a]===o,i===!1&&n)break;return n}function ge(){var e,t;return((e=lt)==null?void 0:e.hidden)===!1||((t=lt)==null?void 0:t.visibilityState)==="visible"}function An(e,t){const{DocumentTouch:i,matchMedia:s,navigator:n}=j,a=s==null?void 0:s("(pointer:coarse)").matches;let o=!1;if(t)if(n&&"maxTouchPoints"in n)o=n.maxTouchPoints>0;else if("ontouchmove"in j||i&&lt instanceof i)o=!0;else if(a)o=!0;else{const l=n.userAgent;o=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(l)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(l)}return e&&!a&&(s==null?void 0:s("(pointer:fine)").matches)&&"mouse"||o&&"touch"||"mouse"}function $i(e,t){t()===!1?hn(()=>$i(e,t)):e()}function wn(e){if(B(e)&&!X(e)){const o=e;return{top:o.top||0,right:o.right||0,bottom:o.bottom||0,left:o.left||0}}const t=(X(e)?e.trim().split(/\s+/):[e]).map(o=>+o||0),[i,s=i,n=i,a=s]=t;return{top:i,right:s,bottom:n,left:a}}var Sn=Object.defineProperty,yi=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,Be=(e,t,i)=>t in e?Sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,bi=(e,t)=>{for(var i in t||(t={}))Rn.call(t,i)&&Be(e,i,t[i]);if(yi)for(var i of yi(t))Cn.call(t,i)&&Be(e,i,t[i]);return e},kn=(e,t,i)=>Be(e,typeof t!="symbol"?t+"":t,i);const vi=class Gs{static setOptions(t){this.data=t.reduce((i,s)=>bi(bi({},i),s),this.data)}constructor(){return mn(an,en,ln,sn,cn,nn,on,rn,Gs.data)}};kn(vi,"data",{});let Yt=vi;class En{constructor(){return{chart:null,main:null,svg:null,axis:{x:null,y:null,y2:null,subX:null},axisTooltip:{x:null,y:null,y2:null},defs:null,tooltip:null,legend:null,title:null,subchart:{main:null,bar:null,line:null,area:null},arcs:null,bar:null,candlestick:null,line:null,area:null,circle:null,radar:null,text:null,grid:{main:null,x:null,y:null},gridLines:{main:null,x:null,y:null},region:{main:null,list:null},eventRect:null,zoomResetBtn:null}}}class Ln{constructor(){return{width:0,width2:0,height:0,height2:0,margin:{top:0,bottom:0,left:0,right:0},margin2:{top:0,bottom:0,left:0,right:0},margin3:{top:0,bottom:0,left:0,right:0},arcWidth:0,arcHeight:0,xAxisHeight:0,hasAxis:!1,hasFunnel:!1,hasRadar:!1,hasTreemap:!1,cssRule:{},current:{domain:void 0,width:0,height:0,dataMax:0,maxTickSize:{x:{width:0,height:0,ticks:[],clipPath:0,domain:""},y:{width:0,height:0,domain:""},y2:{width:0,height:0,domain:""}},types:[],needle:void 0,zoomDomain:null},isLegendRight:!1,isLegendInset:!1,isLegendTop:!1,isLegendLeft:!1,legendStep:0,legendItemWidth:0,legendItemHeight:0,legendHasRendered:!1,eventReceiver:{currentIdx:-1,rect:{},data:[],coords:[]},axis:{x:{padding:{left:0,right:0},tickCount:0}},rotatedPadding:{left:30,right:0,top:5},withoutFadeIn:{},inputType:"",datetimeId:"",clip:{id:"",idXAxis:"",idYAxis:"",idXAxisTickTexts:"",idGrid:"",idSubchart:"",path:"",pathXAxis:"",pathYAxis:"",pathXAxisTickTexts:"",pathGrid:""},event:null,dragStart:null,dragging:!1,flowing:!1,cancelClick:!1,mouseover:!1,rendered:!1,transiting:!1,redrawing:!1,resizing:!1,toggling:!1,zooming:!1,hasNegativeValue:!1,hasPositiveValue:!0,orgAreaOpacity:"0.2",orgConfig:{},hiddenTargetIds:[],hiddenLegendIds:[],focusedTargetIds:[],defocusedTargetIds:[],radius:0,innerRadius:0,outerRadius:void 0,innerRadiusRatio:0,gaugeArcWidth:0,radiusExpanded:0,xgridAttr:{x1:null,x2:null,y1:null,y2:null}}}}const Ti={element:En,state:Ln};class Pn{constructor(){Object.keys(Ti).forEach(t=>{this[t]=new Ti[t]})}getStore(t){return this[t]}}var On=Object.defineProperty,In=(e,t,i)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Dn=(e,t,i)=>In(e,typeof t!="symbol"?t+"":t,i);const _t={bubbleBaseLength:"$baseLength",colorPattern:"__colorPattern__",dataMinMax:"$dataMinMax",dataTotalSum:"$dataTotalSum",dataTotalPerIndex:"$totalPerIndex",legendItemTextBox:"legendItemTextBox",radarPoints:"$radarPoints",radarTextWidth:"$radarTextWidth",setOverOut:"setOverOut",callOverOutForTouch:"callOverOutForTouch",textRect:"textRect"};class zn{constructor(){Dn(this,"cache",{})}add(t,i,s=!1){return this.cache[t]=s?this.cloneTarget(i):i,this.cache[t]}remove(t){(X(t)?[t]:t).forEach(i=>delete this.cache[i])}get(t,i=!1){if(i&&Array.isArray(t)){const s=[];for(let n=0,a;a=t[n];n++)a in this.cache&&s.push(this.cloneTarget(this.cache[a]));return s}else{const s=this.cache[t];return M(s)?s:null}}reset(t){const i=this;for(const s in i.cache)(t||/^\$/.test(s))&&(i.cache[s]=null)}cloneTarget(t){return{id:t.id,id_org:t.id_org,values:t.values.map(i=>({x:i.x,value:i.value,id:i.id}))}}}const k={AREA:"area",AREA_LINE_RANGE:"area-line-range",AREA_SPLINE:"area-spline",AREA_SPLINE_RANGE:"area-spline-range",AREA_STEP:"area-step",AREA_STEP_RANGE:"area-step-range",BAR:"bar",BUBBLE:"bubble",CANDLESTICK:"candlestick",DONUT:"donut",FUNNEL:"funnel",GAUGE:"gauge",LINE:"line",PIE:"pie",POLAR:"polar",RADAR:"radar",SCATTER:"scatter",SPLINE:"spline",STEP:"step",TREEMAP:"treemap"},Ne={AREA:"initArea",AREA_LINE_RANGE:"initArea",AREA_SPLINE:"initArea",AREA_SPLINE_RANGE:"initArea",AREA_STEP:"initArea",AREA_STEP_RANGE:"initArea",BAR:"initBar",BUBBLE:"initCircle",CANDLESTICK:"initCandlestick",DONUT:"initArc",FUNNEL:"initFunnel",GAUGE:"initArc",LINE:"initLine",PIE:"initArc",POLAR:"initPolar",RADAR:"initCircle",SCATTER:"initCircle",SPLINE:"initLine",STEP:"initLine",TREEMAP:"initTreemap"},Ft={Area:[k.AREA,k.AREA_SPLINE,k.AREA_SPLINE_RANGE,k.AREA_LINE_RANGE,k.AREA_STEP,k.AREA_STEP_RANGE],AreaRange:[k.AREA_SPLINE_RANGE,k.AREA_LINE_RANGE,k.AREA_STEP_RANGE],Arc:[k.PIE,k.DONUT,k.GAUGE,k.POLAR,k.RADAR],Line:[k.LINE,k.SPLINE,k.AREA,k.AREA_SPLINE,k.AREA_SPLINE_RANGE,k.AREA_LINE_RANGE,k.STEP,k.AREA_STEP,k.AREA_STEP_RANGE],Step:[k.STEP,k.AREA_STEP,k.AREA_STEP_RANGE],Spline:[k.SPLINE,k.AREA_SPLINE,k.AREA_SPLINE_RANGE]};function Fn(e){const t=e,{config:i}=t;let s="";if(wt(i.data_type||i.data_types)&&!t[Ne.LINE])s="line";else for(const n in Ne){const a=k[n];if(t.hasType(a)&&!t[Ne[n]]){s=a;break}}s&&Mn(`Please, make sure if %c${$n(s)}`,"module has been imported and specified correctly.","https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality")}function Mn(e,t,i){var s;const n="[billboard.js]";if((s=j.console)==null?void 0:s.error){const o=t?["background:red;color:white;display:block;font-size:15px",t]:[];console.error(`\u274C ${n} ${e}`,"background:red;color:white;display:block;font-size:15px",...o),i&&console.info("%c\u2139\uFE0F","font-size:15px",i)}throw Error(`${n} ${e.replace(/\%c([a-z-]+)/i,"'$1' ")} ${t!=null?t:""}`)}const{setTimeout:Xn,clearTimeout:Bn}=j;function Nn(e){const t=[];let i;const s=function(){s.clear(),e===!1?ri(()=>{t.forEach(n=>n())},{timeout:200}):i=Xn(()=>{t.forEach(n=>n())},O(e)?e:200)};return s.clear=()=>{i&&(Bn(i),i=null)},s.add=n=>t.push(n),s.remove=n=>t.splice(t.indexOf(n),1),s}function Ai(){let e=[];const t=function(i,s){function n(){var a;let o=0;for(let r=0,l;l=e[r];r++){if(l===!0||(a=l.empty)!=null&&a.call(l)){o++;continue}if(ge()===!1){o=e.length;break}try{l.transition()}catch(c){o++}}return o===e.length}$i(()=>{s==null||s()},n)};return t.add=function(i){G(i)?e=e.concat(i):e.push(i)},t}const Ge={};function Gn(e,t){var i;const s=e.toString(),n=s.replace(/(function|[\s\W\n])/g,"").substring(0,15);return n in Ge||(Ge[n]=new j.Blob([`${(i=t==null?void 0:t.map(String).join(";"))!=null?i:""}
@@ -13,7 +13,7 @@
13
13
  self.onmessage=function({data}) {
14
14
  const result = (${s}).apply(null, data);
15
15
  self.postMessage(result);
16
- };`],{type:"text/javascript"})),j.URL.createObjectURL(Ge[n])}function Vn(e){const t=new j.Worker(e);return t.onerror=function(i){console.error?console.error(i):console.log(i)},t}function Ve(e=!0,t,i,s){let n=function(...a){const o=t(...a);i(o)};if(j.Worker&&e){const a=Gn(t,s),o=Vn(a);n=function(...r){o.postMessage(r),o.onmessage=function(l){return j.URL.revokeObjectURL(a),i(l.data)}}}return n}var Se=U(5);function Ye(e){const t=[];return e.forEach(function(i,s){const n=i[0];i.forEach(function(a,o){if(o>0){if(typeof t[o-1]=="undefined"&&(t[o-1]={}),typeof a=="undefined")throw new Error(`Source data is missing a component at (${s}, ${o})!`);t[o-1][n]=a}})}),t}function je(e){const t=e[0],i=[];return e.forEach(function(s,n){if(n>0){const a={};s.forEach(function(o,r){if(typeof o=="undefined")throw new Error(`Source data is missing a component at (${n}, ${r})!`);a[t[r]]=o}),i.push(a)}}),i}function wi(e,t){const i=[];let s,n;if(Array.isArray(e)){const a=function(o,r){if(o[r]!==void 0)return o[r];const c=r.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");let u=o;return c.some(function(d){return!(u=u&&d in u?u[d]:void 0)}),u};t.x?s=t.value.concat(t.x):s=t.value,i.push(s),e.forEach(function(o){const r=s.map(function(l){let c=a(o,l);return typeof c=="undefined"&&(c=null),c});i.push(r)}),n=je(i)}else Object.keys(e).forEach(function(a){var o;const r=e[a].concat();(o=r.unshift)==null||o.call(r,a),i.push(r)}),n=Ye(i);return n}function Yn(e,t="csv",i,s,n){const a=new XMLHttpRequest,o={csv:jn,tsv:Hn,json:wi};a.open("GET",e),i&&Object.keys(i).forEach(function(r){a.setRequestHeader(r,i[r])}),a.onreadystatechange=function(){if(a.readyState===4)if(a.status===200){const r=a.responseText;r&&n.call(this,o[t](t==="json"?JSON.parse(r):r,s))}else throw new Error(`${e}: Something went wrong loading!`)},a.send()}function Si(e,t){const i=e.rows(t);let s;return i.length===1?(s=[{}],i[0].forEach(n=>{s[0][n]=null})):s=e.parse(t),s}function jn(e){return Si({rows:Se.csvParseRows,parse:Se.csvParse},e)}function Hn(e){return Si({rows:Se.tsvParseRows,parse:Se.tsvParse},e)}function Ri(e,t){const i=e||(t==null?void 0:t.data_keys);return i!=null&&i.x&&(t.data_x=i.x),i}function Wn(e,t,i){const s=this,{config:n}=s;let a;e.forEach(o=>{const r=s.getXKey(o);if(i.customX||i.timeSeries?i.xs.indexOf(r)>=0?a=(i.appendXs&&s.data.xs[o]||[]).concat(t.map((l,c)=>{const u=M(l[r]);return u?s.generateTargetX(u,o,c):!1}).filter(l=>l!==!1)):n.data_x?a=this.getOtherTargetXs():nt(n.data_xs)&&(a=s.getXValuesOfXKey(r,s.data.targets)):a=t.map((l,c)=>c),a)s.data.xs[o]=a;else throw new Error(`x is not defined for id = "${o}".`)})}var Un={convertData(e,t){const{config:i}=this,s=i.boost_useWorker;let n=e;if(e.bindto&&(n={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(a=>{const o=`data_${a}`;o in e&&(n[a]=e[o])})),n.url&&t)Yn(n.url,n.mimeType,n.headers,Ri(n.keys,i),t);else if(n.json)Ve(n.json.length?s:!1,wi,t,[Ye,je])(n.json,Ri(n.keys,i));else if(n.rows)Ve(n.rows.length?s:!1,je,t)(n.rows);else if(n.columns)Ve(n.columns.length?s:!1,Ye,t)(n.columns);else if(e.bindto)throw Error("url or json or rows or columns is required.")},convertDataToTargets(e,t){const i=this,{axis:s,config:n,state:a}=i,o=n.data_type,r=Object.keys(e[0]||{}),{ids:l,xs:c}=r.length?r.reduce((h,g)=>(i.isX.call(i,g)?h.xs.push(g):i.isNotX.call(i,g)&&h.ids.push(g),h),{ids:[],xs:[]}):{ids:[],xs:[]},u={appendXs:t,xs:c,idConverter:n.data_idConverter.bind(i.api),categorized:s==null?void 0:s.isCategorized(),timeSeries:s==null?void 0:s.isTimeSeries(),customX:s==null?void 0:s.isCustomX()};Wn.bind(i)(l,e,u);const d=l.map((h,g)=>{const f=n.data_idConverter.bind(i.api)(h),p=i.getXKey(h),_=u.customX&&u.categorized,x=_&&(()=>{const b=new Set(n.axis_x_categories);return e.every(v=>b.has(v.x))})(),m=e.__append__,$=p===null&&m?i.api.data.values(h).length:0;return{id:f,id_org:h,values:e.map((b,v)=>{const y=b[p];let T=b[h],C;return T=T!==null&&!isNaN(T)&&!B(T)?+T:G(T)||B(T)?T:null,(_||a.hasRadar)&&g===0&&!st(y)?(!x&&g===0&&v===0&&!m&&(n.axis_x_categories=[]),C=n.axis_x_categories.indexOf(y),C===-1&&(C=n.axis_x_categories.length,n.axis_x_categories.push(y))):C=i.generateTargetX(y,h,$+v),(st(T)||i.data.xs[h].length<=v)&&(C=void 0),{x:C,value:T,id:f,index:-1}}).filter(b=>H(b.x))}});if(d.forEach(h=>{var g;n.data_xSort&&(h.values=h.values.sort((f,p)=>{const _=f.x||f.x===0?f.x:1/0,x=p.x||p.x===0?p.x:1/0;return _-x})),h.values.forEach((f,p)=>f.index=p),(g=i.data.xs[h.id])==null||g.sort((f,p)=>f-p)}),a.hasNegativeValue=i.hasNegativeValueInTargets(d),a.hasPositiveValue=i.hasPositiveValueInTargets(d),o&&i.isValidChartType(o)){const h=i.mapToIds(d).filter(g=>!(g in n.data_types)||!i.isValidChartType(n.data_types[g]));i.setTargetType(h,o)}return d.forEach(h=>i.cache.add(h.id_org,h,!0)),d}},Zn={isX(e){const t=this,{config:i}=t,s=i.data_x&&e===i.data_x,n=nt(i.data_xs)&&_n(i.data_xs,e);return s||n},isNotX(e){return!this.isX(e)},isStackNormalized(){const{config:e}=this;return!!(e.data_stack_normalize&&e.data_groups.length)},isGrouped(e){const t=this.config.data_groups;return e?t.some(i=>i.indexOf(e)>=0&&i.length>1):t.length>0},getXKey(e){const t=this,{config:i}=t;return i.data_x?i.data_x:nt(i.data_xs)?i.data_xs[e]:null},getXValuesOfXKey(e,t){const i=this,s=t&&nt(t)?i.mapToIds(t):[];let n;return s.forEach(a=>{i.getXKey(a)===e&&(n=i.data.xs[a])}),n},getIndexByX(e,t){const i=this;return t?t.indexOf(X(e)?e:+e):(i.filterByX(i.data.targets,e)[0]||{index:null}).index},getXValue(e,t){const i=this;return e in i.data.xs&&i.data.xs[e]&&M(i.data.xs[e][t])?i.data.xs[e][t]:t},getOtherTargetXs(){const e=this,t=Object.keys(e.data.xs);return t.length?e.data.xs[t[0]]:null},getOtherTargetX(e){const t=this.getOtherTargetXs();return t&&e<t.length?t[e]:null},addXs(e){const t=this,{config:i}=t;Object.keys(e).forEach(s=>{i.data_xs[s]=e[s]})},isMultipleX(){return!this.config.axis_x_forceAsSingle&&(nt(this.config.data_xs)||this.hasType("bubble")||this.hasType("scatter"))},addName(e){const t=this,{config:i}=t;let s;return e&&(s=i.data_names[e.id],e.name=s!==void 0?s:e.id),e},getAllValuesOnIndex(e,t=!1){const i=this;let s=i.filterTargetsToShow(i.data.targets).map(n=>i.addName(i.getValueOnIndex(n.values,e)));return t&&(s=s.filter(n=>n&&"value"in n&&M(n.value))),s},getValueOnIndex(e,t){const i=e.filter(s=>s.index===t);return i.length?i[0]:null},updateTargetX(e,t){const i=this;e.forEach(s=>{s.values.forEach((n,a)=>{n.x=i.generateTargetX(t[a],s.id,a)}),i.data.xs[s.id]=t})},updateTargetXs(e,t){const i=this;e.forEach(s=>{t[s.id]&&i.updateTargetX([s],t[s.id])})},generateTargetX(e,t,i){const s=this,{axis:n}=s;let a=n!=null&&n.isCategorized()?i:e||i;if(n!=null&&n.isTimeSeries()){const o=vt.bind(s);a=o(e||s.getXValue(t,i))}else n!=null&&n.isCustomX()&&!(n!=null&&n.isCategorized())&&(a=M(e)?+e:s.getXValue(t,i));return a},updateXs(e){e.length&&(this.axis.xs=e.map(t=>t.x))},getPrevX(e){const t=this.axis.xs[e-1];return H(t)?t:null},getNextX(e){const t=this.axis.xs[e+1];return H(t)?t:null},getBaseValue(e){const t=this,{hasAxis:i}=t.state;let{value:s}=e;return s&&i&&(t.isAreaRangeType(e)?s=t.getRangedData(e,"mid"):t.isBubbleZType(e)&&(s=t.getBubbleZData(s,"y"))),s},getMinMaxValue(e){const t=this.getBaseValue.bind(this);let i,s;return(e||this.data.targets.map(n=>n.values)).forEach((n,a)=>{const o=n.map(t).filter(O);i=Math.min(a?i:1/0,...o),s=Math.max(a?s:-1/0,...o)}),{min:i,max:s}},getMinMaxData(){const e=this,t=_t.dataMinMax;let i=e.cache.get(t);if(!i){const s=e.data.targets.map(c=>c.values),n=e.getMinMaxValue(s);let a=[],o=[];const{min:r,max:l}=n;s.forEach(c=>{const u=e.getFilteredDataByValue(c,r),d=e.getFilteredDataByValue(c,l);u.length&&(a=a.concat(u)),d.length&&(o=o.concat(d))}),e.cache.add(t,i={min:a,max:o})}return i},getTotalPerIndex(){const e=this,t=_t.dataTotalPerIndex;let i=e.cache.get(t);return(e.config.data_groups.length||e.isStackNormalized())&&!i&&(i=[],e.data.targets.forEach(s=>{s.values.forEach((n,a)=>{i[a]||(i[a]=0),i[a]+=~~n.value})})),i},getTotalDataSum(e){const t=this,i=_t.dataTotalSum;let s=t.cache.get(i);return O(s)||(s=t.data.targets.reduce((n,a)=>n+a.values.reduce((o,r)=>o+~~r.value,0),0),t.cache.add(i,s)),e&&(s-=t.getHiddenTotalDataSum()),s},getHiddenTotalDataSum(){const e=this,{api:t,state:{hiddenTargetIds:i}}=e;let s=0;return i.length&&(s=t.data.values.bind(t)(i).reduce((n,a)=>n+a)),s},getFilteredDataByValue(e,t){return e.filter(i=>this.getBaseValue(i)===t)},getMaxDataCount(){return Math.max(...this.data.targets.map(e=>e.values.length),0)},getMaxDataCountTarget(){let e=this.filterTargetsToShow()||[];const t=e.length,i=this.config.axis_x_inverted;return t>1?(e=e.map(s=>s.values).reduce((s,n)=>s.concat(n)).map(s=>s.x),e=Qt(Me(e)).map((s,n,a)=>({x:s,index:i?a.length-n-1:n}))):t&&(e=e[0].values.concat()),e},mapToIds(e){return e.map(t=>t.id)},mapToTargetIds(e){const t=this;return e?G(e)?e.concat():[e]:t.mapToIds(t.data.targets)},hasTarget(e,t){const i=this.mapToIds(e);for(let s=0,n;n=i[s];s++)if(n===t)return!0;return!1},isTargetToShow(e){return this.state.hiddenTargetIds.indexOf(e)<0},isLegendToShow(e){return this.state.hiddenLegendIds.indexOf(e)<0},filterTargetsToShow(e){const t=this;return(e||t.data.targets).filter(i=>t.isTargetToShow(i.id))},mapTargetsToUniqueXs(e){const t=this,{axis:i}=t;let s=[];return e!=null&&e.length&&(s=Me(mi(e.map(n=>n.values.map(a=>+a.x)))),s=i!=null&&i.isTimeSeries()?s.map(n=>new Date(+n)):s.map(Number)),Qt(s)},addTargetIds(e,t){const{state:i}=this;(G(t)?t:[t]).forEach(n=>{i[e].indexOf(n)<0&&i[e].push(n)})},removeTargetIds(e,t){const{state:i}=this;(G(t)?t:[t]).forEach(n=>{const a=i[e].indexOf(n);a>=0&&i[e].splice(a,1)})},addHiddenTargetIds(e){this.addTargetIds("hiddenTargetIds",e)},removeHiddenTargetIds(e){this.removeTargetIds("hiddenTargetIds",e)},addHiddenLegendIds(e){this.addTargetIds("hiddenLegendIds",e)},removeHiddenLegendIds(e){this.removeTargetIds("hiddenLegendIds",e)},getValuesAsIdKeyed(e){const t=this,{hasAxis:i}=t.state,s={},n=t.isMultipleX(),a=n?t.mapTargetsToUniqueXs(e).map(o=>X(o)?o:+o):null;return e.forEach(o=>{const r=[];o.values.filter(({value:l})=>M(l)||l===null).forEach(l=>{let{value:c}=l;c!==null&&t.isCandlestickType(l)&&(c=G(c)?c.slice(0,4):[c.open,c.high,c.low,c.close]),G(c)?r.push(...c):B(c)&&"high"in c?r.push(...Object.values(c)):t.isBubbleZType(l)?r.push(i&&t.getBubbleZData(c,"y")):n?r[t.getIndexByX(l.x,a)]=c:r.push(c)}),s[o.id]=r}),s},checkValueInTargets(e,t){return Object.keys(e).some(i=>e[i].values.some(s=>t(s.value)))},hasMultiTargets(){return this.filterTargetsToShow().length>1},hasNegativeValueInTargets(e){return this.checkValueInTargets(e,t=>t<0)},hasPositiveValueInTargets(e){return this.checkValueInTargets(e,t=>t>0)},orderTargets(e){const t=this,i=[...e],s=t.getSortCompareFn();return s&&i.sort(s),i},getSortCompareFn(e=!1){const t=this,{config:i}=t,s=i.data_order,n=/asc/i.test(s),a=/desc/i.test(s);let o;if(n||a){const r=(c,u)=>c+Math.abs(u.value),l=c=>O(c)?c:"values"in c?c.values.reduce(r,0):c.value;o=(c,u)=>{const d=l(c),h=l(u);return e?n?d-h:h-d:n?h-d:d-h}}else L(s)&&(o=s.bind(t.api));return o||null},filterByX(e,t){return mi(e.map(i=>i.values)).filter(i=>i.x-t===0)},filterNullish(e){const t=i=>M(i.value);return e&&e.filter(i=>"value"in i?t(i):i.values.some(t))},filterRemoveNull(e){return e.filter(t=>M(this.getBaseValue(t)))},filterByXDomain(e,t){return e.map(i=>({id:i.id,id_org:i.id_org,values:i.values.filter(s=>t[0]<=s.x&&s.x<=t[1])}))},hasDataLabel(){const e=this.config.data_labels;return De(e)&&e||Rt(e)&&nt(e)},hasNullDataValue(e){return e.some(({value:t})=>t===null)},getDataIndexFromEvent(e){const t=this,{$el:i,config:s,state:{hasRadar:n,inputType:a,eventReceiver:{coords:o,rect:r}}}=t;let l;if(n){let c=e.target;/tspan/i.test(c.tagName)&&(c=c.parentNode);const u=(0,w.select)(c).datum();l=u&&Object.keys(u).length===1?u.index:void 0}else{const c=s.axis_rotated,u=xi(i.chart.node()),d=a==="touch"&&e.changedTouches?e.changedTouches[0]:e;let h=c?d.clientY+u.y:d.clientX+u.x;if(Xe(i.svg)){const g=[h,0];c&&g.reverse(),h=Ae(i.eventRect.node(),...g)[c?"y":"x"]}else h-=c?r.top:r.left;l=Fe(o,h,0,o.length-1,c)}return l},getDataLabelLength(e,t,i){var s;const n=this,a=1.3;return((s=n.getTextRect([e,t].map(o=>n.dataLabelFormat()(o))))==null?void 0:s.map(o=>o[i]*a))||[0,0]},isNoneArc(e){return this.hasTarget(this.data.targets,e.id)},isArc(e){return"data"in e&&this.hasTarget(this.data.targets,e.data.id)},findSameXOfValues(e,t){const i=e[t].x,s=[];let n;for(n=t-1;n>=0&&i===e[n].x;n--)s.push(e[n]);for(n=t;n<e.length&&i===e[n].x;n++)s.push(e[n]);return s},findClosestFromTargets(e,t){const i=this,s=e.map(n=>i.findClosest(n.values,t));return i.findClosest(s,t)},findClosest(e,t){const i=this,{$el:{main:s}}=i,n=e.filter(r=>r&&M(r.value));let a,o;return n.filter(r=>i.isBarType(r.id)||i.isCandlestickType(r.id)).forEach(r=>{const l=i.isBarType(r.id)?`.${$t.chartBar}.${I.target}${i.getTargetSelectorSuffix(r.id)} .${$t.bar}-${r.index}`:`.${Et.chartCandlestick}.${I.target}${i.getTargetSelectorSuffix(r.id)} .${Et.candlestick}-${r.index} path`;!o&&i.isWithinBar(s.select(l).node())&&(o=r)}),n.filter(r=>!i.isBarType(r.id)&&!i.isCandlestickType(r.id)).forEach(r=>{const l=i.dist(r,t);a=i.getPointSensitivity(r),l<a&&(a=l,o=r)}),o},dist(e,t){const i=this,{config:{axis_rotated:s},scale:n}=i,a=+s,o=+!s,r=i.circleY(e,e.index),l=(n.zoom||n.x)(e.x);return Math.sqrt(Math.pow(l-t[a],2)+Math.pow(r-t[o],2))},convertValuesToStep(e){const t=this,{axis:i,config:s}=t,n=s.line_step_type,a=i?i.isCategorized():!1,o=G(e)?e.concat():[e];if(!(a||/step\-(after|before)/.test(n)))return e;if(o.length){const r=o[0],l=o[o.length-1],{id:c}=r;let{x:u}=r;o.unshift({x:--u,value:r.value,id:c}),a&&n==="step-after"&&o.unshift({x:--u,value:r.value,id:c}),u=l.x,o.push({x:++u,value:l.value,id:c}),a&&n==="step-before"&&o.push({x:++u,value:l.value,id:c})}return o},convertValuesToRange(e){const t=G(e)?e.concat():[e],i=[];return t.forEach(s=>{const{x:n,id:a}=s;i.push({x:n,id:a,value:s.value[0]}),i.push({x:n,id:a,value:s.value[2]})}),i},updateDataAttributes(e,t){const i=this,{config:s}=i,n=s[`data_${e}`];return st(t)||(Object.keys(t).forEach(a=>{n[a]=t[a]}),i.redraw({withLegend:!0})),n},getRangedData(e,t="",i="areaRange"){const s=e==null?void 0:e.value;if(G(s)){if(i==="bar")return s.reduce((n,a)=>a-n);{const n={areaRange:["high","mid","low"],candlestick:["open","high","low","close","volume"]}[i].indexOf(t);return n>=0&&s?s[n]:void 0}}else if(s&&t)return s[t];return s},setRatioForGroupedData(e){const t=this,{config:i}=t;if(i.data_groups.length&&e.some(s=>t.isGrouped(s.id))){const s=n=>t.getRatio("index",n,!0);e.forEach(n=>{"values"in n?n.values.forEach(s):s(n)})}},getRatio(e,t,i=!1){const s=this,{config:n,state:a}=s,o=s.api;let r=0;if(t&&o.data.shown().length)if(r=t.ratio||t.value,e==="arc")if(s.pie.padAngle()())r=t.value/s.getTotalDataSum(!0);else{const l=n.gauge_fullCircle?s.getArcLength():s.getStartingAngle()*-2,c=s.hasType("gauge")?l:Math.PI*2;r=(t.endAngle-t.startAngle)/c}else if(e==="index"){const l=o.data.values.bind(o);let c=this.getTotalPerIndex();if(a.hiddenTargetIds.length){let d=l(a.hiddenTargetIds,!1);d.length&&(d=d.reduce((h,g)=>h.map((f,p)=>~~f+g[p])),c=c.map((h,g)=>h-d[g]))}const u=c[t.index];t.ratio=O(t.value)&&c&&u?t.value/u:0,r=t.ratio}else if(e==="radar")r=parseFloat(String(Math.max(t.value,0)))/a.current.dataMax*n.radar_size_ratio;else if(e==="bar"){const c=s.getYScaleById.bind(s)(t.id).domain().reduce((u,d)=>d-u);r=c===0?0:Math.abs(s.getRangedData(t,null,e)/c)}else e==="treemap"&&(r/=s.getTotalDataSum(!0));return i&&r?r*100:r},updateDataIndexByX(e){const t=this,i=e.reduce((s,n,a)=>(s[Number(n.x)]=a,s),{});t.data.targets.forEach(s=>{s.values.forEach((n,a)=>{let o=i[Number(n.x)];o===void 0&&(o=a),n.index=o})})},isBubbleZType(e){return this.isBubbleType(e)&&(B(e.value)&&("z"in e.value||"y"in e.value)||G(e.value)&&e.value.length>=2)},isBarRangeType(e){const t=this,{value:i}=e;return t.isBarType(e)&&G(i)&&i.length>=2&&i.every(O)},getDataById(e){var t;const i=this.cache.get(e)||this.api.data(e);return(t=i==null?void 0:i[0])!=null?t:i}};function Ci(e,t=!1){const i=this,{api:s}=i;t&&i.api.flush(!0),e==null||e.call(s)}var qn={load(e,t){const i=this,{axis:s,data:n,org:a,scale:o}=i,{append:r}=t,l={domain:null,currentDomain:null,x:null};let c=e;c&&(t.filter&&(c=c.filter(t.filter)),(t.type||t.types)&&c.forEach(u=>{var d;const h=((d=t.types)==null?void 0:d[u.id])||t.type;i.setTargetType(u.id,h)}),n.targets.forEach(u=>{for(let d=0;d<c.length;d++)if(u.id===c[d].id){u.values=r?u.values.concat(c[d].values):c[d].values,c.splice(d,1);break}}),n.targets=n.targets.concat(c)),i.updateTargets(n.targets),o.zoom&&(l.x=s.isCategorized()?o.x.orgScale():(a.xScale||o.x).copy(),l.domain=i.getXDomain(n.targets),l.x.domain(l.domain),l.currentDomain=i.zoom.getDomain(),i.withinRange(l.currentDomain,void 0,l.domain)||(o.x.domain(l.domain),o.zoom=null,i.$el.eventRect.property("__zoom",null))),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),o.zoom?(a.xDomain=l.domain,a.xScale=l.x,s.isCategorized()&&(l.currentDomain=i.getZoomDomainValue(l.currentDomain),a.xDomain=i.getZoomDomainValue(a.xDomain),a.xScale=l.x.domain(a.xDomain)),i.updateCurrentZoomTransform(l.x,l.currentDomain)):a.xScale&&a.xScale.domain(a.xDomain),i.updateTypesElements(),Ci.call(i,t.done,t.resizeAfter)},loadFromArgs(e){const t=this;t.config&&(t.cache.reset(),t.convertData(e,i=>{const s=e.data||i;e.append&&(s.__append__=!0),s&&t.load(t.convertDataToTargets(s),e)}))},unload(e,t){var i;const s=this,{state:n,$el:a,$T:o}=s,r=!!((i=s.hasLegendDefsPoint)!=null&&i.call(s));let l=t,c=e;if(s.cache.reset(),l||(l=()=>{}),c=c.filter(d=>s.hasTarget(s.data.targets,d)),!c||c.length===0){l();return}const u=a.svg.selectAll(c.map(d=>s.selectorTarget(d)));o(u).style("opacity","0").remove().call(Te,l),c.forEach(d=>{var h;const g=s.getTargetSelectorSuffix(d);n.withoutFadeIn[d]=!1,a.legend&&a.legend.selectAll(`.${Y.legendItem}${g}`).remove(),s.data.targets=s.data.targets.filter(f=>f.id!==d),r&&((h=a.defs)==null||h.select(`#${s.getDefsPointId(g)}`).remove())}),n.hasFunnel&&s.updateFunnel(s.data.targets),n.hasTreemap&&s.updateTargetsForTreemap(s.data.targets),s.updateTypesElements()}},ki=U(6),Kn={setExpand(e,t,i){const s=this,{config:n,$el:{circle:a}}=s;a&&n.point_focus_expand_enabled&&s.expandCircles(e,t,i),s.expandBarTypeShapes(!0,e,t,i)},expandBarTypeShapes(e=!0,t,i,s){const n=this;["bar","candlestick"].filter(a=>n.$el[a]).forEach(a=>{s&&n.$el[a].classed(I.EXPANDED,!1),n.getShapeByIndex(a,t,i).classed(I.EXPANDED,e)})},setOverOut(e,t){const i=this,{config:s,state:{hasFunnel:n,hasRadar:a,hasTreemap:o},$el:{main:r}}=i,l=B(t);if(l||t!==-1){const c=s[e?"data_onover":"data_onout"].bind(i.api);if(s.color_onover&&i.setOverColor(e,t,l),l){const u=i.getTargetSelectorSuffix(t.id),d=n||o?`${I.target+u} .${it.shape}`:V.arc+u;c(t,r.select(`.${d}`).node())}else if(s.tooltip_grouped)e&&(a&&i.isPointFocusOnly()?i.showCircleFocus(i.getAllValuesOnIndex(t,!0)):i.setExpand(t,null,!0)),!i.isMultipleX()&&r.selectAll(`.${it.shape}-${t}`).each(function(u){c(u,this)});else{const u=i.cache.get(_t.setOverOut)||[],d=r.selectAll(`.${it.shape}-${t}`).filter(function(g){return i.isWithinShape(this,g)}),h=d.filter(function(){return u.every(g=>g!==this)});if(!e||d.empty()||u.length===h.size()&&h.nodes().every((g,f)=>g!==u[f]))for(;u.length;){const g=u.pop();s.data_onout.bind(i.api)((0,w.select)(g).datum(),g)}h.each(function(){e&&(c((0,w.select)(this).datum(),this),u.push(this))}),i.cache.add(_t.setOverOut,u)}}},callOverOutForTouch(e){const t=this,i=t.cache.get(_t.callOverOutForTouch);(B(e)&&i?e.id!==i.id:e!==i)&&((i||O(i))&&t.setOverOut(!1,i),(e||O(e))&&t.setOverOut(!0,e),t.cache.add(_t.callOverOutForTouch,e))},getDraggableSelection(){const e=this,{config:t,state:i}=e;return t.interaction_enabled&&t.data_selection_draggable&&e.drag?(0,ki.drag)().on("drag",function(s){i.event=s,e.drag(bt(s,this))}).on("start",function(s){i.event=s,e.dragstart(bt(s,this))}).on("end",s=>{i.event=s,e.dragend()}):()=>{}},dispatchEvent(e,t,i){var s,n,a;const o=this,{config:r,state:{eventReceiver:l,hasAxis:c,hasFunnel:u,hasRadar:d,hasTreemap:h},$el:{eventRect:g,funnel:f,radar:p,svg:_,treemap:x}}=o;let m=(a=(n=(u||h)&&l.rect||d&&p.axes.select(`.${ot.axis}-${t} text`)||g||((s=o.getArcElementByIdOrIndex)==null?void 0:s.call(o,t)))==null?void 0:n.node)==null?void 0:a.call(n);if(m){const $=o.isMultipleX(),b=r.axis_rotated;let{width:v,left:y,top:T}=ct(m);if(c&&!d&&!$){const R=l.coords[t];R?(v=R.w,y+=R.x,T+=R.y):(v=0,y=0,T=0)}let C=y+(i?i[0]:0)+($||b?0:v/2),A=T+(i?i[1]:0)+(b?4:0);if(Xe(_)){const R=Ae(o.$el.eventRect.node(),C,A,!1);C=R.x,A=R.y}const S={screenX:C,screenY:A,clientX:C,clientY:A,bubbles:d};(u||h)&&(m=(f!=null?f:x).node()),vn[/^(mouse|click)/.test(e)?"mouse":"touch"](m,e,S)}},setDragStatus(e){this.state.dragging=e},unbindZoomEvent(){const e=this,{$el:{eventRect:t,zoomResetBtn:i}}=e;t==null||t.on(".zoom wheel.zoom .drag",null),i==null||i.on("click",null).style("display","none")},unbindAllEvents(){var e;const t=this,{$el:{arcs:i,eventRect:s,legend:n,region:a,svg:o,treemap:r},brush:l}=t,c=["wheel","click","mouseover","mousemove","mouseout","touchstart","touchmove","touchend","touchstart.eventRect","touchmove.eventRect","touchend.eventRect",".brush",".drag",".zoom","wheel.zoom","dblclick.zoom"].join(" ");[o,s,a==null?void 0:a.list,l==null?void 0:l.getSelection(),i==null?void 0:i.selectAll("path"),n==null?void 0:n.selectAll("g"),r].forEach(u=>u==null?void 0:u.on(c,null)),(e=t.unbindZoomEvent)==null||e.call(t)}},Jn={categoryName(e){var t;const{axis_x_categories:i}=this.config;return(t=i==null?void 0:i[e])!=null?t:e}},Qn={generateClass(e,t){return` ${e} ${e+this.getTargetSelectorSuffix(t)}`},getClass(e,t){const i=/s$/.test(e),s=/^(area|arc|line|funnel|treemap)s?$/.test(e),n=i?"id":"index";return a=>{const o=a.data||a;return((t?this.generateClass(N[i?"shapes":"shape"],o[n]):"")+this.generateClass(N[e],o[s?"id":n])).trim()}},getChartClass(e){return t=>N[`chart${e}`]+this.classTarget((t.data?t.data:t).id)},generateExtraLineClass(){const t=this.config.line_classes||[],i=[];return function(s){var n;const a=s.id||((n=s.data)==null?void 0:n.id)||s;return i.indexOf(a)<0&&i.push(a),t[i.indexOf(a)%t.length]}},classRegion(e,t){return`${this.generateClass(N.region,t)} ${"class"in e?e.class:""}`},classTarget(e){const t=this.config.data_classes[e];let i="";return t&&(i=` ${N.target}-${t}`),this.generateClass(N.target,e)+i},classFocus(e){return this.classFocused(e)+this.classDefocused(e)},classFocused(e){return` ${this.state.focusedTargetIds.indexOf(e.id)>=0?N.focused:""}`},classDefocused(e){return` ${this.state.defocusedTargetIds.indexOf(e.id)>=0?N.defocused:""}`},getTargetSelectorSuffix(e){return(e||e===0?`-${e}`:"").replace(/[\x00-\x20\x7F-\xA0\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-")},selectorTarget(e,t="",i=""){const s=this.getTargetSelectorSuffix(e);return`${t}.${N.target+s} ${i}, ${t}.${N.circles+s} ${i}`},selectorTargets(e,t){const i=e||[];return i.length?i.map(s=>this.selectorTarget(s,t)):null},selectorLegend(e){return`.${N.legendItem+this.getTargetSelectorSuffix(e)}`},selectorLegends(e){return e!=null&&e.length?e.map(t=>this.selectorLegend(t)):null}},Mt=U(7);const ta=(e,t,i)=>{const s=(0,w.select)(e.cloneNode(!0));return s.attr("id",i).insert("rect",":first-child").attr("width",s.attr("width")).attr("height",s.attr("height")).style("fill",t),{id:i,node:s.node()}};function ea(e){const t=_t.colorPattern,{body:i}=lt;let s=i[t];if(!s){const a=e.classed(Oe.colorPattern,!0).style("background-image");e.classed(Oe.colorPattern,!1),a.indexOf(";")>-1&&(s=a.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(";").map(o=>o.trim().replace(/[\"'\s]/g,"")).filter(Boolean),i[t]=s)}return s}const ia=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];var sa={generateColor(){const e=this,{$el:t,config:i}=e,s=[];let n=nt(i.color_pattern)?i.color_pattern:(0,Mt.scaleOrdinal)(ea(t.chart)||ia).range();const a=n;if(L(i.color_tiles)){const o=i.color_tiles.bind(e.api)(),r=n.map((l,c)=>{const u=l.replace(/[#\(\)\s,]/g,""),d=`${e.state.datetimeId}-pattern-${u}-${c}`;return ta(o[c%o.length],l,d)});n=r.map(l=>`url(#${l.id})`),e.patterns=r}return function(o){var r;const l=i.data_colors,c=i.data_color,u=o.id||((r=o.data)==null?void 0:r.id)||o,d=e.isTypeOf(u,["line","spline","step"])||!i.data_types[u];let h;return L(l[u])?h=l[u].bind(e.api)(o):l[u]?h=l[u]:(s.indexOf(u)<0&&s.push(u),h=d?a[s.indexOf(u)%a.length]:n[s.indexOf(u)%n.length],l[u]=h),L(c)?c.bind(e.api)(h,o):h}},generateLevelColor(){const e=this,{config:t}=e,i=t.color_pattern,s=t.color_threshold,n=s.unit==="value",a=s.max||100,o=s.values&&s.values.length?s.values:[];return nt(s)?function(r){const l=n?r:r*100/a;let c=i[i.length-1];for(let u=0,d=o.length;u<d;u++)if(l<=o[u]){c=i[u];break}return c}:null},generateTextBGColorFilter(e,t={x:0,y:0,width:1,height:1}){const i=this,{$el:{defs:s},state:n}=i;if(e){let a=[];X(e)?a.push(""):B(e)?a=Object.keys(e):L(e)&&(a=i.mapToTargetIds()),a.forEach(o=>{const r=`${n.datetimeId}-labels-bg${i.getTargetSelectorSuffix(o)}${X(e)?i.getTargetSelectorSuffix(e):""}`,l=o===""?e:(e==null?void 0:e[o])||"";s.select(`#${r}`).empty()&&s.append("filter").attr("x",t.x).attr("y",t.y).attr("width",t.width).attr("height",t.height).attr("id",r).html(`<feFlood flood-color="${l}" />
16
+ };`],{type:"text/javascript"})),j.URL.createObjectURL(Ge[n])}function Vn(e){const t=new j.Worker(e);return t.onerror=function(i){console.error?console.error(i):console.log(i)},t}function Ve(e=!0,t,i,s){let n=function(...a){const o=t(...a);i(o)};if(j.Worker&&e){const a=Gn(t,s),o=Vn(a);n=function(...r){o.postMessage(r),o.onmessage=function(l){return j.URL.revokeObjectURL(a),i(l.data)}}}return n}var Se=U(5);function Ye(e){const t=[];return e.forEach(function(i,s){const n=i[0];i.forEach(function(a,o){if(o>0){if(typeof t[o-1]=="undefined"&&(t[o-1]={}),typeof a=="undefined")throw new Error(`Source data is missing a component at (${s}, ${o})!`);t[o-1][n]=a}})}),t}function je(e){const t=e[0],i=[];return e.forEach(function(s,n){if(n>0){const a={};s.forEach(function(o,r){if(typeof o=="undefined")throw new Error(`Source data is missing a component at (${n}, ${r})!`);a[t[r]]=o}),i.push(a)}}),i}function wi(e,t){const i=[];let s,n;if(Array.isArray(e)){const a=function(o,r){if(o[r]!==void 0)return o[r];const c=r.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");let u=o;return c.some(function(d){return!(u=u&&d in u?u[d]:void 0)}),u};t.x?s=t.value.concat(t.x):s=t.value,i.push(s),e.forEach(function(o){const r=s.map(function(l){let c=a(o,l);return typeof c=="undefined"&&(c=null),c});i.push(r)}),n=je(i)}else Object.keys(e).forEach(function(a){var o;const r=e[a].concat();(o=r.unshift)==null||o.call(r,a),i.push(r)}),n=Ye(i);return n}function Yn(e,t="csv",i,s,n){const a=new XMLHttpRequest,o={csv:jn,tsv:Hn,json:wi};a.open("GET",e),i&&Object.keys(i).forEach(function(r){a.setRequestHeader(r,i[r])}),a.onreadystatechange=function(){if(a.readyState===4)if(a.status===200){const r=a.responseText;r&&n.call(this,o[t](t==="json"?JSON.parse(r):r,s))}else throw new Error(`${e}: Something went wrong loading!`)},a.send()}function Si(e,t){const i=e.rows(t);let s;return i.length===1?(s=[{}],i[0].forEach(n=>{s[0][n]=null})):s=e.parse(t),s}function jn(e){return Si({rows:Se.csvParseRows,parse:Se.csvParse},e)}function Hn(e){return Si({rows:Se.tsvParseRows,parse:Se.tsvParse},e)}function Ri(e,t){const i=e||(t==null?void 0:t.data_keys);return i!=null&&i.x&&(t.data_x=i.x),i}function Wn(e,t,i){const s=this,{config:n}=s;let a;e.forEach(o=>{const r=s.getXKey(o);if(i.customX||i.timeSeries?i.xs.indexOf(r)>=0?a=(i.appendXs&&s.data.xs[o]||[]).concat(t.map((l,c)=>{const u=M(l[r]);return u?s.generateTargetX(u,o,c):!1}).filter(l=>l!==!1)):n.data_x?a=this.getOtherTargetXs():nt(n.data_xs)&&(a=s.getXValuesOfXKey(r,s.data.targets)):a=t.map((l,c)=>c),a)s.data.xs[o]=a;else throw new Error(`x is not defined for id = "${o}".`)})}var Un={convertData(e,t){const{config:i}=this,s=a=>{var o;return a!=null&&a.length&&((o=a[0])!=null&&o.length)?i.boost_useWorker:!1};let n=e;if(e.bindto&&(n={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(a=>{const o=`data_${a}`;o in e&&(n[a]=e[o])})),n.url&&t)Yn(n.url,n.mimeType,n.headers,Ri(n.keys,i),t);else if(n.json)Ve(s(n.json),wi,t,[Ye,je])(n.json,Ri(n.keys,i));else if(n.rows)Ve(s(n.rows),je,t)(n.rows);else if(n.columns)Ve(s(n.columns),Ye,t)(n.columns);else if(e.bindto)throw Error("url or json or rows or columns is required.")},convertDataToTargets(e,t){const i=this,{axis:s,config:n,state:a}=i,o=n.data_type,r=Object.keys(e[0]||{}),{ids:l,xs:c}=r.length?r.reduce((h,g)=>(i.isX.call(i,g)?h.xs.push(g):i.isNotX.call(i,g)&&h.ids.push(g),h),{ids:[],xs:[]}):{ids:[],xs:[]},u={appendXs:t,xs:c,idConverter:n.data_idConverter.bind(i.api),categorized:s==null?void 0:s.isCategorized(),timeSeries:s==null?void 0:s.isTimeSeries(),customX:s==null?void 0:s.isCustomX()};Wn.bind(i)(l,e,u);const d=l.map((h,g)=>{const f=n.data_idConverter.bind(i.api)(h),p=i.getXKey(h),_=u.customX&&u.categorized,x=_&&(()=>{const b=new Set(n.axis_x_categories);return e.every(v=>b.has(v.x))})(),m=e.__append__,$=p===null&&m?i.api.data.values(h).length:0;return{id:f,id_org:h,values:e.map((b,v)=>{const y=b[p];let T=b[h],C;return T=T!==null&&!isNaN(T)&&!B(T)?+T:G(T)||B(T)?T:null,(_||a.hasRadar)&&g===0&&!st(y)?(!x&&g===0&&v===0&&!m&&(n.axis_x_categories=[]),C=n.axis_x_categories.indexOf(y),C===-1&&(C=n.axis_x_categories.length,n.axis_x_categories.push(y))):C=i.generateTargetX(y,h,$+v),(st(T)||i.data.xs[h].length<=v)&&(C=void 0),{x:C,value:T,id:f,index:-1}}).filter(b=>H(b.x))}});if(d.forEach(h=>{var g;n.data_xSort&&(h.values=h.values.sort((f,p)=>{const _=f.x||f.x===0?f.x:1/0,x=p.x||p.x===0?p.x:1/0;return _-x})),h.values.forEach((f,p)=>f.index=p),(g=i.data.xs[h.id])==null||g.sort((f,p)=>f-p)}),a.hasNegativeValue=i.hasNegativeValueInTargets(d),a.hasPositiveValue=i.hasPositiveValueInTargets(d),o&&i.isValidChartType(o)){const h=i.mapToIds(d).filter(g=>!(g in n.data_types)||!i.isValidChartType(n.data_types[g]));i.setTargetType(h,o)}return d.forEach(h=>i.cache.add(h.id_org,h,!0)),d}},Zn={isX(e){const t=this,{config:i}=t,s=i.data_x&&e===i.data_x,n=nt(i.data_xs)&&_n(i.data_xs,e);return s||n},isNotX(e){return!this.isX(e)},isStackNormalized(){const{config:e}=this;return!!(e.data_stack_normalize&&e.data_groups.length)},isGrouped(e){const t=this.config.data_groups;return e?t.some(i=>i.indexOf(e)>=0&&i.length>1):t.length>0},getXKey(e){const t=this,{config:i}=t;return i.data_x?i.data_x:nt(i.data_xs)?i.data_xs[e]:null},getXValuesOfXKey(e,t){const i=this,s=t&&nt(t)?i.mapToIds(t):[];let n;return s.forEach(a=>{i.getXKey(a)===e&&(n=i.data.xs[a])}),n},getIndexByX(e,t){const i=this;return t?t.indexOf(X(e)?e:+e):(i.filterByX(i.data.targets,e)[0]||{index:null}).index},getXValue(e,t){const i=this;return e in i.data.xs&&i.data.xs[e]&&M(i.data.xs[e][t])?i.data.xs[e][t]:t},getOtherTargetXs(){const e=this,t=Object.keys(e.data.xs);return t.length?e.data.xs[t[0]]:null},getOtherTargetX(e){const t=this.getOtherTargetXs();return t&&e<t.length?t[e]:null},addXs(e){const t=this,{config:i}=t;Object.keys(e).forEach(s=>{i.data_xs[s]=e[s]})},isMultipleX(){return!this.config.axis_x_forceAsSingle&&(nt(this.config.data_xs)||this.hasType("bubble")||this.hasType("scatter"))},addName(e){const t=this,{config:i}=t;let s;return e&&(s=i.data_names[e.id],e.name=s!==void 0?s:e.id),e},getAllValuesOnIndex(e,t=!1){const i=this;let s=i.filterTargetsToShow(i.data.targets).map(n=>i.addName(i.getValueOnIndex(n.values,e)));return t&&(s=s.filter(n=>n&&"value"in n&&M(n.value))),s},getValueOnIndex(e,t){const i=e.filter(s=>s.index===t);return i.length?i[0]:null},updateTargetX(e,t){const i=this;e.forEach(s=>{s.values.forEach((n,a)=>{n.x=i.generateTargetX(t[a],s.id,a)}),i.data.xs[s.id]=t})},updateTargetXs(e,t){const i=this;e.forEach(s=>{t[s.id]&&i.updateTargetX([s],t[s.id])})},generateTargetX(e,t,i){const s=this,{axis:n}=s;let a=n!=null&&n.isCategorized()?i:e||i;if(n!=null&&n.isTimeSeries()){const o=vt.bind(s);a=o(e||s.getXValue(t,i))}else n!=null&&n.isCustomX()&&!(n!=null&&n.isCategorized())&&(a=M(e)?+e:s.getXValue(t,i));return a},updateXs(e){e.length&&(this.axis.xs=e.map(t=>t.x))},getPrevX(e){const t=this.axis.xs[e-1];return H(t)?t:null},getNextX(e){const t=this.axis.xs[e+1];return H(t)?t:null},getBaseValue(e){const t=this,{hasAxis:i}=t.state;let{value:s}=e;return s&&i&&(t.isAreaRangeType(e)?s=t.getRangedData(e,"mid"):t.isBubbleZType(e)&&(s=t.getBubbleZData(s,"y"))),s},getMinMaxValue(e){const t=this.getBaseValue.bind(this);let i,s;return(e||this.data.targets.map(n=>n.values)).forEach((n,a)=>{const o=n.map(t).filter(O);i=Math.min(a?i:1/0,...o),s=Math.max(a?s:-1/0,...o)}),{min:i,max:s}},getMinMaxData(){const e=this,t=_t.dataMinMax;let i=e.cache.get(t);if(!i){const s=e.data.targets.map(c=>c.values),n=e.getMinMaxValue(s);let a=[],o=[];const{min:r,max:l}=n;s.forEach(c=>{const u=e.getFilteredDataByValue(c,r),d=e.getFilteredDataByValue(c,l);u.length&&(a=a.concat(u)),d.length&&(o=o.concat(d))}),e.cache.add(t,i={min:a,max:o})}return i},getTotalPerIndex(){const e=this,t=_t.dataTotalPerIndex;let i=e.cache.get(t);return(e.config.data_groups.length||e.isStackNormalized())&&!i&&(i=[],e.data.targets.forEach(s=>{s.values.forEach((n,a)=>{i[a]||(i[a]=0),i[a]+=~~n.value})})),i},getTotalDataSum(e){const t=this,i=_t.dataTotalSum;let s=t.cache.get(i);return O(s)||(s=t.data.targets.reduce((n,a)=>n+a.values.reduce((o,r)=>o+~~r.value,0),0),t.cache.add(i,s)),e&&(s-=t.getHiddenTotalDataSum()),s},getHiddenTotalDataSum(){const e=this,{api:t,state:{hiddenTargetIds:i}}=e;let s=0;return i.length&&(s=t.data.values.bind(t)(i).reduce((n,a)=>n+a)),s},getFilteredDataByValue(e,t){return e.filter(i=>this.getBaseValue(i)===t)},getMaxDataCount(){return Math.max(...this.data.targets.map(e=>e.values.length),0)},getMaxDataCountTarget(){let e=this.filterTargetsToShow()||[];const t=e.length,i=this.config.axis_x_inverted;return t>1?(e=e.map(s=>s.values).reduce((s,n)=>s.concat(n)).map(s=>s.x),e=Qt(Me(e)).map((s,n,a)=>({x:s,index:i?a.length-n-1:n}))):t&&(e=e[0].values.concat()),e},mapToIds(e){return e.map(t=>t.id)},mapToTargetIds(e){const t=this;return e?G(e)?e.concat():[e]:t.mapToIds(t.data.targets)},hasTarget(e,t){const i=this.mapToIds(e);for(let s=0,n;n=i[s];s++)if(n===t)return!0;return!1},isTargetToShow(e){return this.state.hiddenTargetIds.indexOf(e)<0},isLegendToShow(e){return this.state.hiddenLegendIds.indexOf(e)<0},filterTargetsToShow(e){const t=this;return(e||t.data.targets).filter(i=>t.isTargetToShow(i.id))},mapTargetsToUniqueXs(e){const t=this,{axis:i}=t;let s=[];return e!=null&&e.length&&(s=Me(mi(e.map(n=>n.values.map(a=>+a.x)))),s=i!=null&&i.isTimeSeries()?s.map(n=>new Date(+n)):s.map(Number)),Qt(s)},addTargetIds(e,t){const{state:i}=this;(G(t)?t:[t]).forEach(n=>{i[e].indexOf(n)<0&&i[e].push(n)})},removeTargetIds(e,t){const{state:i}=this;(G(t)?t:[t]).forEach(n=>{const a=i[e].indexOf(n);a>=0&&i[e].splice(a,1)})},addHiddenTargetIds(e){this.addTargetIds("hiddenTargetIds",e)},removeHiddenTargetIds(e){this.removeTargetIds("hiddenTargetIds",e)},addHiddenLegendIds(e){this.addTargetIds("hiddenLegendIds",e)},removeHiddenLegendIds(e){this.removeTargetIds("hiddenLegendIds",e)},getValuesAsIdKeyed(e){const t=this,{hasAxis:i}=t.state,s={},n=t.isMultipleX(),a=n?t.mapTargetsToUniqueXs(e).map(o=>X(o)?o:+o):null;return e.forEach(o=>{const r=[];o.values.filter(({value:l})=>M(l)||l===null).forEach(l=>{let{value:c}=l;c!==null&&t.isCandlestickType(l)&&(c=G(c)?c.slice(0,4):[c.open,c.high,c.low,c.close]),G(c)?r.push(...c):B(c)&&"high"in c?r.push(...Object.values(c)):t.isBubbleZType(l)?r.push(i&&t.getBubbleZData(c,"y")):n?r[t.getIndexByX(l.x,a)]=c:r.push(c)}),s[o.id]=r}),s},checkValueInTargets(e,t){return Object.keys(e).some(i=>e[i].values.some(s=>t(s.value)))},hasMultiTargets(){return this.filterTargetsToShow().length>1},hasNegativeValueInTargets(e){return this.checkValueInTargets(e,t=>t<0)},hasPositiveValueInTargets(e){return this.checkValueInTargets(e,t=>t>0)},orderTargets(e){const t=this,i=[...e],s=t.getSortCompareFn();return s&&i.sort(s),i},getSortCompareFn(e=!1){const t=this,{config:i}=t,s=i.data_order,n=/asc/i.test(s),a=/desc/i.test(s);let o;if(n||a){const r=(c,u)=>c+Math.abs(u.value),l=c=>O(c)?c:"values"in c?c.values.reduce(r,0):c.value;o=(c,u)=>{const d=l(c),h=l(u);return e?n?d-h:h-d:n?h-d:d-h}}else L(s)&&(o=s.bind(t.api));return o||null},filterByX(e,t){return mi(e.map(i=>i.values)).filter(i=>i.x-t===0)},filterNullish(e){const t=i=>M(i.value);return e&&e.filter(i=>"value"in i?t(i):i.values.some(t))},filterRemoveNull(e){return e.filter(t=>M(this.getBaseValue(t)))},filterByXDomain(e,t){return e.map(i=>({id:i.id,id_org:i.id_org,values:i.values.filter(s=>t[0]<=s.x&&s.x<=t[1])}))},hasDataLabel(){const e=this.config.data_labels;return De(e)&&e||Rt(e)&&nt(e)},hasNullDataValue(e){return e.some(({value:t})=>t===null)},getDataIndexFromEvent(e){const t=this,{$el:i,config:s,state:{hasRadar:n,inputType:a,eventReceiver:{coords:o,rect:r}}}=t;let l;if(n){let c=e.target;/tspan/i.test(c.tagName)&&(c=c.parentNode);const u=(0,w.select)(c).datum();l=u&&Object.keys(u).length===1?u.index:void 0}else{const c=s.axis_rotated,u=xi(i.chart.node()),d=a==="touch"&&e.changedTouches?e.changedTouches[0]:e;let h=c?d.clientY+u.y:d.clientX+u.x;if(Xe(i.svg)){const g=[h,0];c&&g.reverse(),h=Ae(i.eventRect.node(),...g)[c?"y":"x"]}else h-=c?r.top:r.left;l=Fe(o,h,0,o.length-1,c)}return l},getDataLabelLength(e,t,i){var s;const n=this,a=1.3;return((s=n.getTextRect([e,t].map(o=>n.dataLabelFormat()(o))))==null?void 0:s.map(o=>o[i]*a))||[0,0]},isNoneArc(e){return this.hasTarget(this.data.targets,e.id)},isArc(e){return"data"in e&&this.hasTarget(this.data.targets,e.data.id)},findSameXOfValues(e,t){const i=e[t].x,s=[];let n;for(n=t-1;n>=0&&i===e[n].x;n--)s.push(e[n]);for(n=t;n<e.length&&i===e[n].x;n++)s.push(e[n]);return s},findClosestFromTargets(e,t){const i=this,s=e.map(n=>i.findClosest(n.values,t));return i.findClosest(s,t)},findClosest(e,t){const i=this,{$el:{main:s}}=i,n=e.filter(r=>r&&M(r.value));let a,o;return n.filter(r=>i.isBarType(r.id)||i.isCandlestickType(r.id)).forEach(r=>{const l=i.isBarType(r.id)?`.${$t.chartBar}.${I.target}${i.getTargetSelectorSuffix(r.id)} .${$t.bar}-${r.index}`:`.${Et.chartCandlestick}.${I.target}${i.getTargetSelectorSuffix(r.id)} .${Et.candlestick}-${r.index} path`;!o&&i.isWithinBar(s.select(l).node())&&(o=r)}),n.filter(r=>!i.isBarType(r.id)&&!i.isCandlestickType(r.id)).forEach(r=>{const l=i.dist(r,t);a=i.getPointSensitivity(r),l<a&&(a=l,o=r)}),o},dist(e,t){const i=this,{config:{axis_rotated:s},scale:n}=i,a=+s,o=+!s,r=i.circleY(e,e.index),l=(n.zoom||n.x)(e.x);return Math.sqrt(Math.pow(l-t[a],2)+Math.pow(r-t[o],2))},convertValuesToStep(e){const t=this,{axis:i,config:s}=t,n=s.line_step_type,a=i?i.isCategorized():!1,o=G(e)?e.concat():[e];if(!(a||/step\-(after|before)/.test(n)))return e;if(o.length){const r=o[0],l=o[o.length-1],{id:c}=r;let{x:u}=r;o.unshift({x:--u,value:r.value,id:c}),a&&n==="step-after"&&o.unshift({x:--u,value:r.value,id:c}),u=l.x,o.push({x:++u,value:l.value,id:c}),a&&n==="step-before"&&o.push({x:++u,value:l.value,id:c})}return o},convertValuesToRange(e){const t=G(e)?e.concat():[e],i=[];return t.forEach(s=>{const{x:n,id:a}=s;i.push({x:n,id:a,value:s.value[0]}),i.push({x:n,id:a,value:s.value[2]})}),i},updateDataAttributes(e,t){const i=this,{config:s}=i,n=s[`data_${e}`];return st(t)||(Object.keys(t).forEach(a=>{n[a]=t[a]}),i.redraw({withLegend:!0})),n},getRangedData(e,t="",i="areaRange"){const s=e==null?void 0:e.value;if(G(s)){if(i==="bar")return s.reduce((n,a)=>a-n);{const n={areaRange:["high","mid","low"],candlestick:["open","high","low","close","volume"]}[i].indexOf(t);return n>=0&&s?s[n]:void 0}}else if(s&&t)return s[t];return s},setRatioForGroupedData(e){const t=this,{config:i}=t;if(i.data_groups.length&&e.some(s=>t.isGrouped(s.id))){const s=n=>t.getRatio("index",n,!0);e.forEach(n=>{"values"in n?n.values.forEach(s):s(n)})}},getRatio(e,t,i=!1){const s=this,{config:n,state:a}=s,o=s.api;let r=0;if(t&&o.data.shown().length)if(r=t.ratio||t.value,e==="arc")if(s.pie.padAngle()())r=t.value/s.getTotalDataSum(!0);else{const l=n.gauge_fullCircle?s.getArcLength():s.getStartingAngle()*-2,c=s.hasType("gauge")?l:Math.PI*2;r=(t.endAngle-t.startAngle)/c}else if(e==="index"){const l=o.data.values.bind(o);let c=this.getTotalPerIndex();if(a.hiddenTargetIds.length){let d=l(a.hiddenTargetIds,!1);d.length&&(d=d.reduce((h,g)=>h.map((f,p)=>~~f+g[p])),c=c.map((h,g)=>h-d[g]))}const u=c[t.index];t.ratio=O(t.value)&&c&&u?t.value/u:0,r=t.ratio}else if(e==="radar")r=parseFloat(String(Math.max(t.value,0)))/a.current.dataMax*n.radar_size_ratio;else if(e==="bar"){const c=s.getYScaleById.bind(s)(t.id).domain().reduce((u,d)=>d-u);r=c===0?0:Math.abs(s.getRangedData(t,null,e)/c)}else e==="treemap"&&(r/=s.getTotalDataSum(!0));return i&&r?r*100:r},updateDataIndexByX(e){const t=this,i=e.reduce((s,n,a)=>(s[Number(n.x)]=a,s),{});t.data.targets.forEach(s=>{s.values.forEach((n,a)=>{let o=i[Number(n.x)];o===void 0&&(o=a),n.index=o})})},isBubbleZType(e){return this.isBubbleType(e)&&(B(e.value)&&("z"in e.value||"y"in e.value)||G(e.value)&&e.value.length>=2)},isBarRangeType(e){const t=this,{value:i}=e;return t.isBarType(e)&&G(i)&&i.length>=2&&i.every(O)},getDataById(e){var t;const i=this.cache.get(e)||this.api.data(e);return(t=i==null?void 0:i[0])!=null?t:i}};function Ci(e,t=!1){const i=this,{api:s}=i;t&&i.api.flush(!0),e==null||e.call(s)}var qn={load(e,t){const i=this,{axis:s,data:n,org:a,scale:o}=i,{append:r}=t,l={domain:null,currentDomain:null,x:null};let c=e;c&&(t.filter&&(c=c.filter(t.filter)),(t.type||t.types)&&c.forEach(u=>{var d;const h=((d=t.types)==null?void 0:d[u.id])||t.type;i.setTargetType(u.id,h)}),n.targets.forEach(u=>{for(let d=0;d<c.length;d++)if(u.id===c[d].id){u.values=r?u.values.concat(c[d].values):c[d].values,c.splice(d,1);break}}),n.targets=n.targets.concat(c)),i.updateTargets(n.targets),o.zoom&&(l.x=s.isCategorized()?o.x.orgScale():(a.xScale||o.x).copy(),l.domain=i.getXDomain(n.targets),l.x.domain(l.domain),l.currentDomain=i.zoom.getDomain(),i.withinRange(l.currentDomain,void 0,l.domain)||(o.x.domain(l.domain),o.zoom=null,i.$el.eventRect.property("__zoom",null))),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),o.zoom?(a.xDomain=l.domain,a.xScale=l.x,s.isCategorized()&&(l.currentDomain=i.getZoomDomainValue(l.currentDomain),a.xDomain=i.getZoomDomainValue(a.xDomain),a.xScale=l.x.domain(a.xDomain)),i.updateCurrentZoomTransform(l.x,l.currentDomain)):a.xScale&&a.xScale.domain(a.xDomain),i.updateTypesElements(),Ci.call(i,t.done,t.resizeAfter)},loadFromArgs(e){const t=this;t.config&&(t.cache.reset(),t.convertData(e,i=>{const s=e.data||i;e.append&&(s.__append__=!0),s&&t.load(t.convertDataToTargets.call(t,s),e)}))},unload(e,t){var i;const s=this,{state:n,$el:a,$T:o}=s,r=!!((i=s.hasLegendDefsPoint)!=null&&i.call(s));let l=t,c=e;if(s.cache.reset(),l||(l=()=>{}),c=c.filter(d=>s.hasTarget(s.data.targets,d)),!c||c.length===0){l();return}const u=a.svg.selectAll(c.map(d=>s.selectorTarget(d)));o(u).style("opacity","0").remove().call(Te,l),c.forEach(d=>{var h;const g=s.getTargetSelectorSuffix(d);n.withoutFadeIn[d]=!1,a.legend&&a.legend.selectAll(`.${Y.legendItem}${g}`).remove(),s.data.targets=s.data.targets.filter(f=>f.id!==d),r&&((h=a.defs)==null||h.select(`#${s.getDefsPointId(g)}`).remove())}),n.hasFunnel&&s.updateFunnel(s.data.targets),n.hasTreemap&&s.updateTargetsForTreemap(s.data.targets),s.updateTypesElements()}},ki=U(6),Kn={setExpand(e,t,i){const s=this,{config:n,$el:{circle:a}}=s;a&&n.point_focus_expand_enabled&&s.expandCircles(e,t,i),s.expandBarTypeShapes(!0,e,t,i)},expandBarTypeShapes(e=!0,t,i,s){const n=this;["bar","candlestick"].filter(a=>n.$el[a]).forEach(a=>{s&&n.$el[a].classed(I.EXPANDED,!1),n.getShapeByIndex(a,t,i).classed(I.EXPANDED,e)})},setOverOut(e,t){const i=this,{config:s,state:{hasFunnel:n,hasRadar:a,hasTreemap:o},$el:{main:r}}=i,l=B(t);if(l||t!==-1){const c=s[e?"data_onover":"data_onout"].bind(i.api);if(s.color_onover&&i.setOverColor(e,t,l),l){const u=i.getTargetSelectorSuffix(t.id),d=n||o?`${I.target+u} .${it.shape}`:V.arc+u;c(t,r.select(`.${d}`).node())}else if(s.tooltip_grouped)e&&(a&&i.isPointFocusOnly()?i.showCircleFocus(i.getAllValuesOnIndex(t,!0)):i.setExpand(t,null,!0)),!i.isMultipleX()&&r.selectAll(`.${it.shape}-${t}`).each(function(u){c(u,this)});else{const u=i.cache.get(_t.setOverOut)||[],d=r.selectAll(`.${it.shape}-${t}`).filter(function(g){return i.isWithinShape(this,g)}),h=d.filter(function(){return u.every(g=>g!==this)});if(!e||d.empty()||u.length===h.size()&&h.nodes().every((g,f)=>g!==u[f]))for(;u.length;){const g=u.pop();s.data_onout.bind(i.api)((0,w.select)(g).datum(),g)}h.each(function(){e&&(c((0,w.select)(this).datum(),this),u.push(this))}),i.cache.add(_t.setOverOut,u)}}},callOverOutForTouch(e){const t=this,i=t.cache.get(_t.callOverOutForTouch);(B(e)&&i?e.id!==i.id:e!==i)&&((i||O(i))&&t.setOverOut(!1,i),(e||O(e))&&t.setOverOut(!0,e),t.cache.add(_t.callOverOutForTouch,e))},getDraggableSelection(){const e=this,{config:t,state:i}=e;return t.interaction_enabled&&t.data_selection_draggable&&e.drag?(0,ki.drag)().on("drag",function(s){i.event=s,e.drag(bt(s,this))}).on("start",function(s){i.event=s,e.dragstart(bt(s,this))}).on("end",s=>{i.event=s,e.dragend()}):()=>{}},dispatchEvent(e,t,i){var s,n,a;const o=this,{config:r,state:{eventReceiver:l,hasAxis:c,hasFunnel:u,hasRadar:d,hasTreemap:h},$el:{eventRect:g,funnel:f,radar:p,svg:_,treemap:x}}=o;let m=(a=(n=(u||h)&&l.rect||d&&p.axes.select(`.${ot.axis}-${t} text`)||g||((s=o.getArcElementByIdOrIndex)==null?void 0:s.call(o,t)))==null?void 0:n.node)==null?void 0:a.call(n);if(m){const $=o.isMultipleX(),b=r.axis_rotated;let{width:v,left:y,top:T}=ct(m);if(c&&!d&&!$){const R=l.coords[t];R?(v=R.w,y+=R.x,T+=R.y):(v=0,y=0,T=0)}let C=y+(i?i[0]:0)+($||b?0:v/2),A=T+(i?i[1]:0)+(b?4:0);if(Xe(_)){const R=Ae(o.$el.eventRect.node(),C,A,!1);C=R.x,A=R.y}const S={screenX:C,screenY:A,clientX:C,clientY:A,bubbles:d};(u||h)&&(m=(f!=null?f:x).node()),vn[/^(mouse|click)/.test(e)?"mouse":"touch"](m,e,S)}},setDragStatus(e){this.state.dragging=e},unbindZoomEvent(){const e=this,{$el:{eventRect:t,zoomResetBtn:i}}=e;t==null||t.on(".zoom wheel.zoom .drag",null),i==null||i.on("click",null).style("display","none")},unbindAllEvents(){var e;const t=this,{$el:{arcs:i,eventRect:s,legend:n,region:a,svg:o,treemap:r},brush:l}=t,c=["wheel","click","mouseover","mousemove","mouseout","touchstart","touchmove","touchend","touchstart.eventRect","touchmove.eventRect","touchend.eventRect",".brush",".drag",".zoom","wheel.zoom","dblclick.zoom"].join(" ");[o,s,a==null?void 0:a.list,l==null?void 0:l.getSelection(),i==null?void 0:i.selectAll("path"),n==null?void 0:n.selectAll("g"),r].forEach(u=>u==null?void 0:u.on(c,null)),(e=t.unbindZoomEvent)==null||e.call(t)}},Jn={categoryName(e){var t;const{axis_x_categories:i}=this.config;return(t=i==null?void 0:i[e])!=null?t:e}},Qn={generateClass(e,t){return` ${e} ${e+this.getTargetSelectorSuffix(t)}`},getClass(e,t){const i=/s$/.test(e),s=/^(area|arc|line|funnel|treemap)s?$/.test(e),n=i?"id":"index";return a=>{const o=a.data||a;return((t?this.generateClass(N[i?"shapes":"shape"],o[n]):"")+this.generateClass(N[e],o[s?"id":n])).trim()}},getChartClass(e){return t=>N[`chart${e}`]+this.classTarget((t.data?t.data:t).id)},generateExtraLineClass(){const t=this.config.line_classes||[],i=[];return function(s){var n;const a=s.id||((n=s.data)==null?void 0:n.id)||s;return i.indexOf(a)<0&&i.push(a),t[i.indexOf(a)%t.length]}},classRegion(e,t){return`${this.generateClass(N.region,t)} ${"class"in e?e.class:""}`},classTarget(e){const t=this.config.data_classes[e];let i="";return t&&(i=` ${N.target}-${t}`),this.generateClass(N.target,e)+i},classFocus(e){return this.classFocused(e)+this.classDefocused(e)},classFocused(e){return` ${this.state.focusedTargetIds.indexOf(e.id)>=0?N.focused:""}`},classDefocused(e){return` ${this.state.defocusedTargetIds.indexOf(e.id)>=0?N.defocused:""}`},getTargetSelectorSuffix(e){return(e||e===0?`-${e}`:"").replace(/[\x00-\x20\x7F-\xA0\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-")},selectorTarget(e,t="",i=""){const s=this.getTargetSelectorSuffix(e);return`${t}.${N.target+s} ${i}, ${t}.${N.circles+s} ${i}`},selectorTargets(e,t){const i=e||[];return i.length?i.map(s=>this.selectorTarget(s,t)):null},selectorLegend(e){return`.${N.legendItem+this.getTargetSelectorSuffix(e)}`},selectorLegends(e){return e!=null&&e.length?e.map(t=>this.selectorLegend(t)):null}},Mt=U(7);const ta=(e,t,i)=>{const s=(0,w.select)(e.cloneNode(!0));return s.attr("id",i).insert("rect",":first-child").attr("width",s.attr("width")).attr("height",s.attr("height")).style("fill",t),{id:i,node:s.node()}};function ea(e){const t=_t.colorPattern,{body:i}=lt;let s=i[t];if(!s){const a=e.classed(Oe.colorPattern,!0).style("background-image");e.classed(Oe.colorPattern,!1),a.indexOf(";")>-1&&(s=a.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(";").map(o=>o.trim().replace(/[\"'\s]/g,"")).filter(Boolean),i[t]=s)}return s}const ia=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];var sa={generateColor(){const e=this,{$el:t,config:i}=e,s=[];let n=nt(i.color_pattern)?i.color_pattern:(0,Mt.scaleOrdinal)(ea(t.chart)||ia).range();const a=n;if(L(i.color_tiles)){const o=i.color_tiles.bind(e.api)(),r=n.map((l,c)=>{const u=l.replace(/[#\(\)\s,]/g,""),d=`${e.state.datetimeId}-pattern-${u}-${c}`;return ta(o[c%o.length],l,d)});n=r.map(l=>`url(#${l.id})`),e.patterns=r}return function(o){var r;const l=i.data_colors,c=i.data_color,u=o.id||((r=o.data)==null?void 0:r.id)||o,d=e.isTypeOf(u,["line","spline","step"])||!i.data_types[u];let h;return L(l[u])?h=l[u].bind(e.api)(o):l[u]?h=l[u]:(s.indexOf(u)<0&&s.push(u),h=d?a[s.indexOf(u)%a.length]:n[s.indexOf(u)%n.length],l[u]=h),L(c)?c.bind(e.api)(h,o):h}},generateLevelColor(){const e=this,{config:t}=e,i=t.color_pattern,s=t.color_threshold,n=s.unit==="value",a=s.max||100,o=s.values&&s.values.length?s.values:[];return nt(s)?function(r){const l=n?r:r*100/a;let c=i[i.length-1];for(let u=0,d=o.length;u<d;u++)if(l<=o[u]){c=i[u];break}return c}:null},generateTextBGColorFilter(e,t={x:0,y:0,width:1,height:1}){const i=this,{$el:{defs:s},state:n}=i;if(e){let a=[];X(e)?a.push(""):B(e)?a=Object.keys(e):L(e)&&(a=i.mapToTargetIds()),a.forEach(o=>{const r=`${n.datetimeId}-labels-bg${i.getTargetSelectorSuffix(o)}${X(e)?i.getTargetSelectorSuffix(e):""}`,l=o===""?e:(e==null?void 0:e[o])||"";s.select(`#${r}`).empty()&&s.append("filter").attr("x",t.x).attr("y",t.y).attr("width",t.width).attr("height",t.height).attr("id",r).html(`<feFlood flood-color="${l}" />
17
17
  <feComposite in="SourceGraphic" />`)})}},getGradienColortUrl(e){return`url(#${this.state.datetimeId}-gradient${this.getTargetSelectorSuffix(e)})`},updateLinearGradient(){const e=this,{config:t,data:{targets:i},state:{datetimeId:s},$el:{defs:n}}=e;i.forEach(a=>{const o=`${s}-gradient${e.getTargetSelectorSuffix(a.id)}`,r=e.hasPointType()&&t.point_radialGradient,l=e.isAreaType(a)&&"area"||e.isBarType(a)&&"bar";if((r||l)&&n.select(`#${o}`).empty()){const c=e.color(a),u={defs:null,stops:[]};if(r){const{cx:d=.3,cy:h=.3,r:g=.7,stops:f=[[.1,c,0],[.9,c,1]]}=r;u.stops=f,u.defs=n.append("radialGradient").attr("id",`${o}`).attr("cx",d).attr("cy",h).attr("r",g)}else{const d=t.axis_rotated,{x:h=d?[1,0]:[0,0],y:g=d?[0,0]:[0,1],stops:f=[[0,c,1],[1,c,0]]}=t[`${l}_linearGradient`];u.stops=f,u.defs=n.append("linearGradient").attr("id",`${o}`).attr("x1",h[0]).attr("x2",h[1]).attr("y1",g[0]).attr("y2",g[1])}u.stops.forEach(d=>{const[h,g,f]=d,p=L(g)?g.bind(e.api)(a.id):g;u.defs&&u.defs.append("stop").attr("offset",h).attr("stop-color",p||c).attr("stop-opacity",f)})}})},setOverColor(e,t){const i=this,{config:s,$el:{main:n}}=i,a=s.color_onover;let o=e?a:i.color;B(o)?o=({id:r})=>r in a?a[r]:i.color(r):X(o)?o=()=>a:L(a)&&(o=o.bind(i.api)),n.selectAll(B(t)?`.${V.arc}${i.getTargetSelectorSuffix(t.id)}`:`.${it.shape}-${t}`).style("fill",o)}},na={getYDomainMinMax(e,t){const i=this,{axis:s,config:n}=i,a=t==="min",o=n.data_groups,r=i.mapToIds(e),l=i.getValuesAsIdKeyed(e);if(o.length>0){const c=i[`has${a?"Negative":"Positive"}ValueInTargets`](e);o.forEach(u=>{const d=u.filter(h=>r.indexOf(h)>=0);if(d.length){const h=d[0],g=s.getId(h);c&&l[h]&&(l[h]=l[h].map(f=>(a?f<0:f>0)?f:0)),d.filter((f,p)=>p>0).forEach(f=>{if(l[f]){const p=s.getId(f);l[f].forEach((_,x)=>{const m=+_,$=a?m>0:m<0;p===g&&!(c&&$)&&(l[h][x]+=m)})}})}})}return St(t,Object.keys(l).map(c=>St(t,l[c])))},isHiddenTargetWithYDomain(e){const t=this;return t.state.hiddenTargetIds.some(i=>t.axis.getId(i)===e)},getYDomain(e,t,i){const s=this,{axis:n,config:a,scale:o}=s,r=`axis_${t}`;if(s.isStackNormalized())return[0,100];const l=(o==null?void 0:o[t])&&o[t].type==="log",c=e.filter(S=>n.getId(S.id)===t),u=i?s.filterByXDomain(c,i):c;if(u.length===0)return s.isHiddenTargetWithYDomain(t)?o[t].domain():t==="y2"?o.y.domain():s.getYDomain(e,"y2",i);const d=a[`${r}_min`],h=a[`${r}_max`],g=a[`${r}_center`],f=a[`${r}_inverted`],p=s.hasDataLabel()&&a.axis_rotated,_=s.hasDataLabel()&&!a.axis_rotated;let x=s.getYDomainMinMax(u,"min"),m=s.getYDomainMinMax(u,"max"),$=[k.BAR,k.BUBBLE,k.SCATTER,...Ft.Line].some(S=>{const R=S.indexOf("area")>-1?"area":S;return s.hasType(S,u,!0)&&a[`${R}_zerobased`]});x=M(d)?d:M(h)?x<=h?x:h-10:x,m=M(h)?h:M(d)?d<=m?m:d+10:m,isNaN(x)&&(x=0),isNaN(m)&&(m=x),x===m&&(x<0?m=0:x=0);const b=x>=0&&m>=0,v=x<=0&&m<=0;(M(d)&&b||M(h)&&v)&&($=!1),$&&(b&&(x=0),v&&(m=0));const y=Math.abs(m-x);let T={top:y*.1,bottom:y*.1};if(H(g)){const S=Math.max(Math.abs(x),Math.abs(m));m=g+S,x=g-S}if(p){const S=Gt(o.y.range()),R=s.getDataLabelLength(x,m,"width").map(z=>{const E=z/S;return isFinite(E)?E:0});["bottom","top"].forEach((z,E)=>{T[z]+=y*(R[E]/(1-R[0]-R[1]))})}else if(_){const S=s.getDataLabelLength(x,m,"height");["bottom","top"].forEach((R,z)=>{T[R]+=s.convertPixelToScale("y",S[z],y)})}T=s.getResettedPadding(T);const C=a[`${r}_padding`];nt(C)&&["bottom","top"].forEach(S=>{T[S]=n.getPadding(C,S,T[S],y)}),$&&(b&&(T.bottom=x),v&&(T.top=-m));const A=l?[x,m].map(S=>S<0?0:S):[x-T.bottom,m+T.top];return f?A.reverse():A},getXDomainMinMax(e,t){var i;const s=this,n=s.config[`axis_x_${t}`],a=St(t,e.map(r=>St(t,r.values.map(l=>l.x))));let o=B(n)?n.value:n;return o=H(o)&&((i=s.axis)!=null&&i.isTimeSeries())?vt.bind(this)(o):o,B(n)&&n.fit&&(t==="min"&&o<a||t==="max"&&o>a)&&(o=void 0),H(o)?o:a},getXDomainPadding(e,t){const i=this,{axis:s,config:n}=i,a=n.axis_x_padding,o=s.isTimeSeries()&&t,r=Gt(e);let l;if(s.isCategorized()||o)l=0;else if(i.hasType("bar")){const d=i.getMaxDataCount();l=d>1?r/(d-1)/2:.5}else l=i.getResettedPadding(r*.01);let{left:c=l,right:u=l}=O(a)?{left:a,right:a}:a;if(a.unit==="px"){const d=Math.abs(r+r*.2);c=s.getPadding(a,"left",l,d),u=s.getPadding(a,"right",l,d)}else{const d=r+c+u;if(o&&d){const h=r/t/d;c=c/d/h,u=u/d/h}}return{left:c,right:u}},getXDomain(e){const t=this,{axis:i,config:s,scale:{x:n}}=t,a=s.axis_x_inverted,o=[t.getXDomainMinMax(e,"min"),t.getXDomainMinMax(e,"max")];let[r=0,l=0]=o;if(n.type!=="log"){const c=i.isCategorized(),u=i.isTimeSeries(),d=t.getXDomainPadding(o);let[h,g]=o;h-g===0&&!c&&(u?(h=new Date(h.getTime()*.5),g=new Date(g.getTime()*1.5)):(h=h===0?1:h*.5,g=g===0?-1:g*1.5)),(h||h===0)&&(r=u?new Date(h.getTime()-d.left):h-d.left),(g||g===0)&&(l=u?new Date(g.getTime()+d.right):g+d.right)}return a?[l,r]:[r,l]},updateXDomain(e,t,i,s,n){var a;const o=this,{config:r,org:l,scale:{x:c,subX:u}}=o,d=r.zoom_enabled;if(i&&(c.domain(n||Qt(o.getXDomain(e),!r.axis_x_inverted)),l.xDomain=c.domain(),u.domain(c.domain()),(a=o.brush)==null||a.scale(u)),t){const h=n||!o.brush||pi(o)?l.xDomain:gi(o).map(u.invert);c.domain(h)}return(i||t)&&d&&o.zoom.updateScaleExtent(),s&&c.domain(o.trimXDomain(c.orgDomain())),c.domain()},trimXDomain(e){const t=this,i=t.config.axis_x_inverted,s=t.getZoomDomain(),[n,a]=s;return(i?e[0]>=n:e[0]<=n)&&(e[1]=+e[1]+(n-e[0]),e[0]=n),(i?e[1]<=a:e[1]>=a)&&(e[0]=+e[0]-(e[1]-a),e[1]=a),e},getZoomDomain(e="zoom",t=!1){const i=this,{config:s,scale:n,org:a}=i;let[o,r]=t&&n[e]?n[e].domain():a.xDomain;return e==="zoom"&&(H(s.zoom_x_min)&&(o=St("min",[o,s.zoom_x_min])),H(s.zoom_x_max)&&(r=St("max",[r,s.zoom_x_max]))),[o,r]},getZoomDomainValue(e){const t=this,{config:i,axis:s}=t;if(s.isCategorized()&&Array.isArray(e)){const n=i.axis_x_inverted;return e.map((o,r)=>Number(o)+(r===0?+n:+!n))}return e},convertPixelToScale(e,t,i){const s=this,{config:n,state:a}=s,o=n.axis_rotated;let r;return e==="x"?r=o?"height":"width":r=o?"width":"height",i*(t/a[r])},withinRange(e,t=[0,0],i){const n=this.config.axis_x_inverted,[a,o]=i;if(Array.isArray(e)){const r=[...e];if(n&&r.reverse(),r[0]<r[1])return e.every((l,c)=>(c===0?n?+l<=a:+l>=a:n?+l>=o:+l<=o)&&!e.every((u,d)=>u===t[d]))}return!1}};function Ei(e,t,i){const{config:s}=e,n=`axis_${t}_tick_format`;return(s[n]?s[n]:e.defaultValueFormat).call(e.api,i)}var aa={yFormat(e){return Ei(this,"y",e)},y2Format(e){return Ei(this,"y2",e)},getDefaultValueFormat(){const e=this,{defaultArcValueFormat:t,yFormat:i,y2Format:s}=e,n=e.hasArcType(null,["gauge","polar","radar"]);return function(a,o,r){return(n?t:e.axis&&e.axis.getId(r)==="y2"?s:i).call(e,a,o)}},defaultValueFormat(e){return G(e)?e.join("~"):M(e)?+e:""},defaultArcValueFormat(e,t){return`${(t*100).toFixed(1)}%`},defaultPolarValueFormat(e){return`${e}`},dataLabelFormat(e){const t=this,i=t.config.data_labels,s=a=>{let r=a;return G(a)?r=a.join("~"):B(a)&&(r=Object.values(a).join("~")),r};let n=s;return L(i.format)?n=i.format:Rt(i.format)&&(i.format[e]?n=i.format[e]===!0?s:i.format[e]:n=()=>""),n.bind(t.api)}};function Re(e){const t=this,i=t.getDataById(e);return t.levelColor?t.levelColor(i.values[0].value):t.color(i)}function He(e,t=!0){var i;const{config:s}=this;let n=(i=s.data_names[e])!=null?i:e;return t&&L(s.legend_format)&&(n=s.legend_format(n,e!==n?e:void 0)),n}var oa={initLegend(){const e=this,{config:t,$el:i}=e;e.legendItemTextBox={},e.state.legendHasRendered=!1,t.legend_show?(t.legend_contents_bindto||(i.legend=e.$el.svg.append("g").classed(Y.legend,!0).attr("transform",e.getTranslate("legend"))),e.updateLegend()):e.state.hiddenLegendIds=e.mapToIds(e.data.targets)},updateLegend(e,t,i){var s;const n=this,{config:a,state:o,scale:r,$el:l}=n,c=t||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};c.withTransition=zt(c,"withTransition",!0),c.withTransitionForTransform=zt(c,"withTransitionForTransform",!0),a.legend_contents_bindto&&a.legend_contents_template?n.updateLegendTemplate():o.hasTreemap||n.updateLegendElement(e||n.mapToIds(n.data.targets),c,i),(s=l.legend)==null||s.selectAll(`.${Y.legendItem}`).classed(Y.legendItemHidden,function(u){const d=!n.isTargetToShow(u);return d&&(this.style.opacity=null),d}),n.updateScales(!1,!r.zoom),n.updateSvgSize(),n.transformAll(c.withTransitionForTransform,i),o.legendHasRendered=!0},updateLegendTemplate(){const e=this,{config:t,$el:i}=e,s=(0,w.select)(t.legend_contents_bindto),n=t.legend_contents_template;if(!s.empty()){const a=e.mapToIds(e.data.targets),o=[];let r="";a.forEach(c=>{const u=L(n)?n.bind(e.api)(c,e.color(c),e.api.data(c)[0].values):he(n,{COLOR:e.color(c),TITLE:c});u&&(o.push(c),r+=u)});const l=s.html(r).selectAll(function(){return this.childNodes}).data(o);e.setLegendItem(l),i.legend=s}},updateSizeForLegend(e){const t=this,{config:i,state:{isLegendTop:s,isLegendLeft:n,isLegendRight:a,isLegendInset:o,current:r}}=t,{width:l,height:c}=e,u={top:s?t.getCurrentPaddingByDirection("top")+i.legend_inset_y+5.5:r.height-c-t.getCurrentPaddingByDirection("bottom")-i.legend_inset_y,left:n?t.getCurrentPaddingByDirection("left")+i.legend_inset_x+.5:r.width-l-t.getCurrentPaddingByDirection("right")-i.legend_inset_x+.5};t.state.margin3={top:a?0:o?u.top:r.height-c,right:NaN,bottom:0,left:a?r.width-l:o?u.left:0}},transformLegend(e){const t=this,{$el:{legend:i},$T:s}=t;s(i,e).attr("transform",t.getTranslate("legend"))},updateLegendStep(e){this.state.legendStep=e},updateLegendItemWidth(e){this.state.legendItemWidth=e},updateLegendItemHeight(e){this.state.legendItemHeight=e},updateLegendItemColor(e,t){const{legend:i}=this.$el;i&&i.select(`.${Y.legendItem}-${e} line`).style("stroke",t)},getLegendWidth(){const e=this,{current:{width:t},isLegendRight:i,isLegendInset:s,legendItemWidth:n,legendStep:a}=e.state;return e.config.legend_show?i||s?n*(a+1):t:0},getLegendHeight(){var e;const t=this,{current:i,isLegendRight:s,legendItemHeight:n,legendStep:a}=t.state,o=((e=t.config.padding)==null?void 0:e.mode)==="fit";return t.config.legend_show?s?i.height:Math.max(o?10:20,n)*(a+1):0},opacityForUnfocusedLegend(e){return e.classed(Y.legendItemHidden)?null:"0.3"},toggleFocusLegend(e,t){const i=this,{$el:{legend:s},$T:n}=i,a=i.mapToTargetIds(e);s&&n(s.selectAll(`.${Y.legendItem}`).filter(o=>a.indexOf(o)>=0).classed(q.legendItemFocused,t)).style("opacity",function(){return t?null:i.opacityForUnfocusedLegend.call(i,(0,w.select)(this))})},revertLegend(){const e=this,{$el:{legend:t},$T:i}=e;t&&i(t.selectAll(`.${Y.legendItem}`).classed(q.legendItemFocused,!1)).style("opacity",null)},showLegend(e){const t=this,{config:i,$el:s,$T:n}=t;i.legend_show||(i.legend_show=!0,s.legend?s.legend.style("visibility",null):t.initLegend(),!t.state.legendHasRendered&&t.updateLegend()),t.removeHiddenLegendIds(e),n(s.legend.selectAll(t.selectorLegends(e)).style("visibility",null)).style("opacity",null)},hideLegend(e){const t=this,{config:i,$el:{legend:s}}=t;i.legend_show&&wt(e)&&(i.legend_show=!1,s.style("visibility","hidden")),t.addHiddenLegendIds(e),s.selectAll(t.selectorLegends(e)).style("opacity","0").style("visibility","hidden")},getLegendItemTextBox(e,t){const i=this,{cache:s,state:n}=i;let a;const o=_t.legendItemTextBox;return e&&(a=!n.redrawing&&s.get(o)||{},a[e]||(a[e]=i.getTextRect(t,Y.legendItem),s.add(o,a)),a=a[e]),a},setLegendItem(e){const t=this,{$el:i,api:s,config:n,state:a}=t,o=a.inputType==="touch",r=t.hasType("gauge"),l=n.boost_useCssRule,c=n.legend_item_interaction;e.attr("class",function(u){const d=(0,w.select)(this);return(!d.empty()&&d.attr("class")||"")+t.generateClass(Y.legendItem,u)}).style("visibility",u=>t.isLegendToShow(u)?null:"hidden"),n.interaction_enabled&&(l&&[[`.${Y.legendItem}`,"cursor:pointer"],[`.${Y.legendItem} text`,"pointer-events:none"],[`.${Y.legendItemPoint} text`,"pointer-events:none"],[`.${Y.legendItemTile}`,"pointer-events:none"],[`.${Y.legendItemEvent}`,"fill-opacity:0"]].forEach(u=>{const[d,h]=u;t.setCssRule(!1,d,[h])(i.legend)}),e.on(c.dblclick?"dblclick":"click",c||L(n.legend_item_onclick)?function(u,d){if(!K(n.legend_item_onclick,s,d,!a.hiddenTargetIds.includes(d))){const{altKey:h,target:g,type:f}=u;f==="dblclick"||h?a.hiddenTargetIds.length&&g.parentNode.getAttribute("class").indexOf(Y.legendItemHidden)===-1?s.show():(s.hide(),s.show(d)):(s.toggle(d),(0,w.select)(this).classed(q.legendItemFocused,!1))}o&&t.hideTooltip()}:null),!o&&e.on("mouseout",c||L(n.legend_item_onout)?function(u,d){K(n.legend_item_onout,s,d,!a.hiddenTargetIds.includes(d))||((0,w.select)(this).classed(q.legendItemFocused,!1),r&&t.undoMarkOverlapped(t,`.${yt.gaugeValue}`),t.api.revert())}:null).on("mouseover",c||L(n.legend_item_onover)?function(u,d){K(n.legend_item_onover,s,d,!a.hiddenTargetIds.includes(d))||((0,w.select)(this).classed(q.legendItemFocused,!0),r&&t.markOverlapped(d,t,`.${yt.gaugeValue}`),!a.transiting&&t.isTargetToShow(d)&&s.focus(d))}:null),!e.empty()&&e.on("click mouseout mouseover")&&e.style("cursor",t.getStylePropValue("pointer")))},updateLegendElement(e,t){const i=this,{config:s,state:n,$el:{legend:a},$T:o}=i,l=s.legend_item_tile_type!=="circle",c=s.legend_item_tile_r,u={width:l?s.legend_item_tile_width:c*2,height:l?s.legend_item_tile_height:c*2},d={padding:{top:4,right:10},max:{width:0,height:0},posMin:10,step:0,tileWidth:u.width+5,totalLength:0},h={offsets:{},widths:{},heights:{},margins:[0],steps:{}};let g,f,p;const _=e.filter(y=>!H(s.data_names[y])||s.data_names[y]!==null),x=t.withTransition,m=i.getUpdateLegendPositions(_,d,h);n.isLegendInset&&(d.step=s.legend_inset_step?s.legend_inset_step:_.length,i.updateLegendStep(d.step)),n.isLegendRight?(g=y=>d.max.width*h.steps[y],f=y=>h.margins[h.steps[y]]+h.offsets[y]):n.isLegendInset?(g=y=>d.max.width*h.steps[y]+10,f=y=>h.margins[h.steps[y]]+h.offsets[y]):(g=y=>h.margins[h.steps[y]]+h.offsets[y],f=y=>d.max.height*h.steps[y]);const $={xText:(y,T)=>g(y,T)+4+u.width,xRect:(y,T)=>g(y,T),x1Tile:(y,T)=>g(y,T)-2,x2Tile:(y,T)=>g(y,T)-2+u.width,yText:(y,T)=>f(y,T)+9,yRect:(y,T)=>f(y,T)-5,yTile:(y,T)=>f(y,T)+4};i.generateLegendItem(_,u,m,$),p=a.select(`.${Y.legendBackground} rect`),n.isLegendInset&&d.max.width>0&&p.size()===0&&(p=a.insert("g",`.${Y.legendItem}`).attr("class",Y.legendBackground).append("rect")),s.legend_tooltip&&a.selectAll("title").data(_).text(y=>He.bind(i)(y,!1));const b=a.selectAll("text").data(_).text(y=>He.bind(i)(y)).each(function(y,T){m(this,y,T)});o(b,x).attr("x",$.xText).attr("y",$.yText);const v=a.selectAll(`rect.${Y.legendItemEvent}`).data(_);o(v,x).attr("width",y=>h.widths[y]).attr("height",y=>h.heights[y]).attr("x",$.xRect).attr("y",$.yRect),i.updateLegendItemPos(_,x,$),p&&o(p,x).attr("height",i.getLegendHeight()-12).attr("width",d.max.width*(d.step+1)+10),i.updateLegendItemWidth(d.max.width),i.updateLegendItemHeight(d.max.height),i.updateLegendStep(d.step)},getUpdateLegendPositions(e,t,i){const s=this,{config:n,state:a}=s,o=a.isLegendRight||a.isLegendInset;return function(r,l,c){const u=c===0,d=c===e.length-1,h=s.getLegendItemTextBox(l,r),g=h.width+t.tileWidth+(d&&!o?0:t.padding.right)+n.legend_padding,f=h.height+t.padding.top,p=o?f:g,_=o?s.getLegendHeight():s.getLegendWidth();let x;const m=function(b,v){v||(x=(_-t.totalLength-p)/2,x<t.posMin&&(x=(_-p)/2,t.totalLength=0,t.step++)),i.steps[b]=t.step,i.margins[t.step]=a.isLegendInset?10:x,i.offsets[b]=t.totalLength,t.totalLength+=p};if(u&&(t.totalLength=0,t.step=0,t.max.width=0,t.max.height=0),n.legend_show&&!s.isLegendToShow(l)){i.widths[l]=0,i.heights[l]=0,i.steps[l]=0,i.offsets[l]=0;return}i.widths[l]=g,i.heights[l]=f,(!t.max.width||g>=t.max.width)&&(t.max.width=g),(!t.max.height||f>=t.max.height)&&(t.max.height=f);const $=o?t.max.height:t.max.width;n.legend_equally?(Object.keys(i.widths).forEach(b=>i.widths[b]=t.max.width),Object.keys(i.heights).forEach(b=>i.heights[b]=t.max.height),x=(_-$*e.length)/2,x<t.posMin?(t.totalLength=0,t.step=0,e.forEach(b=>m(b))):m(l,!0)):m(l)}},generateLegendItem(e,t,i,s){const n=this,{config:a,state:o,$el:{legend:r}}=n,l=a.legend_usePoint,c=a.legend_item_tile_r,u=a.legend_item_tile_type,d=u!=="circle",h=o.isLegendRight||o.isLegendInset,g=-200,f=r.selectAll(`.${Y.legendItem}`).data(e).enter().append("g");if(n.setLegendItem(f),a.legend_tooltip&&f.append("title").text(p=>p),f.append("text").text(p=>He.bind(n)(p)).each(function(p,_){i(this,p,_)}).style("pointer-events",n.getStylePropValue("none")).attr("x",h?s.xText:g).attr("y",h?g:s.yText),f.append("rect").attr("class",Y.legendItemEvent).style("fill-opacity",n.getStylePropValue("0")).attr("x",h?s.xRect:g).attr("y",h?g:s.yRect),l){const p=[];f.append(_=>{const x=nt(a.point_pattern)?a.point_pattern:[a.point_type];p.indexOf(_)===-1&&p.push(_);let m=x[p.indexOf(_)%x.length];return m==="rectangle"&&(m="rect"),lt.createElementNS(w.namespaces.svg,"hasValidPointType"in n&&n.hasValidPointType(m)?m:"use")}).attr("class",Y.legendItemPoint).style("fill",Re.bind(n)).style("pointer-events",n.getStylePropValue("none")).attr("href",(_,x,m)=>{const b=m[x].nodeName.toLowerCase(),v=n.getTargetSelectorSuffix(_);return b==="use"?`#${o.datetimeId}-point${v}`:void 0})}else f.append(d?"line":u).attr("class",Y.legendItemTile).style("stroke",Re.bind(n)).style("pointer-events",n.getStylePropValue("none")).call(p=>{u==="circle"?p.attr("r",c).style("fill",Re.bind(n)).attr("cx",h?s.x2Tile:g).attr("cy",h?g:s.yTile):d&&p.attr("stroke-width",t.height).attr("x1",h?s.x1Tile:g).attr("y1",h?g:s.yTile).attr("x2",h?s.x2Tile:g).attr("y2",h?g:s.yTile)})},updateLegendItemPos(e,t,i){const s=this,{config:n,$el:{legend:a},$T:o}=s,r=n.legend_usePoint,l=n.legend_item_tile_type,c=l!=="circle";if(r){const u=a.selectAll(`.${Y.legendItemPoint}`).data(e);o(u,t).each(function(){const d=this.nodeName.toLowerCase(),h=n.point_r;let g="x",f="y",p=2,_=2.5,x=null,m=null,$=null;if(d==="circle"){const b=h*.2;g="cx",f="cy",x=h+b,p=h*2,_=-b}else if(d==="rect"){const b=h*2.5;m=b,$=b,_=3}(0,w.select)(this).attr(g,b=>i.x1Tile(b)+p).attr(f,b=>i.yTile(b)-_).attr("r",x).attr("width",m).attr("height",$)})}else{const u=a.selectAll(`.${Y.legendItemTile}`).data(e);o(u,t).style("stroke",Re.bind(s)).call(d=>{l==="circle"?d.attr("cx",h=>{const g=i.x2Tile(h);return g-(g-i.x1Tile(h))/2}).attr("cy",i.yTile):c&&d.attr("x1",i.x1Tile).attr("y1",i.yTile).attr("x2",i.x2Tile).attr("y2",i.yTile)})}}},ra=U(8),la={redraw(e={}){var t,i,s,n;const a=this,{config:o,state:r,$el:l}=a,{main:c,treemap:u}=l;r.redrawing=!0;const d=a.filterTargetsToShow(a.data.targets),{flow:h,initializing:g}=e,f=a.getWithOption(e),p=f.Transition?o.transition_duration:0,_=f.TransitionForExit?p:0,x=f.TransitionForAxis?p:0,m=(t=a.axis)==null?void 0:t.generateTransitions(x);a.updateSizes(g),f.Legend&&o.legend_show?(e.withTransition=!!p,!u&&a.updateLegend(a.mapToIds(a.data.targets),e,m)):f.Dimension&&a.updateDimension(!0),o.data_empty_label_text&&c.select(`text.${rt.text}.${I.empty}`).attr("x",r.width/2).attr("y",r.height/2).text(o.data_empty_label_text).style("display",d.length?"none":null),r.hasAxis?(a.axis.redrawAxis(d,f,m,h,g),a.hasGrid()&&a.updateGrid(),o.regions.length&&a.updateRegion(),["bar","candlestick","line","area"].forEach($=>{const b=pt($);(/^(line|area)$/.test($)&&a.hasTypeOf(b)||a.hasType($))&&a[`update${b}`](f.TransitionForExit)}),l.text&&c.selectAll(`.${Q.selectedCircles}`).filter(a.isBarType.bind(a)).selectAll("circle").remove(),o.interaction_enabled&&!h&&f.EventRect&&(a.redrawEventRect(),(i=a.bindZoomEvent)==null||i.call(a))):(l.arcs&&a.redrawArc(p,_,f.Transform),l.radar&&a.redrawRadar(),l.polar&&a.redrawPolar(),l.funnel&&a.redrawFunnel(),u&&a.updateTreemap(_)),!r.resizing&&!u&&(a.hasPointType()||r.hasRadar)?a.updateCircle():(s=a.hasLegendDefsPoint)!=null&&s.call(a)&&a.data.targets.forEach(a.point("create",this)),a.hasDataLabel()&&!a.hasArcType(null,["radar"])&&a.updateText(),(n=a.redrawTitle)==null||n.call(a),g&&a.updateTypesElements(),a.generateRedrawList(d,h,p,f.Subchart),a.updateTooltipOnRedraw(),a.callPluginHook("$redraw",e,p)},generateRedrawList(e,t,i,s){const n=this,{config:a,state:o}=n,r=n.getDrawShape();o.hasAxis&&a.subchart_show&&n.redrawSubchart(s,i,r);const l=t&&n.generateFlow({targets:e,flow:t,duration:t.duration,shape:r,xv:n.xv.bind(n)}),c=(i||l)&&ge(),u=n.getRedrawList(r,t,l,c),d=()=>{l&&l(),o.redrawing=!1,K(a.onrendered,n.api)};if(d)if(c&&u.length){const h=Ai();(0,ra.transition)().duration(i).each(()=>{u.reduce((g,f)=>g.concat(f),[]).forEach(g=>h.add(g))}).call(h,d)}else o.transiting||d();n.mapToIds(n.data.targets).forEach(h=>{o.withoutFadeIn[h]=!0})},getRedrawList(e,t,i,s){const n=this,{config:a,state:{hasAxis:o,hasRadar:r,hasTreemap:l},$el:{grid:c}}=n,{cx:u,cy:d,xForText:h,yForText:g}=e.pos,f=[];return o&&((a.grid_x_lines.length||a.grid_y_lines.length)&&f.push(n.redrawGrid(s)),a.regions.length&&f.push(n.redrawRegion(s)),Object.keys(e.type).forEach(p=>{const _=pt(p),x=e.type[p];(/^(area|line)$/.test(p)&&n.hasTypeOf(_)||n.hasType(p))&&f.push(n[`redraw${_}`](x,s))}),!t&&c.main&&f.push(n.updateGridFocus())),(!n.hasArcType()||r)&&nt(a.data_labels)&&a.data_labels!==!1&&f.push(n.redrawText(h,g,t,s)),(n.hasPointType()||r)&&!n.isPointFocusOnly()&&n.redrawCircle&&f.push(n.redrawCircle(u,d,s,i)),l&&f.push(n.redrawTreemap(s)),f},updateAndRedraw(e={}){const t=this,{config:i,state:s}=t;let n;e.withTransition=zt(e,"withTransition",!0),e.withTransform=zt(e,"withTransform",!1),e.withLegend=zt(e,"withLegend",!1),e.withUpdateXDomain=!0,e.withUpdateOrgXDomain=!0,e.withTransitionForExit=!1,e.withTransitionForTransform=zt(e,"withTransitionForTransform",e.withTransition),e.withLegend&&i.legend_show||(s.hasAxis&&(n=t.axis.generateTransitions(e.withTransitionForAxis?i.transition_duration:0)),t.updateScales(),t.updateSvgSize(),t.transformAll(e.withTransitionForTransform,n)),t.redraw(e,n)}};function jt(e="linear",t,i){const s={linear:Mt.scaleLinear,log:Mt.scaleSymlog,_log:Mt.scaleLog,time:Mt.scaleTime,utc:Mt.scaleUtc}[e]();return s.type=e,/_?log/.test(e)&&s.clamp(!0),s.range([t!=null?t:0,i!=null?i:1])}var ca={getXScale(e,t,i,s){const n=this,a=n.state.loading!=="append"&&n.scale.zoom||jt(n.axis.getAxisType("x"),e,t);return n.getCustomizedXScale(i?a.domain(i):a,s)},getYScale(e,t,i,s){const a=jt(this.axis.getAxisType(e),t,i);return s&&a.domain(s),a},getYScaleById(e,t=!1){var i;const s=((i=this.axis)==null?void 0:i.getId(e))==="y2",n=t?s?"subY2":"subY":s?"y2":"y";return this.scale[n]},getCustomizedXScale(e,t){const i=this,s=t||(()=>i.axis.x.tickOffset()),n=i.config.axis_x_inverted,a=function(o){return e(o)+s()};for(const o in e)a[o]=e[o];return a.orgDomain=()=>e.domain(),a.orgScale=()=>e,i.axis.isCategorized()&&(a.domain=function(o){let r=o;return arguments.length?(e.domain(r),a):(r=this.orgDomain(),n?[r[0]+1,r[1]]:[r[0],r[1]+1])}),a},updateScales(e,t=!0){var i,s;const n=this,{axis:a,config:o,format:r,org:l,scale:c,state:{current:u,width:d,height:h,width2:g,height2:f,hasAxis:p,hasTreemap:_}}=n;if(p){const x=o.axis_rotated,m=n.getResettedPadding(1),$={x:x?m:0,y:x?0:h,subX:x?1:0,subY:x?0:f},b={x:x?h:d,y:x?d:m,subX:x?h:d,subY:x?g:1},v=t&&((i=c.x)==null?void 0:i.orgDomain()),y=t&&l.xDomain;c.x=n.getXScale($.x,b.x,v,()=>a.x.tickOffset()),c.subX=n.getXScale($.x,b.x,y,T=>{var C;return T%1?0:((C=a.subX)!=null?C:a.x).tickOffset()}),r.xAxisTick=a.getXAxisTickFormat(),r.subXAxisTick=a.getXAxisTickFormat(!0),a.setAxis("x",c.x,o.axis_x_tick_outer,e),o.subchart_show&&a.setAxis("subX",c.subX,o.axis_x_tick_outer,e),c.y=n.getYScale("y",$.y,b.y,c.y?c.y.domain():o.axis_y_default),c.subY=n.getYScale("y",$.subY,b.subY,c.subY?c.subY.domain():o.axis_y_default),a.setAxis("y",c.y,o.axis_y_tick_outer,e),o.axis_y2_show&&(c.y2=n.getYScale("y2",$.y,b.y,c.y2?c.y2.domain():o.axis_y2_default),c.subY2=n.getYScale("y2",$.subY,b.subY,c.subY2?c.subY2.domain():o.axis_y2_default),a.setAxis("y2",c.y2,o.axis_y2_tick_outer,e))}else if(_){const x=n.getCurrentPadding();c.x=(0,Mt.scaleLinear)().rangeRound([x.left,u.width-x.right]),c.y=(0,Mt.scaleLinear)().rangeRound([x.top,u.height-x.bottom])}else(s=n.updateArc)==null||s.call(n)},xx(e){const t=this,{config:i,scale:{x:s,zoom:n}}=t,a=i.zoom_enabled&&n?n:s;return e?a(M(e.x)?e.x:e):null},xv(e){const t=this,{axis:i,config:s,scale:{x:n,zoom:a}}=t,o=s.zoom_enabled&&a?a:n;let r=t.getBaseValue(e);return i.isTimeSeries()?r=vt.call(t,r):i.isCategorized()&&X(r)&&(r=s.axis_x_categories.indexOf(r)),o(r)},yv(e){const t=this,{scale:{y:i,y2:s}}=t;return(e.axis&&e.axis==="y2"?s:i)(t.getBaseValue(e))},subxx(e){return e?this.scale.subX(e.x):null}},da={setContainerSize(){const e=this,{state:t}=e;t.current.width=e.getCurrentWidth(),t.current.height=e.getCurrentHeight()},getCurrentWidth(){const e=this;return e.config.size_width||e.getParentWidth()},getCurrentHeight(){const e=this,{config:t}=e,i=t.size_height||e.getParentHeight();return i>0?i:320/(e.hasType("gauge")&&!t.gauge_fullCircle?2:1)},getParentRectValue(e){const t=`offset${pt(e)}`;let i=this.$el.chart.node(),s=0;for(;s<30&&i&&i.tagName!=="BODY";){try{s=ct(i,!0)[e]}catch(a){t in i&&(s=i[t])}i=i.parentNode}const n=lt.body[t];return s>n&&(s=n),s},getParentWidth(){return this.getParentRectValue("width")},getParentHeight(){const e=this.$el.chart.style("height");let t=0;return e&&(t=/px$/.test(e)?parseInt(e,10):this.getParentRectValue("height")),t},getSvgLeft(e){const t=this,{config:i,state:{hasAxis:s},$el:n}=t,a=i.axis_rotated,o=a||!a&&!i.axis_y_inner,r=a?ot.axisX:ot.axisY,l=n.main.select(`.${r}`).node(),c=s&&i[`axis_${a?"x":"y"}_label`];let u=0;if(s&&(X(c)||X(c.text)||/^inner-/.test(c==null?void 0:c.position))){const p=n.main.select(`.${r}-label`);p.empty()||(u=ct(p.node()).left)}const d=l&&o?ct(l,!e):{right:0},h=ct(n.chart.node(),!e).left+u,g=t.hasArcType(),f=d.right-h-(g?0:t.getCurrentPaddingByDirection("left",e));return f>0?f:0},updateDimension(e){var t;const i=this,{config:s,state:{hasAxis:n},$el:a}=i;n&&!e&&i.axis.x&&s.axis_rotated&&((t=i.axis.subX)==null||t.create(a.axis.subX)),i.updateScales(e),i.updateSvgSize(),i.transformAll(!1)},updateSvgSize(){const e=this,{config:t,state:{clip:i,current:s,hasAxis:n,width:a,height:o},$el:{svg:r}}=e;if(t.resize_auto==="viewBox"?r.attr("viewBox",`0 0 ${s.width} ${s.height}`):r.attr("width",s.width).attr("height",s.height),n){const l=r.select(`.${ai.brush} .overlay`),c={width:0,height:0};l.size()&&(c.width=+l.attr("width"),c.height=+l.attr("height")),r.selectAll([`#${i.id}`,`#${i.idGrid}`]).select("rect").attr("width",a).attr("height",o),r.select(`#${i.idXAxis}`).select("rect").call(e.setXAxisClipPath.bind(e)),r.select(`#${i.idYAxis}`).select("rect").call(e.setYAxisClipPath.bind(e)),i.idSubchart&&r.select(`#${i.idSubchart}`).select("rect").attr("width",a).attr("height",c.height)}},getCurrentPaddingByDirection(e,t=!1,i=!1){var s;const n=this,{config:a,$el:o,state:{hasAxis:r}}=n,l=a.axis_rotated,c=((s=a.padding)==null?void 0:s.mode)==="fit",u=O(a[`padding_${e}`])?a[`padding_${e}`]:void 0,d=r?{top:l?"y2":null,bottom:l?"y":"x",left:l?"x":"y",right:l?null:"y2"}[e]:null,h=/^(left|right)$/.test(e),g=d&&a[`axis_${d}_inner`],f=d&&a[`axis_${d}_show`],p=d?a[`axis_${d}_axes`].length:0;let _=d?h?n.getAxisWidthByAxisId(d,t):n.getHorizontalAxisHeight(d):0;const x=20;let m=0;!c&&h&&(_=xn(_));let $=r&&h&&(g||st(u)&&!f)?0:c?(f?_:0)+(u!=null?u:0):st(u)?_:u;return h&&r?(d&&(c||g)&&a[`axis_${d}_label`].text&&($+=n.axis.getAxisLabelPosition(d).isOuter?x:0),e==="right"?($+=l?!c&&st(u)?10:2:!f||g?c?2:1:0,$+=i?n.axis.getXAxisTickTextY2Overflow(x):0):e==="left"&&l&&st(u)&&($=a.axis_x_show?c?_:Math.max(_,40):1)):e==="top"?(o.title&&o.title.node()&&($+=n.getTitlePadding()),m=l&&!g?p:0):e==="bottom"&&r&&l&&!f&&($+=1),$+_*p-m},getCurrentPadding(e=!1){const t=this,[i,s,n,a]=["top","bottom","left","right"].map(o=>t.getCurrentPaddingByDirection(o,null,e));return{top:i,bottom:s,left:n,right:a}},getResettedPadding(e){const t=this,{config:i}=t,s=O(e);let n=s?0:{};return i.padding===!1?!s&&Object.keys(e).forEach(a=>{n[a]=!wt(i.data_labels)&&i.data_labels!==!1&&a==="top"?e[a]:0}):n=e,n},updateSizes(e){var t,i,s,n,a;const o=this,{config:r,state:l,$el:{legend:c}}=o,u=r.axis_rotated,d=o.hasArcType()||l.hasFunnel||l.hasTreemap,h=((t=r.padding)==null?void 0:t.mode)==="fit";!e&&o.setContainerSize();const g={width:c?o.getLegendWidth():0,height:c?o.getLegendHeight():0};!d&&r.axis_x_show&&r.axis_x_tick_autorotate&&o.updateXAxisTickClip();const f={right:r.legend_show&&l.isLegendRight?o.getLegendWidth()+(h?0:20):0,bottom:!r.legend_show||l.isLegendRight||l.isLegendInset?0:g.height},p=u||d?0:o.getHorizontalAxisHeight("x"),_=r.subchart_axis_x_show&&r.subchart_axis_x_tick_text_show?p:30,x=r.subchart_show&&!d?r.subchart_size_height+_:0,m=o.hasType("gauge")&&r.arc_needle_show&&!r.gauge_fullCircle&&!r.gauge_label_show?10:0,$=o.getCurrentPadding(!0);if(l.margin=!d&&u?{top:$.top,right:d?0:$.right+f.right,bottom:f.bottom+$.bottom,left:x+(d?0:$.left)}:{top:(h?0:4)+$.top,right:d?0:$.right+f.right,bottom:m+x+f.bottom+$.bottom,left:d?0:$.left},l.margin=o.getResettedPadding(l.margin),l.margin2=u?{top:l.margin.top,right:NaN,bottom:20+f.bottom,left:o.state.rotatedPadding.left}:{top:l.current.height-x-f.bottom,right:NaN,bottom:_+f.bottom,left:l.margin.left},l.margin3={top:0,right:NaN,bottom:0,left:0},(i=o.updateSizeForLegend)==null||i.call(o,g),l.width=l.current.width-l.margin.left-l.margin.right,l.height=l.current.height-l.margin.top-l.margin.bottom,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l.width2=u?l.margin.left-l.rotatedPadding.left-l.rotatedPadding.right:l.width,l.height2=u?l.height:l.current.height-l.margin2.top-l.margin2.bottom,l.width2<0&&(l.width2=0),l.height2<0&&(l.height2=0),o.hasArcType()){const b=o.hasType("gauge"),v=r.legend_show&&l.isLegendRight,y=(s=l.hasRadar&&o.cache.get(_t.radarTextWidth))!=null?s:0;l.arcWidth=l.width-(v?g.width+10:0)-y,l.arcHeight=l.height-(v&&!b?0:10),(n=r.arc_rangeText_values)!=null&&n.length&&(b?(l.arcWidth-=25,l.arcHeight-=10,l.margin.left+=10):(l.arcHeight-=20,l.margin.top+=10)),b&&!r.gauge_fullCircle&&(l.arcHeight+=l.height-o.getPaddingBottomForGauge()),(a=o.updateRadius)==null||a.call(o)}l.isLegendRight&&d&&(l.margin3.left=l.arcWidth/2+l.radiusExpanded*1.1)}},ua={setCssRule(e,t,i,s){const n=this,{config:a,state:{cssRule:o,style:r}}=n;return a.boost_useCssRule?l=>{l.each(c=>{const u=s&&(s==null?void 0:s.call(n,c)),d=`${e?`.${it.shapes+n.getTargetSelectorSuffix(c.id)}`:""}${t}`;t in o&&r.sheet.deleteRule(o[d]),n.state.cssRule[d]=yn(r,d,i.filter(Boolean).map(h=>X(u)&&h.indexOf(":")===-1?`${h}: ${u}`:h||""))})}:()=>{}},getStylePropValue(e){const{config:{boost_useCssRule:t}}=this;return t?null:L(e)?e.bind(this):e}};function ha(e){let t="middle";return e>0&&e<=170?t="end":e>190&&e<=360&&(t="start"),t}function ga(e,t,i,s,n){var a;const o=this,{value:r}=e,l=o.isCandlestickType(e),c=O(r)&&r<0||l&&!((a=o.getCandlestickData(e))!=null&&a._isUp);let{x:u,y:d}=t;const h=4,g=h*2;return s?i==="start"?(u+=c?0:g,d+=h):i==="middle"?(u+=g,d-=g):i==="end"&&(c&&(u-=g),d+=h):(i==="start"?(u+=h,c&&(d+=g*2)):i==="middle"?d-=g:i==="end"&&(u-=h,c&&(d+=g*2)),n&&(d+=c?-17:l?13:7)),{x:u,y:d}}function Li(e,t){var i;const s=this.config.data_labels_position,{id:n,index:a,value:o}=e;return(i=L(s)?s.bind(this.api)(t,o,n,a,this.$el.text):(n in s?s[n]:s)[t])!=null?i:0}function fa(e,t,i){var s,n;const a=this,{config:o,$T:r}=a,l=o.axis_rotated,{border:{padding:c="3 5",radius:u=10,stroke:d="#000",strokeWidth:h=1,fill:g="none"}}=o.data_labels,f=wn(c),p=o.data_labels.border!==!0,_=Kt(e);let x=(0,w.select)(e.previousElementSibling);(x.empty()||((s=x.node())==null?void 0:s.tagName)!=="rect"||!((n=x.attr("class"))!=null&&n.includes(i)))&&(x=(0,w.select)(e.parentNode).insert("rect",()=>e).attr("class",`${rt.textBorderRect} ${i}`).attr("width",_.width+(p?f.left+f.right:0)).attr("height",_.height+(p?f.top+f.bottom:0)),p&&x.style("fill",g).style("stroke",d).style("stroke-width",`${h}px`).attr("rx",u).attr("ry",u)),r(x).attr("x",t.x-(p?f.left:0)-(l?0:_.width/2)).attr("y",t.y-(p?f.top:0)-_.height/4*3.2)}function We(e=0,t){const i=this,{config:s}=i,n=s[`${t}_label_threshold`]||0;return e>=n}function Pi(){const e=this,{$el:{text:t},config:i}=e;(e.state.arcWidth?e.getArcLabelConfig("image"):i.data_labels.image)&&t.filter(function(){const n=this.previousElementSibling;return n?n.tagName!=="image"||!n.classList.contains(rt.textLabelImage):!0}).each(function(n){var a,o,r,l;const{url:c,width:u,height:d,pos:h}=pa.call(e,n);if(c){const g=(0,w.select)(this.parentNode);g==null||g.insert("image",`${(o=(a=this.getAttribute("class"))==null?void 0:a.replace(/(?:^(.)|\s)/g,".$1"))!=null?o:"text"}`).style("opacity","0").attr("href",f=>he(c,{ID:"id"in f?f.id:f.data.id})).attr("class",rt.textLabelImage).style("pointer-events","none").attr("width",u).attr("height",d).attr("transform",h?`translate(${(r=h.x)!=null?r:0} ${(l=h.y)!=null?l:0})`:null)}})}function pa(e){var t;const i=this,{config:s,state:n}=i,a=n.arcWidth?i.getArcLabelConfig("image"):s.data_labels.image;if(L(a))return(t=a.call(i.api,e.value,e.id,e.index))!=null?t:{url:"",width:0,height:0,pos:{x:0,y:0}};if(a){const{url:o="",width:r=0,height:l=0,pos:c}=a;return{url:o,width:r,height:l,pos:c}}return null}function Oi(e,t){var i;const s=this,{config:n,state:{arcWidth:a,hasTreemap:o}}=s,r=n.axis_rotated,l=(0,w.select)(e.previousElementSibling),c=u=>{var d;const h=u.style.opacity!=="0"&&u.style.fillOpacity!=="0";return(a?u.textContent:h)&&((d=this.previousElementSibling)==null?void 0:d.tagName)!=="image"};if(!l.empty()&&((i=l.node())==null?void 0:i.tagName)==="image"){const u=ct(e),d=+l.attr("width")/2,h=+l.attr("height")/2;let g=t.x-d,f=t.y-h-u.height/2;r?t.x+=d:(o&&(g=-d,f=-(h*2+u.height)),s.hasType("pie")||s.hasType("polar")||(t.y+=h)),s.$T(l).style("opacity",c(e)?null:"0").attr("x",g).attr("y",f)}}var xa={opacityForText(e){const t=this;return t.isBarType(e)&&!We.call(t,Math.abs(t.getRatio("bar",e)),"bar")?"0":t.hasDataLabel?null:"0"},initText(){const{$el:e}=this;e.main.select(`.${I.chart}`).append("g").attr("class",rt.chartTexts).style("pointer-events",e.funnel||e.treemap?"none":null)},updateTargetsForText(e){const t=this,i=t.getChartClass("Text"),s=t.getClass("texts","id"),n=t.classFocus.bind(t);t.$el.main.select(`.${rt.chartTexts}`).selectAll(`.${rt.chartText}`).data(t.filterNullish(e)).attr("class",r=>`${i(r)}${n(r)}`.trim()).enter().append("g").style("opacity","0").attr("class",i).call(t.setCssRule(!0,` .${rt.text}`,["fill","pointer-events:none"],t.updateTextColor)).append("g").attr("class",s)},updateText(){const e=this,{$el:t,$T:i,config:s,axis:n}=e,a=e.getClass("text","index"),o=s.data_labels.centered,r=t.main.selectAll(`.${rt.texts}`).selectAll(`.${rt.text}`).data(e.labelishData.bind(e));i(r.exit()).style("fill-opacity","0").remove(),t.text=r.enter().append("text").merge(r).attr("class",a).attr("text-anchor",l=>{let u=s[`axis_${n==null?void 0:n.getId(l.id)}_inverted`]?l.value>0:l.value<0;if(e.isCandlestickType(l)){const d=e.getCandlestickData(l);u=!(d!=null&&d._isUp)}else if(e.isTreemapType(l))return o?"middle":"start";return s.axis_rotated?u?"end":"start":"middle"}).style("fill",e.getStylePropValue(e.updateTextColor)).style("fill-opacity","0").each(function(l,c,u){const d=(0,w.select)(this);let{value:h}=l;if(e.isBubbleZType(l))h=e.getBubbleZData(h,"z");else if(e.isCandlestickType(l)){const g=e.getCandlestickData(l);g&&(h=g.close)}h=e.isTreemapType(l)?e.treemapDataLabelFormat(l)(d):e.dataLabelFormat(l.id)(h,l.id,l.index,u),O(h)?this.textContent=h:ue(d,h)}),Pi.call(e)},updateTextColor(e){const t=this,{config:i}=t,s=i.data_labels_colors,n=t.isArcType(e)&&!t.isRadarType(e)||t.isFunnelType(e)||t.isTreemapType(e)?null:t.color(e);let a;if(X(s))a=s;else if(B(s)){const{id:o}=e.data||e;a=s[o]}else L(s)&&(a=s.bind(t.api)(n,e));if(t.isCandlestickType(e)&&!L(s)){const o=t.getCandlestickData(e);if(!(o!=null&&o._isUp)){const r=i.candlestick_color_down;a=B(r)?r[e.id]:r}}return a||n},updateTextBGColor(e,t){const i=this,{$el:{defs:s}}=i;let n="";if(t){const a=X(t)?"":i.getTargetSelectorSuffix("id"in e?e.id:e.data.id),o=s.select(["filter[id*='labels-bg","']"].join(a));if(o.size()&&(n=`url(#${o.attr("id")})`),L(t)){i.generateTextBGColorFilter(t);const r=i.color(e),l=t.bind(i.api)(r,e);l?o.select("feFlood").attr("flood-color",l):n=""}}return n||null},redrawText(e,t,i,s){const n=this,{$T:a,axis:o,config:r,state:{hasTreemap:l}}=n,c=Ct(!0),u=r.axis_rotated,d=r.data_labels.rotate,h=ha(d),g=d?`rotate(${d})`:"";return n.$el.text.style("fill",n.getStylePropValue(n.updateTextColor)).attr("filter",f=>n.updateTextBGColor.bind(n)(f,r.data_labels_backgroundColors)).style("fill-opacity",i?0:n.opacityForText.bind(n)).each(function(f,p){const _=a(l&&this.childElementCount?this.parentNode:this,!!(s&&(this.getAttribute("x")||this.getAttribute("transform"))),c),x=r[`axis_${o==null?void 0:o.getId(f.id)}_inverted`];let m={x:e.bind(this)(f,p),y:t.bind(this)(f,p)};d&&(m=ga.bind(n)(f,m,h,u,x),_.attr("text-anchor",h)),Oi.call(n,this,m),this.childElementCount||d?_.attr("transform",`translate(${m.x} ${m.y}) ${g}`):_.attr("x",m.x).attr("y",m.y),r.data_labels.border&&fa.call(n,_.node(),m,`${rt.textBorderRect}-${p}`)}),!0},getTextRect(e,t){var i,s;const n=this;let a,o,r;Array.isArray(e)?a=`${_t.textRect}-${e.join("_")}`:(o=(s=(i=e.node)==null?void 0:i.call(e))!=null?s:e,/text/i.test(o.tagName)||(o=o.querySelector("text")),r=o.textContent,a=`${_t.textRect}-${r.replace(/\W/g,"_")}`);const l=n.cache.get(a)||[];return l.length===0&&((n.$el.svg||n.$el.chart.select("svg")).selectAll(`.${I.dummy}`).data(r?[r]:e).enter().append("text").style("visibility","hidden").style("font",o?(0,w.select)(o).style("font"):null).classed(t||I.dummy,!0).text(c=>c).each(function(c,u){l[u]=ct(this)}).remove(),n.cache.add(a,l)),l.length>1?l:l[0]},generateXYForText(e,t){const i=this,{state:{hasRadar:s,hasFunnel:n,hasTreemap:a}}=i,o=Object.keys(e),r={},l=t?i.getXForText:i.getYForText;return n&&o.push("funnel"),s&&o.push("radar"),a&&o.push("treemap"),o.forEach(c=>{r[c]=i[`generateGet${pt(c)}Points`](e[c],!1)}),function(c,u){const d=i.isAreaType(c)&&"area"||i.isBarType(c)&&"bar"||i.isCandlestickType(c)&&"candlestick"||i.isFunnelType(c)&&"funnel"||i.isRadarType(c)&&"radar"||i.isTreemapType(c)&&"treemap"||"line";return l.call(i,r[d](c,u),c,this)}},getCenteredTextPos(e,t,i,s){const n=this,{config:a}=n,o=a.axis_rotated,r=n.isBarType(e),l=n.isTreemapType(e);if(a.data_labels.centered&&(r||l)){const c=ct(i);if(r){const u=n.getRangedData(e,null,"bar")>=0;if(o){const d=(u?t[1][1]-t[0][1]:t[0][1]-t[1][1])/2+c.width/2;return u?-d-3:d+2}else{const d=(u?t[0][1]-t[1][1]:t[1][1]-t[0][1])/2+c.height/2;return u?d:-d-2}}else if(l)return s==="x"?(t[1][0]-t[0][0])/2:(t[1][1]-t[0][1])/2+c.height/2}return 0},getXForText(e,t,i){var s;const n=this,{config:a}=n,o=a.axis_rotated,r=n.isFunnelType(t),l=n.isTreemapType(t);let c=e?e[0][0]:0;if(n.isCandlestickType(t))o?c=(s=n.getCandlestickData(t))!=null&&s._isUp?e[2][2]+4:e[2][1]-4:c+=(e[1][0]-c)/2;else if(r)c+=n.state.current.width/2;else if(l)c+=a.data_labels.centered?0:5;else if(o){const u=a[`axis_${n.axis.getId(t.id)}_inverted`],d=n.isBarType(t)?4:6,h=t.value;c=e[2][1],u?c-=d*(h>0?1:-1):c+=d*(h<0?-1:1)}else c=n.hasType("bar")?(e[2][0]+e[0][0])/2:c;return(o||l)&&(c+=n.getCenteredTextPos(t,e,i,"x")),c+Li.call(this,t,"x")},getYForText(e,t,i){const s=this,{axis:n,config:a,state:o}=s,r=a.axis_rotated,l=a[`axis_${n==null?void 0:n.getId(t.id)}_inverted`],c=s.isBarType(t),u=s.isFunnelType(t),d=s.isTreemapType(t),h=a.point_r,g=ct(i);let{value:f}=t,p=3,_;if(s.isCandlestickType(t))f=s.getCandlestickData(t),r?(_=e[0][0],_+=(e[1][0]-_)/2+p):(_=f&&f._isUp?e[2][2]-p:e[2][1]+p*4,l&&(_+=15*(f._isUp?1:-1)));else if(u)_=e?e[0][1]+(e[1][1]-e[0][1])/2+g.height/2-3:0;else if(d)_=e[0][1]+(a.data_labels.centered?0:g.height+5);else if(r)_=(e[0][0]+e[2][0]+g.height*.6)/2;else if(_=e[2][1],O(h)&&h>5&&(s.isLineType(t)||s.isScatterType(t))&&(p+=a.point_r/2.3),f<0||f===0&&!o.hasPositiveValue&&o.hasNegativeValue)_+=l?c?-3:-5:g.height+(c?-p:p);else{let x=-p*2;c?x=-p:s.isBubbleType(t)&&(x=p),l&&(x=c?10:15),_+=x}return(!r||d)&&(_+=s.getCenteredTextPos(t,e,i,"y")),_+Li.call(this,t,"y")},markOverlapped(e,t,i){const s=t.$el.arcs.selectAll(i),n=s.filter(l=>l.data.id!==e),a=s.filter(l=>l.data.id===e),o=_i(a.node()),r=(l,c)=>Math.sqrt(Math.pow(l,2)+Math.pow(c,2));a.node()&&n.each(function(){const l=_i(this),c=(0,w.select)(this),u=r(o.e,o.f)>r(l.e,l.f)?a:c,d=Math.ceil(Math.abs(o.e-l.e))<Math.ceil(u.node().getComputedTextLength()),h=Math.ceil(Math.abs(o.f-l.f))<parseInt(a.style("font-size"),10);c.classed(rt.TextOverlapping,d&&h)})},undoMarkOverlapped(e,t){e.$el.arcs.selectAll(t).each(function(){(0,w.selectAll)([this,this.previousSibling]).classed(rt.TextOverlapping,!1)})}};function Ii(e="left",t){const i=O(t);let s;return e.indexOf("center")>-1?s=i?t/2:"middle":e.indexOf("right")>-1?s=i?t:"end":s=i?0:"start",s}var _a={initTitle(){const e=this,{config:t,$el:i}=e;if(t.title_text){i.title=i.svg.append("g");const s=i.title.append("text").style("text-anchor",Ii(t.title_position)).attr("class",rt.title);ue(s,t.title_text,[.3,1.5])}},redrawTitle(){const e=this,{config:t,state:{current:i},$el:{title:s}}=e;if(s){const n=Ii(t.title_position,i.width),a=(t.title_padding.top||0)+e.getTextRect(e.$el.title,rt.title).height;s.attr("transform",`translate(${n}, ${a})`)}},getTitlePadding(){const e=this,{$el:{title:t},config:i}=e;return(i.title_padding.top||0)+(t?e.getTextRect(t,rt.title).height:0)+(i.title_padding.bottom||0)}},ma={initTooltip(){const e=this,{config:t,$el:i}=e;i.tooltip=(0,w.select)(t.tooltip_contents.bindto),i.tooltip.empty()&&(i.tooltip=i.chart.append("div").attr("class",ye.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),e.bindTooltipResizePos()},initShowTooltip(){var e;const t=this,{config:i,$el:s,state:{hasAxis:n,hasRadar:a}}=t;if(i.tooltip_init_show){const o=!(n||a);(e=t.axis)!=null&&e.isTimeSeries()&&X(i.tooltip_init_x)&&(i.tooltip_init_x=vt.call(t,i.tooltip_init_x)),t.api.tooltip.show({data:{[o?"index":"x"]:i.tooltip_init_x}});const r=i.tooltip_init_position;if(!i.tooltip_contents.bindto&&!wt(r)){const{top:l=0,left:c=50}=r;s.tooltip.style("top",X(l)?l:`${l}px`).style("left",X(c)?c:`${c}px`).style("display",null)}}},getTooltipHTML(...e){const t=this,{api:i,config:s}=t;return L(s.tooltip_contents)?s.tooltip_contents.bind(i)(...e):t.getTooltipContent(...e)},getTooltipContent(e,t,i,s){var n;const a=this,{api:o,config:r,state:l,$el:c}=a,[u,d,h]=["title","name","value"].map(E=>{const P=r[`tooltip_format_${E}`];return L(P)?P.bind(o):P}),g=(...E)=>ze((u||t)(...E)),f=(...E)=>ze((d||(P=>P))(...E)),p=(...E)=>{const P=h||(l.hasTreemap||a.isStackNormalized()?(F,W)=>`${(W*100).toFixed(2)}%`:i);return ze(P(...E))},_=r.tooltip_order,x=E=>a.axis&&a.isBubbleZType(E)?a.getBubbleZData(E.value,"z"):a.getBaseValue(E),m=a.levelColor?E=>a.levelColor(E.value):E=>s(E),$=r.tooltip_contents,b=$.template,v=a.mapToTargetIds();if(_===null&&r.data_groups.length){const E=a.orderTargets(a.data.targets).map(P=>P.id).reverse();e.sort((P,F)=>{let W=P?P.value:null,J=F?F.value:null;return W>0&&J>0&&(W=P.id?E.indexOf(P.id):null,J=F.id?E.indexOf(F.id):null),W-J})}else if(/^(asc|desc)$/.test(_)){const E=_==="asc";e.sort((P,F)=>{const W=P?x(P):null,J=F?x(F):null;return E?W-J:J-W})}else L(_)&&e.sort(_.bind(o));const y=a.getTooltipContentTemplate(b),T=e.length;let C,A,S,R,z;for(z=0;z<T;z++)if(A=e[z],!(!A||!(x(A)||x(A)===0))){if(st(C)){const E=(l.hasAxis||l.hasRadar)&&g(A.x);C=he(y[0],{CLASS_TOOLTIP:ye.tooltip,TITLE:M(E)?b?E:`<tr><th colspan="2">${E}</th></tr>`:""})}if(!A.ratio&&c.arcs&&(S=["arc",a.$el.arcs.select(`path.${V.arc}-${A.id}`).data()[0]],A.ratio=a.getRatio(...S)),S=[A.ratio,A.id,A.index],a.isAreaRangeType(A)){const[E,P]=["high","low"].map(W=>p(a.getRangedData(A,W),...S));R=`<b>Mid:</b> ${p(x(A),...S)} <b>High:</b> ${E} <b>Low:</b> ${P}`}else if(a.isCandlestickType(A)){const[E,P,F,W,J]=["open","high","low","close","volume"].map(ut=>a.getRangedData(A,ut,"candlestick")?p(a.getRangedData(A,ut,"candlestick"),...S):void 0);R=`<b>Open:</b> ${E} <b>High:</b> ${P} <b>Low:</b> ${F} <b>Close:</b> ${W}${J?` <b>Volume:</b> ${J}`:""}`}else if(a.isBarRangeType(A)){const{value:E,id:P,index:F}=A;R=`${p(E,void 0,P,F)}`}else R=p(x(A),...S);if(R!==void 0){if(A.name===null)continue;const E=f((n=A.name)!=null?n:A.id,...S),P=m(A),F={CLASS_TOOLTIP_NAME:ye.tooltipName+a.getTargetSelectorSuffix(A.id),COLOR:b||!a.patterns?P:`<svg><rect style="fill:${P}" width="10" height="10"></rect></svg>`,NAME:E,VALUE:R};if(b&&B($.text)){const W=v.indexOf(A.id);Object.keys($.text).forEach(J=>{F[J]=$.text[J][W]})}C+=he(y[1],F)}}return`${C}</table>`},getTooltipContentTemplate(e){return(e||`<table class="{=CLASS_TOOLTIP}"><tbody>
18
18
  {=TITLE}
19
19
  {{<tr class="{=CLASS_TOOLTIP_NAME}">
@@ -30,4 +30,4 @@
30
30
  </foreignObject></svg>`;return`data:image/svg+xml;base64,${ka(d)}`}function La(e,t){const{top:i,left:s}=t,{x:n,y:a}=Kt(e,!0),{a:o,b:r,c:l,d:c,e:u,f:d}=e.getScreenCTM(),{width:h,height:g}=ct(e,!0);return{x:o*n+l*a+u-s,y:r*n+c*a+d-i+(g-Math.round(g/4)),width:h,height:g}}function Pa(e){const{left:t,top:i}=ct(e),s=a=>a.textContent||a.childElementCount,n=[];return Vt(e.querySelectorAll("text")).filter(s).forEach(a=>{const o=r=>{const{fill:l,fontFamily:c,fontSize:u,textAnchor:d,transform:h}=j.getComputedStyle(r),{x:g,y:f,width:p,height:_}=La(r,{left:t,top:i});return{[r.textContent]:{x:g,y:f,width:p,height:_,fill:l,fontFamily:c,fontSize:u,textAnchor:d,transform:h}}};if(a.childElementCount>1){const r=[];return Vt(a.querySelectorAll("tspan")).filter(s).forEach(l=>{n.push(o(l))}),r}else n.push(o(a))}),n}function Oa(e,t){t.forEach(i=>{Object.keys(i).forEach(s=>{const{x:n,y:a,width:o,height:r,fill:l,fontFamily:c,fontSize:u,transform:d}=i[s];if(e.save(),e.font=`${u} ${c}`,e.fillStyle=l,d==="none")e.fillText(s,n,a);else{const h=d.replace(/(matrix|\(|\))/g,"").split(",");h.splice(4).every(g=>+g==0)?(h.push(n+o-o/4),h.push(a-r+r/3)):(h.push(n),h.push(a)),e.transform(...h),e.fillText(s,0,0)}e.restore()})})}var Ia={export(e,t){const i=this.internal,{state:s,$el:{chart:n,svg:a}}=i,{width:o,height:r}=s.current,l=Jt(Object.create(null),{width:o,height:r,preserveAspectRatio:!0,preserveFontStyle:!1,mimeType:"image/png"},e),c=Ea(n.node(),l,{width:o,height:r}),u=l.preserveFontStyle?Pa(a.node()):[];if(t&&L(t)){const d=new Image;d.crossOrigin="Anonymous",d.onload=()=>{const h=lt.createElement("canvas"),g=h.getContext("2d");h.width=l.width||o,h.height=l.height||r,g.drawImage(d,0,0),u.length&&(Oa(g,u),u.length=0),t.bind(this)(h.toDataURL(l.mimeType))},d.src=c}return c}},Da={focus(e){const t=this.internal,{state:i}=t,s=t.mapToTargetIds(e),n=t.$el.svg.selectAll(t.selectorTargets(s.filter(t.isTargetToShow,t)));this.revert(),this.defocus(),n.classed(q.focused,!0).classed(q.defocused,!1),t.hasArcType()&&!i.hasRadar&&(t.expandArc(s),t.hasType("gauge")&&t.markOverlapped(e,t,`.${yt.gaugeValue}`)),t.toggleFocusLegend(s,!0),i.focusedTargetIds=s,i.defocusedTargetIds=i.defocusedTargetIds.filter(a=>s.indexOf(a)<0)},defocus(e){const t=this.internal,{state:i}=t,s=t.mapToTargetIds(e);t.$el.svg.selectAll(t.selectorTargets(s.filter(t.isTargetToShow,t))).classed(q.focused,!1).classed(q.defocused,!0),t.hasArcType(null,["polar"])&&(t.unexpandArc(s),t.hasType("gauge")&&t.undoMarkOverlapped(t,`.${yt.gaugeValue}`)),t.toggleFocusLegend(s,!1),i.focusedTargetIds=i.focusedTargetIds.filter(a=>s.indexOf(a)<0),i.defocusedTargetIds=s},revert(e){const t=this.internal,{config:i,state:s,$el:n}=t,a=t.mapToTargetIds(e);n.svg.selectAll(t.selectorTargets(a)).classed(q.focused,!1).classed(q.defocused,!1),t.hasArcType(null,["polar"])&&t.unexpandArc(a),i.legend_show&&(t.showLegend(a.filter(t.isLegendToShow.bind(t))),n.legend.selectAll(t.selectorLegends(a)).filter(function(){return(0,w.select)(this).classed(q.legendItemFocused)}).classed(q.legendItemFocused,!1)),s.focusedTargetIds=[],s.defocusedTargetIds=[]}},za={legend:{show:function(e){const t=this.internal;t.showLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},hide:function(e){const t=this.internal;t.hideLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})}}},Fa={load(e){const t=this.internal,{config:i}=t;e.xs&&t.addXs(e.xs),"names"in e&&this.data.names(e.names),"classes"in e&&Object.keys(e.classes).forEach(s=>{i.data_classes[s]=e.classes[s]}),"categories"in e&&t.axis.isCategorized()&&(i.axis_x_categories=e.categories),"axes"in e&&Object.keys(e.axes).forEach(s=>{i.data_axes[s]=e.axes[s]}),"colors"in e&&Object.keys(e.colors).forEach(s=>{i.data_colors[s]=e.colors[s]}),"unload"in e&&e.unload!==!1?t.unload(t.mapToTargetIds(e.unload===!0?null:e.unload),()=>{ri(()=>t.loadFromArgs(e))}):t.loadFromArgs(e)},unload(e){const t=this.internal;let i=e||{};wt(i)&&this.tooltip.hide(),G(i)?i={ids:i}:X(i)&&(i={ids:[i]});const s=t.mapToTargetIds(i.ids);t.unload(s,()=>{t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.cache.remove(s),Ci.call(t,i.done,i.resizeAfter)})}};function zi(e,t,i){const s=this.internal,n=s.mapToTargetIds(t),a=s.state.hiddenTargetIds.map(l=>n.indexOf(l)>-1&&l).filter(Boolean);s.state.toggling=!0,s[`${e?"remove":"add"}HiddenTargetIds`](n);const o=s.$el.svg.selectAll(s.selectorTargets(n)),r=e?null:"0";e&&a.length&&(o.style("display",null),K(s.config.data_onshown,this,a)),s.$T(o).style("opacity",r,"important").call(Te,()=>{var l;!e&&a.length===0&&(o.style("display","none"),K((l=s.config)==null?void 0:l.data_onhidden,this,n)),o.style("opacity",r)}),i.withLegend&&s[`${e?"show":"hide"}Legend`](n),s.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),s.state.toggling=!1}var Ma={show(e,t={}){zi.call(this,!0,e,t)},hide(e,t={}){zi.call(this,!1,e,t)},toggle(e,t={}){const i=this.internal,s={show:[],hide:[]};i.mapToTargetIds(e).forEach(n=>s[i.isTargetToShow(n)?"hide":"show"].push(n)),s.show.length&&this.show(s.show,t),s.hide.length&&setTimeout(()=>this.hide(s.hide,t),0)}},Xa={tooltip:{show:function(e){var t,i,s;const n=this.internal,{$el:a,config:o,state:{eventReceiver:r,hasFunnel:l,hasTreemap:c,inputType:u}}=n;let d,h;if(e.mouse&&(h=e.mouse),e.data){const{data:g}=e,f=(t=n.getYScaleById(g.id))==null?void 0:t(g.value);if((l||c)&&g.id){const p=n.selectorTarget(g.id,void 0,`.${it.shape}`);r.rect=a.main.select(p)}else n.isMultipleX()?h=[n.xx(g),f]:(o.tooltip_grouped||(h=[0,f]),d=(s=g.index)!=null?s:n.hasArcType()&&g.id?(i=n.getArcElementByIdOrIndex(g.id))==null?void 0:i.datum().index:n.getIndexByX(g.x))}else H(e.x)?d=n.getIndexByX(e.x):H(e.index)&&(d=e.index);(u==="mouse"?["mouseover","mousemove"]:["touchstart"]).forEach(g=>{n.dispatchEvent(g,d,h)})},hide:function(){var e,t,i;const s=this.internal,{state:{inputType:n},$el:{tooltip:a}}=s,o=a==null?void 0:a.datum();if(o){const{index:r}=JSON.parse(o.current)[0];(n==="mouse"?["mouseout"]:["touchend"]).forEach(l=>{s.dispatchEvent(l,r)})}n==="touch"&&s.callOverOutForTouch(),s.hideTooltip(!0),(e=s.hideGridFocus)==null||e.call(s),(t=s.unexpandCircles)==null||t.call(s),(i=s.expandBarTypeShapes)==null||i.call(s,!1)}}},Ba=Object.defineProperty,Na=(e,t,i)=>t in e?Ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Fi=(e,t,i)=>Na(e,typeof t!="symbol"?t+"":t,i);class Xt{constructor(t){Fi(this,"plugins",[]),Fi(this,"internal");const i=new Ht(this);this.internal=i,(function s(n,a,o){Object.keys(n).forEach(r=>{const l=L(n[r]),c=a!==o,u=nt(n[r]),d=u&&Object.keys(n[r]).length>0;l&&(!c&&d||c)?a[r]=n[r].bind(o):u&&!l?a[r]={}:a[r]=n[r],d&&s(n[r],a[r],o)})})(Xt.prototype,this,this),wa.call(i,t),i.beforeInit(),i.init()}}dt(Xt.prototype,[Sa,Ra,Ca,Ia,Da,za,Fa,Ma,Xa]);function Mi(e=!1,t,i,s){const n=this,{config:a,$el:{main:o}}=n,r=a.data_selection_grouped,l=a.data_selection_isselectable.bind(n.api);a.data_selection_enabled&&o.selectAll(`.${it.shapes}`).selectAll(`.${it.shape}`).each(function(c){const u=(0,w.select)(this),{id:d,index:h}=c.data?c.data:c,g=n.getToggle(this,c).bind(n),f=r||!t||t.indexOf(d)>=0,p=!i||i.indexOf(h)>=0,_=u.classed(Q.SELECTED);u.classed(Lt.line)||u.classed($e.area)||(e?f&&p&&l(c)&&!_?g(!0,u.classed(Q.SELECTED,!0),c,h):H(s)&&s&&_&&g(!1,u.classed(Q.SELECTED,!1),c,h):f&&p&&l(c)&&_&&g(!1,u.classed(Q.SELECTED,!1),c,h))})}var Ga={selected(e){const t=this.internal,i=[];return t.$el.main.selectAll(`.${it.shapes+t.getTargetSelectorSuffix(e)}`).selectAll(`.${it.shape}`).filter(function(){return(0,w.select)(this).classed(Q.SELECTED)}).each(s=>i.push(s)),i},select(e,t,i){const s=this.internal;Mi.bind(s)(!0,e,t,i)},unselect(e,t){const i=this.internal;Mi.bind(i)(!1,e,t)}};const Xi=function(e){var t;const i=this.internal,{axis:s,brush:n,config:a,scale:{x:o,subX:r},state:l}=i;let c;return a.subchart_show&&(c=e,Array.isArray(c)?(s.isTimeSeries()&&(c=c.map(d=>vt.bind(i)(d))),i.withinRange(c,i.getZoomDomain("subX",!0),i.getZoomDomain("subX"))&&(l.domain=c,n.move(n.getSelection(),c.map(r)))):c=(t=l.domain)!=null?t:o.orgDomain()),c};dt(Xi,{show(){var e,t;const i=this.internal,{$el:{subchart:s},config:n}=i,a=n.subchart_show;if(!a){i.unbindZoomEvent(),n.subchart_show=!a,!s.main&&i.initSubchart();let o=s.main.selectAll(`.${I.target}`);i.data.targets.length!==o.size()&&(i.updateSizes(),i.updateTargetsForSubchart(i.data.targets),o=(e=s.main)==null?void 0:e.selectAll(`.${I.target}`)),o==null||o.style("opacity",null),(t=s.main)==null||t.style("display",null),this.resize()}},hide(){const e=this.internal,{$el:{subchart:{main:t}},config:i}=e;i.subchart_show&&(t==null?void 0:t.style("display"))!=="none"&&(i.subchart_show=!1,t.style("display","none"),this.resize())},toggle(){const e=this.internal,{config:t}=e;this.subchart[t.subchart_show?"hide":"show"]()},reset(){const e=this.internal,{brush:t}=e;t.clear(t.getSelection())}});var Va={subchart:Xi},kt=U(10);const Bi=function(e){var t;const i=this.internal,{axis:s,config:n,org:a,scale:o,state:r}=i,l=s.isCategorized();let c;if(n.zoom_enabled)if(c=e,Array.isArray(c)){if(s.isTimeSeries()&&(c=c.map(d=>vt.bind(i)(d))),i.withinRange(c,i.getZoomDomain("zoom",!0),i.getZoomDomain("zoom"))){if(r.domain=c,c=i.getZoomDomainValue(c),i.api.tooltip.hide(),n.subchart_show){const d=o.zoom||o.x;i.brush.getSelection().call(i.brush.move,c.map(d))}else{const d=l?o.x.orgScale():a.xScale||o.x;i.updateCurrentZoomTransform(d,c)}i.setZoomResetButton()}}else c=i.zoom.getDomain();return(t=r.domain)!=null?t:c};dt(Bi,{enable(e){const t=this.internal,{config:i}=t;/^(drag|wheel)$/.test(e)&&(i.zoom_type=e),i.zoom_enabled=!!e,t.zoom?e===!1&&t.bindZoomEvent(!1):(t.initZoom(),t.bindZoomEvent()),t.updateAndRedraw()},max(e){const t=this.internal,{config:i,org:{xDomain:s}}=t;return(e===0||e)&&(i.zoom_x_max=St("max",[s[1],e])),i.zoom_x_max},min(e){const t=this.internal,{config:i,org:{xDomain:s}}=t;return(e===0||e)&&(i.zoom_x_min=St("min",[s[0],e])),i.zoom_x_min},range(e){const t=this.zoom;if(B(e)){const{min:i,max:s}=e;H(i)&&t.min(i),H(s)&&t.max(s)}return{min:t.min(),max:t.max()}}});var Ya={zoom:Bi,unzoom(){const e=this.internal,{config:t,$el:{eventRect:i,zoomResetBtn:s},scale:{zoom:n},state:a}=e;n&&(t.subchart_show?e.brush.getSelection().call(e.brush.move,null):e.zoom.updateTransformScale(kt.zoomIdentity),e.updateZoom(!0),s==null||s.style("display","none"),(0,kt.zoomTransform)(i.node())!==kt.zoomIdentity&&e.zoom.transform(i,kt.zoomIdentity),a.domain=void 0)}},ja={initBrush(){const e=this,{config:t,scale:i,$el:{subchart:s},state:n}=e,a=t.axis_rotated,o=t.subchart_size_height;let r,l,c;e.brush=(a?(0,be.brushY)():(0,be.brushX)()).handleSize(5),e.brush.on("start brush end",u=>{const{selection:d,sourceEvent:h,target:g,type:f}=u;f==="start"&&(e.state.inputType==="touch"&&e.hideTooltip(),l=h?d:null),/(start|brush)/.test(f)&&(f==="brush"&&h&&n.domain&&(l==null||l.forEach((p,_)=>{p!==d[_]&&(n.domain[_]=i.x.orgDomain()[_])})),e.redrawForBrush(f!=="start")),f==="end"&&(r=i.x.orgDomain()),g!=null&&g.handle&&(d===null?e.brush.handle.attr("display","none"):e.brush.handle.attr("display",null).attr("transform",(p,_)=>{const x=[d[_],o/2];return`translate(${a?x.reverse():x})`}))}),e.brush.updateResize=function(){c&&clearTimeout(c),c=setTimeout(()=>{const u=this.getSelection();r&&(0,be.brushSelection)(u.node())&&this.move(u,r.map(i.subX.orgScale()))},0)},e.brush.update=function(){var u;return this.extent()()[1].filter(h=>isNaN(h)).length===0&&((u=s.main)==null||u.select(`.${N.brush}`).call(this)),this},e.brush.scale=function(u){const d=t.subchart_size_height;let h=e.axis.getExtent();!h&&u.range?h=[[0,0],[u.range()[1],d]]:G(h)&&(h=h.map((g,f)=>[g,f>0?d:f])),a&&h[1].reverse(),this.extent(h),this.update()},e.brush.getSelection=()=>s.main?s.main.select(`.${N.brush}`):(0,w.select)([])},initSubchart(){const e=this,{config:t,state:{clip:i,hasAxis:s},$el:{defs:n,svg:a,subchart:o,axis:r}}=e;if(!s)return;const l=t.subchart_show?null:"hidden",c=`${i.id}-subchart`,u=e.getClipPath(c);i.idSubchart=c,e.appendClip(n,c),e.initBrush(),o.main=a.append("g").classed(N.subchart,!0).attr("transform",e.getTranslate("context"));const{main:d}=o;d.style("visibility",l),d.append("g").attr("clip-path",u).attr("class",N.chart),["bar","line","bubble","candlestick","scatter"].forEach(g=>{const f=pt(/^(bubble|scatter)$/.test(g)?"circle":g);if(e.hasType(g)||e.hasTypeOf(f)){const p=d.select(`.${N.chart}`),_=N[`chart${f}s`];p.select(`.${_}`).empty()&&p.append("g").attr("class",_)}});const h=d.append("g").attr("clip-path",u).attr("class",N.brush).call(e.brush);t.subchart_showHandle&&e.addBrushHandle(h),r.subX=d.append("g").attr("class",N.axisX).attr("transform",e.getTranslate("subX")).attr("clip-path",t.axis_rotated?"":i.pathXAxis).style("visibility",t.subchart_axis_x_show?l:"hidden")},addBrushHandle(e){const t=this,{config:i}=t,s=i.axis_rotated,n=i.subchart_init_range,a="handle--custom",o=s?["M8.5 0 a6 6 0 0 0 -6 -6.5 H-2.5 a 6 6 0 0 0 -6 6.5 z m-5 -2 H-3.5 m7 -2 H-3.5z","M8.5 0 a6 -6 0 0 1 -6 6.5 H-2.5 a 6 -6 0 0 1 -6 -6.5z m-5 2 H-3.5 m7 2 H-3.5z"]:["M0 -8.5 A6 6 0 0 0 -6.5 -3.5 V2.5 A6 6 0 0 0 0 8.5 Z M-2 -3.5 V3.5 M-4 -3.5 V3.5z","M0 -8.5 A6 6 0 0 1 6.5 -3.5 V2.5 A6 6 0 0 1 0 8.5 Z M2 -3.5 V3.5 M4 -3.5 V3.5z"];t.brush.handle=e.selectAll(`.${a}`).data(s?[{type:"n"},{type:"s"}]:[{type:"w"},{type:"e"}]).enter().append("path").attr("class",a).attr("cursor",`${s?"ns":"ew"}-resize`).attr("d",r=>o[+/[se]/.test(r.type)]).attr("display",n?null:"none")},updateTargetsForSubchart(e){const t=this,{config:i,state:s,$el:{subchart:{main:n}}}=t;i.subchart_show&&(["bar","line","bubble","candlestick","scatter"].filter(a=>t.hasType(a)||t.hasTypeOf(pt(a))).forEach(a=>{const o=/^(bubble|scatter)$/.test(a),r=pt(o?"circle":a),l=t.getChartClass(r,!0),c=t.getClass(o?"circles":`${a}s`,!0),u=n.select(`.${N[`chart${`${r}s`}`]}`);if(o){const d=u.selectAll(`.${N.circles}`).data(e.filter(t[`is${pt(a)}Type`].bind(t))).attr("class",c);d.exit().remove(),d.enter().append("g").attr("class",c)}else{const d=u.selectAll(`.${N[`chart${r}`]}`).attr("class",l).data(e.filter(t[`is${r}Type`].bind(t))),h=d.enter().append("g").style("opacity","0").attr("class",l).append("g").attr("class",c);d.exit().remove(),a==="line"&&t.hasTypeOf("Area")&&h.append("g").attr("class",t.getClass("areas",!0))}}),n.selectAll(`.${N.brush} rect`).attr(i.axis_rotated?"width":"height",i.axis_rotated?s.width2:s.height2))},redrawSubchart(e,t,i){var s;const n=this,{config:a,$el:{subchart:{main:o}},state:r}=n,l=!!t;if(o.style("visibility",a.subchart_show?null:"hidden"),a.subchart_show&&(((s=r.event)==null?void 0:s.type)==="zoom"&&n.brush.update(),e)){const c=a.subchart_init_range;if(!pi(n)&&n.brush.update(),Object.keys(i.type).forEach(u=>{const d=pt(u),h=n[`generateDraw${d}`](i.indices[u],!0);n[`update${d}`](l,!0),n[`redraw${d}`](h,l,!0)}),n.hasType("bubble")||n.hasType("scatter")){const{cx:u}=i.pos,d=n.updateCircleY(!0);n.updateCircle(!0),n.redrawCircle(u,d,l,void 0,!0)}!r.rendered&&c&&(r.domain=c,n.brush.move(n.brush.getSelection(),c.map(n.scale.x)))}},redrawForBrush(e=!0){var t;const i=this,{config:{subchart_onbrush:s,zoom_rescale:n},scale:a,state:o}=i;i.redraw({withTransition:!1,withY:n,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),e&&o.rendered&&s.bind(i.api)((t=o.domain)!=null?t:a.x.orgDomain())},transformContext(e,t){const i=this,{$el:{subchart:s},$T:n}=i,a=t!=null&&t.axisSubX?t.axisSubX:n(s.main.select(`.${N.axisX}`),e);s.main.attr("transform",i.getTranslate("context")),a.attr("transform",i.getTranslate("subX"))}},Ha={initZoom(){const e=this;e.scale.zoom=null,e.generateZoom(),e.config.zoom_type==="drag"&&e.initZoomBehaviour()},bindZoomEvent(e=!0){const t=this,{config:i}=t;i.zoom_enabled&&e?!i.subchart_show&&t.bindZoomOnEventRect():e===!1&&(t.api.unzoom(),t.unbindZoomEvent())},generateZoom(){const e=this,{config:t,org:i,scale:s}=e,n=(0,kt.zoom)().duration(0).on("start",e.onZoomStart.bind(e)).on("zoom",e.onZoom.bind(e)).on("end",e.onZoomEnd.bind(e));n.orgScaleExtent=()=>{const a=t.zoom_extent||[1,10];return[a[0],Math.max(e.getMaxDataCount()/a[1],a[1])]},n.updateScaleExtent=function(){const a=Gt(e.scale.x.orgDomain())/Gt(e.getZoomDomain()),o=this.orgScaleExtent();return this.scaleExtent([o[0]*a,o[1]*a]),this},n.updateTransformScale=(a,o)=>{var r;const l=t.axis_rotated;(r=i.xScale)==null||r.range(s.x.range());const c=a[l?"rescaleY":"rescaleX"](i.xScale||s.x);if(c.domain().some(h=>/(Invalid Date|NaN)/.test(h.toString())))return;const u=e.trimXDomain(c.domain()),d=t.zoom_rescale;if(c.domain(u,i.xDomain),o){const h=c(s.x.domain()[0]),g=l?a.x:h,f=l?h:a.y;e.$el.eventRect.property("__zoom",kt.zoomIdentity.translate(g,f).scale(a.k))}e.state.xTickOffset||(e.state.xTickOffset=e.axis.x.tickOffset()),s.zoom=e.getCustomizedXScale(c),e.axis.x.scale(s.zoom),d?(!i.xScale&&(i.xScale=s.x.copy()),s.x.domain(u)):i.xScale&&(s.x.domain(i.xScale.domain()),i.xScale=null)},n.getDomain=()=>{const a=s[s.zoom?"zoom":"subX"].domain();return e.axis.isCategorized()&&(a[1]-=2),a},e.zoom=n},onZoomStart(e){const t=this,{sourceEvent:i}=e;i&&(t.zoom.startEvent=i,t.state.zooming=!0,K(t.config.zoom_onzoomstart,t.api,e))},onZoom(e){var t;const i=this,{config:s,scale:n,state:a,org:o}=i,{sourceEvent:r}=e,l=(e==null?void 0:e.transform)===kt.zoomIdentity;if(!s.zoom_enabled||i.filterTargetsToShow(i.data.targets).length===0||!n.zoom&&(r==null?void 0:r.type.indexOf("touch"))>-1&&(r==null?void 0:r.touches.length)===1)return;e.sourceEvent&&(a.zooming=!0,a.domain=void 0);const c=(r==null?void 0:r.type)==="mousemove",u=(r==null?void 0:r.wheelDelta)<0,{transform:d}=e;!c&&u&&n.x.domain().every((g,f)=>g!==o.xDomain[f])&&n.x.domain(o.xDomain),i.zoom.updateTransformScale(d,s.zoom_type==="wheel"&&r);const h=s.transition_duration>0&&!s.subchart_show&&(a.dragging||l||!e.sourceEvent);i.redraw({withTransition:h,withY:s.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),i.state.cancelClick=c,!l&&K(s.zoom_onzoom,i.api,(t=i.state.domain)!=null?t:i.zoom.getDomain())},onZoomEnd(e){var t,i;const s=this,{config:n,state:a}=s;let{startEvent:o}=s.zoom,r=e==null?void 0:e.sourceEvent;const l=(e==null?void 0:e.transform)===kt.zoomIdentity;(o==null?void 0:o.type.indexOf("touch"))>-1&&(o=o.changedTouches[0],r=(t=r==null?void 0:r.changedTouches)==null?void 0:t[0]),!(n.zoom_type==="drag"&&r&&o.clientX===r.clientX&&o.clientY===r.clientY)&&(a.zooming=!1,s.redrawEventRect(),s.updateZoom(),!l&&(r||a.dragging)&&K(n.zoom_onzoomend,s.api,(i=s.state.domain)!=null?i:s.zoom.getDomain()))},updateZoom(e){const t=this,{subX:i,x:s,zoom:n}=t.scale;if(n){const a=n.domain(),o=i.domain(),r=.015,l=t.config.axis_x_inverted?(a[0]>=o[0]||a[0]+r>=o[0])&&(o[1]>=a[1]||o[1]>=a[1]+r):(a[0]<=o[0]||a[0]-r<=o[0])&&(o[1]<=a[1]||o[1]<=a[1]-r);(e||l)&&(t.axis.x.scale(i),s.domain(i.orgDomain()),t.scale.zoom=null)}},updateCurrentZoomTransform(e,t){const i=this,{$el:{eventRect:s},config:n}=i,a=n.axis_rotated,o=[-e(t[0]),0],r=kt.zoomIdentity.scale(e.range()[1]/(e(t[1])-e(t[0]))).translate(...a?o.reverse():o);s.call(i.zoom.transform,r)},bindZoomOnEventRect(){var e;const t=this,{config:i,$el:{eventRect:s,svg:n}}=t,a=i.zoom_type==="drag"?t.zoomBehaviour:t.zoom;j.GestureEvent&&/^((?!chrome|android|mobile).)*safari/i.test((e=j.navigator)==null?void 0:e.userAgent)&&n.on("wheel",()=>{}),s==null||s.call(a).on("dblclick.zoom",null)},initZoomBehaviour(){const e=this,{config:t,state:i}=e,s=t.axis_rotated;let n=0,a=0,o,r;const l={axis:s?"y":"x",attr:s?"height":"width",index:s?1:0};e.zoomBehaviour=(0,ki.drag)().clickDistance(4).on("start",function(c){r=e.scale.zoom?null:e.axis.getExtent(),i.event=c,e.setDragStatus(!0),e.unselectRect(),o||(o=e.$el.main.append("rect").attr("clip-path",i.clip.path).attr("class",Ie.zoomBrush).attr("width",s?i.width:0).attr("height",s?0:i.height)),n=bt(c,this)[l.index],r&&(n<r[0]?n=r[0]:n>r[1]&&(n=r[1])),a=n,o.attr(l.axis,n).attr(l.attr,0),e.onZoomStart(c)}).on("drag",function(c){a=bt(c,this)[l.index],r&&(a>r[1]?a=r[1]:a<r[0]&&(a=r[0])),o.attr(l.axis,Math.min(n,a)).attr(l.attr,Math.abs(a-n))}).on("end",c=>{const u=e.scale.zoom||e.scale.x;i.event=c,o.attr(l.axis,0).attr(l.attr,0),n>a&&([n,a]=[a,n]),n<0&&(a+=Math.abs(n),n=0),n!==a&&e.api.zoom([n,a].map(d=>u.invert(d))),e.setDragStatus(!1)})},setZoomResetButton(){const e=this,{config:t,$el:i}=e,s=t.zoom_resetButton;s&&t.zoom_type==="drag"&&(i.zoomResetBtn?i.zoomResetBtn.style("display",null):i.zoomResetBtn=e.$el.chart.append("div").classed(I.button,!0).append("span").on("click",function(){L(s.onclick)&&s.onclick.bind(e.api)(this),e.api.unzoom()}).classed(Ie.buttonZoomReset,!0).text(s.text||"Reset Zoom"))},getZoomTransform(){const e=this,{$el:{eventRect:t}}=e;return t!=null&&t.node()?(0,kt.zoomTransform)(t.node()):{k:1}}},Wa={drag(e){const t=this,{config:i,state:s,$el:{main:n}}=t,a=i.data_selection_grouped,o=i.interaction_enabled&&i.data_selection_isselectable;if(t.hasArcType()||!i.data_selection_enabled||i.zoom_enabled&&!t.zoom.altDomain||!i.data_selection_multiple)return;const[r,l]=s.dragStart||[0,0],[c,u]=e,d=Math.min(r,c),h=Math.max(r,c),g=a?s.margin.top:Math.min(l,u),f=a?s.height:Math.max(l,u);n.select(`.${Nt.dragarea}`).attr("x",d).attr("y",g).attr("width",h-d).attr("height",f-g),n.selectAll(`.${it.shapes}`).selectAll(`.${it.shape}`).filter(p=>o==null?void 0:o.bind(t.api)(p)).each(function(p,_){const x=(0,w.select)(this),m=x.classed(Q.SELECTED),$=x.classed(Nt.INCLUDED);let b=!1,v;if(x.classed(ft.circle)){const y=+x.attr("cx")*1,T=+x.attr("cy")*1;v=t.togglePoint,b=d<y&&y<h&&g<T&&T<f}else if(x.classed($t.bar)){const{x:y,y:T,width:C,height:A}=hi(this);v=t.togglePath,b=!(h<y||y+C<d)&&!(f<T||T+A<g)}else return;b^$&&(x.classed(Nt.INCLUDED,!$),x.classed(Q.SELECTED,!m),v.call(t,!m,x,p,_))})},dragstart(e){const t=this,{config:i,state:s,$el:{main:n}}=t;t.hasArcType()||!i.data_selection_enabled||(s.dragStart=e,n.select(`.${I.chart}`).append("rect").attr("class",Nt.dragarea).style("opacity","0.1"),t.setDragStatus(!0))},dragend(){const e=this,{config:t,$el:{main:i},$T:s}=e;e.hasArcType()||!t.data_selection_enabled||(s(i.select(`.${Nt.dragarea}`)).style("opacity","0").remove(),i.selectAll(`.${it.shape}`).classed(Nt.INCLUDED,!1),e.setDragStatus(!1))}},Ua=Object.defineProperty,Za=Object.defineProperties,qa=Object.getOwnPropertyDescriptors,Ni=Object.getOwnPropertySymbols,Ka=Object.prototype.hasOwnProperty,Ja=Object.prototype.propertyIsEnumerable,Gi=(e,t,i)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Qa=(e,t)=>{for(var i in t||(t={}))Ka.call(t,i)&&Gi(e,i,t[i]);if(Ni)for(var i of Ni(t))Ja.call(t,i)&&Gi(e,i,t[i]);return e},to=(e,t)=>Za(e,qa(t)),eo=to(Qa({},Wa),{selectPoint(e,t,i){const s=this,{config:n,$el:{main:a},$T:o}=s,r=n.axis_rotated,l=(r?s.circleY:s.circleX).bind(s),c=(r?s.circleX:s.circleY).bind(s),u=s.pointSelectR.bind(s);K(n.data_onselected,s.api,t,e.node()),o(a.select(`.${Q.selectedCircles}${s.getTargetSelectorSuffix(t.id)}`).selectAll(`.${Q.selectedCircle}-${i}`).data([t]).enter().append("circle").attr("class",()=>s.generateClass(Q.selectedCircle,i)).attr("cx",l).attr("cy",c).attr("stroke",s.color).attr("r",d=>s.pointSelectR(d)*1.4)).attr("r",u)},unselectPoint(e,t,i){const s=this,{config:n,$el:{main:a},$T:o}=s;K(n.data_onunselected,s.api,t,e==null?void 0:e.node()),o(a.select(`.${Q.selectedCircles}${s.getTargetSelectorSuffix(t.id)}`).selectAll(`.${Q.selectedCircle}-${i}`)).attr("r",0).remove()},togglePoint(e,t,i,s){this[`${e?"":"un"}selectPoint`](t,i,s)},selectPath(e,t){const i=this,{config:s}=i;K(s.data_onselected,i.api,t,e.node()),s.interaction_brighten&&e.style("filter","brightness(1.25)")},unselectPath(e,t){const i=this,{config:s}=i;K(s.data_onunselected,i.api,t,e.node()),s.interaction_brighten&&e.style("filter",null)},togglePath(e,t,i,s){this[`${e?"":"un"}selectPath`](t,i,s)},getToggle(e,t){const i=this;return e.nodeName==="path"?i.togglePath:i.isStepType(t)?()=>{}:i.togglePoint},toggleShape(e,t,i){var s;const n=this,{config:a,$el:{main:o}}=n;if(a.data_selection_enabled&&a.data_selection_isselectable.bind(n.api)(t)){const r=(0,w.select)(e),l=r.classed(Q.SELECTED),c=n.getToggle(e,t).bind(n);let u;if(!a.data_selection_multiple){const d=(s=n.isPointFocusOnly)==null?void 0:s.call(n);let h=`.${d?Q.selectedCircles:it.shapes}`;a.data_selection_grouped&&(h+=n.getTargetSelectorSuffix(t.id)),o.selectAll(h).selectAll(d?`.${Q.selectedCircle}`:`.${it.shape}.${Q.SELECTED}`).classed(Q.SELECTED,!1).each(function(g){const f=(0,w.select)(this);u=f,c(!1,f,g,g.index)})}(!u||u.node()!==r.node())&&(r.classed(Q.SELECTED,!l),c(!l,r,t,i))}}}),io={data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:()=>!0,data_selection_multiple:!0,data_selection_draggable:!1,data_onselected:()=>{},data_onunselected:()=>{}},so={subchart_show:!1,subchart_showHandle:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_axis_x_tick_show:!0,subchart_axis_x_tick_format:void 0,subchart_axis_x_tick_text_show:!0,subchart_init_range:void 0,subchart_onbrush:()=>{}},no={zoom_enabled:!1,zoom_type:"wheel",zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:void 0,zoom_onzoomstart:void 0,zoom_onzoomend:void 0,zoom_resetButton:!0,zoom_x_min:void 0,zoom_x_max:void 0};let Vi=()=>(dt(Ht.prototype,eo),dt(Xt.prototype,Ga),Yt.setOptions([io]),(Vi=()=>!0)()),Yi=()=>(dt(Ht.prototype,ja),dt(Xt.prototype,Va),Yt.setOptions([so]),(Yi=()=>!0)()),ji=()=>(dt(Ht.prototype,Ha),dt(Xt.prototype,Ya),Yt.setOptions([no]),(ji=()=>!0)());function Hi(e,t,i){const{config:s}=e,n=(a,o)=>{const r=O(o)?o:o===!1?void 0:null;r!==null&&(s[`axis_${a}_${t}`]=r)};H(i)&&(Rt(i)?Object.keys(i).forEach(a=>{n(a,i[a])}):(O(i)||i===!1)&&["y","y2"].forEach(a=>{n(a,i)}),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function Wi(e,t){const{config:i}=e;return{x:i[`axis_x_${t}`],y:i[`axis_y_${t}`],y2:i[`axis_y2_${t}`]}}var ao={axis:{labels:function(e){const t=this.internal;let i;return e&&(Object.keys(e).forEach(s=>{t.axis.setLabelText(s,e[s])}),t.axis.updateLabels()),["x","y","y2"].forEach(s=>{const n=t.axis.getLabelText(s);n&&(!i&&(i={}),i[s]=n)}),i},min:function(e){const t=this.internal;return M(e)||e===!1?Hi(t,"min",e):Wi(t,"min")},max:function(e){const t=this.internal;return M(e)||e===!1?Hi(t,"max",e):Wi(t,"max")},range:function(e){const{axis:t}=this;if(arguments.length){const{min:i,max:s}=e;H(s)&&t.max(s),H(i)&&t.min(i)}else return{max:t.max(),min:t.min()}}}},oo={category(e,t){const i=this.internal,{config:s}=i;return arguments.length>1&&(s.axis_x_categories[e]=t,i.redraw()),s.axis_x_categories[e]},categories(e){const t=this.internal,{config:i}=t;if(!e||!Array.isArray(e)){const s=i.axis_x_categories;return wt(s)?Object.values(t.data.xs)[0]:s}return i.axis_x_categories=e,t.redraw(),i.axis_x_categories}},ro={flow(e){const t=this.internal;let i;(e.json||e.rows||e.columns)&&t.convertData(e,n=>{i=n,s()});function s(){let n,a=0,o=0,r,l;if(t.state.redrawing||!i||!ge())return;const c=[],u=t.getMaxDataCount(),d=t.convertDataToTargets(i,!0),h=t.axis.isTimeSeries();t.data.targets.forEach(p=>{let _=!1;for(let x=0;x<d.length;x++)if(p.id===d[x].id){_=!0,p.values[p.values.length-1]&&(o=p.values[p.values.length-1].index+1),a=d[x].values.length;for(let m=0;m<a;m++)d[x].values[m].index=o+m,h||(d[x].values[m].x=o+m);p.values=p.values.concat(d[x].values),d.splice(x,1);break}!_&&c.push(p.id)}),t.data.targets.forEach(p=>{for(let _=0;_<c.length;_++)if(p.id===c[_]){o=p.values[p.values.length-1].index+1;for(let x=0;x<a;x++)p.values.push({id:p.id,index:o+x,x:h?t.getOtherTargetX(o+x):o+x,value:null})}}),t.data.targets.length&&d.forEach(p=>{const _=[];for(let x=t.data.targets[0].values[0].index;x<o;x++)_.push({id:p.id,index:x,x:h?t.getOtherTargetX(x):x,value:null});p.values.forEach(x=>{x.index+=o,h||(x.x+=o)}),p.values=_.concat(p.values)}),t.data.targets=t.data.targets.concat(d);const g=t.data.targets[0],f=g.values[0];H(e.to)?(a=0,l=h?vt.call(t,e.to):e.to,g.values.forEach(p=>{p.x<l&&a++})):H(e.length)&&(a=e.length),u?u===1&&h&&(r=(g.values[g.values.length-1].x-f.x)/2,n=[new Date(+f.x-r),new Date(+f.x+r)]):(h?r=g.values.length>1?g.values[g.values.length-1].x-f.x:f.x-t.getXDomain(t.data.targets)[0]:r=1,n=[f.x-r,f.x]),n&&t.updateXDomain(null,!0,!0,!1,n),t.updateTargets(t.data.targets),t.redraw({flow:{index:f.index,length:a,duration:M(e.duration)?e.duration:t.config.transition_duration,done:e.done,orgDataCount:u},withLegend:!0,withTransition:u>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}};function Ue(e,t){const i=this.internal,{config:s}=i,n=s.transition_duration&&ge(),a=`grid_${t}_lines`;return e&&(s[a]=e,i.updateGrid(),i.redrawGrid(n)),s[a]}function Ui(e,t){const i=`grid_${t}_lines`;return Ue.bind(this)(this.internal.config[i].concat(e||[]),t)}function Zi(e,t){this.internal.removeGridLines(e,t)}const qi=function(e){return Ue.bind(this)(e,"x")};dt(qi,{add(e){return Ui.bind(this)(e,"x")},remove(e){return Zi.bind(this)(e,!0)}});const Ki=function(e){return Ue.bind(this)(e,"y")};dt(Ki,{add(e){return Ui.bind(this)(e,"y")},remove(e){return Zi.bind(this)(e,!1)}});var lo={xgrids:qi,ygrids:Ki},co={groups(e){const t=this.internal,{config:i}=t;return st(e)||(i.data_groups=e,t.redraw()),i.data_groups}};function Ji(e,t=!1){const i=this.internal,{config:s}=i,n=s.transition_duration&&ge();return e?(s.regions=t?s.regions.concat(e):e,i.updateRegion(),i.redrawRegion(n),t?s.regions:e):s.regions}const Qi=function(e){return Ji.bind(this)(e)};dt(Qi,{add:function(e){return Ji.bind(this)(e,!0)},remove:function(e){const t=this.internal,{config:i,$T:s}=t,n=e||{},a=zt(n,"classes",[de.region]);let o=t.$el.main.select(`.${de.regions}`).selectAll(a.map(r=>`.${r}`));return s(o).style("opacity","0").remove(),o=i.regions,Object.keys(n).length?(o=o.filter(r=>{let l=!1;return r.class?(r.class.split(" ").forEach(c=>{a.indexOf(c)>=0&&(l=!0)}),!l):!0}),i.regions=o):i.regions=[],o}});var uo={regions:Qi},ho={x(e){const t=this.internal,{axis:i,data:s}=t,n=i.isCustomX()&&i.isCategorized();return G(e)&&(n?this.categories(e):(t.updateTargetX(s.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),n?this.categories():s.xs},xs(e){const t=this.internal;return B(e)&&(t.updateTargetXs(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs}},te=U(11),go=Object.defineProperty,fo=(e,t,i)=>t in e?go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ce=(e,t,i)=>fo(e,typeof t!="symbol"?t+"":t,i);class po{constructor(t){Ce(this,"owner"),Ce(this,"config"),Ce(this,"scale"),Ce(this,"charSize",{});const i=jt(),{config:s,params:n}=t;this.owner=t,this.config=s,this.scale=i,(s.noTransition||!n.config.transition_duration)&&(s.withoutTransition=!0),s.range=this.scaleExtent((n.orgXScale||i).range())}getSizeFor1Char(t,i,s=!0){const n={w:5.5,h:11.5};return this.charSize[t]&&s?this.charSize[t]:(!i.empty()&&i.text("0").call(a=>{try{const{width:o,height:r}=Kt(a.node(),!0);o&&r&&(n.w=o,n.h=r)}finally{a.text("")}}),this.charSize[t]=n,n)}getTickTransformSetter(t){const{config:i}=this,s=t==="x"?n=>`translate(${n+i.tickOffset},0)`:n=>`translate(0,${n})`;return(n,a)=>{n.attr("transform",o=>{const r=a(o);return M(o)?s(r):null})}}scaleExtent(t){const i=t[0],s=t[t.length-1];return i<s?[i,s]:[s,i]}generateTicks(t,i){const{tickStepSize:s}=this.owner.params,[n,a]=t.domain();let o=[];if(i&&s){let r=Math.round(n);for(;r<=a;)o.push(r),r+=s}else if(t.ticks){const{tickArguments:r}=this.config;if(t.type==="log"&&!r){const l=jt("_log").domain([n>0?n:1,a]).range(t.range());o=l.ticks();for(let c=a.toFixed().length;o.length>15;c--)o=l.ticks(c);o.splice(0,1,n),o.splice(o.length-1,1,a)}else o=t.ticks(...this.config.tickArguments||[]);o=o.map(l=>X(l)&&O(l)&&!isNaN(l)&&Math.round(l*10)/10||l)}return o}copyScale(){const t=this.scale.copy();return t.domain().length||t.domain(this.scale.domain()),t.type=this.scale.type,t}textFormatted(t){const i=this.config.tickFormat,s=/\d+\.\d+0{5,}\d$/.test(t)?+String(t).replace(/0+\d$/,""):t,n=i?i(s):s;return H(n)?n:""}transitionise(t){const{config:i}=this;let s=t;if(i.withoutTransition)s=t.interrupt();else if(i.transition||!this.owner.params.noTransition)try{s=t.transition(i.transition)}catch(n){}return s}}var xo=Object.defineProperty,_o=(e,t,i)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,fe=(e,t,i)=>_o(e,typeof t!="symbol"?t+"":t,i);class mo{constructor(t={}){fe(this,"helper"),fe(this,"config"),fe(this,"params"),fe(this,"g"),fe(this,"generatedTicks");const i={innerTickSize:6,outerTickSize:t.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:t.noTransition};i.tickLength=Math.max(i.innerTickSize,0)+i.tickPadding,this.config=i,this.params=t,this.helper=new po(this)}create(t){const i=this,{config:s,helper:n,params:a}=i,{scale:o}=n,{orient:r}=s,l=this.splitTickText.bind(i),c=/^(left|right)$/.test(r),u=/^(top|bottom)$/.test(r),d=n.getTickTransformSetter(u?"x":"y"),h=d===n.axisX?"y":"x",g=/^(top|left)$/.test(r)?-1:1,f=a.tickTextRotate;this.config.range=o.rangeExtent?o.rangeExtent():n.scaleExtent((a.orgXScale||o).range());const{innerTickSize:p,tickLength:_,range:x}=s,m=a.id,$=m&&/^(x|y|y2)$/.test(m)?a.config[`axis_${m}_tick_text_position`]:{x:0,y:0},b=m==="subX"?"subchart_axis_x":`axis_${m}`,v=a.config[`${b}_show`],y={tick:v?a.config[`${b}_tick_show`]:!1,text:v?a.config[`${b}_tick_text_show`]:!1},T=a.config.axis_evalTextSize;let C;t.each(function(){const A=(0,w.select)(this);let S=this.__chart__||o,R=n.copyScale();C=A,this.__chart__=R,s.tickOffset=a.isCategory?(R(1)-R(0))/2:0;const z=A.selectAll(".domain").data([0]);if(z.enter().append("path").attr("class","domain").merge(z).attr("d",()=>{const E=s.outerTickSize*g;return u?`M${x[0]},${E}V0H${x[1]}V${E}`:`M${E},${x[0]}H0V${x[1]}H${E}`}),y.tick||y.text){const E=s.tickValues||n.generateTicks(R,c||a.config.axis_rotated);i.generatedTicks=E;let P=A.selectAll(".tick").data(E,R);const F=P.enter().insert("g",".domain").attr("class","tick"),W=P.exit().remove();P=F.merge(P),y.tick&&F.append("line"),y.text&&F.append("text");const J=P.select("text"),ut=[];let at={w:0,h:0};L(T)&&(at=T.bind(i.params.owner.api)(J.node(),m),this.classList.contains(I.dummy)&&(this.sizeFor1Char=at)),(!at||at.w===0||at.h===0)&&(at=i.helper.getSizeFor1Char(r,J,!!T));let Tt=J.selectAll("tspan").data((ht,Bt)=>{const Ut=a.tickMultiline?l(ht,R,E,c,at.w):G(n.textFormatted(ht))?n.textFormatted(ht).concat():[n.textFormatted(ht)];return ut[Bt]=Ut.length,Ut.map(Zt=>({index:Bt,splitted:Zt}))});Tt.exit().remove(),Tt=Tt.enter().append("tspan").merge(Tt).text(ht=>ht.splitted),Tt.attr("x",u?0:_*g).attr("dx",(()=>{let ht=0;return/(top|bottom)/.test(r)&&f&&(ht=8*Math.sin(Math.PI*(f/180))*(r==="top"?-1:1)),ht+($.x||0)})()).attr("dy",(ht,Bt)=>{const Ut=".71em";let Zt=0;return r!=="top"&&(Zt=at.h,Bt===0&&(Zt=c?-((ut[ht.index]-1)*(at.h/2)-3):$.y===0?Ut:0)),O(Zt)&&$.y?Zt+$.y:Zt||Ut});const le=P.select("line"),pe=P.select("text");if(F.select("line").attr(`${h}2`,p*g),F.select("text").attr(h,_*g),i.setTickLineTextPosition(le,pe,at),a.tickTitle){const ht=pe.select("title");(ht.empty()?pe.append("title"):ht).text(Bt=>a.tickTitle[Bt])}if(R.bandwidth){const ht=R,Bt=ht.bandwidth()/2;S=Ut=>ht(Ut)+Bt,R=S}else S.bandwidth?S=R:d(W,R);P=a.owner.state.flowing?n.transitionise(P):a.owner.$T(P),d(F,S),d(P.style("opacity",null),R)}}),this.g=C}getGeneratedTicks(t){var i;const s=((i=this.generatedTicks)==null?void 0:i.length)-1;let n=this.generatedTicks;if(s>t){const a=Math.round(s/t+.1);n=this.generatedTicks.map((o,r)=>r%a===0?o:null).filter(o=>o!==null).splice(0,t)}return n}getTickXY(){const{config:t}=this,i={x:0,y:0};return this.params.isCategory&&(i.x=t.tickCentered?0:t.tickOffset,i.y=t.tickCentered?t.tickOffset:0),i}getTickSize(t){const{scale:i}=this.helper,{config:s}=this,{innerTickSize:n,range:a}=s,o=i(t)+(s.tickCentered?0:s.tickOffset);return a[0]<o&&o<a[1]?n:0}setTickLineTextPosition(t,i,s){const n=this.getTickXY(),{innerTickSize:a,orient:o,tickLength:r,tickOffset:l}=this.config,c=this.params.id,u=this.params.tickTextRotate,d=6,h=s.h/2-d,g=$=>{const b=["start","end"];return o==="top"&&b.reverse(),$?b[$>0?0:1]:"middle"},f=$=>$?`rotate(${$})`:null,p=$=>{const b=$/(o==="bottom"?15:23);return $?11.5-2.5*b*($>0?1:-1):r},{config:{axis_rotated:_,axis_x_tick_text_inner:x}}=this.params.owner,m=this.params.config[`axis_${c}_tick_inner`];switch(o){case"bottom":t.attr("x1",n.x).attr("x2",n.x).attr("y2",$=>this.getTickSize.bind(this)($)*(m?-1:1)),i.attr("x",0).attr("y",p(u)).style("text-anchor",g(u)).style("text-anchor",($,b,{length:v})=>!_&&b===0&&(x===!0||x.first)?"start":!_&&b===v-1&&(x===!0||x.last)?"end":g(u)).attr("transform",f(u));break;case"top":t.attr("x2",0).attr("y2",m?a:-a),i.attr("x",0).attr("y",-(p(u)+h+d)).style("text-anchor",g(u)).attr("transform",f(u));break;case"left":t.attr("x2",m?a:-a).attr("y1",n.y).attr("y2",n.y),i.attr("x",-r).attr("y",l+(_?h/4:h)).style("text-anchor","end");break;case"right":t.attr("x2",m?-a:a).attr("y2",0),i.attr("x",r).attr("y",h).style("text-anchor","start")}}splitTickText(t,i,s,n,a){const{params:o}=this,r=this.helper.textFormatted(t),l=X(r)&&r.indexOf(`
31
31
  `)>-1?r.split(`
32
32
  `):[];if(l.length)return l;if(G(r))return r;let c=o.tickWidth;(!c||c<=0)&&(c=n?95:o.isCategory?(o.isInverted?i(s[0])-i(s[1]):i(s[1])-i(s[0]))-12:110);function u(d,h){let g,f,p;for(let _=1;_<h.length;_++)if(h.charAt(_)===" "&&(f=_),g=h.substr(0,_+1),p=a*g.length,c<p)return u(d.concat(h.substr(0,f||_)),h.slice(f?f+1:_));return d.concat(h)}return u(l,String(r))}scale(t){return arguments.length?(this.helper.scale=t,this):this.helper.scale}orient(t){return arguments.length?(this.config.orient=t in{top:1,right:1,bottom:1,left:1}?String(t):"bottom",this):this.config.orient}tickFormat(t){const{config:i}=this;return arguments.length?(i.tickFormat=t,this):i.tickFormat}tickCentered(t){const{config:i}=this;return arguments.length?(i.tickCentered=t,this):i.tickCentered}tickOffset(){return this.config.tickOffset}tickInterval(t){var i;const{outerTickSize:s,tickOffset:n,tickValues:a}=this.config;let o;if(this.params.isCategory)o=n*2;else{const r=(i=this.params.owner.scale.zoom)!=null?i:this.helper.scale;o=(this.g.select("path.domain").node().getTotalLength()-s*2)/(t||this.g.selectAll("line").size());const c=a?a.map((u,d,h)=>{const g=d+1;return g<h.length?r(h[g])-r(u):null}).filter(Boolean):[];o=Math.min(...c,o)}return o===1/0?0:o}ticks(...t){const{config:i}=this;return t.length?(i.tickArguments=Vt(t),this):i.tickArguments}tickCulling(t){const{config:i}=this;return arguments.length?(i.tickCulling=t,this):i.tickCulling}tickValues(t){const{config:i}=this;if(L(t))i.tickValues=()=>t(this.helper.scale.domain());else{if(!arguments.length)return i.tickValues;i.tickValues=t}return this}setTransition(t){return this.config.transition=t,this}}var $o=Object.defineProperty,yo=(e,t,i)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Pt=(e,t,i)=>yo(e,typeof t!="symbol"?t+"":t,i),bo={getAxisInstance:function(){return this.axis||new vo(this)}};class vo{constructor(t){Pt(this,"owner"),Pt(this,"x"),Pt(this,"subX"),Pt(this,"y"),Pt(this,"y2"),Pt(this,"axesList",{}),Pt(this,"tick",{x:null,y:null,y2:null}),Pt(this,"xs",[]),Pt(this,"orient",{x:"bottom",y:"left",y2:"right",subX:"bottom"}),this.owner=t,this.setOrient()}getAxisClassName(t){return`${ot.axis} ${ot[`axis${pt(t)}`]}`}isHorizontal(t,i){const s=t.config.axis_rotated;return i?s:!s}isCategorized(){const{config:t,state:i}=this.owner;return t.axis_x_type.indexOf("category")>=0||i.hasRadar}isCustomX(){const{config:t}=this.owner;return!this.isTimeSeries()&&(t.data_x||nt(t.data_xs))}isTimeSeries(t="x"){return this.owner.config[`axis_${t}_type`]==="timeseries"}isLog(t="x"){return this.owner.config[`axis_${t}_type`]==="log"}isTimeSeriesY(){return this.isTimeSeries("y")}getAxisType(t="x"){let i="linear";return this.isTimeSeries(t)?i=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(t)&&(i="log"),i}getExtent(){const t=this.owner,{config:i,scale:s}=t;let n=i.axis_x_extent;if(n){if(L(n))n=n.bind(t.api)(t.getXDomain(t.data.targets),s.subX);else if(this.isTimeSeries()&&n.every(isNaN)){const a=vt.bind(t);n=n.map(o=>s.subX(a(o)))}}return n}init(){const t=this.owner,{config:i,$el:{main:s,axis:n},state:{clip:a}}=t,o=["x","y"];i.axis_y2_show&&o.push("y2"),o.forEach(r=>{const l=this.getAxisClassName(r);n[r]=s.append("g").attr("class",l).attr("clip-path",()=>{let c=null;return r==="x"?c=a.pathXAxis:r==="y"&&(c=a.pathYAxis),c}).attr("transform",t.getTranslate(r)).style("visibility",i[`axis_${r}_show`]?null:"hidden"),this.generateAxes(r)})}setOrient(){const t=this.owner,{axis_rotated:i,axis_y_inner:s,axis_y2_inner:n}=t.config;this.orient={x:i?"left":"bottom",y:i?s?"top":"bottom":s?"right":"left",y2:i?n?"bottom":"top":n?"left":"right",subX:i?"left":"bottom"}}generateAxes(t){const i=this.owner,{config:s}=i,n=[],a=s[`axis_${t}_axes`],o=s.axis_rotated;let r;t==="x"?r=o?te.axisLeft:te.axisBottom:t==="y"?r=o?te.axisBottom:te.axisLeft:t==="y2"&&(r=o?te.axisTop:te.axisRight),a.length&&a.forEach(l=>{const c=l.tick||{},u=i.scale[t].copy();l.domain&&u.domain(l.domain),n.push(r(u).ticks(c.count).tickFormat(L(c.format)?c.format.bind(i.api):(d=>d)).tickValues(c.values).tickSizeOuter(c.outer===!1?0:6))}),this.axesList[t]=n}updateAxes(){const t=this.owner,{config:i,$el:{main:s},$T:n}=t;Object.keys(this.axesList).forEach(a=>{const o=i[`axis_${a}_axes`],r=t.scale[a].copy(),l=r.range();this.axesList[a].forEach((c,u)=>{const d=c.scale().range();l.every((f,p)=>f===d[p])||c.scale().range(l);const h=`${this.getAxisClassName(a)}-${u+1}`;let g=s.select(`.${h.replace(/\s/,".")}`);g.empty()?g=s.append("g").attr("class",h).style("visibility",i[`axis_${a}_show`]?null:"hidden").call(c):(o[u].domain&&r.domain(o[u].domain),n(g).call(c.scale(r))),g.attr("transform",t.getTranslate(a,u+1))})})}setAxis(t,i,s,n){const a=this.owner;t!=="subX"&&(this.tick[t]=this.getTickValues(t)),this[t]=this.getAxis(t,i,s,t==="x"&&(a.scale.zoom||a.config.subchart_show||a.state.resizing)?!0:n)}getAxis(t,i,s,n,a){const o=this.owner,{config:r}=o,l=/^(x|subX)$/.test(t),c=l?"x":t,u=l&&this.isCategorized(),d=this.orient[t],h=a?0:o.getAxisTickRotate(c);let g;if(l)g=t==="subX"?o.format.subXAxisTick:o.format.xAxisTick;else{const m=r[`axis_${t}_tick_format`];L(m)&&(g=m.bind(o.api))}let f=this.tick[c];const p=Jt({outerTick:s,noTransition:n,config:r,id:t,tickTextRotate:h,owner:o},l&&{isCategory:u,isInverted:r.axis_x_inverted,tickMultiline:r.axis_x_tick_multiline,tickWidth:r.axis_x_tick_width,tickTitle:u&&r.axis_x_tick_tooltip&&o.api.categories(),orgXScale:o.scale.x});l||(p.tickStepSize=r[`axis_${c}_tick_stepSize`]);const _=new mo(p).scale(l&&o.scale.zoom||i).orient(d);if(l&&this.isTimeSeries()&&f&&!L(f)){const m=vt.bind(o);f=f.map($=>m($))}else!l&&this.isTimeSeriesY()&&(_.ticks(r.axis_y_tick_time_value),f=null);f&&_.tickValues(f),_.tickFormat(g||!l&&o.isStackNormalized()&&(m=>`${m}%`)),u&&(_.tickCentered(r.axis_x_tick_centered),wt(r.axis_x_tick_culling)&&(r.axis_x_tick_culling=!1));const x=r[`axis_${c}_tick_count`];return x&&_.ticks(x),_}updateXAxisTickValues(t,i){var s;const n=this.owner,{config:a}=n,o=a.axis_x_tick_fit;let r=a.axis_x_tick_count,l;return(o||r&&o)&&(l=n.mapTargetsToUniqueXs(t),this.isCategorized()&&r>l.length&&(r=l.length),l=this.generateTickValues(l,r,this.isTimeSeries())),i?i.tickValues(l):this.x&&(this.x.tickValues(l),(s=this.subX)==null||s.tickValues(l)),l}getId(t){const{config:i,scale:s}=this.owner;let n=i.data_axes[t];return(!n||!s[n])&&(n="y"),n}getXAxisTickFormat(t){const i=this.owner,{config:s,format:n}=i,a=t&&s.subchart_axis_x_tick_format||s.axis_x_tick_format,o=this.isTimeSeries(),r=this.isCategorized();let l;return a?L(a)?l=a.bind(i.api):o&&(l=c=>c?n.axisTime(a)(c):""):l=o?n.defaultAxisTime:r?i.categoryName:c=>c<0?c.toFixed(0):c,L(l)?c=>l.apply(i,r?[c,i.categoryName(c)]:[c]):l}getTickValues(t){const i=this.owner,s=i.config[`axis_${t}_tick_values`],n=i[`${t}Axis`];return(L(s)?s.call(i.api):s)||(n?n.tickValues():void 0)}getLabelOptionByAxisId(t){return this.owner.config[`axis_${t}_label`]}getLabelText(t){const i=this.getLabelOptionByAxisId(t);return X(i)?i:i?i.text:null}setLabelText(t,i){const s=this.owner,{config:n}=s,a=this.getLabelOptionByAxisId(t);X(a)?n[`axis_${t}_label`]=i:a&&(a.text=i)}getLabelPosition(t,i){const s=this.owner.config.axis_rotated,n=this.getLabelOptionByAxisId(t),a=Rt(n)&&n.position?n.position:i[+!s],o=r=>!!~a.indexOf(r);return{isInner:o("inner"),isOuter:o("outer"),isLeft:o("left"),isCenter:o("center"),isRight:o("right"),isTop:o("top"),isMiddle:o("middle"),isBottom:o("bottom")}}getAxisLabelPosition(t){return this.getLabelPosition(t,t==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])}getLabelPositionById(t){return this.getAxisLabelPosition(t)}xForAxisLabel(t){const i=this.owner,{state:{width:s,height:n}}=i,a=this.getAxisLabelPosition(t);let o=a.isMiddle?-n/2:0;return this.isHorizontal(i,t!=="x")?o=a.isLeft?0:a.isCenter?s/2:s:a.isBottom&&(o=-n),o}textAnchorForAxisLabel(t){const i=this.owner,s=this.getAxisLabelPosition(t);let n=s.isMiddle?"middle":"end";return this.isHorizontal(i,t!=="x")?n=s.isLeft?"start":s.isCenter?"middle":"end":s.isBottom&&(n="start"),n}dxForAxisLabel(t){const i=this.owner,s=this.getAxisLabelPosition(t);let n=s.isBottom?"0.5em":"0";return this.isHorizontal(i,t!=="x")?n=s.isLeft?"0.5em":s.isRight?"-0.5em":"0":s.isTop&&(n="-0.5em"),n}dyForAxisLabel(t){const i=this.owner,{config:s}=i,n=s.axis_rotated,a=this.getAxisLabelPosition(t).isInner,o=s[`axis_${t}_tick_rotate`]?i.getHorizontalAxisHeight(t):0,{width:r}=this.getMaxTickSize(t);let l;if(t==="x"){const c=s.axis_x_height;n?l=a?"1.2em":-25-r:a?l="-0.5em":c?l=c-10:o?l=o-10:l="3em"}else l={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[t],n?a?l=l[0]:o?l=o*(t==="y2"?-1:1)-l[1]:l=l[2]:l=a?l[3]:(l[4]+(s[`axis_${t}_inner`]?0:r+l[4]))*(t==="y"?-1:1);return l}getMaxTickSize(t,i){const s=this.owner,{config:n,state:{current:a,resizing:o},$el:{svg:r,chart:l}}=s,c=a.maxTickSize[t],u=`axis_${t}`,d={width:0,height:0};if(o||i||!n[`${u}_show`]||c.width>0&&s.filterTargetsToShow().length===0)return c;if(r){const h=/^y2?$/.test(t),g=s.filterTargetsToShow(s.data.targets),f=s.scale[t].copy().domain(s[`get${h?"Y":"X"}Domain`](g,t)),p=f.domain(),_=p[0]===p[1]&&p.every(A=>A>0),x=G(c.domain)&&c.domain[0]===c.domain[1]&&c.domain.every(A=>A>0);if(_||x)return c.size;c.domain=p,h||c.ticks.splice(0);const m=this.getAxis(t,f,!1,!1,!0),$=n[`${u}_tick_rotate`],b=n[`${u}_tick_count`];!n[`${u}_tick_values`]&&b&&m.tickValues(this.generateTickValues(p,b,h?this.isTimeSeriesY():this.isTimeSeries())),!h&&this.updateXAxisTickValues(g,m);const y=l.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0"),T=y.append("g").attr("class",`${ot[`axis${pt(t)}`]} ${I.dummy}`);m.create(T);const{sizeFor1Char:C}=T.node();y.selectAll("text").attr("transform",O($)?`rotate(${$})`:null).each(function(A,S){const{width:R,height:z}=C?{width:this.textContent.length*C.w,height:C.h}:ct(this,!0);d.width=Math.max(d.width,R),d.height=Math.max(d.height,z),h||(c.ticks[S]=R)}),y.remove()}return Object.keys(d).forEach(h=>{d[h]>0&&(c[h]=d[h])}),c}getXAxisTickTextY2Overflow(t){const i=this.owner,{axis:s,config:n,state:{current:a,isLegendRight:o,legendItemWidth:r}}=i,l=i.getAxisTickRotate("x"),c=l>0&&l<90;if((s.isCategorized()||s.isTimeSeries())&&n.axis_x_tick_fit&&(!n.axis_x_tick_culling||wt(n.axis_x_tick_culling))&&!n.axis_x_tick_multiline&&c){const u=n.axis_y2_show&&a.maxTickSize.y2.width||0,d=o&&r||0,h=a.width-i.getCurrentPaddingByDirection("left"),g=this.getXAxisTickMaxOverflow(l,h-t)-u-d,f=Math.max(0,g)+t;return Math.min(f,h/2)}return 0}getXAxisTickMaxOverflow(t,i){const s=this.owner,{axis:n,config:a,state:o}=s,r=n.isTimeSeries(),l=o.current.maxTickSize.x.ticks,c=l.length,{left:u,right:d}=o.axis.x.padding;let h=0;const g=c-(r&&a.axis_x_tick_fit?.5:0);for(let _=0;_<c;_++){const x=_+1,m=Math.cos(Math.PI*t/180)*l[_],$=x-(r?1:.5)+u;if($<=0)continue;const v=(i-m)/$,y=g-x,T=d*v,C=y*v+T,A=m-v/2-C;h=Math.max(h,A)}const f=s.filterTargetsToShow(s.data.targets);let p=0;if(!r&&a.axis_x_tick_count<=f.length&&f[0].values.length){const _=jt(s.axis.getAxisType("x"),0,i-h).domain([u*-1,s.getXDomainMax(s.data.targets)+1+d]);p=(_(1)-_(0))/2}return h+p}updateLabels(t){const i=this.owner,{config:s,$el:{main:n},$T:a}=i,o=s.axis_rotated;["x","y","y2"].forEach(r=>{const l=this.getLabelText(r),c=`axis${pt(r)}`,u=ot[`${c}Label`];if(l){let d=n.select(`text.${u}`);d.empty()&&(d=n.select(`g.${ot[c]}`).insert("text",":first-child").attr("class",u).attr("transform",["rotate(-90)",null][r==="x"?+!o:+o]).style("text-anchor",()=>this.textAnchorForAxisLabel(r))),a(d,t).attr("x",()=>this.xForAxisLabel(r)).attr("dx",()=>this.dxForAxisLabel(r)).attr("dy",()=>this.dyForAxisLabel(r)).text(l)}})}getPadding(t,i,s,n){const a=O(t)?t:t[i];return M(a)?this.owner.convertPixelToScale(/(bottom|top)/.test(i)?"y":"x",a,n):s}generateTickValues(t,i,s){let n=t;if(i){const a=L(i)?i():i;if(a===1)n=[t[0]];else if(a===2)n=[t[0],t[t.length-1]];else if(a>2){const o=this.isCategorized(),r=a-2,l=t[0],c=t[t.length-1],u=(c-l)/(r+1);let d;n=[l];for(let h=0;h<r;h++)d=+l+u*(h+1),n.push(s?new Date(d):o?Math.round(d):d);n.push(c)}}return s||(n=n.sort((a,o)=>a-o)),n}generateTransitions(t){const i=this.owner,{$el:{axis:s},$T:n}=i,[a,o,r,l]=["x","y","y2","subX"].map(c=>n(s[c],t));return{axisX:a,axisY:o,axisY2:r,axisSubX:l}}redraw(t,i,s){const n=this.owner,{config:a,state:o,$el:r}=n,l=i?"0":null;["x","y","y2","subX"].forEach(c=>{const u=this[c],d=r.axis[c];u&&d&&(!s&&!a.transition_duration&&(u.config.withoutTransition=!0),d.style("opacity",l),u.create(t[`axis${pt(c)}`]))}),this.updateAxes(),!o.rendered&&a.axis_tooltip&&this.setAxisTooltip()}redrawAxis(t,i,s,n,a){var o,r,l;const c=this.owner,{config:u,scale:d,$el:h}=c,g=!!d.zoom;let f;!g&&this.isCategorized()&&t.length===0&&d.x.domain([0,h.axis.x.selectAll(".tick").size()]),d.x&&t.length?(!g&&c.updateXDomain(t,i.UpdateXDomain,i.UpdateOrgXDomain,i.TrimXDomain),u.axis_x_tick_values||this.updateXAxisTickValues(t)):this.x&&(this.x.tickValues([]),(o=this.subX)==null||o.tickValues([])),u.zoom_rescale&&!n&&(f=d.x.orgDomain()),["y","y2"].forEach(p=>{const _=`axis_${p}_`,x=d[p];if(x){const m=u[`${_}tick_values`],$=u[`${_}tick_count`];if(x.domain(c.getYDomain(t,p,f)),!m&&$){const b=c.axis[p],v=x.domain();b.tickValues(this.generateTickValues(v,v.every(y=>y===0)?1:$,this.isTimeSeriesY()))}}}),this.redraw(s,c.hasArcType(),a),this.updateLabels(i.Transition),(i.UpdateXDomain||i.UpdateXAxis||i.Y)&&t.length&&this.setCulling(),i.Y&&((r=d.subY)==null||r.domain(c.getYDomain(t,"y")),(l=d.subY2)==null||l.domain(c.getYDomain(t,"y2")))}setCulling(){const t=this.owner,{config:i,state:{clip:s,current:n},$el:a}=t;["subX","x","y","y2"].forEach(o=>{const r=a.axis[o],c=`axis_${o==="subX"?"x":o}_tick_culling`,u=i[c];if(r&&u){const d=r.selectAll(".tick"),h=Qt(d.data(),!i[`${c}_reverse`]),g=h.length,f=i[`${c}_max`],p=i[`${c}_lines`];let _;if(g){for(let x=1;x<g;x++)if(g/x<f){_=x;break}d.each(function(x){const m=p?this.querySelector("text"):this;m&&(m.style.display=h.indexOf(x)%_?"none":null)})}else d.style("display",null);if(o==="x"){const x=n.maxTickSize.x.clipPath?s.pathXAxisTickTexts:null;a.svg.selectAll(`.${ot.axisX} .tick text`).attr("clip-path",x)}}})}setAxisTooltip(){var t;const i=this.owner,{config:{axis_rotated:s,axis_tooltip:n},$el:{axis:a,axisTooltip:o}}=i,r=(t=n.backgroundColor)!=null?t:"black";i.generateTextBGColorFilter(r,{x:-.15,y:-.2,width:1.3,height:1.3}),["x","y","y2"].forEach(l=>{var c,u,d;if(X(r)||r[l])if(o[l]=(c=a[l])==null?void 0:c.append("text").classed(ot[`axis${l.toUpperCase()}Tooltip`],!0).attr("filter",i.updateTextBGColor({id:l},r)),s){const h=l==="x"?"x":"y",g=l==="y"?"1.15em":l==="x"?"-0.3em":"-0.4em";(u=o[l])==null||u.attr(h,g).attr(`d${l==="x"?"y":"x"}`,l==="x"?"0.4em":"-1.3em").style("text-anchor",l==="x"?"end":null)}else{const h=l==="x"?"y":"x",g=l==="x"?"1.15em":`${l==="y"?"-":""}0.4em`;(d=o[l])==null||d.attr(h,g).attr(`d${l==="x"?"x":"y"}`,l==="x"?"-1em":"0.3em").style("text-anchor",l==="y"?"end":null)}})}}var To={initEventRect(){this.$el.main.select(`.${I.chart}`).append("g").attr("class",At.eventRects).style("fill-opacity","0")},redrawEventRect(){var e;const t=this,{config:i,state:s,$el:n}=t,a=t.isMultipleX(),o=i.axis_x_inverted;if(n.eventRect)t.updateEventRect(n.eventRect,!0);else if(t.data.targets.length){const l=t.$el.main.select(`.${At.eventRects}`).style("cursor",i.zoom_enabled&&i.zoom_type!=="drag"?i.axis_rotated?"ns-resize":"ew-resize":null).classed(At.eventRectsMultiple,a).classed(At.eventRectsSingle,!a).selectAll(`.${At.eventRect}`).data([0]).enter().append("rect");t.updateEventRect(l),t.updateEventType(l),l.call(t.getDraggableSelection()),n.eventRect=l,t.state.inputType==="touch"&&!n.svg.on("touchstart.eventRect")&&!t.hasArcType()&&t.bindTouchOnEventRect(),s.rendered&&t.updateEventRect(n.eventRect,!0)}if(!a){const r=t.getMaxDataCountTarget();(!i.data_xSort||o)&&r.sort((l,c)=>o?c.x-l.x:l.x-c.x),t.updateDataIndexByX(r),t.updateXs(r),(e=t.updatePointClass)==null||e.call(t,!0),s.eventReceiver.data=r}t.updateEventRectData()},bindTouchOnEventRect(){const e=this,{config:t,state:i,$el:{eventRect:s,svg:n}}=e,a=h=>{if(e.isMultipleX())e.selectRectForMultipleXs(h);else{const g=e.getDataIndexFromEvent(i.event);e.callOverOutForTouch(g),g===-1?e.unselectRect():e.selectRectForSingle(h,g)}},o=()=>{e.unselectRect(),e.callOverOutForTouch()},r=t.interaction_inputType_touch.preventDefault,l=De(r)&&r||!1,c=!isNaN(r)&&r||null;let u;const d=h=>{const g=h.type,p=h.changedTouches[0][`client${t.axis_rotated?"Y":"X"}`];g==="touchstart"?l?h.preventDefault():c!==null&&(u=p):g==="touchmove"&&(l||u===!0||c!==null&&Math.abs(u-p)>=c)&&(u=!0,h.preventDefault())};s.on("touchstart",h=>{i.event=h,e.updateEventRect()}).on("touchstart.eventRect touchmove.eventRect",h=>{if(i.event=h,!s.empty()&&s.classed(At.eventRect)){if(i.dragging||i.flowing||e.hasArcType()||h.touches.length>1)return;d(h),a(s.node())}else o()},!0).on("touchend.eventRect",h=>{i.event=h,!s.empty()&&s.classed(At.eventRect)&&(e.hasArcType()||!e.toggleShape||i.cancelClick)&&i.cancelClick&&(i.cancelClick=!1)},!0),n.on("touchstart",h=>{i.event=h;const{target:g}=h;g&&g!==s.node()&&o()})},updateEventRect(e,t=!1){const i=this,{state:s,$el:n}=i,{eventReceiver:a,width:o,height:r,rendered:l,resizing:c}=s,u=e||n.eventRect,d=()=>{if(a){const h=xi(n.chart.node());a.rect=ct(u.node(),!0).toJSON(),a.rect.top+=h.y,a.rect.left+=h.x}};(!l||c||t)&&(u.attr("x",0).attr("y",0).attr("width",o).attr("height",r),(!l||t)&&u.classed(At.eventRect,!0)),d()},updateEventType(e){const t=this,i=De(e),s=i?t.$el.eventRect:e,n=i?e!==(s==null?void 0:s.datum().multipleX):!1;s&&(n&&(s==null||s.on("mouseover mousemove mouseout click",null)),t.isMultipleX()?t.generateEventRectsForMultipleXs(s):t.generateEventRectsForSingleX(s))},updateEventRectData(){const e=this,{config:t,scale:i,state:s}=e,n=i.zoom||i.x,a=t.axis_rotated,o=e.isMultipleX();let r,l,c,u;if(e.updateEventType(o),o)r=0,l=0,c=s.width,u=s.height;else{let g,f;if(e.axis.isCategorized())g=e.getEventRectWidth(),f=p=>n(p.x)-g/2;else{const p=({index:_})=>({prev:e.getPrevX(_),next:e.getNextX(_)});g=_=>{const x=p(_),m=n.domain();let $;return x.prev===null&&x.next===null?$=a?s.height:s.width:x.prev===null?$=(n(x.next)+n(_.x))/2:x.next===null?$=n(m[1])-(n(x.prev)+n(_.x))/2:(Object.keys(x).forEach((b,v)=>{var y;x[b]=(y=x[b])!=null?y:m[v]}),$=Math.max(0,(n(x.next)-n(x.prev))/2)),$},f=_=>{const x=p(_);let m;return x.prev===null&&x.next===null?m=0:x.prev===null?m=n(n.domain()[0]):m=(n(_.x)+n(x.prev))/2,m}}r=a?0:f,l=a?f:0,c=a?s.width:g,u=a?g:s.height}const{eventReceiver:d}=s,h=(g,f)=>L(g)?g(f):g;d.coords.splice(d.data.length),d.data.forEach((g,f)=>{d.coords[f]={x:h(r,g),y:h(l,g),w:h(c,g),h:h(u,g)}})},selectRectForSingle(e,t){var i,s;const n=this,{config:a,$el:{main:o,circle:r}}=n,l=a.data_selection_enabled,c=a.data_selection_grouped,u=a.data_selection_isselectable,d=a.tooltip_grouped,h=n.getAllValuesOnIndex(t);if(d&&(n.showTooltip(h,e),(i=n.showGridFocus)==null||i.call(n,h),!l||c))return;!r&&o.selectAll(`.${I.EXPANDED}:not(.${it.shape}-${t})`).classed(I.EXPANDED,!1);const g=o.selectAll(`.${it.shape}-${t}`).classed(I.EXPANDED,!0).style("cursor",u?"pointer":null).filter(function(f){return n.isWithinShape(this,f)});g.empty()&&!d&&a.interaction_onout&&((s=n.hideGridFocus)==null||s.call(n),n.hideTooltip(),!c&&n.setExpand(t)),g.call(f=>{var p,_;const x=f.data();l&&(c||u!=null&&u.bind(n.api)(x))&&(e.style.cursor="pointer"),d||(n.showTooltip(x,e),(p=n.showGridFocus)==null||p.call(n,x),(_=n.unexpandCircles)==null||_.call(n),f.each(m=>n.setExpand(t,m.id)))})},selectRectForMultipleXs(e,t=!0){const i=this,{config:s,state:n}=i,a=i.filterTargetsToShow(i.data.targets);if(n.dragging||i.hasArcType(a))return;const o=bt(n.event,e),r=i.findClosestFromTargets(a,o);if(t&&n.mouseover&&(!r||r.id!==n.mouseover.id)&&(s.data_onout.call(i.api,n.mouseover),n.mouseover=void 0),!r){i.unselectRect();return}const c=(i.isBubbleType(r)||i.isScatterType(r)||!s.tooltip_grouped?[r]:i.filterByX(a,r.x)).map(d=>i.addName(d));i.showTooltip(c,e),i.setExpand(r.index,r.id,!0),i.showGridFocus(c);const u=i.dist(r,o);(i.isBarType(r.id)||u<i.getPointSensitivity(r))&&(i.$el.svg.select(`.${At.eventRect}`).style("cursor","pointer"),t&&!n.mouseover&&(s.data_onover.call(i.api,r),n.mouseover=r))},unselectRect(){const e=this,{$el:{circle:t,tooltip:i}}=e;e.$el.svg.select(`.${At.eventRect}`).style("cursor",null),e.hideGridFocus(),i&&(e.hideTooltip(),e._handleLinkedCharts(!1)),t&&!e.isPointFocusOnly()&&e.unexpandCircles(),e.expandBarTypeShapes(!1)},generateEventRectsForSingleX(e){const t=this,{config:i,state:s}=t,{eventReceiver:n}=s,a=e.style("cursor",i.data_selection_enabled&&i.data_selection_grouped?"pointer":null).on("click",function(o){s.event=o;const{currentIdx:r,data:l}=n,c=l[r===-1?t.getDataIndexFromEvent(o):r];t.clickHandlerForSingleX.bind(this)(c,t)}).datum({multipleX:!1});if(s.inputType==="mouse"){const o=r=>{const l=r?t.getDataIndexFromEvent(r):n.currentIdx;return l>-1?n.data[l]:null};a.on("mouseover",r=>{s.event=r,t.updateEventRect(),Object.values(t.$el.axisTooltip).forEach(l=>l==null?void 0:l.style("display",null))}).on("mousemove",function(r){const l=o(r);if(s.event=r,!l)return;let{index:c}=l;const u=i.line_step_type;if(i.line_step_tooltipMatch&&t.hasType("step")&&/^step\-(before|after)$/.test(u)){const h=t.scale.zoom||t.scale.x,g=t.axis.xs[c],f=h.invert(bt(r,this)[0]);u==="step-after"&&f<g?c-=1:u==="step-before"&&f>g&&(c+=1)}t.showAxisGridFocus();const d=i.tooltip_grouped&&c===n.currentIdx;if(s.dragging||s.flowing||t.hasArcType()||d){i.tooltip_show&&d&&t.setTooltipPosition();return}c!==n.currentIdx&&(t.setOverOut(!1,n.currentIdx),n.currentIdx=c),c===-1?t.unselectRect():t.selectRectForSingle(this,c),t.setOverOut(c!==-1,c)}).on("mouseout",r=>{s.event=r,!(!i||t.hasArcType()||n.currentIdx===-1||!i.interaction_onout)&&(t.hideAxisGridFocus(),t.unselectRect(),t.setOverOut(!1,n.currentIdx),n.currentIdx=-1)})}return a},clickHandlerForSingleX(e,t){const i=t,{config:s,state:n,$el:{main:a}}=i;if(!e||i.hasArcType()||n.cancelClick){n.cancelClick&&(n.cancelClick=!1);return}const{index:o}=e;a.selectAll(`.${it.shape}-${o}`).each(function(r){var l;(s.data_selection_grouped||i.isWithinShape(this,r))&&((l=i.toggleShape)==null||l.call(i,this,r,o),s.data_onclick.bind(i.api)(r,this))})},generateEventRectsForMultipleXs(e){const t=this,{config:i,state:s}=t;e.on("click",function(n){s.event=n,t.clickHandlerForMultipleXS.bind(this)(t)}).datum({multipleX:!0}),s.inputType==="mouse"&&e.on("mouseover mousemove",function(n){s.event=n,t.selectRectForMultipleXs(this)}).on("mouseout",n=>{s.event=n,!(!t.config||t.hasArcType()||!i.interaction_onout)&&t.unselectRect()})},clickHandlerForMultipleXS(e){const t=e,{config:i,state:s}=t,n=t.filterTargetsToShow(t.data.targets);if(t.hasArcType(n))return;const a=bt(s.event,this),o=t.findClosestFromTargets(n,a),r=t.getPointSensitivity(o);o&&(t.isBarType(o.id)||t.dist(o,a)<r)&&t.$el.main.selectAll(`.${it.shapes}${t.getTargetSelectorSuffix(o.id)}`).selectAll(`.${it.shape}-${o.index}`).each(function(){var l;(i.data_selection_grouped||t.isWithinShape(this,o))&&((l=t.toggleShape)==null||l.call(t,this,o,o.index),i.data_onclick.bind(t.api)(o,this))})}},Ao=U(12),wo={generateFlow(e){const t=this,{data:i,state:s,$el:n}=t;return function(){const a=e.flow.length;s.flowing=!0,i.targets.forEach(r=>{r.values.splice(0,a)}),t.updateXGrid&&t.updateXGrid(!0);const o={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(r=>{const l=r.split(".");let c=n[l[0]];c&&l.length>1&&(c=c[l[1]]),c!=null&&c.size()&&(o[r]=c)}),t.hideGridFocus(),t.setFlowList(o,e)}},setFlowList(e,t){const i=this,{flow:s,targets:n}=t,{duration:a=t.duration,index:o,length:r,orgDataCount:l}=s,c=i.getFlowTransform(n,l,o,r),u=Ai();let d;u.add(Object.keys(e).map(h=>(d=e[h].transition().ease(Ao.easeLinear).duration(a),h==="axis.x"?d=d.call(g=>{i.axis.x.setTransition(g).create(g)}):h==="region.list"?d=d.filter(i.isRegionOnX).attr("transform",c):d=d.attr("transform",c),d))),d.call(u,()=>{i.cleanUpFlow(e,t)})},cleanUpFlow(e,t){const i=this,{config:s,state:n,$el:{svg:a}}=i,o=s.axis_rotated,{flow:r,shape:l,xv:c}=t,{cx:u,cy:d,xForText:h,yForText:g}=l.pos,{done:f=()=>{},length:p}=r;p&&(["circle","text","shape","eventRect"].forEach(_=>{const x=[];for(let m=0;m<p;m++)x.push(`.${N[_]}-${m}`);a.selectAll(`.${N[`${_}s`]}`).selectAll(x).remove()}),a.select(`.${N.xgrid}`).remove()),Object.keys(e).forEach(_=>{const x=e[_];if(_!=="axis.x"&&x.attr("transform",null),_==="grid.x")x.attr(n.xgridAttr);else if(_==="gridLines.x")x.attr("x1",o?0:c).attr("x2",o?n.width:c),x.select("text").attr("x",o?n.width:0).attr("y",c);else if(/^(area|bar|line)$/.test(_))x.attr("d",l.type[_]);else if(_==="text")x.attr("x",h).attr("y",g).style("fill-opacity",i.opacityForText.bind(i));else if(_==="circle")if(i.isCirclePoint())x.attr("cx",u).attr("cy",d);else{const m=b=>u(b)-s.point_r,$=b=>d(b)-s.point_r;x.attr("x",m).attr("y",$)}else _==="region.list"&&x.select("rect").filter(i.isRegionOnX).attr("x",i.regionX.bind(i)).attr("width",i.regionWidth.bind(i))}),s.interaction_enabled&&i.redrawEventRect(),f.call(i.api),n.flowing=!1},getFlowTransform(e,t,i,s){const n=this,{data:a,scale:{x:o}}=n,r=a.targets[0].values;let l=n.getValueOnIndex(r,i),c=n.getValueOnIndex(r,i+s),u;const d=o.domain(),h=n.updateXDomain(e,!0,!0);t?t===1||(l==null?void 0:l.x)===(c==null?void 0:c.x)?u=o(d[0])-o(h[0]):u=n.axis.isTimeSeries()?o(d[0])-o(h[0]):o((l==null?void 0:l.x)||0)-o(c.x):r.length!==1?u=o(d[0])-o(h[0]):n.axis.isTimeSeries()?(l=n.getValueOnIndex(r,0),c=n.getValueOnIndex(r,r.length-1),u=o(l.x)-o(c.x)):u=Gt(h)/2;const g=Gt(d)/Gt(h);return`translate(${u},0) scale(${g},1)`}},So={initClip(){const e=this,{clip:t,datetimeId:i}=e.state;t.id=`${i}-clip`,t.idXAxis=`${t.id}-xaxis`,t.idYAxis=`${t.id}-yaxis`,t.idGrid=`${t.id}-grid`,t.path=e.getClipPath(t.id),t.pathXAxis=e.getClipPath(t.idXAxis),t.pathYAxis=e.getClipPath(t.idYAxis),t.pathGrid=e.getClipPath(t.idGrid)},getClipPath(e){const t=this,{config:i}=t;return!i.clipPath&&/-clip$/.test(e)||!i.axis_x_clipPath&&/-clip-xaxis$/.test(e)||!i.axis_y_clipPath&&/-clip-yaxis$/.test(e)?null:`url(#${e})`},appendClip(e,t){t&&e.append("clipPath").attr("id",t).append("rect")},setXAxisClipPath(e){const t=this,{config:i,state:{margin:s,width:n,height:a}}=t,o=i.axis_rotated,r=Math.max(30,s.left)-(o?0:20),l=(o?s.top+a+10:s.bottom)+20,c=o?-(1+r):-(r-1),u=-15,d=o?s.left+20:n+10+r;e.attr("x",c).attr("y",u).attr("width",d).attr("height",l)},setYAxisClipPath(e){const t=this,{config:i,state:{margin:s,width:n,height:a}}=t,o=i.axis_rotated,r=Math.max(30,s.left)-(o?20:0),l=i.axis_y_inner,c=l&&!o?i.axis_y_label.text?-20:-1:o?-(1+r):-(r-1),u=-(o?20:s.top),d=(o?n+15+r:s.left+20)+(l?20:0),h=(o?s.bottom+10:s.top+a)+10;e.attr("x",c).attr("y",u).attr("width",d).attr("height",h)},updateXAxisTickClip(){const e=this,{config:t,state:{clip:i,xAxisHeight:s},$el:{defs:n}}=e,a=e.getHorizontalAxisHeight("x");if(n&&!i.idXAxisTickTexts){const o=`${i.id}-xaxisticktexts`;e.appendClip(n,o),i.pathXAxisTickTexts=e.getClipPath(i.idXAxisTickTexts),i.idXAxisTickTexts=o}!t.axis_x_tick_multiline&&e.getAxisTickRotate("x")&&a!==s&&(e.setXAxisTickClipWidth(),e.setXAxisTickTextClipPathWidth()),e.state.xAxisHeight=a},setXAxisTickClipWidth(){const e=this,{config:t,state:{current:{maxTickSize:i}}}=e,s=e.getAxisTickRotate("x");if(!t.axis_x_tick_multiline&&s){const n=Math.sin(Math.PI/180*Math.abs(s));i.x.clipPath=(e.getHorizontalAxisHeight("x")-20)/n}else i.x.clipPath=null},setXAxisTickTextClipPathWidth(){const e=this,{state:{clip:t,current:i},$el:{svg:s}}=e;s&&s.select(`#${t.idXAxisTickTexts} rect`).attr("width",i.maxTickSize.x.clipPath).attr("height",30)}};const Ro=e=>M(e.position)||"end",Co=e=>e.position==="start"?4:e.position==="middle"?0:-4;function ts(e,t,i){return s=>{let n=e?0:t;return s.position==="start"?n=e?-i:0:s.position==="middle"&&(n=(e?-i:t)/2),n}}function es(e,t){t==="grid"&&e.each(function(){const i=(0,w.select)(this);["x1","x2","y1","y2"].forEach(s=>i.attr(s,+i.attr(s)))})}var ko={hasGrid(){const{config:e}=this;return["x","y"].some(t=>e[`grid_${t}_show`]||e[`grid_${t}_lines`].length)},initGrid(){const e=this;e.hasGrid()&&e.initGridLines(),e.initFocusGrid()},initGridLines(){const e=this,{config:t,state:{clip:i},$el:s}=e;(t.grid_x_lines.length||t.grid_y_lines.length)&&(s.gridLines.main=s.main.insert("g",`.${I.chart}${t.grid_lines_front?" + *":""}`).attr("clip-path",i.pathGrid).attr("class",`${et.grid} ${et.gridLines}`),s.gridLines.main.append("g").attr("class",et.xgridLines),s.gridLines.main.append("g").attr("class",et.ygridLines),s.gridLines.x=(0,w.selectAll)([]))},updateXGrid(e){const t=this,{config:i,scale:s,state:n,$el:{main:a,grid:o}}=t,r=i.axis_rotated,l=t.generateGridData(i.grid_x_type,s.x),c=t.axis.isCategorized()?t.axis.x.tickOffset():0,u=d=>(s.zoom||s.x)(d)+c*(r?-1:1);n.xgridAttr=r?{x1:0,x2:n.width,y1:u,y2:u}:{x1:u,x2:u,y1:0,y2:n.height},o.x=a.select(`.${et.xgrids}`).selectAll(`.${et.xgrid}`).data(l),o.x.exit().remove(),o.x=o.x.enter().append("line").attr("class",et.xgrid).merge(o.x),e||o.x.each(function(){const d=(0,w.select)(this);Object.keys(n.xgridAttr).forEach(h=>{d.attr(h,n.xgridAttr[h]).style("opacity",()=>d.attr(r?"y1":"x1")===(r?n.height:0)?"0":null)})})},updateYGrid(){const e=this,{axis:t,config:i,scale:s,state:n,$el:{grid:a,main:o}}=e,r=i.axis_rotated,l=u=>s.y(u),c=t.y.getGeneratedTicks(i.grid_y_ticks)||e.scale.y.ticks(i.grid_y_ticks);a.y=o.select(`.${et.ygrids}`).selectAll(`.${et.ygrid}`).data(c),a.y.exit().remove(),a.y=a.y.enter().append("line").attr("class",et.ygrid).merge(a.y),a.y.attr("x1",r?l:0).attr("x2",r?l:n.width).attr("y1",r?0:l).attr("y2",r?n.height:l),es(a.y,"grid")},updateGrid(){const e=this,{$el:{grid:t,gridLines:i}}=e;!i.main&&e.initGridLines(),t.main.style("visibility",e.hasArcType()?"hidden":null),e.hideGridFocus(),e.updateGridLines("x"),e.updateGridLines("y")},updateGridLines(e){const t=this,{config:i,$el:{gridLines:s,main:n},$T:a}=t,o=i.axis_rotated,r=e==="x";i[`grid_${e}_show`]&&t[`update${e.toUpperCase()}Grid`]();let l=n.select(`.${et[`${e}gridLines`]}`).selectAll(`.${et[`${e}gridLine`]}`).data(i[`grid_${e}_lines`]);a(l.exit()).style("opacity","0").remove();const c=l.enter().append("g");c.append("line").style("opacity","0"),l=c.merge(l),l.each(function(u){const d=(0,w.select)(this);d.select("text").empty()&&u.text&&d.append("text").style("opacity","0")}),a(l.attr("class",u=>`${et[`${e}gridLine`]} ${u.class||""}`.trim()).select("text").attr("text-anchor",Ro).attr("transform",()=>r?o?null:"rotate(-90)":o?"rotate(-90)":null).attr("dx",Co).attr("dy",-5)).text(function(u){var d;return(d=u.text)!=null?d:this.remove()}),s[e]=l},redrawGrid(e){const t=this,{config:{axis_rotated:i},state:{width:s,height:n},$el:{gridLines:a},$T:o}=t,r=t.xv.bind(t),l=t.yv.bind(t);let c=a.x.select("line"),u=a.x.select("text"),d=a.y.select("line"),h=a.y.select("text");return c=o(c,e).attr("x1",i?0:r).attr("x2",i?s:r).attr("y1",i?r:0).attr("y2",i?r:n),u=o(u,e).attr("x",ts(!i,s,n)).attr("y",r),d=o(d,e).attr("x1",i?l:0).attr("x2",i?l:s).attr("y1",i?0:l).attr("y2",i?n:l),h=o(h,e).attr("x",ts(i,s,n)).attr("y",l),[c.style("opacity",null),u.style("opacity",null),d.style("opacity",null),h.style("opacity",null)]},initFocusGrid(){const e=this,{config:t,state:{clip:i},$el:s}=e,n=t.grid_front,a=`.${n&&s.gridLines.main?et.gridLines:I.chart}${n?" + *":""}`,o=s.main.insert("g",a).attr("clip-path",i.pathGrid).attr("class",et.grid);if(s.grid.main=o,t.grid_x_show&&o.append("g").attr("class",et.xgrids),t.grid_y_show&&o.append("g").attr("class",et.ygrids),t.axis_tooltip){const r=o.append("g").attr("class","bb-axis-tooltip");r.append("line").attr("class","bb-axis-tooltip-x"),r.append("line").attr("class","bb-axis-tooltip-y")}t.interaction_enabled&&t.grid_focus_show&&!t.axis_tooltip&&(o.append("g").attr("class",q.xgridFocus).append("line").attr("class",q.xgridFocus),t.grid_focus_y&&!t.tooltip_grouped&&o.append("g").attr("class",q.ygridFocus).append("line").attr("class",q.ygridFocus))},showAxisGridFocus(){var e,t;const i=this,{config:s,format:n,state:{event:a,width:o,height:r}}=i,l=s.axis_rotated,[c,u]=bt(a,(e=i.$el.eventRect)==null?void 0:e.node()),d={x:c,y:u};for(const[h,g]of Object.entries(i.$el.axisTooltip)){const f=h==="x"&&!l||h!=="x"&&l?"x":"y",p=d[f];let _=(t=i.scale[h])==null?void 0:t.invert(p);_&&(_=h==="x"&&i.axis.isTimeSeries()?n.xAxisTick(_):_==null?void 0:_.toFixed(2),g==null||g.attr(f,p).text(_))}i.$el.main.selectAll("line.bb-axis-tooltip-x, line.bb-axis-tooltip-y").style("visibility",null).each(function(h,g){const f=(0,w.select)(this);g===0?f.attr("x1",c).attr("x2",c).attr("y1",g?0:r).attr("y2",g?r:0):f.attr("x1",g?0:o).attr("x2",g?o:0).attr("y1",u).attr("y2",u)})},hideAxisGridFocus(){const e=this;e.$el.main.selectAll(`line.${ot.axisTooltipX}, line.${ot.axisTooltipY}`).style("visibility","hidden"),Object.values(e.$el.axisTooltip).forEach(t=>t==null?void 0:t.style("display","none"))},showGridFocus(e){var t;const i=this,{config:s,state:{width:n,height:a}}=i,o=s.axis_rotated,r=i.$el.main.selectAll(`line.${q.xgridFocus}, line.${q.ygridFocus}`),l=(e||[r.datum()]).filter(d=>d&&M(i.getBaseValue(d)));if(!s.tooltip_show||l.length===0||!s.axis_x_forceAsSingle&&i.hasType("bubble")||i.hasArcType())return;const c=s.grid_focus_edge&&!s.tooltip_grouped,u=i.xx.bind(i);r.style("visibility",null).data(l.concat(l)).each(function(d){const h=(0,w.select)(this),g={x:u(d),y:i.getYScaleById(d.id)(d.value)};let f;if(h.classed(q.xgridFocus))f=o?[null,g.x,c?g.y:n,g.x]:[g.x,c?g.y:null,g.x,a];else{const p=i.axis.getId(d.id)==="y2";f=o?[g.y,c&&!p?g.x:null,g.y,c&&p?g.x:a]:[c&&p?g.x:null,g.y,c&&!p?g.x:n,g.y]}["x1","y1","x2","y2"].forEach((p,_)=>h.attr(p,f[_]))}),es(r,"grid"),(t=i.showCircleFocus)==null||t.call(i,e)},hideGridFocus(){var e;const t=this,{state:{inputType:i,resizing:s},$el:{main:n}}=t;(i==="mouse"||!s)&&(n.selectAll(`line.${q.xgridFocus}, line.${q.ygridFocus}`).style("visibility","hidden"),(e=t.hideCircleFocus)==null||e.call(t))},updateGridFocus(){var e;const t=this,{state:{inputType:i,width:s,height:n,resizing:a},$el:{grid:o}}=t,r=o.main.select(`line.${q.xgridFocus}`);if(i==="touch")r.empty()?a&&((e=t.showCircleFocus)==null||e.call(t)):t.showGridFocus();else{const l=t.config.axis_rotated;r.attr("x1",l?0:-10).attr("x2",l?s:-10).attr("y1",l?-10:0).attr("y2",l?-10:n)}return!0},generateGridData(e,t){const i=this,s=i.$el.main.select(`.${ot.axisX}`).selectAll(".tick").size();let n=[];if(e==="year"){const a=i.getXDomain(),[o,r]=a.map(l=>l.getFullYear());for(let l=o;l<=r;l++)n.push(new Date(`${l}-01-01 00:00:00`))}else n=t.ticks(10),n.length>s&&(n=n.filter(a=>String(a).indexOf(".")<0));return n},getGridFilterToRemove(e){return e?t=>{let i=!1;return(G(e)?e.concat():[e]).forEach(s=>{("value"in s&&t.value===s.value||"class"in s&&t.class===s.class)&&(i=!0)}),i}:()=>!0},removeGridLines(e,t){const i=this,{config:s,$T:n}=i,a=i.getGridFilterToRemove(e),o=u=>!a(u),r=t?et.xgridLines:et.ygridLines,l=t?et.xgridLine:et.ygridLine;n(i.$el.main.select(`.${r}`).selectAll(`.${l}`).filter(a)).style("opacity","0").remove();const c=`grid_${t?"x":"y"}_lines`;s[c]=s[c].filter(o)}},Eo={initRegion(){const e=this,{$el:t}=e;t.region.main=t.main.insert("g",":first-child").attr("clip-path",e.state.clip.path).attr("class",de.regions)},updateRegion(){const e=this,{config:t,$el:{region:i},$T:s}=e;i.main||e.initRegion(),i.main.style("visibility",e.hasArcType()?"hidden":null);const n=i.main.selectAll(`.${de.region}`).data(t.regions);s(n.exit()).style("opacity","0").remove();const a=n.enter().append("g");a.append("rect").style("fill-opacity","0"),i.list=a.merge(n).attr("class",e.classRegion.bind(e)),i.list.each(function(o){var r;(0,w.select)(this).select("text").empty()&&((r=o.label)!=null&&r.text)&&(0,w.select)(this).append("text").style("opacity","0")})},redrawRegion(e){const t=this,{$el:{region:i},$T:s}=t,n=t.regionX.bind(t),a=t.regionY.bind(t),o=["width","height"];let r=i.list.select("rect"),l=i.list.selectAll("text");return r=s(r,e).attr("x",n).attr("y",a).attr("width",t.regionWidth.bind(t)).attr("height",t.regionHeight.bind(t)),l=s(l,e).text(c=>{var u;return(u=c.label)==null?void 0:u.text}).attr("transform",({label:c})=>c.rotated?" rotate(-90)":null).attr("transform",function(c){var u;const{x:d=0,y:h=0,center:g=!1,rotated:f=!1}=(u=c.label)!=null?u:{},p=this.previousElementSibling,_={x:0,y:0};return X(g)&&["x","y"].forEach((x,m)=>{g.indexOf(x)>-1&&(_[x]=(+p.getAttribute(o[m])-ct(this)[o[m]])/2)}),`translate(${n(c)+_.x+d}, ${a(c)+_.y+h})${f?" rotate(-90)":""}`}).attr("text-anchor",({label:c})=>c!=null&&c.rotated?"end":null).attr("dy","1em").style("fill",({label:c})=>{var u;return(u=c==null?void 0:c.color)!=null?u:null}),[r.style("fill-opacity",c=>M(c.opacity)?c.opacity:null).on("end",function(){(0,w.select)(this.parentNode).selectAll("rect:not([x])").remove()}),l.style("opacity",null)]},regionX(e){return this.getRegionSize("x",e)},regionY(e){return this.getRegionSize("y",e)},regionWidth(e){return this.getRegionSize("width",e)},regionHeight(e){return this.getRegionSize("height",e)},getRegionSize(e,t){const i=this,{config:s,scale:n,state:a}=i,o=s.axis_rotated,r=/(x|y|y2)/.test(e),l=r?e==="x":e==="width",c=!r&&i[l?"regionX":"regionY"](t);let u=r?"start":"end",d=r?0:a[e],h;if(t.axis==="y"||t.axis==="y2"?(!r&&!l?u="start":r&&!l&&(u="end"),(l?o:!o)&&u in t&&(h=n[t.axis])):(l?!o:o)&&u in t&&(h=n.zoom||n.x),h){let g=0;d=t[u],i.axis.isTimeSeries(t.axis)?d=vt.call(i,d):/(x|width)/.test(e)&&i.axis.isCategorized()&&isNaN(d)&&(d=s.axis_x_categories.indexOf(d),g=i.axis.x.tickOffset()*(u==="start"?-1:1)),d=h(d)+g}return r?d:d<c?0:d-c},isRegionOnX(e){return!e.axis||e.axis==="x"}},Lo={getAxisSize(e){const t=this,i=t.config.axis_rotated;return i&&e==="x"||!i&&/y2?/.test(e)?t.getAxisWidthByAxisId(e,!0):t.getHorizontalAxisHeight(e)},getAxisWidthByAxisId(e,t){var i,s;const n=this;if(n.axis){const a=(i=n.axis)==null?void 0:i.getLabelPositionById(e),{width:o}=n.axis.getMaxTickSize(e,t),r=o===0?.5:0;return o+(((s=n.config.padding)==null?void 0:s.mode)==="fit"?a.isInner?10+r:10:a.isInner?20+r:40)}else return 40},getHorizontalAxisHeight(e){var t,i;const s=this,{config:n,state:a}=s,{rotatedPadding:o,isLegendRight:r,isLegendInset:l}=a,c=n.axis_rotated,u=((t=n.padding)==null?void 0:t.mode)==="fit",d=n[`axis_${e}_inner`],h=n[`axis_${e}_label`].text,g=13;let f=((i=n.padding)==null?void 0:i.mode)==="fit"?d&&!h?e==="y"?1:0:20:30;if(e==="x"&&!n.axis_x_show)return 8;if(e==="x"&&O(n.axis_x_height))return n.axis_x_height;if(e==="y"&&!n.axis_y_show)return n.legend_show&&!r&&!l?10:1;if(e==="y2"&&!n.axis_y2_show)return u?0:o.top;const p=s.axis.getMaxTickSize(e),_=Math.abs(n.axis_x_tick_rotate)>0&&(!n.axis_x_tick_autorotate||s.needToRotateXAxisTickTexts());return(n.axis_x_tick_multiline||_)&&p.height>g&&(f+=p.height-g),f+(s.axis.getLabelPositionById(e).isInner?0:10)+(e==="y2"&&!c?-10:0)},getEventRectWidth(){const e=this,{config:t,axis:i}=e,s=t.axis_x_inverted,n=i.x.tickInterval();return Math.max(0,s?Math.abs(n):n)},getAxisTickRotate(e){const t=this,{axis:i,config:s,state:n,$el:a}=t;let o=s[`axis_${e}_tick_rotate`];if(e==="x"){const r=i.isCategorized()||i.isTimeSeries();if(s.axis_x_tick_fit&&r){const l=s.axis_x_tick_count,c=n.current.maxTickSize.x.ticks.length;let u=0;if(l?u=l>c?c:l:c&&(u=c),u!==n.axis.x.tickCount){const{targets:d}=t.data;n.axis.x.padding=t.getXDomainPadding([t.getXDomainMinMax(d,"min"),t.getXDomainMinMax(d,"max")],u)}n.axis.x.tickCount=u}a.svg&&s.axis_x_tick_autorotate&&s.axis_x_tick_fit&&!s.axis_x_tick_multiline&&!s.axis_x_tick_culling&&r&&(o=t.needToRotateXAxisTickTexts()?s.axis_x_tick_rotate:0)}return o},needToRotateXAxisTickTexts(){const e=this,{state:{axis:t,current:i,isLegendRight:s,legendItemWidth:n}}=e,a=s&&n,o=i.width-a-e.getCurrentPaddingByDirection("left")-e.getCurrentPaddingByDirection("right"),r=t.x.tickCount+t.x.padding.left+t.x.padding.right,{width:l}=e.axis.getMaxTickSize("x"),c=r?o/r:0;return l>c}},Po={axis_x_clipPath:!0,axis_x_show:!0,axis_x_forceAsSingle:!1,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_culling_lines:!0,axis_x_tick_culling_reverse:!1,axis_x_tick_count:void 0,axis_x_tick_inner:!1,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_inner:!1,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_autorotate:!1,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_inverted:!1,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[]},Oo={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",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_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_culling_reverse:!1,axis_y_tick_inner:!1,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},Io={axis_y2_show:!1,axis_y2_type:"indexed",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_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_culling_reverse:!1,axis_y2_tick_inner:!1,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]},Do=Object.defineProperty,is=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,ss=(e,t,i)=>t in e?Do(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ze=(e,t)=>{for(var i in t||(t={}))zo.call(t,i)&&ss(e,i,t[i]);if(is)for(var i of is(t))Fo.call(t,i)&&ss(e,i,t[i]);return e},Mo=Ze(Ze(Ze({axis_evalTextSize:!0,axis_rotated:!1,axis_tooltip:!1},Po),Oo),Io),Xo={grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:void 0,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0},Bo={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1};const No=[ao,oo,ro,lo,co,uo,ho],ns={axis:bo,clip:So,eventrect:To,flow:wo,grid:ko,region:Eo,sizeAxis:Lo},as={optDataAxis:Bo,optAxis:Mo,optGrid:Xo};var os=U(13),Go=Object.defineProperty,Vo=Object.defineProperties,Yo=Object.getOwnPropertyDescriptors,rs=Object.getOwnPropertySymbols,jo=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable,ls=(e,t,i)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Wo=(e,t)=>{for(var i in t||(t={}))jo.call(t,i)&&ls(e,i,t[i]);if(rs)for(var i of rs(t))Ho.call(t,i)&&ls(e,i,t[i]);return e},Uo=(e,t)=>Vo(e,Yo(t));function cs(e=0){const t=this,{config:i,state:s}=t,n=t.hasMultiArcGauge(),a=s.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length,o=e?Math.min(s.radiusExpanded*e-s.radius,a*.8-(1-e)*100):0;return{inner(r){const{innerRadius:l}=t.getRadius(r);return n?s.radius-a*(r.index+1):O(l)?l:0},outer(r){const{outerRadius:l}=t.getRadius(r);let c;if(n)c=s.radius-a*r.index+o;else if(t.hasType("polar")&&!e)c=t.getPolarOuterRadius(r,l);else if(c=l,e){let{radiusExpanded:u}=s;s.radius!==l&&(u-=Math.abs(s.radius-l)),c=u*e}return c},corner(r,l){const{arc_cornerRadius_ratio:c=0,arc_cornerRadius:u=0}=i,{data:{id:d},value:h}=r;let g=0;return c?g=c*l:g=O(u)?u:u.call(t.api,d,h,l),g}}}function qe(e){return function(t){const i=({startAngle:n=0,endAngle:a=0,padAngle:o=0})=>({startAngle:n,endAngle:a,padAngle:o}),s=(0,os.interpolate)(i(this._current),i(t));return this._current=t,function(n){const a=s(n),{data:o,index:r,value:l}=t;return e(Uo(Wo({},a),{data:o,index:r,value:l}))}}}var Zo={initPie(){const e=this,{config:t}=e,i=t.data_type,s=t[`${i}_padding`],n=t[`${i}_startingAngle`]||0,a=(s?s*.01:t[`${i}_padAngle`])||0;e.pie=(0,tt.pie)().startAngle(n).endAngle(n+2*Math.PI).padAngle(a).value(o=>{var r,l;return(l=(r=o.values)==null?void 0:r.reduce((c,u)=>c+u.value,0))!=null?l:o}).sort(e.getSortCompareFn.bind(e)(!0))},updateRadius(){const e=this,{config:t,state:i}=e,s=t.data_type,n=t[`${s}_padding`],a=t.gauge_width||t.donut_width,o=e.filterTargetsToShow(e.data.targets).length*t.gauge_arcs_minWidth;i.radiusExpanded=Math.min(i.arcWidth,i.arcHeight)/2*(e.hasMultiArcGauge()&&t.gauge_label_show?.85:1),i.radius=i.radiusExpanded*.95,i.innerRadiusRatio=a?(i.radius-a)/i.radius:.6,i.gaugeArcWidth=a||(o<=i.radius-i.innerRadius?i.radius-i.innerRadius:o<=i.radius?o:i.radius);const r=t.pie_innerRadius||(n?n*(i.innerRadiusRatio+.1):0);i.outerRadius=t.pie_outerRadius,i.innerRadius=e.hasType("donut")||e.hasType("gauge")?i.radius*i.innerRadiusRatio:r},getRadius(e){const t=this,i=e==null?void 0:e.data;let{innerRadius:s,outerRadius:n}=t.state;return!O(s)&&i&&(s=s[i.id]||0),B(n)&&i&&i.id in n?n=n[i.id]:O(n)||(n=t.state.radius),{innerRadius:s,outerRadius:n}},updateArc(){const e=this;e.updateRadius(),e.svgArc=e.getSvgArc(),e.svgArcExpanded=e.getSvgArcExpanded()},getArcLength(){const e=this,{config:t}=e,i=t.gauge_arcLength*3.6;let s=2*(i/360);return i<-360?s=-2:i>360&&(s=2),s*Math.PI},getStartingAngle(){const e=this,{config:t}=e,i=t.data_type,s=e.hasType("gauge")?t.gauge_fullCircle:!1,n=-1*Math.PI/2,a=Math.PI/2;let o=t[`${i}_startingAngle`]||0;return!s&&o<=n?o=n:!s&&o>=a?o=a:(o>Math.PI||o<-1*Math.PI)&&(o=Math.PI),o},updateAngle(e,t=!1){var i;const s=this,{config:n,state:a}=s,o=t&&s.hasType("gauge");let{pie:r}=s,l=e,c=!1;if(!n)return null;const u=s.getStartingAngle(),d=n.gauge_fullCircle||t&&!o?s.getArcLength():u*-2;if(l.data&&s.isGaugeType(l.data)&&!s.hasMultiArcGauge()){const{gauge_min:h,gauge_max:g}=n,f=s.getTotalDataSum(a.rendered),p=d*((f-h)/(g-h));r=r.startAngle(u).endAngle(p+u)}if(t===!1&&r(s.filterTargetsToShow()).forEach((h,g)=>{var f;!c&&h.data.id===((f=l.data)==null?void 0:f.id)&&(c=!0,l=h,l.index=g)}),isNaN(l.startAngle)&&(l.startAngle=0),isNaN(l.endAngle)&&(l.endAngle=l.startAngle),t||l.data&&(n.gauge_enforceMinMax||s.hasMultiArcGauge())){const{gauge_min:h,gauge_max:g}=n,f=t&&!o?s.getTotalDataSum(a.rendered):g,p=d/(f-h),_=(i=l.value)!=null?i:0,x=_<h?0:_<f?_-h:f-h;l.startAngle=u,l.endAngle=u+p*x}return c||t?l:null},getSvgArc(){const e=this,{inner:t,outer:i,corner:s}=cs.call(e),n=(0,tt.arc)().innerRadius(t).outerRadius(i),a=function(o,r){var l;let c="M 0 0";if(o.value||o.data){const u=r?o:(l=e.updateAngle(o))!=null?l:null;u&&(c=n.cornerRadius(s(u,i(u)))(u))}return c};return a.centroid=n.centroid,a},getSvgArcExpanded(e=1){const t=this,{inner:i,outer:s,corner:n}=cs.call(t,e),a=(0,tt.arc)().innerRadius(i).outerRadius(s);return o=>{const r=t.updateAngle(o),l=s(r);let c=0;return r&&(c=n(r,l)),r?a.cornerRadius(c)(r):"M 0 0"}},getArc(e,t,i){return i||this.isArcType(e.data)?this.svgArc(e,t):"M 0 0"},redrawArcRangeText(){const e=this,{config:t,$el:{arcs:i},state:s,$T:n}=e,a=t.arc_rangeText_format,o=e.hasType("gauge")&&t.arc_rangeText_fixed;let r=t.arc_rangeText_values;if(r!=null&&r.length){const l=t.arc_rangeText_unit==="%",c=e.getTotalDataSum(s.rendered);l&&(r=r.map(h=>c/100*h));const u=e.pie(r).map((h,g)=>(h.index=g,h));let d=i.selectAll(`.${V.arcRange}`).data(r);d.exit(),d=n(d.enter().append("text").attr("class",V.arcRange).style("text-anchor","middle").style("pointer-events","none").style("opacity","0").text(h=>{const g=l?h/c*100:h;return L(a)?a(g):`${g}${l?"%":""}`}).merge(d)),(!s.rendered||s.rendered&&!o)&&c>0&&d.attr("transform",function(h,g){return e.transformForArcLabel(this,u[g],!0)}),d.style("opacity",h=>!o&&(h>c||c===0)?"0":null)}},transformForArcLabel(e,t,i=!1){var s,n,a;const o=this,{config:r,state:{radiusExpanded:l}}=o,c=o.updateAngle(t,i),u={x:0,y:0};let d="",h=1;if(c){if(i||o.hasMultiArcGauge()){const g=Math.sin(c.endAngle-Math.PI/2),f=r.arc_rangeText_position;if(u.x=Math.cos(c.endAngle-Math.PI/2)*(l+(i?5:25)),u.y=g*(l+15-Math.abs(g*10))+3,i&&f){const p=r.arc_rangeText_values,_=L(f)?f(p[t.index]):f;u.x+=(s=_==null?void 0:_.x)!=null?s:0,u.y+=(n=_==null?void 0:_.y)!=null?n:0}}else if(!o.hasType("gauge")||o.data.targets.length>1){let{outerRadius:g}=o.getRadius(t);o.hasType("polar")&&(g=o.getPolarOuterRadius(t,g));const f=this.svgArc.centroid(c),[p,_]=f.map(m=>isNaN(m)?0:m),x=Math.sqrt(p*p+_*_);u.x=p,u.y=_,h=(a=["donut","gauge","pie","polar"].filter(o.hasType.bind(o)).map(m=>r[`${m}_label_ratio`]))==null?void 0:a[0],h?h=L(h)?h.bind(o.api)(t,g,x):h:h=g&&(x?(36/g>.375?1.175-36/g:.8)*g/x:0)}Oi.call(o,e,u),d=`translate(${u.x*h},${u.y*h})`}return d},convertToArcData(e){return this.addName({id:"data"in e?e.data.id:e.id,value:e.value,ratio:this.getRatio("arc",e),index:e.index})},textForArcLabel(e){const t=this,i=t.hasType("gauge");t.shouldShowArcLabel()&&e.style("fill",t.updateTextColor.bind(t)).attr("filter",s=>t.updateTextBGColor.bind(t)(s,t.config.data_labels_backgroundColors)).each(function(s){var n;const a=(0,w.select)(this),o=t.updateAngle(s),r=t.getRatio("arc",o);if(We.call(t,r,(n=["donut","gauge","pie","polar"].filter(t.hasType.bind(t)))==null?void 0:n[0])){const{value:c}=o||s,u=(t.getArcLabelConfig("format")||t.defaultArcValueFormat)(c,r,s.data.id).toString();ue(a,u,[-1,1],i)}else a.text("")})},expandArc(e){const t=this,{state:{transiting:i},$el:s}=t;if(i){const a=setInterval(()=>{i||(clearInterval(a),s.legend.selectAll(`.${q.legendItemFocused}`).size()>0&&t.expandArc(e))},10);return}const n=t.mapToTargetIds(e);s.svg.selectAll(t.selectorTargets(n,`.${V.chartArc}`)).each(function(a){if(!t.shouldExpand(a.data.id))return;const o=t.getExpandConfig(a.data.id,"duration"),r=t.getSvgArcExpanded(t.getExpandConfig(a.data.id,"rate"));(0,w.select)(this).selectAll("path").transition().duration(o).attrTween("d",qe(t.svgArcExpanded.bind(t))).transition().duration(o*2).attrTween("d",qe(r.bind(t)))})},unexpandArc(e){const t=this,{state:{transiting:i},$el:{svg:s}}=t;if(i)return;const n=t.mapToTargetIds(e);s.selectAll(t.selectorTargets(n,`.${V.chartArc}`)).selectAll("path").transition().duration(a=>t.getExpandConfig(a.data.id,"duration")).attrTween("d",qe(t.svgArc.bind(t))),s.selectAll(`${V.arc}`).style("opacity",null)},getExpandConfig(e,t){const i=this,{config:s}=i,n={duration:50,rate:.98};let a;return i.isDonutType(e)?a="donut":i.isGaugeType(e)?a="gauge":i.isPieType(e)&&(a="pie"),a?s[`${a}_expand_${t}`]:n[t]},shouldExpand(e){const t=this,{config:i}=t;return t.isDonutType(e)&&i.donut_expand||t.isGaugeType(e)&&i.gauge_expand||t.isPieType(e)&&i.pie_expand},shouldShowArcLabel(){const e=this,{config:t}=e;return["donut","gauge","pie","polar"].some(i=>e.hasType(i)&&t[`${i}_label_show`])},getArcLabelConfig(e="format"){const t=this,{config:i}=t;let s=n=>n;return["donut","gauge","pie","polar"].filter(t.hasType.bind(t)).forEach(n=>{s=i[`${n}_label_${e}`]}),e==="format"&&L(s)?s.bind(t.api):s},updateTargetsForArc(e){const t=this,{$el:i}=t,s=t.hasType("gauge"),n=t.getChartClass("Arc"),a=t.getClass("arcs",!0),o=t.classFocus.bind(t),r=i.main.select(`.${V.chartArcs}`),l=r.selectAll(`.${V.chartArc}`).data(t.pie(e)).attr("class",u=>n(u)+o(u.data)),c=l.enter().append("g").attr("class",n).call(this.setCssRule(!1,`.${V.chartArcs} text`,["pointer-events:none","text-anchor:middle"]));c.append("g").attr("class",a).merge(l),c.append("text").attr("dy",s&&!t.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor",t.getStylePropValue("middle")).style("pointer-events",t.getStylePropValue("none")),i.text=r.selectAll(`.${I.target} text`)},initArc(){const e=this,{$el:t}=e;t.arcs=t.main.select(`.${I.chart}`).append("g").attr("class",V.chartArcs).attr("transform",e.getTranslate("arc")),e.setArcTitle()},setArcTitle(e){const t=this,i=e||t.getArcTitle(),s=t.hasType("gauge");if(i){const n=s?yt.chartArcsGaugeTitle:V.chartArcsTitle;let a=t.$el.arcs.select(`.${n}`);a.empty()&&(a=t.$el.arcs.append("text").attr("class",n).style("text-anchor","middle")),s&&a.attr("dy","-0.3em"),ue(a,i,s?void 0:[-.6,1.35],!0)}},getArcTitle(){const e=this,t=e.hasType("donut")&&"donut"||e.hasType("gauge")&&"gauge";return t?e.config[`${t}_title`]:""},getArcTitleWithNeedleValue(){const e=this,{config:t,state:i}=e,s=e.getArcTitle();if(s&&e.config.arc_needle_show&&/{=[A-Z_]+}/.test(s)){let n=i.current.needle;return O(n)||(n=t.arc_needle_value),he(s,{NEEDLE_VALUE:~~n})}return!1},redrawArc(e,t,i){const s=this,{config:n,state:a,$el:{main:o}}=s,r=n.interaction_enabled,l=r&&n.data_selection_isselectable;let c=o.selectAll(`.${V.arcs}`).selectAll(`.${V.arc}`).data(s.arcData.bind(s));c.exit().transition().duration(t).style("opacity","0").remove(),c=c.enter().append("path").attr("class",s.getClass("arc",!0)).style("fill",u=>s.color(u.data)).style("cursor",u=>{var d;return(d=l==null?void 0:l.bind)!=null&&d.call(l,s.api)(u)?"pointer":null}).style("opacity","0").each(function(u){s.isGaugeType(u.data)&&(u.startAngle=n.gauge_startingAngle,u.endAngle=n.gauge_startingAngle),this._current=u}).merge(c),s.hasType("gauge")&&(s.updateGaugeMax(),s.hasMultiArcGauge()&&s.redrawArcGaugeLine()),c.attr("transform",u=>!s.isGaugeType(u.data)&&i?"scale(0)":"").style("opacity",function(u){return u===this._current?"0":null}).each(()=>{a.transiting=!0}).transition().duration(e).attrTween("d",function(u){const d=s.updateAngle(u);if(!d)return()=>"M 0 0";isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);const h=(0,os.interpolate)(this._current,d);return this._current=h(0),function(g){const f=h(g);return f.data=u.data,s.getArc(f,!0)}}).attr("transform",i?"scale(1)":"").style("fill",u=>{let d;return s.levelColor?(d=s.levelColor(u.data.values[0].value),n.data_colors[u.data.id]=d):d=s.color(u.data),d}).style("opacity",null).call(Te,function(){if(s.levelColor){const u=(0,w.select)(this),d=u.datum(this._current);s.updateLegendItemColor(d.data.id,u.style("fill"))}a.transiting=!1,K(n.onrendered,s.api)}),r&&s.bindArcEvent(c),s.hasType("polar")&&s.redrawPolar(),s.hasType("gauge")&&s.redrawBackgroundArcs(),n.arc_needle_show&&s.redrawNeedle(),s.redrawArcText(e),s.redrawArcRangeText()},redrawNeedle(){const e=this,{$el:t,config:i,state:{hiddenTargetIds:s,radius:n}}=e,a=(n-1)/100*i.arc_needle_length,o=s.length!==e.data.targets.length;let r=e.$el.arcs.select(`.${V.needle}`);const l=i.arc_needle_path,c=i.arc_needle_bottom_width/2,u=i.arc_needle_top_width/2,d=i.arc_needle_top_rx,h=i.arc_needle_top_ry,g=i.arc_needle_bottom_len,f=i.arc_needle_bottom_rx,p=i.arc_needle_bottom_ry,_=e.getNeedleAngle(),x=()=>{const m=e.getArcTitleWithNeedleValue();m&&e.setArcTitle(m)};if(x(),r.empty()&&(r=t.arcs.append("path").classed(V.needle,!0),t.needle=r,t.needle.updateHelper=(m,$=!1)=>{t.needle.style("display")!=="none"&&e.$T(t.needle).style("transform",`rotate(${e.getNeedleAngle(m)}deg)`).call(Te,()=>{$&&(i.arc_needle_value=m),x()})}),o){const m=L(l)?l.call(e,a):`M-${c} ${g} A${f} ${p} 0 0 0 ${c} ${g} L${u} -${a} A${d} ${h} 0 0 0 -${u} -${a} L-${c} ${g} Z`;e.$T(r).attr("d",m).style("fill",i.arc_needle_color).style("display",null).style("transform",`rotate(${_}deg)`)}else r.style("display","none")},getNeedleAngle(e){const t=this,{config:i,state:s}=t,n=t.getArcLength(),a=t.hasType("gauge"),o=t.getTotalDataSum(!0);let r=H(e)?e:i.arc_needle_value,l=i[`${i.data_type}_startingAngle`]||0,c=0;if(O(r)||(r=a&&t.data.targets.length===1?o:0),s.current.needle=r,a){l=t.getStartingAngle();const u=i.gauge_fullCircle?n:l*-2,{gauge_min:d,gauge_max:h}=i;c=u*((r-d)/(h-d))}else c=n*(r/o);return(l+c)*(180/Math.PI)},redrawBackgroundArcs(){const e=this,{config:t,state:i}=e,s=e.hasMultiArcGauge(),n=t.gauge_fullCircle,a=e.filterTargetsToShow(e.data.targets).length===0&&!!t.data_empty_label_text,o=e.getStartingAngle(),r=n?o+e.getArcLength():o*-1;let l=e.$el.arcs.select(`${s?"g":""}.${V.chartArcsBackground}`);if(s){let c=0;l=l.selectAll(`path.${V.chartArcsBackground}`).data(e.data.targets),l.enter().append("path").attr("class",(u,d)=>`${V.chartArcsBackground} ${V.chartArcsBackground}-${d}`).merge(l).style("fill",t.gauge_background||null).attr("d",({id:u})=>{if(a||i.hiddenTargetIds.indexOf(u)>=0)return"M 0 0";const d={data:[{value:t.gauge_max}],startAngle:o,endAngle:r,index:c++};return e.getArc(d,!0,!0)}),l.exit().remove()}else l.attr("d",a?"M 0 0":()=>{const c={data:[{value:t.gauge_max}],startAngle:o,endAngle:r};return e.getArc(c,!0,!0)})},bindArcEvent(e){const t=this,{config:i,state:s}=t,n=s.inputType==="touch",a=s.inputType==="mouse";function o(l,c,u){t.expandArc(u),t.api.focus(u),t.toggleFocusLegend(u,!0),t.showTooltip([c],l)}function r(l){const c=(l==null?void 0:l.id)||void 0;t.unexpandArc(c),t.api.revert(),t.revertLegend(),t.hideTooltip()}if(e.on("click",function(l,c,u){var d;const h=t.updateAngle(c);let g;h&&(g=t.convertToArcData(h),(d=t.toggleShape)==null||d.call(t,this,g,u),i.data_onclick.bind(t.api)(g,this))}),a&&e.on("mouseover",function(l,c){if(s.transiting)return;s.event=l;const u=t.updateAngle(c),d=u?t.convertToArcData(u):null,h=(d==null?void 0:d.id)||void 0;o(this,d,h),t.setOverOut(!0,d)}).on("mouseout",(l,c)=>{if(s.transiting||!i.interaction_onout)return;s.event=l;const u=t.updateAngle(c),d=u?t.convertToArcData(u):null;r(),t.setOverOut(!1,d)}).on("mousemove",function(l,c){const u=t.updateAngle(c),d=u?t.convertToArcData(u):null;s.event=l,t.showTooltip([d],this)}),n&&t.hasArcType()&&!t.radars){const l=c=>{var u,d;const{clientX:h,clientY:g}=(d=(u=c.changedTouches)==null?void 0:u[0])!=null?d:{clientX:0,clientY:0};return(0,w.select)(lt.elementFromPoint(h,g))};t.$el.svg.on("touchstart touchmove",function(c){if(s.transiting)return;s.event=c;const d=l(c).datum(),h=d!=null&&d.data&&d.data.id?t.updateAngle(d):null,g=h?t.convertToArcData(h):null,f=(g==null?void 0:g.id)||void 0;t.callOverOutForTouch(g),st(f)?r():o(this,g,f)})}},redrawArcText(e){const t=this,{config:i,state:s,$el:{main:n,arcs:a}}=t,o=t.hasType("gauge"),r=t.hasMultiArcGauge();let l;if(o&&t.data.targets.length===1&&i.gauge_title||(l=n.selectAll(`.${V.chartArc}`).select("text").style("opacity","0").attr("class",c=>t.isGaugeType(c.data)?yt.gaugeValue:null).call(t.textForArcLabel.bind(t)).style("font-size",c=>t.isGaugeType(c.data)&&t.data.targets.length===1&&!r?`${Math.round(s.radius/5)}px`:null),Pi.call(t),l.attr("transform",function(c){return t.transformForArcLabel.bind(t)(this,c)}).transition().duration(e).style("opacity",c=>t.isTargetToShow(c.data.id)&&t.isArcType(c.data)?null:"0"),r&&l.attr("dy","-.1em")),n.select(`.${V.chartArcsTitle}`).style("opacity",t.hasType("donut")||o?null:"0"),o){const c=i.gauge_fullCircle;c&&(l==null||l.attr("dy",`${r?0:Math.round(s.radius/14)}`)),i.gauge_label_show&&(a.select(`.${yt.chartArcsGaugeUnit}`).attr("dy",`${c?1.5:.75}em`).text(i.gauge_units),a.select(`.${yt.chartArcsGaugeMin}`).attr("dx",`${-1*(s.innerRadius+(s.radius-s.innerRadius)/(c?1:2))}px`).attr("dy","1.2em").text(t.textForGaugeMinMax(i.gauge_min,!1)),!c&&a.select(`.${yt.chartArcsGaugeMax}`).attr("dx",`${s.innerRadius+(s.radius-s.innerRadius)/2}px`).attr("dy","1.2em").text(t.textForGaugeMinMax(i.gauge_max,!0)))}},getArcElementByIdOrIndex(e){const t=this,{$el:{arcs:i}}=t,s=O(e)?n=>n.index===e:n=>n.data.id===e;return i==null?void 0:i.selectAll(`.${I.target} path`).filter(s)}},ee={initArea(e){const t=this,{config:i}=t;e.insert("g",`.${i.area_front?ft.circles:Lt.lines}`).attr("class",t.getClass("areas",!0))},updateAreaColor(e){const t=this;return t.config.area_linearGradient?t.getGradienColortUrl(e.id):t.color(e)},updateArea(e,t=!1){const i=this,{config:s,state:n,$el:a,$T:o}=i,r=t?a.subchart:a;s.area_linearGradient&&i.updateLinearGradient();const l=r.main.selectAll(`.${$e.areas}`).selectAll(`.${$e.area}`).data(i.lineData.bind(i));o(l.exit(),e).style("opacity","0").remove(),r.area=l.enter().append("path").attr("class",i.getClass("area",!0)).style("fill",i.updateAreaColor.bind(i)).style("opacity",function(){return n.orgAreaOpacity=(0,w.select)(this).style("opacity"),"0"}).merge(l),l.style("opacity",n.orgAreaOpacity),i.setRatioForGroupedData(r.area.data())},redrawArea(e,t,i=!1){const s=this,{area:n}=i?this.$el.subchart:this.$el,{orgAreaOpacity:a}=s.state;return[s.$T(n,t,Ct()).attr("d",e).style("fill",s.updateAreaColor.bind(s)).style("opacity",o=>String(s.isAreaRangeType(o)?a/1.75:a))]},generateDrawArea(e,t){const i=this,{config:s}=i,n=s.line_connectNull,a=s.axis_rotated,o=i.generateGetAreaPoints(e,t),r=i.getYScaleById.bind(i),l=d=>(t?i.subxx:i.xx).call(i,d),c=(d,h)=>i.isGrouped(d.id)?o(d,h)[0][1]:r(d.id,t)(i.isAreaRangeType(d)?i.getRangedData(d,"high"):i.getShapeYMin(d.id)),u=(d,h)=>i.isGrouped(d.id)?o(d,h)[1][1]:r(d.id,t)(i.isAreaRangeType(d)?i.getRangedData(d,"low"):d.value);return d=>{let h=n?i.filterRemoveNull(d.values):d.values,g=0,f=0,p;if(i.isAreaType(d)){let _=(0,tt.area)();_=a?_.y(l).x0(c).x1(u):_.x(l).y0(s.area_above?0:s.area_below?i.state.height:c).y1(u),n||(_=_.defined(x=>i.getBaseValue(x)!==null)),i.isStepType(d)&&(h=i.convertValuesToStep(h)),p=_.curve(i.getCurve(d))(h)}else h[0]&&(g=i.scale.x(h[0].x),f=i.getYScaleById(d.id)(h[0].value)),p=a?`M ${f} ${g}`:`M ${g} ${f}`;return p||"M 0 0"}},generateGetAreaPoints(e,t){const i=this,{config:s}=i,n=i.getShapeX(0,e,t),a=i.getShapeY(!!t),o=i.getShapeOffset(i.isAreaType,e,t),r=i.getYScaleById.bind(i);return function(l,c){const u=r.call(i,l.id,t)(i.getShapeYMin(l.id)),d=o(l,c)||u,h=n(l),g=l.value;let f=a(l);return s.axis_rotated&&(g>0&&f<u||g<0&&u<f)&&(f=u),[[h,d],[h,f-(u-d)],[h,f-(u-d)],[h,d]]}}};function Ke(e){const t=this.config.bar_connectLine,i=(t==null?void 0:t[e])||t;return/^(start|end)\-(start|end)$/.test(i)?i:null}var qo={initBar(){const{$el:e,config:t,state:{clip:i}}=this;e.bar=e.main.select(`.${I.chart}`),e.bar=t.bar_front?e.bar.append("g"):e.bar.insert("g",":first-child"),e.bar.attr("class",$t.chartBars).call(this.setCssRule(!1,`.${$t.chartBars}`,["pointer-events:none"])),t.clipPath===!1&&(t.bar_radius||t.bar_radius_ratio)&&e.bar.attr("clip-path",i.pathXAxis.replace(/#[^)]*/,`#${i.id}`))},updateTargetsForBar(e){const t=this,{config:i,$el:s}=t,n=t.getChartClass("Bar"),a=t.getClass("bars",!0),o=t.classFocus.bind(t),r=i.interaction_enabled&&i.data_selection_isselectable;s.bar||t.initBar(),s.main.select(`.${$t.chartBars}`).selectAll(`.${$t.chartBar}`).data(t.filterNullish(e)).attr("class",u=>n(u)+o(u)).enter().append("g").attr("class",n).style("opacity","0").style("pointer-events",t.getStylePropValue("none")).append("g").attr("class",a).style("cursor",u=>{var d;return(d=r==null?void 0:r.bind)!=null&&d.call(r,t.api)(u)?"pointer":null}).call(u=>{t.setCssRule(!0,` .${$t.bar}`,["fill"],t.color)(u),u.each(function(d){Ke.call(t,d.id)&&(0,w.select)(this).append("path").attr("class",$t.barConnectLine)})})},updateBar(e,t=!1){const i=this,{config:s,$el:n,$T:a}=i,o=t?n.subchart:n,r=i.getClass("bar",!0),l=i.initialOpacity.bind(i);s.bar_linearGradient&&i.updateLinearGradient();const c=o.main.selectAll(`.${$t.bars}`).selectAll(`.${$t.bar}`).data(i.labelishData.bind(i));a(c.exit(),e).style("opacity","0").remove(),o.bar=c.enter().append("path").attr("class",r).style("fill",i.updateBarColor.bind(i)).merge(c).style("opacity",l),i.setRatioForGroupedData(o.bar.data())},updateBarColor(e){const t=this,i=t.getStylePropValue(t.color);return t.config.bar_linearGradient?t.getGradienColortUrl(e.id):i?i(e):null},redrawBar(e,t,i=!1){const s=this,{bar:n}=i?s.$el.subchart:s.$el,a=[];return[s.$T(n,t,Ct()).attr("d",function(o,r,l){const c=(O(o.value)||s.isBarRangeType(o))&&e(o,r),u=Ke.call(s,o.id);if(c.length>1&&(a.push(c[1]),r===l.length-1)){const d=s.$T((0,w.select)(this.parentNode.querySelector(`.${$t.barConnectLine}`)),t,Ct());s.updateConnectLine(d,u,a),a.splice(0)}return c[0]}).style("fill",s.updateBarColor.bind(s)).style("clip-path",o=>o.clipPath).style("opacity",null)]},generateDrawBar(e,t){const i=this,{config:s}=i,n=i.generateGetBarPoints(e,t),a=s.axis_rotated,o=s.bar_radius,r=s.bar_radius_ratio,l=O(o)&&o>0?()=>o:O(r)?c=>c*r:null;return(c,u)=>{const d=n(c,u),h=+a,g=+!h,f=c.value<0,p=s[`axis_${i.axis.getId(c.id)}_inverted`],_=!p&&f||p&&!f,x=["",""],m=i.isGrouped(c.id),$=l&&m?i.isStackingRadiusData(c):!1,b=[d[0][h],d[0][g]];let v=0;if(c.clipPath=null,l){const A=a?g:h,S=d[2][A]-d[0][A];v=!m||$?l(S):0;const R=`a${v} ${v} ${_?"1 0 0":"0 0 1"} `;x[+!a]=`${R}${v},${v}`,x[+a]=`${R}${[-v,v][a?"sort":"reverse"]()}`,_&&x.reverse()}const y=a?d[1][h]+(_?v:-v):d[1][g]+(_?-v:v);if(v){let A="";a?_&&b[0]<y?A=`0 ${y-b[0]}px 0 0`:!_&&b[0]>y&&(A=`0 0 0 ${b[0]-y}px`):_&&b[1]>y?A=`${b[1]-y}px 0 0 0`:!_&&b[1]<y&&(A=`0 0 ${y-b[1]}px 0`),A&&(c.clipPath=`inset(${A})`)}const T=a?`H${y} ${x[0]}V${d[2][g]-v} ${x[1]}H${d[3][h]}`:`V${y} ${x[0]}H${d[2][h]-v} ${x[1]}V${d[3][g]}`,C=[`M${d[0][h]},${d[0][g]}${T}z`];return Ke.call(i,c.id)&&C.push(a?{x:d[0][h],y:d[0][g],width:d[0][h]-y,height:d[2][g]-d[0][g]}:{x:d[0][h],y,width:d[2][h]-d[0][h],height:d[3][g]-y}),C}},isStackingRadiusData(e){const t=this,{$el:i,config:s,data:n,state:a}=t,{id:o,index:r,value:l}=e;if(a.hiddenTargetIds.indexOf(o)>-1){const h=i.bar.filter(g=>g.id===o&&g.value===l);return!h.empty()&&/a\d+/i.test(h.attr("d"))}const c=s.data_groups.find(h=>h.indexOf(o)>-1),d=t.orderTargets(t.filterTargetsToShow(n.targets.filter(t.isBarType,t))).filter(h=>c.indexOf(h.id)>-1).map(h=>h.values.filter(g=>g.index===r&&(O(l)&&l>0?g.value>0:g.value<0))[0]).filter(Boolean).map(h=>h.id);return l!==0&&d.indexOf(o)===d.length-1},generateGetBarPoints(e,t){const i=this,{config:s}=i,n=t?i.axis.subX:i.axis.x,a=i.getIndicesMax(e)+1,o=i.getBarW("bar",n,a),r=i.getShapeX(o,e,!!t),l=i.getShapeY(!!t),c=i.getShapeOffset(i.isBarType,e,!!t),u=i.getYScaleById.bind(i);return(d,h)=>{const{id:g}=d,f=u.call(i,g,t)(i.getShapeYMin(g)),p=c(d,h)||f,_=O(o)?o:o[d.id]||o._$width,x=s[`axis_${i.axis.getId(g)}_inverted`],m=d.value,$=r(d);let b=l(d);s.axis_rotated&&!x&&(m>0&&b<f||m<0&&f<b)&&(b=f),i.isBarRangeType(d)||(b-=f-p);const v=$+_;return[[$,p],[$,b],[v,b],[v,p]]}},updateConnectLine(e,t,i){const s=i.map((n,a,o)=>{const r=this.config.axis_rotated,l=/^start-(start|end)$/.test(t),c=/^end-(start|end)$/.test(t),u=[],d=r?c?n.x-n.width:n.x:n.x+n.width,h=r||l?n.y+n.height:n.y;return a===0?u.push(`${d},${h}`):(u.push(r?`L${n.x-(/\w+-end$/.test(t)?n.width:0)},${n.y}`:`L${n.x},${n.y+(/\w+-start$/.test(t)?n.height:0)}`),a<o.length-1&&u.push(`M${d},${h}`)),u.join(" ")});e.attr("d",`M${s.join("")}z`)}},Ko={initBubble(){const e=this,{config:t}=e;e.hasType("bubble")&&(t.point_show=!0,t.point_type="circle")},getBaseLength(){const e=this,{width:t,height:i}=e.state,s=_t.bubbleBaseLength;let n=e.cache.get(s);return n||e.cache.add(s,n=St("min",[t,i])),n},getBubbleR(e){const t=this;let i=t.config.bubble_maxR;L(i)?i=i.bind(t.api)(e):O(i)||(i=t.getBaseLength()/(t.getMaxDataCount()*2)+12);const s=St("max",t.getMinMaxData().max.map(o=>t.isBubbleZType(o)?t.getBubbleZData(o.value,"y"):B(o.value)?o.value.mid:o.value)),n=i*i*Math.PI,a=(t.isBubbleZType(e)?t.getBubbleZData(e.value,"z"):e.value)*(n/s);return Math.sqrt(a/Math.PI)},getBubbleZData(e,t){return B(e)?e[t]:e[t==="y"?0:1]}},Jo=Object.defineProperty,ds=Object.getOwnPropertySymbols,Qo=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,us=(e,t,i)=>t in e?Jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,er=(e,t)=>{for(var i in t||(t={}))Qo.call(t,i)&&us(e,i,t[i]);if(ds)for(var i of ds(t))tr.call(t,i)&&us(e,i,t[i]);return e},ir={initCandlestick(){const{$el:e}=this;e.candlestick=e.main.select(`.${I.chart}`).append("g").attr("class",Et.chartCandlesticks)},updateTargetsForCandlestick(e){const t=this,{$el:i}=t,s=t.getChartClass("Candlestick");i.candlestick||t.initCandlestick(),t.$el.main.select(`.${Et.chartCandlesticks}`).selectAll(`.${Et.chartCandlestick}`).data(t.filterNullish(e)).enter().append("g").attr("class",s).style("pointer-events","none")},updateCandlestick(e,t=!1){const i=this,{$el:s,$T:n}=i,a=t?s.subchart:s,o=i.getClass("candlestick",!0),r=i.initialOpacity.bind(i),l=a.main.selectAll(`.${Et.chartCandlestick}`).selectAll(`.${Et.candlestick}`).data(i.labelishData.bind(i));n(l.exit(),e).style("opacity","0").remove();const c=l.enter().filter(u=>u.value).append("g").attr("class",o);c.append("line"),c.append("path"),a.candlestick=l.merge(c).style("opacity",r)},generateDrawCandlestick(e,t){const i=this,{config:s}=i,n=i.generateGetCandlestickPoints(e,t),a=s.axis_rotated,o=s.candlestick_color_down;return(r,l,c)=>{const u=n(r,l),d=i.getCandlestickData(r),h=d==null?void 0:d._isUp,g=+a,f=+!g;c.classed&&c.classed(Et[h?"valueUp":"valueDown"],!0);const p=a?`H${u[1][1]} V${u[1][0]} H${u[0][1]}`:`V${u[1][1]} H${u[1][0]} V${u[0][1]}`;c.select("path").attr("d",`M${u[0][g]},${u[0][f]}${p}z`).style("fill",m=>(h?i.color(m):B(o)?o[m.id]:o)||i.color(m));const _=c.select("line"),x=a?{x1:u[2][1],x2:u[2][2],y1:u[2][0],y2:u[2][0]}:{x1:u[2][0],x2:u[2][0],y1:u[2][1],y2:u[2][2]};for(const m in x)_.attr(m,x[m])}},generateGetCandlestickPoints(e,t=!1){const i=this,s=t?i.axis.subX:i.axis.x,n=i.getIndicesMax(e)+1,a=i.getBarW("candlestick",s,n),o=i.getShapeX(a,e,!!t),r=i.getShapeY(!!t),l=i.getShapeOffset(i.isBarType,e,!!t),c=i.getYScaleById.bind(i);return(u,d)=>{const h=c.call(i,u.id,t)(i.getShapeYMin(u.id)),g=l(u,d)||h,f=O(a)?a:a[u.id]||a._$width,p=i.getCandlestickData(u);let _;if(p&&O(p.open)&&O(p.close)){const x={start:o(u),end:0};x.end=x.start+f;const m={start:r(p.open),end:r(p.close)},$={x:x.start+f/2,high:r(p.high),low:r(p.low)};m.start-=h-g,_=[[x.start,m.start],[x.end,m.end],[$.x,$.low,$.high]]}else _=[[0,0],[0,0],[0,0,0]];return _}},redrawCandlestick(e,t,i=!1){const s=this,{$el:n,$T:a}=s,{candlestick:o}=i?n.subchart:n,r=Ct(!0);return[o.each(function(l,c){const u=a((0,w.select)(this),t,r);e(l,c,u)}).style("opacity",null)]},getCandlestickData({value:e}){let t;if(G(e)){const[i,s,n,a,o=!1]=e;t={open:i,high:s,low:n,close:a},o!==!1&&(t.volume=o)}else B(e)&&(t=er({},e));return t&&(t._isUp=t.close>=t.open),t||null}},sr=Object.defineProperty,hs=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,ar=Object.prototype.propertyIsEnumerable,gs=(e,t,i)=>t in e?sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,or=(e,t)=>{for(var i in t||(t={}))nr.call(t,i)&&gs(e,i,t[i]);if(hs)for(var i of hs(t))ar.call(t,i)&&gs(e,i,t[i]);return e};function ke(e=!1){const t=this,{config:i,state:{current:{width:s,height:n}}}=t,a=t.getCurrentPadding(),o=or({width:s-(a.left+a.right),height:n-(i.legend_show?t.getLegendHeight()+10:0)-(a.top+a.bottom)},a);if(e){const{width:r,height:l}=fs.call(t,{width:o.width,height:o.height});o.width<r&&(o.width=r),o.height<l&&(o.height=l)}return o}function fs(e){const t=this,{config:i}=t;let s=i.funnel_neck_width,n=i.funnel_neck_height;return[s,n]=[s,n].map((a,o)=>{let r=a;return B(a)&&(r=e[o?"height":"width"]*a.ratio),r}),{width:s,height:n}}function rr(e){const t=this,{top:i,left:s,width:n}=ke.call(t,!0),a=[];return e.forEach((o,r)=>{const{ratio:l}=o,c=r>0?a[r-1][2][1]:i;a.push(o.coords=[[s,c],[s+n,c],[s+n,r>0?l+c:l+i],[s,r>0?l+c:l+i],[s,c]])}),a}function ps(e=!1){const t=this,{width:i,height:s,top:n,left:a}=ke.call(t,!0),o=fs.call(t,{width:i,height:s}),r=(i-o.width)/2,l=(i+o.width)/2,c=s-o.height,u=[[0,0],[i,0],[l,c],[l,s],[r,s],[r,c],[0,0]];return e&&u.forEach(d=>{d[0]+=a,d[1]+=n}),`M${u.join("L")}z`}function lr(e){const t=this,{config:i}=t,s=e.map(n=>({id:n.id,value:n.values.reduce((a,o)=>a+o.value,0)}));return i.data_order&&s.sort(t.getSortCompareFn.bind(t)(!0)),xs.call(t,s)}function xs(e){const t=this,{height:i}=ke.call(t),s=t.getTotalDataSum(!0);return e.forEach(n=>{n.ratio=n.value/s*i}),e}var cr={initFunnel(){const e=this,{$el:t}=e;t.funnel=t.main.select(`.${I.chart}`).append("g").classed(ce.chartFunnels,!0),t.funnel.background=t.funnel.append("path").classed(ce.funnelBackground,!0),e.bindFunnelEvent()},bindFunnelEvent(){const e=this,{$el:{funnel:t},config:i,state:s}=e,n=a=>{var o;const r=a.isTrusted?a.target:(o=s.eventReceiver.rect)==null?void 0:o.node();let l;return/^path$/i.test(r.tagName)&&(s.event=a,l=(0,w.select)(r).datum()),l};if(i.interaction_enabled){const a=s.inputType==="touch";t.on(a?"touchstart":"mouseover mousemove",o=>{const r=n(o);r&&(e.showTooltip([r],o.target),/^(touchstart|mouseover)$/.test(o.type)&&e.setOverOut(!0,r))}).on(a?"touchend":"mouseout",o=>{const r=n(o);i.interaction_onout&&(e.hideTooltip(),e.setOverOut(!1,r))})}},updateTargetsForFunnel(e){const t=this,{$el:{funnel:i}}=t,s=t.getChartClass("Funnel"),n=t.getClass("funnel",!0);i||t.initFunnel();const a=lr.call(t,e.filter(t.isFunnelType.bind(t))),o=i.selectAll(`.${ce.chartFunnel}`).data(t.filterNullish(a));o.exit().remove();const r=o.enter().insert("g",`.${ce.funnelBackground}`);r.append("path"),i.path=r.merge(o).attr("class",l=>s(l)).select("path").attr("class",n).style("opacity","0").style("fill",t.color)},updateFunnel(e){const t=this,{$el:{funnel:i}}=t,s=e.map(({id:n})=>n);i.path=i.path.filter(n=>s.indexOf(n.id)>=0)},generateGetFunnelPoints(){const e=this,{$el:{funnel:t}}=e,i=e.filterTargetsToShow(t.path),{top:s,left:n,right:a}=ke.call(e),o=(n-a)/2,r={};let l=s!=null?s:0;return i.each((c,u)=>{var d;r[c.id]=[[o,l],[o,l+=((d=i==null?void 0:i[u])!=null?d:c).ratio]]}),c=>r[c.id]},redrawFunnel(){const e=this,{$T:t,$el:{funnel:i}}=e,s=e.filterTargetsToShow(i.path),n=rr.call(e,xs.call(e,s.data()));i.attr("clip-path",`path('${ps.bind(e)()}')`),i.background.attr("d",ps.call(e,!0)),t(s).attr("d",(a,o)=>`M${n[o].join("L")}z`).style("opacity","1"),i.selectAll("g").style("opacity",null)}},dr={initGauge(){const e=this,{config:t,$el:{arcs:i}}=e,s=(n=null,a="")=>{i.append("text").attr("class",n).style("text-anchor","middle").style("pointer-events","none").text(a)};if(e.hasType("gauge")){const n=e.hasMultiArcGauge();i.append(n?"g":"path").attr("class",V.chartArcsBackground).style("fill",!n&&t.gauge_background||null),t.gauge_units&&s(yt.chartArcsGaugeUnit),t.gauge_label_show&&(s(yt.chartArcsGaugeMin),!t.gauge_fullCircle&&s(yt.chartArcsGaugeMax))}},updateGaugeMax(){const e=this,{config:t,state:i}=e,n=e.hasMultiArcGauge()?e.getMinMaxData().max[0].value:e.getTotalDataSum(i.rendered);!t.gauge_enforceMinMax&&n+t.gauge_min*(t.gauge_min>0?-1:1)>t.gauge_max&&(t.gauge_max=n-t.gauge_min)},redrawArcGaugeLine(){const e=this,{config:t,state:i,$el:s}=e,{hiddenTargetIds:n}=e.state,a=s.main.selectAll(`.${V.arcs}`).selectAll(`.${V.arcLabelLine}`).data(e.arcData.bind(e));a.enter().append("rect").attr("class",r=>`${V.arcLabelLine} ${I.target} ${I.target}-${r.data.id}`).merge(a).style("fill",r=>e.levelColor?e.levelColor(r.data.values[0].value):e.color(r.data)).style("display",t.gauge_label_show?null:"none").each(function(r){let l=0;const c=2;let u=0,d=0,h="";if(n.indexOf(r.data.id)<0){const g=e.updateAngle(r),f=i.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length*(g.index+1),p=g.endAngle-Math.PI/2,_=i.radius-f,x=p-(_===0?0:1/_);l=i.radiusExpanded-i.radius+f,u=Math.cos(x)*_,d=Math.sin(x)*_,h=`rotate(${p*180/Math.PI}, ${u}, ${d})`}(0,w.select)(this).attr("x",u).attr("y",d).attr("width",l).attr("height",c).attr("transform",h).style("stroke-dasharray",`0, ${l+c}, 0`)})},textForGaugeMinMax(e,t){const i=this,{config:s}=i,n=s.gauge_label_extents;return L(n)?n.bind(i.api)(e,t):e},getGaugeLabelHeight(){const{config:e}=this;return this.config.gauge_label_show&&!e.gauge_fullCircle?20:0},getPaddingBottomForGauge(){const e=this;return e.getGaugeLabelHeight()*(e.config.gauge_label_show?2:2.5)}},ur=Object.defineProperty,hr=Object.defineProperties,gr=Object.getOwnPropertyDescriptors,_s=Object.getOwnPropertySymbols,fr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,ms=(e,t,i)=>t in e?ur(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,xr=(e,t)=>{for(var i in t||(t={}))fr.call(t,i)&&ms(e,i,t[i]);if(_s)for(var i of _s(t))pr.call(t,i)&&ms(e,i,t[i]);return e},_r=(e,t)=>hr(e,gr(t));function mr(e,t,i,s=!1){const n=e?[e,0]:i;for(let a=e||i.reduce((o,r)=>o+r);a<=t;)i.forEach(o=>{a+o<=t&&n.push(o),a+=o});return n.length%2!==0&&n.push(s?i[1]:0),{dash:n.join(" "),length:n.reduce((a,o)=>a+o,0)}}function $r(e,t,i){const s=this,n=[],a="2 2";if(H(t)){const o=(r,l)=>st(r)?l:i?vt.call(s,r):r;for(let r=0,l;l=t[r];r++){const c=o(l.start,e[0].x),u=o(l.end,e[e.length-1].x),d=l.style||{dasharray:a};n[r]={start:c,end:u,style:d}}}return n}var yr={initLine(){const{$el:e}=this;e.line=e.main.select(`.${I.chart}`).append("g").attr("class",Lt.chartLines).call(this.setCssRule(!1,`.${Lt.chartLines}`,["pointer-events:none"]))},updateTargetsForLine(e){const t=this,{$el:{area:i,line:s,main:n}}=t,a=t.getChartClass("Line"),o=t.getClass("lines",!0),r=t.classFocus.bind(t);s||t.initLine();const l=e.filter(d=>!(t.isScatterType(d)||t.isBubbleType(d))),c=n.select(`.${Lt.chartLines}`).selectAll(`.${Lt.chartLine}`).data(t.filterNullish(l)).attr("class",d=>a(d)+r(d)),u=c.enter().append("g").attr("class",a).style("opacity","0").style("pointer-events",t.getStylePropValue("none"));if(u.append("g").attr("class",o),t.hasTypeOf("Area")){const d=(!i&&u.empty()?c:u).filter(t.isAreaType.bind(t));t.initArea(d)}t.updateTargetForCircle(l,u)},updateLine(e,t=!1){const i=this,{format:{extraLineClasses:s},$el:n,$T:a}=i,o=t?n.subchart:n,r=o.main.selectAll(`.${Lt.lines}`).selectAll(`.${Lt.line}`).data(i.lineData.bind(i));a(r.exit(),e).style("opacity","0").remove(),o.line=r.enter().append("path").attr("class",l=>`${i.getClass("line",!0)(l)} ${s(l)||""}`).style("stroke",i.color).merge(r).style("opacity",i.initialOpacity.bind(i)).attr("transform",null)},redrawLine(e,t,i=!1){const s=this,{$el:n,$T:a}=s,{line:o}=i?n.subchart:n;return[a(o,t,Ct()).attr("d",e).style("stroke",this.color).style("opacity",null)]},getCurve(e){const t=this;return t.config.axis_rotated&&t.isStepType(e)?s=>{const n=t.getInterpolate(e)(s);return n.orgPoint=n.point,n.pointRotated=function(a,o){this._point===1&&(this._point=2);const r=this._y*(1-this._t)+o*this._t;this._context.lineTo(this._x,r),this._context.lineTo(a,r),this._x=a,this._y=o},n.point=function(a,o){this._point===0?this.orgPoint(a,o):this.pointRotated(a,o)},n}:t.getInterpolate(e)},generateDrawLine(e,t){const i=this,{config:s,scale:n}=i,a=s.line_connectNull,o=s.axis_rotated,r=i.generateGetLinePoints(e,t),l=i.getYScaleById.bind(i),c=g=>(t?i.subxx:i.xx).call(i,g),u=(g,f)=>i.isGrouped(g.id)?r(g,f)[0][1]:l(g.id,t)(i.getBaseValue(g));let d=(0,tt.line)();d=o?d.x(u).y(c):d.x(c).y(u),a||(d=d.defined(g=>i.getBaseValue(g)!==null));const h=t?n.subX:n.x;return g=>{const f=l(g.id,t);let p=a?i.filterRemoveNull(g.values):g.values,_=0,x=0,m;if(i.isLineType(g)){const $=s.data_regions[g.id];$?(i.isAreaRangeType(g)&&(p=p.map(b=>_r(xr({},b),{value:i.getRangedData(b,"mid")}))),m=i.lineWithRegions(p,n.zoom||h,f,$)):(i.isStepType(g)&&(p=i.convertValuesToStep(p)),m=d.curve(i.getCurve(g))(p))}else p[0]&&(_=h(p[0].x),x=f(p[0].value)),m=o?`M ${x} ${_}`:`M ${_} ${x}`;return m||"M 0 0"}},lineWithRegions(e,t,i,s){const n=this,{config:a}=n,o=a.axis_rotated,r=n.axis.isTimeSeries(),l="2 2",c=$r.bind(n)(e,s,r),u=n.hasNullDataValue(e);let d,h,g,f;const p=o?S=>i(S.value):S=>t(S.x),_=o?S=>t(S.x):S=>i(S.value),x=S=>`M${S[0][0]},${S[0][1]}L${S[1][0]},${S[1][1]}`,m=r?(S,R,z,E)=>{const P=S.x.getTime(),F=R.x-S.x,W=new Date(P+F*z),J=new Date(P+F*(z+E)),ut=o?[[i(h(z)),t(W)],[i(h(z+g)),t(J)]]:[[t(W),i(h(z))],[t(J),i(h(z+g))]];return x(ut)}:(S,R,z,E)=>{const P=t(R.x,!o),F=i(R.value,o),W=z+E,J=t(d(z),!o),ut=i(h(z),o);let at=t(d(W),!o),Tt=i(h(W),o);at>P&&(at=P),S.value>R.value&&(o?Tt<F:Tt>F)&&(Tt=F);const le=[[J,ut],[at,Tt]];return o&&le.forEach(pe=>pe.reverse()),x(le)},$={x:n.axis.getAxisType("x"),y:n.axis.getAxisType("y")};let b="";const v=n.$el.line.filter(({id:S})=>S===e[0].id),y=v.clone().style("display","none"),T=(S,R)=>S.attr("d",R).node().getTotalLength(),C={dash:[],lastLength:0};let A=!1;for(let S=0,R;R=e[S];S++){const z=e[S-1],E=z&&M(z.value);let P=n.isWithinRegions(R.x,c);if(M(R.value)){if(st(c)||!P||!E)b+=`${S&&E?"L":"M"}${p(R)},${_(R)}`;else if(E)if(P=((P==null?void 0:P.dasharray)||l).split(" ").map(Number),d=jt($.x,z.x,R.x),h=jt($.y,z.value,R.value),u){const F=t(R.x)-t(z.x),W=i(R.value)-i(z.value),J=Math.sqrt(Math.pow(F,2)+Math.pow(W,2));g=P[0]/J,f=g*P[1];for(let ut=g;ut<=1;ut+=f)b+=m(z,R,ut,g),ut+f>=1&&(b+=m(z,R,1,0))}else{let F=[];if(A=R.x===e[e.length-1].x,r){const at=+z.x,Tt=new Date(at),le=new Date(at+(+R.x-at));F=[[t(Tt),i(h(0))],[t(le),i(h(1))]]}else F=[[t(d(0)),i(h(0))],[t(d(1)),i(h(1))]];o&&F.forEach(at=>at.reverse());const W=T(y,b),J=T(y,b+=`L${F[1].join(",")}`),ut=mr(W-C.lastLength,J-C.lastLength,P,A);C.lastLength+=ut.length,C.dash.push(ut.dash)}}}return C.dash.length&&(!A&&C.dash.push(T(y,b)),y.remove(),v.attr("stroke-dasharray",C.dash.join(" "))),b},isWithinRegions(e,t){for(let i=0,s;s=t[i];i++)if(s.start<e&&e<=s.end)return s.style;return!1},isWithinStep(e,t){return Math.abs(t-bt(this.state.event,e)[1])<30},shouldDrawPointsForLine(e){const t=this.config.line_point;return t===!0||G(t)&&t.indexOf(e.id)!==-1}};const ie=()=>Ct();var Ee={initialOpacityForCircle(e){const{config:t,state:{withoutFadeIn:i}}=this;let s=t.point_opacity;return st(s)&&(s=this.getBaseValue(e)!==null&&i[e.id]?this.opacityForCircle(e):"0"),s},opacityForCircle(e){var t;const{config:i}=this;let s=i.point_opacity;return st(s)&&(s=i.point_show&&!((t=this.isPointFocusOnly)!=null&&t.call(this))?null:"0",s=M(this.getBaseValue(e))?this.isBubbleType(e)||this.isScatterType(e)?"0.5":s:"0"),s},initCircle(){const e=this,{$el:{main:t}}=e;!e.point&&(e.point=e.generatePoint()),(e.hasType("bubble")||e.hasType("scatter"))&&t.select(`.${I.chart} > .${ft.chartCircles}`).empty()&&t.select(`.${I.chart}`).append("g").attr("class",ft.chartCircles)},updateTargetForCircle(e,t){const i=this,{config:s,data:n,$el:a}=i,o=s.interaction_enabled&&s.data_selection_enabled,r=o&&s.data_selection_isselectable,l=i.getClass("circles",!0);if(!s.point_show)return;i.initCircle();let c=e,u=t;if(!c){c=i.filterNullish(n.targets).filter(h=>this.isScatterType(h)||this.isBubbleType(h));const d=a.main.select(`.${ft.chartCircles}`).style("pointer-events","none").selectAll(`.${ft.circles}`).data(c);d.exit().remove(),u=d.enter()}o&&u.append("g").attr("class",d=>i.generateClass(Q.selectedCircles,d.id)),u.append("g").attr("class",l).call(d=>{i.setCssRule(!0,`.${ft.circles}`,["cursor:pointer"],r)(d),i.setCssRule(!0,` .${ft.circle}`,["fill","stroke"],i.color)(d)}).style("opacity",function(){return(0,w.select)(this.parentNode).attr("class").indexOf(ft.chartCircles)>-1?"0":null}),o&&c.forEach(d=>{a.main.selectAll(`.${Q.selectedCircles}${i.getTargetSelectorSuffix(d.id)}`).selectAll(`${Q.selectedCircle}`).each(h=>{h.value=d.values[h.index].value})})},updateCircle(e=!1){const t=this,{config:i,state:s,$el:n}=t,a=t.isPointFocusOnly(),o=e?n.subchart:n;if(i.point_show&&!s.toggling){i.point_radialGradient&&t.updateLinearGradient();const r=o.main.selectAll(`.${ft.circles}`).selectAll(`.${ft.circle}`).data(l=>{const c=t.isLineType(l)&&t.shouldDrawPointsForLine(l)||t.isBubbleType(l)||t.isRadarType(l)||t.isScatterType(l)?a?[l.values[0]]:l.values:[];return t.filterNullish(c)});r.exit().remove(),r.enter().filter(Boolean).append(t.point("create",this,t.pointR.bind(t),t.updateCircleColor.bind(t))),o.circle=o.main.selectAll(`.${ft.circles} .${ft.circle}`).style("stroke",t.getStylePropValue(t.color)).style("opacity",t.initialOpacityForCircle.bind(t))}},updateCircleColor(e){const t=this,i=t.getStylePropValue(t.color);return t.config.point_radialGradient?t.getGradienColortUrl(e.id):i?i(e):null},redrawCircle(e,t,i,s,n=!1){const a=this,{state:{rendered:o},$el:r,$T:l}=a,c=n?r.subchart:r,u=c.main.selectAll(`.${Q.selectedCircle}`);if(!a.config.point_show)return[];const d=a.point("update",a,e,t,a.updateCircleColor.bind(a),i,s,u),h=a.isCirclePoint()?"c":"",g=Ct(),f=a.opacityForCircle.bind(a),p=[];return c.circle.each(function(_){let x=d.bind(this)(_);x=l(x,i||!o,g).style("opacity",f),p.push(x)}),[p,l(u,i).attr(`${h}x`,e).attr(`${h}y`,t)]},showCircleFocus(e){const t=this,{state:{hasRadar:i,resizing:s,toggling:n,transiting:a},$el:o}=t;let{circle:r}=o;if(a===!1&&r&&t.isPointFocusOnly()){const l=(i?t.radarCircleX:t.circleX).bind(t),c=(i?t.radarCircleY:t.circleY).bind(t),u=n||st(e),d=t.point("update",t,l,c,t.getStylePropValue(t.color),s?!1:u);e&&(r=r.filter(function(h){var g;const f=(g=e.filter)==null?void 0:g.call(e,p=>p.id===h.id);return f.length?(0,w.select)(this).datum(f[0]):!1})),r.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(h){const{id:g,index:f,value:p}=h;let _="hidden";M(p)&&(d.bind(this)(h),t.expandCircles(f,g),_=""),this.style.visibility=_})}},hideCircleFocus(){const e=this,{$el:{circle:t}}=e;e.isPointFocusOnly()&&t&&(e.unexpandCircles(),t.style("visibility","hidden"))},circleX(e){return this.xx(e)},updateCircleY(e=!1){const t=this,i=t.generateGetLinePoints(t.getShapeIndices(t.isLineType),e);return(s,n)=>{const a=s.id;return t.isGrouped(a)?i(s,n)[0][1]:t.getYScaleById(a,e)(t.getBaseValue(s))}},expandCircles(e,t,i){const s=this,n=s.pointExpandedR.bind(s);i&&s.unexpandCircles();const a=s.getShapeByIndex("circle",e,t).classed(I.EXPANDED,!0),o=n(a)/s.config.point_r,r=1-o;s.isCirclePoint()?a.attr("r",n):a.each(function(){const l=(0,w.select)(this);if(this.tagName==="circle")l.attr("r",n);else{const{width:c,height:u}=Kt(this),d=r*(+l.attr("x")+c/2),h=r*(+l.attr("y")+u/2);l.attr("transform",`translate(${d} ${h}) scale(${o})`)}})},unexpandCircles(e){const t=this,i=t.pointR.bind(t),s=t.getShapeByIndex("circle",e).filter(function(){return(0,w.select)(this).classed(I.EXPANDED)}).classed(I.EXPANDED,!1);if(s.attr("r",i),!t.isCirclePoint()){const n=i(s)/t.config.point_r;s.attr("transform",n!==1?`scale(${n})`:null)}},pointR(e){const t=this,{config:i}=t,s=i.point_r;let n=s;return t.isBubbleType(e)?n=t.getBubbleR(e):L(s)&&(n=s.bind(t.api)(e)),e.r=n,n},pointExpandedR(e){const t=this,{config:i}=t,s=t.isBubbleType(e)?1.15:1.75;return i.point_focus_expand_enabled?i.point_focus_expand_r||t.pointR(e)*s:t.pointR(e)},pointSelectR(e){const t=this,i=t.config.point_select_r;return L(i)?i(e):i||t.pointR(e)*4},isPointFocusOnly(){const e=this;return e.config.point_focus_only&&!e.hasType("bubble")&&!e.hasType("scatter")&&!e.hasArcType(null,["radar"])},isWithinCircle(e,t){const{state:i}=this,s=bt(i.event,e),n=(0,w.select)(e),a=this.isCirclePoint(e)?"c":"",o=this.getPointSensitivity(n==null?void 0:n.datum());let r=+n.attr(`${a}x`),l=+n.attr(`${a}y`);if(!(r||l)&&e.nodeType===1){const{x:c,y:u}=ct(e);r=c,l=u}return Math.sqrt(Math.pow(r-s[0],2)+Math.pow(l-s[1],2))<(t||o)},getPointSensitivity(e){const t=this;let i=t.config.point_sensitivity;if(e)L(i)?i=i.call(t.api,e):i==="radius"&&(i=e.r);else return i;return i},updatePointClass(e){const t=this,{circle:i}=t.$el;let s=!1;return(B(e)||i)&&(s=e===!0?i.each(function(n){let a=t.getClass("circle",!0)(n);this.getAttribute("class").indexOf(I.EXPANDED)>-1&&(a+=` ${I.EXPANDED}`),this.setAttribute("class",a)}):t.getClass("circle",!0)(e)),s},generateGetLinePoints(e,t){const i=this,{config:s}=i,n=i.getShapeX(0,e,t),a=i.getShapeY(t),o=i.getShapeOffset(i.isLineType,e,t),r=i.getYScaleById.bind(i);return(l,c)=>{const u=r.call(i,l.id,t)(i.getShapeYMin(l.id)),d=o(l,c)||u,h=n(l);let g=a(l);s.axis_rotated&&(l.value>0&&g<u||l.value<0&&u<g)&&(g=u);const f=[h,g-(u-d)];return[f,f,f,f]}},custom:{create(e,t,i){return e.append("use").attr("xlink:href",`#${t}`).attr("class",this.updatePointClass.bind(this)).style("fill",i).node()},update(e,t,i,s,n,a,o){const r=this,{width:l,height:c}=Kt(e.node()),u=g=>M(g.value)?t(g)-l/2:0,d=g=>M(g.value)?i(g)-c/2:0;let h=e;return n&&(a&&h.attr("x",u),h=r.$T(h,n,ie()),o&&r.$T(o,n,ie())),h.attr("x",u).attr("y",d).style("fill",s)}},circle:{create(e,t,i){return e.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",t).style("fill",i).node()},update(e,t,i,s,n,a,o){const r=this;let l=e;return r.hasType("bubble")&&l.attr("r",r.pointR.bind(r)),n&&(a&&l.attr("cx",t),l.attr("cx")&&(l=r.$T(l,n,ie())),o&&r.$T(l,n,ie())),l.attr("cx",t).attr("cy",i).style("fill",s)}},rectangle:{create(e,t,i){const s=n=>t(n)*2;return e.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",s).attr("height",s).style("fill",i).node()},update(e,t,i,s,n,a,o){const r=this,l=r.config.point_r,c=h=>t(h)-l,u=h=>i(h)-l;let d=e;return n&&(a&&d.attr("x",c),d=r.$T(d,n,ie()),o&&r.$T(o,n,ie())),d.attr("x",c).attr("y",u).style("fill",s)}}};function br(e){return Rt(e)&&L(e.create)&&L(e.update)}function vr(e,t){var i;const s=this,n=(l,c)=>{const u=l.attributes;for(let d=0,h;h=u[d];d++)h=h.name,c.setAttribute(h,l.getAttribute(h))},o=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,r=lt.createElementNS(w.namespaces.svg,o.nodeName.toLowerCase());if(r.id=t,r.style.fill="inherit",r.style.stroke="inherit",n(o,r),(i=o.childNodes)!=null&&i.length){const l=(0,w.select)(r);"innerHTML"in r?l.html(o.innerHTML):Vt(o.childNodes).forEach(c=>{n(c,l.append(c.tagName).node())})}s.$el.defs.node().appendChild(r)}var se={hasValidPointType(e){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(e||this.config.point_type)},hasLegendDefsPoint(){var e;const{config:t}=this;return t.legend_show&&((e=t.point_pattern)==null?void 0:e.length)&&t.legend_usePoint},getDefsPointId(e){const{state:{datetimeId:t}}=this;return`${t}-point${e}`},generatePoint(){const e=this,{$el:t,config:i}=e,s=[],n=nt(i.point_pattern)?i.point_pattern:[i.point_type];return function(a,o,...r){return function(l){var c,u,d,h;const g=e.getTargetSelectorSuffix(l.id||((c=l.data)==null?void 0:c.id)||l),f=(0,w.select)(this);s.indexOf(g)<0&&s.push(g);let p=n[s.indexOf(g)%n.length];if(e.hasValidPointType(p))p=e[p];else if(!br(p||i.point_type)){const _=e.getDefsPointId(g);if(t.defs.select(`#${_}`).size()<1&&vr.bind(e)(p,_),a==="create")return(u=e.custom)==null?void 0:u.create.bind(o)(f,_,...r);if(a==="update")return(d=e.custom)==null?void 0:d.update.bind(o)(f,...r)}return(h=p[a])==null?void 0:h.bind(o)(f,...r)}}}};function $s(e){const t=e.config.polar_level_max;let i=e.getMinMaxData().max[0].value;return t&&t>i&&(i=t),i}var Tr={initPolar(){const e=this,{$el:{arcs:t},config:i}=e,s=i.polar_level_text_show,n=i.polar_level_text_backgroundColor;t.levels=t.append("g").attr("class",Dt.levels),s&&n&&e.generateTextBGColorFilter(n)},getPolarOuterRadius(e,t){var i;const s=$s(this);return((i=e==null?void 0:e.data.values[0].value)!=null?i:0)/s*t},updateTargetsForPolar(e){this.updateTargetsForArc(e)},redrawPolar(){const e=this,{config:t}=e;t.polar_level_show&&e.updatePolarLevel()},updatePolarLevel(){const e=this,{config:t,state:i,$el:{arcs:{levels:s}}}=e,n=t.polar_level_depth,a=$s(e),o=we(0,n),r=i.radius,l=o.map(h=>r*((h+1)/n)),c=(t.polar_level_text_format||function(){}).bind(e.api),u=s.selectAll(`.${Dt.level}`).data(o);u.exit().remove();const d=u.enter().append("g").attr("class",(h,g)=>`${Dt.level} ${Dt.level}-${g}`);if(d.append("circle"),d.merge(u).selectAll("circle").style("visibility",t.polar_level_show?null:"hidden").attr("cx",0).attr("cy",0).attr("r",h=>l[h]),t.polar_level_text_show){const h=t.polar_level_text_backgroundColor,g=`#${i.datetimeId}-labels-bg${e.getTargetSelectorSuffix(h)}`;d.append("text").style("text-anchor","middle"),d.merge(u).selectAll("text").attr("dy",f=>-l[f]+5).attr("filter",h?`url(${g})`:null).text(f=>c(a/o.length*(f+1)))}}};function Ar(e,t,i,s,n,a){const o=e&&s>0?i-s:s,r=2*Math.PI;return n*(1-a*(t==="x"?Math.sin:Math.cos)(o*r/i))}const ne=_t.radarPoints,ys=_t.radarTextWidth;var wr={initRadar(){const e=this,{config:t,state:{current:i},$el:s}=e;e.hasType("radar")&&(s.radar=s.main.select(`.${I.chart}`).append("g").attr("class",ni.chartRadars),s.radar.levels=s.radar.append("g").attr("class",Dt.levels),s.radar.axes=s.radar.append("g").attr("class",ot.axis),s.radar.shapes=s.radar.append("g").attr("class",it.shapes),i.dataMax=t.radar_axis_max||e.getMinMaxData().max[0].value,t.radar_axis_text_show&&(t.interaction_enabled&&e.bindRadarEvent(),e.updateRadarLevel(),e.updateRadarAxes()))},getRadarSize(){const e=this,{config:t,state:{arcWidth:i,arcHeight:s}}=e,n=t.axis_x_categories.length<4?-20:10,a=(Math.min(i,s)-n)/2;return[a,a]},updateTargetsForRadar(e){const t=this,{config:i}=t;wt(i.axis_x_categories)&&(i.axis_x_categories=we(0,St("max",e.map(s=>s.values.length)))),t.generateRadarPoints()},getRadarPosition(e,t,i,s){const n=this,{config:a}=n,[o,r]=n.getRadarSize(),l=a.axis_x_categories.length,c=a.radar_direction_clockwise,u=Vt(e).map(d=>Ar(c,d,l,t,H(i)?i:e==="x"?o:r,O(s)?s:a.radar_size_ratio));return u.length===1?u[0]:u},generateRadarPoints(){const e=this,t=e.data.targets,[i,s]=e.getRadarSize(),n=e.cache.get(ne)||{},a=n._size;(!a||a.width!==i&&a.height!==s)&&(t.forEach(o=>{n[o.id]=o.values.map((r,l)=>e.getRadarPosition(["x","y"],l,void 0,e.getRatio("radar",r)))}),n._size={width:i,height:s},e.cache.add(ne,n))},redrawRadar(){const e=this,{radar:t,main:i}=e.$el,s=e.getTranslate("radar");s&&(t.attr("transform",s),i.select(`.${rt.chartTexts}`).attr("transform",s),e.generateRadarPoints(),e.updateRadarLevel(),e.updateRadarAxes(),e.updateRadarShape())},generateGetRadarPoints(){const e=this.cache.get(ne);return(t,i)=>{const s=e[t.id][i];return[s,s,s,s]}},updateRadarLevel(){const e=this,{config:t,state:i,$el:{radar:s}}=e,[n,a]=e.getRadarSize(),o=t.radar_level_depth,r=t.axis_x_categories.length,l=t.radar_level_text_show,c=s.levels,u=we(0,o),d=t.radar_size_ratio*Math.min(n,a),h=u.map(x=>d*((x+1)/o)),g=(t.radar_level_text_format||function(){}).bind(e.api),f=u.map(x=>{const m=h[x];return we(0,r).map(b=>e.getRadarPosition(["x","y"],b,m,1).join(",")).join(" ")}),p=c.selectAll(`.${Dt.level}`).data(u);p.exit().remove();const _=p.enter().append("g").attr("class",(x,m)=>`${Dt.level} ${Dt.level}-${m}`);_.append("polygon").style("visibility",t.radar_level_show?null:"hidden"),l&&(c.select("text").empty()&&c.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(()=>g(0)),_.append("text").attr("dx","-.5em").style("text-anchor","end").text(x=>g(i.current.dataMax/u.length*(x+1)))),_.merge(p).attr("transform",x=>`translate(${n-h[x]}, ${a-h[x]})`).selectAll("polygon").attr("points",x=>f[x]),l&&c.selectAll("text").attr("x",x=>st(x)?n:f[x].split(",")[0]).attr("y",x=>st(x)?a:0)},updateRadarAxes(){const e=this,{config:t,$el:{radar:i}}=e,[s,n]=e.getRadarSize(),a=t.axis_x_categories;let o=i.axes.selectAll("g").data(a);o.exit().remove();const r=o.enter().append("g").attr("class",(l,c)=>`${ot.axis}-${c}`);if(t.radar_axis_line_show&&r.append("line"),t.radar_axis_text_show&&r.append("text"),o=r.merge(o),t.radar_axis_line_show&&o.select("line").attr("x1",s).attr("y1",n).attr("x2",(l,c)=>e.getRadarPosition("x",c)).attr("y2",(l,c)=>e.getRadarPosition("y",c)),t.radar_axis_text_show){const{x:l=0,y:c=0}=t.radar_axis_text_position,u=e.cache.get(ys)||0;if(o.select("text").style("text-anchor","middle").attr("dy",".5em").call(d=>{d.each(function(h){ue((0,w.select)(this),String(h),[-.6,1.2])})}).datum((d,h)=>({index:h})).attr("transform",function(d){st(this.width)&&(this.width=ct(this,!0).width/2);let h=e.getRadarPosition("x",d.index,void 0,1),g=Math.round(e.getRadarPosition("y",d.index,void 0,1));return h>s?h+=this.width+l:Math.round(h)<s&&(h-=this.width+l),g>n?(g/2===n&&this.firstChild.tagName==="tspan"&&this.firstChild.setAttribute("dy","0em"),g+=c):g<n&&(g-=c),`translate(${h} ${g})`}),!u){const d=[i.axes,i.levels].map(h=>hi(h.node()).width);d.every(h=>h>0)&&e.cache.add(ys,d[0]-d[1])}}},bindRadarEvent(){const e=this,{config:t,state:i,$el:{radar:s,svg:n}}=e,a=e.isPointFocusOnly(),{inputType:o,transiting:r}=i,l=o==="mouse",c=u=>{if(i.event=u,!t.interaction_onout)return;const d=e.getDataIndexFromEvent(u),h=st(d);(l||h)&&(e.hideTooltip(),a?e.hideCircleFocus():e.unexpandCircles(),l?e.setOverOut(!1,d):h&&e.callOverOutForTouch())};s.axes.on(l?"mouseover ":"touchstart",u=>{if(r)return;i.event=u;const d=e.getDataIndexFromEvent(u);e.selectRectForSingle(n.node(),d),l?e.setOverOut(!0,d):e.callOverOutForTouch(d)}).on("mouseout",l?c:null),l||n.on("touchstart",c)},updateRadarShape(){const e=this,t=e.data.targets.filter(a=>e.isRadarType(a)),i=e.cache.get(ne),s=e.$el.radar.shapes.selectAll("polygon").data(e.filterNullish(t)),n=s.enter().append("g").attr("class",e.getChartClass("Radar"));e.$T(s.exit()).remove(),n.append("polygon").merge(s).style("fill",e.color).style("stroke",e.color).attr("points",a=>i[a.id].join(" ")),e.updateTargetForCircle(t,n)},radarCircleX(e){return this.cache.get(ne)[e.id][e.index][0]},radarCircleY(e){return this.cache.get(ne)[e.id][e.index][1]}},Ot=U(14);function Sr(e,t){const i=this,{scale:{x:s,y:n},state:{width:a}}=i;e.selectAll("g").attr("transform",o=>`translate(${o===t?"0,0":`${s(o.x0)},${n(o.y0)}`})`).select("rect").attr("width",o=>o===t?a:s(o.x1)-s(o.x0)).attr("height",o=>o===t?0:n(o.y1)-n(o.y0))}function Rr(e){const t=this;return e.map(i=>{const{id:s,values:n}=i,{value:a}=n[0];return{name:s,id:s,value:a,ratio:t.getRatio("treemap",n[0])}})}function Cr(e){const t=this,i=(0,Ot.hierarchy)(e).sum(n=>n.value),s=t.getSortCompareFn(!0);return[t.treemap(s?i.sort(s):i)]}var kr={initTreemap(){const e=this,{$el:t,state:{current:{width:i,height:s},clip:n,datetimeId:a}}=e;n.id=`${a}-clip`,e.treemap=(0,Ot.treemap)().tile(e.getTreemapTile()),t.defs.append("clipPath").attr("id",n.id).append("rect").attr("width",i).attr("height",s),t.treemap=t.main.select(`.${I.chart}`).attr("clip-path",`url(#${n.id})`).append("g").classed(oi.chartTreemaps,!0),e.bindTreemapEvent()},bindTreemapEvent(){const e=this,{$el:t,config:i,state:s}=e,n=a=>{var o;const r=a.isTrusted?a.target:(o=s.eventReceiver.rect)==null?void 0:o.node();let l;return/^rect$/i.test(r.tagName)&&(s.event=a,l=(0,w.select)(r).datum()),l==null?void 0:l.data};if(i.interaction_enabled){const a=s.inputType==="touch";t.treemap.on(a?"touchstart":"mouseover mousemove",o=>{const r=n(o);r&&(e.showTooltip([r],o.currentTarget),/^(touchstart|mouseover)$/.test(o.type)&&e.setOverOut(!0,r))}).on(a?"touchend":"mouseout",o=>{const r=n(o);i.interaction_onout&&(e.hideTooltip(),e.setOverOut(!1,r))})}},getTreemapTile(){var e,t;const i=this,{config:s,state:{current:{width:n,height:a}}}=i,o=(t={binary:Ot.treemapBinary,dice:Ot.treemapDice,slice:Ot.treemapSlice,sliceDice:Ot.treemapSliceDice,squarify:Ot.treemapSquarify,resquarify:Ot.treemapResquarify}[(e=s.treemap_tile)!=null?e:"binary"])!=null?t:Ot.treemapBinary;return(r,l,c,u,d)=>{o(r,0,0,n,a);for(const h of r.children)h.x0=l+h.x0/n*(u-l),h.x1=l+h.x1/n*(u-l),h.y0=c+h.y0/a*(d-c),h.y1=c+h.y1/a*(d-c)}},getTreemapData(e){const t=this;return{name:"root",children:Rr.bind(t)(t.filterTargetsToShow(e.filter(t.isTreemapType,t)))}},updateTargetsForTreemap(e){const t=this,{$el:{treemap:i}}=t,s=Cr.call(t,t.getTreemapData(e!=null?e:t.data.targets));i.data(t.filterNullish(s))},updateTreemap(e){const t=this,{$el:i,$T:s}=t,n=i.treemap.datum(),a=t.getChartClass("Treemap"),o=t.getClass("treemap",!0),r=i.treemap.selectAll("g").data(n.children);s(r.exit(),e).style("opacity","0").remove(),r.enter().append("g").append("rect"),i.treemap.selectAll("g").attr("class",a).select("rect").attr("class",o).attr("fill",l=>t.color(l.data.name))},generateGetTreemapPoints(){const e=this,{$el:t,scale:{x:i,y:s}}=e,n={};return t.treemap.selectAll("g").each(a=>{n[a.data.name]=[[i(a.x0),s(a.y0)],[i(a.x1),s(a.y1)]]}),a=>n[a.id]},redrawTreemap(e){const t=this,{$el:i,state:{current:{width:s,height:n}}}=t;return i.defs.select("rect").attr("width",s).attr("height",n),[t.$T(i.treemap,e,Ct()).call(Sr.bind(t),i.treemap.datum())]},treemapDataLabelFormat(e){const t=this,{config:i}=t,{id:s,value:n}=e,a=i.treemap_label_format,o=t.getRatio("treemap",e),r=(o*100).toFixed(2),l=i.treemap_label_show&&We.call(t,o,"treemap")?null:"0";return function(c){return c.style("opacity",l),L(a)?a.bind(t.api)(n,o,s):`${s}
33
- ${r}%`}}},Wt={point_show:!0,point_r:2.5,point_radialGradient:!1,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},ae={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},Er={bar_connectLine:!1,bar_front:!1,bar_indices_removeNull:!1,bar_label_threshold:0,bar_linearGradient:!1,bar_overlap:!1,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0},Lr={bubble_maxR:35,bubble_zerobased:!1},Pr={candlestick_width:void 0,candlestick_width_ratio:.6,candlestick_width_max:void 0,candlestick_color_down:"red"},Or={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0},Ir={scatter_zerobased:!1},Je={spline_interpolation_type:"cardinal"},Le={arc_cornerRadius:0,arc_cornerRadius_ratio:0,arc_needle_show:!1,arc_needle_color:void 0,arc_needle_value:void 0,arc_needle_path:void 0,arc_needle_length:100,arc_needle_top_rx:0,arc_needle_top_ry:0,arc_needle_top_width:0,arc_needle_bottom_rx:1,arc_needle_bottom_ry:1,arc_needle_bottom_width:15,arc_needle_bottom_len:0,arc_rangeText_values:void 0,arc_rangeText_unit:"absolute",arc_rangeText_fixed:!1,arc_rangeText_format:void 0,arc_rangeText_position:void 0},Dr={donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_image:void 0,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_rate:.98,donut_expand_duration:50,donut_padAngle:0,donut_startingAngle:0},zr={funnel_neck_width:0,funnel_neck_height:0},Fr={gauge_background:"",gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_extents:void 0,gauge_label_format:void 0,gauge_label_ratio:void 0,gauge_label_threshold:0,gauge_label_image:void 0,gauge_enforceMinMax:!1,gauge_min:0,gauge_max:100,gauge_type:"single",gauge_startingAngle:-1*Math.PI/2,gauge_arcLength:100,gauge_title:"",gauge_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,gauge_expand:{},gauge_expand_rate:.98,gauge_expand_duration:50},Mr={pie_label_show:!0,pie_label_format:void 0,pie_label_ratio:void 0,pie_label_threshold:.05,pie_label_image:void 0,pie_expand:{},pie_expand_rate:.98,pie_expand_duration:50,pie_innerRadius:0,pie_outerRadius:void 0,pie_padAngle:0,pie_padding:0,pie_startingAngle:0},Xr={polar_label_show:!0,polar_label_format:void 0,polar_label_threshold:.05,polar_label_image:void 0,polar_label_ratio:void 0,polar_level_depth:3,polar_level_max:void 0,polar_level_show:!0,polar_level_text_backgroundColor:"#fff",polar_level_text_format:e=>e%1===0?e:e.toFixed(2),polar_level_text_show:!0,polar_padAngle:0,polar_padding:0,polar_startingAngle:0},Br={radar_axis_max:void 0,radar_axis_line_show:!0,radar_axis_text_show:!0,radar_axis_text_position:{},radar_level_depth:3,radar_level_show:!0,radar_level_text_format:e=>e%1===0?e:e.toFixed(2),radar_level_text_show:!0,radar_size_ratio:.87,radar_direction_clockwise:!1},Nr={treemap_tile:"binary",treemap_label_format:void 0,treemap_label_threshold:.05,treemap_label_show:!0};function oe(e,t){dt(Ht.prototype,Object.values(ns).concat(e)),dt(Xt.prototype,No),Yt.setOptions(Object.values(as).concat(t||[]))}function It(e,t){oe([se,Ee,yr].concat(e||[])),Yt.setOptions([Wt,Or].concat(t||[]))}function re(e,t){dt(Ht.prototype,[Zo,se].concat(e||[])),Yt.setOptions([Wt].concat(t||[]))}let bs=()=>(It(ee,[ae]),(bs=()=>k.AREA)()),vs=()=>(It(ee,[ae]),(vs=()=>k.AREA_LINE_RANGE)()),Ts=()=>(It(ee,[ae]),(Ts=()=>k.AREA_STEP_RANGE)()),As=()=>(It(ee,[ae,Je]),(As=()=>k.AREA_SPLINE)()),ws=()=>(It(ee,[ae,Je]),(ws=()=>k.AREA_SPLINE_RANGE)()),Ss=()=>(It(ee,[ae]),(Ss=()=>k.AREA_STEP)()),Rs=()=>(It(),(Rs=()=>k.LINE)()),Cs=()=>(It(void 0,[Je]),(Cs=()=>k.SPLINE)()),ks=()=>(It(),(ks=()=>k.STEP)()),Es=()=>(re(void 0,[Le,Dr]),(Es=()=>k.DONUT)()),Ls=()=>(re([dr],[Le,Fr]),(Ls=()=>k.GAUGE)()),Ps=()=>(re(void 0,[Le,Mr]),(Ps=()=>k.PIE)()),Os=()=>(re([Tr],[Le,Xr]),(Os=()=>k.POLAR)()),Is=()=>(re([ns.eventrect,Ee,wr],[Wt,Br,{axis_x_categories:as.optAxis.axis_x_categories}]),(Is=()=>k.RADAR)()),Ds=()=>(oe([qo,se],[Er,Wt]),(Ds=()=>k.BAR)()),zs=()=>(oe([se,Ee,Ko],[Lr,Wt]),(zs=()=>k.BUBBLE)()),Fs=()=>(oe([ir,se],[Pr,Wt]),(Fs=()=>k.CANDLESTICK)()),Ms=()=>(oe([se,Ee],[Wt,Ir]),(Ms=()=>k.SCATTER)()),Xs=()=>(re([cr],[zr]),(Xs=()=>k.FUNNEL)()),Bs=()=>(oe([kr],[Nr]),(Bs=()=>k.TREEMAP)()),Qe=Object.create(null);const Ns={version:"3.17.0",generate(e){const t=Jt(Object.create(null),Qe,e),i=new Xt(t);return i.internal.charts=this.instance,this.instance.push(i),i},defaults(e){return B(e)&&(Qe=e),Qe},instance:[],plugin:{}};Object.keys(mt).forEach(e=>mt[e]()),Object.keys(D).forEach(e=>D[e]())})(),Pe})()});
33
+ ${r}%`}}},Wt={point_show:!0,point_r:2.5,point_radialGradient:!1,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},ae={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},Er={bar_connectLine:!1,bar_front:!1,bar_indices_removeNull:!1,bar_label_threshold:0,bar_linearGradient:!1,bar_overlap:!1,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0},Lr={bubble_maxR:35,bubble_zerobased:!1},Pr={candlestick_width:void 0,candlestick_width_ratio:.6,candlestick_width_max:void 0,candlestick_color_down:"red"},Or={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0},Ir={scatter_zerobased:!1},Je={spline_interpolation_type:"cardinal"},Le={arc_cornerRadius:0,arc_cornerRadius_ratio:0,arc_needle_show:!1,arc_needle_color:void 0,arc_needle_value:void 0,arc_needle_path:void 0,arc_needle_length:100,arc_needle_top_rx:0,arc_needle_top_ry:0,arc_needle_top_width:0,arc_needle_bottom_rx:1,arc_needle_bottom_ry:1,arc_needle_bottom_width:15,arc_needle_bottom_len:0,arc_rangeText_values:void 0,arc_rangeText_unit:"absolute",arc_rangeText_fixed:!1,arc_rangeText_format:void 0,arc_rangeText_position:void 0},Dr={donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_image:void 0,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_rate:.98,donut_expand_duration:50,donut_padAngle:0,donut_startingAngle:0},zr={funnel_neck_width:0,funnel_neck_height:0},Fr={gauge_background:"",gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_extents:void 0,gauge_label_format:void 0,gauge_label_ratio:void 0,gauge_label_threshold:0,gauge_label_image:void 0,gauge_enforceMinMax:!1,gauge_min:0,gauge_max:100,gauge_type:"single",gauge_startingAngle:-1*Math.PI/2,gauge_arcLength:100,gauge_title:"",gauge_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,gauge_expand:{},gauge_expand_rate:.98,gauge_expand_duration:50},Mr={pie_label_show:!0,pie_label_format:void 0,pie_label_ratio:void 0,pie_label_threshold:.05,pie_label_image:void 0,pie_expand:{},pie_expand_rate:.98,pie_expand_duration:50,pie_innerRadius:0,pie_outerRadius:void 0,pie_padAngle:0,pie_padding:0,pie_startingAngle:0},Xr={polar_label_show:!0,polar_label_format:void 0,polar_label_threshold:.05,polar_label_image:void 0,polar_label_ratio:void 0,polar_level_depth:3,polar_level_max:void 0,polar_level_show:!0,polar_level_text_backgroundColor:"#fff",polar_level_text_format:e=>e%1===0?e:e.toFixed(2),polar_level_text_show:!0,polar_padAngle:0,polar_padding:0,polar_startingAngle:0},Br={radar_axis_max:void 0,radar_axis_line_show:!0,radar_axis_text_show:!0,radar_axis_text_position:{},radar_level_depth:3,radar_level_show:!0,radar_level_text_format:e=>e%1===0?e:e.toFixed(2),radar_level_text_show:!0,radar_size_ratio:.87,radar_direction_clockwise:!1},Nr={treemap_tile:"binary",treemap_label_format:void 0,treemap_label_threshold:.05,treemap_label_show:!0};function oe(e,t){dt(Ht.prototype,Object.values(ns).concat(e)),dt(Xt.prototype,No),Yt.setOptions(Object.values(as).concat(t||[]))}function It(e,t){oe([se,Ee,yr].concat(e||[])),Yt.setOptions([Wt,Or].concat(t||[]))}function re(e,t){dt(Ht.prototype,[Zo,se].concat(e||[])),Yt.setOptions([Wt].concat(t||[]))}let bs=()=>(It(ee,[ae]),(bs=()=>k.AREA)()),vs=()=>(It(ee,[ae]),(vs=()=>k.AREA_LINE_RANGE)()),Ts=()=>(It(ee,[ae]),(Ts=()=>k.AREA_STEP_RANGE)()),As=()=>(It(ee,[ae,Je]),(As=()=>k.AREA_SPLINE)()),ws=()=>(It(ee,[ae,Je]),(ws=()=>k.AREA_SPLINE_RANGE)()),Ss=()=>(It(ee,[ae]),(Ss=()=>k.AREA_STEP)()),Rs=()=>(It(),(Rs=()=>k.LINE)()),Cs=()=>(It(void 0,[Je]),(Cs=()=>k.SPLINE)()),ks=()=>(It(),(ks=()=>k.STEP)()),Es=()=>(re(void 0,[Le,Dr]),(Es=()=>k.DONUT)()),Ls=()=>(re([dr],[Le,Fr]),(Ls=()=>k.GAUGE)()),Ps=()=>(re(void 0,[Le,Mr]),(Ps=()=>k.PIE)()),Os=()=>(re([Tr],[Le,Xr]),(Os=()=>k.POLAR)()),Is=()=>(re([ns.eventrect,Ee,wr],[Wt,Br,{axis_x_categories:as.optAxis.axis_x_categories}]),(Is=()=>k.RADAR)()),Ds=()=>(oe([qo,se],[Er,Wt]),(Ds=()=>k.BAR)()),zs=()=>(oe([se,Ee,Ko],[Lr,Wt]),(zs=()=>k.BUBBLE)()),Fs=()=>(oe([ir,se],[Pr,Wt]),(Fs=()=>k.CANDLESTICK)()),Ms=()=>(oe([se,Ee],[Wt,Ir]),(Ms=()=>k.SCATTER)()),Xs=()=>(re([cr],[zr]),(Xs=()=>k.FUNNEL)()),Bs=()=>(oe([kr],[Nr]),(Bs=()=>k.TREEMAP)()),Qe=Object.create(null);const Ns={version:"3.17.1",generate(e){const t=Jt(Object.create(null),Qe,e),i=new Xt(t);return i.internal.charts=this.instance,this.instance.push(i),i},defaults(e){return B(e)&&(Qe=e),Qe},instance:[],plugin:{}};Object.keys(mt).forEach(e=>mt[e]()),Object.keys(D).forEach(e=>D[e]())})(),Pe})()});