@carbon/charts-react 1.22.6 → 1.22.7
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/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
71
71
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
72
72
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
73
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:Et(p,"locale.translations.total")||Et(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,ni)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,ni),n.stopPropagation()}t.services.events.dispatchEvent(S.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function PR(e,t){const n=es(this._current,e);return r=>(this._current=n(r),t(this._current))}class mv extends yt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ht.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(L=>L[a]>0),l=this.computeRadius();this.arc=Ds().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ds().innerRadius(this.getInnerRadius()).outerRadius(l+Ht.hoverArc.outerRadiusOffset);const c=pL().value(L=>L[a]).sort(x(i,"pie","sortFunction")).padAngle(Ht.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",pt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,L=>L.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",L=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s],null,L.data)).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[a]}, ${yc(L.data[a],o,a)+"%"}`).attrTween("d",function(L){return PR.bind(this)(L,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=x(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(L=>L.data[a]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",pt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,L=>L.data[s]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter({...L,percentageValue:yc(L.data[a],o,a,!0)}):h(yc(L.data[a],o,a),d)+"%").datum(function(L){const R=l+7,$=(L.endAngle-L.startAngle)/2+L.startAngle,F=$/Math.PI*180,P=this.getComputedTextLength();return L.textOffsetX=P/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+R)*Math.sin($),L.yPosition=(L.textOffsetY+R)*-Math.cos($),L}).attr("transform",function(L,R){const $=f.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(R>=$-2&&F<Ht.callout.minSliceDegree){let P,H;return L.index===$-1?(P=L.xPosition+Ht.callout.offsetX+Ht.callout.textMargin+L.textOffsetX,H=L.yPosition-Ht.callout.offsetY,L.direction=ki.RIGHT,y.push(L)):(P=L.xPosition-Ht.callout.offsetX-L.textOffsetX-Ht.callout.textMargin,H=L.yPosition-Ht.callout.offsetY,L.direction=ki.LEFT,y.push(L)),`translate(${P}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(y);const g=x(i,"donut")?"donut":"pie",b=x(i,g,"alignment"),{width:T}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),E=p?Ht.xOffset:0,O=p?Ht.yOffset:0;let A=l+E;b===Jt.CENTER?A=T/2:b===Jt.RIGHT&&(A=T-l-Ht.xOffset);let I=l+O;y.length>0&&(I+=Ht.yOffsetCallout),r.attr("x",A+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",pt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",pt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===ki.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Ht.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Ht.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=D(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);IC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Ht.radiusOffset:i}}class UR extends mv{constructor(){super(...arguments),this.type="donut",this.renderType=rt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(D(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=cp:s=Ae;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const gv="4,10 8,6 12,10",vv="12,6 8,10 4,6";class BR extends yt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Tm(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case ta.UP:return gv;case ta.DOWN:return vv;default:return t>0?gv:vv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ds().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ds().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=x(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===Jt.CENTER?m=v/2:f===Jt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:v,number:m}=x(n,"locale"),y=x(n,"gauge","numberFormatter"),g=f.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${p}px`).attr("text-anchor","middle").text(L=>{let R;return L!=null?R=Number(L.toFixed(2))%1!==0?L.toFixed(2):L.toFixed():R=0,y?y(R):m(Number(R),v)});const{width:b}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),T=p/2,E=u?"%":"",O=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${T}px`).attr("x",b/2).text(E),{width:A,height:I}=N.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${I/2}px`),f.attr("transform",`translate(-${A/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(T=>{let E;return T!=null?E=Number(T.toFixed(2))%1!==0?T.toFixed(2):T.toFixed():E=0,c?`${c(E)}${m}`:`${a(Number(E),s)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),b=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);b.enter().append("svg").merge(b).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const T=D(this);N.appendOrSelect(T,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=x(r,"gauge","status");N.appendOrSelect(T,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").attr("points",t.getArrow(i))}),b.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class yv extends Yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Xi(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",pt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Qt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-h/2,T=b+h;if(!this.isOutsideZoomedDomain(b,T))return me({x0:p,x1:f,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ps().domain(t).rangeRound([0,this.getGroupWidth()])}}class HR extends yt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const v=this.matrix[r][f].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const v=this.matrix[f][r].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Wn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Wn(l.range())},${c(r)})`),this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(S.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(S.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(S.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[a])}, ${s(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${p})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==Gr.OFF&&(t===Gr.AUTO&&Bp.minCellDividerDimension<=this.xBandwidth&&Bp.minCellDividerDimension<=this.yBandwidth||t===Gr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=cs(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const d=D(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class VR extends yt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>Et(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",pt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=1:m-=1),me({x0:p,x1:f,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=D(this);l.classed("hovered",!0);const c=i(parseFloat(Et(o,"data.x0")),r),u=i(parseFloat(Et(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:Et(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("mouseout",function(){D(this).classed("hovered",!1),s.services.events.dispatchEvent(S.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class FR extends xn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?Mn.weight.unselected:Mn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Mn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?Mn.opacity.unselected:Mn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",Mn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=An(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const v=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Qt.HORIZONTAL?v.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class GR extends yt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-ae.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ae.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=en().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=x(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?ae.height.proportional:ae.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?ae.height.proportional:ae.height.default));const f=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",b=>b.x).attr("y",0).attr("height",()=>p||(s?ae.height.proportional:ae.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:b[c],originalClassName:v})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):Math.max(b.width,2)).style("fill",b=>n.model.getFillColor(b[c],null,b)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),f.exit().remove();const m=x(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<a[0].value&&(y=a[0].value>u?u:a[0].value));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>p||(s?ae.height.proportional:ae.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class zR extends yt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=BC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?_r.opacity.unselected:_r.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?_r.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",_r.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:v,xAxisRectHeight:m}=_r;this.uniqueKeys=Array.from(new Set(s.map(_=>_[u]))),this.uniqueGroups=Array.from(new Set(s.map(_=>_[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),g=(Math.min(r,i)-y)/2;if(g<=0)return;const b=ps().domain(this.fullDataNormalized.map(_=>_[u])).range([0,2*Math.PI].map(_=>_-Math.PI/2)),T=Wn(this.fullDataNormalized.map(_=>_[d])),E=en().domain([T>=0?0:T,gr(this.fullDataNormalized.map(_=>_[d]))]).range([v,g]).nice(f),O=E.ticks(f),A=(_,C,k)=>this.model.getFillColor(_,C,k),I=gL().angle(_=>b(_[u])+Math.PI/2).radius(_=>E(_[d])).curve(Ff),L=this.uniqueKeys.map(_=>{const C=this.getLabelDimensions(_).width,k=G2(b(_),g);return C+k}),R={x:gr(L)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",pt.GROUP).selectAll("path").data(O,_=>_),F=_=>this.uniqueKeys.map(C=>({[u]:C,[d]:_}));$.join(_=>_.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:t})).attr("d",k=>I(F(k))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",pt.GROUP).selectAll("line").data(this.uniqueKeys,_=>_).join(_=>_.append("line").attr("opacity",0).attr("class",C=>`x-axis-${pi(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Zt(b(C),0,R).x).attr("y1",C=>Zt(b(C),0,R).y).attr("x2",C=>Zt(b(C),0,R).x).attr("y2",C=>Zt(b(C),0,R).y).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",k=>Zt(b(k),E.range()[0],R).x).attr("y1",k=>Zt(b(k),E.range()[0],R).y).attr("x2",k=>Zt(b(k),E.range()[1],R).x).attr("y2",k=>Zt(b(k),E.range()[1],R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",k=>Zt(b(k),E.range()[0],R).x).attr("y1",k=>Zt(b(k),E.range()[0],R).y).attr("x2",k=>Zt(b(k),E.range()[1],R).x).attr("y2",k=>Zt(b(k),E.range()[1],R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",pt.GROUP).selectAll("text").data(this.uniqueKeys).join(_=>_.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Zt(b(C),E.range()[1]+h,R).x).attr("y",C=>Zt(b(C),E.range()[1]+h,R).y).style("text-anchor",C=>rm(b(C)).textAnchor).style("dominant-baseline",C=>rm(b(C)).dominantBaseline).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",k=>Zt(b(k),E.range()[1]+h,R).x).attr("y",k=>Zt(b(k),E.range()[1]+h,R).y).end().finally(()=>{const k=x(o,"radar","alignment"),U=this.getAlignmentXOffset(k,n,this.getParent());n.attr("x",U)})),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",pt.GROUP).selectAll("path").data(this.groupedDataNormalized,_=>_.name).join(_=>_.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",C=>A(C.name,null,C.data)).style("fill-opacity",_r.opacity.selected).style("stroke",C=>A(C.name,null,C.data)).call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),k.attr("opacity",1).attr("d",U=>I(U.data))}),_=>(_.attr("class",C=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>A(C.name,null,C.data)).style("stroke",C=>A(C.name,null,C.data)),_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>I(k.data))),_),_=>_.call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",pt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(_=>x(_,d)!==null)).join(_=>_.append("circle").attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),_=>_,_=>_.remove()).attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:_[l],originalClassName:pi(_[u])})).attr("cx",_=>Zt(b(_[u]),E(_[d]),R).x).attr("cy",_=>Zt(b(_[u]),E(_[d]),R).y).attr("r",0).attr("opacity",0).style("fill",_=>A(_[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",pt.GROUP).selectAll("rect").data(this.uniqueKeys).join(_=>_.append("rect"),_=>_,_=>_.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",E.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",_=>`rotate(${im(b(_))}, ${R.x}, ${R.y})`);const{code:P,number:H}=x(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",pt.GROUP).selectAll("text").data(Qe(O)).join(_=>_.append("text").attr("opacity",0).text(C=>H(C,P)).attr("x",C=>Zt(-Math.PI/2,E(C),R).x+p).attr("y",C=>Zt(-Math.PI/2,E(C),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:t})).text(k=>k).attr("opacity",1).attr("x",k=>Zt(-Math.PI/2,E(k),R).x+p).attr("y",k=>Zt(-Math.PI/2,E(k),R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Jt.CENTER?a=Math.floor((s-i.width)/2):t===Jt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",_r.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE)})}}class xv extends Yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,v;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-f);if(m!==0&&m<2&&(d>0&&a===Qt.VERTICAL||d<0&&a===Qt.HORIZONTAL?v=f-2:v=f+2),!this.isOutsideZoomedDomain(h,p))return me({x0:h,x1:p,y0:f,y1:v},a)}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class jR extends xe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class bv extends yt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?$n.opacity.unselected:$n.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",$n.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=ku().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s),null,p)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",$n.opacity.selected).attr("d",this.areaGenerator)}}class _v extends Yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",pt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(v-f)>0&&Math.abs(v-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=1:v-=1)}return me({x0:h,x1:p,y0:f,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ev extends xn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",pt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(v)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[y]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Oi=6;class WR extends yt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+Oi:30-Oi},h=ks({name:o,children:a}),p=10,f=r/6,v=O=>{const A=h.descendants().reverse(),I=h.links();let L=h,R=h;h.eachBefore(U=>{U.x<L.x&&(L=U),U.x>R.x&&(R=U)});const $=R.x-L.x,F=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,L.x,r,$].join(" ")),P=E.selectAll("g").data(A,U=>U.id),H=this,_=P.enter().append("g").attr("transform",()=>`translate(${O.y0},${O.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOVER,{event:U,element:D(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(S.Tree.NODE_CLICK,{event:U,element:D(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOUT,{event:U,element:D(this),datum:B})});_.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),_.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Oi:Oi).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(_).transition(F).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(F).remove().attr("transform",()=>`translate(${O.y},${O.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const C=T.selectAll("path").data(I,U=>U.target.id),k=C.enter().append("path").attr("d",()=>{const U={x:O.x0,y:O.y0};return b({source:U,target:U})});C.merge(k).transition(F).attr("d",b),C.exit().transition(F).remove().attr("d",()=>{const U={x:O.x,y:O.y};return b({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=x(s,"tree","type")===Js.DENDROGRAM?dk().size([i,r-u-y*Oi-l]):Jk().nodeSize([p,f]).size([i,r-u-y*Oi-l]),b=EL().x(O=>O.y).y(O=>O.x);h.x0=f/2,h.y0=0,h.descendants().forEach((O,A)=>{O.id=A,O._children=O.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,p]).style("user-select","none");const T=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");v(h)}}var qR="#000000",YR="#ffffff",ZR="#fcf4d6",XR="#fddc69",KR="#f1c21b",QR="#d2a106",JR="#b28600",tD="#8e6a00",eD="#684e00",nD="#483700",rD="#302400",iD="#1c1500",sD={10:ZR,20:XR,30:KR,40:QR,50:JR,60:tD,70:eD,80:nD,90:rD,100:iD},aD="#fff2e8",oD="#ffd9be",lD="#ffb784",cD="#ff832b",uD="#eb6200",hD="#ba4e00",dD="#8a3800",pD="#5e2900",fD="#3e1a00",mD="#231000",gD={10:aD,20:oD,30:lD,40:cD,50:uD,60:hD,70:dD,80:pD,90:fD,100:mD},vD="#fff1f1",yD="#ffd7d9",xD="#ffb3b8",bD="#ff8389",_D="#fa4d56",ED="#da1e28",TD="#a2191f",OD="#750e13",SD="#520408",wD="#2d0709",$D={10:vD,20:yD,30:xD,40:bD,50:_D,60:ED,70:TD,80:OD,90:SD,100:wD},MD="#fff0f7",CD="#ffd6e8",AD="#ffafd2",kD="#ff7eb6",LD="#ee5396",RD="#d02670",DD="#9f1853",ID="#740937",ND="#510224",PD="#2a0a18",UD={10:MD,20:CD,30:AD,40:kD,50:LD,60:RD,70:DD,80:ID,90:ND,100:PD},BD="#f6f2ff",HD="#e8daff",VD="#d4bbff",FD="#be95ff",GD="#a56eff",zD="#8a3ffc",jD="#6929c4",WD="#491d8b",qD="#31135e",YD="#1c0f30",ZD={10:BD,20:HD,30:VD,40:FD,50:GD,60:zD,70:jD,80:WD,90:qD,100:YD},XD="#edf5ff",KD="#d0e2ff",QD="#a6c8ff",JD="#78a9ff",tI="#4589ff",eI="#0f62fe",nI="#0043ce",rI="#002d9c",iI="#001d6c",sI="#001141",aI={10:XD,20:KD,30:QD,40:JD,50:tI,60:eI,70:nI,80:rI,90:iI,100:sI},oI="#e5f6ff",lI="#bae6ff",cI="#82cfff",uI="#33b1ff",hI="#1192e8",dI="#0072c3",pI="#00539a",fI="#003a6d",mI="#012749",gI="#061727",vI={10:oI,20:lI,30:cI,40:uI,50:hI,60:dI,70:pI,80:fI,90:mI,100:gI},yI="#d9fbfb",xI="#9ef0f0",bI="#3ddbd9",_I="#08bdba",EI="#009d9a",TI="#007d79",OI="#005d5d",SI="#004144",wI="#022b30",$I="#081a1c",MI={10:yI,20:xI,30:bI,40:_I,50:EI,60:TI,70:OI,80:SI,90:wI,100:$I},CI="#defbe6",AI="#a7f0ba",kI="#6fdc8c",LI="#42be65",RI="#24a148",DI="#198038",II="#0e6027",NI="#044317",PI="#022d0d",UI="#071908",BI={10:CI,20:AI,30:kI,40:LI,50:RI,60:DI,70:II,80:NI,90:PI,100:UI},HI="#f2f4f8",VI="#dde1e6",FI="#c1c7cd",GI="#a2a9b0",zI="#878d96",jI="#697077",WI="#4d5358",qI="#343a3f",YI="#21272a",ZI="#121619",XI={10:HI,20:VI,30:FI,40:GI,50:zI,60:jI,70:WI,80:qI,90:YI,100:ZI},KI="#f4f4f4",QI="#e0e0e0",JI="#c6c6c6",tN="#a8a8a8",eN="#8d8d8d",nN="#6f6f6f",rN="#525252",iN="#393939",sN="#262626",aN="#161616",oN={10:KI,20:QI,30:JI,40:tN,50:eN,60:nN,70:rN,80:iN,90:sN,100:aN},lN="#f7f3f2",cN="#e5e0df",uN="#cac5c4",hN="#ada8a8",dN="#8f8b8b",pN="#726e6e",fN="#565151",mN="#3c3838",gN="#272525",vN="#171414",yN={10:lN,20:cN,30:uN,40:hN,50:dN,60:pN,70:fN,80:mN,90:gN,100:vN},Tv={black:{100:qR},blue:aI,coolGray:XI,cyan:vI,gray:oN,green:BI,magenta:UD,orange:gD,purple:ZD,red:$D,teal:MI,warmGray:yN,white:{0:YR},yellow:sD};const xN=e=>{if(!e)return null;for(const t of Object.keys(Tv)){const n=Tv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Ov=function(e){const t=D(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=On(n);let i;if(r&&(i=xN(r?r.hex():null)),i==null){const s=sp(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let bN=0;class _N extends yt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=ks({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=iL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>bN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=D(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${f}`;return new URL(`#${v}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(v=>v.text).style("fill",Ov).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const v=D(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",Ov),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),On(s).darker(.7).toString()}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}}function EN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ON={value:function(){}};function Sv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Po(n)}function Po(e){this._=e}function SN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Po.prototype=Sv.prototype={constructor:Po,on:function(e,t){var n=this._,r=SN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=wN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=wv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=wv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Po(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function wN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function wv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ON,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const $N=Object.freeze(Object.defineProperty({__proto__:null,dispatch:Sv},Symbol.toStringTag,{value:"Module"})),MN=TN($N),CN=MN.dispatch,Zu=Math.PI/180,AN={archimedean:Mv,rectangular:VN},Fs=64,Uo=2048;var kN=function(){var e=[256,256],t=LN,n=RN,r=DN,i=$v,s=$v,a=IN,o=NN,l=Mv,c=[],u=1/0,d=CN("word","end"),h=null,p=Math.random,f={},v=GN;f.canvas=function(g){return arguments.length?(v=tr(g),f):v},f.start=function(){var g=m(v()),b=FN((e[0]>>5)*e[1]),T=null,E=c.length,O=-1,A=[],I=c.map(function(R,$){return R.text=t.call(this,R,$),R.font=n.call(this,R,$),R.style=i.call(this,R,$),R.weight=s.call(this,R,$),R.rotate=a.call(this,R,$),R.size=~~r.call(this,R,$),R.padding=o.call(this,R,$),R}).sort(function(R,$){return $.size-R.size});return h&&clearInterval(h),h=setInterval(L,0),L(),f;function L(){for(var R=Date.now();Date.now()-R<u&&++O<E&&h;){var $=I[O];$.x=e[0]*(p()+.5)>>1,$.y=e[1]*(p()+.5)>>1,PN(g,$,I,O),$.hasText&&y(b,$,T)&&(A.push($),d.call("word",f,$),T?BN(T,$):T=[{x:$.x+$.x0,y:$.y+$.y0},{x:$.x+$.x1,y:$.y+$.y1}],$.x-=e[0]>>1,$.y-=e[1]>>1)}O>=E&&(f.stop(),d.call("end",f,A,T))}},f.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return f};function m(g){const b=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const T=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return g.width=(Fs<<5)/T,g.height=Uo/T,b.fillStyle=b.strokeStyle="red",{context:b,ratio:T}}function y(g,b,T){e[0],e[1];for(var E=b.x,O=b.y,A=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),L=p()<.5?1:-1,R=-L,$,F,P;($=I(R+=L))&&(F=~~$[0],P=~~$[1],!(Math.min(Math.abs(F),Math.abs(P))>=A));)if(b.x=E+F,b.y=O+P,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!T||HN(b,T))&&!UN(b,g,e[0])){for(var H=b.sprite,_=b.width>>5,C=e[0]>>5,k=b.x-(_<<4),U=k&127,B=32-U,X=b.y1-b.y0,Y=(b.y+b.y0)*C+(k>>5),ot,it=0;it<X;it++){ot=0;for(var bt=0;bt<=_;bt++)g[Y+bt]|=ot<<B|(bt<_?(ot=H[it*_+bt])>>>U:0);Y+=C}return!0}return!1}return f.timeInterval=function(g){return arguments.length?(u=g??1/0,f):u},f.words=function(g){return arguments.length?(c=g,f):c},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=tr(g),f):n},f.fontStyle=function(g){return arguments.length?(i=tr(g),f):i},f.fontWeight=function(g){return arguments.length?(s=tr(g),f):s},f.rotate=function(g){return arguments.length?(a=tr(g),f):a},f.text=function(g){return arguments.length?(t=tr(g),f):t},f.spiral=function(g){return arguments.length?(l=AN[g]||g,f):l},f.fontSize=function(g){return arguments.length?(r=tr(g),f):r},f.padding=function(g){return arguments.length?(o=tr(g),f):o},f.random=function(g){return arguments.length?(p=g,f):p},f.on=function(){var g=d.on.apply(d,arguments);return g===d?f:g},f};function LN(e){return e.text}function RN(){return"serif"}function $v(){return"normal"}function DN(e){return Math.sqrt(e.value)}function IN(){return(~~(random()*6)-3)*30}function NN(){return 1}function PN(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Fs<<5)/s,Uo/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const $=i.measureText(t.text),F=-Math.floor($.width/2);let P=($.width+1)*s,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Zu),d=Math.cos(t.rotate*Zu),h=P*d,p=P*u,f=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(p+f),Math.abs(p-f))}else P=P+31>>5<<5;if(H>l&&(l=H),a+P>=Fs<<5&&(a=0,o+=l,l=0),o+H>=Uo)break;i.translate((a+(P>>1))/s,(o+(H>>1))/s),t.rotate&&i.rotate(t.rotate*Zu),i.fillText(t.text,F,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,F,0)),i.restore(),t.width=P,t.height=H,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(Fs<<5)/s,Uo/s).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,b=g>>5,T=t.y1-t.y0,E=0;E<T*b;E++)y[E]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var O=0,A=-1,I=0;I<T;I++){for(var E=0;E<g;E++){var L=b*I+(E>>5),R=m[(o+I)*(Fs<<5)+(a+E)<<2]?1<<31-E%32:0;y[L]|=R,O|=R}O?A=I:(t.y0++,T--,I--,o++)}t.y1=t.y0+A,t.sprite=y.slice(0,(t.y1-t.y0)*b)}}}function UN(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function BN(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function HN(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Mv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function VN(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function FN(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function GN(){return document.createElement("canvas")}function tr(e){return typeof e=="function"?e:function(){return e}}const zN=EN(kN);class jN extends yt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=zN().size([u,d]).words(i.map(function(f){const v=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:v,value:v}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(f,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Qe(i):[1,1];return en().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Fa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class WN extends yt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=SR(s,Object.values(l)),u=ER(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=UA().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=N.appendOrSelect(t,"defs");N.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Is()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case un.geoEqualEarth:t=rk();break;case un.geoAlbers:t=XA();break;case un.geoConicEqualArea:t=Eg();break;case un.geoConicEquidistant:t=ek();break;case un.geoEquirectangular:t=JA();break;case un.geoMercator:t=KA();break;case un.geoNaturalEarth1:t=ik();break;default:throw new Error("Projection is not supported.")}return t}}class qN extends WN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.HIDE,{event:r,hoveredElement:s})})}}function Xu(e){var t=e==null?0:e.length;return t?ha(e,1):[]}function YN(e){return Dh(Ph(e,void 0,Xu),e+"")}function Cv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function ZN(e,t){return t.length<2?e:Rl(e,Cv(t,0,-1))}function XN(e,t){return t=ua(t,e),e=ZN(e,t),e==null||delete e[qi(Ld(t))]}function KN(e){return Xh(e)?void 0:e}var QN=1,JN=2,tP=4,eP=YN(function(e,t){var n={};if(e==null)return n;var r=!1;t=_l(t,function(s){return s=ua(s,e),r||(r=s.length>1),s}),zr(e,ad(e),n),r&&(n=Yi(n,QN|JN|tP,KN));for(var i=t.length;i--;)XN(n,t[i]);return n});function Av(e){return Math.log(e)}function kv(e){return Math.exp(e)}function nP(e){return-Math.log(-e)}function rP(e){return-Math.exp(-e)}function iP(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sP(e){return e===10?iP:e===Math.E?Math.exp:t=>Math.pow(e,t)}function aP(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Lv(e){return(t,n)=>-e(-t,n)}function oP(e){const t=e(Av,kv),n=t.domain;let r=10,i,s;function a(){return i=aP(r),s=sP(r),n()[0]<0?(i=Lv(i),s=Lv(s),e(nP,rP)):e(Av,kv),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,v;const m=o==null?10:+o;let y=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(v=h<0?f/s(-h):f*s(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(v=h>0?f/s(-h):f*s(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=va(c,u,m))}else y=va(h,p,Math.min(p-h,m)).map(s);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=as(l)).precision==null&&(l.trim=!0),l=pc(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(yf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Rv(){const e=oP(Ip()).domain([1,10]);return e.copy=()=>mc(e,Rv()).base(e.base()),ti.apply(e,arguments),e}function Bo(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ho(e){this._context=e}Ho.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lP(e){return new Ho(e)}function Dv(e){this._context=e}Dv.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cP(e){return new Dv(e)}function Iv(e){this._context=e}Iv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uP(e){return new Iv(e)}function Nv(e,t){this._basis=new Ho(e),this._beta=t}Nv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const hP=function e(t){function n(r){return t===1?new Ho(r):new Nv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Vo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Vo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const dP=function e(t){function n(r){return new Ku(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Qu(e,t){this._context=e,this._k=(1-t)/6}Qu.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const pP=function e(t){function n(r){return new Qu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ju(e,t){this._context=e,this._k=(1-t)/6}Ju.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const fP=function e(t){function n(r){return new Ju(r,t)}return n.tension=function(r){return e(+r)},n}(0);function th(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>de){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>de){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function Pv(e,t){this._context=e,this._alpha=t}Pv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:th(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const mP=function e(t){function n(r){return t?new Pv(r,t):new Ku(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Uv(e,t){this._context=e,this._alpha=t}Uv.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:th(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const gP=function e(t){function n(r){return t?new Uv(r,t):new Qu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Bv(e,t){this._context=e,this._alpha=t}Bv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:th(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const vP=function e(t){function n(r){return t?new Bv(r,t):new Ju(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Hv(e){return e<0?-1:1}function Vv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(Hv(s)+Hv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Fv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eh(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function Fo(e){this._context=e}Fo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eh(this,this._t0,Fv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,eh(this,Fv(this,n=Vv(this,e,t)),n);break;default:eh(this,this._t0,n=Vv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Gv(e){this._context=new zv(e)}(Gv.prototype=Object.create(Fo.prototype)).point=function(e,t){Fo.prototype.point.call(this,t,e)};function zv(e){this._context=e}zv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function yP(e){return new Fo(e)}function xP(e){return new Gv(e)}function jv(e){this._context=e}jv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Wv(e),i=Wv(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Wv(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function bP(e){return new jv(e)}function Go(e,t){this._context=e,this._t=t}Go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function _P(e){return new Go(e,.5)}function EP(e){return new Go(e,0)}function TP(e){return new Go(e,1)}class OP extends Nn{zoomIn(t,n,r){let i,s,a;const o=r||ni;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||ni;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT)}}class SP extends Nn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class wP extends Nn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class $P extends Nn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(S.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(Fp,n,"duration")||Fp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Gs(e,t){const n=+Yt(e)-+Yt(t);return n<0?-1:n>0?1:n}function MP(e,t,n){const[r,i]=cr(void 0,e,t);return r.getFullYear()-i.getFullYear()}function CP(e,t,n){const[r,i]=cr(void 0,e,t),s=Gs(r,i),a=Math.abs(MP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Gs(r,i)===-s,l=s*(a-+o);return l===0?0:l}function nh(e,t,n){const r=Yt(e,void 0);if(isNaN(t))return Be(e,NaN);if(!t)return r;const i=r.getDate(),s=Be(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function qv(e,t,n){return nh(e,t*12)}function AP(e,t,n){return qv(e,-t)}function kP(e,t,n){const[r,i]=cr(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function LP(e,t){const n=Yt(e,void 0);return n.setHours(23,59,59,999),n}function RP(e,t){const n=Yt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function DP(e,t){const n=Yt(e,void 0);return+LP(n)==+RP(n)}function IP(e,t,n){const[r,i,s]=cr(void 0,e,e,t),a=Gs(i,s),o=Math.abs(kP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Gs(i,s)===-a;DP(r)&&o===1&&Gs(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function NP(e,t,n){return nh(e,-t)}function PP(e,t,n){const[r,i]=cr(void 0,e,t),s=Yv(r,i),a=Math.abs(tf(r,i));r.setDate(r.getDate()-s*a);const o=+(Yv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Yv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Zv(e,t,n){const r=Yt(e,void 0);return isNaN(t)?Be(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function UP(e,t,n){return Zv(e,-t)}function rh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function BP(e,t,n){const[r,i]=cr(void 0,e,t),s=(+r-+i)/Eh;return rh(void 0)(s)}function Xv(e,t,n){return Be(e,+Yt(e)+t)}function Kv(e,t,n){return Xv(e,t*Eh)}function HP(e,t,n){return Kv(e,-t)}function Qv(e,t){return+Yt(e)-+Yt(t)}function Jv(e,t,n){const r=Qv(e,t)/_h;return rh(void 0)(r)}function ih(e,t,n){const r=Yt(e,void 0);return r.setTime(r.getTime()+t*_h),r}function t0(e,t,n){return ih(e,-t)}function e0(e,t,n){const r=Qv(e,t)/1e3;return rh(void 0)(r)}function sh(e,t,n){return Xv(e,t*1e3)}function n0(e,t,n){return sh(e,-t)}class VP extends Nn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===G.BOTTOM||t===G.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(G).map(t=>G[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Qt.VERTICAL:this.orientation=Qt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[G.LEFT])!=null&&t.correspondingDatasets&&a[G.RIGHT]||(n=a[G.RIGHT])!=null&&n.correspondingDatasets&&a[G.LEFT]||(r=a[G.TOP])!=null&&r.correspondingDatasets&&a[G.BOTTOM]||(i=a[G.BOTTOM])!=null&&i.correspondingDatasets&&a[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===tt.LINEAR||this.scaleTypes[t]===tt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case tt.LABELS:c=t(l)+t.step()/2;break;case tt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===tt.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return FP(n,s)}else return GP(n,qn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,G.LEFT)===null&&x(n,G.RIGHT)!==null||x(n,G.RIGHT,"main")===!0||r&&x(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,G.BOTTOM)===null&&x(n,G.TOP)!==null||x(n,G.TOP,"main")===!0||r&&x(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||tt.LINEAR,o=s.scaleType||tt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===tt.LABELS||o===tt.TIME)&&a===tt.LABELS||a===tt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||tt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,gr(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=qn.ratio;if(r.domain)return a===tt.LABELS?r.domain:(a===tt.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===tt.LABELS)return Xi(o.map(y=>y[c]));let f,v;const m=this.model.getDataGroupNames();if(a===tt.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[p]}`);if(a===tt.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),b=o.filter(E=>!m.includes(E[y])),T=[];g.forEach(E=>{const{...O}=E;let A=0,I=0;Object.values(eP(O,"sharedStackKey")).forEach(L=>{isNaN(L)||(L<0?I+=L:A+=L)}),T.push([I,A])}),v=[...Xu(T),...b.map(E=>E[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return a!==tt.TIME&&a!==tt.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=x(y,"value");g!==null&&v.push(g)}),f=Qe(v),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||tt.LINEAR;this.scaleTypes[t]=i;let s;return i===tt.TIME?s=Pf():i===tt.LOG?s=Rv().base(r.base||10):i===tt.LABELS||i===tt.LABELS_RATIO?s=ps():s=en(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Qt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),x(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===tt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function FP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return CP(r,n)>1?[AP(n,t),qv(r,t)]:IP(r,n)>1?[NP(n,t),nh(r,t)]:PP(r,n)>1?[UP(n,t),Zv(r,t)]:BP(r,n)>1?[HP(n,t),Kv(r,t)]:Jv(r,n)>30?[t0(n,t*30),ih(r,t*30)]:Jv(r,n)>1?[t0(n,t),ih(r,t)]:e0(r,n)>15?[n0(n,t*15),sh(r,t*15)]:e0(r,n)>1?[n0(n,t),sh(r,t)]:[n,r]}function GP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===tt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class zP extends Nn{constructor(){super(...arguments),this.curveTypes={curveLinear:Za,curveLinearClosed:Ff,curveBasis:lP,curveBasisClosed:cP,curveBasisOpen:uP,curveBundle:hP,curveCardinal:dP,curveCardinalClosed:pP,curveCardinalOpen:fP,curveCatmullRom:mP,curveCatmullRomClosed:gP,curveCatmullRomOpen:vP,curveMonotoneX:yP,curveMonotoneY:xP,curveNatural:bP,curveStep:_P,curveStepAfter:TP,curveStepBefore:EP}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class jP extends Nn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===tt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=x(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Qe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=ke.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=x(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}}function WP(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Cv(e,t,n)}var qP="\\ud800-\\udfff",YP="\\u0300-\\u036f",ZP="\\ufe20-\\ufe2f",XP="\\u20d0-\\u20ff",KP=YP+ZP+XP,QP="\\ufe0e\\ufe0f",JP="\\u200d",t3=RegExp("["+JP+qP+KP+QP+"]");function r0(e){return t3.test(e)}function e3(e){return e.split("")}var i0="\\ud800-\\udfff",n3="\\u0300-\\u036f",r3="\\ufe20-\\ufe2f",i3="\\u20d0-\\u20ff",s3=n3+r3+i3,a3="\\ufe0e\\ufe0f",o3="["+i0+"]",ah="["+s3+"]",oh="\\ud83c[\\udffb-\\udfff]",l3="(?:"+ah+"|"+oh+")",s0="[^"+i0+"]",a0="(?:\\ud83c[\\udde6-\\uddff]){2}",o0="[\\ud800-\\udbff][\\udc00-\\udfff]",c3="\\u200d",l0=l3+"?",c0="["+a3+"]?",u3="(?:"+c3+"(?:"+[s0,a0,o0].join("|")+")"+c0+l0+")*",h3=c0+l0+u3,d3="(?:"+[s0+ah+"?",ah,a0,o0,o3].join("|")+")",p3=RegExp(oh+"(?="+oh+")|"+d3+h3,"g");function f3(e){return e.match(p3)||[]}function m3(e){return r0(e)?f3(e):e3(e)}function g3(e){return function(t){t=Wi(t);var n=r0(t)?m3(t):void 0,r=n?n[0]:t.charAt(0),i=n?WP(n,1).join(""):t.slice(1);return r[e]()+i}}var v3=g3("toUpperCase");function y3(e){return v3(Wi(e).toLowerCase())}var x3=Em(function(e,t,n){return t=t.toLowerCase(),e+(n?y3(t):t)});class an{constructor(t,n){this.components=[],this.services={canvasZoom:OP,domUtils:N,events:SP,files:wP,gradientUtils:zc,transitions:$P},this.model=new fn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(S.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(S.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(S.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new Hu(this.model,this.services)],growth:ht.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new GL(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new Ie(this.model,this.services,[l,...i?[c]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:x(n,"graphFrameRenderType")||rt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=It.COLUMN;if(h){const y=x(r,"legend","position");y==="left"?(p=It.ROW,r.legend.orientation||(r.legend.orientation=Fr.VERTICAL)):y==="right"?(p=It.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Fr.VERTICAL)):y==="bottom"&&(p=It.COLUMN_REVERSE)}const f={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new Ie(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new Vu(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,m,{direction:It.COLUMN})]}}class we extends an{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:VP,curves:zP,zoom:jP}),this.model=new Or(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",G.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===G.BOTTOM&&o===tt.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},p={id:"header",components:[new Ie(this.model,this.services,[d,...s?[h]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},f={id:"legend",components:[new Hu(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new Kg(this.model,this.services),new zL(this.model,this.services)),t.push(new WL(this.model,this.services)),t.push(new qL(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=It.COLUMN;if(m){const O=x(this.model.getOptions(),"legend","position");O===Vr.LEFT?(y=It.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Fr.VERTICAL)):O===Vr.RIGHT?(y=It.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Fr.VERTICAL)):O===Vr.BOTTOM&&(y=It.COLUMN_REVERSE)}const g={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},b={id:"full-frame",components:[new Ie(this.model,this.services,[...m?[f]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},T={id:"zoom-bar",components:[new jL(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},E=[];if(u||s){E.push(p);const O={id:"spacer",components:[new Hn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};E.push(O)}return l&&E.push(T),E.push(b),[new ev(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,E,{direction:It.COLUMN})]}}class b3 extends an{constructor(t,n){super(t,n),this.model=new o$(this.services),this.model.setOptions(zt(Nt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new pR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class _3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Tn(Nt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new Ei(this.model,this.services),new uv(this.model,this.services),new xn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class E3 extends we{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(zt(Nt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new gR(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class T3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new vR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class O3 extends we{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(zt(Nt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class S3 extends an{constructor(t,n){super(t,n),this.model=new u$(this.services),this.model.setOptions(zt(Nt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[a,...i?[o]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new fv(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=It.COLUMN_REVERSE,p={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new Vu(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,v,{direction:It.COLUMN})]}getComponents(){const t=[new qN(this.model,this.services)];return this.getChartComponents(t)}}class w3 extends an{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(zt(Nt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new NR(this.model,this.services)];return this.getChartComponents(t)}}const u0={[Me.LINE]:[Ei,xn],[Me.SCATTER]:[xn],[Me.AREA]:[uv,Ei,xn],[Me.STACKED_AREA]:[bv,Ei,Ev,No],[Me.SIMPLE_BAR]:[xv],[Me.GROUPED_BAR]:[yv,Ti],[Me.STACKED_BAR]:[_v,No]};class $3 extends we{constructor(t,n){super(t,n);const r=zt(Nt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Me.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(u0).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${x3(i.type)}Chart`;return a=ct({},Nt[l],this.model.getOptions(),i.options),i.type===Me.STACKED_AREA&&(o=!0),u0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Xu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Me.STACKED_BAR||i.type===Me.STACKED_AREA),r=[new Se(this.model,this.services),new Ne(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID}),...n?[]:[new Jn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class h0 extends an{constructor(t,n,r=!1){super(t,n),this.model=new d$(this.services),!r&&(this.model.setOptions(zt(Nt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new mv(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}class M3 extends h0{constructor(t,n){super(t,n,!0),this.model.setOptions(zt(Nt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new UR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.DONUT})];return this.getChartComponents(t)}}class C3 extends an{constructor(t,n){super(t,n),this.model=new p$(this.services),this.model.setOptions(zt(Nt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new BR(this.model,this.services)];return this.getChartComponents(t)}}class A3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yv(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class k3 extends we{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(zt(Nt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[a,...i?[o]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new fv(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=It.COLUMN_REVERSE,p={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new ev(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,v,{direction:It.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new HR(this.model,this.services)];return this.getAxisChartComponents(t)}}class L3 extends we{constructor(t,n){super(t,n),this.model=new m$(this.services),this.model.setOptions(zt(Nt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new $R(this.model,this.services),new VR(this.model,this.services)];return this.getAxisChartComponents(t)}}class R3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new Ei(this.model,this.services),new xn(this.model,this.services,{handleThresholds:!0}),new jR(this.model,this.services),new Ti(this.model,this.services)];return this.getAxisChartComponents(t)}}class D3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new FR(this.model,this.services),new xn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class I3 extends an{constructor(t,n){var r;super(t,n),this.model=new g$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?ct(Tn(Nt.proportionalMeterChart),n.options):ct(Tn(Nt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new IR(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Hn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new GR(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new Ie(this.model,this.services,t,{direction:It.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class N3 extends an{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(zt(Nt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new zR(this.model,this.services)];return this.getChartComponents(t)}}class P3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class U3 extends an{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(zt(Nt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new WR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class B3 extends an{constructor(t,n){super(t,n),this.model=new x$(this.services),this.model.setOptions(zt(Nt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new _N(this.model,this.services)];return this.getChartComponents(t)}}class H3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new xv(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class V3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new No(this.model,this.services),new bv(this.model,this.services),new Ei(this.model,this.services,{stacked:!0}),new Ev(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class F3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new No(this.model,this.services),new _v(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ}),new Ti(this.model,this.services)];return this.getAxisChartComponents(t)}}class G3 extends an{constructor(t,n){super(t,n),this.model=new b$(this.services),this.model.setOptions(zt(Nt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new jN(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}function z3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},zs={};/**
|
|
73
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(f=>{if(f!==null)return typeof f.data.value=="number"?{label:f.data.name,value:f.data.value}:{label:f.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:f.value}});const p=t.model.getOptions();u=[{label:Et(p,"locale.translations.total")||Et(p,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(S.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,ni)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,ni),n.stopPropagation()}t.services.events.dispatchEvent(S.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function PR(e,t){const n=es(this._current,e);return r=>(this._current=n(r),t(this._current))}class mv extends yt{constructor(){super(...arguments),this.type="pie",this.renderType=rt.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ht.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(L=>L[a]>0),l=this.computeRadius();this.arc=Ds().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ds().innerRadius(this.getInnerRadius()).outerRadius(l+Ht.hoverArc.outerRadiusOffset);const c=pL().value(L=>L[a]).sort(x(i,"pie","sortFunction")).padAngle(Ht.padAngle)(o),u=N.appendOrSelect(r,"g.slices").attr("role",pt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,L=>L.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",L=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s],null,L.data)).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[a]}, ${yc(L.data[a],o,a)+"%"}`).attrTween("d",function(L){return PR.bind(this)(L,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:d,number:h}=x(i,"locale"),p=i.pie.labels.enabled,f=p?c.filter(L=>L.data[a]>0):[],v=N.appendOrSelect(r,"g.labels").attr("role",pt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(f,L=>L.data[s]);v.exit().attr("opacity",0).remove();const m=v.enter().append("text").classed("pie-label",!0),y=[];m.merge(v).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter({...L,percentageValue:yc(L.data[a],o,a,!0)}):h(yc(L.data[a],o,a),d)+"%").datum(function(L){const R=l+7,$=(L.endAngle-L.startAngle)/2+L.startAngle,F=$/Math.PI*180,P=this.getComputedTextLength();return L.textOffsetX=P/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+R)*Math.sin($),L.yPosition=(L.textOffsetY+R)*-Math.cos($),L}).attr("transform",function(L,R){const $=f.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(R>=$-2&&F<Ht.callout.minSliceDegree){let P,H;return L.index===$-1?(P=L.xPosition+Ht.callout.offsetX+Ht.callout.textMargin+L.textOffsetX,H=L.yPosition-Ht.callout.offsetY,L.direction=ki.RIGHT,y.push(L)):(P=L.xPosition-Ht.callout.offsetX-L.textOffsetX-Ht.callout.textMargin,H=L.yPosition-Ht.callout.offsetY,L.direction=ki.LEFT,y.push(L)),`translate(${P}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(y);const g=x(i,"donut")?"donut":"pie",b=x(i,g,"alignment"),{width:T}=N.getSVGElementSize(this.getParent(),{useAttrs:!0}),E=p?Ht.xOffset:0,O=p?Ht.yOffset:0;let A=l+E;b===Jt.CENTER?A=T/2:b===Jt.RIGHT&&(A=T-l-Ht.xOffset);let I=l+O;y.length>0&&(I+=Ht.yOffsetCallout),r.attr("x",A+7).attr("y",I),this.addEventListeners()}renderCallouts(t){const n=N.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",pt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",pt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===ki.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Ht.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Ht.callout.offsetX,y:o-Ht.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Ht.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=D(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);IC(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(S.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=N.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Ht.radiusOffset:i}}class UR extends mv{constructor(){super(...arguments),this.type="donut",this.renderType=rt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=N.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");N.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(D(this))}),a!==null&&a!==""&&N.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=cp:s=Ae;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=x(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const gv="4,10 8,6 12,10",vv="12,6 8,10 4,6";class BR extends yt{constructor(){super(...arguments),this.type="gauge",this.renderType=rt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Tm(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case ta.UP:return gv;case ta.DOWN:return vv;default:return t>0?gv:vv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ds().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ds().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),N.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const p=n.selectAll("path.arc-foreground").data([i]);p.enter().append("path").merge(p).attr("class",this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),p.exit().remove();const f=x(r,"gauge","alignment"),{width:v}=N.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;f===Jt.CENTER?m=v/2:f===Jt.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.SEMI&&s&&(d=-(l(a)+c));const h=N.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),p=o(a),f=N.appendOrSelect(h,"g.gauge-value-number"),{code:v,number:m}=x(n,"locale"),y=x(n,"gauge","numberFormatter"),g=f.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${p}px`).attr("text-anchor","middle").text(L=>{let R;return L!=null?R=Number(L.toFixed(2))%1!==0?L.toFixed(2):L.toFixed():R=0,y?y(R):m(Number(R),v)});const{width:b}=N.getSVGElementSize(N.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),T=p/2,E=u?"%":"",O=N.appendOrSelect(f,"text.gauge-value-symbol").style("font-size",`${T}px`).attr("x",b/2).text(E),{width:A,height:I}=N.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${I/2}px`),f.attr("transform",`translate(-${A/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=x(r,"locale");if(i){const o=this.computeRadius(),l=i?x(r,"gauge","deltaFontSize"):()=>0,c=i?x(r,"gauge","numberFormatter"):()=>null,u=x(r,"gauge","deltaArrow","size"),d=x(r,"gauge","numberSpacing"),h=x(r,"gauge","showPercentageSymbol"),p=N.appendOrSelect(n,"g.gauge-numbers"),f=N.appendOrSelect(p,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),v=N.appendOrSelect(f,"text.gauge-delta-number"),m=h?"%":"";v.data(i===null?[]:[i]),v.enter().append("text").classed("gauge-delta-number",!0).merge(v).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(T=>{let E;return T!=null?E=Number(T.toFixed(2))%1!==0?T.toFixed(2):T.toFixed():E=0,c?`${c(E)}${m}`:`${a(Number(E),s)}${m}`});const{width:y}=N.getSVGElementSize(N.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),b=f.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);b.enter().append("svg").merge(b).attr("class","gauge-delta-arrow").attr("x",-u(o)-y/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const T=D(this);N.appendOrSelect(T,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=x(r,"gauge","status");N.appendOrSelect(T,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").attr("points",t.getArrow(i))}),b.exit().remove(),v.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class yv extends Yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=rt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Xi(n.map(u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return u[d]&&typeof u[d].toString=="function"?u[d].toString():u[d]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",pt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const d=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Qt.VERTICAL?`translate(${d}, 0)`:`translate(0, ${d})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>{const d=this.services.cartesianScales.getDomainIdentifier(u);return this.model.getFillColor(u[i],u[d],u)}).attr("d",u=>{const d=this.groupScale(u[i]),h=this.getBarWidth(),p=d,f=d+h,v=this.services.cartesianScales.getRangeAxisPosition({datum:u}),m=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,m),g=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-h/2,T=b+h;if(!this.isOutsideZoomedDomain(b,T))return me({x0:p,x1:f,y0:y,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ps().domain(t).rangeRound([0,this.getGroupWidth()])}}class HR extends yt{constructor(){super(...arguments),this.type="heatmap",this.renderType=rt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,p=null;this.matrix[r]!==void 0?(u=a,i.forEach(f=>{if(typeof this.matrix[r][f].value=="number"){const v=this.matrix[r][f].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})):(u=o,s.forEach(f=>{if(typeof this.matrix[f][r].value=="number"){const v=this.matrix[f][r].value;if(d===null){d=v,h=v,p=v;return}d+=v,h=v<h?v:h,p=v>p?v:p}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Wn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Wn(l.range())},${c(r)})`),this.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:p!==null?p:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(S.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(S.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(S.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(S.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const p=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",p).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const f=n.selectAll().data(u).enter().append("g").attr("class",v=>`heat-${v.index}`).classed("cell",!0).attr("transform",v=>`translate(${i(v[a])}, ${s(v[o])})`).append("rect").attr("class",v=>this.model.getColorClassName({value:v.value,originalClassName:`heat-${v.index}`})).classed("heat",!0).classed("null-state",v=>v.index===-1||v.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",v=>{const m=this.services.cartesianScales.getDomainIdentifier(v);return v.index===-1||v.value===null?`url(#${p})`:this.model.getFillColor(Number(v.value),v[m],v)}).attr("aria-label",v=>v.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(f.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=N.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);N.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),N.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),N.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),N.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==Gr.OFF&&(t===Gr.AUTO&&Bp.minCellDividerDimension<=this.xBandwidth&&Bp.minCellDividerDimension<=this.yBandwidth||t===Gr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Et(r,"locale.translations.total")||Et(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=cs(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(S.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const d=D(this).select("rect.heat"),h=d.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),h||(t.services.events.dispatchEvent(S.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{event:c,hoveredElement:d}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class VR extends yt{constructor(){super(...arguments),this.type="histogram",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>Et(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",pt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,p=this.services.cartesianScales.getDomainValue(d.x0),f=p+h,v=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-v)>0&&Math.abs(m-v)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=1:m-=1),me({x0:p,x1:f,y0:v,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=x(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=D(this);l.classed("hovered",!0);const c=i(parseFloat(Et(o,"data.x0")),r),u=i(parseFloat(Et(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(S.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:Et(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(S.Tooltip.MOVE,{event:a})}).on("mouseout",function(){D(this).classed("hovered",!1),s.services.events.dispatchEvent(S.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class FR extends xn{constructor(){super(...arguments),this.type="lollipop",this.renderType=rt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?Mn.weight.unselected:Mn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Mn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?Mn.opacity.unselected:Mn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",Mn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,p]=An(c,u,d),f=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);f.exit().attr("opacity",0).remove();const v=f.enter().append("line").attr("opacity",0).merge(f).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Qt.HORIZONTAL?v.attr("y1",p).attr("y2",p).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>p(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(S.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(S.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class GR extends yt{constructor(){super(...arguments),this.type="meter",this.renderType=rt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-ae.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ae.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=N.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const d=en().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),p=x(i,"meter","height");N.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",p||(s?ae.height.proportional:ae.height.default)),N.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",p||(s?ae.height.proportional:ae.height.default));const f=r.selectAll("rect.value").data(h),v=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";f.enter().append("rect").classed("value",!0).merge(f).attr("x",b=>b.x).attr("y",0).attr("height",()=>p||(s?ae.height.proportional:ae.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:b[c],originalClassName:v})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):Math.max(b.width,2)).style("fill",b=>n.model.getFillColor(b[c],null,b)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),f.exit().remove();const m=x(i,"meter","peak");let y=m;m!==null&&(m>u?y=u:m<0&&(y=0));const g=r.selectAll("line.peak").data(y==null?[]:[y]);g.enter().append("line").classed("peak",!0).merge(g).attr("y1",0).attr("y2",()=>p||(s?ae.height.proportional:ae.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),g.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class zR extends yt{constructor(){super(...arguments),this.type="radar",this.renderType=rt.SVG,this.getLabelDimensions=t=>{const n=N.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=N.appendOrSelect(n,"text").text(t),{width:i,height:s}=N.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=BC(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?_r.opacity.unselected:_r.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?_r.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",_r.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:p,yTicksNumber:f,minRange:v,xAxisRectHeight:m}=_r;this.uniqueKeys=Array.from(new Set(s.map(_=>_[u]))),this.uniqueGroups=Array.from(new Set(s.map(_=>_[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+p),g=(Math.min(r,i)-y)/2;if(g<=0)return;const b=ps().domain(this.fullDataNormalized.map(_=>_[u])).range([0,2*Math.PI].map(_=>_-Math.PI/2)),T=Wn(this.fullDataNormalized.map(_=>_[d])),E=en().domain([T>=0?0:T,gr(this.fullDataNormalized.map(_=>_[d]))]).range([v,g]).nice(f),O=E.ticks(f),A=(_,C,k)=>this.model.getFillColor(_,C,k),I=gL().angle(_=>b(_[u])+Math.PI/2).radius(_=>E(_[d])).curve(Ff),L=this.uniqueKeys.map(_=>{const C=this.getLabelDimensions(_).width,k=G2(b(_),g);return C+k}),R={x:gr(L)+h,y:i/2},$=N.appendOrSelect(n,"g.y-axes").attr("role",pt.GROUP).selectAll("path").data(O,_=>_),F=_=>this.uniqueKeys.map(C=>({[u]:C,[d]:_}));$.join(_=>_.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>I(F(k)))),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:t})).attr("d",k=>I(F(k))).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-axes").attr("role",pt.GROUP).selectAll("line").data(this.uniqueKeys,_=>_).join(_=>_.append("line").attr("opacity",0).attr("class",C=>`x-axis-${pi(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Zt(b(C),0,R).x).attr("y1",C=>Zt(b(C),0,R).y).attr("x2",C=>Zt(b(C),0,R).x).attr("y2",C=>Zt(b(C),0,R).y).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",k=>Zt(b(k),E.range()[0],R).x).attr("y1",k=>Zt(b(k),E.range()[0],R).y).attr("x2",k=>Zt(b(k),E.range()[1],R).x).attr("y2",k=>Zt(b(k),E.range()[1],R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",k=>Zt(b(k),E.range()[0],R).x).attr("y1",k=>Zt(b(k),E.range()[0],R).y).attr("x2",k=>Zt(b(k),E.range()[1],R).x).attr("y2",k=>Zt(b(k),E.range()[1],R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.x-labels").attr("role",pt.GROUP).selectAll("text").data(this.uniqueKeys).join(_=>_.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Zt(b(C),E.range()[1]+h,R).x).attr("y",C=>Zt(b(C),E.range()[1]+h,R).y).style("text-anchor",C=>rm(b(C)).textAnchor).style("dominant-baseline",C=>rm(b(C)).dominantBaseline).call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",k=>Zt(b(k),E.range()[1]+h,R).x).attr("y",k=>Zt(b(k),E.range()[1]+h,R).y).end().finally(()=>{const k=x(o,"radar","alignment"),U=this.getAlignmentXOffset(k,n,this.getParent());n.attr("x",U)})),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),N.appendOrSelect(n,"g.blobs").attr("role",pt.GROUP).selectAll("path").data(this.groupedDataNormalized,_=>_.name).join(_=>_.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",C=>A(C.name,null,C.data)).style("fill-opacity",_r.opacity.selected).style("stroke",C=>A(C.name,null,C.data)).call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_enter",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),k.attr("opacity",1).attr("d",U=>I(U.data))}),_=>(_.attr("class",C=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>A(C.name,null,C.data)).style("stroke",C=>A(C.name,null,C.data)),_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>I(k.data))),_),_=>_.call(C=>{const k=C.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"radar_blobs_exit",animate:t}));t&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),N.appendOrSelect(n,"g.dots").attr("role",pt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(_=>x(_,d)!==null)).join(_=>_.append("circle").attr("role",pt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),_=>_,_=>_.remove()).attr("class",_=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:_[l],originalClassName:pi(_[u])})).attr("cx",_=>Zt(b(_[u]),E(_[d]),R).x).attr("cy",_=>Zt(b(_[u]),E(_[d]),R).y).attr("r",0).attr("opacity",0).style("fill",_=>A(_[l])),N.appendOrSelect(n,"g.x-axes-rect").attr("role",pt.GROUP).selectAll("rect").data(this.uniqueKeys).join(_=>_.append("rect"),_=>_,_=>_.remove()).attr("x",R.x).attr("y",R.y-m/2).attr("width",E.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",_=>`rotate(${im(b(_))}, ${R.x}, ${R.y})`);const{code:P,number:H}=x(o,"locale");N.appendOrSelect(n,"g.y-labels").attr("role",pt.GROUP).selectAll("text").data(Qe(O)).join(_=>_.append("text").attr("opacity",0).text(C=>H(C,P)).attr("x",C=>Zt(-Math.PI/2,E(C),R).x+p).attr("y",C=>Zt(-Math.PI/2,E(C),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:t})).text(k=>k).attr("opacity",1).attr("x",k=>Zt(-Math.PI/2,E(k),R).x+p).attr("y",k=>Zt(-Math.PI/2,E(k),R).y)),_=>_.call(C=>C.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=N.getSVGElementSize(n,{useBBox:!0}),{width:s}=N.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Jt.CENTER?a=Math.floor((s-i.width)/2):t===Jt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",p=>l.indexOf(p[u])!==-1?1:0).attr("r",_r.dotsRadius);const h=t.fullDataNormalized.filter(p=>p[n]===i&&l.indexOf(p[u])!==-1);t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(p=>typeof p[d]=="number").map(p=>({label:p[u],value:p[d],color:t.model.getFillColor(p[u],null,p),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:p[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(S.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${pi(i)}`),o=t.parent.selectAll(`.dots circle.${pi(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(S.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(S.Tooltip.HIDE)})}}class xv extends Yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return this.model.getFillColor(l[r],l[c],l)}).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),d=l[c],h=this.services.cartesianScales.getDomainValue(l)-u/2,p=h+u;let f,v;if(Array.isArray(d)&&d.length===2)f=this.services.cartesianScales.getRangeValue(d[0]),v=this.services.cartesianScales.getRangeValue(d[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,y)),v=this.services.cartesianScales.getRangeValue(l)}const m=Math.abs(v-f);if(m!==0&&m<2&&(d>0&&a===Qt.VERTICAL||d<0&&a===Qt.HORIZONTAL?v=f-2:v=f+2),!this.isOutsideZoomedDomain(h,p))return me({x0:h,x1:p,y0:f,y1:v},a)}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class jR extends xe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=N.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=N.appendOrSelect(t,"svg.chart-skeleton.DAII"),N.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class bv extends yt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?$n.opacity.unselected:$n.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",$n.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=ku().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s),null,p)).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",$n.opacity.selected).attr("d",this.areaGenerator)}}class _v extends Yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",pt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,p=h+d,f=this.services.cartesianScales.getRangeValue(c[0]);let v=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,p)){if(Math.abs(v-f)>0&&Math.abs(v-f)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=c[1]===0?2:1:v-=1:m||(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?v+=1:v-=1)}return me({x0:h,x1:p,y0:f,y1:v},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",pt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(S.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(S.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(S.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=N.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ev extends xn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=rt.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",pt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const d=u[i],h=this.services.cartesianScales.getDomainIdentifier(u),p=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:d,[h]:u.data.sharedStackKey,[p]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],p=u.data.sharedStackKey;let f=u.data[h];const v=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),y=this.services.cartesianScales.getRangeIdentifier(u);f!=null&&t===this.services.cartesianScales.getDomainValue(p)&&n===this.services.cartesianScales.getRangeValue(v)&&(s&&(f=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),f!==null&&o.push({[i]:h,[m]:p,[y]:f}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Oi=6;class WR extends yt{constructor(){super(...arguments),this.type="tree",this.renderType=rt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=N.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={top:0,right:0,bottom:0,left:l>0?l+Oi:30-Oi},h=ks({name:o,children:a}),p=10,f=r/6,v=O=>{const A=h.descendants().reverse(),I=h.links();let L=h,R=h;h.eachBefore(U=>{U.x<L.x&&(L=U),U.x>R.x&&(R=U)});const $=R.x-L.x,F=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,L.x,r,$].join(" ")),P=E.selectAll("g").data(A,U=>U.id),H=this,_=P.enter().append("g").attr("transform",()=>`translate(${O.y0},${O.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOVER,{event:U,element:D(this),datum:B})}).on("click",function(U,B){B.depth!==0&&(B.children=B.children?null:B._children,v(B)),H.services.events.dispatchEvent(S.Tree.NODE_CLICK,{event:U,element:D(this),datum:B})}).on("mouseout",function(U,B){H.services.events.dispatchEvent(S.Tree.NODE_MOUSEOUT,{event:U,element:D(this),datum:B})});_.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),_.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Oi:Oi).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(_).transition(F).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(F).remove().attr("transform",()=>`translate(${O.y},${O.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const C=T.selectAll("path").data(I,U=>U.target.id),k=C.enter().append("path").attr("d",()=>{const U={x:O.x0,y:O.y0};return b({source:U,target:U})});C.merge(k).transition(F).attr("d",b),C.exit().transition(F).remove().attr("d",()=>{const U={x:O.x,y:O.y};return b({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},m=h.descendants(),y=m[m.length-1].depth,g=x(s,"tree","type")===Js.DENDROGRAM?dk().size([i,r-u-y*Oi-l]):Jk().nodeSize([p,f]).size([i,r-u-y*Oi-l]),b=EL().x(O=>O.y).y(O=>O.x);h.x0=f/2,h.y0=0,h.descendants().forEach((O,A)=>{O.id=A,O._children=O.children}),g(h),n.attr("viewBox",[-d.left,-d.top,r,p]).style("user-select","none");const T=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");v(h)}}var qR="#000000",YR="#ffffff",ZR="#fcf4d6",XR="#fddc69",KR="#f1c21b",QR="#d2a106",JR="#b28600",tD="#8e6a00",eD="#684e00",nD="#483700",rD="#302400",iD="#1c1500",sD={10:ZR,20:XR,30:KR,40:QR,50:JR,60:tD,70:eD,80:nD,90:rD,100:iD},aD="#fff2e8",oD="#ffd9be",lD="#ffb784",cD="#ff832b",uD="#eb6200",hD="#ba4e00",dD="#8a3800",pD="#5e2900",fD="#3e1a00",mD="#231000",gD={10:aD,20:oD,30:lD,40:cD,50:uD,60:hD,70:dD,80:pD,90:fD,100:mD},vD="#fff1f1",yD="#ffd7d9",xD="#ffb3b8",bD="#ff8389",_D="#fa4d56",ED="#da1e28",TD="#a2191f",OD="#750e13",SD="#520408",wD="#2d0709",$D={10:vD,20:yD,30:xD,40:bD,50:_D,60:ED,70:TD,80:OD,90:SD,100:wD},MD="#fff0f7",CD="#ffd6e8",AD="#ffafd2",kD="#ff7eb6",LD="#ee5396",RD="#d02670",DD="#9f1853",ID="#740937",ND="#510224",PD="#2a0a18",UD={10:MD,20:CD,30:AD,40:kD,50:LD,60:RD,70:DD,80:ID,90:ND,100:PD},BD="#f6f2ff",HD="#e8daff",VD="#d4bbff",FD="#be95ff",GD="#a56eff",zD="#8a3ffc",jD="#6929c4",WD="#491d8b",qD="#31135e",YD="#1c0f30",ZD={10:BD,20:HD,30:VD,40:FD,50:GD,60:zD,70:jD,80:WD,90:qD,100:YD},XD="#edf5ff",KD="#d0e2ff",QD="#a6c8ff",JD="#78a9ff",tI="#4589ff",eI="#0f62fe",nI="#0043ce",rI="#002d9c",iI="#001d6c",sI="#001141",aI={10:XD,20:KD,30:QD,40:JD,50:tI,60:eI,70:nI,80:rI,90:iI,100:sI},oI="#e5f6ff",lI="#bae6ff",cI="#82cfff",uI="#33b1ff",hI="#1192e8",dI="#0072c3",pI="#00539a",fI="#003a6d",mI="#012749",gI="#061727",vI={10:oI,20:lI,30:cI,40:uI,50:hI,60:dI,70:pI,80:fI,90:mI,100:gI},yI="#d9fbfb",xI="#9ef0f0",bI="#3ddbd9",_I="#08bdba",EI="#009d9a",TI="#007d79",OI="#005d5d",SI="#004144",wI="#022b30",$I="#081a1c",MI={10:yI,20:xI,30:bI,40:_I,50:EI,60:TI,70:OI,80:SI,90:wI,100:$I},CI="#defbe6",AI="#a7f0ba",kI="#6fdc8c",LI="#42be65",RI="#24a148",DI="#198038",II="#0e6027",NI="#044317",PI="#022d0d",UI="#071908",BI={10:CI,20:AI,30:kI,40:LI,50:RI,60:DI,70:II,80:NI,90:PI,100:UI},HI="#f2f4f8",VI="#dde1e6",FI="#c1c7cd",GI="#a2a9b0",zI="#878d96",jI="#697077",WI="#4d5358",qI="#343a3f",YI="#21272a",ZI="#121619",XI={10:HI,20:VI,30:FI,40:GI,50:zI,60:jI,70:WI,80:qI,90:YI,100:ZI},KI="#f4f4f4",QI="#e0e0e0",JI="#c6c6c6",tN="#a8a8a8",eN="#8d8d8d",nN="#6f6f6f",rN="#525252",iN="#393939",sN="#262626",aN="#161616",oN={10:KI,20:QI,30:JI,40:tN,50:eN,60:nN,70:rN,80:iN,90:sN,100:aN},lN="#f7f3f2",cN="#e5e0df",uN="#cac5c4",hN="#ada8a8",dN="#8f8b8b",pN="#726e6e",fN="#565151",mN="#3c3838",gN="#272525",vN="#171414",yN={10:lN,20:cN,30:uN,40:hN,50:dN,60:pN,70:fN,80:mN,90:gN,100:vN},Tv={black:{100:qR},blue:aI,coolGray:XI,cyan:vI,gray:oN,green:BI,magenta:UD,orange:gD,purple:ZD,red:$D,teal:MI,warmGray:yN,white:{0:YR},yellow:sD};const xN=e=>{if(!e)return null;for(const t of Object.keys(Tv)){const n=Tv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Ov=function(e){const t=D(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=On(n);let i;if(r&&(i=xN(r?r.hex():null)),i==null){const s=sp(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let bN=0;class _N extends yt{constructor(){super(...arguments),this.type="treemap",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=N.getSVGElementSize(n,{useAttrs:!0}),l=ks({name:i.title||"Treemap",children:r}).sum(p=>p.value).sort((p,f)=>f.value-p.value),c=iL().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),p=>p.data.name);u.exit().attr("opacity",0).remove();const d=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>bN++).merge(u);d.attr("data-name","leaf").transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-group-update",animate:t})).attr("transform",p=>`translate(${p.x0},${p.y0})`);const h=d.selectAll("rect.leaf").data(p=>[p]);h.exit().attr("width",0).attr("height",0).remove(),h.enter().append("rect").classed("leaf",!0).merge(h).attr("width",0).attr("height",0).attr("id",function(){const p=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${p}`}).attr("class",p=>{for(;p.depth>1;)p=p.parent;return this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:p.data.name,originalClassName:"leaf"})}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"treemap-leaf-update-enter",animate:t})).attr("width",p=>p.x1-p.x0).attr("height",p=>p.y1-p.y0).style("fill",p=>{for(;p.depth>1;)p=p.parent;return this.model.getFillColor(p.data.name,null,p.data)}),d.selectAll("clipPath").data(p=>p.data.showLabel!==!0?[]:[1],p=>p).join(p=>p.append("clipPath").attr("id",function(){const f=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${f}`}).append("use").attr("xlink:href",function(){const f=D(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${f}`;return new URL(`#${v}`,s)+""}),p=>null,p=>p.remove()),d.selectAll("text").data(p=>{if(p.data.showLabel!==!0)return[];let f=p;for(;f.depth>1;)f=f.parent;return[{text:p.data.name,backgroundColor:this.model.getFillColor(f.data.name)}]},p=>p).join(p=>{const f=p.append("text").text(v=>v.text).style("fill",Ov).attr("x",7).attr("y",18);return s&&f.attr("clip-path",function(){const v=D(this.parentNode).attr("data-uid"),m=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${m}`,s)+""})`}),f},p=>p.text(f=>f.text).style("fill",Ov),p=>p.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),On(s).darker(.7).toString()}),t.services.events.dispatchEvent(S.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(S.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(S.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:i})})}}function EN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ON={value:function(){}};function Sv(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Po(n)}function Po(e){this._=e}function SN(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Po.prototype=Sv.prototype={constructor:Po,on:function(e,t){var n=this._,r=SN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=wN(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=wv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=wv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Po(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function wN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function wv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ON,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const $N=Object.freeze(Object.defineProperty({__proto__:null,dispatch:Sv},Symbol.toStringTag,{value:"Module"})),MN=TN($N),CN=MN.dispatch,Zu=Math.PI/180,AN={archimedean:Mv,rectangular:VN},Fs=64,Uo=2048;var kN=function(){var e=[256,256],t=LN,n=RN,r=DN,i=$v,s=$v,a=IN,o=NN,l=Mv,c=[],u=1/0,d=CN("word","end"),h=null,p=Math.random,f={},v=GN;f.canvas=function(g){return arguments.length?(v=tr(g),f):v},f.start=function(){var g=m(v()),b=FN((e[0]>>5)*e[1]),T=null,E=c.length,O=-1,A=[],I=c.map(function(R,$){return R.text=t.call(this,R,$),R.font=n.call(this,R,$),R.style=i.call(this,R,$),R.weight=s.call(this,R,$),R.rotate=a.call(this,R,$),R.size=~~r.call(this,R,$),R.padding=o.call(this,R,$),R}).sort(function(R,$){return $.size-R.size});return h&&clearInterval(h),h=setInterval(L,0),L(),f;function L(){for(var R=Date.now();Date.now()-R<u&&++O<E&&h;){var $=I[O];$.x=e[0]*(p()+.5)>>1,$.y=e[1]*(p()+.5)>>1,PN(g,$,I,O),$.hasText&&y(b,$,T)&&(A.push($),d.call("word",f,$),T?BN(T,$):T=[{x:$.x+$.x0,y:$.y+$.y0},{x:$.x+$.x1,y:$.y+$.y1}],$.x-=e[0]>>1,$.y-=e[1]>>1)}O>=E&&(f.stop(),d.call("end",f,A,T))}},f.stop=function(){h&&(clearInterval(h),h=null);for(const g of c)delete g.sprite;return f};function m(g){const b=g.getContext("2d",{willReadFrequently:!0});g.width=g.height=1;const T=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return g.width=(Fs<<5)/T,g.height=Uo/T,b.fillStyle=b.strokeStyle="red",{context:b,ratio:T}}function y(g,b,T){e[0],e[1];for(var E=b.x,O=b.y,A=Math.sqrt(e[0]*e[0]+e[1]*e[1]),I=l(e),L=p()<.5?1:-1,R=-L,$,F,P;($=I(R+=L))&&(F=~~$[0],P=~~$[1],!(Math.min(Math.abs(F),Math.abs(P))>=A));)if(b.x=E+F,b.y=O+P,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!T||HN(b,T))&&!UN(b,g,e[0])){for(var H=b.sprite,_=b.width>>5,C=e[0]>>5,k=b.x-(_<<4),U=k&127,B=32-U,X=b.y1-b.y0,Y=(b.y+b.y0)*C+(k>>5),ot,it=0;it<X;it++){ot=0;for(var bt=0;bt<=_;bt++)g[Y+bt]|=ot<<B|(bt<_?(ot=H[it*_+bt])>>>U:0);Y+=C}return!0}return!1}return f.timeInterval=function(g){return arguments.length?(u=g??1/0,f):u},f.words=function(g){return arguments.length?(c=g,f):c},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=tr(g),f):n},f.fontStyle=function(g){return arguments.length?(i=tr(g),f):i},f.fontWeight=function(g){return arguments.length?(s=tr(g),f):s},f.rotate=function(g){return arguments.length?(a=tr(g),f):a},f.text=function(g){return arguments.length?(t=tr(g),f):t},f.spiral=function(g){return arguments.length?(l=AN[g]||g,f):l},f.fontSize=function(g){return arguments.length?(r=tr(g),f):r},f.padding=function(g){return arguments.length?(o=tr(g),f):o},f.random=function(g){return arguments.length?(p=g,f):p},f.on=function(){var g=d.on.apply(d,arguments);return g===d?f:g},f};function LN(e){return e.text}function RN(){return"serif"}function $v(){return"normal"}function DN(e){return Math.sqrt(e.value)}function IN(){return(~~(random()*6)-3)*30}function NN(){return 1}function PN(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Fs<<5)/s,Uo/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;const $=i.measureText(t.text),F=-Math.floor($.width/2);let P=($.width+1)*s,H=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Zu),d=Math.cos(t.rotate*Zu),h=P*d,p=P*u,f=H*d,v=H*u;P=Math.max(Math.abs(h+v),Math.abs(h-v))+31>>5<<5,H=~~Math.max(Math.abs(p+f),Math.abs(p-f))}else P=P+31>>5<<5;if(H>l&&(l=H),a+P>=Fs<<5&&(a=0,o+=l,l=0),o+H>=Uo)break;i.translate((a+(P>>1))/s,(o+(H>>1))/s),t.rotate&&i.rotate(t.rotate*Zu),i.fillText(t.text,F,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,F,0)),i.restore(),t.width=P,t.height=H,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=H>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(Fs<<5)/s,Uo/s).data,y=[];--r>=0;)if(t=n[r],!!t.hasText){for(var g=t.width,b=g>>5,T=t.y1-t.y0,E=0;E<T*b;E++)y[E]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var O=0,A=-1,I=0;I<T;I++){for(var E=0;E<g;E++){var L=b*I+(E>>5),R=m[(o+I)*(Fs<<5)+(a+E)<<2]?1<<31-E%32:0;y[L]|=R,O|=R}O?A=I:(t.y0++,T--,I--,o++)}t.y1=t.y0+A,t.sprite=y.slice(0,(t.y1-t.y0)*b)}}}function UN(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function BN(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function HN(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Mv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function VN(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function FN(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function GN(){return document.createElement("canvas")}function tr(e){return typeof e=="function"?e:function(){return e}}const zN=EN(kN);class jN extends yt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=rt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(S.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(S.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=N.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=zN().size([u,d]).words(i.map(function(f){const v=f[o];if(typeof f[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:f[c],text:f[l],size:v,value:v}})).padding(5).rotate(0).fontSize(f=>s(f.size)).on("end",p);h.start();function p(f){const v=N.appendOrSelect(r,"g.words");v.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=v.selectAll("text").data(f,y=>`${y[c]}-${y.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=N.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Qe(i):[1,1];return en().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Fa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(S.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(S.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(S.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(S.Tooltip.HIDE,{hoveredElement:o})})}}class WN extends yt{constructor(){super(...arguments),this.type="geo",this.renderType=rt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=N.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=SR(s,Object.values(l)),u=ER(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=UA().projection(d);N.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=N.appendOrSelect(t,"defs");N.appendOrSelect(f,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Is()([[0,0],[0,10]]));const v=N.appendOrSelect(t,"g.missing-data");N.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case un.geoEqualEarth:t=rk();break;case un.geoAlbers:t=XA();break;case un.geoConicEqualArea:t=Eg();break;case un.geoConicEquidistant:t=ek();break;case un.geoEquirectangular:t=JA();break;case un.geoMercator:t=KA();break;case un.geoNaturalEarth1:t=ik();break;default:throw new Error("Projection is not supported.")}return t}}class qN extends WN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Br.HIDE,{event:r,hoveredElement:s})})}}function Xu(e){var t=e==null?0:e.length;return t?ha(e,1):[]}function YN(e){return Dh(Ph(e,void 0,Xu),e+"")}function Cv(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function ZN(e,t){return t.length<2?e:Rl(e,Cv(t,0,-1))}function XN(e,t){return t=ua(t,e),e=ZN(e,t),e==null||delete e[qi(Ld(t))]}function KN(e){return Xh(e)?void 0:e}var QN=1,JN=2,tP=4,eP=YN(function(e,t){var n={};if(e==null)return n;var r=!1;t=_l(t,function(s){return s=ua(s,e),r||(r=s.length>1),s}),zr(e,ad(e),n),r&&(n=Yi(n,QN|JN|tP,KN));for(var i=t.length;i--;)XN(n,t[i]);return n});function Av(e){return Math.log(e)}function kv(e){return Math.exp(e)}function nP(e){return-Math.log(-e)}function rP(e){return-Math.exp(-e)}function iP(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sP(e){return e===10?iP:e===Math.E?Math.exp:t=>Math.pow(e,t)}function aP(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Lv(e){return(t,n)=>-e(-t,n)}function oP(e){const t=e(Av,kv),n=t.domain;let r=10,i,s;function a(){return i=aP(r),s=sP(r),n()[0]<0?(i=Lv(i),s=Lv(s),e(nP,rP)):e(Av,kv),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),p=i(u),f,v;const m=o==null?10:+o;let y=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),c>0){for(;h<=p;++h)for(f=1;f<r;++f)if(v=h<0?f/s(-h):f*s(h),!(v<c)){if(v>u)break;y.push(v)}}else for(;h<=p;++h)for(f=r-1;f>=1;--f)if(v=h>0?f/s(-h):f*s(h),!(v<c)){if(v>u)break;y.push(v)}y.length*2<m&&(y=va(c,u,m))}else y=va(h,p,Math.min(p-h,m)).map(s);return d?y.reverse():y},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=as(l)).precision==null&&(l.trim=!0),l=pc(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(yf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Rv(){const e=oP(Ip()).domain([1,10]);return e.copy=()=>mc(e,Rv()).base(e.base()),ti.apply(e,arguments),e}function Bo(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ho(e){this._context=e}Ho.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lP(e){return new Ho(e)}function Dv(e){this._context=e}Dv.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cP(e){return new Dv(e)}function Iv(e){this._context=e}Iv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uP(e){return new Iv(e)}function Nv(e,t){this._basis=new Ho(e),this._beta=t}Nv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const hP=function e(t){function n(r){return t===1?new Ho(r):new Nv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Vo(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Vo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const dP=function e(t){function n(r){return new Ku(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Qu(e,t){this._context=e,this._k=(1-t)/6}Qu.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const pP=function e(t){function n(r){return new Qu(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ju(e,t){this._context=e,this._k=(1-t)/6}Ju.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const fP=function e(t){function n(r){return new Ju(r,t)}return n.tension=function(r){return e(+r)},n}(0);function th(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>de){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>de){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function Pv(e,t){this._context=e,this._alpha=t}Pv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:th(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const mP=function e(t){function n(r){return t?new Pv(r,t):new Ku(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Uv(e,t){this._context=e,this._alpha=t}Uv.prototype={areaStart:Xn,areaEnd:Xn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:th(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const gP=function e(t){function n(r){return t?new Uv(r,t):new Qu(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Bv(e,t){this._context=e,this._alpha=t}Bv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:th(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const vP=function e(t){function n(r){return t?new Bv(r,t):new Ju(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Hv(e){return e<0?-1:1}function Vv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(Hv(s)+Hv(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Fv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eh(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function Fo(e){this._context=e}Fo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eh(this,this._t0,Fv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,eh(this,Fv(this,n=Vv(this,e,t)),n);break;default:eh(this,this._t0,n=Vv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Gv(e){this._context=new zv(e)}(Gv.prototype=Object.create(Fo.prototype)).point=function(e,t){Fo.prototype.point.call(this,t,e)};function zv(e){this._context=e}zv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function yP(e){return new Fo(e)}function xP(e){return new Gv(e)}function jv(e){this._context=e}jv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Wv(e),i=Wv(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Wv(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function bP(e){return new jv(e)}function Go(e,t){this._context=e,this._t=t}Go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function _P(e){return new Go(e,.5)}function EP(e){return new Go(e,0)}function TP(e){return new Go(e,1)}class OP extends Nn{zoomIn(t,n,r){let i,s,a;const o=r||ni;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=N.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||ni;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT)}}class SP extends Nn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class wP extends Nn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class $P extends Nn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(S.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(Fp,n,"duration")||Fp.default.duration)}getPendingTransitions(){return this.pendingTransitions}}function Gs(e,t){const n=+Yt(e)-+Yt(t);return n<0?-1:n>0?1:n}function MP(e,t,n){const[r,i]=cr(void 0,e,t);return r.getFullYear()-i.getFullYear()}function CP(e,t,n){const[r,i]=cr(void 0,e,t),s=Gs(r,i),a=Math.abs(MP(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Gs(r,i)===-s,l=s*(a-+o);return l===0?0:l}function nh(e,t,n){const r=Yt(e,void 0);if(isNaN(t))return Be(e,NaN);if(!t)return r;const i=r.getDate(),s=Be(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function qv(e,t,n){return nh(e,t*12)}function AP(e,t,n){return qv(e,-t)}function kP(e,t,n){const[r,i]=cr(void 0,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function LP(e,t){const n=Yt(e,void 0);return n.setHours(23,59,59,999),n}function RP(e,t){const n=Yt(e,void 0),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function DP(e,t){const n=Yt(e,void 0);return+LP(n)==+RP(n)}function IP(e,t,n){const[r,i,s]=cr(void 0,e,e,t),a=Gs(i,s),o=Math.abs(kP(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Gs(i,s)===-a;DP(r)&&o===1&&Gs(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function NP(e,t,n){return nh(e,-t)}function PP(e,t,n){const[r,i]=cr(void 0,e,t),s=Yv(r,i),a=Math.abs(tf(r,i));r.setDate(r.getDate()-s*a);const o=+(Yv(r,i)===-s),l=s*(a-o);return l===0?0:l}function Yv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Zv(e,t,n){const r=Yt(e,void 0);return isNaN(t)?Be(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function UP(e,t,n){return Zv(e,-t)}function rh(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function BP(e,t,n){const[r,i]=cr(void 0,e,t),s=(+r-+i)/Eh;return rh(void 0)(s)}function Xv(e,t,n){return Be(e,+Yt(e)+t)}function Kv(e,t,n){return Xv(e,t*Eh)}function HP(e,t,n){return Kv(e,-t)}function Qv(e,t){return+Yt(e)-+Yt(t)}function Jv(e,t,n){const r=Qv(e,t)/_h;return rh(void 0)(r)}function ih(e,t,n){const r=Yt(e,void 0);return r.setTime(r.getTime()+t*_h),r}function t0(e,t,n){return ih(e,-t)}function e0(e,t,n){const r=Qv(e,t)/1e3;return rh(void 0)(r)}function sh(e,t,n){return Xv(e,t*1e3)}function n0(e,t,n){return sh(e,-t)}class VP extends Nn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===G.BOTTOM||t===G.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(G).map(t=>G[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Qt.VERTICAL:this.orientation=Qt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[G.LEFT])!=null&&t.correspondingDatasets&&a[G.RIGHT]||(n=a[G.RIGHT])!=null&&n.correspondingDatasets&&a[G.LEFT]||(r=a[G.TOP])!=null&&r.correspondingDatasets&&a[G.BOTTOM]||(i=a[G.BOTTOM])!=null&&i.correspondingDatasets&&a[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===tt.LINEAR||this.scaleTypes[t]===tt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case tt.LABELS:c=t(l)+t.step()/2;break;case tt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===tt.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return FP(n,s)}else return GP(n,qn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,G.LEFT)===null&&x(n,G.RIGHT)!==null||x(n,G.RIGHT,"main")===!0||r&&x(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,G.BOTTOM)===null&&x(n,G.TOP)!==null||x(n,G.TOP,"main")===!0||r&&x(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||tt.LINEAR,o=s.scaleType||tt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===tt.LABELS||o===tt.TIME)&&a===tt.LABELS||a===tt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||tt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:y}=this.model.getBinConfigurations();return[0,gr(y,g=>g.length)]}else if(r.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),g=this.model.getStackKeys({bins:y});return[g[0].split(":")[0],g[g.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:p}=qn.ratio;if(r.domain)return a===tt.LABELS?r.domain:(a===tt.TIME&&(r.domain=r.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===tt.LABELS)return Xi(o.map(y=>y[c]));let f,v;const m=this.model.getDataGroupNames();if(a===tt.LABELS_RATIO)return o.map(y=>`${y[h]}/${y[p]}`);if(a===tt.TIME)v=o.map(y=>+new Date(y[c]));else if(i&&n.axes)v=[],o.forEach(y=>{v.push(y[c]),y[i.upperBoundMapsTo]&&v.push(y[i.upperBoundMapsTo]),y[i.lowerBoundMapsTo]&&v.push(y[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,g=this.model.getDataValuesGroupedByKeys({groups:m}),b=o.filter(E=>!m.includes(E[y])),T=[];g.forEach(E=>{const{...O}=E;let A=0,I=0;Object.values(eP(O,"sharedStackKey")).forEach(L=>{isNaN(L)||(L<0?I+=L:A+=L)}),T.push([I,A])}),v=[...Xu(T),...b.map(E=>E[c])]}else v=[],o.forEach(y=>{const g=y[c];Array.isArray(g)&&g.length===2?(v.push(g[0]),v.push(g[1])):(l&&v.push(Math.max(y[c],y[l])),v.push(g))});return a!==tt.TIME&&a!==tt.LOG&&s&&v.push(0),d&&d.length>0&&d.forEach(y=>{const g=x(y,"value");g!==null&&v.push(g)}),f=Qe(v),f=this.extendsDomain(t,f),f}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||tt.LINEAR;this.scaleTypes[t]=i;let s;return i===tt.TIME?s=Pf():i===tt.LOG?s=Rv().base(r.base||10):i===tt.LABELS||i===tt.LABELS_RATIO?s=ps():s=en(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Qt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),x(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===tt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function FP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return CP(r,n)>1?[AP(n,t),qv(r,t)]:IP(r,n)>1?[NP(n,t),nh(r,t)]:PP(r,n)>1?[UP(n,t),Zv(r,t)]:BP(r,n)>1?[HP(n,t),Kv(r,t)]:Jv(r,n)>30?[t0(n,t*30),ih(r,t*30)]:Jv(r,n)>1?[t0(n,t),ih(r,t)]:e0(r,n)>15?[n0(n,t*15),sh(r,t*15)]:e0(r,n)>1?[n0(n,t),sh(r,t)]:[n,r]}function GP([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===tt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}class zP extends Nn{constructor(){super(...arguments),this.curveTypes={curveLinear:Za,curveLinearClosed:Ff,curveBasis:lP,curveBasisClosed:cP,curveBasisOpen:uP,curveBundle:hP,curveCardinal:dP,curveCardinalClosed:pP,curveCardinalOpen:fP,curveCatmullRom:mP,curveCatmullRomClosed:gP,curveCatmullRomOpen:vP,curveMonotoneX:yP,curveMonotoneY:xP,curveNatural:bP,curveStep:_P,curveStepAfter:TP,curveStepBefore:EP}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class jP extends Nn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===tt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=x(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Qe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(S.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=ke.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let d=a+u,h=o-u;d>=h&&(d=a+c/2-i/2,h=o-c/2+i/2);const p=[s.invert(d),s.invert(h)];(r[0].valueOf()!==p[0].valueOf()||r[1].valueOf()!==p[1].valueOf())&&this.handleDomainChange(p)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=x(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}}function WP(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Cv(e,t,n)}var qP="\\ud800-\\udfff",YP="\\u0300-\\u036f",ZP="\\ufe20-\\ufe2f",XP="\\u20d0-\\u20ff",KP=YP+ZP+XP,QP="\\ufe0e\\ufe0f",JP="\\u200d",t3=RegExp("["+JP+qP+KP+QP+"]");function r0(e){return t3.test(e)}function e3(e){return e.split("")}var i0="\\ud800-\\udfff",n3="\\u0300-\\u036f",r3="\\ufe20-\\ufe2f",i3="\\u20d0-\\u20ff",s3=n3+r3+i3,a3="\\ufe0e\\ufe0f",o3="["+i0+"]",ah="["+s3+"]",oh="\\ud83c[\\udffb-\\udfff]",l3="(?:"+ah+"|"+oh+")",s0="[^"+i0+"]",a0="(?:\\ud83c[\\udde6-\\uddff]){2}",o0="[\\ud800-\\udbff][\\udc00-\\udfff]",c3="\\u200d",l0=l3+"?",c0="["+a3+"]?",u3="(?:"+c3+"(?:"+[s0,a0,o0].join("|")+")"+c0+l0+")*",h3=c0+l0+u3,d3="(?:"+[s0+ah+"?",ah,a0,o0,o3].join("|")+")",p3=RegExp(oh+"(?="+oh+")|"+d3+h3,"g");function f3(e){return e.match(p3)||[]}function m3(e){return r0(e)?f3(e):e3(e)}function g3(e){return function(t){t=Wi(t);var n=r0(t)?m3(t):void 0,r=n?n[0]:t.charAt(0),i=n?WP(n,1).join(""):t.slice(1);return r[e]()+i}}var v3=g3("toUpperCase");function y3(e){return v3(Wi(e).toLowerCase())}var x3=Em(function(e,t,n){return t=t.toLowerCase(),e+(n?y3(t):t)});class an{constructor(t,n){this.components=[],this.services={canvasZoom:OP,domUtils:N,events:SP,files:wP,gradientUtils:zc,transitions:$P},this.model=new fn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(S.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(S.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(S.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new Hu(this.model,this.services)],growth:ht.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new GL(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},c={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},u={id:"header",components:[new Ie(this.model,this.services,[l,...i?[c]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},d={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:x(n,"graphFrameRenderType")||rt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let p=It.COLUMN;if(h){const y=x(r,"legend","position");y==="left"?(p=It.ROW,r.legend.orientation||(r.legend.orientation=Fr.VERTICAL)):y==="right"?(p=It.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Fr.VERTICAL)):y==="bottom"&&(p=It.COLUMN_REVERSE)}const f={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},v={id:"full-frame",components:[new Ie(this.model,this.services,[...h?[s]:[],...h?[f]:[],d],{direction:p})],growth:ht.STRETCH},m=[];if(o||i){m.push(u);const y={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};m.push(y)}return m.push(v),[new Vu(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,m,{direction:It.COLUMN})]}}class we extends an{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:VP,curves:zP,zoom:jP}),this.model=new Or(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",G.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===G.BOTTOM&&o===tt.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},h={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},p={id:"header",components:[new Ie(this.model,this.services,[d,...s?[h]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},f={id:"legend",components:[new Hu(this.model,this.services)],growth:ht.PREFERRED};l&&!c&&t.push(new Kg(this.model,this.services),new zL(this.model,this.services)),t.push(new WL(this.model,this.services)),t.push(new qL(this.model,this.services));const v={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},m=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=It.COLUMN;if(m){const O=x(this.model.getOptions(),"legend","position");O===Vr.LEFT?(y=It.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Fr.VERTICAL)):O===Vr.RIGHT?(y=It.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Fr.VERTICAL)):O===Vr.BOTTOM&&(y=It.COLUMN_REVERSE)}const g={id:"spacer",components:[new Hn(this.model,this.services)],growth:ht.PREFERRED},b={id:"full-frame",components:[new Ie(this.model,this.services,[...m?[f]:[],...m?[g]:[],v],{direction:y})],growth:ht.STRETCH},T={id:"zoom-bar",components:[new jL(this.model,this.services)],growth:ht.PREFERRED,renderType:rt.SVG},E=[];if(u||s){E.push(p);const O={id:"spacer",components:[new Hn(this.model,this.services,s?{size:15}:void 0)],growth:ht.PREFERRED};E.push(O)}return l&&E.push(T),E.push(b),[new ev(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,E,{direction:It.COLUMN})]}}class b3 extends an{constructor(t,n){super(t,n),this.model=new o$(this.services),this.model.setOptions(zt(Nt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new pR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class _3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Tn(Nt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new Ei(this.model,this.services),new uv(this.model,this.services),new xn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class E3 extends we{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(zt(Nt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new gR(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class T3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new vR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class O3 extends we{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(zt(Nt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class S3 extends an{constructor(t,n){super(t,n),this.model=new u$(this.services),this.model.setOptions(zt(Nt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[a,...i?[o]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new fv(this.model,this.services,{chartType:"choropleth"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=It.COLUMN_REVERSE,p={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new Vu(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,v,{direction:It.COLUMN})]}getComponents(){const t=[new qN(this.model,this.services)];return this.getChartComponents(t)}}class w3 extends an{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(zt(Nt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new NR(this.model,this.services)];return this.getChartComponents(t)}}const u0={[Me.LINE]:[Ei,xn],[Me.SCATTER]:[xn],[Me.AREA]:[uv,Ei,xn],[Me.STACKED_AREA]:[bv,Ei,Ev,No],[Me.SIMPLE_BAR]:[xv],[Me.GROUPED_BAR]:[yv,Ti],[Me.STACKED_BAR]:[_v,No]};class $3 extends we{constructor(t,n){super(t,n);const r=zt(Nt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Me.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(u0).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${x3(i.type)}Chart`;return a=ct({},Nt[l],this.model.getOptions(),i.options),i.type===Me.STACKED_AREA&&(o=!0),u0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Xu(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Me.STACKED_BAR||i.type===Me.STACKED_AREA),r=[new Se(this.model,this.services),new Ne(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID}),...n?[]:[new Jn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class h0 extends an{constructor(t,n,r=!1){super(t,n),this.model=new d$(this.services),!r&&(this.model.setOptions(zt(Nt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new mv(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}class M3 extends h0{constructor(t,n){super(t,n,!0),this.model.setOptions(zt(Nt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new UR(this.model,this.services),new xe(this.model,this.services,{skeleton:te.DONUT})];return this.getChartComponents(t)}}class C3 extends an{constructor(t,n){super(t,n),this.model=new p$(this.services),this.model.setOptions(zt(Nt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new BR(this.model,this.services)];return this.getChartComponents(t)}}class A3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new yv(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class k3 extends we{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(zt(Nt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Vs(this.model,this.services)],growth:ht.STRETCH},o={id:"toolbar",components:[new ko(this.model,this.services)],growth:ht.PREFERRED},l={id:"header",components:[new Ie(this.model,this.services,[a,...i?[o]:[]],{direction:It.ROW,alignItems:or.CENTER})],growth:ht.PREFERRED},c={id:"legend",components:[new fv(this.model,this.services,{chartType:"heatmap"})],growth:ht.PREFERRED,renderType:rt.SVG},u={id:"graph-frame",components:t,growth:ht.STRETCH,renderType:rt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=It.COLUMN_REVERSE,p={id:"spacer",components:[new Hn(this.model,this.services,{size:15})],growth:ht.PREFERRED},f={id:"full-frame",components:[new Ie(this.model,this.services,[...d?[c]:[],...d?[p]:[],u],{direction:h})],growth:ht.STRETCH},v=[];if(s||i){v.push(l);const m={id:"spacer",components:[new Hn(this.model,this.services,i?{size:15}:void 0)],growth:ht.PREFERRED};v.push(m)}return v.push(f),[new ev(this.model,this.services),new Lo(this.model,this.services),new Ie(this.model,this.services,v,{direction:It.COLUMN})]}getComponents(){const t=[new Se(this.model,this.services),new HR(this.model,this.services)];return this.getAxisChartComponents(t)}}class L3 extends we{constructor(t,n){super(t,n),this.model=new m$(this.services),this.model.setOptions(zt(Nt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new $R(this.model,this.services),new VR(this.model,this.services)];return this.getAxisChartComponents(t)}}class R3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new Ei(this.model,this.services),new xn(this.model,this.services,{handleThresholds:!0}),new jR(this.model,this.services),new Ti(this.model,this.services)];return this.getAxisChartComponents(t)}}class D3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new FR(this.model,this.services),new xn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class I3 extends an{constructor(t,n){var r;super(t,n),this.model=new g$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?ct(Tn(Nt.proportionalMeterChart),n.options):ct(Tn(Nt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new IR(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG},{id:"spacer",components:[new Hn(this.model,this.services,{size:8})],growth:ht.STRETCH}]:[],{id:"meter-graph",components:[new GR(this.model,this.services)],growth:ht.STRETCH,renderType:rt.SVG}],n=[new Ie(this.model,this.services,t,{direction:It.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:rt.HTML})}}class N3 extends an{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(zt(Nt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new zR(this.model,this.services)];return this.getChartComponents(t)}}class P3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new Jn(this.model,this.services),new xn(this.model,this.services),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class U3 extends an{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(zt(Nt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new WR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class B3 extends an{constructor(t,n){super(t,n),this.model=new x$(this.services),this.model.setOptions(zt(Nt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new _N(this.model,this.services)];return this.getChartComponents(t)}}class H3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new xv(this.model,this.services),new Ti(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class V3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new No(this.model,this.services),new bv(this.model,this.services),new Ei(this.model,this.services,{stacked:!0}),new Ev(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new xe(this.model,this.services,{skeleton:te.GRID})];return this.getAxisChartComponents(t)}}class F3 extends we{constructor(t,n){super(t,n),this.model.setOptions(zt(Nt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new Se(this.model,this.services),new Ne(this.model,this.services),new No(this.model,this.services),new _v(this.model,this.services),new xe(this.model,this.services,{skeleton:te.VERT_OR_HORIZ}),new Ti(this.model,this.services)];return this.getAxisChartComponents(t)}}class G3 extends an{constructor(t,n){super(t,n),this.model=new b$(this.services),this.model.setOptions(zt(Nt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new jN(this.model,this.services),new xe(this.model,this.services,{skeleton:te.PIE})];return this.getChartComponents(t)}}function z3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},zs={};/**
|
|
74
74
|
* @license React
|
|
75
75
|
* react-jsx-runtime.production.min.js
|
|
76
76
|
*
|