billboard.js 4.0.0 → 4.0.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.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +2 -2
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2 -2
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/Chart/Chart.js +1 -1
- package/dist-esm/Chart/api/axis.js +1 -1
- package/dist-esm/Chart/api/category.js +1 -1
- package/dist-esm/Chart/api/chart.js +1 -1
- package/dist-esm/Chart/api/color.js +1 -1
- package/dist-esm/Chart/api/data.js +1 -1
- package/dist-esm/Chart/api/export.js +1 -1
- package/dist-esm/Chart/api/flow.js +1 -1
- package/dist-esm/Chart/api/focus.js +1 -1
- package/dist-esm/Chart/api/grid.js +1 -1
- package/dist-esm/Chart/api/group.js +1 -1
- package/dist-esm/Chart/api/legend.js +1 -1
- package/dist-esm/Chart/api/load.js +1 -1
- package/dist-esm/Chart/api/regions.js +1 -1
- package/dist-esm/Chart/api/selection.js +1 -1
- package/dist-esm/Chart/api/show.js +1 -1
- package/dist-esm/Chart/api/stubs.js +1 -1
- package/dist-esm/Chart/api/subchart.js +1 -1
- package/dist-esm/Chart/api/tooltip.js +1 -1
- package/dist-esm/Chart/api/x.js +1 -1
- package/dist-esm/Chart/api/zoom.js +1 -1
- package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
- package/dist-esm/ChartInternal/ChartInternal.js +1 -1
- package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
- package/dist-esm/ChartInternal/data/convert.js +1 -1
- package/dist-esm/ChartInternal/data/data.js +1 -1
- package/dist-esm/ChartInternal/data/load.js +1 -1
- package/dist-esm/ChartInternal/interactions/drag.js +1 -1
- package/dist-esm/ChartInternal/interactions/eventrect.js +1 -1
- package/dist-esm/ChartInternal/interactions/flow.js +1 -1
- package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
- package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
- package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
- package/dist-esm/ChartInternal/internals/category.js +1 -1
- package/dist-esm/ChartInternal/internals/class.js +1 -1
- package/dist-esm/ChartInternal/internals/clip.js +1 -1
- package/dist-esm/ChartInternal/internals/color.js +1 -1
- package/dist-esm/ChartInternal/internals/domain.js +1 -1
- package/dist-esm/ChartInternal/internals/format.js +1 -1
- package/dist-esm/ChartInternal/internals/grid.js +1 -1
- package/dist-esm/ChartInternal/internals/legend.js +1 -1
- package/dist-esm/ChartInternal/internals/redraw.js +1 -1
- package/dist-esm/ChartInternal/internals/region.js +1 -1
- package/dist-esm/ChartInternal/internals/scale.js +1 -1
- package/dist-esm/ChartInternal/internals/selection.js +1 -1
- package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
- package/dist-esm/ChartInternal/internals/size.js +1 -1
- package/dist-esm/ChartInternal/internals/style.js +1 -1
- package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
- package/dist-esm/ChartInternal/internals/text.js +1 -1
- package/dist-esm/ChartInternal/internals/text.util.js +1 -1
- package/dist-esm/ChartInternal/internals/title.js +1 -1
- package/dist-esm/ChartInternal/internals/tooltip.js +1 -1
- package/dist-esm/ChartInternal/internals/transform.js +1 -1
- package/dist-esm/ChartInternal/internals/type.js +1 -1
- package/dist-esm/ChartInternal/shape/arc.js +1 -1
- package/dist-esm/ChartInternal/shape/area.js +1 -1
- package/dist-esm/ChartInternal/shape/bar.js +1 -1
- package/dist-esm/ChartInternal/shape/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
- package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
- package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
- package/dist-esm/ChartInternal/shape/core/path.js +1 -1
- package/dist-esm/ChartInternal/shape/core/point.js +1 -1
- package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
- package/dist-esm/ChartInternal/shape/funnel.js +1 -1
- package/dist-esm/ChartInternal/shape/gauge.js +1 -1
- package/dist-esm/ChartInternal/shape/line.js +1 -1
- package/dist-esm/ChartInternal/shape/point.js +1 -1
- package/dist-esm/ChartInternal/shape/polar.js +1 -1
- package/dist-esm/ChartInternal/shape/radar.js +1 -1
- package/dist-esm/ChartInternal/shape/shape.js +1 -1
- package/dist-esm/ChartInternal/shape/treemap.js +1 -1
- package/dist-esm/canvas/CanvasAxisRenderer.js +1 -1
- package/dist-esm/canvas/CanvasEngine.js +1 -1
- package/dist-esm/canvas/CanvasPainter.js +1 -1
- package/dist-esm/canvas/CanvasRenderer.js +1 -1
- package/dist-esm/canvas/CanvasTheme.js +1 -1
- package/dist-esm/canvas/HitDetector.js +1 -1
- package/dist-esm/canvas/axisTicks.js +1 -1
- package/dist-esm/canvas/classes.js +1 -1
- package/dist-esm/canvas/color.js +1 -1
- package/dist-esm/canvas/geometry.js +1 -1
- package/dist-esm/canvas/labels.js +1 -1
- package/dist-esm/canvas/pointPattern.js +1 -1
- package/dist-esm/canvas/util.js +1 -1
- package/dist-esm/config/Options/Options.js +1 -1
- package/dist-esm/config/Options/axis/axis.js +1 -1
- package/dist-esm/config/Options/axis/x.js +1 -1
- package/dist-esm/config/Options/axis/y.js +1 -1
- package/dist-esm/config/Options/axis/y2.js +1 -1
- package/dist-esm/config/Options/common/boost.js +1 -1
- package/dist-esm/config/Options/common/color.js +1 -1
- package/dist-esm/config/Options/common/grid.js +1 -1
- package/dist-esm/config/Options/common/legend.js +1 -1
- package/dist-esm/config/Options/common/main.js +1 -1
- package/dist-esm/config/Options/common/point.js +1 -1
- package/dist-esm/config/Options/common/title.js +1 -1
- package/dist-esm/config/Options/common/tooltip.js +1 -1
- package/dist-esm/config/Options/data/axis.js +1 -1
- package/dist-esm/config/Options/data/data.js +1 -1
- package/dist-esm/config/Options/data/selection.js +1 -1
- package/dist-esm/config/Options/interaction/interaction.js +1 -1
- package/dist-esm/config/Options/interaction/subchart.js +1 -1
- package/dist-esm/config/Options/interaction/zoom.js +1 -1
- package/dist-esm/config/Options/shape/arc.js +1 -1
- package/dist-esm/config/Options/shape/area.js +1 -1
- package/dist-esm/config/Options/shape/bar.js +1 -1
- package/dist-esm/config/Options/shape/bubble.js +1 -1
- package/dist-esm/config/Options/shape/candlestick.js +1 -1
- package/dist-esm/config/Options/shape/donut.js +1 -1
- package/dist-esm/config/Options/shape/funnel.js +1 -1
- package/dist-esm/config/Options/shape/gauge.js +1 -1
- package/dist-esm/config/Options/shape/line.js +1 -1
- package/dist-esm/config/Options/shape/pie.js +1 -1
- package/dist-esm/config/Options/shape/polar.js +1 -1
- package/dist-esm/config/Options/shape/radar.js +1 -1
- package/dist-esm/config/Options/shape/scatter.js +1 -1
- package/dist-esm/config/Options/shape/spline.js +1 -1
- package/dist-esm/config/Options/shape/treemap.js +1 -1
- package/dist-esm/config/Store/Element.js +1 -1
- package/dist-esm/config/Store/State.js +1 -1
- package/dist-esm/config/Store/Store.js +1 -1
- package/dist-esm/config/classes.js +1 -1
- package/dist-esm/config/config.js +1 -1
- package/dist-esm/config/const.js +1 -1
- package/dist-esm/config/resolver/axis.core.js +1 -1
- package/dist-esm/config/resolver/axis.js +1 -1
- package/dist-esm/config/resolver/canvas.js +1 -1
- package/dist-esm/config/resolver/canvasShape.js +1 -1
- package/dist-esm/config/resolver/category.js +1 -1
- package/dist-esm/config/resolver/export.js +1 -1
- package/dist-esm/config/resolver/flow.js +1 -1
- package/dist-esm/config/resolver/grid.js +1 -1
- package/dist-esm/config/resolver/interaction/selection.js +1 -1
- package/dist-esm/config/resolver/interaction/subchart.js +1 -1
- package/dist-esm/config/resolver/interaction/zoom.js +1 -1
- package/dist-esm/config/resolver/regions.js +1 -1
- package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/area.js +1 -1
- package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/bar.js +1 -1
- package/dist-esm/config/resolver/shape/bubble.js +1 -1
- package/dist-esm/config/resolver/shape/candlestick.js +1 -1
- package/dist-esm/config/resolver/shape/donut.js +1 -1
- package/dist-esm/config/resolver/shape/funnel.js +1 -1
- package/dist-esm/config/resolver/shape/gauge.js +1 -1
- package/dist-esm/config/resolver/shape/line.js +1 -1
- package/dist-esm/config/resolver/shape/pie.js +1 -1
- package/dist-esm/config/resolver/shape/polar.js +1 -1
- package/dist-esm/config/resolver/shape/radar.js +1 -1
- package/dist-esm/config/resolver/shape/scatter.js +1 -1
- package/dist-esm/config/resolver/shape/treemap.js +1 -1
- package/dist-esm/core.js +3 -3
- package/dist-esm/index.canvas.js +1 -1
- package/dist-esm/index.esm.js +1 -1
- package/dist-esm/module/Cache.js +1 -1
- package/dist-esm/module/browser.js +1 -1
- package/dist-esm/module/dsv.js +1 -1
- package/dist-esm/module/error.js +1 -1
- package/dist-esm/module/generator.js +1 -1
- package/dist-esm/module/sanitize.js +1 -1
- package/dist-esm/module/util/brush.js +1 -1
- package/dist-esm/module/util/dom.js +1 -1
- package/dist-esm/module/util/object.js +1 -1
- package/dist-esm/module/util/type-checks.js +1 -1
- package/dist-esm/module/worker.js +1 -1
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +8 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.1
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.11
|
|
@@ -64,4 +64,4 @@ ${(l*100).toFixed(2)}%`;return u==null?null:String(u)}var XR=Array.prototype.sli
|
|
|
64
64
|
</foreignObject></svg>`;return`data:image/svg+xml;base64,${pE(d)}`}function xE(t,e){const{top:n,left:r}=e,{x:i,y:o}=da(t,!0),{a:s,b:l,c,d:u,e:f,f:d}=t.getScreenCTM(),{width:h,height:m}=un(t,!0);return{x:s*i+c*o+f-r,y:l*i+u*o+d-n+(m-Math.round(m/4)),width:h,height:m}}function yE(t){const{left:e,top:n}=un(t),r=o=>o.textContent||o.childElementCount,i=[];return Ea(t.querySelectorAll("text")).filter(r).forEach(o=>{const s=l=>{const{fill:c,fontFamily:u,fontSize:f,textAnchor:d,transform:h}=ce.getComputedStyle(l),{x:m,y:A,width:R,height:C}=xE(l,{left:e,top:n});return{[l.textContent]:{x:m,y:A,width:R,height:C,fill:c,fontFamily:u,fontSize:f,textAnchor:d,transform:h}}};o.childElementCount>1?Ea(o.querySelectorAll("tspan")).filter(r).forEach(l=>{i.push(s(l))}):i.push(s(o))}),i}function TE(t,e){e.forEach(n=>{Object.keys(n).forEach(r=>{const{x:i,y:o,width:s,height:l,fill:c,fontFamily:u,fontSize:f,transform:d}=n[r];if(t.save(),t.font=`${f} ${u}`,t.fillStyle=c,d==="none")t.fillText(r,i,o);else{const h=d.replace(/(matrix|\(|\))/g,"").split(",");h.splice(4).every(m=>+m==0)?(h.push(i+s-s/4),h.push(o-l+l/3)):(h.push(i),h.push(o)),t.transform(...h),t.fillText(r,0,0)}t.restore()})})}function bE(t,e,n){const{width:r,height:i}=e||n,o=He.createElement("canvas"),s=o.getContext("2d");if(o.width=r,o.height=i,s){let c=0,u=r,f=i;if((e==null?void 0:e.preserveAspectRatio)!==!1){const d=Math.min(r/n.width,i/n.height);u=n.width*d,f=n.height*d,c=(i-f)/2}s.drawImage(t,0,0,t.width,t.height,0,c,u,f)}return o.toDataURL(e.mimeType)}var SE={export(t,e){var n;const r=this.internal,{state:i,$el:{chart:o,svg:s}}=r,l=(n=r.canvasEngine)==null?void 0:n.canvas,c=i.isCanvasMode&&l?un(l,!0):null,{width:u,height:f}=c&&c.width&&c.height?{width:c.width,height:c.height}:i.current,d=Gr(Object.create(null),{width:u,height:f,preserveAspectRatio:!0,preserveFontStyle:!1,mimeType:"image/png"},t);if(i.isCanvasMode&&l){const A=bE(l,d,{width:u,height:f});return e==null||e.bind(this)(A),A}const h=mE(o.node(),d,{width:u,height:f}),m=d.preserveFontStyle?yE(s.node()):[];if(e&&le(e)){const A=new Image;A.crossOrigin="Anonymous",A.onload=()=>{const R=He.createElement("canvas"),C=R.getContext("2d");R.width=d.width||u,R.height=d.height||f,C.drawImage(A,0,0),m.length&&(TE(C,m),m.length=0),e.bind(this)(R.toDataURL(d.mimeType))},A.src=h}return h}};let Bg=()=>(Kn.prototype.export=SE.export,(Bg=()=>({}))());var AE={flow(t){const e=this.internal;let n;(t.json||t.rows||t.columns)&&e.convertData(t,i=>{n=i,r()});function r(){var i,o,s;let l,c=0,u=0,f,d;if(e.state.redrawing||!n||!Qi())return;(i=e.flushCanvasFlow)==null||i.call(e);const h=[],m=e.getMaxDataCount(),A=e.convertDataToTargets(n,!0),R=e.axis.isTimeSeries();e.data.targets.forEach(z=>{let $=!1;for(let B=0;B<A.length;B++)if(z.id===A[B].id){$=!0,z.values[z.values.length-1]&&(u=z.values[z.values.length-1].index+1);const W=A[B].values;c=W.length;for(let H=0;H<c;H++)W[H].index=u+H,R||(W[H].x=u+H),z.values.push(W[H]);A.splice(B,1);break}!$&&h.push(z.id)}),e.data.targets.forEach(z=>{for(let $=0;$<h.length;$++)if(z.id===h[$]){if(!z.values[z.values.length-1])continue;u=z.values[z.values.length-1].index+1;for(let B=0;B<c;B++)z.values.push({id:z.id,index:u+B,x:R?e.getOtherTargetX(u+B):u+B,value:null})}}),e.data.targets.length&&A.forEach(z=>{const $=e.data.targets[0].values[0].index,B=z.values,W=B.length,H=Math.max(u-$,0);if(H){B.length=W+H;for(let J=W-1;J>=0;J--)B[J+H]=B[J];for(let J=0;J<H;J++){const q=$+J;B[J]={id:z.id,index:q,x:R?e.getOtherTargetX(q):q,value:null}}}for(let J=H;J<B.length;J++){const q=B[J];q.index+=u,R||(q.x+=u)}});for(let z=0;z<A.length;z++)e.data.targets.push(A[z]);const C=e.data.targets[0],P=C.values[0];if(ln(t.to)?(c=0,d=R?Hn.call(e,t.to):t.to,C.values.forEach(z=>{z.x<d&&c++})):ln(t.length)&&(c=t.length),m?m===1&&R&&(f=(C.values[C.values.length-1].x-P.x)/2,l=[new Date(+P.x-f),new Date(+P.x+f)]):(R?f=C.values.length>1?C.values[C.values.length-1].x-P.x:P.x-e.getXDomain(e.data.targets)[0]:f=1,l=[P.x-f,P.x]),l&&e.updateXDomain(null,!0,!0,!1,l),e.state.isCanvasMode){const z=We(t.duration)?t.duration:e.config.transition_duration;if((o=e.animateCanvasFlow)==null?void 0:o.call(e,{done:t.done,duration:z,length:c,orgDataCount:m}))return;c&&m&&e.data.targets.forEach(B=>{B.values.splice(0,c)}),e.state.dirty.data=!0,e.state._eventRectFingerprint=null,e.redraw({withLegend:!0,withTransition:!1,withTrimXDomain:!1,withUpdateOrgXDomain:!0,withUpdateXAxis:!0,withUpdateXDomain:!0}),e.updateTypesElements(),(s=t.done)==null||s.call(e.api);return}e.updateTargets(e.data.targets),e.state.dirty.data=!0,e.state._eventRectFingerprint=null,e.redraw({flow:{index:P.index,length:c,duration:We(t.duration)?t.duration:e.config.transition_duration,done:t.done,orgDataCount:m},withLegend:!0,withTransition:m>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}},EE={generateFlow(t){const e=this,{data:n,state:r,$el:i}=e;return function(){var o;const s=t.flow.length;r.flowing=!0,n.targets.forEach(c=>{c.values.splice(0,s)}),r.dataGeneration++,e.updateXGrid&&e.updateXGrid(!0);const l={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(c=>{const u=c.split(".");let f=i[u[0]];f&&u.length>1&&(f=f[u[1]]),f!=null&&f.size()&&(l[c]=f)}),(o=e.hideGridFocus)==null||o.call(e),e.setFlowList(l,t)}},setFlowList(t,e){const n=this,{flow:r,targets:i}=e,{duration:o=e.duration,index:s,length:l,orgDataCount:c}=r,u=n.getFlowTransform(i,c,s,l),f=eh();let d;f.add(Object.keys(t).map(h=>(d=t[h].transition().ease(m=>+m).duration(o),h==="axis.x"?d=d.call(m=>{n.axis.x.setTransition(m).create(m)}):h==="region.list"?d=d.filter(n.isRegionOnX).attr("transform",u):d=d.attr("transform",u),d))),d.call(f,()=>{n.cleanUpFlow(t,e)})},cleanUpFlow(t,e){const n=this,{config:r,state:i,$el:{svg:o}}=n,s=r.axis_rotated,{flow:l,shape:c,xv:u}=e,{cx:f,cy:d,xForText:h,yForText:m}=c.pos,{done:A=()=>{},length:R}=l;R&&(["circle","text","shape","eventRect"].forEach(C=>{const P=[];for(let z=0;z<R;z++)P.push(`.${en[C]}-${z}`);o.selectAll(`.${en[`${C}s`]}`).selectAll(P).remove()}),o.select(`.${en.xgrid}`).remove()),Object.keys(t).forEach(C=>{const P=t[C];if(C!=="axis.x"&&P.attr("transform",null),C==="grid.x")P.attr(i.xgridAttr);else if(C==="gridLines.x")P.attr("x1",s?0:u).attr("x2",s?i.width:u),P.select("text").attr("x",s?i.width:0).attr("y",u);else if(/^(area|bar|line)$/.test(C))P.attr("d",c.type[C]);else if(C==="text")P.attr("x",h).attr("y",m).style("fill-opacity",n.opacityForText.bind(n));else if(C==="circle")if(n.isCirclePoint())P.attr("cx",f).attr("cy",d);else{const z=B=>f(B)-r.point_r,$=B=>d(B)-r.point_r;P.attr("x",z).attr("y",$)}else C==="region.list"&&P.select("rect").filter(n.isRegionOnX).attr("x",n.regionX.bind(n)).attr("width",n.regionWidth.bind(n))}),r.interaction_enabled&&n.redrawEventRect(),A.call(n.api),i.flowing=!1},getFlowTransform(t,e,n,r){const i=this,{data:o,scale:{x:s}}=i,l=o.targets[0].values;let c=i.getValueOnIndex(l,n),u=i.getValueOnIndex(l,n+r),f;const d=s.domain(),h=i.updateXDomain(t,!0,!0);e?e===1||(c==null?void 0:c.x)===(u==null?void 0:u.x)?f=s(d[0])-s(h[0]):f=i.axis.isTimeSeries()?s(d[0])-s(h[0]):s((c==null?void 0:c.x)||0)-s(u.x):l.length!==1?f=s(d[0])-s(h[0]):i.axis.isTimeSeries()?(c=i.getValueOnIndex(l,0),u=i.getValueOnIndex(l,l.length-1),f=s(c.x)-s(u.x)):f=Aa(h)/2;const m=Aa(d)/Aa(h);return`translate(${f},0) scale(${m},1)`}};let zg=()=>(yn(Er.prototype,EE),Kn.prototype.flow=AE.flow,(zg=()=>({}))());function Ug(t){return Array.isArray(t)?t:[t]}function kg(t){var e;t.state.canvasShape=null,(e=t.renderCanvasFrame)==null||e.call(t,void 0,null,!1)}function _c(t,e){const n=this.internal,{config:r}=n,i=r.transition_duration&&Qi(),o=`grid_${e}_lines`;return t?(r[o]=Ug(t),n.state.isCanvasMode?(kg(n),r[o]):(n.updateGrid(),n.redrawGrid(i),r[o])):r[o]}function Xg(t,e){const n=`grid_${e}_lines`;return _c.bind(this)(this.internal.config[n].concat(t?Ug(t):[]),e)}function Gg(t,e){var n;const r=this.internal;if(r.state.isCanvasMode){const i=((n=r.getGridFilterToRemove)==null?void 0:n.call(r,t))||(()=>!0),o=`grid_${e?"x":"y"}_lines`;r.config[o]=r.config[o].filter(s=>!i(s)),kg(r);return}r.removeGridLines(t,e)}const Wg=function(t){return _c.bind(this)(t,"x")};yn(Wg,{add(t){return Xg.bind(this)(t,"x")},remove(t){return Gg.bind(this)(t,!0)}});const Vg=function(t){return _c.bind(this)(t,"y")};yn(Vg,{add(t){return Xg.bind(this)(t,"y")},remove(t){return Gg.bind(this)(t,!1)}});var jg={xgrids:Wg,ygrids:Vg};const CE=`line.${rn.xgridFocus}, line.${rn.ygridFocus}`,IE=t=>We(t.position)||"end",RE=t=>t.position==="start"?4:t.position==="middle"?0:-4;function Hg(t){var e;const{state:n,$el:{main:r}}=t,i=n._gridFocusEl,o=r.node(),s=((e=i==null?void 0:i.nodes)==null?void 0:e.call(i))||[];return s.length&&s.every(l=>o==null?void 0:o.contains(l))?i:n._gridFocusEl=r.selectAll(CE)}function Yg(t,e,n){return r=>{let i=t?0:e;return r.position==="start"?i=t?-n:0:r.position==="middle"&&(i=(t?-n:e)/2),i}}function Kg(t,e){e==="grid"&&t.each(function(){const n=Ut(this);["x1","x2","y1","y2"].forEach(r=>n.attr(r,+n.attr(r)))})}var wE={hasGrid(){const{config:t}=this;return["x","y"].some(e=>t[`grid_${e}_show`]||t[`grid_${e}_lines`].length)},initGrid(){const t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines(){const t=this,{config:e,state:{clip:n},$el:r}=t;(e.grid_x_lines.length||e.grid_y_lines.length)&&(r.gridLines.main=r.main.insert("g",`.${ze.chart}${e.grid_lines_front?" + *":""}`).attr("clip-path",n.pathGrid).attr("class",`${Tn.grid} ${Tn.gridLines}`),r.gridLines.main.append("g").attr("class",Tn.xgridLines),r.gridLines.main.append("g").attr("class",Tn.ygridLines),r.gridLines.x=Yh([]))},updateXGrid(t){const e=this,{config:n,scale:r,state:i,$el:{main:o,grid:s}}=e,l=n.axis_rotated,c=e.generateGridData(n.grid_x_type,r.x),u=e.axis.isCategorized()?e.axis.x.tickOffset():0,f=d=>(r.zoom||r.x)(d)+u*(l?-1:1);i.xgridAttr=l?{x1:0,x2:i.width,y1:f,y2:f}:{x1:f,x2:f,y1:0,y2:i.height},s.x=o.select(`.${Tn.xgrids}`).selectAll(`.${Tn.xgrid}`).data(c),s.x.exit().remove(),s.x=s.x.enter().append("line").attr("class",Tn.xgrid).merge(s.x),t||s.x.each(function(){const d=Ut(this);Object.keys(i.xgridAttr).forEach(h=>{d.attr(h,i.xgridAttr[h])}),d.style("opacity",()=>+d.attr(l?"y1":"x1")===(l?i.height:0)?"0":null)})},updateYGrid(){const t=this,{axis:e,config:n,scale:r,state:i,$el:{grid:o,main:s}}=t,l=n.axis_rotated,c=f=>r.y(f),u=e.y.getGeneratedTicks(n.grid_y_ticks)||t.scale.y.ticks(n.grid_y_ticks);o.y=s.select(`.${Tn.ygrids}`).selectAll(`.${Tn.ygrid}`).data(u),o.y.exit().remove(),o.y=o.y.enter().append("line").attr("class",Tn.ygrid).merge(o.y),o.y.attr("x1",l?c:0).attr("x2",l?c:i.width).attr("y1",l?0:c).attr("y2",l?i.height:c),Kg(o.y,"grid")},updateGrid(){const t=this,{$el:{grid:e,gridLines:n}}=t;!n.main&&t.initGridLines(),e.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateGridLines("x"),t.updateGridLines("y")},updateGridLines(t){const e=this,{config:n,$el:{gridLines:r,main:i},$T:o}=e,s=n.axis_rotated,l=t==="x";n[`grid_${t}_show`]&&e[`update${t.toUpperCase()}Grid`]();let c=i.select(`.${Tn[`${t}gridLines`]}`).selectAll(`.${Tn[`${t}gridLine`]}`).data(n[`grid_${t}_lines`]);o(c.exit()).style("opacity","0").remove();const u=c.enter().append("g");u.append("line").style("opacity","0"),c=u.merge(c),c.each(function(f){const d=Ut(this);d.select("text").empty()&&f.text&&d.append("text").style("opacity","0")}),o(c.attr("class",f=>`${Tn[`${t}gridLine`]} ${f.class||""}`.trim()).select("text").attr("text-anchor",IE).attr("transform",()=>l?s?null:"rotate(-90)":s?"rotate(-90)":null).attr("dx",RE).attr("dy",-5)).text(function(f){var d;return(d=f.text)!=null?d:this.remove()}),r[t]=c},redrawGrid(t){const e=this,{config:{axis_rotated:n},state:{width:r,height:i},$el:{gridLines:o},$T:s}=e,l=e.xv.bind(e),c=e.yv.bind(e);let u=o.x.select("line"),f=o.x.select("text"),d=o.y.select("line"),h=o.y.select("text");return u=s(u,t).attr("x1",n?0:l).attr("x2",n?r:l).attr("y1",n?l:0).attr("y2",n?l:i),f=s(f,t).attr("x",Yg(!n,r,i)).attr("y",l),d=s(d,t).attr("x1",n?c:0).attr("x2",n?c:r).attr("y1",n?0:c).attr("y2",n?i:c),h=s(h,t).attr("x",Yg(n,r,i)).attr("y",c),[u.style("opacity",null),f.style("opacity",null),d.style("opacity",null),h.style("opacity",null)]},initFocusGrid(){const t=this,{config:e,state:n,state:{clip:r},$el:i}=t;n._gridFocusEl=null;const o=e.grid_front,s=`.${o&&i.gridLines.main?Tn.gridLines:ze.chart}${o?" + *":""}`,l=i.main.insert("g",s).attr("clip-path",r.pathGrid).attr("class",Tn.grid);if(i.grid.main=l,e.grid_x_show&&l.append("g").attr("class",Tn.xgrids),e.grid_y_show&&l.append("g").attr("class",Tn.ygrids),e.axis_tooltip){const c=l.append("g").attr("class","bb-axis-tooltip");c.append("line").attr("class","bb-axis-tooltip-x"),c.append("line").attr("class","bb-axis-tooltip-y")}e.interaction_enabled&&e.grid_focus_show&&!e.axis_tooltip&&(l.append("g").attr("class",rn.xgridFocus).append("line").attr("class",rn.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&l.append("g").attr("class",rn.ygridFocus).append("line").attr("class",rn.ygridFocus))},showAxisGridFocus(){var t,e;const n=this,{config:r,format:i,state:{event:o,width:s,height:l}}=n,c=r.axis_rotated,[u,f]=hr(o,(t=n.$el.eventRect)==null?void 0:t.node()),d={x:u,y:f};for(const[h,m]of Object.entries(n.$el.axisTooltip)){const A=h==="x"&&!c||h!=="x"&&c?"x":"y",R=d[A];let C=(e=n.scale[h])==null?void 0:e.invert(R);C&&(C=h==="x"&&n.axis.isTimeSeries()?i.xAxisTick(C):C==null?void 0:C.toFixed(2),m==null||m.attr(A,R).text(C))}n.$el.main.selectAll("line.bb-axis-tooltip-x, line.bb-axis-tooltip-y").style("visibility",null).each(function(h,m){const A=Ut(this);m===0?A.attr("x1",u).attr("x2",u).attr("y1",m?0:l).attr("y2",m?l:0):A.attr("x1",m?0:s).attr("x2",m?s:0).attr("y1",f).attr("y2",f)})},hideAxisGridFocus(){const t=this;t.$el.main.selectAll(`line.${Rn.axisTooltipX}, line.${Rn.axisTooltipY}`).style("visibility","hidden"),Object.values(t.$el.axisTooltip).forEach(e=>e==null?void 0:e.style("display","none"))},showGridFocus(t){var e;const n=this,{config:r,state:{width:i,height:o}}=n,s=r.axis_rotated,l=Hg(n),c=(t||[l.datum()]).filter(d=>d&&We(n.getBaseValue(d)));if(!r.tooltip_show||c.length===0||!r.axis_x_forceAsSingle&&n.hasType("bubble")||n.hasArcType())return;const u=r.grid_focus_edge&&!r.tooltip_grouped,f=n.xx.bind(n);l.style("visibility",null).data(c.concat(c)).each(function(d){const h=Ut(this),m={x:f(d),y:n.getYScaleById(d.id)(d.value)};let A;if(h.classed(rn.xgridFocus))A=s?[null,m.x,u?m.y:i,m.x]:[m.x,u?m.y:null,m.x,o];else{const R=n.axis.getId(d.id)==="y2";A=s?[m.y,u&&!R?m.x:null,m.y,u&&R?m.x:o]:[u&&R?m.x:null,m.y,u&&!R?m.x:i,m.y]}["x1","y1","x2","y2"].forEach((R,C)=>h.attr(R,A[C]))}),Kg(l,"grid"),(e=n.showCircleFocus)==null||e.call(n,t)},hideGridFocus(t=!1){var e;const n=this,{state:{inputType:r,resizing:i}}=n;(t||r==="mouse"||!i)&&(Hg(n).style("visibility","hidden"),(e=n.hideCircleFocus)==null||e.call(n))},updateGridFocus(){var t;const e=this,{state:{inputType:n,width:r,height:i,resizing:o},$el:{grid:s}}=e,l=s.main.select(`line.${rn.xgridFocus}`);if(n==="touch")l.empty()?o&&((t=e.showCircleFocus)==null||t.call(e)):e.showGridFocus();else{const c=e.config.axis_rotated;l.attr("x1",c?0:-10).attr("x2",c?r:-10).attr("y1",c?-10:0).attr("y2",c?-10:i)}return!0},generateGridData(t,e){const n=this,r=n.$el.main.select(`.${Rn.axisX}`).selectAll(".tick").size();let i=[];if(t==="year"){const o=n.getXDomain(n.data.targets),[s,l]=o.map(c=>c.getFullYear());for(let c=s;c<=l;c++)i.push(new Date(`${c}-01-01 00:00:00`))}else i=e.ticks(hn),i.length>r&&(i=i.filter(o=>String(o).indexOf(".")<0));return i},getGridFilterToRemove(t){return t?e=>{let n=!1;return(tn(t)?t.concat():[t]).forEach(r=>{("value"in r&&e.value===r.value||"class"in r&&e.class===r.class)&&(n=!0)}),n}:()=>!0},removeGridLines(t,e){const n=this,{config:r,$T:i}=n,o=n.getGridFilterToRemove(t),s=f=>!o(f),l=e?Tn.xgridLines:Tn.ygridLines,c=e?Tn.xgridLine:Tn.ygridLine;i(n.$el.main.select(`.${l}`).selectAll(`.${c}`).filter(o)).style("opacity","0").remove();const u=`grid_${e?"x":"y"}_lines`;r[u]=r[u].filter(s)}},OE={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};let Zg=()=>(yn(Er.prototype,wE),Kn.prototype.xgrids=jg.xgrids,Kn.prototype.ygrids=jg.ygrids,Fa.setOptions([OE]),(Zg=()=>({}))());function Jg(t=!1,e,n,r){const i=this,{config:o,$el:{main:s}}=i,l=o.data_selection_grouped,c=o.data_selection_isselectable.bind(i.api);o.data_selection_enabled&&s.selectAll(`.${bn.shapes}`).selectAll(`.${bn.shape}`).each(function(u){const f=Ut(this),{id:d,index:h}=u.data?u.data:u,m=i.getToggle(this,u).bind(i),A=l||!e||e.indexOf(d)>=0,R=!n||n.indexOf(h)>=0,C=f.classed(gn.SELECTED);f.classed(Lr.line)||f.classed(as.area)||(t?A&&R&&c(u)&&!C?m(!0,f.classed(gn.SELECTED,!0),u,h):ln(r)&&r&&C&&m(!1,f.classed(gn.SELECTED,!1),u,h):A&&R&&c(u)&&C&&m(!1,f.classed(gn.SELECTED,!1),u,h))})}var PE={selected(t){var e;const n=this.internal,r=[];return n.state.isCanvasMode?((e=n.getCanvasSelectedData)==null?void 0:e.call(n,t))||r:(n.$el.main.selectAll(`.${bn.shapes+n.getTargetSelectorSuffix(t)}`).selectAll(`.${bn.shape}`).filter(function(){return Ut(this).classed(gn.SELECTED)}).each(i=>r.push(i)),r)},select(t,e,n){var r;const i=this.internal;if(i.state.isCanvasMode){(r=i.setCanvasSelection)==null||r.call(i,!0,t,e,n);return}Jg.bind(i)(!0,t,e,n)},unselect(t,e){var n;const r=this.internal;if(r.state.isCanvasMode){(n=r.setCanvasSelection)==null||n.call(r,!1,t,e);return}Jg.bind(r)(!1,t,e)}},ME={drag(t){const e=this,{config:n,state:r,$el:{main:i}}=e,o=n.data_selection_grouped,s=n.interaction_enabled&&n.data_selection_isselectable;if(e.hasArcType()||!n.data_selection_enabled||n.zoom_enabled&&!e.zoom.altDomain||!n.data_selection_multiple)return;const[l,c]=r.dragStart||[0,0],[u,f]=t,d=Math.min(l,u),h=Math.max(l,u),m=o?r.margin.top:Math.min(c,f),A=o?r.height:Math.max(c,f),R=()=>{!e||!e.$el||!e.$el.main||(i.select(`.${Da.dragarea}`).attr("x",d).attr("y",m).attr("width",h-d).attr("height",A-m),i.selectAll(`.${bn.shapes}`).selectAll(`.${bn.shape}`).filter(C=>s==null?void 0:s.bind(e.api)(C)).each(function(C,P){const z=Ut(this),$=z.classed(gn.SELECTED),B=z.classed(Da.INCLUDED);let W,H;if(z.classed(Bn.circle)){const J=+z.attr("cx"),q=+z.attr("cy");H=e.togglePoint,W=d<J&&J<h&&m<q&&q<A}else if(z.classed(nr.bar)){const{x:J,y:q,width:at,height:et}=_d(this);H=e.togglePath,W=!(h<J||J+at<d)&&!(A<q||q+et<m)}else return;W^B&&(z.classed(Da.INCLUDED,!B),z.classed(gn.SELECTED,!$),H.call(e,!$,z,C,P))}))};th(e.state,R)},dragstart(t){const e=this,{config:n,state:r,$el:{main:i}}=e;e.hasArcType()||!n.data_selection_enabled||(r.dragStart=t,i.select(`.${ze.chart}`).append("rect").attr("class",Da.dragarea).style("opacity","0.1"),e.setDragStatus(!0))},dragend(){const t=this,{config:e,$el:{main:n},$T:r}=t;t.hasArcType()||!e.data_selection_enabled||(r(n.select(`.${Da.dragarea}`)).style("opacity","0").remove(),n.selectAll(`.${bn.shape}`).classed(Da.INCLUDED,!1),t.setDragStatus(!1))}},LE=Object.defineProperty,DE=Object.defineProperties,FE=Object.getOwnPropertyDescriptors,Qg=Object.getOwnPropertySymbols,NE=Object.prototype.hasOwnProperty,$E=Object.prototype.propertyIsEnumerable,_g=(t,e,n)=>e in t?LE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,BE=(t,e)=>{for(var n in e||(e={}))NE.call(e,n)&&_g(t,n,e[n]);if(Qg)for(var n of Qg(e))$E.call(e,n)&&_g(t,n,e[n]);return t},zE=(t,e)=>DE(t,FE(e)),UE=zE(BE({},ME),{selectPoint(t,e,n){const r=this,{config:i,$el:{main:o},$T:s}=r,l=i.axis_rotated,c=(l?r.circleY:r.circleX).bind(r),u=(l?r.circleX:r.circleY).bind(r),f=r.pointSelectR.bind(r);Ne(i.data_onselected,r.api,e,t.node()),s(o.select(`.${gn.selectedCircles}${r.getTargetSelectorSuffix(e.id)}`).selectAll(`.${gn.selectedCircle}-${n}`).data([e]).enter().append("circle").attr("class",()=>r.generateClass(gn.selectedCircle,n)).attr("cx",c).attr("cy",u).attr("stroke",r.color).attr("r",d=>r.pointSelectR(d)*1.4)).attr("r",f)},unselectPoint(t,e,n){const r=this,{config:i,$el:{main:o},$T:s}=r;Ne(i.data_onunselected,r.api,e,t==null?void 0:t.node()),s(o.select(`.${gn.selectedCircles}${r.getTargetSelectorSuffix(e.id)}`).selectAll(`.${gn.selectedCircle}-${n}`)).attr("r",0).remove()},togglePoint(t,e,n,r){this[`${t?"":"un"}selectPoint`](e,n,r)},selectPath(t,e){const n=this,{config:r}=n;Ne(r.data_onselected,n.api,e,t.node()),r.interaction_brighten&&t.style("filter","brightness(1.25)")},unselectPath(t,e){const n=this,{config:r}=n;Ne(r.data_onunselected,n.api,e,t.node()),r.interaction_brighten&&t.style("filter",null)},togglePath(t,e,n,r){this[`${t?"":"un"}selectPath`](e,n,r)},getToggle(t,e){const n=this;return t.nodeName==="path"?n.togglePath:n.isStepType(e)?()=>{}:n.togglePoint},toggleShape(t,e,n){var r;const i=this,{config:o,$el:{main:s}}=i;if(o.data_selection_enabled&&o.data_selection_isselectable.bind(i.api)(e)){const l=Ut(t),c=l.classed(gn.SELECTED),u=i.getToggle(t,e).bind(i);let f;if(!o.data_selection_multiple){const d=(r=i.isPointFocusOnly)==null?void 0:r.call(i);let h=`.${d?gn.selectedCircles:bn.shapes}`;o.data_selection_grouped&&(h+=i.getTargetSelectorSuffix(e.id)),s.selectAll(h).selectAll(d?`.${gn.selectedCircle}`:`.${bn.shape}.${gn.SELECTED}`).classed(gn.SELECTED,!1).each(function(m){const A=Ut(this);f=A,u(!1,A,m,m.index)})}(!f||f.node()!==l.node())&&(l.classed(gn.SELECTED,!c),u(!c,l,e,n))}}}),kE={data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:()=>!0,data_selection_multiple:!0,data_selection_draggable:!1,data_onselected:()=>{},data_onunselected:()=>{}};let qg=()=>(yn(Er.prototype,UE),yn(Kn.prototype,PE),Fa.setOptions([kE]),(qg=()=>!0)());const tv=function(t){var e,n;const r=this.internal,{axis:i,brush:o,config:s,scale:{x:l,subX:c},state:u}=r;let f;return u.isCanvasMode?(s.subchart_show&&(f=t,Array.isArray(f)?(f=i.isTimeSeries()?f.map(d=>Hn.bind(r)(d)):f,f=r.setCanvasSubchartDomain(f)||u.domain):f=(e=u.domain)!=null?e:l.orgDomain()),f):(s.subchart_show&&(f=t,Array.isArray(f)?(i.isTimeSeries()&&(f=f.map(h=>Hn.bind(r)(h))),r.withinRange(f,r.getZoomDomain("subX",!0),r.getZoomDomain("subX"))&&(u.domain=f.slice(),o.move(o.getSelection(),f.map(c)))):f=(n=u.domain)!=null?n:l.orgDomain()),f)};yn(tv,{show(){var t,e,n;const r=this.internal,{$el:{subchart:i},config:o}=r,s=o.subchart_show;if(!s){if(r.state.isCanvasMode){(t=r.unbindZoomEvent)==null||t.call(r),o.subchart_show=!0,this.resize();return}r.unbindZoomEvent(),o.subchart_show=!s,!i.main&&r.initSubchart();let l=i.main.selectAll(`.${ze.target}`);r.data.targets.length!==l.size()&&(r.updateSizes(),r.updateTargetsForSubchart(r.data.targets),l=(e=i.main)==null?void 0:e.selectAll(`.${ze.target}`)),l==null||l.style("opacity",null),(n=i.main)==null||n.style("display",null),this.resize()}},hide(){var t;const e=this.internal,{$el:{subchart:{main:n}},config:r}=e;if(e.state.isCanvasMode){r.subchart_show&&(r.subchart_show=!1,this.resize(),(t=e.bindZoomEvent)==null||t.call(e));return}r.subchart_show&&(n==null?void 0:n.style("display"))!=="none"&&(r.subchart_show=!1,n.style("display","none"),this.resize())},toggle(){const t=this.internal,{config:e}=t;this.subchart[e.subchart_show?"hide":"show"]()},reset(){var t;const e=this.internal,{brush:n}=e;if(e.state.isCanvasMode){(t=e.clearCanvasSubchartDomain)==null||t.call(e,!0,!1);return}n.clear(n.getSelection())}});var XE={subchart:tv},GE={initBrush(){const t=this,{config:e,scale:n,$el:{subchart:r},state:i}=t,o=e.axis_rotated,s=e.subchart_size_height;let l,c,u;t.brush=(o?bS():TS()).handleSize(5),t.brush.on("start brush end",f=>{const{selection:d,sourceEvent:h,target:m,type:A}=f;A==="start"&&(t.state.inputType==="touch"&&t.hideTooltip(),c=h?d:null),/(start|brush)/.test(A)&&(A==="brush"&&h&&i.domain&&(c==null||c.forEach((R,C)=>{R!==d[C]&&(i.domain[C]=n.x.orgDomain()[C])})),t.redrawForBrush(A!=="start")),A==="end"&&(l=n.x.orgDomain()),m!=null&&m.handle&&(d===null?t.brush.handle.attr("display","none"):t.brush.handle.attr("display",null).attr("transform",(R,C)=>{const P=[d[C],s/2];return`translate(${o?P.reverse():P})`}))}),t.brush.updateResize=function(){u&&clearTimeout(u),u=setTimeout(()=>{const f=this.getSelection();l&&Bh(f.node())&&this.move(f,l.map(n.subX.orgScale()))},0)},t.brush.update=function(){var f;return this.extent()()[1].filter(h=>isNaN(h)).length===0&&((f=r.main)==null||f.select(`.${en.brush}`).call(this)),this},t.brush.scale=function(f){const d=e.subchart_size_height;let h=t.axis.getExtent();!h&&f.range?h=[[0,0],[f.range()[1],d]]:tn(h)&&(h=h.map((m,A)=>[m,A>0?d:A])),o&&h[1].reverse(),this.extent(h),this.update()},t.brush.getSelection=()=>r.main?r.main.select(`.${en.brush}`):Ut([])},initSubchart(){const t=this,{config:e,state:{clip:n,hasAxis:r},$el:{defs:i,svg:o,subchart:s,axis:l}}=t;if(!r)return;const c=e.subchart_show?null:"hidden",u=`${n.id}-subchart`,f=t.getClipPath(u);n.idSubchart=u,t.appendClip(i,u),t.initBrush(),s.main=o.append("g").classed(en.subchart,!0).attr("transform",t.getTranslate("context"));const{main:d}=s;d.style("visibility",c),d.append("g").attr("clip-path",f).attr("class",en.chart),["bar","line","bubble","candlestick","scatter"].forEach(m=>{const A=$n(/^(bubble|scatter)$/.test(m)?"circle":m);if(t.hasType(m)||t.hasTypeOf(A)){const R=d.select(`.${en.chart}`),C=en[`chart${A}s`];R.select(`.${C}`).empty()&&R.append("g").attr("class",C)}});const h=d.append("g").attr("clip-path",f).attr("class",en.brush).call(t.brush);e.subchart_showHandle&&t.addBrushHandle(h),l.subX=d.append("g").attr("class",en.axisX).attr("transform",t.getTranslate("subX")).attr("clip-path",e.axis_rotated?"":n.pathXAxis).style("visibility",e.subchart_axis_x_show?c:"hidden")},addBrushHandle(t){const e=this,{config:n}=e,r=n.axis_rotated,i=n.subchart_init_range,o="handle--custom",s=Ii[r?"y":"x"];e.brush.handle=t.selectAll(`.${o}`).data(r?[{type:"n"},{type:"s"}]:[{type:"w"},{type:"e"}]).enter().append("path").attr("class",o).attr("cursor",`${r?"ns":"ew"}-resize`).attr("d",l=>s[/[se]/.test(l.type)?"end":"start"]).attr("display",i?null:"none")},updateTargetsForSubchart(t){const e=this,{config:n,state:r,$el:{subchart:{main:i}}}=e;n.subchart_show&&(["bar","line","bubble","candlestick","scatter"].filter(o=>e.hasType(o)||e.hasTypeOf($n(o))).forEach(o=>{const s=/^(bubble|scatter)$/.test(o),l=$n(s?"circle":o),c=e.getChartClass(l,!0),u=e.getClass(s?"circles":`${o}s`,!0),f=i.select(`.${en[`chart${`${l}s`}`]}`);if(s){const d=f.selectAll(`.${en.circles}`).data(t.filter(e[`is${$n(o)}Type`].bind(e))).attr("class",u);d.exit().remove(),d.enter().append("g").attr("class",u)}else{const d=f.selectAll(`.${en[`chart${l}`]}`).attr("class",c).data(t.filter(e[`is${l}Type`].bind(e))),h=d.enter().append("g").style("opacity","0").attr("class",c).append("g").attr("class",u);d.exit().remove(),o==="line"&&e.hasTypeOf("Area")&&h.append("g").attr("class",e.getClass("areas",!0))}}),i.selectAll(`.${en.brush} rect`).attr(n.axis_rotated?"width":"height",n.axis_rotated?r.width2:r.height2))},redrawSubchart(t,e,n){var r;const i=this,{config:o,$el:{subchart:{main:s}},state:l}=i,c=!!e;if(s.style("visibility",o.subchart_show?null:"hidden"),o.subchart_show&&(((r=l.event)==null?void 0:r.type)==="zoom"&&i.brush.update(),t)){const u=o.subchart_init_range;if(!Uh(i)&&i.brush.update(),Object.keys(n.type).forEach(f=>{const d=$n(f),h=i[`generateDraw${d}`](n.indices[f],!0);i[`update${d}`](c,!0),i[`redraw${d}`](h,c,!0)}),i.hasType("bubble")||i.hasType("scatter")){const{cx:f}=n.pos,d=i.updateCircleY(!0);i.updateCircle(!0),i.redrawCircle(f,d,c,void 0,!0)}!l.rendered&&u&&(l.domain=u,i.brush.move(i.brush.getSelection(),u.map(i.scale.x)))}},redrawForBrush(t=!0){var e;const n=this,{config:{subchart_onbrush:r,zoom_rescale:i},scale:o,state:s}=n;n.redraw({withTransition:!1,withY:i,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),t&&s.rendered&&r.bind(n.api)((e=s.domain)!=null?e:o.x.orgDomain())},transformContext(t,e){const n=this,{$el:{subchart:r},$T:i}=n,o=e!=null&&e.axisSubX?e.axisSubX:i(r.main.select(`.${en.axisX}`),t);r.main.attr("transform",n.getTranslate("context")),o.attr("transform",n.getTranslate("subX"))}},WE={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:()=>{}};let ev=()=>(yn(Er.prototype,GE),yn(Kn.prototype,XE),Fa.setOptions([WE]),(ev=()=>!0)());var VE=1e-12;function nv(t){return((t=Math.exp(t))+1/t)/2}function jE(t){return((t=Math.exp(t))-1/t)/2}function HE(t){return((t=Math.exp(2*t))-1)/(t+1)}var YE=(function t(e,n,r){function i(o,s){var l=o[0],c=o[1],u=o[2],f=s[0],d=s[1],h=s[2],m=f-l,A=d-c,R=m*m+A*A,C,P;if(R<VE)P=Math.log(h/u)/e,C=function(J){return[l+J*m,c+J*A,u*Math.exp(e*J*P)]};else{var z=Math.sqrt(R),$=(h*h-u*u+r*R)/(2*u*n*z),B=(h*h-u*u-r*R)/(2*h*n*z),W=Math.log(Math.sqrt($*$+1)-$),H=Math.log(Math.sqrt(B*B+1)-B);P=(H-W)/e,C=function(J){var q=J*P,at=nv(W),et=u/(n*z)*(at*HE(e*q+W)-jE(W));return[l+et*m,c+et*A,u*at/nv(e*q+W)]}}return C.duration=P*1e3*e/Math.SQRT2,C}return i.rho=function(o){var s=Math.max(.001,+o),l=s*s,c=l*l;return t(s,l,c)},i})(Math.SQRT2,2,4),Ns=(t=>()=>t);function KE(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function qr(t,e,n){this.k=t,this.x=e,this.y=n}qr.prototype={constructor:qr,scale:function(t){return t===1?this:new qr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new qr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gr=new qr(1,0,0);qc.prototype=qr.prototype;function qc(t){for(;!t.__zoom;)if(!(t=t.parentNode))return gr;return t.__zoom}function tu(t){t.stopImmediatePropagation()}function so(t){t.preventDefault(),t.stopImmediatePropagation()}function ZE(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function JE(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function rv(){return this.__zoom||gr}function QE(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function _E(){return navigator.maxTouchPoints||"ontouchstart"in this}function qE(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function tC(){var t=ZE,e=JE,n=qE,r=QE,i=_E,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=YE,u=cs("start","zoom","end"),f,d,h,m=500,A=150,R=0,C=10;function P(_){_.property("__zoom",rv).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",at).on("dblclick.zoom",et).filter(i).on("touchstart.zoom",ot).on("touchmove.zoom",lt).on("touchend.zoom touchcancel.zoom",ft).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}P.transform=function(_,dt,ut,xt){var bt=_.selection?_.selection():_;bt.property("__zoom",rv),_!==bt?W(_,dt,ut,xt):bt.interrupt().each(function(){H(this,arguments).event(xt).start().zoom(null,typeof dt=="function"?dt.apply(this,arguments):dt).end()})},P.scaleBy=function(_,dt,ut,xt){P.scaleTo(_,function(){var bt=this.__zoom.k,Rt=typeof dt=="function"?dt.apply(this,arguments):dt;return bt*Rt},ut,xt)},P.scaleTo=function(_,dt,ut,xt){P.transform(_,function(){var bt=e.apply(this,arguments),Rt=this.__zoom,Et=ut==null?B(bt):typeof ut=="function"?ut.apply(this,arguments):ut,Zt=Rt.invert(Et),fe=typeof dt=="function"?dt.apply(this,arguments):dt;return n($(z(Rt,fe),Et,Zt),bt,s)},ut,xt)},P.translateBy=function(_,dt,ut,xt){P.transform(_,function(){return n(this.__zoom.translate(typeof dt=="function"?dt.apply(this,arguments):dt,typeof ut=="function"?ut.apply(this,arguments):ut),e.apply(this,arguments),s)},null,xt)},P.translateTo=function(_,dt,ut,xt,bt){P.transform(_,function(){var Rt=e.apply(this,arguments),Et=this.__zoom,Zt=xt==null?B(Rt):typeof xt=="function"?xt.apply(this,arguments):xt;return n(gr.translate(Zt[0],Zt[1]).scale(Et.k).translate(typeof dt=="function"?-dt.apply(this,arguments):-dt,typeof ut=="function"?-ut.apply(this,arguments):-ut),Rt,s)},xt,bt)};function z(_,dt){return dt=Math.max(o[0],Math.min(o[1],dt)),dt===_.k?_:new qr(dt,_.x,_.y)}function $(_,dt,ut){var xt=dt[0]-ut[0]*_.k,bt=dt[1]-ut[1]*_.k;return xt===_.x&&bt===_.y?_:new qr(_.k,xt,bt)}function B(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function W(_,dt,ut,xt){_.on("start.zoom",function(){H(this,arguments).event(xt).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(xt).end()}).tween("zoom",function(){var bt=this,Rt=arguments,Et=H(bt,Rt).event(xt),Zt=e.apply(bt,Rt),fe=ut==null?B(Zt):typeof ut=="function"?ut.apply(bt,Rt):ut,me=Math.max(Zt[1][0]-Zt[0][0],Zt[1][1]-Zt[0][1]),xe=bt.__zoom,Te=typeof dt=="function"?dt.apply(bt,Rt):dt,Fe=c(xe.invert(fe).concat(me/xe.k),Te.invert(fe).concat(me/Te.k));return function(Ie){if(Ie===1)Ie=Te;else{var ke=Fe(Ie),Jt=me/ke[2];Ie=new qr(Jt,fe[0]-ke[0]*Jt,fe[1]-ke[1]*Jt)}Et.zoom(null,Ie)}})}function H(_,dt,ut){return!ut&&_.__zooming||new J(_,dt)}function J(_,dt){this.that=_,this.args=dt,this.active=0,this.sourceEvent=null,this.extent=e.apply(_,dt),this.taps=0}J.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,dt){return this.mouse&&_!=="mouse"&&(this.mouse[1]=dt.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=dt.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=dt.invert(this.touch1[0])),this.that.__zoom=dt,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var dt=Ut(this.that).datum();u.call(_,this.that,new KE(_,{sourceEvent:this.sourceEvent,target:P,type:_,transform:this.that.__zoom,dispatch:u}),dt)}};function q(_,...dt){if(!t.apply(this,arguments))return;var ut=H(this,dt).event(_),xt=this.__zoom,bt=Math.max(o[0],Math.min(o[1],xt.k*Math.pow(2,r.apply(this,arguments)))),Rt=dr(_);if(ut.wheel)(ut.mouse[0][0]!==Rt[0]||ut.mouse[0][1]!==Rt[1])&&(ut.mouse[1]=xt.invert(ut.mouse[0]=Rt)),clearTimeout(ut.wheel);else{if(xt.k===bt)return;ut.mouse=[Rt,xt.invert(Rt)],li(this),ut.start()}so(_),ut.wheel=setTimeout(Et,A),ut.zoom("mouse",n($(z(xt,bt),ut.mouse[0],ut.mouse[1]),ut.extent,s));function Et(){ut.wheel=null,ut.end()}}function at(_,...dt){if(h||!t.apply(this,arguments))return;var ut=_.currentTarget,xt=H(this,dt,!0).event(_),bt=Ut(_.view).on("mousemove.zoom",fe,!0).on("mouseup.zoom",me,!0),Rt=dr(_,ut),Et=_.clientX,Zt=_.clientY;xc(_.view),tu(_),xt.mouse=[Rt,this.__zoom.invert(Rt)],li(this),xt.start();function fe(xe){if(so(xe),!xt.moved){var Te=xe.clientX-Et,Fe=xe.clientY-Zt;xt.moved=Te*Te+Fe*Fe>R}xt.event(xe).zoom("mouse",n($(xt.that.__zoom,xt.mouse[0]=dr(xe,ut),xt.mouse[1]),xt.extent,s))}function me(xe){bt.on("mousemove.zoom mouseup.zoom",null),yc(xe.view,xt.moved),so(xe),xt.event(xe).end()}}function et(_,...dt){if(t.apply(this,arguments)){var ut=this.__zoom,xt=dr(_.changedTouches?_.changedTouches[0]:_,this),bt=ut.invert(xt),Rt=ut.k*(_.shiftKey?.5:2),Et=n($(z(ut,Rt),xt,bt),e.apply(this,dt),s);so(_),l>0?Ut(this).transition().duration(l).call(W,Et,xt,_):Ut(this).call(P.transform,Et,xt,_)}}function ot(_,...dt){if(t.apply(this,arguments)){var ut=_.touches,xt=ut.length,bt=H(this,dt,_.changedTouches.length===xt).event(_),Rt,Et,Zt,fe;for(tu(_),Et=0;Et<xt;++Et)Zt=ut[Et],fe=dr(Zt,this),fe=[fe,this.__zoom.invert(fe),Zt.identifier],bt.touch0?!bt.touch1&&bt.touch0[2]!==fe[2]&&(bt.touch1=fe,bt.taps=0):(bt.touch0=fe,Rt=!0,bt.taps=1+!!f);f&&(f=clearTimeout(f)),Rt&&(bt.taps<2&&(d=fe[0],f=setTimeout(function(){f=null},m)),li(this),bt.start())}}function lt(_,...dt){if(this.__zooming){var ut=H(this,dt).event(_),xt=_.changedTouches,bt=xt.length,Rt,Et,Zt,fe;for(so(_),Rt=0;Rt<bt;++Rt)Et=xt[Rt],Zt=dr(Et,this),ut.touch0&&ut.touch0[2]===Et.identifier?ut.touch0[0]=Zt:ut.touch1&&ut.touch1[2]===Et.identifier&&(ut.touch1[0]=Zt);if(Et=ut.that.__zoom,ut.touch1){var me=ut.touch0[0],xe=ut.touch0[1],Te=ut.touch1[0],Fe=ut.touch1[1],Ie=(Ie=Te[0]-me[0])*Ie+(Ie=Te[1]-me[1])*Ie,ke=(ke=Fe[0]-xe[0])*ke+(ke=Fe[1]-xe[1])*ke;Et=z(Et,Math.sqrt(Ie/ke)),Zt=[(me[0]+Te[0])/2,(me[1]+Te[1])/2],fe=[(xe[0]+Fe[0])/2,(xe[1]+Fe[1])/2]}else if(ut.touch0)Zt=ut.touch0[0],fe=ut.touch0[1];else return;ut.zoom("touch",n($(Et,Zt,fe),ut.extent,s))}}function ft(_,...dt){if(this.__zooming){var ut=H(this,dt).event(_),xt=_.changedTouches,bt=xt.length,Rt,Et;for(tu(_),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),Rt=0;Rt<bt;++Rt)Et=xt[Rt],ut.touch0&&ut.touch0[2]===Et.identifier?delete ut.touch0:ut.touch1&&ut.touch1[2]===Et.identifier&&delete ut.touch1;if(ut.touch1&&!ut.touch0&&(ut.touch0=ut.touch1,delete ut.touch1),ut.touch0)ut.touch0[1]=this.__zoom.invert(ut.touch0[0]);else if(ut.end(),ut.taps===2&&(Et=dr(Et,this),Math.hypot(d[0]-Et[0],d[1]-Et[1])<C)){var Zt=Ut(this).on("dblclick.zoom");Zt&&Zt.apply(this,arguments)}}}return P.wheelDelta=function(_){return arguments.length?(r=typeof _=="function"?_:Ns(+_),P):r},P.filter=function(_){return arguments.length?(t=typeof _=="function"?_:Ns(!!_),P):t},P.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:Ns(!!_),P):i},P.extent=function(_){return arguments.length?(e=typeof _=="function"?_:Ns([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),P):e},P.scaleExtent=function(_){return arguments.length?(o[0]=+_[0],o[1]=+_[1],P):[o[0],o[1]]},P.translateExtent=function(_){return arguments.length?(s[0][0]=+_[0][0],s[1][0]=+_[1][0],s[0][1]=+_[0][1],s[1][1]=+_[1][1],P):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},P.constrain=function(_){return arguments.length?(n=_,P):n},P.duration=function(_){return arguments.length?(l=+_,P):l},P.interpolate=function(_){return arguments.length?(c=_,P):c},P.on=function(){var _=u.on.apply(u,arguments);return _===u?P:_},P.clickDistance=function(_){return arguments.length?(R=(_=+_)*_,P):Math.sqrt(R)},P.tapDistance=function(_){return arguments.length?(C=+_,P):C},P}const av=function(t){var e,n;const r=this.internal,{axis:i,config:o,org:s,scale:l,state:c}=r;let u;if(!i)return;const f=i.isCategorized();if(o.zoom_enabled)if(u=t,Array.isArray(u)){if(i.isTimeSeries()&&(u=u.map(h=>Hn.bind(r)(h))),r.withinRange(u,r.getZoomDomain("zoom",!0),r.getZoomDomain("zoom"))){if(c.domain=u.slice(),u=r.getZoomDomainValue(u),r.api.tooltip.hide(),o.subchart_show)if(c.isCanvasMode)(e=r.setCanvasSubchartDomain)==null||e.call(r,u,!0,!1);else{const h=l.zoom||l.x;r.brush.getSelection().call(r.brush.move,u.map(h))}else{const h=f?l.x.orgScale():s.xScale||l.x;r.updateCurrentZoomTransform(h,u)}r.setZoomResetButton()}}else u=r.zoom.getDomain();return(n=c.domain)!=null?n:u};yn(av,{enable(t){var e;const n=this.internal,{axis:r,config:i}=n;if(!r){i.zoom_enabled=!1;return}/^(drag|wheel)$/.test(t)&&(i.zoom_type=t),i.zoom_enabled=!!t,n.zoom?t===!1&&n.bindZoomEvent(!1):n.initZoom(),t!==!1&&(i.zoom_type==="drag"&&!n.zoomBehaviour&&((e=n.initZoomBehaviour)==null||e.call(n)),n.bindZoomEvent()),n.updateAndRedraw()},max(t){const e=this.internal,{config:n,org:{xDomain:r}}=e;return(t===0||t)&&(n.zoom_x_max=Tr("max",[r[1],t])),n.zoom_x_max},min(t){const e=this.internal,{config:n,org:{xDomain:r}}=e;return(t===0||t)&&(n.zoom_x_min=Tr("min",[r[0],t])),n.zoom_x_min},range(t){const e=this.zoom;if(je(t)){const{min:n,max:r}=t;ln(n)&&e.min(n),ln(r)&&e.max(r)}return{min:e.min(),max:e.max()}}});var eC={zoom:av,unzoom(){var t;const e=this.internal,{config:n,$el:{canvas:r,eventRect:i,zoomResetBtn:o},scale:{zoom:s},state:l}=e,c=l.isCanvasMode?r:i;(s||l.isCanvasMode&&n.subchart_show&&l.domain)&&(n.subchart_show?l.isCanvasMode?(t=e.clearCanvasSubchartDomain)==null||t.call(e,!0,!1):e.brush.getSelection().call(e.brush.move,null):e.zoom.updateTransformScale(gr),e.updateZoom(!0),o==null||o.style("display","none"),c!=null&&c.node()&&qc(c.node())!==gr&&e.zoom.transform(c,gr),l.domain=void 0)}};function $s(t){return t.state.isCanvasMode?t.$el.canvas:t.$el.eventRect}function iv(t,e){if(!t.state.isCanvasMode)return e;const{margin:n}=t.state;return gr.translate(e.x+(e.k-1)*n.left,e.y+(e.k-1)*n.top).scale(e.k)}function ov(t,e){if(!t.state.isCanvasMode)return e;const{margin:n}=t.state;return gr.translate(e.x-(e.k-1)*n.left,e.y-(e.k-1)*n.top).scale(e.k)}function sv(t,e,n){const r=hr(e,n);if(t.state.isCanvasMode){const{margin:i}=t.state;r[0]-=i.left,r[1]-=i.top}return r}var nC={initZoom(){const t=this;t.scale.zoom=null,t.generateZoom(),t.config.zoom_type==="drag"&&t.initZoomBehaviour()},bindZoomEvent(t=!0){const e=this,{config:n}=e;n.zoom_enabled&&t?!n.subchart_show&&e.bindZoomOnEventRect():t===!1&&(e.api.unzoom(),e.unbindZoomEvent())},generateZoom(){const t=this,{config:e,org:n,scale:r}=t,i=tC().duration(0).on("start",t.onZoomStart.bind(t)).on("zoom",t.onZoom.bind(t)).on("end",t.onZoomEnd.bind(t));i.orgScaleExtent=()=>{const o=e.zoom_extent||[1,10];return[o[0],Math.max(t.getMaxDataCount()/o[1],o[1])]},i.updateScaleExtent=function(){const o=Aa(t.scale.x.orgDomain())/Aa(t.getZoomDomain()),s=this.orgScaleExtent();return this.scaleExtent([s[0]*o,s[1]*o]),this},i.updateTransformScale=(o,s)=>{var l,c;const u=e.axis_rotated,f=iv(t,o);(l=n.xScale)==null||l.range(r.x.range());const d=f[u?"rescaleY":"rescaleX"](n.xScale||r.x);if(d.domain().some(A=>/(Invalid Date|NaN)/.test(A.toString())))return;const h=t.trimXDomain(d.domain()),m=e.zoom_rescale;if(d.domain(h,n.xDomain),s){const A=d(r.x.domain()[0]),R=u?f.x:A,C=u?A:f.y,P=ov(t,gr.translate(R,C).scale(o.k));(c=$s(t))==null||c.property("__zoom",P)}r.zoom=t.getCustomizedXScale(d),t.axis.x.scale(r.zoom),m?(!n.xScale&&(n.xScale=r.x.copy()),r.x.domain(h)):n.xScale&&(r.x.domain(n.xScale.domain()),n.xScale=null)},i.getDomain=()=>{const o=r[r.zoom?"zoom":"subX"].domain();return t.axis.isCategorized()&&(o[1]-=2),o},t.zoom=i},onZoomStart(t){const e=this,{sourceEvent:n}=t;n&&(e.zoom.startEvent=n,e.state.zooming=!0,Ne(e.config.zoom_onzoomstart,e.api,t))},onZoom(t){const e=this,{config:n,scale:r,state:i,org:o}=e,{sourceEvent:s}=t,l=(t==null?void 0:t.transform)===gr;if(!n.zoom_enabled||e.filterTargetsToShow(e.data.targets).length===0||!r.zoom&&(s==null?void 0:s.type.indexOf("touch"))>-1&&(s==null?void 0:s.touches.length)===1)return;t.sourceEvent&&(i.zooming=!0,i.domain=void 0);const c=(s==null?void 0:s.type)==="mousemove",u=(s==null?void 0:s.wheelDelta)<0,{transform:f}=t;!c&&u&&r.x.domain().every((A,R)=>A!==o.xDomain[R])&&r.x.domain(o.xDomain),e.zoom.updateTransformScale(f,n.zoom_type==="wheel"&&s);const d=n.transition_duration>0&&!n.subchart_show&&(i.dragging||l||!t.sourceEvent),h=s&&c&&n.zoom_type!=="wheel",m=()=>{var A;e.config&&(e.redraw({withTransition:d,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),e.state.cancelClick=c,!l&&Ne(n.zoom_onzoom,e.api,(A=e.state.domain)!=null?A:e.zoom.getDomain()))};h?th(e.state,m):m()},onZoomEnd(t){var e,n;const r=this,{config:i,state:o}=r,s=r.zoom;if(!s)return;let{startEvent:l}=s,c=t==null?void 0:t.sourceEvent;const u=(t==null?void 0:t.transform)===gr;(l==null?void 0:l.type.indexOf("touch"))>-1&&(l=l.changedTouches[0],c=(e=c==null?void 0:c.changedTouches)==null?void 0:e[0]),!(i.zoom_type==="drag"&&c&&l.clientX===c.clientX&&l.clientY===c.clientY)&&(o.zooming=!1,!o.isCanvasMode&&r.redrawEventRect(),r.updateZoom(),!u&&(c||o.dragging)&&Ne(i.zoom_onzoomend,r.api,(n=r.state.domain)!=null?n:r.zoom.getDomain()))},updateZoom(t){const e=this,{subX:n,x:r,zoom:i}=e.scale;if(i){const o=i.domain(),s=n.domain(),l=.015,c=e.config.axis_x_inverted?(o[0]>=s[0]||o[0]+l>=s[0])&&(s[1]>=o[1]||s[1]>=o[1]+l):(o[0]<=s[0]||o[0]-l<=s[0])&&(s[1]<=o[1]||s[1]<=o[1]-l);(t||c)&&(e.axis.x.scale(n),r.domain(n.orgDomain()),e.scale.zoom=null)}},updateCurrentZoomTransform(t,e){var n;const r=this,{config:i}=r,o=i.axis_rotated,s=[-t(e[0]),0],l=gr.scale(t.range()[1]/(t(e[1])-t(e[0]))).translate(...o?s.reverse():s);(n=$s(r))==null||n.call(r.zoom.transform,ov(r,l))},bindZoomOnEventRect(){var t,e;const n=this,{config:r,$el:{svg:i}}=n,o=$s(n),s=r.zoom_type==="drag"?n.zoomBehaviour:n.zoom;n.state.isCanvasMode&&((t=s==null?void 0:s.touchable)==null||t.call(s,()=>r.interaction_inputType_touch!==!1)),!n.state.isCanvasMode&&ce.GestureEvent&&/^((?!chrome|android|mobile).)*safari/i.test((e=ce.navigator)==null?void 0:e.userAgent)&&i.on("wheel",()=>{}),o==null||o.call(s).on("dblclick.zoom",null)},initZoomBehaviour(){const t=this,{config:e,state:n}=t,r=e.axis_rotated;let i=0,o=0,s,l;const c={axis:r?"y":"x",attr:r?"height":"width",index:r?1:0},u=f=>{const[d,h]=l!=null?l:[0,r?n.height:n.width];return Math.min(Math.max(f,d),h)};t.zoomBehaviour=uh().touchable(()=>!n.isCanvasMode||e.interaction_inputType_touch!==!1).clickDistance(4).on("start",function(f){var d;l=t.scale.zoom?null:t.axis.getExtent(),n.event=f,t.setDragStatus(!0),t.unselectRect(),!n.isCanvasMode&&!s&&(s=t.$el.main.append("rect").attr("clip-path",n.clip.path).attr("class",lc.zoomBrush).attr("width",r?n.width:0).attr("height",r?0:n.height)),s==null||s.attr(r?"width":"height",r?n.width:n.height),i=u(sv(t,f,this)[c.index]),o=i,n.isCanvasMode?(d=t.renderCanvasZoomBrush)==null||d.call(t,i,o):s.attr(c.axis,i).attr(c.attr,0),t.onZoomStart(f)}).on("drag",function(f){var d;o=u(sv(t,f,this)[c.index]),n.isCanvasMode?(d=t.renderCanvasZoomBrush)==null||d.call(t,i,o):s.attr(c.axis,Math.min(i,o)).attr(c.attr,Math.abs(o-i))}).on("end",f=>{var d;const h=t.scale.zoom||t.scale.x;n.event=f,o=u(o),n.isCanvasMode?(d=t.clearCanvasZoomBrush)==null||d.call(t):s.attr(c.axis,0).attr(c.attr,0),i>o&&([i,o]=[o,i]),i<0&&(o+=Math.abs(i),i=0),i!==o&&t.api.zoom([i,o].map(m=>h.invert(m))),t.setDragStatus(!1)})},setZoomResetButton(){const t=this,{config:e,$el:n}=t,r=e.zoom_resetButton;r&&e.zoom_type==="drag"&&(n.zoomResetBtn?n.zoomResetBtn.style("display",null):n.zoomResetBtn=t.$el.chart.append("div").classed(ze.button,!0).append("span").on("click",function(){le(r.onclick)&&r.onclick.bind(t.api)(this),t.api.unzoom()}).classed(lc.buttonZoomReset,!0).text(r.text||"Reset Zoom"))},getZoomTransform(){const t=this,e=$s(t),n=e==null?void 0:e.node();return n?iv(t,qc(n)):{k:1}}},rC={zoom_enabled:!1,zoom_type:"wheel",zoom_extent:void 0,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 lv=()=>(yn(Er.prototype,nC),yn(Kn.prototype,eC),Fa.setOptions([rC]),(lv=()=>!0)());function cv(t){var e;t.state.canvasShape=null,(e=t.renderCanvasFrame)==null||e.call(t,void 0,null,!1)}function uv(t,e=!1){const n=this.internal,{config:r}=n,i=r.transition_duration&&Qi();return t?(r.regions=e?r.regions.concat(t):t,n.state.isCanvasMode?(cv(n),r.regions):(n.updateRegion(),n.redrawRegion(i),r.regions)):r.regions}const fv=function(t){return uv.bind(this)(t)};yn(fv,{add:function(t){return uv.bind(this)(t,!0)},remove:function(t){const e=this.internal,{config:n,$T:r}=e,i=t||{},o=ia(i,"classes",[Ji.region]);let s=n.regions;if(e.state.isCanvasMode)return Object.keys(i).length?(s=s.filter(c=>{let u=!1;return c.class?(c.class.split(" ").forEach(f=>{o.indexOf(f)>=0&&(u=!0)}),!u):!0}),n.regions=s):n.regions=[],cv(e),n.regions;const l=e.$el.main.select(`.${Ji.regions}`).selectAll(o.map(c=>`.${c}`));return r(l).style("opacity","0").remove(),Object.keys(i).length?(s=s.filter(c=>{let u=!1;return c.class?(c.class.split(" ").forEach(f=>{o.indexOf(f)>=0&&(u=!0)}),!u):!0}),n.regions=s):n.regions=[],s}});var aC={regions:fv},iC={initRegion(){const t=this,{$el:e}=t;e.region.main=e.main.insert("g",":first-child").attr("clip-path",t.state.clip.path).attr("class",Ji.regions)},updateRegion(){const t=this,{config:e,$el:{region:n},$T:r}=t;n.main||t.initRegion(),n.main.style("visibility",t.hasArcType()?"hidden":null);const i=n.main.selectAll(`.${Ji.region}`).data(e.regions);r(i.exit()).style("opacity","0").remove();const o=i.enter().append("g");o.append("rect").style("fill-opacity","0"),n.list=o.merge(i).attr("class",t.classRegion.bind(t)),n.list.each(function(s){var l;Ut(this).select("text").empty()&&((l=s.label)!=null&&l.text)&&Ut(this).append("text").style("opacity","0")})},redrawRegion(t){const e=this,{$el:{region:n},$T:r}=e,i=e.regionX.bind(e),o=e.regionY.bind(e),s=["width","height"];let l=n.list.select("rect"),c=n.list.selectAll("text");return l=r(l,t).attr("x",i).attr("y",o).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)),c=r(c,t).text(u=>{var f;return(f=u.label)==null?void 0:f.text}).attr("transform",({label:u})=>u.rotated?" rotate(-90)":null).attr("transform",function(u){var f;const{x:d=0,y:h=0,center:m=!1,rotated:A=!1}=(f=u.label)!=null?f:{},R=this.previousElementSibling,C={x:0,y:0};return Ke(m)&&["x","y"].forEach((P,z)=>{m.indexOf(P)>-1&&(C[P]=(+R.getAttribute(s[z])-un(this)[s[z]])/2)}),`translate(${i(u)+C.x+d}, ${o(u)+C.y+h})${A?" rotate(-90)":""}`}).attr("text-anchor",({label:u})=>u!=null&&u.rotated?"end":null).attr("dy","1em").style("fill",({label:u})=>{var f;return(f=u==null?void 0:u.color)!=null?f:null}),[l.style("fill-opacity",u=>We(u.opacity)?u.opacity:null).on("end",function(){Ut(this.parentNode).selectAll("rect:not([x])").remove()}),c.style("opacity",null)]},regionX(t){return this.getRegionSize("x",t)},regionY(t){return this.getRegionSize("y",t)},regionWidth(t){return this.getRegionSize("width",t)},regionHeight(t){return this.getRegionSize("height",t)},getRegionSize(t,e){const n=this,{config:r,scale:i,state:o}=n,s=r.axis_rotated,l=/(x|y|y2)/.test(t),c=l?t==="x":t==="width",u=!l&&n[c?"regionX":"regionY"](e);let f=l?"start":"end",d=l?0:o[t],h;if(e.axis==="y"||e.axis==="y2"?(!l&&!c?f="start":l&&!c&&(f="end"),(c?s:!s)&&f in e&&(h=i[e.axis])):(c?!s:s)&&f in e&&(h=i.zoom||i.x),h){let m=0;d=e[f],n.axis.isTimeSeries(e.axis)?d=Hn.call(n,d):/(x|width)/.test(t)&&n.axis.isCategorized()&&isNaN(d)&&(d=r.axis_x_categories.indexOf(d),m=n.axis.x.tickOffset()*(f==="start"?-1:1)),d=h(d)+m}return l?d:d<u?0:d-u},isRegionOnX(t){return!t.axis||t.axis==="x"}};let dv=()=>(yn(Er.prototype,iC),Kn.prototype.regions=aC.regions,(dv=()=>({}))());var hi={initArea(t){const e=this,{config:n}=e;t.insert("g",`.${n.area_front?Bn.circles:Lr.lines}`).attr("class",e.getClass("areas",!0))},updateAreaColor(t){const e=this;return vg.call(e,t,"area_linearGradient",e.color)},updateArea(t,e=!1){const n=this;if(n.state.isCanvasMode)return;const{config:r,state:i,$el:o,$T:s}=n,l=e?o.subchart:o;r.area_linearGradient&&n.updateLinearGradient();const c=l.main.selectAll(`.${as.areas}`).selectAll(`.${as.area}`).data(n.lineData.bind(n));s(c.exit(),t).style("opacity","0").remove(),l.area=c.enter().append("path").attr("class",n.getClass("area",!0)).style("fill",n.updateAreaColor.bind(n)).style("opacity",function(){return i.orgAreaOpacity=Ut(this).style("opacity"),"0"}).merge(c),c.style("opacity",i.orgAreaOpacity),n.setRatioForGroupedData(l.area.data())},redrawArea(t,e,n=!1){const r=this;if(r.state.isCanvasMode)return[];const{area:i}=n?this.$el.subchart:this.$el,{orgAreaOpacity:o}=r.state;return[r.$T(i,e,Rr()).attr("d",t).style("fill",r.updateAreaColor.bind(r)).style("opacity",s=>String(r.isAreaRangeType(s)?o/1.75:o))]},generateDrawArea(t,e){return ud(this,t,e)}},gi={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},eu={spline_interpolation_type:"cardinal"};function oC(t){return Qn(t)&&le(t.create)&&le(t.update)}function sC(t,e){var n;const r=this,i=(c,u)=>{const f=c.attributes;for(let d=0,h;h=f[d];d++)h=h.name,u.setAttribute(h,c.getAttribute(h))},s=new DOMParser().parseFromString(Xr(t),"image/svg+xml").documentElement,l=He.createElementNS(Qt.svg,s.nodeName.toLowerCase());if(l.id=e,l.style.fill="inherit",l.style.stroke="inherit",i(s,l),(n=s.childNodes)!=null&&n.length){const c=Ut(l);"innerHTML"in l?c.html(Xr(s.innerHTML)):Ea(s.childNodes).forEach(u=>{i(u,c.append(u.tagName).node())})}r.$el.defs.node().appendChild(l)}var vi={hasValidPointType(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasLegendDefsPoint(){var t;const{config:e}=this;return e.legend_show&&((t=e.point_pattern)==null?void 0:t.length)&&e.legend_usePoint},getDefsPointId(t){const{state:{datetimeId:e}}=this;return`${e}-point${t}`},getValidPointPattern(){const{config:t}=this,e=/^(circle|rect(angle)?)$/i.test(t.point_type)?t.point_type:"circle";return vn(t.point_pattern)?t.point_pattern:[e]},generatePoint(){const t=this,{$el:e,config:n}=t,r=[],i=t.getValidPointPattern();return function(o,s,...l){return function(c){var u,f,d,h;const m=t.getTargetSelectorSuffix(c.id||((u=c.data)==null?void 0:u.id)||c),A=Ut(this);r.indexOf(m)<0&&r.push(m);let R=i[r.indexOf(m)%i.length];if(t.hasValidPointType(R))R=t[R];else if(!oC(R||n.point_type)){const C=t.getDefsPointId(m);if(e.defs.select(`#${C}`).size()<1&&sC.call(t,R,C),o==="create")return(f=t.custom)==null?void 0:f.create.bind(s)(A,C,...l);if(o==="update")return(d=t.custom)==null?void 0:d.update.bind(s)(A,...l)}return(h=R[o])==null?void 0:h.bind(s)(A,...l)}}}};function lC(t,e,n,r=!1){const i=t?[t,0]:n;for(let o=t||n.reduce((s,l)=>s+l);o<=e;)n.forEach(s=>{o+s<=e&&i.push(s),o+=s});return i.length%2!==0&&i.push(r?n[1]:0),{dash:i.join(" "),length:i.reduce((o,s)=>o+s,0)}}var cC={initLine(){pg.call(this,{elKey:"line",className:Lr.chartLines,cssRules:["pointer-events:none"]})},updateTargetsForLine(t){const e=this,{$el:{area:n,main:r}}=e,i=e.getClass("lines",!0),o=t.filter(l=>!(e.isScatterType(l)||e.isBubbleType(l))),s=jc.call(e,o,{type:"Line",elKey:"line",containerClass:Lr.chartLines,itemClass:Lr.chartLine,initFn:e.initLine});if(s.append("g").attr("class",i),e.hasTypeOf("Area")){const l=r.select(`.${Lr.chartLines}`).selectAll(`.${Lr.chartLine}`),c=(!n&&s.empty()?l:s).filter(e.isAreaType.bind(e));e.initArea(c)}e.updateTargetForCircle(o,s)},updateLine(t,e=!1){const n=this;if(n.state.isCanvasMode)return;const{format:{extraLineClasses:r},$el:i,$T:o}=n,s=e?i.subchart:i,l=s.main.selectAll(`.${Lr.lines}`).selectAll(`.${Lr.line}`).data(n.lineData.bind(n));o(l.exit(),t).style("opacity","0").remove(),s.line=l.enter().append("path").attr("class",c=>`${n.getClass("line",!0)(c)} ${r(c)||""}`).style("stroke",n.color).merge(l).style("opacity",n.initialOpacity.bind(n)).attr("transform",null)},redrawLine(t,e,n=!1){const r=this;if(r.state.isCanvasMode)return[];const{$el:i,$T:o}=r,{line:s}=n?i.subchart:i;return[o(s,e,Rr()).attr("d",t).style("stroke",this.color).style("opacity",null)]},generateDrawLine(t,e){return cd(this,t,e)},lineWithRegions(t,e,n,r){const i=this,{config:o}=i,s=o.axis_rotated,l=i.axis.isTimeSeries(),c="2 2",u=td(i,t,r),f=i.hasNullDataValue(t);let d,h,m,A;const R=s?et=>n(et.value):et=>e(et.x),C=s?et=>e(et.x):et=>n(et.value),P=et=>`M${et[0][0]},${et[0][1]}L${et[1][0]},${et[1][1]}`,z=l?(et,ot,lt,ft)=>{const _=et.x.getTime(),dt=ot.x-et.x,ut=new Date(_+dt*lt),xt=new Date(_+dt*(lt+ft)),bt=s?[[n(h(lt)),e(ut)],[n(h(lt+m)),e(xt)]]:[[e(ut),n(h(lt))],[e(xt),n(h(lt+m))]];return P(bt)}:(et,ot,lt,ft)=>{const _=e(ot.x,!s),dt=n(ot.value,s),ut=lt+ft,xt=e(d(lt),!s),bt=n(h(lt),s);let Rt=e(d(ut),!s),Et=n(h(ut),s);Rt>_&&(Rt=_),et.value>ot.value&&(s?Et<dt:Et>dt)&&(Et=dt);const Zt=[[xt,bt],[Rt,Et]];return s&&Zt.forEach(fe=>fe.reverse()),P(Zt)},$={x:i.axis.getAxisType("x"),y:i.axis.getAxisType("y")};let B="";if(!t.length)return B;const W=i.$el.line.filter(({id:et})=>et===t[0].id),H=W.clone().style("display","none"),J=(et,ot)=>et.attr("d",ot).node().getTotalLength(),q={dash:[],lastLength:0};let at=!1;for(let et=0,ot;ot=t[et];et++){const lt=t[et-1],ft=lt&&We(lt.value);let _=i.isWithinRegions(ot.x,u);if(We(ot.value)){if(xn(u)||!_||!ft)B+=`${et&&ft?"L":"M"}${R(ot)},${C(ot)}`;else if(ft)if(_=((_==null?void 0:_.dasharray)||c).split(" ").map(Number),d=oa($.x,lt.x,ot.x),h=oa($.y,lt.value,ot.value),f){const dt=e(ot.x)-e(lt.x),ut=n(ot.value)-n(lt.value),xt=Math.sqrt(Math.pow(dt,2)+Math.pow(ut,2));m=_[0]/xt,A=m*_[1];for(let bt=m;bt<=1;bt+=A)B+=z(lt,ot,bt,m),bt+A>=1&&(B+=z(lt,ot,1,0))}else{let dt;if(at=ot.x===t[t.length-1].x,l){const Rt=+lt.x,Et=new Date(Rt),Zt=new Date(Rt+(+ot.x-Rt));dt=[[e(Et),n(h(0))],[e(Zt),n(h(1))]]}else dt=[[e(d(0)),n(h(0))],[e(d(1)),n(h(1))]];s&&dt.forEach(Rt=>Rt.reverse());const ut=J(H,B),xt=J(H,B+=`L${dt[1].join(",")}`),bt=lC(ut-q.lastLength,xt-q.lastLength,_,at);q.lastLength+=bt.length,q.dash.push(bt.dash)}}}return q.dash.length&&(!at&&q.dash.push(J(H,B)),W.attr("stroke-dasharray",q.dash.join(" "))),H.remove(),B},isWithinRegions(t,e){return ed(t,e)},isWithinStep(t,e){return Math.abs(e-hr(this.state.event,t)[1])<30},shouldDrawPointsForLine(t){const e=this.config.line_point;return e===!0||tn(e)&&e.indexOf(t.id)!==-1}};const pi=()=>Rr(),hv=new WeakMap;function gv(t){const e=t.getAttribute("height"),n=t.getAttribute("width"),r=t.getAttribute("href")||t.getAttribute("xlink:href"),i=hv.get(t);if(i&&i.attrHeight===e&&i.attrWidth===n&&i.href===r)return i;const{width:o,height:s}=da(t),l={attrHeight:e,attrWidth:n,height:s,href:r,width:o};return hv.set(t,l),l}var Bs={initialOpacityForCircle(t){const{config:e,state:{withoutFadeIn:n}}=this;let r=e.point_opacity;return xn(r)&&(r=this.getBaseValue(t)!==null&&n[t.id]?this.opacityForCircle(t):"0"),r},opacityForCircle(t){var e;const{config:n}=this;let r=n.point_opacity;return xn(r)&&(r=n.point_show&&!((e=this.isPointFocusOnly)!=null&&e.call(this))?null:"0",r=We(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":r:"0"),r},initCircle(){const t=this,{$el:{main:e}}=t;!t.point&&(t.point=t.generatePoint()),(t.hasType("bubble")||t.hasType("scatter"))&&e.select(`.${ze.chart} > .${Bn.chartCircles}`).empty()&&e.select(`.${ze.chart}`).append("g").attr("class",Bn.chartCircles)},updateTargetForCircle(t,e){const n=this,{config:r,data:i,$el:o}=n,s=r.interaction_enabled&&r.data_selection_enabled,l=s&&r.data_selection_isselectable,c=n.getClass("circles",!0);if(!r.point_show)return;n.initCircle();let u=t,f=e;if(!u){u=n.filterNullish(i.targets).filter(h=>this.isScatterType(h)||this.isBubbleType(h));const d=o.main.select(`.${Bn.chartCircles}`).style("pointer-events","none").selectAll(`.${Bn.circles}`).data(u);d.exit().remove(),f=d.enter()}s&&f.append("g").attr("class",d=>n.generateClass(gn.selectedCircles,d.id)),f.append("g").attr("class",c).call(d=>{n.setCssRule(!0,`.${Bn.circles}`,["cursor:pointer"],l)(d),n.setCssRule(!0,` .${Bn.circle}`,["fill","stroke"],n.color)(d)}).style("opacity",function(){return Ut(this.parentNode).classed(Bn.chartCircles)?"0":null}),s&&u.forEach(d=>{o.main.selectAll(`.${gn.selectedCircles}${n.getTargetSelectorSuffix(d.id)}`).selectAll(`${gn.selectedCircle}`).each(h=>{h.value=d.values[h.index].value})})},updateCircle(t=!1){const e=this,{config:n,state:r,$el:i}=e,o=e.isPointFocusOnly(),s=t?i.subchart:i;if(n.point_show&&!r.toggling){n.point_radialGradient&&e.updateLinearGradient();const l=s.main.selectAll(`.${Bn.circles}`).selectAll(`.${Bn.circle}`).data(d=>{const h=e.isLineType(d)&&e.shouldDrawPointsForLine(d)||e.isBubbleType(d)||e.isRadarType(d)||e.isScatterType(d)?o?[d.values[0]]:d.values:[];return e.filterNullish(h)});l.exit().remove();const c=e.pointR.bind(e),u=e.updateCircleColor.bind(e),f=e.initialOpacityForCircle.bind(e);l.enter().filter(Boolean).append(e.point("create",this,c,u)),s.circle=s.main.selectAll(`.${Bn.circles} .${Bn.circle}`).style("stroke",e.getStylePropValue(e.color)).style("opacity",f)}},updateCircleColor(t){const e=this,n=e.getStylePropValue(e.color);return e.config.point_radialGradient?e.getGradienColortUrl(t.id):n?n(t):null},redrawCircle(t,e,n,r,i=!1){const o=this,{state:{rendered:s},$el:l,$T:c}=o,u=i?l.subchart:l,f=u.main.selectAll(`.${gn.selectedCircle}`);if(!o.config.point_show)return[];const d=o.isCirclePoint()?"c":"",h=Rr(),m=o.opacityForCircle.bind(o);if(o.isCirclePoint()){const C=u.circle;return o.hasType("bubble")&&C.attr("r",o.pointR.bind(o)),n?(r&&C.attr("cx",t),c(C.filter(function(){return!!this.getAttribute("cx")}),!0,`${h}-pos`).attr("cx",t).attr("cy",e).style("fill",o.updateCircleColor.bind(o)),C.filter(function(){return!this.getAttribute("cx")}).attr("cx",t).attr("cy",e).style("fill",o.updateCircleColor.bind(o))):C.attr("cx",t).attr("cy",e).style("fill",o.updateCircleColor.bind(o)),[[c(C,n||!s,h).style("opacity",m)],c(f,n).attr("cx",t).attr("cy",e)]}const A=o.point("update",o,t,e,o.updateCircleColor.bind(o),n,r,f),R=[];return u.circle.each(function(C){let P=A.bind(this)(C);P=c(P,n||!s,h).style("opacity",m),R.push(P)}),[R,c(f,n).attr(`${d}x`,t).attr(`${d}y`,e)]},showCircleFocus(t){const e=this,{state:{hasRadar:n,resizing:r,toggling:i,transiting:o},$el:s}=e;let{circle:l}=s;if(o===!1&&l&&e.isPointFocusOnly()){const c=(n?e.radarCircleX:e.circleX).bind(e),u=(n?e.radarCircleY:e.circleY).bind(e),f=i||xn(t),d=e.point("update",e,c,u,e.getStylePropValue(e.color),r?!1:f);t&&(l=l.filter(function(h){var m;const A=(m=t.filter)==null?void 0:m.call(t,R=>R.id===h.id);return A.length?Ut(this).datum(A[0]):!1})),l.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(h){const{id:m,index:A,value:R}=h;let C="hidden";We(R)&&(d.bind(this)(h),e.expandCircles(A,m),C=""),this.style.visibility=C})}},hideCircleFocus(){const t=this,{$el:{circle:e}}=t;t.isPointFocusOnly()&&e&&(t.unexpandCircles(),e.style("visibility","hidden"))},expandCircles(t,e,n){const r=this,i=r.pointExpandedR.bind(r);n&&r.unexpandCircles();const o=r.getShapeByIndex("circle",t,e).classed(ze.EXPANDED,!0),s=i(o)/r.config.point_r,l=1-s;r.isCirclePoint()?o.attr("r",i):o.each(function(){const c=Ut(this);if(this.tagName==="circle")c.attr("r",i);else{const{width:u,height:f}=gv(this),d=l*(+c.attr("x")+u/2),h=l*(+c.attr("y")+f/2);c.attr("transform",`translate(${d} ${h}) scale(${s})`)}})},unexpandCircles(t){const e=this,n=e.pointR.bind(e),r=e.getShapeByIndex("circle",t).filter(function(){return Ut(this).classed(ze.EXPANDED)}).classed(ze.EXPANDED,!1);if(r.attr("r",n),!e.isCirclePoint()){const i=n(r)/e.config.point_r;r.attr("transform",i!==1?`scale(${i})`:null)}},isWithinCircle(t,e){const{state:n}=this,r=hr(n.event,t),i=Ut(t),o=this.isCirclePoint(t)?"c":"",s=this.getPointSensitivity(i==null?void 0:i.datum());let l=+i.attr(`${o}x`),c=+i.attr(`${o}y`);if(!(l||c)&&t.nodeType===1){const{x:u,y:f}=un(t);l=u,c=f}return Math.sqrt(Math.pow(l-r[0],2)+Math.pow(c-r[1],2))<(e||s)},updatePointClass(t){const e=this,{circle:n}=e.$el;let r=!1;return(je(t)||n)&&(r=t===!0?n.each(function(i){let o=e.getClass("circle",!0)(i);this.getAttribute("class").indexOf(ze.EXPANDED)>-1&&(o+=` ${ze.EXPANDED}`),this.setAttribute("class",o)}):e.getClass("circle",!0)(t)),r},custom:{create(t,e,n){return t.append("use").attr("xlink:href",`#${e}`).attr("class",this.updatePointClass.bind(this)).style("fill",n).node()},update(t,e,n,r,i,o,s){const l=this,{width:c,height:u}=gv(t.node()),f=m=>We(m.value)?e(m)-c/2:0,d=m=>We(m.value)?n(m)-u/2:0;let h=t;return i&&(o&&h.attr("x",f),h=l.$T(h,i,pi()),s&&l.$T(s,i,pi())),h.attr("x",f).attr("y",d).style("fill",r)}},circle:{create(t,e,n){return t.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",e).style("fill",n).node()},update(t,e,n,r,i,o,s){const l=this;let c=t;return l.hasType("bubble")&&c.attr("r",l.pointR.bind(l)),i&&(o&&c.attr("cx",e),c.attr("cx")&&(c=l.$T(c,i,pi())),s&&l.$T(s,i,pi())),c.attr("cx",e).attr("cy",n).style("fill",r)}},rectangle:{create(t,e,n){const r=i=>e(i)*2;return t.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",r).attr("height",r).style("fill",n).node()},update(t,e,n,r,i,o,s){const l=this,c=l.config.point_r,u=h=>e(h)-c,f=h=>n(h)-c;let d=t;return i&&(o&&d.attr("x",u),d=l.$T(d,i,pi()),s&&l.$T(s,i,pi())),d.attr("x",u).attr("y",f).style("fill",r)}}},za={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"},uC={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0};function vv(t,e,n){const{config:r}=t,i=(o,s)=>{const l=ge(s)?s:s===!1?void 0:null;l!==null&&(r[`axis_${o}_${e}`]=l)};ln(n)&&(Qn(n)?Object.keys(n).forEach(o=>{i(o,n[o])}):(ge(n)||n===!1)&&["y","y2"].forEach(o=>{i(o,n)}),t.state.dirty.data=!0,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function pv(t,e){const{config:n}=t;return{x:n[`axis_x_${e}`],y:n[`axis_y_${e}`],y2:n[`axis_y2_${e}`]}}var fC={axis:{labels:function(t){var e;const n=this.internal;let r;return t&&(Object.keys(t).forEach(i=>{n.axis.setLabelText(i,t[i])}),n.state.isCanvasMode?(e=n.renderCanvasFrame)==null||e.call(n,void 0,null,!1):n.axis.updateLabels()),["x","y","y2"].forEach(i=>{const o=n.axis.getLabelText(i);o&&(!r&&(r={}),r[i]=o)}),r},min:function(t){const e=this.internal;return We(t)||t===!1?vv(e,"min",t):pv(e,"min")},max:function(t){const e=this.internal;return We(t)||t===!1?vv(e,"max",t):pv(e,"max")},range:function(t){const{axis:e}=this;if(arguments.length){const{min:n,max:r}=t;ln(r)&&e.max(r),ln(n)&&e.min(n)}else return{max:e.max(),min:e.min()}}}},dC={groups(t){const e=this.internal,{config:n}=e;return xn(t)||(n.data_groups=t,e.state.dirty.data=!0,e.redraw()),n.data_groups}},hC={x(t){const e=this.internal,{axis:n,data:r}=e,i=n.isCustomX()&&n.isCategorized();return tn(t)&&(i?this.categories(t):(e.updateTargetX(r.targets,t),e.state.dirty.data=!0,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),i?this.categories():r.xs},xs(t){const e=this.internal;return je(t)&&(e.updateTargetXs(e.data.targets,t),e.state.dirty.data=!0,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}};function gC(t){return t}var zs=1,Us=2,nu=3,lo=4,mv=1e-6;function vC(t){return"translate("+t+",0)"}function pC(t){return"translate(0,"+t+")"}function mC(t){return e=>+t(e)}function xC(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function yC(){return!this.__axis}function ks(t,e){var n=[],r=null,i=null,o=6,s=6,l=3,c=typeof window!="undefined"&&window.devicePixelRatio>1?0:.5,u=t===zs||t===lo?-1:1,f=t===lo||t===Us?"x":"y",d=t===zs||t===nu?vC:pC;function h(m){var A=r==null?e.ticks?e.ticks.apply(e,n):e.domain():r,R=i==null?e.tickFormat?e.tickFormat.apply(e,n):gC:i,C=Math.max(o,0)+l,P=e.range(),z=+P[0]+c,$=+P[P.length-1]+c,B=(e.bandwidth?xC:mC)(e.copy(),c),W=m.selection?m.selection():m,H=W.selectAll(".domain").data([null]),J=W.selectAll(".tick").data(A,e).order(),q=J.exit(),at=J.enter().append("g").attr("class","tick"),et=J.select("line"),ot=J.select("text");H=H.merge(H.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),J=J.merge(at),et=et.merge(at.append("line").attr("stroke","currentColor").attr(f+"2",u*o)),ot=ot.merge(at.append("text").attr("fill","currentColor").attr(f,u*C).attr("dy",t===zs?"0em":t===nu?"0.71em":"0.32em")),m!==W&&(H=H.transition(m),J=J.transition(m),et=et.transition(m),ot=ot.transition(m),q=q.transition(m).attr("opacity",mv).attr("transform",function(lt){return isFinite(lt=B(lt))?d(lt+c):this.getAttribute("transform")}),at.attr("opacity",mv).attr("transform",function(lt){var ft=this.parentNode.__axis;return d((ft&&isFinite(ft=ft(lt))?ft:B(lt))+c)})),q.remove(),H.attr("d",t===lo||t===Us?s?"M"+u*s+","+z+"H"+c+"V"+$+"H"+u*s:"M"+c+","+z+"V"+$:s?"M"+z+","+u*s+"V"+c+"H"+$+"V"+u*s:"M"+z+","+c+"H"+$),J.attr("opacity",1).attr("transform",function(lt){return d(B(lt)+c)}),et.attr(f+"2",u*o),ot.attr(f,u*C).text(R),W.filter(yC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Us?"start":t===lo?"end":"middle"),W.each(function(){this.__axis=B})}return h.scale=function(m){return arguments.length?(e=m,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(m){return arguments.length?(n=m==null?[]:Array.from(m),h):n.slice()},h.tickValues=function(m){return arguments.length?(r=m==null?null:Array.from(m),h):r&&r.slice()},h.tickFormat=function(m){return arguments.length?(i=m,h):i},h.tickSize=function(m){return arguments.length?(o=s=+m,h):o},h.tickSizeInner=function(m){return arguments.length?(o=+m,h):o},h.tickSizeOuter=function(m){return arguments.length?(s=+m,h):s},h.tickPadding=function(m){return arguments.length?(l=+m,h):l},h.offset=function(m){return arguments.length?(c=+m,h):c},h}function TC(t){return ks(zs,t)}function bC(t){return ks(Us,t)}function xv(t){return ks(nu,t)}function yv(t){return ks(lo,t)}var SC=Object.defineProperty,AC=(t,e,n)=>e in t?SC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xs=(t,e,n)=>AC(t,typeof e!="symbol"?e+"":e,n);class EC{constructor(e){Xs(this,"owner"),Xs(this,"config"),Xs(this,"scale"),Xs(this,"charSize",{});const n=oa(),{config:r,params:i}=e;this.owner=e,this.config=r,this.scale=n,(r.noTransition||!i.config.transition_duration)&&(r.withoutTransition=!0),r.range=this.scaleExtent((i.orgXScale||n).range())}getSizeFor1Char(e,n,r=!0){const i={w:5.5,h:11.5};return this.charSize[e]&&r?this.charSize[e]:(!n.empty()&&n.text("0").call(o=>{try{const{width:s,height:l}=da(o.node(),!0);s&&l&&(i.w=s,i.h=l)}finally{o.text("")}}),this.charSize[e]=i,i)}getTickTransformSetter(e){const{config:n}=this,r=e==="x"?i=>`translate(${i+n.tickOffset},0)`:i=>`translate(0,${i})`;return(i,o)=>{i.attr("transform",s=>{const l=o(s);return We(s)?r(l):null})}}scaleExtent(e){const n=e[0],r=e[e.length-1];return n<r?[n,r]:[r,n]}generateTicks(e,n){const{tickStepSize:r}=this.owner.params,[i,o]=e.domain();let s=[];if(n&&r){let l=Math.round(i);for(;l<=o;)s.push(l),l+=r}else if(e.ticks){const{tickArguments:l}=this.config;if(e.type==="log"&&!l){const c=oa("_log").domain([i>0?i:1,o]).range(e.range());s=c.ticks();for(let u=o.toFixed().length;s.length>15;u--)s=c.ticks(u);s.splice(0,1,i),s.splice(s.length-1,1,o)}else s=e.ticks(...this.config.tickArguments||[])}return s}copyScale(){const e=this.scale.copy();return e.domain().length||e.domain(this.scale.domain()),e.type=this.scale.type,e}textFormatted(e){const n=this.config.tickFormat,r=/\d+\.\d+0{5,}\d$/.test(e)?+String(e).replace(/0+\d$/,""):e,i=n?n(r):r;return ln(i)?i:""}transitionise(e){const{config:n}=this;let r=e;if(n.withoutTransition)r=e.interrupt();else if(n.transition||!this.owner.params.noTransition)try{r=e.transition(n.transition)}catch(i){}return r}}var CC=Object.defineProperty,IC=(t,e,n)=>e in t?CC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,co=(t,e,n)=>IC(t,typeof e!="symbol"?e+"":e,n);class RC{constructor(e={}){co(this,"helper"),co(this,"config"),co(this,"params"),co(this,"g"),co(this,"generatedTicks",[]);const n={innerTickSize:Dt,outerTickSize:e.outerTick?Dt:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:mr,tickOffset:0,tickPadding:sn,tickValues:null,transition:null,noTransition:e.noTransition};n.tickLength=Math.max(n.innerTickSize,0)+n.tickPadding,this.config=n,this.params=e,this.helper=new EC(this)}canReuseTickTextOnResize(e){const{config:n,params:r}=this,{config:i,id:o,owner:s}=r,l=/^(x|subX)$/.test(o),u=o==="subX"?i.subchart_axis_x_tick_format||i.axis_x_tick_format:i[`axis_${o==="subX"?"x":o}_tick_format`],f=r.tickMultiline&&r.isCategory&&!e&&!(r.tickWidth>0);return!!(s.state.resizing&&!s.state.flowing&&!le(i.axis_evalTextSize)&&!u&&!r.tickTitle&&!(l&&i.axis_x_tick_autorotate)&&!f&&n.withoutTransition)}canReuseTickNodesOnResize(e,n,r,i){if(i.tick||!i.text||!this.canReuseTickTextOnResize(r)||e.size()!==n.length)return!1;const o=e.nodes();for(let s=0;s<n.length;s++){const l=o[s].__data__,c=n[s];if(l instanceof Date||c instanceof Date){if(+l!=+c)return!1}else if(l!==c)return!1}return!0}create(e){const n=this,{config:r,helper:i,params:o}=n,{scale:s}=i,{orient:l}=r,c=this.splitTickText.bind(n),u=/^(left|right)$/.test(l),f=/^(top|bottom)$/.test(l),d=i.getTickTransformSetter(f?"x":"y"),h=d===i.axisX?"y":"x",m=/^(top|left)$/.test(l)?-1:1,A=o.tickTextRotate;this.config.range=s.rangeExtent?s.rangeExtent():i.scaleExtent((o.orgXScale||s).range());const{innerTickSize:R,tickLength:C,range:P}=r,z=o.id,$=z&&/^(x|y|y2)$/.test(z)?o.config[`axis_${z}_tick_text_position`]:{x:0,y:0},B=z==="subX"?"subchart_axis_x":`axis_${z}`,W=o.config[`${B}_show`],H={tick:W?o.config[`${B}_tick_show`]:!1,text:W?o.config[`${B}_tick_text_show`]:!1},J=o.config.axis_evalTextSize;let q;e.each(function(){const at=Ut(this);let et=this.__chart__||s,ot=i.copyScale();q=at,this.__chart__=ot,r.tickOffset=o.isCategory?(ot(1)-ot(0))/2:0;const lt=at.selectAll(".domain").data([0]);if(lt.enter().append("path").attr("class","domain").merge(lt).attr("d",()=>{const ft=r.outerTickSize*m;return f?`M${P[0]},${ft}V0H${P[1]}V${ft}`:`M${ft},${P[0]}H0V${P[1]}H${ft}`}),H.tick||H.text){const ft=r.tickValues||i.generateTicks(ot,u||o.config.axis_rotated);n.generatedTicks=ft;let _=at.selectAll(".tick");if(n.canReuseTickNodesOnResize(_,ft,u||o.config.axis_rotated,H))d(_,ot);else{_=_.data(ft,ot);const ut=_.enter().insert("g",".domain").attr("class","tick"),xt=_.exit().remove();_=ut.merge(_),H.tick&&ut.append("line"),H.text&&ut.append("text");const bt=!ut.empty()||!xt.empty(),Rt=H.text&&!bt&&n.canReuseTickTextOnResize(u||o.config.axis_rotated);let Et={w:0,h:0},Zt=_.selectAll("text.__bb-empty");if(H.text&&!Rt){const me=_.select("text"),xe=[];Zt=me,le(J)&&(Et=J.bind(n.params.owner.api)(me.node(),z),this.classList.contains(ze.dummy)&&(this.sizeFor1Char=Et)),(!Et||Et.w===0||Et.h===0)&&(Et=n.helper.getSizeFor1Char(l,me,!!J));let Te=me.selectAll("tspan").data((Fe,Ie)=>{let ke;if(o.tickMultiline)ke=c(Fe,ot,ft,u,Et.w);else{const Jt=i.textFormatted(Fe);ke=tn(Jt)?Jt.concat():[Jt]}return xe[Ie]=ke.length,ke.map(Jt=>({index:Ie,splitted:Jt}))});Te.exit().remove(),Te=Te.enter().append("tspan").merge(Te).text(Fe=>Fe.splitted),Te.attr("x",f?0:C*m).attr("dx",(()=>{let Fe=0;return/(top|bottom)/.test(l)&&A&&(Fe=8*Math.sin(Math.PI*(A/180))*(l==="top"?-1:1)),Fe+($.x||0)})()).attr("dy",(Fe,Ie)=>{const ke=".71em";let Jt=0;return l!=="top"&&(Jt=Et.h,Ie===0&&(Jt=u?-((xe[Fe.index]-1)*(Et.h/2)-3):$.y===0?ke:0)),ge(Jt)&&$.y?Jt+$.y:Jt||ke})}const fe=_.select("line");if(ut.select("line").attr(`${h}2`,R*m),ut.select("text").attr(h,C*m),n.setTickLineTextPosition(fe,Zt,Et),o.tickTitle){const me=Zt.select("title"),xe=o.tickTitle;(me.empty()?Zt.append("title"):me).text(Te=>xe[Number(Te)])}if(ot.bandwidth){const me=ot,xe=me.bandwidth()/2;et=Te=>me(Te)+xe,ot=et}else et.bandwidth?et=ot:d(xt,ot);_=o.owner.state.flowing?i.transitionise(_):o.owner.$T(_),d(ut,et),d(_.style("opacity",null),ot)}}}),this.g=q}getGeneratedTicks(e){var n;const r=((n=this.generatedTicks)==null?void 0:n.length)-1;let i=this.generatedTicks;if(r>e){const o=Math.round(r/e+.1);i=this.generatedTicks.map((s,l)=>l%o===0?s:null).filter(s=>s!==null).splice(0,e)}return i}getTickXY(){const{config:e}=this,n={x:0,y:0};return this.params.isCategory&&(n.x=e.tickCentered?0:e.tickOffset,n.y=e.tickCentered?e.tickOffset:0),n}getTickSize(e){const{scale:n}=this.helper,{config:r}=this,{innerTickSize:i,range:o}=r,s=n(e)+(r.tickCentered?0:r.tickOffset);return o[0]<s&&s<o[1]?i:0}setTickLineTextPosition(e,n,r){const i=this.getTickXY(),{innerTickSize:o,orient:s,tickLength:l,tickOffset:c}=this.config,u=this.params.id,f=this.params.tickTextRotate,d=6,h=r.h/2-d,m=$=>{const B=["start","end"];return s==="top"&&B.reverse(),$?B[$>0?0:1]:"middle"},A=$=>$?`rotate(${$})`:null,R=$=>{const B=$/(s==="bottom"?15:23);return $?11.5-2.5*B*($>0?1:-1):l},{config:{axis_rotated:C,axis_x_tick_text_inner:P}}=this.params.owner,z=this.params.config[`axis_${u}_tick_inner`];switch(s){case"bottom":e.attr("x1",i.x).attr("x2",i.x).attr("y2",$=>this.getTickSize.bind(this)($)*(z?-1:1)),n.attr("x",0).attr("y",R(f)).style("text-anchor",($,B,{length:W})=>!C&&B===0&&(P===!0||P.first)?"start":!C&&B===W-1&&(P===!0||P.last)?"end":m(f)).attr("transform",A(f));break;case"top":e.attr("x2",0).attr("y2",z?o:-o),n.attr("x",0).attr("y",-(R(f)+h+d)).style("text-anchor",m(f)).attr("transform",A(f));break;case"left":e.attr("x2",z?o:-o).attr("y1",i.y).attr("y2",i.y),n.attr("x",-l).attr("y",c+(C?h/4:h)).style("text-anchor","end");break;case"right":e.attr("x2",z?-o:o).attr("y2",0),n.attr("x",l).attr("y",h).style("text-anchor","start")}}splitTickText(e,n,r,i,o){const{params:s}=this,l=this.helper.textFormatted(e),c=Ke(l)&&l.indexOf(`
|
|
65
65
|
`)>-1?l.split(`
|
|
66
66
|
`):[];if(c.length)return c;if(tn(l))return l;let u=s.tickWidth;(!u||u<=0)&&(u=i?95:s.isCategory?(s.isInverted?n(r[0])-n(r[1]):n(r[1])-n(r[0]))-12:110);function f(d,h){let m,A,R;for(let C=1;C<h.length;C++)if(h.charAt(C)===" "&&(A=C),m=h.substr(0,C+1),R=o*m.length,u<R)return f(d.concat(h.substr(0,A||C)),h.slice(A?A+1:C));return d.concat(h)}return f(c,String(l))}scale(e){return arguments.length?(this.helper.scale=e,this):this.helper.scale}orient(e){return arguments.length?(this.config.orient=e in{top:1,right:1,bottom:1,left:1}?String(e):"bottom",this):this.config.orient}tickFormat(e){const{config:n}=this;return arguments.length?(n.tickFormat=e,this):n.tickFormat}tickCentered(e){const{config:n}=this;return arguments.length?(n.tickCentered=e,this):n.tickCentered}tickOffset(){return this.config.tickOffset}tickInterval(e){var n,r,i;const{outerTickSize:o,tickOffset:s,tickValues:l}=this.config;let c;if(this.params.isCategory){const u=(n=this.params.owner.scale.zoom)!=null?n:this.helper.scale;c=s*2||Math.abs(u(1)-u(0))}else{const u=(r=this.params.owner.scale.zoom)!=null?r:this.helper.scale;if(c=(this.g?this.g.select("path.domain").node().getTotalLength()-o*2:Math.abs(u.range()[1]-u.range()[0]))/(e||((i=this.g)==null?void 0:i.selectAll("line").size())||1),l)for(let d=0;d<l.length-1;d++){const h=u(l[d+1])-u(l[d]);h&&h<c&&(c=h)}}return c===1/0?0:c}ticks(...e){const{config:n}=this;return e.length?(n.tickArguments=Ea(e),this):n.tickArguments}tickCulling(e){const{config:n}=this;return arguments.length?(n.tickCulling=e,this):n.tickCulling}tickValues(e){const{config:n}=this;if(le(e))n.tickValues=()=>e(this.helper.scale.domain());else{if(!arguments.length)return n.tickValues;n.tickValues=e}return this}setTransition(e){return this.config.transition=e,this}}var wC=Object.defineProperty,OC=Object.defineProperties,PC=Object.getOwnPropertyDescriptors,Tv=Object.getOwnPropertySymbols,MC=Object.prototype.hasOwnProperty,LC=Object.prototype.propertyIsEnumerable,ru=(t,e,n)=>e in t?wC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,DC=(t,e)=>{for(var n in e||(e={}))MC.call(e,n)&&ru(t,n,e[n]);if(Tv)for(var n of Tv(e))LC.call(e,n)&&ru(t,n,e[n]);return t},FC=(t,e)=>OC(t,PC(e)),ta=(t,e,n)=>ru(t,typeof e!="symbol"?e+"":e,n);function NC(t){var e,n;const r=[t[0],t[t.length-1]];let i=0,o=null;for(const l of t){const c=(n=(e=l.textContent)==null?void 0:e.length)!=null?n:0;c>i&&(i=c,o=l)}o&&!r.includes(o)&&r.push(o);const s=t[Math.floor(t.length/2)];return r.includes(s)||r.push(s),r}const Gs=50,au=Symbol("tickWidthFallback");function $C(t){var e,n,r;const i=t.select("line").node(),o=(n=(e=i==null?void 0:i.ownerDocument)==null?void 0:e.defaultView)!=null&&n.getComputedStyle?parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).strokeWidth):parseFloat((r=i==null?void 0:i.getAttribute)==null?void 0:r.call(i,"stroke-width"));return Number.isFinite(o)&&o>0?o:1}function BC(t,e,n){var r;const i=(r=t==null?void 0:t.scale)==null?void 0:r.call(t);if(!i||e.length<2)return!1;const o=Math.max(1,n)/2,s=e.map(c=>+i(c)).filter(Number.isFinite).sort((c,u)=>c-u);if(s.length<2)return!1;let l=s[0]+o;for(let c=1;c<s.length;c++){const u=s[c]-o,f=s[c]+o;if(u<=l+ka)return!0;l=Math.max(l,f)}return!1}function zC(t,e){if(t.length<=Gs)return t;const n=new Map,r=l=>{l>=0&&l<t.length&&n.set(l,t[l])};r(0),r(t.length-1),r(Math.floor(t.length/2));const i=Math.max(1,Math.floor(t.length/(Gs-3)));let o=-1,s=0;for(let l=0;l<t.length;l+=i){r(l);const c=t[l],u=e?e(c):c,f=Array.isArray(u)?u.join("").length:String(u!=null?u:"").length;f>o&&(o=f,s=l)}return r(s),Array.from(n.keys()).sort((l,c)=>l-c).map(l=>n.get(l))}function UC(t){return le(t)?Sv(t):!Array.isArray(t)||t.length<=Gs?t:{length:t.length,first:t[0],middle:t[Math.floor(t.length/2)],last:t[t.length-1]}}function iu(t){return t[au]}function Ws(t,e){ge(e)?Object.defineProperty(t,au,{configurable:!0,value:e,writable:!0}):delete t[au]}function ou(t){t.length=0,Ws(t)}function kC(t,e,n){ou(t),t.length=e,Ws(t,n)}function XC(t){const e=[];return e.length=t.length,Object.keys(t).forEach(n=>{const r=+n;e[r]=t[r]}),Ws(e,iu(t)),e}function GC(t,e){ou(t),t.length=e.length,Object.keys(e).forEach(n=>{const r=+n;t[r]=e[r]}),Ws(t,iu(e))}function WC(t,e,n){const r=t[e];if(ge(r))return r;const i=Number(r);return Number.isFinite(i)?i:n}const bv=new WeakMap;let VC=0;function Sv(t){if(!t||!/^(function|object)$/.test(typeof t))return`${typeof t}:${String(t)}`;let e=bv.get(t);return e||(e=++VC,bv.set(t,e)),`${typeof t}:${e}`}function su(t){return t instanceof Date?`date:${+t}`:Array.isArray(t)?`[${t.map(e=>su(e)).join(",")}]`:t&&typeof t=="object"?`{${Object.keys(t).sort().map(e=>`${e}:${su(t[e])}`).join(",")}}`:typeof t=="function"?Sv(t):`${typeof t}:${String(t)}`}function lu(t){return t instanceof Date?new Date(+t):Array.isArray(t)?t.map(e=>lu(e)):t}function jC(t){return{width:t.width,height:t.height,ticks:t.ticks&&XC(t.ticks),clipPath:t.clipPath,domain:lu(t.domain)}}function HC(t,e){return t.width=e.width,t.height=e.height,t.clipPath=e.clipPath,t.domain=lu(e.domain),t.ticks&&e.ticks&&GC(t.ticks,e.ticks),t}var YC={getAxisInstance:function(){return this.axis||new KC(this)}};class KC{constructor(e){ta(this,"owner"),ta(this,"x"),ta(this,"subX"),ta(this,"y"),ta(this,"y2"),ta(this,"axesList",{}),ta(this,"tick",{x:null,y:null,y2:null}),ta(this,"xs",[]),ta(this,"orient",{x:"bottom",y:"left",y2:"right",subX:"bottom"}),this.owner=e,this.setOrient()}getAxisClassName(e){return`${Rn.axis} ${Rn[`axis${$n(e)}`]}`}isHorizontal(e,n){const r=e.config.axis_rotated;return n?r:!r}isCategorized(){const{config:e,state:n}=this.owner;return e.axis_x_type.indexOf("category")>=0||n.hasRadar}isCustomX(){const{config:e}=this.owner;return!this.isTimeSeries()&&(e.data_x||vn(e.data_xs))}isTimeSeries(e="x"){return this.owner.config[`axis_${e}_type`]==="timeseries"}isLog(e="x"){return this.owner.config[`axis_${e}_type`]==="log"}isTimeSeriesY(){return this.isTimeSeries("y")}getAxisType(e="x"){let n="linear";return this.isTimeSeries(e)?n=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(e)&&(n="log"),n}getExtent(){const e=this.owner,{config:n,scale:r}=e;let i=n.axis_x_extent;if(i){if(le(i))i=i.bind(e.api)(e.getXDomain(e.data.targets),r.subX);else if(this.isTimeSeries()&&i.every(isNaN)){const o=Hn.bind(e);i=i.map(s=>r.subX(o(s)))}}return i}init(){const e=this.owner,{config:n,$el:{main:r,axis:i},state:{clip:o}}=e,s=["x","y"];n.axis_y2_show&&s.push("y2"),s.forEach(l=>{const c=this.getAxisClassName(l);i[l]=r.append("g").attr("class",c).attr("clip-path",()=>{let u=null;return l==="x"?u=o.pathXAxis:l==="y"&&(u=o.pathYAxis),u}).attr("transform",e.getTranslate(l)).style("visibility",n[`axis_${l}_show`]?null:"hidden"),this.generateAxes(l)})}setOrient(){const e=this.owner,{axis_rotated:n,axis_y_inner:r,axis_y2_inner:i}=e.config;this.orient={x:n?"left":"bottom",y:n?r?"top":"bottom":r?"right":"left",y2:n?i?"bottom":"top":i?"left":"right",subX:n?"left":"bottom"}}generateAxes(e){const n=this.owner,{config:r}=n,i=[],o=r[`axis_${e}_axes`],s=r.axis_rotated;let l;e==="x"?l=s?yv:xv:e==="y"?l=s?xv:yv:e==="y2"&&(l=s?TC:bC),o.length&&o.forEach(c=>{const u=c.tick||{},f=n.scale[e].copy();c.domain&&f.domain(c.domain),i.push(l(f).ticks(u.count).tickFormat(le(u.format)?u.format.bind(n.api):(d=>d)).tickValues(u.values).tickSizeOuter(u.outer===!1?0:Dt))}),this.axesList[e]=i}updateAxes(){const e=this.owner,{config:n,$el:{main:r},$T:i}=e;Object.keys(this.axesList).forEach(o=>{const s=n[`axis_${o}_axes`],l=e.scale[o].copy(),c=l.range();this.axesList[o].forEach((u,f)=>{const d=u.scale().range();c.every((A,R)=>A===d[R])||u.scale().range(c);const h=`${this.getAxisClassName(o)}-${f+1}`;let m=r.select(`.${h.replace(/\s/,".")}`);m.empty()?m=r.append("g").attr("class",h).style("visibility",n[`axis_${o}_show`]?null:"hidden").call(u):(s[f].domain&&l.domain(s[f].domain),i(m).call(u.scale(l))),m.attr("transform",e.getTranslate(o,f+1))})})}setAxis(e,n,r,i){const o=this.owner;e!=="subX"&&(this.tick[e]=this.getTickValues(e)),this[e]=this.getAxis(e,n,r,e==="x"&&(o.scale.zoom||o.config.subchart_show||o.state.resizing)?!0:i)}getAxis(e,n,r,i,o){const s=this.owner,{config:l}=s,c=/^(x|subX)$/.test(e),u=c?"x":e,f=c&&this.isCategorized(),d=this.orient[e],h=o?0:s.getAxisTickRotate(u);let m;if(c)m=e==="subX"?s.format.subXAxisTick:s.format.xAxisTick;else{const z=l[`axis_${e}_tick_format`];le(z)&&(m=z.bind(s.api))}let A=this.tick[u];const R=Gr({outerTick:r,noTransition:i,config:l,id:e,tickTextRotate:h,owner:s},c&&{isCategory:f,isInverted:l.axis_x_inverted,tickMultiline:l.axis_x_tick_multiline,tickWidth:l.axis_x_tick_width,tickTitle:f&&l.axis_x_tick_tooltip&&s.api.categories(),orgXScale:s.scale.x});c||(R.tickStepSize=l[`axis_${u}_tick_stepSize`]);const C=new RC(R).scale(c&&s.scale.zoom||n).orient(d);if(c&&this.isTimeSeries()&&A&&!le(A)){const z=Hn.bind(s);A=A.map($=>z($))}else!c&&this.isTimeSeriesY()&&(C.ticks(l.axis_y_tick_time_value),A=null);A&&C.tickValues(A),C.tickFormat(m||!c&&s.isStackNormalized()&&s.hasAxisGroupedData(e)&&(z=>`${z}%`)),f&&(C.tickCentered(l.axis_x_tick_centered),sr(l.axis_x_tick_culling)&&(l.axis_x_tick_culling=!1));const P=l[`axis_${u}_tick_count`];return P&&C.ticks(P),C}updateXAxisTickValues(e,n){var r;const i=this.owner,{config:o}=i,s=o.axis_x_tick_fit;let l=o.axis_x_tick_count,c;return s&&(c=i.mapTargetsToUniqueXs(e),this.isCategorized()&&l>c.length&&(l=c.length),c=this.generateTickValues(c,l,this.isTimeSeries())),n?n.tickValues(c):this.x&&(this.x.tickValues(c),(r=this.subX)==null||r.tickValues(c)),c}getId(e){const{config:n,scale:r}=this.owner;let i=n.data_axes[e];return(!i||!r[i])&&(i="y"),i}getXAxisTickFormat(e){const n=this.owner,{config:r,format:i}=n,o=e&&r.subchart_axis_x_tick_format||r.axis_x_tick_format,s=this.isTimeSeries(),l=this.isCategorized();let c;return o?le(o)?c=o.bind(n.api):s&&(c=u=>u?i.axisTime(o)(u):""):c=s?i.defaultAxisTime:l?n.categoryName:u=>u<0?u.toFixed(0):u,le(c)?u=>c.apply(n,l?[u,n.categoryName(u)]:[u]):c}getTickValues(e){const n=this.owner,r=n.config[`axis_${e}_tick_values`],i=n[`${e}Axis`];return(le(r)?r.call(n.api):r)||(i?i.tickValues():void 0)}getLabelOptionByAxisId(e){return this.owner.config[`axis_${e}_label`]}getLabelText(e){const n=this.getLabelOptionByAxisId(e);return Ke(n)?n:n?n.text:null}setLabelText(e,n){const r=this.owner,{config:i}=r,o=this.getLabelOptionByAxisId(e);Ke(o)?i[`axis_${e}_label`]=n:o&&(o.text=n)}getLabelPosition(e,n){const r=this.owner.config.axis_rotated,i=this.getLabelOptionByAxisId(e),o=Qn(i)&&i.position?i.position:n[+!r],s=l=>!!~o.indexOf(l);return{isInner:s("inner"),isOuter:s("outer"),isLeft:s("left"),isCenter:s("center"),isRight:s("right"),isTop:s("top"),isMiddle:s("middle"),isBottom:s("bottom")}}getAxisLabelPosition(e){return this.getLabelPosition(e,e==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])}xForAxisLabel(e){const n=this.owner,{state:{width:r,height:i}}=n,o=this.getAxisLabelPosition(e);let s=o.isMiddle?-i/2:0;return this.isHorizontal(n,e!=="x")?s=o.isLeft?0:o.isCenter?r/2:r:o.isBottom&&(s=-i),s}textAnchorForAxisLabel(e){const n=this.owner,r=this.getAxisLabelPosition(e);let i=r.isMiddle?"middle":"end";return this.isHorizontal(n,e!=="x")?i=r.isLeft?"start":r.isCenter?"middle":"end":r.isBottom&&(i="start"),i}dxForAxisLabel(e){const n=this.owner,r=this.getAxisLabelPosition(e);let i=r.isBottom?"0.5em":"0";return this.isHorizontal(n,e!=="x")?i=r.isLeft?"0.5em":r.isRight?"-0.5em":"0":r.isTop&&(i="-0.5em"),i}dyForAxisLabel(e){const n=this.owner,{config:r}=n,i=r.axis_rotated,o=this.getAxisLabelPosition(e).isInner,s=r[`axis_${e}_tick_rotate`]?n.getHorizontalAxisHeight(e):0,{width:l}=this.getMaxTickSize(e);let c;if(e==="x"){const u=r.axis_x_height;i?c=o?"1.2em":-25-l:o?c="-0.5em":u?c=u-10:s?c=s-10:c="3em"}else c={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[e],i?o?c=c[0]:s?c=s*(e==="y2"?-1:1)-c[1]:c=c[2]:c=o?c[3]:(c[4]+(r[`axis_${e}_inner`]?0:l+c[4]))*(e==="y"?-1:1);return c}getTickFormatCacheValue(e){const n=this.owner,{config:r}=n;return e==="x"?{format:r.axis_x_tick_format,type:r.axis_x_type,localtime:r.axis_x_localtime,categories:r.axis_x_categories}:{format:r[`axis_${e}_tick_format`],normalized:n.isStackNormalized(),grouped:n.hasAxisGroupedData(e),type:r[`axis_${e}_type`]}}getMaxTickSizeFingerprint(e,n,r,i,o,s){var l;const c=this.owner,{config:u,state:f}=c,d=e==="x",h=d?"axis_x":`axis_${e}`,m=i.tickValues();return su({id:e,withoutRecompute:!!s,dataGeneration:f.dataGeneration,size:[f.current.width,f.current.height],range:(l=n.range)==null?void 0:l.call(n),domain:r,type:n.type,orient:this.orient[e],axisRotated:u.axis_rotated,evalTextSize:u.axis_evalTextSize,format:this.getTickFormatCacheValue(e),ticks:{values:UC(m),rawValues:u[`${h}_tick_values`],arguments:i.ticks(),count:u[`${h}_tick_count`],rotate:o,show:u[`${h}_tick_show`],textShow:u[`${h}_tick_text_show`],textPosition:u[`${h}_tick_text_position`],inner:u[`${h}_tick_inner`],culling:u[`${h}_tick_culling`],cullingMax:u[`${h}_tick_culling_max`],cullingLines:u[`${h}_tick_culling_lines`],cullingReverse:u[`${h}_tick_culling_reverse`],stepSize:!d&&u[`${h}_tick_stepSize`],timeValue:!d&&u[`${h}_tick_time_value`],fit:d&&u.axis_x_tick_fit,autorotate:d&&u.axis_x_tick_autorotate,centered:d&&u.axis_x_tick_centered,inverted:d&&u.axis_x_inverted,multiline:d&&u.axis_x_tick_multiline,width:d&&u.axis_x_tick_width}})}getMaxTickSize(e,n){var r;const i=this.owner,{config:o,state:s,$el:{svg:l,chart:c}}=i,{current:u,resizing:f}=s,d=u.maxTickSize[e],h=`${Ue.maxTickSize}_${e}_${!!n}`,m=i.cache.get(h);if(m&&m.generation===s.redrawGeneration)return d;const A=`axis_${e}`,R={width:0,height:0};let C;if(f||n||!o[`${A}_show`]||d.width>0&&i.filterTargetsToShow().length===0)return d;if((l||o.render_mode==="canvas")&&((r=i.scale[e])!=null&&r.copy)){const P=/^y2?$/.test(e),z=i.getTargetsToShow(),$=i.scale[e].copy().domain(i[`get${P?"Y":"X"}Domain`](z,e)),B=$.domain(),W=B[0]===B[1]&&B.every(bt=>bt>0),H=tn(d.domain)&&d.domain[0]===d.domain[1]&&d.domain.every(bt=>bt>0);if(W||H)return d;d.domain=B,P||ou(d.ticks);const J=this.getAxis(e,$,!1,!1,!0),q=o[`${A}_tick_rotate`],at=o[`${A}_tick_count`];if(!o[`${A}_tick_values`]&&at&&J.tickValues(this.generateTickValues(B,at,P?this.isTimeSeriesY():this.isTimeSeries())),!P&&this.updateXAxisTickValues(z,J),C=this.getMaxTickSizeFingerprint(e,$,B,J,q,n),(m==null?void 0:m.fingerprint)===C)return i.cache.add(h,FC(DC({},m),{generation:s.redrawGeneration})),HC(d,m.value);const ot=J.tickValues(),lt=!P&&Array.isArray(ot)&&ot.length>Gs;lt&&J.tickValues(zC(ot,J.tickFormat()));const ft=c.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0"),_=ft.append("g").attr("class",`${Rn[`axis${$n(e)}`]} ${ze.dummy}`);J.create(_);const{sizeFor1Char:dt}=_.node(),ut=ft.selectAll("text").attr("transform",ge(q)?`rotate(${q})`:null),xt=lt?ot.length:ut.size();if(dt)ut.each(function(bt,Rt){const Et=this.textContent.length*dt.w,Zt=dt.h;R.width=Math.max(R.width,Et),R.height=Math.max(R.height,Zt),P||(d.ticks[Rt]=Et)});else{const bt=[];if(ut.each(function(){bt.push(this)}),(bt.length<=5?bt:NC(bt)).map(Et=>un(Et,!0)).forEach(Et=>{R.width=Math.max(R.width,Et.width),R.height=Math.max(R.height,Et.height)}),!P)for(let Et=0;Et<bt.length;Et++)d.ticks[Et]=R.width}!P&<&&kC(d.ticks,xt,R.width),ft.remove()}return Object.keys(R).forEach(P=>{R[P]>0&&(d[P]=R[P])}),i.cache.add(h,{fingerprint:C,generation:s.redrawGeneration,value:jC(d)}),d}getXAxisTickTextY2Overflow(e){const n=this.owner,{axis:r,config:i,state:{current:o,isLegendRight:s,legendItemWidth:l}}=n,c=n.getAxisTickRotate("x"),u=c>0&&c<90;if((r.isCategorized()||r.isTimeSeries())&&i.axis_x_tick_fit&&(!i.axis_x_tick_culling||sr(i.axis_x_tick_culling))&&!i.axis_x_tick_multiline&&u){const f=i.axis_y2_show&&o.maxTickSize.y2.width||0,d=s&&l||0,h=o.width-n.getCurrentPaddingByDirection("left"),m=this.getXAxisTickMaxOverflow(c,h-e)-f-d,A=Math.max(0,m)+e;return Math.min(A,h/2)}return 0}getXAxisTickMaxOverflow(e,n){var r;const i=this.owner,{axis:o,config:s,state:l}=i,c=o.isTimeSeries(),u=l.current.maxTickSize.x.ticks,f=u.length,d=(r=iu(u))!=null?r:l.current.maxTickSize.x.width,{left:h,right:m}=l.axis.x.padding;let A=0;const R=f-(c&&s.axis_x_tick_fit?.5:0);for(let z=0;z<f;z++){const $=z+1,B=Math.cos(Math.PI*e/180)*WC(u,z,d),W=$-(c?1:.5)+h;if(W<=0)continue;const J=(n-B)/W,q=R-$,at=m*J,et=q*J+at,ot=B-J/2-et;A=Math.max(A,ot)}const C=i.getTargetsToShow();let P=0;if(!c&&s.axis_x_tick_count<=C.length&&C[0].values.length){const z=oa(i.axis.getAxisType("x"),0,n-A).domain([h*-1,i.getXDomainMax(i.data.targets)+1+m]);P=(z(1)-z(0))/2}return A+P}updateLabels(e){const n=this.owner,{config:r,$el:{main:i},$T:o}=n,s=r.axis_rotated;["x","y","y2"].forEach(l=>{const c=this.getLabelText(l),u=`axis${$n(l)}`,f=Rn[`${u}Label`];if(c){let d=i.select(`text.${f}`);d.empty()&&(d=i.select(`g.${Rn[u]}`).insert("text",":first-child").attr("class",f).attr("transform",["rotate(-90)",null][l==="x"?+!s:+s]).style("text-anchor",()=>this.textAnchorForAxisLabel(l))),o(d,e).attr("x",()=>this.xForAxisLabel(l)).attr("dx",()=>this.dxForAxisLabel(l)).attr("dy",()=>this.dyForAxisLabel(l)).text(c)}})}getPadding(e,n,r,i){const o=ge(e)?e:e[n];return We(o)?this.owner.convertPixelToScale(/(bottom|top)/.test(n)?"y":"x",o,i):r}generateTickValues(e,n,r){let i=e;if(n){const o=le(n)?n():n;if(o===1)i=[e[0]];else if(o===2)i=[e[0],e[e.length-1]];else if(o>2){const s=this.isCategorized(),l=o-2,c=e[0],u=e[e.length-1],f=(u-c)/(l+1);let d;i=[c];for(let h=0;h<l;h++)d=+c+f*(h+1),i.push(r?new Date(d):s?Math.round(d):d);i.push(u)}}return r||(i=i.sort((o,s)=>o-s)),i}generateTransitions(e){const n=this.owner,{$el:{axis:r},$T:i}=n,[o,s,l,c]=["x","y","y2","subX"].map(u=>i(r[u],e));return{axisX:o,axisY:s,axisY2:l,axisSubX:c}}redraw(e,n,r){const i=this.owner,{config:o,state:s,$el:l}=i,c=n?"0":null;["x","y","y2","subX"].forEach(u=>{const f=this[u],d=l.axis[u];f&&d&&(!r&&!o.transition_duration&&(f.config.withoutTransition=!0),d.style("opacity",c),f.create(e[`axis${$n(u)}`]))}),this.updateAxes(),!s.rendered&&o.axis_tooltip&&this.setAxisTooltip()}syncAxisDomains(e,n,r){var i,o,s;const l=this.owner,{config:c,scale:u,$el:f}=l,d=!!u.zoom;let h;!d&&this.isCategorized()&&e.length===0&&f.axis.x&&u.x.domain([0,f.axis.x.selectAll(".tick").size()]),u.x&&e.length?(!d&&l.updateXDomain(e,n.UpdateXDomain,n.UpdateOrgXDomain,n.TrimXDomain),c.axis_x_tick_values||this.updateXAxisTickValues(e)):this.x&&(this.x.tickValues([]),(i=this.subX)==null||i.tickValues([])),c.zoom_rescale&&!r&&(h=u.x.orgDomain()),["y","y2"].forEach(m=>{const A=`axis_${m}_`,R=u[m];if(R){const C=c[`${A}tick_values`],P=c[`${A}tick_count`];if(R.domain(l.getYDomain(e,m,h)),!C&&P){const z=l.axis[m],$=R.domain();z.tickValues(this.generateTickValues($,$.every(B=>B===0)?1:P,this.isTimeSeriesY()))}}}),n.Y&&((o=u.subY)==null||o.domain(l.getYDomain(e,"y")),(s=u.subY2)==null||s.domain(l.getYDomain(e,"y2")))}redrawAxis(e,n,r,i,o){const s=this.owner;this.syncAxisDomains(e,n,i),this.redraw(r,s.hasArcType(),o),this.updateLabels(n.Transition),(n.UpdateXDomain||n.UpdateXAxis||n.Y)&&e.length&&this.setCulling()}setCulling(){const e=this.owner,{config:n,state:{clip:r,current:i},$el:o}=e;["subX","x","y","y2"].forEach(s=>{const l=o.axis[s],u=`axis_${s==="subX"?"x":s}_tick_culling`,f=n[u];if(l&&f){const d=l.selectAll(".tick"),h=Qa(d.data(),!n[`${u}_reverse`]),m=h.length,A=n[`${u}_max`],C=!n[`${u}_lines`]||BC(this[s],h,$C(d));let P;if(m){for(let $=1;$<m;$++)if(m/$<A){P=$;break}P=P!=null?P:m;const z=new Map;for(let $=0;$<h.length;$++)z.set(h[$],$);d.each(function($){var B;const W=C?this:this.querySelector("text");W&&(W.style.display=((B=z.get($))!=null?B:0)%P?"none":null)})}else d.style("display",null);if(s==="x"){const z=i.maxTickSize.x.clipPath?r.pathXAxisTickTexts:null;o.svg.selectAll(`.${Rn.axisX} .tick text`).attr("clip-path",z)}}})}setAxisTooltip(){var e;const n=this.owner,{config:{axis_rotated:r,axis_tooltip:i},$el:{axis:o,axisTooltip:s}}=n,l=(e=i.backgroundColor)!=null?e:"black";n.generateTextBGColorFilter(l,{x:-.15,y:-.2,width:1.3,height:1.3}),["x","y","y2"].forEach(c=>{var u,f,d;if(Ke(l)||l[c])if(s[c]=(u=o[c])==null?void 0:u.append("text").classed(Rn[`axis${c.toUpperCase()}Tooltip`],!0).attr("filter",n.updateTextBGColor({id:c},l)),r){const h=c==="x"?"x":"y",m=c==="y"?"1.15em":c==="x"?"-0.3em":"-0.4em";(f=s[c])==null||f.attr(h,m).attr(`d${c==="x"?"y":"x"}`,c==="x"?"0.4em":"-1.3em").style("text-anchor",c==="x"?"end":null)}else{const h=c==="x"?"y":"x",m=c==="x"?"1.15em":`${c==="y"?"-":""}0.4em`;(d=s[c])==null||d.attr(h,m).attr(`d${c==="x"?"x":"y"}`,c==="x"?"-1em":"0.3em").style("text-anchor",c==="y"?"end":null)}})}}var Av=Math.pow,ZC={initEventRect(){this.$el.main.select(`.${ze.chart}`).append("g").attr("class",Kr.eventRects).style("fill-opacity","0")},redrawEventRect(){var t;const e=this,{config:n,state:r,$el:i}=e,o=e.isMultipleX(),s=n.axis_x_inverted;if(i.eventRect)e.updateEventRect(i.eventRect,!0);else if(e.data.targets.length){const c=e.$el.main.select(`.${Kr.eventRects}`).style("cursor",n.zoom_enabled&&n.zoom_type!=="drag"?n.axis_rotated?"ns-resize":"ew-resize":null).classed(Kr.eventRectsMultiple,o).classed(Kr.eventRectsSingle,!o).selectAll(`.${Kr.eventRect}`).data([0]).enter().append("rect");e.updateEventRect(c),e.updateEventType(c),c.call(e.getDraggableSelection()),i.eventRect=c,e.state.inputType==="touch"&&!i.svg.on("touchstart.eventRect")&&!e.hasArcType()&&e.bindTouchOnEventRect(),r.rendered&&e.updateEventRect(i.eventRect,!0)}if(!o){const l=e.getMaxDataCountTarget();(!n.data_xSort||s)&&l.sort((c,u)=>s?u.x-c.x:c.x-u.x),e.updateDataIndexByX(l),e.updateXs(l),(t=e.updatePointClass)==null||t.call(e,!0),r.eventReceiver.data=l}e.updateEventRectData()},bindTouchOnEventRect(){const t=this,{config:e,state:n,$el:{eventRect:r,svg:i}}=t,o=m=>{if(t.isMultipleX())t.selectRectForMultipleXs(m);else{const A=t.getDataIndexFromEvent(n.event);t.callOverOutForTouch(A),A===-1?t.unselectRect():t.selectRectForSingle(m,A)}},s=()=>{t.unselectRect(),t.callOverOutForTouch()},l=e.interaction_inputType_touch.preventDefault,c=Sa(l)&&l||!1,u=!isNaN(l)&&l||null;let f;const d=!c&&u===null,h=m=>{const A=m.type,C=m.changedTouches[0][`client${e.axis_rotated?"Y":"X"}`];A==="touchstart"?c?m.preventDefault():u!==null&&(f=C):A==="touchmove"&&(c||f===!0||u!==null&&Math.abs(f-C)>=u)&&(f=!0,m.preventDefault())};r.on("touchstart",m=>{n.event=m,t.updateEventRect()},{passive:d}).on("touchstart.eventRect touchmove.eventRect",m=>{if(n.event=m,!r.empty()&&r.classed(Kr.eventRect)){if(n.dragging||n.flowing||t.hasArcType()||m.touches.length>1)return;h(m),o(r.node())}else s()},{passive:d}).on("touchend.eventRect",m=>{n.event=m,!r.empty()&&r.classed(Kr.eventRect)&&(t.hasArcType()||!t.toggleShape||n.cancelClick)&&n.cancelClick&&(n.cancelClick=!1)},{passive:d}),i.on("touchstart",m=>{n.event=m;const{target:A}=m;A&&A!==r.node()&&s()},{passive:d})},updateEventRect(t,e=!1){const n=this,{state:r,$el:i}=n,{eventReceiver:o,width:s,height:l,rendered:c,resizing:u}=r,f=t||i.eventRect,d=()=>{if(o){const h=qd(i.chart.node());o.rect=un(f.node(),!0).toJSON(),o.rect.top+=h.y,o.rect.left+=h.x}};(!c||u||e)&&(f.attr("x",0).attr("y",0).attr("width",s).attr("height",l),(!c||e)&&f.classed(Kr.eventRect,!0)),d()},updateEventType(t){const e=this,n=Sa(t),r=n?e.$el.eventRect:t,i=n?t!==(r==null?void 0:r.datum().multipleX):!1;r&&(i&&(r==null||r.on("mouseover mousemove mouseout click",null)),e.isMultipleX()?e.generateEventRectsForMultipleXs(r):e.generateEventRectsForSingleX(r))},updateEventRectData(){const t=this,{config:e,scale:n,state:r}=t,i=n.zoom||n.x,o=e.axis_rotated,s=t.isMultipleX(),l=i==null?void 0:i.domain(),c=l?`${l[0]}_${l[1]}_${r.width}_${r.height}_${t.data.targets.length}_${r.dataGeneration}_${[...r.hiddenTargetIds].join(",")}`:null;if(c&&c===r._eventRectFingerprint)return;r._eventRectFingerprint=c;let u,f,d,h;if(t.updateEventType(s),s)u=0,f=0,d=r.width,h=r.height;else{let R,C;if(t.axis.isCategorized())R=t.getEventRectWidth(),C=P=>i(P.x)-R/2;else{const P=({index:z})=>({prev:t.getPrevX(z),next:t.getNextX(z)});R=z=>{const $=P(z),B=i.domain();let W;return $.prev===null&&$.next===null?W=o?r.height:r.width:$.prev===null?W=(i($.next)+i(z.x))/2:$.next===null?W=i(B[1])-(i($.prev)+i(z.x))/2:W=Math.max(0,(i($.next)-i($.prev))/2),W},C=z=>{const $=P(z);let B;return $.prev===null&&$.next===null?B=0:$.prev===null?B=i(i.domain()[0]):B=(i(z.x)+i($.prev))/2,B}}u=o?0:C,f=o?C:0,d=o?r.width:R,h=o?R:r.height}const{eventReceiver:m}=r,A=(R,C)=>le(R)?R(C):R;m.coords.splice(m.data.length),m.data.forEach((R,C)=>{m.coords[C]={x:A(u,R),y:A(f,R),w:A(d,R),h:A(h,R)}})},selectRectForSingle(t,e){var n,r;const i=this,{config:o,$el:{main:s,circle:l}}=i,c=o.data_selection_enabled,u=o.data_selection_grouped,f=o.data_selection_isselectable,d=o.tooltip_grouped,h=i.getAllValuesOnIndex(e);if(d&&(i.showTooltip(h,t),(n=i.showGridFocus)==null||n.call(i,h),!c||u))return;!l&&s.selectAll(`.${ze.EXPANDED}:not(.${bn.shape}-${e})`).classed(ze.EXPANDED,!1);const m=s.selectAll(`.${bn.shape}-${e}`).classed(ze.EXPANDED,!0).style("cursor",f?"pointer":null).filter(function(A){return i.isWithinShape(this,A)});m.empty()&&!d&&o.interaction_onout&&((r=i.hideGridFocus)==null||r.call(i),i.hideTooltip(),!u&&i.setExpand(e)),m.call(A=>{var R,C;const P=A.data();c&&(u||f!=null&&f.bind(i.api)(P))&&(t.style.cursor="pointer"),d||(i.showTooltip(P,t),(R=i.showGridFocus)==null||R.call(i,P),(C=i.unexpandCircles)==null||C.call(i),A.each(z=>i.setExpand(e,z.id)))})},selectRectForMultipleXs(t,e=!0){var n;const r=this,{config:i,state:o}=r,s=r.getTargetsToShow();if(o.dragging||r.hasArcType(s))return;const l=hr(o.event,t),c=r.findClosestFromTargets(s,l);if(e&&o.mouseover&&(!c||c.id!==o.mouseover.id)&&(i.data_onout.call(r.api,o.mouseover),o.mouseover=void 0),!c){r.unselectRect();return}const f=(r.isBubbleType(c)||r.isScatterType(c)||!i.tooltip_grouped?[c]:r.filterByX(s,c.x)).map(h=>r.addName(h));r.showTooltip(f,t),r.setExpand(c.index,c.id,!0),(n=r.showGridFocus)==null||n.call(r,f);const d=r.dist(c,l);(r.isBarType(c.id)||d<r.getPointSensitivity(c))&&(r.$el.eventRect.style("cursor","pointer"),e&&(!o.mouseover||o.mouseover.x!==c.x||o.mouseover.id!==c.id)&&(i.data_onover.call(r.api,c),o.mouseover=c))},unselectRect(){var t,e,n;const r=this,{state:i,$el:{circle:o,tooltip:s}}=r;if(i._lastTooltipMouse=null,i.isCanvasMode){(t=r.clearCanvasFocus)==null||t.call(r),s&&r.hideTooltip();return}(e=r.$el.eventRect)==null||e.style("cursor",null),(n=r.hideGridFocus)==null||n.call(r),s&&(r.hideTooltip(),r._handleLinkedCharts(!1)),o&&!r.isPointFocusOnly()&&r.unexpandCircles(),r.expandBarTypeShapes(!1)},generateEventRectsForSingleX(t){const e=this,{config:n,state:r}=e,{eventReceiver:i}=r,o=t.style("cursor",n.data_selection_enabled&&n.data_selection_grouped?"pointer":null).on("click",function(s){r.event=s;const{currentIdx:l,data:c}=i,u=c[l===-1?e.getDataIndexFromEvent(s):l];e.clickHandlerForSingleX.bind(this)(u,e)}).datum({multipleX:!1});if(r.inputType==="mouse"){const s=l=>{const c=l?e.getDataIndexFromEvent(l):i.currentIdx;return c>-1?i.data[c]:null};o.on("mouseover",l=>{r.event=l,e.updateEventRect(),Object.values(e.$el.axisTooltip).forEach(c=>c==null?void 0:c.style("display",null))}).on("mousemove",function(l){const c=s(l);if(r.event=l,!c)return;let{index:u}=c;const f=n.line_step_type;if(n.line_step_tooltipMatch&&e.hasType("step")&&/^step\-(before|after)$/.test(f)){const h=e.scale.zoom||e.scale.x,m=e.axis.xs[u],A=h.invert(hr(l,this)[0]);f==="step-after"&&A<m?u-=1:f==="step-before"&&A>m&&(u+=1)}e.showAxisGridFocus();const d=n.tooltip_grouped&&u===i.currentIdx;if(r.dragging||r.flowing||e.hasArcType()||d){if(n.tooltip_show&&d){const[h,m]=hr(l,this),A=r._lastTooltipMouse;(!A||Av(h-A[0],2)+Av(m-A[1],2)>=9)&&(r._lastTooltipMouse=[h,m],e.setTooltipPosition())}return}u!==i.currentIdx&&(e.setOverOut(!1,i.currentIdx),i.currentIdx=u),u===-1?e.unselectRect():e.selectRectForSingle(this,u),e.setOverOut(u!==-1,u)}).on("mouseout",l=>{r.event=l,!(!e.config||e.hasArcType()||i.currentIdx===-1||!n.interaction_onout)&&(e.hideAxisGridFocus(),e.unselectRect(),e.setOverOut(!1,i.currentIdx),i.currentIdx=-1)})}return o},clickHandlerForSingleX(t,e){const n=e,{config:r,state:i,$el:{main:o}}=n;if(!t||n.hasArcType()||i.cancelClick){i.cancelClick&&(i.cancelClick=!1);return}const{index:s}=t;o.selectAll(`.${bn.shape}-${s}`).each(function(l){var c;(r.data_selection_grouped||n.isWithinShape(this,l))&&((c=n.toggleShape)==null||c.call(n,this,l,s),r.data_onclick.bind(n.api)(l,this))})},generateEventRectsForMultipleXs(t){const e=this,{config:n,state:r}=e;t.on("click",function(i){r.event=i,e.clickHandlerForMultipleXS.bind(this)(e)}).datum({multipleX:!0}),r.inputType==="mouse"&&t.on("mouseover mousemove",function(i){r.event=i,e.selectRectForMultipleXs(this)}).on("mouseout",i=>{r.event=i,!(!e.config||e.hasArcType()||!n.interaction_onout)&&e.unselectRect()})},clickHandlerForMultipleXS(t){const e=t,{config:n,state:r}=e,i=e.getTargetsToShow();if(e.hasArcType(i))return;const o=hr(r.event,this),s=e.findClosestFromTargets(i,o);if(!s)return;const l=e.getPointSensitivity(s);(e.isBarType(s.id)||e.dist(s,o)<l)&&e.$el.main.selectAll(`.${bn.shapes}${e.getTargetSelectorSuffix(s.id)}`).selectAll(`.${bn.shape}-${s.index}`).each(function(){var c;(n.data_selection_grouped||e.isWithinShape(this,s))&&((c=e.toggleShape)==null||c.call(e,this,s,s.index),n.data_onclick.bind(e.api)(s,this))})}},JC={initClip(){const t=this,{clip:e,datetimeId:n}=t.state;e.id=`${n}-clip`,e.idXAxis=`${e.id}-xaxis`,e.idYAxis=`${e.id}-yaxis`,e.idGrid=`${e.id}-grid`,e.path=t.getClipPath(e.id),e.pathXAxis=t.getClipPath(e.idXAxis),e.pathYAxis=t.getClipPath(e.idYAxis),e.pathGrid=t.getClipPath(e.idGrid)},getClipPath(t){const e=this,{config:n}=e;return!n.clipPath&&/-clip$/.test(t)||!n.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!n.axis_y_clipPath&&/-clip-yaxis$/.test(t)?null:`url(#${t})`},appendClip(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath(t){const e=this,{config:n,state:{margin:r,width:i,height:o}}=e,s=n.axis_rotated,l=Math.max(30,r.left)-(s?0:20),c=(s?r.top+o+10:r.bottom)+20,u=s?-(1+l):-(l-1),f=-15,d=s?r.left+20:i+10+l;t.attr("x",u).attr("y",f).attr("width",d).attr("height",c)},setYAxisClipPath(t){const e=this,{config:n,state:{margin:r,width:i,height:o}}=e,s=n.axis_rotated,l=Math.max(30,r.left)-(s?20:0),c=n.axis_y_inner,u=c&&!s?n.axis_y_label.text?-20:-1:s?-(1+l):-(l-1),f=-(s?20:r.top),d=(s?i+15+l:r.left+20)+(c?20:0),h=(s?r.bottom+10:r.top+o)+10;t.attr("x",u).attr("y",f).attr("width",d).attr("height",h)},updateXAxisTickClip(){const t=this,{config:e,state:{clip:n,xAxisHeight:r},$el:{defs:i}}=t,o=t.getHorizontalAxisHeight("x");if(i&&!n.idXAxisTickTexts){const s=`${n.id}-xaxisticktexts`;t.appendClip(i,s),n.idXAxisTickTexts=s,n.pathXAxisTickTexts=t.getClipPath(n.idXAxisTickTexts)}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&o!==r&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=o},setXAxisTickClipWidth(){const t=this,{config:e,state:{current:{maxTickSize:n}}}=t,r=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&r){const i=Math.sin(Math.PI/180*Math.abs(r));n.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/i}else n.x.clipPath=null},setXAxisTickTextClipPathWidth(){const t=this,{state:{clip:e,current:n},$el:{svg:r}}=t;r&&r.select(`#${e.idXAxisTickTexts} rect`).attr("width",n.maxTickSize.x.clipPath).attr("height",30)}},QC={getAxisSize(t){const e=this,n=e.config.axis_rotated;return n&&t==="x"||!n&&/y2?/.test(t)?e.getAxisWidthByAxisId(t,!0):e.getHorizontalAxisHeight(t)},getAxisWidthByAxisId(t,e){var n,r;const i=this;if(i.axis){const o=(n=i.axis)==null?void 0:n.getAxisLabelPosition(t),{width:s}=i.axis.getMaxTickSize(t,e),l=s===0?.5:0;return s+(((r=i.config.padding)==null?void 0:r.mode)==="fit"?o.isInner?10+l:10:o.isInner?20+l:40)}else return 40},getHorizontalAxisHeight(t){var e,n;const r=this,{config:i,state:o}=r,{rotatedPadding:s,isLegendRight:l,isLegendInset:c}=o,u=i.axis_rotated,f=((e=i.padding)==null?void 0:e.mode)==="fit",d=i[`axis_${t}_inner`],h=i[`axis_${t}_label`].text,m=13;let A=((n=i.padding)==null?void 0:n.mode)==="fit"?d&&!h?t==="y"?1:0:20:30;if(t==="x"&&!i.axis_x_show)return 8;if(t==="x"&&ge(i.axis_x_height))return i.axis_x_height;if(t==="y"&&!i.axis_y_show)return i.legend_show&&!l&&!c?10:1;if(t==="y2"&&!i.axis_y2_show)return f?0:s.top;const R=r.axis.getMaxTickSize(t),C=Math.abs(i.axis_x_tick_rotate)>0&&(!i.axis_x_tick_autorotate||r.needToRotateXAxisTickTexts());return(i.axis_x_tick_multiline||C)&&R.height>m&&(A+=R.height-m),A+(r.axis.getAxisLabelPosition(t).isInner?0:10)+(t==="y2"&&!u?-10:0)},getEventRectWidth(){const t=this,{config:e,axis:n}=t,r=e.axis_x_inverted,i=n.x.tickInterval();return Math.max(0,r?Math.abs(i):i)},getAxisTickRotate(t){const e=this,{axis:n,config:r,state:i,$el:o}=e;let s=r[`axis_${t}_tick_rotate`];if(t==="x"){const l=n.isCategorized()||n.isTimeSeries();if(r.axis_x_tick_fit&&l){const c=r.axis_x_tick_count,u=i.current.maxTickSize.x.ticks.length;let f=0;if(c?f=c>u?u:c:u&&(f=u),f!==i.axis.x.tickCount){const{targets:d}=e.data;i.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(d,"min"),e.getXDomainMinMax(d,"max")],f)}i.axis.x.tickCount=f}(o.svg||i.isCanvasMode)&&r.axis_x_tick_autorotate&&r.axis_x_tick_fit&&!r.axis_x_tick_multiline&&!r.axis_x_tick_culling&&l&&(s=e.needToRotateXAxisTickTexts()?r.axis_x_tick_rotate:0)}return s},needToRotateXAxisTickTexts(){const t=this,{state:{axis:e,current:n,isLegendRight:r,legendItemWidth:i}}=t,o=r&&i,s=n.width-o-t.getCurrentPaddingByDirection("left")-t.getCurrentPaddingByDirection("right"),l=e.x.tickCount+e.x.padding.left+e.x.padding.right,{width:c}=t.axis.getMaxTickSize("x"),u=l?s/l:0;return c>u}},_C={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:[]},qC={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:[]},t2={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:[]},e2=Object.defineProperty,Ev=Object.getOwnPropertySymbols,n2=Object.prototype.hasOwnProperty,r2=Object.prototype.propertyIsEnumerable,Cv=(t,e,n)=>e in t?e2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,cu=(t,e)=>{for(var n in e||(e={}))n2.call(e,n)&&Cv(t,n,e[n]);if(Ev)for(var n of Ev(e))r2.call(e,n)&&Cv(t,n,e[n]);return t},a2=cu(cu(cu({axis_evalTextSize:!0,axis_rotated:!1,axis_tooltip:!1},_C),qC),t2),i2={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1};const o2=[fC,dC,hC],Iv={axis:YC,clip:JC,eventrect:ZC,sizeAxis:QC},Rv={optDataAxis:i2,optAxis:a2};function wv(t){return Object.keys(t).map(e=>t[e])}function Ov(t=[],e=[]){yn(Er.prototype,wv(Iv).concat(t)),yn(Kn.prototype,o2),Fa.setOptions(wv(Rv).concat(e))}function uo(t=[],e=[]){Ov(t,e)}function ea(t,e=[]){const n=Array.isArray(t)?t:t?[t]:[];Ov([vi,Bs,cC].concat(n),[za,uC].concat(e))}let Pv=()=>(ea(hi,[gi]),(Pv=()=>jt.AREA)()),Mv=()=>(ea(hi,[gi]),(Mv=()=>jt.AREA_LINE_RANGE)()),Lv=()=>(ea(hi,[gi]),(Lv=()=>jt.AREA_STEP_RANGE)()),Dv=()=>(ea(hi,[gi,eu]),(Dv=()=>jt.AREA_SPLINE)()),Fv=()=>(ea(hi,[gi,eu]),(Fv=()=>jt.AREA_SPLINE_RANGE)()),Nv=()=>(ea(hi,[gi]),(Nv=()=>jt.AREA_STEP)());function uu(t){const e=this.config.bar_connectLine,n=(e==null?void 0:e[t])||e;return/^(start|end)\-(start|end)$/.test(n)?n:null}var s2={initBar(){const{$el:t,config:e,state:{clip:n}}=this;t.bar=t.main.select(`.${ze.chart}`),t.bar=e.bar_front?t.bar.append("g"):t.bar.insert("g",":first-child"),t.bar.attr("class",nr.chartBars).call(this.setCssRule(!1,`.${nr.chartBars}`,["pointer-events:none"])),e.clipPath===!1&&(e.bar_radius||e.bar_radius_ratio)&&t.bar.attr("clip-path",n.pathXAxis.replace(/#[^)]*/,`#${n.id}`))},updateTargetsForBar(t){const e=this,{config:n}=e,r=e.getClass("bars",!0),i=n.interaction_enabled&&n.data_selection_isselectable;jc.call(e,t,{type:"Bar",elKey:"bar",containerClass:nr.chartBars,itemClass:nr.chartBar,initFn:e.initBar}).append("g").attr("class",r).style("cursor",s=>{var l;return(l=i==null?void 0:i.bind)!=null&&l.call(i,e.api)(s)?"pointer":null}).call(s=>{e.setCssRule(!0,` .${nr.bar}`,["fill"],e.color)(s),s.each(function(l){uu.call(e,l.id)&&Ut(this).append("path").attr("class",nr.barConnectLine)})})},updateBar(t,e=!1){const n=this;if(n.state.isCanvasMode)return;const{config:r,$el:i,$T:o}=n,s=e?i.subchart:i,l=n.getClass("bar",!0),c=n.initialOpacity.bind(n);r.bar_linearGradient&&n.updateLinearGradient();const u=s.main.selectAll(`.${nr.bars}`).selectAll(`.${nr.bar}`).data(n.labelishData.bind(n));o(u.exit(),t).style("opacity","0").remove(),s.bar=u.enter().append("path").attr("class",l).style("fill",n.updateBarColor.bind(n)).merge(u).style("opacity",c),n.setRatioForGroupedData(s.bar.data())},updateBarColor(t){const e=this,n=e.getStylePropValue(e.color);return vg.call(e,t,"bar_linearGradient",n||(()=>null))},redrawBar(t,e,n=!1){const r=this;if(r.state.isCanvasMode)return[];const{bar:i}=n?r.$el.subchart:r.$el,o=[],s=new Map;return[r.$T(i,e,Rr()).attr("d",function(l,c,u){const f=(ge(l.value)||r.isBarRangeType(l))&&t(l,c);let d=s.get(l.id);if(d===void 0&&(d=uu.call(r,l.id),s.set(l.id,d)),f.length>1&&o.push(f[1]),c===u.length-1&&o.length){const h=r.$T(Ut(this.parentNode.querySelector(`.${nr.barConnectLine}`)),e,Rr());r.updateConnectLine(h,d,o),o.splice(0)}return f[0]}).style("fill",r.updateBarColor.bind(r)).style("clip-path",l=>l.clipPath).style("opacity",null)]},generateDrawBar(t,e){const n=this,{config:r}=n,i=n.generateGetBarPoints(t,e),o=Wl(n),s=o?Vl(n):new Set;return(l,c)=>{const u=i(l,c),{indexX:f,indexY:d,isNegative:h,pos:m,radius:A,clipPath:R}=jl(n,l,u,o,s,n.isStackingRadiusData.bind(n)),C=["",""];if(l.clipPath=R,o){const $=`a${A} ${A} ${h?"1 0 0":"0 0 1"} `;C[d]=`${$}${A},${A}`,C[f]=`${$}${[-A,A][r.axis_rotated?"sort":"reverse"]()}`,h&&C.reverse()}const P=r.axis_rotated?`H${m} ${C[0]}V${u[2][d]-A} ${C[1]}H${u[3][f]}`:`V${m} ${C[0]}H${u[2][f]-A} ${C[1]}V${u[3][d]}`,z=[`M${u[0][f]},${u[0][d]}${P}z`];return uu.call(n,l.id)&&z.push(r.axis_rotated?{x:u[0][f],y:u[0][d],width:u[0][f]-m,height:u[2][d]-u[0][d]}:{x:u[0][f],y:m,width:u[2][f]-u[0][f],height:u[3][d]-m}),z}},isStackingRadiusData(t){const e=this,{$el:n,config:r,data:i,state:o}=e,{id:s,index:l,value:c}=t;if(o.hiddenTargetIds.has(s)){const h=n.bar.filter(m=>m.id===s&&m.value===c);return!h.empty()&&/a\d+/i.test(h.attr("d"))}const u=r.data_groups.find(h=>h.indexOf(s)>-1),d=e.orderTargets(e.filterTargetsToShow(i.targets.filter(e.isBarType,e))).filter(h=>u.indexOf(h.id)>-1).map(h=>{const m=h.values[l];if(m&&(ge(c)&&c>0?m.value>0:m.value<0))return m}).filter(Boolean).map(h=>h.id);return c!==0&&d.indexOf(s)===d.length-1},updateConnectLine(t,e,n){const r=n.map((i,o,s)=>{const l=this.config.axis_rotated,c=/^start-(start|end)$/.test(e),u=/^end-(start|end)$/.test(e),f=[],d=l?u?i.x-i.width:i.x:i.x+i.width,h=l||c?i.y+i.height:i.y;return o===0?f.push(`${d},${h}`):(f.push(l?`L${i.x-(/\w+-end$/.test(e)?i.width:0)},${i.y}`:`L${i.x},${i.y+(/\w+-start$/.test(e)?i.height:0)}`),o<s.length-1&&f.push(`M${d},${h}`)),f.join(" ")});t.attr("d",`M${r.join("")}z`)}},l2={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};let $v=()=>(uo([s2,vi],[l2,za]),($v=()=>jt.BAR)());var c2={initBubble(){const t=this,{config:e}=t;t.hasType("bubble")&&(e.point_show=!0,e.point_type="circle")},getBaseLength(){const t=this,{width:e,height:n}=t.state,r=Ue.bubbleBaseLength;let i=t.cache.get(r);return i||t.cache.add(r,i=Tr("min",[e,n])),i},getBubbleR(t){const e=this;let n=e.config.bubble_maxR;le(n)?n=n.bind(e.api)(t):ge(n)||(n=e.getBaseLength()/(e.getMaxDataCount()*2)+12);const r=Ue.bubbleMaxValue;let i=e.cache.get(r);i===null&&e.cache.add(r,i=Tr("max",e.getMinMaxData().max.map(l=>e.isBubbleZType(l)?e.getBubbleZData(l.value,"y"):je(l.value)?l.value.mid:l.value)));const o=n*n*Math.PI,s=(e.isBubbleZType(t)?e.getBubbleZData(t.value,"z"):t.value)*(o/i);return Math.sqrt(s/Math.PI)},getBubbleZData(t,e){return je(t)?t[e]:t[e==="y"?0:1]}},u2=c2,f2={bubble_maxR:35,bubble_zerobased:!1};let Bv=()=>(uo([vi,Bs,u2],[f2,za]),(Bv=()=>jt.BUBBLE)());var d2=Object.defineProperty,zv=Object.getOwnPropertySymbols,h2=Object.prototype.hasOwnProperty,g2=Object.prototype.propertyIsEnumerable,Uv=(t,e,n)=>e in t?d2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v2=(t,e)=>{for(var n in e||(e={}))h2.call(e,n)&&Uv(t,n,e[n]);if(zv)for(var n of zv(e))g2.call(e,n)&&Uv(t,n,e[n]);return t},p2={generateGetCandlestickPoints(t,e=!1){const n=this,r=e?n.axis.subX:n.axis.x,i=n.getIndicesMax(t)+1,o=n.getBarW("candlestick",r,i),s=n.getShapeX(o,t,!!e),l=n.getShapeY(!!e),c=n.getShapeOffset(n.isCandlestickType,t,!!e),u=n.getYScaleById.bind(n);return(f,d)=>{const h=u.call(n,f.id,e)(n.getShapeYMin(f.id)),m=c(f,d)||h,A=ge(o)?o:o[f.id]||o._$width,R=n.getCandlestickData(f);let C;if(R&&ge(R.open)&&ge(R.close)){const P={start:s(f),end:0};P.end=P.start+A;const z={start:l(R.open),end:l(R.close)},$={x:P.start+A/2,high:l(R.high),low:l(R.low)},B=h-m;z.start-=B,z.end-=B,$.high-=B,$.low-=B,C=[[P.start,z.start],[P.end,z.end],[$.x,$.low,$.high]]}else C=[[0,0],[0,0],[0,0,0]];return C}},getCandlestickData({value:t}){let e;if(tn(t)){const[n,r,i,o,s=!1]=t;e={open:n,high:r,low:i,close:o},s!==!1&&(e.volume=s)}else je(t)&&(e=v2({},t));return e&&(e._isUp=e.close>=e.open),e||null}},m2=Object.defineProperty,x2=Object.defineProperties,y2=Object.getOwnPropertyDescriptors,kv=Object.getOwnPropertySymbols,T2=Object.prototype.hasOwnProperty,b2=Object.prototype.propertyIsEnumerable,Xv=(t,e,n)=>e in t?m2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,S2=(t,e)=>{for(var n in e||(e={}))T2.call(e,n)&&Xv(t,n,e[n]);if(kv)for(var n of kv(e))b2.call(e,n)&&Xv(t,n,e[n]);return t},A2=(t,e)=>x2(t,y2(e)),E2=A2(S2({},p2),{initCandlestick(){pg.call(this,{elKey:"candlestick",className:Yr.chartCandlesticks})},updateTargetsForCandlestick(t){jc.call(this,t,{type:"Candlestick",elKey:"candlestick",containerClass:Yr.chartCandlesticks,itemClass:Yr.chartCandlestick,initFn:this.initCandlestick,withFocus:!1,withStyles:!1}).style("pointer-events","none")},updateCandlestick(t,e=!1){const n=this,{$el:r,$T:i}=n,o=e?r.subchart:r,s=n.getClass("candlestick",!0),l=n.initialOpacity.bind(n),c=o.main.selectAll(`.${Yr.chartCandlestick}`).selectAll(`.${Yr.candlestick}`).data(n.labelishData.bind(n));i(c.exit(),t).style("opacity","0").remove();const u=c.enter().filter(f=>f.value).append("g").attr("class",s);u.append("line"),u.append("path"),o.candlestick=c.merge(u).style("opacity",l)},generateDrawCandlestick(t,e){const n=this,{config:r}=n,i=n.generateGetCandlestickPoints(t,e),o=r.axis_rotated,s=r.candlestick_color_down;return(l,c,u)=>{const f=i(l,c),d=n.getCandlestickData(l),h=d==null?void 0:d._isUp,m=+o,A=+!m;u.classed&&u.classed(Yr[h?"valueUp":"valueDown"],!0);const R=o?`H${f[1][1]} V${f[1][0]} H${f[0][1]}`:`V${f[1][1]} H${f[1][0]} V${f[0][1]}`;u.select("path").attr("d",`M${f[0][m]},${f[0][A]}${R}z`).style("fill",z=>(h?n.color(z):je(s)?s[z.id]:s)||n.color(z));const C=u.select("line"),P=o?{x1:f[2][1],x2:f[2][2],y1:f[2][0],y2:f[2][0]}:{x1:f[2][0],x2:f[2][0],y1:f[2][1],y2:f[2][2]};for(const z in P)C.attr(z,P[z])}},redrawCandlestick(t,e,n=!1){const r=this,{$el:i,$T:o}=r,{candlestick:s}=n?i.subchart:i,l=Rr(!0);return[s.each(function(c,u){const f=o(Ut(this),e,l);t(c,u,f)}).style("opacity",null)]}}),C2={candlestick_width:void 0,candlestick_width_ratio:.6,candlestick_width_max:void 0,candlestick_color_down:"red"};let Gv=()=>(uo([E2,vi],[C2,za]),(Gv=()=>jt.CANDLESTICK)());var Vs={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},I2={donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_line:!1,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};function R2(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function w2(t){return t}function O2(){var t=w2,e=R2,n=null,r=Ze(0),i=Ze(Is),o=Ze(0);function s(l){var c,u=(l=Hl(l)).length,f,d,h=0,m=new Array(u),A=new Array(u),R=+r.apply(this,arguments),C=Math.min(Is,Math.max(-Is,i.apply(this,arguments)-R)),P,z=Math.min(Math.abs(C)/u,o.apply(this,arguments)),$=z*(C<0?-1:1),B;for(c=0;c<u;++c)(B=A[m[c]=c]=+t(l[c],c,l))>0&&(h+=B);for(e!=null?m.sort(function(W,H){return e(A[W],A[H])}):n!=null&&m.sort(function(W,H){return n(l[W],l[H])}),c=0,d=h?(C-u*$)/h:0;c<u;++c,R=P)f=m[c],B=A[f],P=R+(B>0?B*d:0)+$,A[f]={data:l[f],index:c,value:B,startAngle:R,endAngle:P,padAngle:z};return A}return s.value=function(l){return arguments.length?(t=typeof l=="function"?l:Ze(+l),s):t},s.sortValues=function(l){return arguments.length?(e=l,n=null,s):e},s.sort=function(l){return arguments.length?(n=l,e=null,s):n},s.startAngle=function(l){return arguments.length?(r=typeof l=="function"?l:Ze(+l),s):r},s.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:Ze(+l),s):i},s.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:Ze(+l),s):o},s}function P2(t){return t.innerRadius}function M2(t){return t.outerRadius}function L2(t){return t.startAngle}function D2(t){return t.endAngle}function F2(t){return t&&t.padAngle}function N2(t,e,n,r,i,o,s,l){var c=n-t,u=r-e,f=s-i,d=l-o,h=d*c-f*u;if(!(h*h<Xn))return h=(f*(e-o)-d*(t-i))/h,[t+h*c,e+h*u]}function js(t,e,n,r,i,o,s){var l=t-n,c=e-r,u=(s?o:-o)/fi(l*l+c*c),f=u*c,d=-u*l,h=t+f,m=e+d,A=n+f,R=r+d,C=(h+A)/2,P=(m+R)/2,z=A-h,$=R-m,B=z*z+$*$,W=i-o,H=h*R-A*m,J=($<0?-1:1)*fi(aA(0,W*W*B-H*H)),q=(H*$-z*J)/B,at=(-H*z-$*J)/B,et=(H*$+z*J)/B,ot=(-H*z+$*J)/B,lt=q-C,ft=at-P,_=et-C,dt=ot-P;return lt*lt+ft*ft>_*_+dt*dt&&(q=et,at=ot),{cx:q,cy:at,x01:-f,y01:-d,x11:q*(i/W-1),y11:at*(i/W-1)}}function Wv(){var t=P2,e=M2,n=Ze(0),r=null,i=L2,o=D2,s=F2,l=null,c=Zl(u);function u(){var f,d,h=+t.apply(this,arguments),m=+e.apply(this,arguments),A=i.apply(this,arguments)-Cs,R=o.apply(this,arguments)-Cs,C=eg(R-A),P=R>A;if(l||(l=f=c()),m<h&&(d=m,m=h,h=d),!(m>Xn))l.moveTo(0,0);else if(C>Is-Xn)l.moveTo(m*Ba(A),m*Fr(A)),l.arc(0,0,m,A,R,!P),h>Xn&&(l.moveTo(h*Ba(R),h*Fr(R)),l.arc(0,0,h,R,A,P));else{var z=A,$=R,B=A,W=R,H=C,J=C,q=s.apply(this,arguments)/2,at=q>Xn&&(r?+r.apply(this,arguments):fi(h*h+m*m)),et=kc(eg(m-h)/2,+n.apply(this,arguments)),ot=et,lt=et,ft,_;if(at>Xn){var dt=ng(at/h*Fr(q)),ut=ng(at/m*Fr(q));(H-=dt*2)>Xn?(dt*=P?1:-1,B+=dt,W-=dt):(H=0,B=W=(A+R)/2),(J-=ut*2)>Xn?(ut*=P?1:-1,z+=ut,$-=ut):(J=0,z=$=(A+R)/2)}var xt=m*Ba(z),bt=m*Fr(z),Rt=h*Ba(W),Et=h*Fr(W);if(et>Xn){var Zt=m*Ba($),fe=m*Fr($),me=h*Ba(B),xe=h*Fr(B),Te;if(C<io)if(Te=N2(xt,bt,me,xe,Zt,fe,Rt,Et)){var Fe=xt-Te[0],Ie=bt-Te[1],ke=Zt-Te[0],Jt=fe-Te[1],Ae=1/Fr(iA((Fe*ke+Ie*Jt)/(fi(Fe*Fe+Ie*Ie)*fi(ke*ke+Jt*Jt)))/2),Le=fi(Te[0]*Te[0]+Te[1]*Te[1]);ot=kc(et,(h-Le)/(Ae-1)),lt=kc(et,(m-Le)/(Ae+1))}else ot=lt=0}J>Xn?lt>Xn?(ft=js(me,xe,xt,bt,m,lt,P),_=js(Zt,fe,Rt,Et,m,lt,P),l.moveTo(ft.cx+ft.x01,ft.cy+ft.y01),lt<et?l.arc(ft.cx,ft.cy,lt,kn(ft.y01,ft.x01),kn(_.y01,_.x01),!P):(l.arc(ft.cx,ft.cy,lt,kn(ft.y01,ft.x01),kn(ft.y11,ft.x11),!P),l.arc(0,0,m,kn(ft.cy+ft.y11,ft.cx+ft.x11),kn(_.cy+_.y11,_.cx+_.x11),!P),l.arc(_.cx,_.cy,lt,kn(_.y11,_.x11),kn(_.y01,_.x01),!P))):(l.moveTo(xt,bt),l.arc(0,0,m,z,$,!P)):l.moveTo(xt,bt),!(h>Xn)||!(H>Xn)?l.lineTo(Rt,Et):ot>Xn?(ft=js(Rt,Et,Zt,fe,h,-ot,P),_=js(xt,bt,me,xe,h,-ot,P),l.lineTo(ft.cx+ft.x01,ft.cy+ft.y01),ot<et?l.arc(ft.cx,ft.cy,ot,kn(ft.y01,ft.x01),kn(_.y01,_.x01),!P):(l.arc(ft.cx,ft.cy,ot,kn(ft.y01,ft.x01),kn(ft.y11,ft.x11),!P),l.arc(0,0,h,kn(ft.cy+ft.y11,ft.cx+ft.x11),kn(_.cy+_.y11,_.cx+_.x11),P),l.arc(_.cx,_.cy,ot,kn(_.y11,_.x11),kn(_.y01,_.x01),!P))):l.arc(0,0,h,W,B,P)}if(l.closePath(),f)return l=null,f+""||null}return u.centroid=function(){var f=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-io/2;return[Ba(d)*f,Fr(d)*f]},u.innerRadius=function(f){return arguments.length?(t=typeof f=="function"?f:Ze(+f),u):t},u.outerRadius=function(f){return arguments.length?(e=typeof f=="function"?f:Ze(+f),u):e},u.cornerRadius=function(f){return arguments.length?(n=typeof f=="function"?f:Ze(+f),u):n},u.padRadius=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ze(+f),u):r},u.startAngle=function(f){return arguments.length?(i=typeof f=="function"?f:Ze(+f),u):i},u.endAngle=function(f){return arguments.length?(o=typeof f=="function"?f:Ze(+f),u):o},u.padAngle=function(f){return arguments.length?(s=typeof f=="function"?f:Ze(+f),u):s},u.context=function(f){return arguments.length?(l=f==null?null:f,u):l},u}const $2=15,Vv=20,jv=.35;function B2(t=!1){const e=this;return["donut","pie","polar","gauge"].find(n=>e.hasType(n)&&!(n==="gauge"&&t&&e.hasMultiArcGauge()))}function Hv(){const t=this,{config:e}=t,n=B2.call(t,!0),r=n&&e[`${n}_label_line`],i=Qn(r),o=(c,u,f)=>f,s={show:r===!0||i&&(r==null?void 0:r.show)!==!1,distance:i&&(r==null?void 0:r.distance)||Vv};if(r===!0)return{chartType:n,line:s,text:{formatter:o}};if(!i)return{chartType:n,line:{show:!1,distance:Vv},text:{formatter:null}};let l=o;return le(r.text)?l=r.text:r.text===!1&&(l=null),{chartType:n,line:s,text:{formatter:l}}}function z2(t,e){const n=this,{state:r}=n,i=n.updateAngle(t);if(!i)return null;let{outerRadius:o}=n.getRadius(t),s=o;n.hasType("polar")&&(s=n.getPolarOuterRadius(t,o),o=r.radius);let l=(i.startAngle+i.endAngle)/2;Math.abs(i.endAngle-i.startAngle-2*Math.PI)<.01&&(l=Math.PI/2);const u=Math.sin(l),f=-Math.cos(l),d={x:u*s,y:f*s},h=o+$2,m={x:u*h,y:f*h},A=u>=0,R={x:m.x+e*(A?1:-1),y:m.y};return{startPoint:d,breakPoint:m,endPoint:R,isRight:A,midAngle:l}}function Yv(){return Hv.call(this).line.show}function U2(t){const e=this,{$el:{arcs:n},$T:r}=e,{line:i,text:o}=Hv.call(e),s=i.distance;let l=null;n.selectAll(`.${Ye.chartArc}`).each(function(c){var u,f,d;const h=Ut(this),m=z2.call(e,c,s),{ratio:A,meetsThreshold:R,updated:C}=(u=c._cache)!=null?u:{};if(!C||!m)return;const P=e.isTargetToShow(c.data.id)&&R,{startPoint:z,breakPoint:$,endPoint:B,isRight:W}=m,H=`${z.x},${z.y} ${$.x},${$.y} ${B.x},${B.y}`;if(i.show){let q=h.select(`.${Ye.arcLabelLine}`);q.empty()&&(q=h.append("polyline").attr("class",Ye.arcLabelLine)),r(q,t).attr("points",H).style("stroke",e.color(c.data)).style("opacity",P?null:"0")}let J=h.select(`.${Ye.arcLabelLineText}`);if(J.empty()&&(J=h.append("text").attr("class",Ye.arcLabelLineText).style("pointer-events","none")),P){const{value:q}=C,{id:at}=c.data,et=((d=(f=o.formatter)!=null?f:e.getArcLabelConfig("format"))!=null?d:e.defaultArcValueFormat)(q,A,at).toString();ii(J,et,[-1,1],!1);const ot={x:B.x+5*(W?1:-1),y:B.y};J.style("text-anchor",W?"start":"end");const lt=J.node(),ft=lt==null?void 0:lt.querySelectorAll("tspan");if(l===null&&(l=parseFloat(ce.getComputedStyle(lt).fontSize)||12),ft&&ft.length>1){const dt=(ft.length-3)/2;ot.y+=(-dt+jv)*l}else ot.y+=jv*l;r(J,t).attr("transform",`translate(${ot.x},${ot.y})`).style("opacity",null).style("fill",e.updateTextColor.bind(e)(c))}else r(J,t).style("opacity","0")})}var k2=Object.defineProperty,X2=Object.defineProperties,G2=Object.getOwnPropertyDescriptors,Kv=Object.getOwnPropertySymbols,W2=Object.prototype.hasOwnProperty,V2=Object.prototype.propertyIsEnumerable,Zv=(t,e,n)=>e in t?k2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j2=(t,e)=>{for(var n in e||(e={}))W2.call(e,n)&&Zv(t,n,e[n]);if(Kv)for(var n of Kv(e))V2.call(e,n)&&Zv(t,n,e[n]);return t},H2=(t,e)=>X2(t,G2(e));const fu=["donut","gauge","pie","polar"];function Y2(t){return["donut","pie","polar","gauge"].find(e=>t.hasType(e))}function K2(t,e,n,r){var i,o;const{config:s,state:{radiusExpanded:l}}=t,c=n.endAngle-Math.PI/2,u=Math.sin(c),f={x:Math.cos(c)*(l+(r?5:25)),y:u*(l+15-Math.abs(u*10))+3};if(r){const d=s.arc_rangeText_position;if(d){const h=s.arc_rangeText_values,m=le(d)?d(h[e.index]):d;f.x+=(i=m==null?void 0:m.x)!=null?i:0,f.y+=(o=m==null?void 0:m.y)!=null?o:0}}return f}function Z2(t,e,n,r){const{config:i}=t,o=Y2(t);let s=o?i[`${o}_label_ratio`]:void 0;if(s)s=le(s)?s.bind(t.api)(e,n,r):s;else{const d=36/n,h=d>.375;s=n&&r?(h?1.175-d:.8)*n/r:0}return s}function J2(t,e,n){let{outerRadius:r}=t.getRadius(e);t.hasType("polar")&&(r=t.getPolarOuterRadius(e,r));const[i,o]=t.svgArc.centroid(n).map(c=>isNaN(c)?0:c),s=Math.sqrt(i*i+o*o),l=Z2(t,e,r,s);return{pos:{x:i,y:o},ratio:l}}function Jv(t=0){const e=this,{config:n,state:r}=e,i=e.hasMultiArcGauge(),o=r.gaugeArcWidth/e.getTargetsToShow().length,s=t?Math.min(r.radiusExpanded*t-r.radius,o*.8-(1-t)*100):0;return{inner(l){const{innerRadius:c}=e.getRadius(l);return i?r.radius-o*(l.index+1):ge(c)?c:0},outer(l){const{outerRadius:c}=e.getRadius(l);let u;if(i)u=r.radius-o*l.index+s;else if(e.hasType("polar")&&!t)u=e.getPolarOuterRadius(l,c);else if(u=c,t){let{radiusExpanded:f}=r;r.radius!==c&&(f-=Math.abs(r.radius-c)),u=f*t}return u},corner(l,c){const{arc_cornerRadius_ratio:u=0,arc_cornerRadius:f=0}=n,{data:{id:d},value:h}=l;let m;return u?m=u*c:m=ge(f)?f:f.call(e.api,d,h,c),m}}}function du(t){return function(e){const n=({startAngle:i=0,endAngle:o=0,padAngle:s=0})=>({startAngle:i,endAngle:o,padAngle:s}),r=Wa(n(this._current),n(e));return this._current=e,function(i){const o=r(i),{data:s,index:l,value:c}=e;return t(H2(j2({},o),{data:s,index:l,value:c}))}}}var Q2={initPie(){const t=this,{config:e}=t,n=e.data_type,r=e[`${n}_padding`],i=e[`${n}_startingAngle`]||0,o=(r?r*.01:e[`${n}_padAngle`])||0;t.pie=O2().startAngle(i).endAngle(i+2*Math.PI).padAngle(o).value(s=>{var l,c;return(c=(l=s.values)==null?void 0:l.reduce((u,f)=>u+f.value,0))!=null?c:s}).sort(t.getSortCompareFn.bind(t)(!0))},updateRadius(){const t=this,{config:e,state:n}=t,r=e.data_type,i=e[`${r}_padding`],o=e.gauge_width||e.donut_width,s=t.getTargetsToShow().length*e.gauge_arcs_minWidth,l=.85,c=Yv.call(t)?l:1;n.radiusExpanded=Math.min(n.arcWidth,n.arcHeight)/2*(t.hasMultiArcGauge()&&e.gauge_label_show?l:c),n.radius=n.radiusExpanded*.95,n.innerRadiusRatio=o?(n.radius-o)/n.radius:.6,n.gaugeArcWidth=o||(s<=n.radius-n.innerRadius?n.radius-n.innerRadius:s<=n.radius?s:n.radius);const u=e.pie_innerRadius||(i?i*(n.innerRadiusRatio+.1):0);n.outerRadius=e.pie_outerRadius,n.innerRadius=t.hasType("donut")||t.hasType("gauge")?n.radius*n.innerRadiusRatio:u},getRadius(t){const e=this,n=t==null?void 0:t.data;let{innerRadius:r,outerRadius:i}=e.state;return!ge(r)&&n&&(r=r[n.id]||0),je(i)&&n&&n.id in i?i=i[n.id]:ge(i)||(i=e.state.radius),{innerRadius:r,outerRadius:i}},updateArc(){const t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength(){const t=this,{config:e}=t,n=e.gauge_arcLength*3.6;let r=2*(n/360);return n<-360?r=-2:n>360&&(r=2),r*Math.PI},getStartingAngle(){const t=this,{config:e}=t,n=e.data_type,r=t.hasType("gauge")?e.gauge_fullCircle:!1,i=-1*Math.PI/2,o=Math.PI/2;let s=e[`${n}_startingAngle`]||0;return!r&&s<=i?s=i:!r&&s>=o?s=o:(s>Math.PI||s<-1*Math.PI)&&(s=Math.PI),s},updateAngle(t,e=!1){var n;const r=this,{config:i,state:o}=r,s=e&&r.hasType("gauge");let{pie:l}=r,c=t,u=!1;if(!i)return null;const f=r.getStartingAngle(),d=i.gauge_fullCircle||e&&!s?r.getArcLength():f*-2,h=c.data&&r.isGaugeType(c.data)&&!r.hasMultiArcGauge();if(h){const{gauge_min:m,gauge_max:A}=i,R=r.getTotalDataSum(o.rendered),C=d*((R-m)/(A-m));l=l.startAngle(f).endAngle(C+f)}if(e===!1){let m;if(h)m=l(r.filterTargetsToShow());else{const A="$arcPieLayout";let R=r.cache.get(A);(!R||R.generation!==o.redrawGeneration)&&(R={generation:o.redrawGeneration,layout:l(r.filterTargetsToShow())},r.cache.add(A,R)),m=R.layout}m.forEach((A,R)=>{var C;!u&&A.data.id===((C=c.data)==null?void 0:C.id)&&(u=!0,c=A,c.index=R)})}if(isNaN(c.startAngle)&&(c.startAngle=0),isNaN(c.endAngle)&&(c.endAngle=c.startAngle),e||c.data&&(i.gauge_enforceMinMax||r.hasMultiArcGauge())){const{gauge_min:m,gauge_max:A}=i,R=e&&!s?r.getTotalDataSum(o.rendered):A,C=d/(R-m),P=(n=c.value)!=null?n:0,z=P<m?0:P<R?P-m:R-m;c.startAngle=f,c.endAngle=f+C*z}return u||e?c:null},getSvgArc(){const t=this,{inner:e,outer:n,corner:r}=Jv.call(t),i=Wv().innerRadius(e).outerRadius(n),o=function(s,l){var c;let u="M 0 0";if(s.value||s.data){const f=l?s:(c=t.updateAngle(s))!=null?c:null;f&&(u=i.cornerRadius(r(f,n(f)))(f))}return u};return o.centroid=i.centroid,o},getSvgArcExpanded(t=1){const e=this,{inner:n,outer:r,corner:i}=Jv.call(e,t),o=Wv().innerRadius(n).outerRadius(r);return s=>{const l=e.updateAngle(s),c=r(l);let u=0;return l&&(u=i(l,c)),l&&o.cornerRadius(u)(l)||"M 0 0"}},getArc(t,e,n){return n||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},redrawArcRangeText(){const t=this,{config:e,$el:{arcs:n},state:r,$T:i}=t,o=e.arc_rangeText_format,s=t.hasType("gauge")&&e.arc_rangeText_fixed;let l=e.arc_rangeText_values;if(l!=null&&l.length){const c=e.arc_rangeText_unit==="%",u=t.getTotalDataSum(r.rendered);c&&(l=l.map(h=>u/100*h));const f=t.pie(l).map((h,m)=>(h.index=m,h));let d=n.selectAll(`.${Ye.arcRange}`).data(l);d.exit().remove(),d=i(d.enter().append("text").attr("class",Ye.arcRange).style("text-anchor","middle").style("pointer-events","none").style("opacity","0").text(h=>{const m=c?h/u*100:h;return le(o)?o(m):`${m}${c?"%":""}`}).merge(d)),(!r.rendered||r.rendered&&!s)&&u>0&&d.attr("transform",function(h,m){return t.transformForArcLabel(this,f[m],!0)}),d.style("opacity",h=>!s&&(h>u||u===0)?"0":null)}},transformForArcLabel(t,e,n=!1){const r=this,i=r.updateAngle(e,n);if(!i)return"";let o,s=1;if(n||r.hasMultiArcGauge())o=K2(r,e,i,n);else if(!r.hasType("gauge")||r.data.targets.length>1){const l=J2(r,e,i);o=l.pos,s=l.ratio}else return"";return Jh.call(r,t,o),`translate(${o.x*s},${o.y*s})`},convertToArcData(t){return this.addName({id:"data"in t?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel(t){var e;const n=this,r=n.hasType("gauge"),i=(e=fu.filter(n.hasType.bind(n)))==null?void 0:e[0];n.shouldShowArcLabel()&&t.style("fill",n.updateTextColor.bind(n)).attr("filter",o=>n.updateTextBGColor.bind(n)(o,n.config.data_labels_backgroundColors)).each(function(o){const s=Ut(this),l=n.updateAngle(o),c=n.getRatio("arc",l),u=$c.call(n,c,i);if(o._cache={updated:l,ratio:c,meetsThreshold:u},u){const{value:f}=l||o,d=(n.getArcLabelConfig("format")||n.defaultArcValueFormat)(f,c,o.data.id).toString();ii(s,d,[-1,1],r)}else s.text("")})},expandArc(t){const e=this,{state:{transiting:n},$el:r}=e;if(n){const o=setInterval(()=>{e.state.transiting||(clearInterval(o),r.legend.selectAll(`.${rn.legendItemFocused}`).size()>0&&e.expandArc(t))},10);return}const i=e.mapToTargetIds(t);r.svg.selectAll(e.selectorTargets(i,`.${Ye.chartArc}`)).each(function(o){if(!e.shouldExpand(o.data.id))return;const s=e.getExpandConfig(o.data.id,"duration"),l=e.getSvgArcExpanded(e.getExpandConfig(o.data.id,"rate"));Ut(this).selectAll("path").transition().duration(s).attrTween("d",du(e.svgArcExpanded.bind(e))).transition().duration(s*2).attrTween("d",du(l.bind(e)))})},unexpandArc(t){const e=this,{state:{transiting:n},$el:{svg:r}}=e;if(n)return;const i=e.mapToTargetIds(t);r.selectAll(e.selectorTargets(i,`.${Ye.chartArc}`)).selectAll("path").transition().duration(o=>e.getExpandConfig(o.data.id,"duration")).attrTween("d",du(e.svgArc.bind(e))),r.selectAll(`${Ye.arc}`).style("opacity",null)},getExpandConfig(t,e){const n=this,{config:r}=n,i={duration:50,rate:.98};let o;return n.isDonutType(t)?o="donut":n.isGaugeType(t)?o="gauge":n.isPieType(t)&&(o="pie"),o?r[`${o}_expand_${e}`]:i[e]},shouldExpand(t){const e=this,{config:n}=e,r=e.isDonutType(t)?"donut":e.isGaugeType(t)?"gauge":e.isPieType(t)?"pie":null;return r?!!n[`${r}_expand`]:!1},shouldShowArcLabel(){const t=this,{config:e}=t;return fu.some(n=>t.hasType(n)&&e[`${n}_label_show`])},getArcLabelConfig(t="format"){const e=this,{config:n}=e;let r=i=>i;return fu.filter(e.hasType.bind(e)).forEach(i=>{r=n[`${i}_label_${t}`]}),t==="format"&&le(r)?r.bind(e.api):r},updateTargetsForArc(t){const e=this,{$el:n}=e,r=e.hasType("gauge"),i=e.getChartClass("Arc"),o=e.getClass("arcs",!0),s=e.classFocus.bind(e),l=n.main.select(`.${Ye.chartArcs}`),c=l.selectAll(`.${Ye.chartArc}`).data(e.pie(t)).attr("class",f=>i(f)+s(f.data)),u=c.enter().append("g").attr("class",i).call(this.setCssRule(!1,`.${Ye.chartArcs} text`,["pointer-events:none","text-anchor:middle"]));u.append("g").attr("class",o).merge(c),u.append("text").attr("dy",r&&!e.hasMultiTargets()?"-.1em":null).style("opacity","0").style("text-anchor",e.getStylePropValue("middle")).style("pointer-events",e.getStylePropValue("none")),n.text=l.selectAll(`.${ze.target} text`)},initArc(){const t=this,{$el:e}=t;e.arcs=e.main.select(`.${ze.chart}`).append("g").attr("class",Ye.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle(t){const e=this,n=t||e.getArcTitle(),r=e.hasType("gauge");if(n){const i=r?rr.chartArcsGaugeTitle:Ye.chartArcsTitle;let o=e.$el.arcs.select(`.${i}`);o.empty()&&(o=e.$el.arcs.append("text").attr("class",i).style("text-anchor","middle")),r&&o.attr("dy","-0.3em"),ii(o,n,r?void 0:[-.6,1.35],!0)}},getArcTitle(){const t=this,e=t.hasType("donut")&&"donut"||t.hasType("gauge")&&"gauge";return e?t.config[`${e}_title`]:""},getArcTitleWithNeedleValue(){const t=this,{config:e,state:n}=t,r=t.getArcTitle();if(r&&t.config.arc_needle_show&&/{=[A-Z_]+}/.test(r)){let i=n.current.needle;return ge(i)||(i=e.arc_needle_value),Ca(r,{NEEDLE_VALUE:~~i})}return!1},redrawArc(t,e,n){const r=this,{config:i,state:o,$el:{main:s}}=r,l=i.interaction_enabled,c=l&&i.data_selection_isselectable;let u=s.selectAll(`.${Ye.arcs}`).selectAll(`.${Ye.arc}`).data(r.arcData.bind(r));u.exit().transition().duration(e).style("opacity","0").remove(),u=u.enter().append("path").attr("class",r.getClass("arc",!0)).style("fill",f=>r.color(f.data)).style("cursor",f=>{var d;return(d=c==null?void 0:c.bind)!=null&&d.call(c,r.api)(f)?"pointer":null}).style("opacity","0").each(function(f){r.isGaugeType(f.data)&&(f.startAngle=i.gauge_startingAngle,f.endAngle=i.gauge_startingAngle),this._current=f}).merge(u),r.hasType("gauge")&&(r.updateGaugeMax(),r.hasMultiArcGauge()&&r.redrawArcGaugeLine()),u.attr("transform",f=>!r.isGaugeType(f.data)&&n?"scale(0)":"").style("opacity",function(f){return f===this._current?"0":null}).each(()=>{o.transiting=!0}).transition().duration(t).attrTween("d",function(f){const d=r.updateAngle(f);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=Wa(this._current,d);return this._current=h(0),function(m){const A=h(m);return A.data=f.data,r.getArc(A,!0)}}).attr("transform",n?"scale(1)":"").style("fill",f=>{let d;return r.levelColor?(d=r.levelColor(f.data.values[0].value),i.data_colors[f.data.id]=d):d=r.color(f.data),d}).style("opacity",null).call(Wo,function(){if(r.levelColor){const f=Ut(this),d=f.datum(this._current);r.updateLegendItemColor(d.data.id,f.style("fill"))}o.transiting=!1,o.redrawing&&(o.redrawing=!1,o._targetsToShow=null,o._cachedDrawShape=null),Ne(i.onrendered,r.api)}),l&&r.bindArcEvent(u),r.hasType("polar")&&r.redrawPolar(),r.hasType("gauge")&&r.redrawBackgroundArcs(),i.arc_needle_show&&r.redrawNeedle(),r.redrawArcText(t),r.redrawArcRangeText()},redrawNeedle(){const t=this,{$el:e,config:n,state:{hiddenTargetIds:r,radius:i}}=t,o=(i-1)/100*n.arc_needle_length,s=r.size!==t.data.targets.length;let l=t.$el.arcs.select(`.${Ye.needle}`);const c=n.arc_needle_path,u=n.arc_needle_bottom_width/2,f=n.arc_needle_top_width/2,d=n.arc_needle_top_rx,h=n.arc_needle_top_ry,m=n.arc_needle_bottom_len,A=n.arc_needle_bottom_rx,R=n.arc_needle_bottom_ry,C=t.getNeedleAngle(),P=()=>{const z=t.getArcTitleWithNeedleValue();z&&t.setArcTitle(z)};if(P(),l.empty()&&(l=e.arcs.append("path").classed(Ye.needle,!0),e.needle=l,e.needle.updateHelper=(z,$=!1)=>{e.needle.style("display")!=="none"&&t.$T(e.needle).style("transform",`rotate(${t.getNeedleAngle(z)}deg)`).call(Wo,()=>{$&&(n.arc_needle_value=z),P()})}),s){const z=le(c)?c.call(t,o):`M-${u} ${m} A${A} ${R} 0 0 0 ${u} ${m} L${f} -${o} A${d} ${h} 0 0 0 -${f} -${o} L-${u} ${m} Z`;t.$T(l).attr("d",z).style("fill",n.arc_needle_color).style("display",null).style("transform",`rotate(${C}deg)`)}else l.style("display","none")},getNeedleAngle(t){const e=this,{config:n,state:r}=e,i=e.getArcLength(),o=e.hasType("gauge"),s=e.getTotalDataSum(!0);let l=ln(t)?t:n.arc_needle_value,c=n[`${n.data_type}_startingAngle`]||0,u;if(ge(l)||(l=o&&e.data.targets.length===1?s:0),r.current.needle=l,o){c=e.getStartingAngle();const f=n.gauge_fullCircle?i:c*-2,{gauge_min:d,gauge_max:h}=n;u=f*((l-d)/(h-d))}else u=s?i*(l/s):0;return(c+u)*(180/Math.PI)},redrawBackgroundArcs(){const t=this,{config:e,state:n}=t,r=t.hasMultiArcGauge(),i=e.gauge_fullCircle,o=t.getTargetsToShow().length===0&&!!e.data_empty_label_text,s=t.getStartingAngle(),l=i?s+t.getArcLength():s*-1;let c=t.$el.arcs.select(`${r?"g":""}.${Ye.chartArcsBackground}`);if(r){let u=0;c=c.selectAll(`path.${Ye.chartArcsBackground}`).data(t.data.targets),c.enter().append("path").attr("class",(f,d)=>`${Ye.chartArcsBackground} ${Ye.chartArcsBackground}-${d}`).merge(c).style("fill",e.gauge_background||null).attr("d",({id:f})=>{if(o||n.hiddenTargetIds.has(f))return"M 0 0";const d={data:[{value:e.gauge_max}],startAngle:s,endAngle:l,index:u++};return t.getArc(d,!0,!0)}),c.exit().remove()}else c.attr("d",o?"M 0 0":()=>{const u={data:[{value:e.gauge_max}],startAngle:s,endAngle:l};return t.getArc(u,!0,!0)})},bindArcEvent(t){const e=this,{config:n,state:r}=e,i=r.inputType==="touch",o=r.inputType==="mouse",s=u=>{const f=e.updateAngle(u);return f?e.convertToArcData(f):null};function l(u,f,d){e.expandArc(d),e.api.focus(d),e.toggleFocusLegend(d,!0),e.showTooltip([f],u)}function c(u){const f=(u==null?void 0:u.id)||void 0;e.unexpandArc(f),e.api.revert(),e.revertLegend(),e.hideTooltip()}if(t.on("click",function(u,f,d){var h;const m=s(f);m&&((h=e.toggleShape)==null||h.call(e,this,m,d),n.data_onclick.bind(e.api)(m,this))}),o&&t.on("mouseover",function(u,f){if(r.transiting)return;r.event=u;const d=s(f),h=(d==null?void 0:d.id)||void 0;l(this,d,h),e.setOverOut(!0,d)}).on("mouseout",(u,f)=>{if(r.transiting||!n.interaction_onout)return;r.event=u;const d=s(f);c(),e.setOverOut(!1,d)}).on("mousemove",function(u,f){const d=s(f);r.event=u,e.showTooltip([d],this)}),i&&e.hasArcType()&&!e.radars){const u=f=>{var d,h;const{clientX:m,clientY:A}=(h=(d=f.changedTouches)==null?void 0:d[0])!=null?h:{clientX:0,clientY:0};return Ut(He.elementFromPoint(m,A))};e.$el.svg.on("touchstart touchmove",function(f){if(r.transiting)return;r.event=f;const h=u(f).datum(),m=h!=null&&h.data&&h.data.id?e.updateAngle(h):null,A=m?e.convertToArcData(m):null,R=(A==null?void 0:A.id)||void 0;e.callOverOutForTouch(A),xn(R)?c():l(this,A,R)},{passive:!0})}},redrawArcText(t){const e=this,{config:n,state:r,$el:{main:i,arcs:o}}=e,s=e.hasType("gauge"),l=e.hasMultiArcGauge();let c;if(s&&e.data.targets.length===1&&n.gauge_title||(c=i.selectAll(`.${Ye.chartArc}`).select("text").style("opacity","0").attr("class",u=>e.isGaugeType(u.data)?rr.gaugeValue:null).call(e.textForArcLabel.bind(e)).style("font-size",u=>e.isGaugeType(u.data)&&e.data.targets.length===1&&!l?`${Math.round(r.radius/5)}px`:null),Zh.call(e),c.attr("transform",function(u){return e.transformForArcLabel.bind(e)(this,u)}).transition().duration(t).style("opacity",u=>e.isTargetToShow(u.data.id)&&e.isArcType(u.data)?null:"0"),l&&c.attr("dy","-.1em")),i.select(`.${Ye.chartArcsTitle}`).style("opacity",e.hasType("donut")||s?null:"0"),s){const u=n.gauge_fullCircle;u&&(c==null||c.attr("dy",`${l?0:Math.round(r.radius/14)}`)),n.gauge_label_show&&(o.select(`.${rr.chartArcsGaugeUnit}`).attr("dy",`${u?1.5:.75}em`).text(n.gauge_units),o.select(`.${rr.chartArcsGaugeMin}`).attr("dx",`${-1*(r.innerRadius+(r.radius-r.innerRadius)/(u?1:2))}px`).attr("dy","1.2em").text(e.textForGaugeMinMax(n.gauge_min,!1)),!u&&o.select(`.${rr.chartArcsGaugeMax}`).attr("dx",`${r.innerRadius+(r.radius-r.innerRadius)/2}px`).attr("dy","1.2em").text(e.textForGaugeMinMax(n.gauge_max,!0)))}Yv.call(e)&&U2.call(e,t)},getArcElementByIdOrIndex(t){const e=this,{$el:{arcs:n}}=e,r=ge(t)?i=>i.index===t:i=>i.data.id===t;return n==null?void 0:n.selectAll(`.${ze.target} path`).filter(r)}};function mi(t,e){yn(Er.prototype,[Q2,vi].concat(t||[])),Fa.setOptions([za].concat(e||[]))}let Qv=()=>(mi(void 0,[Vs,I2]),(Qv=()=>jt.DONUT)());var _2=Object.defineProperty,_v=Object.getOwnPropertySymbols,q2=Object.prototype.hasOwnProperty,tI=Object.prototype.propertyIsEnumerable,qv=(t,e,n)=>e in t?_2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,eI=(t,e)=>{for(var n in e||(e={}))q2.call(e,n)&&qv(t,n,e[n]);if(_v)for(var n of _v(e))tI.call(e,n)&&qv(t,n,e[n]);return t};function xi(t=!1){const e=this,{config:n,state:{current:{width:r,height:i}}}=e,o=e.getCurrentPadding(),s=eI({width:r-o.left-o.right,height:i-(n.legend_show?e.getLegendHeight()+10:0)-o.top-o.bottom},o);if(t){const l=hu.call(e,s),c=n.funnel_rotated;s.width=Math.max(s.width,c?l.height:l.width),s.height=Math.max(s.height,c?l.width:l.height)}return s}function hu(t){const e=this,{config:n}=e,r=n.funnel_rotated,[i,o]=[n.funnel_neck_width,n.funnel_neck_height].map((s,l)=>je(s)?t[r!==!l?"width":"height"]*s.ratio:s);return{width:i,height:o}}function nI(t){const e=this,n=e.config.funnel_rotated,{width:r,height:i}=xi.call(e,!0),o=[];return t.forEach((s,l)=>{const{ratio:c=0}=s,u=l>0?o[l-1][2][n?0:1]:0,f=c+u;o.push(s.coords=n?[[u,0],[f,0],[f,i],[u,i],[u,0]]:[[0,u],[r,u],[r,f],[0,f],[0,u]])}),o}function rI(){const t=this,e=t.config.funnel_rotated,{width:n,height:r}=xi.call(t,!0),i=hu.call(t,{width:n,height:r});let o;if(e){const s=(r-i.width)/2,l=n-i.height;o=[[l,s],[n,s],[n,r-s],[l,r-s],[0,r]]}else{const s=(n-i.width)/2,l=r-i.height;o=[[n,0],[n-s,l],[n-s,r],[s,r],[s,l]]}return`M${[[0,0],...o,[0,0]].join("L")}z`}function aI(t){const e=this,{config:n}=e,r=t.map(i=>({id:i.id,value:i.values.reduce((o,s)=>o+s.value,0)}));return n.data_order&&r.sort(e.getSortCompareFn.bind(e)(!0)),tp.call(e,r)}function tp(t){const e=this,{width:n,height:r}=xi.call(e),i=e.getTotalDataSum(!0),o=e.config.funnel_rotated?n:r;return t.forEach(s=>{s.ratio=s.value/i*o}),t}function iI(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function ep(t,e,n,r,i){const o=[];for(let l=0;l<=20;l++){const c=l/20,u=t+(e-t)*c,f=n+(r-n)*iI(c);o.push(i?[u,f]:[f,u])}return o}function oI(){var t;const e=this,n=e.config.funnel_rotated,{width:r,height:i}=xi.call(e,!0),o=hu.call(e,{width:r,height:i}),s=Jl().x(m=>m[0]).y(m=>m[1]).curve(Qo),l=(n?i-o.width:r-o.width)/2,c=n?r-o.height:i-o.height,u=ep(0,c,n?0:r,n?l:r-l,n),f=[];if(o.height>0&&(u.push(n?[r,l]:[r-l,i]),f.push(n?[r,i-l]:[l,i])),f.push(...ep(c,0,n?i-l:l,n?i:0,n)),u.length>1){const[m,A]=n?[1,0]:[0,1];u.splice(1,0,[u[m][0],u[A][1]]);const R=f.length-1;R>0&&f.splice(R,0,[f[R-m][0],f[R-A][1]])}const d=s(u)||"",h=((t=s(f))==null?void 0:t.replace(/^M/,"L"))||"";return n?`${d}${h}z`:`M0,0${d.replace(/^M/,"L")}${h}z`}var sI={initFunnel(){const t=this,{$el:e}=t;e.funnel=e.main.select(`.${ze.chart}`).append("g").classed(Zi.chartFunnels,!0),e.funnel.background=e.funnel.append("path").classed(Zi.funnelBackground,!0),t.bindFunnelEvent()},bindFunnelEvent(){const t=this,{$el:{funnel:e},config:n,state:r}=t;if(!n.interaction_enabled)return;const i=s=>{var l;const c=s.isTrusted?s.target:(l=r.eventReceiver.rect)==null?void 0:l.node();if(c&&/^path$/i.test(c.tagName))return r.event=s,Ut(c).datum()},o=r.inputType==="touch";e.on(o?"touchstart":"mouseover mousemove",s=>{const l=i(s);l&&(t.showTooltip([l],s.target),/^(touchstart|mouseover)$/.test(s.type)&&t.setOverOut(!0,l))},o?{passive:!0}:void 0).on(o?"touchend":"mouseout",s=>{const l=i(s);n.interaction_onout&&(t.hideTooltip(),t.setOverOut(!1,l))})},updateTargetsForFunnel(t){const e=this,{$el:{funnel:n}}=e;n||e.initFunnel();const r=e.getChartClass("Funnel"),i=e.getClass("funnel",!0),o=aI.call(e,t.filter(e.isFunnelType.bind(e))),s=e.filterNullish(o),l=n.selectAll(`.${Zi.chartFunnel}`).data(s);l.exit().remove();const c=l.enter().insert("g",`.${Zi.funnelBackground}`);c.append("path"),n.path=c.merge(l).attr("class",r).select("path").attr("class",i).style("opacity","0").style("fill",e.color)},updateFunnel(t){const e=this,{$el:{funnel:n}}=e,r=t.map(({id:i})=>i);n.path=n.path.filter(i=>r.includes(i.id))},generateGetFunnelPoints(){const t=this,{config:e,$el:{funnel:n}}=t,r=e.funnel_rotated,i=t.filterTargetsToShow(n.path),{top:o,left:s,width:l,height:c}=xi.call(t),u={};let f=0;return i.each(d=>{const h=f,{ratio:m}=d;f+=m;const A=r?s:o,R=A+h,C=A+f,P=(R+C)/2,z=r?o+c/2:s+l/2;u[d.id]=r?[[R,z],[C,z],[P,z]]:[[z,R],[z,C],[z,P]]}),d=>u[d.id]},redrawFunnel(){const t=this,{config:e,$T:n,$el:{funnel:r}}=t,i=t.filterTargetsToShow(r.path),o=nI.call(t,tp.call(t,i.data())),{top:s,left:l}=xi.call(t),c=(e.funnel_spline?oI:rI).call(t);r.attr("transform",`translate(${l}, ${s})`).attr("clip-path",`path('${c}')`),r.background.attr("d",c),n(i).attr("d",(u,f)=>`M${o[f].join("L")}z`).style("opacity","1"),r.selectAll("g").style("opacity",null)}},lI={funnel_neck_width:0,funnel_neck_height:0,funnel_rotated:!1,funnel_spline:!1};let np=()=>(mi([sI],[lI]),(np=()=>jt.FUNNEL)());var cI={initGauge(){const t=this,{config:e,$el:{arcs:n}}=t,r=(i=null,o="")=>{n.append("text").attr("class",i).style("text-anchor","middle").style("pointer-events","none").text(o)};if(t.hasType("gauge")){const i=t.hasMultiArcGauge();n.append(i?"g":"path").attr("class",Ye.chartArcsBackground).style("fill",!i&&e.gauge_background||null),e.gauge_units&&r(rr.chartArcsGaugeUnit),e.gauge_label_show&&(r(rr.chartArcsGaugeMin),!e.gauge_fullCircle&&r(rr.chartArcsGaugeMax))}},updateGaugeMax(){const t=this,{config:e,state:n}=t,i=t.hasMultiArcGauge()?t.getMinMaxData().max[0].value:t.getTotalDataSum(n.rendered);!e.gauge_enforceMinMax&&i+e.gauge_min*(e.gauge_min>0?-1:1)>e.gauge_max&&(e.gauge_max=i-e.gauge_min)},redrawArcGaugeLine(){const t=this,{config:e,state:n,$el:r}=t,{hiddenTargetIds:i}=t.state,o=r.main.selectAll(`.${Ye.arcs}`).selectAll(`.${Ye.arcLabelLine}`).data(t.arcData.bind(t));o.enter().append("rect").attr("class",l=>`${Ye.arcLabelLine} ${ze.target} ${ze.target}-${l.data.id}`).merge(o).style("fill",l=>t.levelColor?t.levelColor(l.data.values[0].value):t.color(l.data)).style("display",e.gauge_label_show?null:"none").each(function(l){let c=0;const u=2;let f=0,d=0,h="";if(!i.has(l.data.id)){const m=t.updateAngle(l),A=n.gaugeArcWidth/t.getTargetsToShow().length*(m.index+1),R=m.endAngle-Math.PI/2,C=n.radius-A,P=R-(C===0?0:1/C);c=n.radiusExpanded-n.radius+A,f=Math.cos(P)*C,d=Math.sin(P)*C,h=`rotate(${R*180/Math.PI}, ${f}, ${d})`}Ut(this).attr("x",f).attr("y",d).attr("width",c).attr("height",u).attr("transform",h).style("stroke-dasharray",`0, ${c+u}, 0`)})},textForGaugeMinMax(t,e){const n=this,{config:r}=n,i=r.gauge_label_extents;return le(i)?i.bind(n.api)(t,e):t},getGaugeLabelHeight(){const{config:t}=this;return this.config.gauge_label_show&&!t.gauge_fullCircle?20:0},getPaddingBottomForGauge(){return this.getGaugeLabelHeight()*2}},uI={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_line:!1,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};let rp=()=>(mi([cI],[Vs,uI]),(rp=()=>jt.GAUGE)()),ap=()=>(ea(),(ap=()=>jt.LINE)()),ip=()=>(ea(void 0,[eu]),(ip=()=>jt.SPLINE)()),op=()=>(ea(),(op=()=>jt.STEP)());var fI={pie_label_show:!0,pie_label_format:void 0,pie_label_ratio:void 0,pie_label_threshold:.05,pie_label_line:!1,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};let sp=()=>(mi(void 0,[Vs,fI]),(sp=()=>jt.PIE)());function lp(t){const e=t.config.polar_level_max;let n=t.getMinMaxData().max[0].value;return e&&e>n&&(n=e),n}var dI={initPolar(){const t=this,{$el:{arcs:e},config:n}=t,r=n.polar_level_text_show,i=n.polar_level_text_backgroundColor;e.levels=e.append("g").attr("class",Zr.levels),r&&i&&t.generateTextBGColorFilter(i)},getPolarOuterRadius(t,e){var n;const r=lp(this);return((n=t==null?void 0:t.data.values[0].value)!=null?n:0)/r*e},updateTargetsForPolar(t){this.updateTargetsForArc(t)},redrawPolar(){const t=this,{config:e}=t;e.polar_level_show&&t.updatePolarLevel()},updatePolarLevel(){const t=this,{config:e,state:n,$el:{arcs:{levels:r}}}=t,i=e.polar_level_depth,o=lp(t),s=Vo(0,i),l=n.radius,c=s.map(h=>l*((h+1)/i)),u=(e.polar_level_text_format||function(){}).bind(t.api),f=r.selectAll(`.${Zr.level}`).data(s);f.exit().remove();const d=f.enter().append("g").attr("class",(h,m)=>`${Zr.level} ${Zr.level}-${m}`);if(d.append("circle"),d.merge(f).selectAll("circle").style("visibility",e.polar_level_show?null:"hidden").attr("cx",0).attr("cy",0).attr("r",h=>c[h]),e.polar_level_text_show){const h=e.polar_level_text_backgroundColor,m=`#${n.datetimeId}-labels-bg${t.getTargetSelectorSuffix(h)}`;d.append("text").style("text-anchor","middle"),d.merge(f).selectAll("text").attr("dy",A=>-c[A]+5).attr("filter",h?`url(${m})`:null).text(A=>u(o/s.length*(A+1)))}}},hI={polar_label_show:!0,polar_label_format:void 0,polar_label_threshold:.05,polar_label_line:!1,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:t=>t%1===0?t:t.toFixed(2),polar_level_text_show:!0,polar_padAngle:0,polar_padding:0,polar_startingAngle:0};let cp=()=>(mi([dI],[Vs,hI]),(cp=()=>jt.POLAR)());function gI(t,e,n,r,i,o){const s=t&&r>0?n-r:r,l=2*Math.PI;return i*(1-o*(e==="x"?Math.sin:Math.cos)(s*l/n))}const yi=Ue.radarPoints,up=Ue.radarTextWidth;var vI={initRadar(){const t=this,{config:e,state:{current:n},$el:r}=t;t.hasType("radar")&&(r.radar=r.main.select(`.${ze.chart}`).append("g").attr("class",Wd.chartRadars),r.radar.levels=r.radar.append("g").attr("class",Zr.levels),r.radar.axes=r.radar.append("g").attr("class",Rn.axis),r.radar.shapes=r.radar.append("g").attr("class",bn.shapes),n.dataMax=e.radar_axis_max||t.getMinMaxData().max[0].value,e.radar_axis_text_show&&(e.interaction_enabled&&t.bindRadarEvent(),t.updateRadarLevel(),t.updateRadarAxes()))},getRadarSize(){const t=this,{config:e,state:{arcWidth:n,arcHeight:r}}=t,i=e.axis_x_categories.length<4?-20:10,o=(Math.min(n,r)-i)/2;return[o,o]},updateTargetsForRadar(t){const e=this,{config:n}=e;sr(n.axis_x_categories)&&(n.axis_x_categories=Vo(0,Tr("max",t.map(r=>r.values.length)))),e.generateRadarPoints()},getRadarPosition(t,e,n,r){const i=this,{config:o}=i,[s,l]=i.getRadarSize(),c=o.axis_x_categories.length,u=o.radar_direction_clockwise,f=Ea(t).map(d=>gI(u,d,c,e,ln(n)?n:t==="x"?s:l,ge(r)?r:o.radar_size_ratio));return f.length===1?f[0]:f},generateRadarPoints(){const t=this,e=t.data.targets,[n,r]=t.getRadarSize(),i=t.cache.get(yi)||{},o=i._size;(!o||o.width!==n&&o.height!==r)&&(e.forEach(s=>{i[s.id]=s.values.map((l,c)=>t.getRadarPosition(["x","y"],c,void 0,t.getRatio("radar",l)))}),i._size={width:n,height:r},t.cache.add(yi,i))},redrawRadar(){const t=this,{radar:e,main:n}=t.$el,r=t.getTranslate("radar");r&&(e.attr("transform",r),n.select(`.${En.chartTexts}`).attr("transform",r),t.generateRadarPoints(),t.updateRadarLevel(),t.updateRadarAxes(),t.updateRadarShape())},generateGetRadarPoints(){const t=this.cache.get(yi);return(e,n)=>{const r=t[e.id][n];return[r,r,r,r]}},updateRadarLevel(){const t=this,{config:e,state:n,$el:{radar:r}}=t,[i,o]=t.getRadarSize(),s=e.radar_level_depth,l=e.axis_x_categories.length,c=e.radar_level_text_show,u=r.levels,f=Vo(0,s),d=e.radar_size_ratio*Math.min(i,o),h=f.map(P=>d*((P+1)/s)),m=(e.radar_level_text_format||function(){}).bind(t.api),A=f.map(P=>{const z=h[P];return Vo(0,l).map(B=>t.getRadarPosition(["x","y"],B,z,1).join(",")).join(" ")}),R=u.selectAll(`.${Zr.level}`).data(f);R.exit().remove();const C=R.enter().append("g").attr("class",(P,z)=>`${Zr.level} ${Zr.level}-${z}`);C.append("polygon").style("visibility",e.radar_level_show?null:"hidden"),c&&(u.select("text").empty()&&u.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(()=>m(0)),C.append("text").attr("dx","-.5em").style("text-anchor","end").text(P=>m(n.current.dataMax/f.length*(P+1)))),C.merge(R).attr("transform",P=>`translate(${i-h[P]}, ${o-h[P]})`).selectAll("polygon").attr("points",P=>A[P]),c&&u.selectAll("text").attr("x",P=>xn(P)?i:A[P].split(",")[0]).attr("y",P=>xn(P)?o:0)},updateRadarAxes(){const t=this,{config:e,$el:{radar:n}}=t,[r,i]=t.getRadarSize(),o=e.axis_x_categories;let s=n.axes.selectAll("g").data(o);s.exit().remove();const l=s.enter().append("g").attr("class",(c,u)=>`${Rn.axis}-${u}`);if(e.radar_axis_line_show&&l.append("line"),e.radar_axis_text_show&&l.append("text"),s=l.merge(s),e.radar_axis_line_show&&s.select("line").attr("x1",r).attr("y1",i).attr("x2",(c,u)=>t.getRadarPosition("x",u)).attr("y2",(c,u)=>t.getRadarPosition("y",u)),e.radar_axis_text_show){const{x:c=0,y:u=0}=e.radar_axis_text_position,f=t.cache.get(up)||0;if(s.select("text").style("text-anchor","middle").attr("dy",".5em").call(d=>{d.each(function(h){ii(Ut(this),String(h),[-.6,1.2])})}).datum((d,h)=>({index:h})).attr("transform",function(d){xn(this.width)&&(this.width=un(this,!0).width/2);let h=t.getRadarPosition("x",d.index,void 0,1),m=Math.round(t.getRadarPosition("y",d.index,void 0,1));return h>r?h+=this.width+c:Math.round(h)<r&&(h-=this.width+c),m>i?(m/2===i&&this.firstChild.tagName==="tspan"&&this.firstChild.setAttribute("dy","0em"),m+=u):m<i&&(m-=u),`translate(${h} ${m})`}),!f){const d=[n.axes,n.levels].map(h=>_d(h.node()).width);d.every(h=>h>0)&&t.cache.add(up,d[0]-d[1])}}},bindRadarEvent(){const t=this,{config:e,state:n,$el:{radar:r,svg:i}}=t,o=t.isPointFocusOnly(),{inputType:s,transiting:l}=n,c=s==="mouse",u=f=>{if(n.event=f,!e.interaction_onout)return;const d=t.getDataIndexFromEvent(f),h=xn(d);(c||h)&&(t.hideTooltip(),o?t.hideCircleFocus():t.unexpandCircles(),c?t.setOverOut(!1,d):h&&t.callOverOutForTouch())};r.axes.on(c?"mouseover ":"touchstart",f=>{if(l)return;n.event=f;const d=t.getDataIndexFromEvent(f);t.selectRectForSingle(i.node(),d),c?t.setOverOut(!0,d):t.callOverOutForTouch(d)},c?void 0:{passive:!0}).on("mouseout",c?u:null),c||i.on("touchstart",u,{passive:!0})},updateRadarShape(){const t=this,e=t.data.targets.filter(o=>t.isRadarType(o)),n=t.cache.get(yi),r=t.$el.radar.shapes.selectAll("polygon").data(t.filterNullish(e)),i=r.enter().append("g").attr("class",t.getChartClass("Radar"));t.$T(r.exit()).remove(),i.append("polygon").merge(r).style("fill",t.color).style("stroke",t.color).attr("points",o=>n[o.id].join(" ")),t.updateTargetForCircle(e,i)},radarCircleX(t){return this.cache.get(yi)[t.id][t.index][0]},radarCircleY(t){return this.cache.get(yi)[t.id][t.index][1]}},pI={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:t=>t%1===0?t:t.toFixed(2),radar_level_text_show:!0,radar_size_ratio:.87,radar_direction_clockwise:!1};let fp=()=>(mi([Iv.eventrect,Bs,vI],[za,pI,{axis_x_categories:Rv.optAxis.axis_x_categories}]),(fp=()=>jt.RADAR)());var mI={scatter_zerobased:!1};let dp=()=>(uo([vi,Bs],[za,mI]),(dp=()=>jt.SCATTER)());function xI(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Hs(t,e,n,r,i){for(var o=t.children,s,l=-1,c=o.length,u=t.value&&(r-e)/t.value;++l<c;)s=o[l],s.y0=n,s.y1=i,s.x0=e,s.x1=e+=s.value*u}function Ys(t,e,n,r,i){for(var o=t.children,s,l=-1,c=o.length,u=t.value&&(i-n)/t.value;++l<c;)s=o[l],s.x0=e,s.x1=r,s.y0=n,s.y1=n+=s.value*u}var hp=(1+Math.sqrt(5))/2;function gp(t,e,n,r,i,o){for(var s=[],l=e.children,c,u,f=0,d=0,h=l.length,m,A,R=e.value,C,P,z,$,B,W,H;f<h;){m=i-n,A=o-r;do C=l[d++].value;while(!C&&d<h);for(P=z=C,W=Math.max(A/m,m/A)/(R*t),H=C*C*W,B=Math.max(z/H,H/P);d<h;++d){if(C+=u=l[d].value,u<P&&(P=u),u>z&&(z=u),H=C*C*W,$=Math.max(z/H,H/P),$>B){C-=u;break}B=$}s.push(c={value:C,dice:m<A,children:l.slice(f,d)}),c.dice?Hs(c,n,r,i,R?r+=A*C/R:o):Ys(c,n,r,R?n+=m*C/R:i,o),R-=C,f=d}return s}var vp=(function t(e){function n(r,i,o,s,l){gp(e,r,i,o,s,l)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(hp);function QR(t){return t==null?null:pp(t)}function pp(t){if(typeof t!="function")throw new Error;return t}function fo(){return 0}function ho(t){return function(){return t}}function yI(){var t=vp,e=!1,n=1,r=1,i=[0],o=fo,s=fo,l=fo,c=fo,u=fo;function f(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],e&&h.eachBefore(xI),h}function d(h){var m=i[h.depth],A=h.x0+m,R=h.y0+m,C=h.x1-m,P=h.y1-m;C<A&&(A=C=(A+C)/2),P<R&&(R=P=(R+P)/2),h.x0=A,h.y0=R,h.x1=C,h.y1=P,h.children&&(m=i[h.depth+1]=o(h)/2,A+=u(h)-m,R+=s(h)-m,C-=l(h)-m,P-=c(h)-m,C<A&&(A=C=(A+C)/2),P<R&&(R=P=(R+P)/2),t(h,A,R,C,P))}return f.round=function(h){return arguments.length?(e=!!h,f):e},f.size=function(h){return arguments.length?(n=+h[0],r=+h[1],f):[n,r]},f.tile=function(h){return arguments.length?(t=pp(h),f):t},f.padding=function(h){return arguments.length?f.paddingInner(h).paddingOuter(h):f.paddingInner()},f.paddingInner=function(h){return arguments.length?(o=typeof h=="function"?h:ho(+h),f):o},f.paddingOuter=function(h){return arguments.length?f.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):f.paddingTop()},f.paddingTop=function(h){return arguments.length?(s=typeof h=="function"?h:ho(+h),f):s},f.paddingRight=function(h){return arguments.length?(l=typeof h=="function"?h:ho(+h),f):l},f.paddingBottom=function(h){return arguments.length?(c=typeof h=="function"?h:ho(+h),f):c},f.paddingLeft=function(h){return arguments.length?(u=typeof h=="function"?h:ho(+h),f):u},f}function mp(t,e,n,r,i){var o=t.children,s,l=o.length,c,u=new Array(l+1);for(u[0]=c=s=0;s<l;++s)u[s+1]=c+=o[s].value;f(0,l,t.value,e,n,r,i);function f(d,h,m,A,R,C,P){if(d>=h-1){var z=o[d];z.x0=A,z.y0=R,z.x1=C,z.y1=P;return}for(var $=u[d],B=m/2+$,W=d+1,H=h-1;W<H;){var J=W+H>>>1;u[J]<B?W=J+1:H=J}B-u[W-1]<u[W]-B&&d+1<W&&--W;var q=u[W]-$,at=m-q;if(C-A>P-R){var et=m?(A*at+C*q)/m:C;f(d,W,q,A,R,et,P),f(W,h,at,et,R,C,P)}else{var ot=m?(R*at+P*q)/m:P;f(d,W,q,A,R,C,ot),f(W,h,at,A,ot,C,P)}}}function TI(t,e,n,r,i){(t.depth&1?Ys:Hs)(t,e,n,r,i)}var bI=(function t(e){function n(r,i,o,s,l){if((c=r._squarify)&&c.ratio===e)for(var c,u,f,d,h=-1,m,A=c.length,R=r.value;++h<A;){for(u=c[h],f=u.children,d=u.value=0,m=f.length;d<m;++d)u.value+=f[d].value;u.dice?Hs(u,i,o,s,R?o+=(l-o)*u.value/R:l):Ys(u,i,o,R?i+=(s-i)*u.value/R:s,l),R-=u.value}else r._squarify=c=gp(e,r,i,o,s,l),c.ratio=e}return n.ratio=function(r){return t((r=+r)>1?r:1)},n})(hp);function SI(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function AI(){return this.eachAfter(SI)}function EI(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function CI(t,e){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(t.call(e,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function II(t,e){for(var n=this,r=[n],i=[],o,s,l,c=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,l=o.length;s<l;++s)r.push(o[s]);for(;n=i.pop();)t.call(e,n,++c,this);return this}function RI(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function wI(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function OI(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function PI(t){for(var e=this,n=MI(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function MI(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function LI(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function DI(){return Array.from(this)}function FI(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function NI(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*$I(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function gu(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=UI)):e===void 0&&(e=zI);for(var n=new Ks(t),r,i=[n],o,s,l,c;r=i.pop();)if((s=e(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,l=c-1;l>=0;--l)i.push(o=s[l]=new Ks(s[l])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(XI)}function BI(){return gu(this).eachBefore(kI)}function zI(t){return t.children}function UI(t){return Array.isArray(t)?t[1]:null}function kI(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function XI(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Ks(t){this.data=t,this.depth=this.height=0,this.parent=null}Ks.prototype=gu.prototype={constructor:Ks,count:AI,each:EI,eachAfter:II,eachBefore:CI,find:RI,sum:wI,sort:OI,path:PI,ancestors:LI,descendants:DI,leaves:FI,links:NI,copy:BI,[Symbol.iterator]:$I};function GI(t){const e=this;return t.map(n=>{const{id:r,values:i}=n,{value:o}=i[0];return{name:r,id:r,value:o,ratio:e.getRatio("treemap",i[0])}})}var WI={initTreemapLayout(){this.treemap=yI().tile(this.getTreemapTile())},getTreemapTile(){var t,e;const n=this,{config:r,state:{current:{width:i,height:o}}}=n,s=(e={binary:mp,dice:Hs,slice:Ys,sliceDice:TI,squarify:vp,resquarify:bI}[(t=r.treemap_tile)!=null?t:"binary"])!=null?e:mp;return(l,c,u,f,d)=>{s(l,0,0,i,o);for(const h of l.children)h.x0=c+h.x0/i*(f-c),h.x1=c+h.x1/i*(f-c),h.y0=u+h.y0/o*(d-u),h.y1=u+h.y1/o*(d-u)}},getTreemapData(t){const e=this;return{name:"root",children:GI.bind(e)(e.filterTargetsToShow(t.filter(e.isTreemapType,e)))}},getTreemapRoot(t){const e=this,n=e.getTreemapData(t!=null?t:e.data.targets),r=gu(n).sum(o=>o.value),i=e.getSortCompareFn(!0);return e.treemap||e.initTreemapLayout(),e.treemap(i?r.sort(i):r)}},VI=Object.defineProperty,jI=Object.defineProperties,HI=Object.getOwnPropertyDescriptors,xp=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,KI=Object.prototype.propertyIsEnumerable,yp=(t,e,n)=>e in t?VI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ZI=(t,e)=>{for(var n in e||(e={}))YI.call(e,n)&&yp(t,n,e[n]);if(xp)for(var n of xp(e))KI.call(e,n)&&yp(t,n,e[n]);return t},JI=(t,e)=>jI(t,HI(e));function QI(t,e){const n=this;t.selectAll("g").attr("transform",r=>{const i=ti(n,r,e);return`translate(${i.x},${i.y})`}).select("rect").attr("width",r=>ti(n,r,e).w).attr("height",r=>ti(n,r,e).h)}var _I=JI(ZI({},WI),{initTreemap(){const t=this,{$el:e,state:{current:{width:n,height:r},clip:i,datetimeId:o}}=t;i.id=`${o}-clip`,t.initTreemapLayout(),e.defs.append("clipPath").attr("id",i.id).append("rect").attr("width",n).attr("height",r),e.treemap=e.main.select(`.${ze.chart}`).attr("clip-path",`url(#${i.id})`).append("g").classed(jd.chartTreemaps,!0),t.bindTreemapEvent()},bindTreemapEvent(){const t=this,{$el:e,config:n,state:r}=t,i=o=>{var s;const l=o.isTrusted?o.target:(s=r.eventReceiver.rect)==null?void 0:s.node();let c;return l&&/^rect$/i.test(l.tagName)&&(r.event=o,c=Ut(l).datum()),c==null?void 0:c.data};if(n.interaction_enabled){const o=r.inputType==="touch";e.treemap.on(o?"touchstart":"mouseover mousemove",s=>{const l=i(s);l&&(t.showTooltip([l],s.currentTarget),/^(touchstart|mouseover)$/.test(s.type)&&t.setOverOut(!0,l))},o?{passive:!0}:void 0).on(o?"touchend":"mouseout",s=>{const l=i(s);n.interaction_onout&&(t.hideTooltip(),t.setOverOut(!1,l))})}},updateTargetsForTreemap(t){const e=this,{$el:{treemap:n}}=e,r=[e.getTreemapRoot(t!=null?t:e.data.targets)];n.data(e.filterNullish(r))},updateTreemap(t){const e=this,{$el:n,$T:r}=e,i=n.treemap.datum(),o=e.getChartClass("Treemap"),s=e.getClass("treemap",!0),l=n.treemap.selectAll("g").data(i.children);r(l.exit(),t).style("opacity","0").remove(),l.enter().append("g").append("rect"),n.treemap.selectAll("g").attr("class",o).select("rect").attr("class",s).attr("fill",c=>e.color(c.data.name))},generateGetTreemapPoints(){const t=this,{$el:e}=t,n={};return e.treemap.selectAll("g").each(r=>{const i=ti(t,r);n[r.data.name]=[[i.x,i.y],[i.x+i.w,i.y+i.h]]}),r=>n[r.id]},redrawTreemap(t){const e=this,{$el:n,state:{current:{width:r,height:i}}}=e;return n.defs.select("rect").attr("width",r).attr("height",i),[e.$T(n.treemap,t,Rr()).call(QI.bind(e),n.treemap.datum())]},treemapDataLabelFormat(t){const e=this,{$el:{treemap:n},config:r,scale:{x:i,y:o}}=e,{id:s,value:l}=t,c=r.treemap_label_format,u=e.getRatio("treemap",t),f=(u*100).toFixed(2),d=r.treemap_label_show&&$c.call(e,u,"treemap")?null:"0",h=n.selectAll("g").filter(R=>R.data.id===s).datum();let m=0,A=0;if(h){const{x0:R,x1:C,y0:P,y1:z}=h;m=i(C)-i(R),A=o(z)-o(P)}return function(R){return R.style("opacity",d),le(c)?c.bind(e.api)(l,u,s,{width:m,height:A}):`${s}
|
|
67
|
-
${f}%`}}}),qI={treemap_tile:"binary",treemap_label_format:void 0,treemap_label_threshold:.05,treemap_label_show:!0};let Tp=()=>(uo([_I],[qI]),(Tp=()=>jt.TREEMAP)()),vu=Object.create(null);const bp={version:"4.0.
|
|
67
|
+
${f}%`}}}),qI={treemap_tile:"binary",treemap_label_format:void 0,treemap_label_threshold:.05,treemap_label_show:!0};let Tp=()=>(uo([_I],[qI]),(Tp=()=>jt.TREEMAP)()),vu=Object.create(null);const bp={version:"4.0.1",generate(t){const e=Gr(Object.create(null),vu,t),n=new Kn(e);return n.internal.charts=this.instance,this.instance.push(n),n},defaults(t){return je(t)&&(vu=t),vu},instance:[],plugin:{}};Object.keys(v).forEach(t=>v[t]()),Object.keys(g).forEach(t=>g[t]()),Bg(),zg(),Zg(),dv(),$g(),Lg()})],vo={};function ar(b){var O=vo[b];if(O!==void 0)return O.exports;var a=vo[b]={exports:{}};return pu[b].call(a.exports,a,a.exports,ar),a.exports}(function(){ar.d=function(b,O){for(var a in O)ar.o(O,a)&&!ar.o(b,a)&&Object.defineProperty(b,a,{enumerable:!0,get:O[a]})}})(),(function(){ar.o=function(b,O){return Object.prototype.hasOwnProperty.call(b,O)}})(),(function(){ar.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})}})(),ar(0);var po=ar(627);return po})()});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -198,7 +198,7 @@ class Plugin {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
__publicField(Plugin, "version", "4.0.
|
|
201
|
+
__publicField(Plugin, "version", "4.0.1");
|
|
202
202
|
|
|
203
203
|
;// ./src/Plugin/bubblecompare/index.ts
|
|
204
204
|
var bubblecompare_defProp = Object.defineProperty;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(a,c){typeof exports=="object"&&typeof module=="object"?module.exports=c(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],c):typeof exports=="object"?exports.bb=c(require("d3-selection")):(a.bb=a.bb||{},a.bb.plugin=a.bb.plugin||{},a.bb.plugin.bubblecompare=c(a.d3))})(this,function(f){return(function(){"use strict";var a={747:(function(e){e.exports=f})},c={};function u(e){var t=c[e];if(t!==void 0)return t.exports;var n=c[e]={exports:{}};return a[e](n,n.exports,u),n.exports}(function(){u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var l={};u.d(l,{default:function(){return M}});var g=u(747);const q=e=>e||e===0,A=e=>typeof e=="function",y=e=>typeof e=="string",$=e=>typeof e=="number",x=e=>typeof e=="undefined",v=e=>typeof e!="undefined",z=e=>typeof e=="boolean",L=e=>Math.ceil(e/10)*10,S=e=>Math.ceil(e)+.5,U=e=>e[1]-e[0],p=e=>typeof e=="object",B=e=>{for(const t in e)return!1;return!0},C=e=>x(e)||e===null||y(e)&&e.length===0||p(e)&&!(e instanceof Date)&&B(e)||$(e)&&isNaN(e),V=e=>!C(e),P=e=>Array.isArray(e),H=e=>e&&!(e!=null&&e.nodeType)&&p(e)&&!P(e);function R(e){const t=this.config;let n,r,i;const o=()=>{const s=r.shift();if(s&&n&&p(n)&&s in n)return n=n[s],o();if(!s)return n};Object.keys(t).forEach(s=>{n=e,r=s.split("_"),i=o(),v(i)&&(t[s]=i)}),this.api&&(this.state.orgConfig=e)}var w=Object.defineProperty,O=(e,t,n)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t,n)=>O(e,typeof t!="symbol"?t+"":t,n);class d{constructor(t={}){b(this,"$$"),b(this,"options"),b(this,"config"),this.options=t}loadConfig(){R.call(this,this.options)}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}b(d,"version","4.0.
|
|
11
|
+
*/(function(a,c){typeof exports=="object"&&typeof module=="object"?module.exports=c(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],c):typeof exports=="object"?exports.bb=c(require("d3-selection")):(a.bb=a.bb||{},a.bb.plugin=a.bb.plugin||{},a.bb.plugin.bubblecompare=c(a.d3))})(this,function(f){return(function(){"use strict";var a={747:(function(e){e.exports=f})},c={};function u(e){var t=c[e];if(t!==void 0)return t.exports;var n=c[e]={exports:{}};return a[e](n,n.exports,u),n.exports}(function(){u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var l={};u.d(l,{default:function(){return M}});var g=u(747);const q=e=>e||e===0,A=e=>typeof e=="function",y=e=>typeof e=="string",$=e=>typeof e=="number",x=e=>typeof e=="undefined",v=e=>typeof e!="undefined",z=e=>typeof e=="boolean",L=e=>Math.ceil(e/10)*10,S=e=>Math.ceil(e)+.5,U=e=>e[1]-e[0],p=e=>typeof e=="object",B=e=>{for(const t in e)return!1;return!0},C=e=>x(e)||e===null||y(e)&&e.length===0||p(e)&&!(e instanceof Date)&&B(e)||$(e)&&isNaN(e),V=e=>!C(e),P=e=>Array.isArray(e),H=e=>e&&!(e!=null&&e.nodeType)&&p(e)&&!P(e);function R(e){const t=this.config;let n,r,i;const o=()=>{const s=r.shift();if(s&&n&&p(n)&&s in n)return n=n[s],o();if(!s)return n};Object.keys(t).forEach(s=>{n=e,r=s.split("_"),i=o(),v(i)&&(t[s]=i)}),this.api&&(this.state.orgConfig=e)}var w=Object.defineProperty,O=(e,t,n)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t,n)=>O(e,typeof t!="symbol"?t+"":t,n);class d{constructor(t={}){b(this,"$$"),b(this,"options"),b(this,"config"),this.options=t}loadConfig(){R.call(this,this.options)}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}b(d,"version","4.0.1");var D=Object.defineProperty,E=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t,n)=>E(e,typeof t!="symbol"?t+"":t,n);const h=class m extends d{constructor(t){return super(t),this}$init(){const{$$:t}=this;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(t){const n=this.getBubbleR(t),{expandScale:r=1}=this.options;return m.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),n*r}static raiseFocusedBubbleLayer(t){t.raise&&(0,g.select)(t.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(t,n){const{$$:r}=this;return t.filter(i=>i&&!r.isBarType(i.id)).reduce((i,o)=>r.dist(o,n)<this.getBubbleR(o)?o:i,0)}getBubbleR(t){const{minR:n,maxR:r}=this.options,i=this.getZData(t);if(!i)return n;const[o,s]=this.$$.data.targets.reduce(([F,Z],T)=>{const _=this.getZData(T.values[0]);return[Math.min(F,_),Math.max(Z,_)]},[1e4,0]),N=o>0&&s===o?0:i/s;return Math.abs(N)*(r-n)+n}getZData(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value}};j(h,"version","0.0.1");let M=h;return l=l.default,l})()});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -1216,7 +1216,7 @@ class Plugin {
|
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
|
-
__publicField(Plugin, "version", "4.0.
|
|
1219
|
+
__publicField(Plugin, "version", "4.0.1");
|
|
1220
1220
|
|
|
1221
1221
|
;// ./src/Plugin/sparkline/Options.ts
|
|
1222
1222
|
class Options {
|